Resource Allocation in Wireless-Powered Mobile Edge Computing Systems for Internet of Things Applications

Wireless devices in Internet of Things (IoT) applications, such as wireless sensors and Radio Frequency Identifications (RFIDs), are faced with challenges of heavy computation tasks and limited energy, which can be solved by the importation of mobile edge computing (MEC) and wireless power transfer (WPT) techniques. As MEC can effectively enhance computation capability, and the wireless power transfer can ensure a sustainable supply of energy, it has drawn significant research interest in IoT applications. In this paper, we will study the resource allocation problem in the wireless-powered MEC system for IoT applications with one access point (AP) and many other wireless devices, and propose a Stackelberg dynamic game model to obtain the optimal allocated resource for the nodes in the IoT environment. The AP is a wireless power source that can charge wireless devices based on wireless power transfer techniques. The AP is also integrated with a MEC server that can carry out computation tasks that offload from wireless devices. The wireless devices can use the harvested energy to execute and offload computation tasks to the AP. Based on the proposed game model, the AP and wireless devices can control their optimal transmit power for energy transfer, and computation tasks offloading to the AP, respectively. The numerical simulation results show the correctness and effectiveness of the proposed model.


Introduction
The Internet of Things (IoT) [1] is a physical representation of the Internet that can cover everything in the physical world.It uses a variety of information-sensing devices to sense real-time data from its environments, in order to exchange and communicate information among devices and people.With the rapid development of information technology, more and more devices are inter-connected via the IoT.The IoT has widely been used in intelligent transportation [2], smart homes [3], smart cities [4][5][6], smart electricity grids [7,8] and other fields.The application of IoT can effectively improve social intelligence levels, thus greatly facilitating people's lives.
One challenge for devices in the IoT is the constrained energy problem [9].The rapid development of the IoT technology has led to the exponential growth of wireless devices.Most wireless devices in the IoT are energy-limited devices, which do not have a stable energy supply.The issue of reducing energy consumption and providing sustainable energy for wireless devices has become an urgent problem to be solved on the development path of the IoT [10].Researchers have designed and developed wireless power transfer (WPT) techniques for wireless devices in order to increase a device's lifecycle [11].As a new type of energy transfer technology, the WPT can achieve a balance between power supply and energy consumption [12,13].
Aside from the limited energy problem of IoT, it is expected to provide better computing and storage services for users that are covered by the IoT environment.Mobile edge computing (MEC) is a technique that extends the traditional computing platform [14], and has drawn significant research interest.It 'sinks' the services and functions originally located in the cloud data center to the edge of the IoT network, and provides computing, storage and communication resources [15,16].Computation offloading, as the core technology of MEC, migrates the computation tasks of resource-limited devices to the MEC server at the edge of IoT, which can improve computational quality and reduce latency [17].Extensive work was conducted on the computation offloading in MEC [18][19][20][21][22][23].Chen et al. developed a novel online peer offloading framework using the Lyapunov technique to maximize system performance and to reduce energy consumption [18].The literature [19] used cooperative computation offloading for unmanned aerial vehicles (UAVs) to reduce energy consumption and task execution latency through convex optimization.However, they did not consider the problem of insufficient energy in a wireless device's battery.Mao et al. proposed a dynamic computation offloading algorithm based on Lyapunov optimization to study MEC systems with energy harvesting devices [20].Chen et al. studied the multi-user computation offloading problems of mobile-edge cloud computing in the multi-channel wireless interference environment [21].Wang et al. improved performance by considering a wireless powered multi-user MEC innovative framework [22].According to the energy harvesting causal constraint and the UAV's speed constraint, the literature [23] studied the maximization of the computation rate in a UAV-enabled MEC wireless-powered system.Although they considered the wireless power supply system, they did not study the dynamic game equilibrium problem between the wireless energy transfer and the computation offloading in the wireless powered MEC systems.
As the WPT technique can charge wireless devices [24], and the computation offloading can effectively solve the limited computation resource issue in wireless devices in the IoT environment, we will combine the WPT and MEC techniques in this paper to solve the resource allocation problem of IoT devices effectively.We will propose a Stackelberg dynamic game-based resource allocation model in wireless powered MEC systems, by considering the influence of IoT devices' dynamic energy variations.In summary, the key contributions of this paper are as follows:

•
Firstly, the researched wireless powered MEC system consists of one access point (AP) and N wireless devices.The AP tries to find the optimal transmit power for the energy supply, and the wireless devices try to decide the proportion of computation tasks offloading to the AP.

•
Secondly, a Stackelberg dynamic game model is proposed to formulate the resource allocation problem in wireless powered MEC systems for IoT applications.The Stackelberg game is a one-leader-many-followers game, where the AP is the leader and the wireless devices are the followers.

•
For the dynamic game, we use the energy variation as the system state.The objectives for the AP and wireless devices are to optimize the cost function during the wireless transfer of energy and computation offloading.

•
Finally, the open-loop control solutions for the AP and wireless devices are given based on Bellman dynamic programming.
The remainder of the paper is organized as follows: Section 2 introduces the system model and problem formulation.Section 3 provides the Nash equilibrium solutions for the proposed game model.Numerical simulations are given in Section 4. Finally, we conclude the work in Section 5.

System Model and Problem Formulation
Figure 1 shows a wireless powered MEC system in a certain transmit range with one access point and N wireless devices.The AP is the wireless power source and charges the wireless devices based on wireless power transfer techniques.In order to provide MEC services, the AP is also integrated with a MEC server that can carry out computation tasks offloading from wireless devices.The wireless device can use harvested energy to execute and offload computation tasks.In this paper, we tried to find the optimal transmit power from the AP for wireless energy transfer.For wireless devices, the computation tasks offloading to the AP should be decided.Since the wireless devices should harvest energy from the AP for computation tasks processes and computation offloading, we can abstract the relationships between the AP and wireless devices as a Stackelberg game, whereby the AP is the leader and the wireless devices are the followers.The AP decides the power level for the transfer of wireless energy, then the wireless devices control the computation tasks offloading to the AP based on the harvested energy from the AP.Since the energy of the proposed MEC system is dynamically changed during wireless energy transfer and computation offloading, which affects the strategies for energy transfer and computation offloading, we take the effect of the dynamic energy variation to our system in order to research the impact of the energy state on these strategies, which is a process of the dynamic game.Then we can combine the dynamic game and Stackelberg game together to find the optimal solutions for both the AP and wireless devices.
Electronics 2019, 8, 206 3 of 13 devices, the computation tasks offloading to the AP should be decided.Since the wireless devices should harvest energy from the AP for computation tasks processes and computation offloading, we can abstract the relationships between the AP and wireless devices as a Stackelberg game, whereby the AP is the leader and the wireless devices are the followers.The AP decides the power level for the transfer of wireless energy, then the wireless devices control the computation tasks offloading to the AP based on the harvested energy from the AP.Since the energy of the proposed MEC system is dynamically changed during wireless energy transfer and computation offloading, which affects the strategies for energy transfer and computation offloading, we take the effect of the dynamic energy variation to our system in order to research the impact of the energy state on these strategies, which is a process of the dynamic game.Then we can combine the dynamic game and Stackelberg game together to find the optimal solutions for both the AP and wireless devices.In our proposed Stackelberg dynamic game, the energy variation is considered as the system state for the AP and wireless devices, which is affected by the power level for wireless energy transfer, the system consumption and the power level for computation tasks.Let .The transmit power of AP for wireless energy transfer is   ap p t .The computation tasks of device i at time t is denoted by   i q t , which can be divided into two parts: one is the computation tasks offloading to the MEC server, and the other is the computation tasks processed locally.Assuming the computation offloading to the MEC server is   i r t , then the energy consumption of the computation offloading can be given by , where  is the energy consumption per offloading bit in the MEC server.
The energy consumption of the computation tasks processed locally is denoted by Based on the above assumptions, the energy state for the AP and wireless device i can be given by the following differential equation: where i h is the channel vector from the AP to device i for wireless energy transfer and i  is the energy harvest efficiency of device i .

 
g p t is the energy supply from the power grid.Generally, the energy supply is a constant value when the AP connects with the thermal power suppliers.However, with the promotion of sustainable energy development, the AP may connect to some sustainable energy sources such as solar energy, wind energy and so on.In these situations, the energy supply is unsteady.The parameter  in Equations ( 1) and ( 2) is the energy consumption rate In our proposed Stackelberg dynamic game, the energy variation is considered as the system state for the AP and wireless devices, which is affected by the power level for wireless energy transfer, the system consumption and the power level for computation tasks.Let x ap (t) and x i (t) denote the energy state of the AP and wireless device i, respectively, and i ∈ {1, 2, ..., N}.The transmit power of AP for wireless energy transfer is p ap (t).The computation tasks of device i at time t is denoted by q i (t), which can be divided into two parts: one is the computation tasks offloading to the MEC server, and the other is the computation tasks processed locally.Assuming the computation offloading to the MEC server is r i (t), then the energy consumption of the computation offloading can be given by µr i (t), where µ is the energy consumption per offloading bit in the MEC server.The energy consumption of the computation tasks processed locally is denoted by µ[q i (t) − r i (t)].Based on the above assumptions, the energy state for the AP and wireless device i can be given by the following differential equation: where h i is the channel vector from the AP to device i for wireless energy transfer and η i is the energy harvest efficiency of device i. p g (t) is the energy supply from the power grid.Generally, the energy supply is a constant value when the AP connects with the thermal power suppliers.However, with the promotion of sustainable energy development, the AP may connect to some sustainable energy sources such as solar energy, wind energy and so on.In these situations, the energy supply is unsteady.The parameter ε in Equations ( 1) and ( 2) is the energy consumption rate of the system, which means the system energy will decrease with a random degradation coefficient ε while the system is running for both the AP and wireless devices.Based on Equation (1), we can find that the energy state of the AP decreases with the power level of the wireless energy transfer, and decreases with the offloading computation tasks.The longer the MEC server runs, the lower the energy state.Based on Equation (2), the energy state of wireless devices is mainly affected by the harvested energy from the AP and the energy for local computation tasks.The energy state of wireless device i increases with the harvested energy from the AP, and decreases with energy consumption for computation.
In our proposed Stackelberg dynamic game model, the AP is considered the game leader and is the energy source for wireless devices, through the wireless energy transfer technique of broadcasting energy to wireless devices in IoT environments.The AP is also integrated with a MEC server to provide edge computing services to wireless devices.Based on the above assumption, the payoff function of the AP primarily includes three parts.The first part is the profit earned from the transfer of wireless energy, which is paid by wireless devices and is controlled by the variable p ap (t).The AP can earn profit from energy transfer, which is the primary reason for wireless energy transfer.The second part is the energy cost of offloading computation tasks from wireless devices, which is dominated by the proportion of computation offloading.The AP should process computation tasks from all the devices.The third part is the attempted costs of ensuring the energy state is no lower than a threshold x ap , in order to have a minimum energy that provides edge computing services for different kinds of wireless devices served by the MEC server.Then the instantaneous payoff function can be given by the following equation: where α ap , β ap and γ ap are positive weighted factors that denote the relative importance of the components.Given the time interval [0, T], the AP wants to find the optimal power level p ap (t) that minimizes the cost function as follows: min The wireless devices are considered as the followers in the proposed Stackelberg dynamic game.They should pay for the AP harvesting of energy, and use the harvested energy for local computation tasks.As the wireless devices are energy-limited devices, they should try their best to make their energy no lower than a threshold x i to cope with all kinds of sudden computing requirements.The instantaneous payoff function of the wireless device i is denoted by the following equation: where α i , β i and γ i are positive weighted factors that denote the relative importance of the components.Given the time interval [0, T], the wireless devices want to find the optimal computation offloading variable r i (t) that minimizes the cost function as follows: min

Game Analysis
This section discusses open-loop control solutions for both the followers and leader of the proposed Stackelberg dynamic game.The wireless devices, which means the followers of the game, should find their optimal allocation for computation offloading based on the harvested energy from the AP.Then the AP controls its power for energy transfer to minimize the cost during the observed time interval.

Open-Loop Solutions for Wireless Devices
Integrated with the energy-harvested circuit, wireless devices should harvest energy from the AP for information transmission, computations tasks and even the computation offloading.The AP should broadcast its energy to wireless devices at the beginning of the game, whereby the wireless devices harvest energy and use the harvested energy to achieve computation tasks locally, and to offload the computation to the AP.In order to minimize the cost during energy harvesting and computation offloading, wireless devices should control offloading variable r i (t) during the process.Before obtaining optimal solutions for open-loop control, we should firstly define wireless devices in two ways.Definition 1.For the wireless device i, the computation offloading r * i (t) is optimal if the following inequality holds for all feasible control r i (t) = r * i (t), Definition 2. A set of controls r * i (t) constitute an open-loop Stackelberg equilibrium to the problem in Equations ( 2) and ( 4).x * i (t) is the corresponding state trajectory, if there exists a costate function Λ i (t) such that the following relations are satisfied [25,26], .
where Λ i (t) in Equation ( 9) is a costate function that is associated with the energy state given in (2).Using the costate function, we can associate the objective function of wireless devices with the energy state to construct the Hamiltonian function, which is denoted by H i (t) in Equation ( 9).Based on the Bellman dynamic programming principle, the Hamiltonian function can be given as H i (t) = J i (t) + Λ i (t)dx i (t)/dt.
Given the definitions in Equations ( 7)-( 9), we need to solve the optimal allocated resource r * i (t) for wireless devices.In order to get the optimal open-loop solutions, we should solve the Hamiltonian function given in Definition 2 based on the Bellman's dynamic programming principle.Lemma 1.The optimal computation tasks offloading from the wireless device i to the AP is: where Λ i (t) is given in Equations ( 8) and (9).
Proof.The Hamiltonian system H i (t) of wireless device i can be expressed as follows: Electronics 2019, 8, 206 6 of 13 Calculating the partial derivative for r i (t) in Equation ( 11), we have: Then we have the optimal solution for resource allocation as follows: The proof is complete.Equation (10) gives the optimal solutions for the proposed game in Equations ( 2) and ( 4).We found that it is associated with the costate function Λ i (t).In order to get the explicit expression for the optimal allocated r * i (t), we need to find the expression of the costate function Λ i (t).
Lemma 2. The optimal energy state trajectory and related costate function are given by: where c 1 and c 1 are the initial value of the energy state and the costate function.
Proof.Giving the Hamiltonian system H i (t) of the wireless device i in Equation ( 11), we calculated the partial derivative for x i (t) as follows: Substituting r * i (t) into Equation ( 13) yields a pair of differential equations: . .
To make the mathematical analysis easier for the above differential equations, we reduced the number of parameters by introducing the following substitutions: The parameters in Equations ( 17) and ( 18) were reassigned to obtain a pair of differential equations as follows: . .
Solving the above differential equations, we have: where c 1 and c 1 are the initial value of the energy state x i (t) and the costate function Λ i (t), respectively.The proof is complete.Given Equations ( 13) and ( 15), we have the optimal solution for resource allocation of each wireless device.Based on the optimal solution for resource allocation, the wireless devices can control their computation tasks based on their own energy variation.The energy state variation can also be obtained based on Equation ( 14).

Open-Loop Solutions for the AP
After obtaining the optimal solutions for wireless devices, in this subsection we tried to find the optimal solutions for the wireless energy transfer of the AP.Similarly, two definitions are given as follows: Definition 3.For the AP, the power level p * ap (t) is optimal if the following inequality holds for all feasible controls p ap (t) = p * ap (t): Definition 4. A set of controls p * ap (t) constitutes an open-loop Stackelberg equilibrium to the problem in Equations ( 1) and ( 3), and x * ap (t) is the corresponding state trajectory, if there exists costate functions λ 0 (t) and λ i (t) such that the following relations are satisfied: p * ap (t) = arg min H ap (t). . .
where the Hamiltonian system H ap (t) of the AP can be expressed as follows: H ap (t) = J ap (t) + λ 0 (t) .
x ap (t) As the AP holds the lead position in the proposed dynamic game, it controls its objective function and forms a Hamiltonian system that considers the wireless devices' strategies in the game process.
Compared to the open-loop solution of wireless devices, the Hamiltonian system of the AP has one more costate function, which is denoted λ i (t).Using λ i (t), we can relate the optimal solution of the AP with the optimal solutions of wireless devices.Calculating the partial derivative for p ap (t) in Equation (28), we can obtain that the optimal solution for wireless energy transfer is given by: Lemma 3. The optimal energy state trajectory and related costate function are given by: where c 3 and c 4 are the initial value of the energy state x ap (t) and the costate function λ 0 (t), respectively.
Proof.Calculating the partial derivative for λ 0 (t) and λ i (t) in the Hamiltonian system H ap (t), we can obtain: . .
To make the mathematical analysis easier for the above differential equations, we reduced the number of parameters by introducing the following substitutions: The parameters were reassigned in Equations ( 29) and (30) to obtain a pair of differential equations as follows: . .
Solving the above differential equations, we have: The proof is complete.

Numerical Simulations
In this section, we used MATLAB software to simulate the proposed Stackelberg dynamic game model.We combined WPT and MEC techniques to solve the resource allocation problem in devices effectively.For this problem there is one wireless power source and four wireless devices.We only considered the transmit power within a certain transmit range, and did not consider the influence of factors such as the attenuation of the transmit power on the model.We set the energy supply from the power grid as 5000 unit.The other simulation parameters are shown in Table 1.As parameters β i , γ i , α ap and γ ap are weighted factors that denote the relative importance of the components in the objective functions, they are set to a real value between 0 and 1.The unit of the parameter µ is KJ/unit.h i is the channel vector that denotes the influence of the physical aspects, such as the distance.η i is the energy harvest efficiency that is set to a value between 0 and 1. ε is the energy consumption rate of the system, which means the system energy will decrease with a random degradation coefficient.Figure 2 describes the relationships between the energy state of the wireless devices and time t.We consider the thresholds x i of four different wireless devices to be 600 unit, 800 unit, 1000 unit and 1200 unit, respectively.As shown in Figure 1, the energy state of wireless devices increased monotonously with time t, indicating that wireless devices can harvest energy from the AP.Meanwhile, through the optimal control of computation offloading, the wireless devices stored more energy than other IoT applications, such communication, sensing and so on.Figure 3 describes the relationships between the optimal computation offloading of wireless devices and time t .We consider the computation tasks   i q t of four different wireless devices to be 300 MB, 400 MB, 500 MB and 600 MB, respectively.As shown in Figure 2, the optimal computation offloading of the wireless devices decreased monotonously with time, and can converge over time.Figure 3 describes the relationships between the optimal computation offloading of wireless devices and time t.We consider the computation tasks q i (t) of four different wireless devices to be 300 MB, 400 MB, 500 MB and 600 MB, respectively.As shown in Figure 2, the optimal computation offloading of the wireless devices decreased monotonously with time, and can converge over time.
(c) (d) Figure 3 describes the relationships between the optimal computation offloading of wireless devices and time t .We consider the computation tasks   i q t of four different wireless devices to be 300 MB, 400 MB, 500 MB and 600 MB, respectively.As shown in Figure 2, the optimal computation offloading of the wireless devices decreased monotonously with time, and can converge over time.
(a) (b)   Figure 4 describes the relationship between the energy state of the AP and time t .We observed that the energy state of the AP is highest at the initial time of the game process.The energy state showed a decreasing trend and a convergence over time with the charging of wireless devices and the handling of computation tasks from the wireless devices.Figure 5 describes the relationship between the optimal transmit power of the AP and time t .As shown in Figure 5, the optimal  Figure 4 describes the relationship between the energy state of the AP and time t.We observed that the energy state of the AP is highest at the initial time of the game process.The energy state showed a decreasing trend and a convergence over time with the charging of wireless devices and the handling of computation tasks from the wireless devices.Figure 5 describes the relationship between the optimal transmit power of the AP and time t.As shown in Figure 5, the optimal transmit power of the AP decreased monotonously with time t.
(c) (d)  Figure 4 describes the relationship between the energy state of the AP and time t .We observed that the energy state of the AP is highest at the initial time of the game process.The energy state showed a decreasing trend and a convergence over time with the charging of wireless devices and the handling of computation tasks from the wireless devices.Figure 5 describes the relationship between the optimal transmit power of the AP time t .As shown in Figure 5, the optimal transmit power of the AP decreased monotonously with time t .Figure 4 describes the relationship between the energy state of the AP and time t .We observed that the energy state of the AP is highest at the initial time of the game process.The energy state showed a decreasing trend and a convergence over time with the charging of wireless devices and the handling of computation tasks from the wireless devices.Figure 5 describes the relationship between the optimal transmit power of the AP and time t .As shown in Figure 5, the optimal transmit power of the AP decreased monotonously with time t .

Conclusions
The energy of the proposed MEC system dynamically changed during the transfer of wireless energy and computation offloading, which affected the strategies for energy transfer and computation offloading.In this paper, we took the effect of dynamic energy variation to our system in order to research the impact of the energy state on our strategies, which is a process of the dynamic game.A Stackelberg dynamic game-based resource allocation model in the wireless powered MEC system for IoT applications was proposed.The AP decided the transfer power level for wireless energy transfer, as well as the wireless devices' control of offloading computation tasks to the AP using harvested energy.Both the AP and wireless devices found their optimal transmit power and the optimal computation tasks offloading level based on the proposed model.Based on the numerical simulation, it can be seen that our proposed model can achieve optimal resource allocation.
the energy state of the AP and wireless device i , respectively, and  1, 2, ..., i N 

Figure 2 .
Figure 2. Energy variation of the wireless devices.(a) Energy thresholds is 600 unit; (b) Energy thresholds is 800 unit; (c) Energy thresholds is 1000 unit; (d) Energy thresholds is 1200 unit.

Figure 2 .
Figure 2. Energy variation of the wireless devices.(a) Energy thresholds is 600 unit; (b) Energy thresholds is 800 unit; (c) Energy thresholds is 1000 unit; (d) Energy thresholds is 1200 unit.

Figure 2 .
Figure 2. Energy variation of the wireless devices.(a) Energy thresholds is 600 unit; (b) Energy thresholds is 800 unit; (c) Energy thresholds is 1000 unit; (d) Energy thresholds is 1200 unit.

Figure 4 .
Figure 4. Energy variation of the access point (AP).

Figure 4 .
Figure 4. Energy variation of the access point (AP).

Figure 4 .
Figure 4. Energy variation of the access point (AP). x

Figure 5 .
Figure 5. Optimal transmit power of the AP.