Jointly Optimize the Residual Energy of Multiple Mobile Devices in the MEC–WPT System

: With the rapid popularity of mobile devices (MDs), mobile edge computing (MEC) networks and wireless power transmission (WPT) will receive more attention. Naturally, by integrating these two technologies, the inherent energy consumption during task execution can be effectively reduced, and the collected energy can be provided to charge the MD. In this article, our research focuses on extending the battery time of MDs by maximizing the harvested energy and minimizing the consumed energy in the MEC–WPT system, which is formulated as a residual energy maximization problem and also a non-convex optimization problem. On the basis of study on maximizing the residual energy under multi-users and multi-time blocks, we propose an effective jointly optimization method (i.e., jointly optimize the energy harvesting time, task-ofﬂoading time, task-ofﬂoading size and the MDs’ CPU frequency), which combines the convex optimization method and the augmented Lagrangian to solve the residual energy maximum problem. We leverage Time Division Multiple Access (TMDA) mode to coordinate computation ofﬂoading. Simulation results show that our scheme has better performance than the benchmark schemes on maximizing residual energy. In particular, our proposed scheme is outstanding in the failure rate of multiple MDs and can adapt to the task size to minimize the failure rate.


Introduction
With the explosive development of the mobile devices and mobile communication, mobile devices (MDs) are becoming more and more widely used, the novel mobile applications emerge continuously. These emerging latency-sensitive applications rely heavily on real-time communication and computation of wireless devices [1]. However, most MDs have low computing capability and finite battery capacity, and cannot meet the massive demand for physical resources of current applications, which will be a crucial and breakthrough challenge. To resolve this issue, mobile edge computing (MEC) has emerged as a promising technique by providing cloud-like computing at the edge of mobile networks via integrated MEC servers at wireless access points (APs) [2]. Leveraging MEC, MDs with limited resources can offload their computation tasks to APs, and remotely compute and offload tasks on the MEC server. Generally, there are two different methods for computation, namely binary offloading and partial offloading. When using binary offloading, the division of tasks is not allowed. The entire task is required to be executed locally on the MD or remotely on the edge server. As for partial offloading, the task can be divided into two parts, one part is executed locally and the other part is executed on the edge server [3]. Meanwhile, because MEC technology can promote low-power devices to perform computing tasks in real-time, and MEC technology has attracted growing research interests in both academia and industry.
In addition to improving the computation capability and reducing power consumption of MDs, another challenge is how to provide a sustainable and cost-effective energy supply to massive computation-heavy MDs is another challenge. The development of radio frequency (RF)-based wireless power transmission (WPT) technology brings a new solution to solve the problem of insufficient battery energy [4]. It was shown that user quality of experience (QoE) can be improved by integrating wireless powered techniques into MEC networks since the duration of having MEC services is extended [5]. By integrating WPT with the AP, the dedicated energy transmitter can be deployed to spread energy wirelessly to continuously power the battery of remote energy harvesting (EH) devices [6]. Deploying multiple antennas on the energy transmitter can be used for multiple devices at the same time, which helps to improve the efficiency of WPT, thereby it can satisfy more MDs' energy supply requests.
In this article, we study the integration of WPT into MEC where multiple MDs collect energy in each time block and perform computationally intensive tasks simultaneously on edge servers and local devices. The key contributions of this article are as follows.
(1) We adopting the case of multiple MDs, leveraging multiple antennas on the AP to perform energy transmission and charging multiple MDs at the same time so that each MD completes the corresponding computing task based on the harvested energy. Using partial offloading, each MD arbitrarily divides the computing task into two independent parts, which are used for local computing and task offloading. In addition, our proposed scheme uses Time Division Multiple Access (TDMA) protocol to coordinate computation offloading, where different users offload their respective tasks to the AP over orthogonal time slots. (2) In the integrated system, we focus on the joint optimization of the communication and computing resources of the partial computation offloading system. Taking the multi-period execution tasks of MDs into account, we achieve the goal of maximizing the remaining energy under multiple MDs and multi-slots, which requires maximizing energy harvesting and minimizing energy consumption. Therefore, we jointly optimize the task offloading size, task offloading time, energy harvesting time and CPU frequency of the MDs. (3) We established the system model and formalized the residual energy maximum problem. The best solution was obtained by proposing effective convex optimization methods and the augmented Lagrangian method. The simulation results show that the proposed joint optimizing scheme outperforms the previous ones in the partial computation offloading system, and the proposed algorithm is proven to be more efficient.
The remainder of the article is organized as follows. The related work is introduced in Section 2. In Section 3, we describe the WPT and MEC integrated system model in details. Section 4 gives the formulation and analysis of the problem. In Section 5, we provide the implemented algorithm. We give and discuss the experimental results in Section 6. Finally, we conclude the results in this article.

Related Work
In recent years, with the development of mobile edge computing and mobile cloud computing, computation offloading attracts more attention. The development of computational offloading can effectively improve the energy efficiency and task processing rate of MDs. Reducing the power consumption of MDs and increasing the working hours of the battery is a great concern to users. In previous studies, it was proved that offloading to the cloud can save energy for MDs and extend battery standby time [7], and refs. [8][9][10] proposed different computation offloading frameworks. Therefore, there are two basic computing task offloading models in MEC, namely binary offloading and partial offloading [3]. The combination of MEC networks promotes the execution of a large number of computing tasks on low-power devices, arousing the great attention of the resource management of computing offloading in the academic community [11]. Specifically, the multi-user mobile-edge computation offloading (MECO) system is studied in [12,13], and in [12], the mobile device delay minimization resource allocation of the MECO system under multiple access is mainly considered. In [14], the resource allocation in the asynchronous MECO system with heterogeneous input data arrival time and calculation deadline is studied. Of course, there are also related researches on resource scheduling strategies on edge servers. In [15], a two-level cooperative resource allocation mechanism is proposed, which provides formal guarantees regarding resource allocation and QoS specifications at the lower level, and a way to solve the problem of edge server workload balancing at the upper level.
Computation offloading can effectively improve the task processing capabilities of MDs, which largely depends on the quality of communication because data transmission is essential. Combining previous research, we conclude that through the joint optimization of communication and computing resources [16], the obtainable is significantly better than the single optimization method, which prompts us to focus on joint optimization. Leveraging Augmented Reality (AR) property in [17], different user applications share part of the computational tasks and of the input and output data, to reduce communication and computing overhead via the joint optimization of communication resources and computing resources. In [18], a joint optimization of the transmission power, the number of bits per symbol and the CPU cycles assigned to each application was proposed to minimize the power consumption of the mobile terminal. Wang et al. considered the joint optimization of communication, computational offloading, resource allocation and content caching, and transformed the original problem to the convex problem [19]. The distributed convex optimization method and the algorithm based on the Alternating Direction Multiplier Method (ADMM) are used to solve the optimization problem. In [20], the (TDMA) communication protocol is adopted, which jointly optimizes task allocation, time and power allocation, combined with the performance limitations of local and MEC edge servers to minimize the computation delay of local users. This is a mixed-integer nonlinear program (MINLP), which is relaxed to a convex problem and is solved by a sub-optimal solution based on the relaxed convex problem. The authors in [21] proposed a multi-layer data stream processing system, where the cloud server is in the top layer, the mobile edge computing server is in the middle layer and the edge devices are at the bottom layer, and the system offloads tasks and computing resources through multi-layer processing. However, the above methods are only expected to reduce energy consumption to achieve the goal of energy saving. Therefore, some studies propose the idea of combining WPT technology to charge MDs [22]. They apply energy harvesting to computation offloading and local computing to reduce energy consumption while effectively helping MDs to charge. The above methods are similar to ours, but we propose the joint optimization method to minimize system delay in a multi-layer system.
Combined with the latest research findings, researchers began to focus on the close integration of WPT and MEC [23][24][25][26]. The wireless multi-user MEC system composed of multi-antenna AP and multiple single-antenna users is studied, the downlink WPT and uplink wireless communication (used to computation offloading) are performed simultaneously on orthogonal frequency bands. Through joint optimization of task-offloading time, AP energy transmission beam formation, task-offloading size and CPU frequency, while taking into account the constraints on task completion time and user energy harvesting, the convex optimization problem is obtained. By leveraging the state-of-the-art optimization techniques, the optimal solution to minimizing the overall energy consumption of the AP is obtained in a semi-closed form [22]. In [27], it is emphasized the MEC-WPT system of two mobile devices, and the two devices are at a far point and a near point, respectively. Fully considering the dual near-far effects of the distant mobile devices, the closer mobile devices cooperate in the form of the relay to perform offloading, and then according to the constraints of task-offloading to minimize the total AP emission energy. Finally, an effective problem form is obtained, and the two-stage method is used to solve the problem to get the best solution. The MEC system using multiple MDs and combined with WPT technology is studied, considering the goal of maximizing the remaining energy of MDs while ensuring more efficient energy collection efficiency and lower energy consumption. In the process of computation task and energy harvesting, the parameters are jointly optimized to maximize the remaining energy of the system and propose corresponding solutions to obtain the best solution [28]. The authors in [13,29] extended the energy consumption minimization problems into multi-user MEC networks with TDMA and orthogonal frequency-division multiple access, respectively. Energy-efficient TDMA and non-orthogonal multiple access (NOMA) using partial offloading and binary offloading are studied in the wireless-powered MEC networks [30].
Regarding the previous research, most of the research focused on reducing energy consumption, which is a way of thinking for service providers rather than users. Only a few studies think about problems from the user's point of view, studying the remaining energy of MDs to ensure the user's service quality. Among them, most papers consider only one user in a time block is studied, but not the multi-user situation. The purpose of this article was to maximize the remaining energy in multiple time slots by studying multiple MDs in the case of time-division multiplexing and to ensure that the overall energy consumption is the minimum and the residual energy is the maximum.

System Model
This article considers a wireless powered multi-user MEC system, which consists of an multi-antenna AP and a set M {1, ..., M} of single-antenna MDs. The AP is directly integrated in the MEC server and has N {1, ..., N} time slots. The AP not only receives task data and transmits the data to the edge server, but also powers MDs through WPT. MDs can offload and execute computation tasks, and harvest energy from APs. However, since the MD is a single antenna, the MD cannot offload tasks and harvest energy at the same time. The system model is shown in Figure 1. Taking the communication requirements of MDs during task offloading into account, we adopt a slot-based time division multiplexing (TDMA) model. We assume that the length of each time block is T and the channel remains static in one time block but changes between blocks. The MD collects energy at the beginning of each time block and then offloads the computing task to the edge server during the remaining time. The computing task is divided into two parts and executed on the local and edge servers, respectively. As for the local computation part, the execution starts at the beginning and will not stop until use up the whole time block. In order to understand the AP's energy transmission and computing offloading better, we assume that the AP has perfect knowledge of the channels from AP to MDs and the computation requirement for each task, and it can coordinate the task partition, computation offloading and local computing by jointly allocating both communication and computation resources. The parameters are given in Table 1.

Parameters Notation
The input bit of the task The number of cycles for one bie C j The effective capacitance coefficient

Local Computing Model
For the task, R i,j and R o f f i,j denote the input bit and offload bit of the tasks, respectively. j ∈ M, i ∈ N. As for the local computing, the size of the local computing data on the j-th MD after knowing the task size and offloading size is We can get the local computing energy consumption as: where P i,j = κ j f 2 i,j is the energy consumption per cycle, C j denotes the cycles required to process one bit input, which depends on the task characteristic, κ j is the effective capacitance coefficient, depending on the MD chip architecture of user j, f i,j denotes the frequency of the CPU of the j-th MD in i-th time slot, and is constrained by f i,j ∈ (0, f max j ). According to the CPU frequency, we can get the time consumed by the local computation as: After obtaining the time consumed by the local computation, according to the previous assumption, we use (2) as a constraint to perform the computation task on the MD. The user cannot stand for waiting for a long time, so the time limit of the local computation should be within the time block. Thus, we assume that T loc i,j ≤ T.

Task-Offloading Model
Considering that energy harvesting and task offloading are performed by multiple MDs in a time block, we use the TDMA protocol, which is shown in Figure 2. In Figure 2, t0 represents the energy harvesting time of all MDs in the time block. Multiple MDs parallel the energy harvesting, so the energy harvesting time of each MD in the same time slice is equal. t1 denotes the task-offloading time of all MDs in the time block, and there is no requirement that t0 and t1 must be equal. Here, we suppose that if there is a multi-core CPU perfect well on the edge server, the execution time of the computing task offloaded to the edge server can be ignored. Compared with the size of the offloading task, the size of the computation result is usually much smaller than the offloaded task and can be downloaded directly by the MD, so we also ignore the download time. According to the above assumptions, we can clearly know that the task-offloading model is mainly about offloading communication.
From the Shannon formula in communication knowledge, we know that the transmission speed of offloading is: where h m i,j represents the channel gain from MD j to AP, which is a constant during the offload duration, p m i,j represents the transmission power from MD j to the AP, N 0 represents the noise power from device j to the AP, d i,j indicates the distance between device j and AP. R o f f i,j is the offloading data size, ). Note that to avoid the problem of division by zero, we define f ( In addition, a constant circuit power p m,j (such as digital-to-analog converter (DAC), filter, etc.) is consumed. We can get the communication energy consumption of the task offload model: We consider that the computing power of the MEC server is limited and can help us obtain more realistic results. We suppose F represents the maximum computing power of the MEC server in each time block. Here we use the maximum number of CPU cycles in a time block to represent: This constraint ensures that the computing delay of the edge server is negligible.

Energy Harvesting Model
The multi-antenna AP in the multi-user MEC system can use the energy beamforming to transfer power to the MD through WPT technology, and the single antenna of the MD can receive the energy transmitted by the AP to charge its battery. Although the current energy harvesting technology is not very mature, we consider the relatively sufficient battery power. Therefore, we assume that MDs have sufficient battery capacity to store harvested energy. Then the energy collected by the MD during energy harvesting is: where 0 < υ j < 1 represents energy conversion efficiency, h a i,j represents the channel gain of the downlink channel from the AP to the j-th MD and is a constant during the harvest time, p a i,j represents the AP transmission power, t har i represents the energy harvesting time of the MD in the i-th time block and the energy harvesting time of the MDs in this time block is equal. According to our model, the MD harvests energy first, and then offloads the task during the rest of the block to meet the time constraint of time T in each time block. In our system, multiple MDs perform energy harvesting and task-offloading in each time block. Therefore, the energy harvesting time and task-offloading time must meet the following constraints: The above are the three aspects of the system model for which we have carried out a detailed description and explanation.

Formalization of the Problem
The goal of this article was to maximize the residual energy of multiple MDs in multiple time blocks, which requires to maximize the harvested energy and minimize the consumed energy at the same time. The amount of harvest energy is directly proportional to the energy harvest time t har i , larger t har i will surely harvest more energy but also minimize the maximum available time for task offloading, which brings high energy consumption and the risk of violating time constraints. With each given t har i , we should coordinate the task-offloading size R o f f i,j , the task-offloading time t o f f i,j and the CPU frequency of local execution to minimize the energy consumption. In short, in order to maximize the residual energy of MDs, we need to jointly optimize the energy harvesting time, task-offloading size, task-offloading time and CPU frequency to find the optimal combination. The following is the formulation to describe the residual energy maximization problem under multiple MDs and multiple time slots.

Problem Formulation
According to the proposed model, the residual energy of each MD in any time block is expressed as a function as: where the E i,j , E o f f i,j , E loc i,j are given by (6), (4) and (1), respectively.
Therefore, the problem of maximizing residual energy in multi-user and multi-time slots can be expressed as: In order to simplify the formula, we define f (i, j) = υ j p a i,j h a i,j , then the complete expression of: In P1, C1 and C3 respectively represent the time constraints of local computation and edge offloading, the total time of offloading time and energy harvesting time cannot be greater than each time block T, and local computation can use the entire time block T. C2 is the CPU frequency constraint of each MD, and C4 is the computing power constraint of the edge server. C5, C6 and C7 give the optimization variable range of the problem.

Problem Analysis
Problem P1 is a non-convex problem that is difficult to solve. However, through the analysis of problem P1, we can first transform the main problem into a problem of smaller dimensions. Here we introduce Lemma 1, which is the basis of transformation.

Lemma 1. We always have inf
x,y Proof of Lemma 1. See [31]. Lemma 1 shows that the objective function can be minimized by first minimizing some of variables, and then minimizing the other ones. For this reason, we are able to find the optimal f firstly.
According to Equation (3), we can find that the energy consumption of local computation increases monotonically with the increase of T1, the smaller the T1 is, the less energy consumed. However, the small f i,j lead to the violation of constraint C2. In other words, local task execution cannot be completed within time block T. Therefore, when the time T is taken as the maximum available computation time, the best value f * i,j = It can be seen that the objective function and f ( P2 max where Through the above replacement steps and constraint elimination, the problem P1 is converted to P2, and a variable is eliminated simultaneously. Next, we will solve the problem P2 to get the best combination of offload data size, energy harvesting time and task offload time.

Problem Solving
Through the above simplification, we have obtained the simplification problem P2. In order to get the best task-offloading time and energy harvesting time, we have the constraint t har P3 max where , and the C3 and C5 are replaced by C9 and C10.
Through the above simplification, the problem is divided into two parts, one is a constant term and the other is a non-constant term with variables. It happens that the constant term subtracts the non-constant term, then we transform the P3 problem into the P4 problem: P4 min We get that the objective function and constraint 3 of the P4 problem are convex, and the other constraints are convex. Therefore, the P4 problem is convex and can be solved by standard convex optimization techniques.
The detailed solution for solving problem P4 and main problem P1 is described as follows.

Through the Lagrange Method and KKT Conditions to Find the Optimal Solution Properties
Constructing a Lagrangian function usually adds all constraints to the objective function, thereby transforming the constraint problem into an unconstrained problem. However, in this construction process, we only consider most constraints but not all constraints. Let u i = [u 1 , u 2 , . . . , u N ] 0, We supposed (R * , t * ) to represent the optimal solution of the P4 problem, and (u * , v * , w * , λ * ) represents the optimal Lagrange multipliers. By applying the Karush-Kuhn-Tucker (KKT) condition, we get a relation about the optimal solution: L(R, t, u, v, w, λ) where w * i,j ≥ 0 and λ * i = 0 we can get an equation: is a monotonic decreasing function of x ≥ 0 with h(0) = 0. Given G < 0, there exists a unique positive solution for equation h(x) = G, given by is the main branch of the Lambert W function, which defines W 0 (x)e W 0 (x) = x, and e is the base of the natural logarithm [32].

Use the Optimal Solution Properties to Rearrange the Problem
Since P4 is proved to be a convex optimization problem, the property of the optimal solution is obtained by the KKT condition. Therefore, the optimal solution of P4 will surely possess the property. By leveraging characteristic (17), the objective function of P4 can be transformed into a polynomial form with only one unknown vector and reducing the constraints accordingly. Put the obtained t * i,j into the P4 problem to get the problem P5: P5 min We bring t * i,j into constraint 4 to get the constraint about R o f f i,j , and then combine constraint 2 and constraint 5 to get constraint 6.
In problem P5, the objective function is in polynomial form and there are three constraints. Therefore, P5 is a nonlinear constrained optimization problem that can be solved by applying several algorithms.

Solving the Simplified Problem through the ALM Method
The augmented Lagrangian method is used to reconstruct the constrained problem into an unconstrained problem, and then solve the unconstrained optimization problem. Augmented Lagrangian function: In addition, c is the penalty factor. In order to make the formula concise, we make the following expression: We select the ALM to solve the unconstrained problem (18) in each iteration, the optimal solution is denoted by R (k * ) i,j . k is the number of iterations, given the termination limits ε, the initial candidate point R (0) i,j , the initial penalty factor c 0 and the penalty factor growth coefficient ρ. The penalty factor will be updated iteratively until the termination condition c k > ε or the iteration time k is larger than 50, and then the optimal solution R (k * ) i,j is obtain. The pseudo code of the ALM algorithm in Algorithm 1:

Obtaining Other Optimization Variables
Based on the optimal offloading task size obtained by the algorithm, the optimal offloading time can be obtained by (17), the optimal harvest time can be obtained by t har

Simulation Results
In this section, we conduct simulation experiments to verify the advantages of the proposed joint optimization scheme, which aims at residual energy maximization of multi MDs in multi-time slots, and jointly optimizes the amount of task-offloading, energy harvesting time, task-offloading time and CPU frequency. All simulation programs are written in the Python programming language and use the PyOpt, which is a Python-based software package for solving optimization problems with nonlinear constraints.
The numerical results are compared with the following two benchmark schemes to evaluate the joint optimization scheme for maximizing residual energy under multi-MD s and multi-slots. The scheme jointly optimizes the task-offloading size, energy harvesting time, task-offloading time and the CPU frequency, which is abbreviated as MMM.
1. Local computation only: Each user completes its computation task only through local computations, and the entire time slice is used to harvest energy for each user, referred to as LOC. 2. Only computation offload: Each user completes his computing task only by completely offloading the computing task to the AP, and the energy harvested by the user is used to support computing offload, referred to as OFF. 3. Fixed energy harvesting time: The energy harvesting time of each user is fixed [28], and the task-offloading size and task-offloading time are optimized, referred to as FEH. 4. Fixed task offloading size: The size of each user's task-offloading is fixed [28], which can optimize energy harvesting time and offloading time, referred to as FTO.
In the simulation, we first used to set the general parameters of the simulation. The system parameters are setting as follows (unless otherwise stated): The number of the MDs M = 3, the number of time slots N = 3, the period required for 1-bit calculation is subject to uniform distribution C j ∈ [600, 800] cycles/bit, κ j = 10 −28 , ∀j ∈ M [13], the maximum CPU frequency f max j = 1 GHz, the AP transmission power p a i,j = 200 W, the circuit power p m,j = 10 −4 W, the receiver noise power N 0 = 10 −9 W and the spectrum bandwidth for offloading B = 2 MHz. The distance between the MD and the AP follow d i,j ∼ U(5.0, 8.0) m, the task size follow R i,j ∼ U(50, 80) kb and the device received energy conversion rate follows the equal division distributed υ ∈ [0.7, 0.9]. The channel power gain from each MD to the AP is modeled as h m i,j = 10 −3 d −α i,j φ i , where φ i represents the short-term fading which is assumed to be an exponentially distributed random variable with unit mean, α denotes the path loss exponent and here set α = 2 and the channel power gain h a i,j from the AP to each MD is equal to h m i,j . In addition, set the time block T = 2 s .

Performance of Solution
The first simulation shows the relationship between the residual energy (J) and the AP transmission power (W). By observing the changes of the residual energy with the AP transmission power during the five methods, it is assumed that d i,j , R i,j , υ j are transmitted randomly according to the above. The results are shown in Figure 3. From Figure 3, we can observe that when the AP transmission power varies from 200 W to 290 W, the MMM and FTO curves always have relatively large residual energy. However, the MMM curve shows better stability because the proposed joint optimization scheme considers the task-offloading size, while FTO fixes the task-offloading size and only optimizes the task-offloading time and energy harvesting time. In contrast, OFF offloads all tasks to the AP, which means that the size of task offload is fixed, and optimize the only task-offloading time and energy harvesting time, which requires reducing energy harvesting time and increasing task-offloading time. Similarly, although LOC does not require task offload size and task offload time, it only needs to use time slots for harvesting. We all know that MDs do not have strong computing power. Of course, the residual energy is more than FEH only. The FEH solution fixes the energy harvesting time, which does not take so long for task-offloading. Therefore, the energy harvesting time is shortened, the energy consumption increased further the smallest residual energy. In addition, we found that MMM and FTO intersect among the five curves, OFF is closer to MMM, and the LOC and FEH curves are a straight line.
The second simulation shows the relationship between the residual energy (J) and the task size (KB). The tasks we declared earlier are randomly selected. For the sake of the intuitiveness of the task size changes, we directly give a fixed task size change. There are multiple MDs in a time block, assuming that each MD has the same task size. By changing the size of the task, we observed the changes in the residual energy when the five methods were executed separately. The results are shown in Figure 4. It can be seen from the results in Figure 4 that no matter which optimization scheme is adopted, the residual energy decreases with the increase of the task size, but the proposed joint optimization scheme is still superior to other benchmark schemes and has better stability than the benchmark scheme. Specifically, when the task size is bigger, the decline speed of the LOC curve is faster, while the decline speed of MMM, OFF and FTO is very slow. However, the residual energy of MMM is always greater than OFF, and the FTO curve decreases faster when the task is large, which shows that MMM has a good solution combination and better ability to adapt to larger tasks. MMM jointly optimizes task-offloading size, energy harvesting time and task-offloading time to find the best combination, while LOC and OFF can only execute all tasks in the local and MEC servers, respectively. FEH optimizes the task-offloading size, fixes the energy harvesting time and the total offloading time of all equipment tasks. Therefore, the residual energy of FEH is relatively stable as the task increases. In addition, when the task is relatively small, the residual energy of the other four methods except FEH tends to be equal, and the residual energy of FEH is only half of them, which shows that fixing energy harvesting time is unreasonable.
The third simulation shows the relationship between the residual energy (J) and the length of the time block T(s). By changing the length of the time block, we observe the residual energy changes when the five schemes are executed separately. The results are shown in Figure 5. From Figure 5, we have several observations. First, when the time block is small relatively, the residual energy of the LOC is the smallest. The energy harvesting time at this time is relatively short, and the energy consumed by the local execution task is relatively large. At the same time, the residual energy of MMM and FTO are very close to some extent, which indicates that the combination of FTO and MMM solutions is similar. Secondly, as the length of the time block increases, the residual energy of the LOC quickly approaches that of OFF, which indicates that the combination of OFF method solutions is no close to the MMM optimal combination, and the rapid growth of LOC does not quickly approach MMM. Finally, we found that the curves of MMM and OFF and FTO are closer to a straight line, but the linear rise of MMM and FTO is larger, which shows that the better performance and adaptability of MMM and FTO schemes. In addition, as the time block becomes increases, the growth rate of the FET is the smallest. From the results, compared with other solutions, the residual energy is only approximately half compared with other solutions.

Failure Ratio of Solution
The simulation shows the relationship between failure ratio (%) and task size. By changing the size of the task, we studied the failure ratio of the five scenarios. Failure ratio means that the residual energy is less than 0 or the task is not complete within time T. Assuming the task size follows from 60 KB to 150 KB, as the task size increases, the result of the failure ratio is shown in Figure 6.
It can be seen in Figure 6 that the failure ratio grows with the increase in tasks. First, the failure ratio is very high when the task is very large, but the proposed MMM has a relatively low failure ratio. MMM can find the best combination of task-offloading size, energy harvesting time and task-offloading time. Second, the curves of FEH and OFF are very tortuous. When the task is small, the failure ratio is the highest. When the task is large, the failure ratio is almost equal and relatively high, and it is higher than the failure ratio of MMM only. Then, the growth rate of the failure ratio of the FTO curve increases rapidly as the task increases, especially when the task is relatively large, the failure rate approaches 1. The fixed offload task size makes the number of local executed tasks too large to be completed within T. MMM can reasonably divide the task offload size, thereby allowing users to complete tasks within time T. Finally, when the task is small, the failure rate of the LOC can almost reach zero. The local parallel execution meets the demand, but the task offload of the MMM scheme is serial execution, which will cause relatively more energy consumption. When the task is large enough, the failure rate of LOC is as high as 100%. When the task is small, the harvesting energy can fully satisfy the task to execute locally. As the task increases, the harvesting energy cannot meet the large amount of energy consumed by the local execution.

Conclusions
In this article, we propose an MEC and WPT integrated system that considers multiple users and partial task-offloading in multiple time slots. The multi-antenna AP provides energy for multiple MDs at the same time, and the energy harvested by the MDs provides energy for task-offloading and local computing. By jointing optimization of task-offloading size, energy harvesting time, task-offloading time and CPU frequency, it is ensured that the energy harvested by each MD in each time block meets the energy consumption requirements of various tasks. At the same time, it can extend the battery duration of MDs and improve the computing power of MDs. The optimal solution is obtained by using the Lagrange method, KKT condition and augmented Lagrangian method. The numerical results show that the proposed joint optimization scheme is superior to the traditional benchmark scheme. The integrated system of MEC and WPT is becoming the hotpot research because of its practicability. Our work provides a new idea for related research. Next, the development of MDs will have greater applicability. In the following research, we will pay more attention to the nonlinear energy transmission model, and apply more task offloading communication protocols such as Orthogonal Frequency Division Multiple Access to make the system model more in line with technological development.

Conflicts of Interest:
The authors declare no conflict of interest.