# Efficient and Energy-Saving Computation Offloading Mechanism with Energy Harvesting for IoT

Authors: Yawen Zhang; Yifeng Miao; Shujia Pan; Siguang Chen
Journal: Security and Communication Networks
 (2021)

---

## Abstract

In order to effectively extend the lifetime of Internet of Things (IoT) devices, improve the energy efficiency of task processing, and build a self-sustaining and green edge computing system, this paper proposes an efficient and energy-saving computation offloading mechanism with energy harvesting for IoT. Specifically, based on the comprehensive consideration of local computing resource, time allocation ratio of energy harvesting, and offloading decision, an optimization problem that minimizes the total energy consumption of all user devices is formulated. In order to solve such optimization problem, a deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm is proposed. The design of deep neural network architecture incorporating regularization method and the employment of the stochastic gradient descent method can accelerate the convergence rate of the developed algorithm and improve its generalization performance. Furthermore, it can minimize the total energy consumption of task processing by integrating the momentum gradient descent to solve the resource optimization allocation problem. Finally, the simulation results show that the mechanism proposed in this paper has significant advantage in convergence rate and can achieve an optimal offloading and resource allocation strategy that is close to the solution of greedy algorithm.


---

## Body

## 1. Introduction

With the gradual popularization of 5G technology, the Internet of Everything (IoE) is no longer a fantasy. According to Cisco’s estimation, there will be 29.3 billion devices connected to network worldwide by 2023, of which about 14.7 billion Internet of Things (IoT) devices will be connected to the Internet, roughly accounting for 50% of networking devices [1]. The IoT has been applied to various fields, which brings huge breakthroughs, especially in human-computer interaction, artificial intelligence (AI), augmented reality (AR), smart cities, smart healthcare, etc. However, problems caused by the development of technology also arise. As the scale of applications increases, a large amount of data will be generated. In general, the data processing capability and the battery capacity of IoT device are limited. In order to overcome these shortages, cloud computing technology emerges as times require. Cloud computing paradigm provides a large amount of computing resources in the cloud center and returns the computing results to users, which has the advantages of high flexibility, scalability, and cost-effective performance. However, owing to the long communication distance between local device and remote cloud center, the network congestion may occur during communication process, which will cause great communication delay. As a result, it is difficult to meet the processing requirements of delay-sensitive or task-intensive applications [2].To alleviate the communication pressure of huge amounts of data and better realize real-time interaction, egde computing has entered public view [3]. Compared with cloud computing, edge computing paradigm deploys computing nodes close to the user terminals. Computing and resource storing occur at the edge of the network, and the processing capabilities are closer to the data sources. Therefore, edge computing provides faster network service response and satisfies the basic demands of the industry in real-time service, intelligent applications, etc. At present, the research on edge computing has attracted increasing attention in both academia and industry. In particular, edge computing promotes the execution of a large number of computing tasks in real time on low-power devices [4–6]. Tasks are offloaded to improve the system performance in specific scenarios, and the problem of computation offloading in edge computing has also become the research focus [7].In the context of mobile edge computing (MEC) network, a joint optimization method was proposed by combining alternating direction method of multipliers (ADMM) based decomposition technique and coordinate descent [8]. It maximizes the total computation rate of all wireless devices in the network by jointly optimizing computation mode selection (i.e., local computing or offloading) and transmission time allocation. In order to evaluate system performance more comprehensively, work [9] studied an efficient computation offloading algorithm, which jointly optimizes user association and offloading decisions with the consideration of computing resource and transmission power allocations. The developed algorithm is applied to multitask MEC scenario, and the total energy consumption is reduced significantly. Meanwhile, the fast convergence property of the algorithm is verified by series of simulations. Similarly, Kiani et al. [10] formulated an optimization framework based on nonorthogonal multiple access (NOMA), which minimizes the energy consumption of MEC users via optimizing the user clustering, computing and communication resources, and transmission power. In order to apply computation offloading to more practical scenario, in industrial Internet of Things (IIoT), literature [11] proposed an accelerated gradient algorithm with joint optimization of the offloading ratio and transmission time. Subsequently, in order to further improve system performance and better meet the stringent energy and latency requirements of IIoT applications, an alternating energy consumption minimization algorithm was proposed by integrating dynamic voltage scaling technique. In the multiuser MEC system, work [12] is remarkably effective in energy saving. An approximate dynamic programming (ADP) approach was proposed for task offloading in mobile edge system. By adopting the value function approximation framework and the stochastic gradient learning strategy, the state value can be parameterized and recursively estimated progressively to achieve the goal of the system cost minimization. In addition, some other excellent works also conducted research on computation offloading, such as [13, 14]. At the same time, several other energy-saving techniques and methods were studied, such as in [15].Because IoT terminals are usually small in size and low in power consumption, they are often heavy-loaded when processing a large amount of data. The service life of devices can be effectively prolonged by replacing the batteries, but it is labor-intensive, time-consuming, costly, or even impossible (e.g., in the remote field) [16]. In order to prolong the battery life of IoT devices, wireless power transfer (WPT) technology has been widely used in such devices [17]. WPT is used to transfer energy from an energy source to an electrical load, and this process is achieved through wireless transmission.Currently, studies on WPT emerge in an endless stream. In [18], combining WPT and MEC, Deng et al. proposed a Lyapunov-based dynamic maximum throughput optimization algorithm by optimizing the allocations of communication, computation, and energy resources. Literature [19] studied energy harvesting enabled fog radio access networks. To reduce system power consumption, a green energy-aware offloading decision algorithm was proposed, which determines the offloading strategy by optimizing the allocations of power and computation capabilities, thereby saving the energy consumption for tasks computing. The simulation results confirm that the developed algorithm can effectively minimize the system energy consumption with the support of renewable energy.In order to better fit the practical application scenario, work [20] investigated an energy-harvesting MEC system with multiple mobile devices (MDs) and multiple heterogeneous MECs and offloaded the computation tasks of MDs to MEC for processing through the wireless interference channels. Considering the interference between devices, the randomness of task generation and time-varying network scenario, an iterated distributive algorithm for Nash equilibrium (NE) was proposed, and its convergence performance and applicability are verified by simulations. Wang et al. [21] considered a practical scenario with real-time task and channel states and proposed an offline-optimization driven online design method. The Lagrangian dual method is combined with the sliding-window based online resource allocation to jointly optimize the offloading decision and resource allocation; thus, it can minimize the total energy consumption of the system. Literature [22] illustrated the optimization solved by a two-phase method. The first phase obtains the optimal offloading decisions by maximizing the sum of harvested energy under the given energy transmission power. In the second phase, the optimal minimum energy transmission power is obtained by a binary search method. According to simulations, it is verified that the proposed method can minimize the total transmission energy of the access point by joint optimization of power and time allocation.For separate WPT system and MEC system, Qiao et al. [23] designed a framework of device-to-device edge computing and networks (D2D-ECN) based on energy harvesting and proposed a Lyapunov-based online optimization algorithm to address high-dimensionality and continuous-valued action caused by the collaboration of multiple devices. Through joint optimization of offloading strategy, power allocation, and CPU frequency, the quantitative relationship between system cost and execution delay is balanced, with the effectiveness of the algorithm verified by simulation results. Literature [24] formulated an optimal offloading strategy problem based on channel quality, energy queue, and task queue for MEC in ultradense networks and modeled the problem as a Markov decision process. By deploying and training the deep Q network in the system, the minimum long-term cost of the system is achieved.According to above analysis, the research on edge computing has the following two challenges: (1) Although the traditional mathematical programming method can obtain the global optimal solution on solving the complex optimization problem, the time cost and computation overhead are too high. As the number of tasks increases, the phenomenon of dimensional explosion will occur. In addition, the solving results of traditional optimization method are too dependent on the initial state to adapt to the dynamic network environment. (2) The battery capacity of IoT terminals is limited, and a large amount of energy consumption is generated during the task processing phase. Insufficient energy is likely to cause a decrease in computing performance and fail to meet user’s needs. Although some WPT-based computation offloading schemes were studied in recent years, there is a shortage of comprehensive optimization consideration of offloading decision, computing resource, and energy-harvesting time.In IoT scenario, this paper proposes an efficient and energy-saving computation offloading mechanism with energy harvesting. The major contributions are summarized as follows:(i)
Based on the joint consideration of offloading decision and resource allocation, an optimization problem is formulated to minimize the total energy consumption of all terminal devices. At the same time, combined with the energy-harvesting theory, the WPT technology is used to realize the sustainability of the device data transmission. The objective of minimizing total energy consumption is achieved by jointly optimizing the computation offloading decision, time allocation ratio of energy harvesting, and CPU computing capability of the local device.(ii)
For the formulated mixed-integer nonlinear optimization problem above, a deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm is proposed. This algorithm constructs a deep neural network architecture incorporating regularization method, and the training process is rapidly converged by adding regularization paradigm in the network parameter updating process. Furthermore, it can obtain the optimal local computing capability and time allocation ratio of energy harvesting and then achieve the minimization of total energy consumption for all terminal devices by integrating the momentum gradient descent.(iii)
Through extensive simulations and analysis, the proposed mechanism in this paper has significant performance advantage in reducing energy consumption compared with local computing and full offloading mechanisms, and it can approximately converge to the optimal value of the greedy algorithm with a fast speed, which further confirms its superiority.The rest of this paper is arranged as follows: We present the system model in Section2. In Section 3, the optimization problem is described. Section 4 explains the proposed solving algorithm in detail. The numerical results are analyzed to verify and evaluate the proposed algorithm in Section 5. Finally, we make a summary in Section 6.


## 2. System Model

In this paper, an edge computation offloading model with energy harvesting for IoT is constructed to support the optimization of the system energy consumption caused by task computing and offloading. The specific network architecture is shown in Figure1. The model consists of two layers, namely, the edge cloud layer and the user layer.Figure 1
The system model.We assume that the user layer comprisesN terminal devices. Let i denote device i, i∈1,2,…,N, and the devices be mutually independent. Each user terminal i generates a task with a size of ci for the time interval T. Considering the randomness of the task size and the limitations of local computing resources, the device will decide whether to offload the task or not. xi∈0,1 represents the offloading decision of device i. The task is executed in a local computing mode when xi=0; otherwise, the task is offloaded to the edge server through the wireless network.Meanwhile, the device will consume a lot of energy during the process of local or offloading computing. The battery of the device itself cannot meet its needs in view of the limited battery capacity. In order to reduce terminal energy consumption and further improve quality of service and user experience, a rechargeable battery is configured for each device at the user layer in this paper. The battery is powered mainly by renewable energy base stations located around the device via wireless charging.In the edge cloud, an edge node with a server is used for providing computing services for terminal devices within its communication coverage due to the abundant resources of the edge server, and the computation results will be returned to user layer devices.In the following parts, the definition model of local computing, task offloading, and energy harvesting will be explained in detail.


### 2.1. Local Computing Model

In our model, we assume that each devicei completes the task within time T. filoc (MCycles/s) is defined as the computing capability of the user device i, where 0<filoc≤fimax. The capability can be changed by adjusting the voltage dynamically. R denotes the number of required CPU cycles to compute a 1 kbit task. Therefore, when device i’s task is executed locally, the computation time delay can be expressed as(1)tiloc=ciRfiloc,where ci (kbit) represents device i’s task size.According to the general definition of computing capability in CMOS circuits [25], the device i’s computing capability can be written as(2)piloc=δiV2filoc,where δi is the effective capacitance coefficient of local device and V represents the power supply voltage. Since V is linear in proportion to filoc, piloc can be directly expressed by δi and filoc [26].Consequently, the local computing energy consumption can be given as(3)eiloc=piloctiloc=δifilocciR.


### 2.2. Task Offloading Model

Owing to limited resource of user devices, the task will be offloaded to the edge node for computing when there are not enough local computing resources to handle the current task. Therefore, when the user layer performs data transmission through the wireless channel, we mark the channel gain of the wireless channel asgi. According to Shannon theory, the transmission rate from terminal device i to the edge node is(4)riup=Biuplog21+pigi2σ2,where Biup is the uplink bandwidth, σ2 is the white noise power of the edge server, and pi is the transmitting power of device i.Restricted by the single antenna of the user device, the terminal devices cannot be charged and transmit computing tasks in parallel mode during offloading process. Then, the delay and energy consumption required for devicei to offload the task to the edge node are, respectively, given as(5)tioff=ci1−αiriup,eioff=pitioff.


### 2.3. Energy-Harvesting Model

Limited to single-channel transmission, each terminal device adopts a time division multiplexing circuit to avoid mutual interference between energy harvesting and computation offloading. We divide the task completion time into equal time intervalsT, each time interval T contains the time of energy harvesting and task offloading of each terminal device, and the corresponding allocation ratios are, respectively, denoted by αi and 1−αi, where 0≤αi≤1. The remaining battery energy of each device i is defined as a random constant bi.According to the related theories raised by Bi et al. in [27], the energy harvested through wireless charging can be expressed as(6)eihar=νphiαiT,where ν represents the energy conversion efficiency, p represents the transmission power of energy wireless charging, and hi represents the wireless channel gain from the energy base station to the user device i.


## 2.1. Local Computing Model

In our model, we assume that each devicei completes the task within time T. filoc (MCycles/s) is defined as the computing capability of the user device i, where 0<filoc≤fimax. The capability can be changed by adjusting the voltage dynamically. R denotes the number of required CPU cycles to compute a 1 kbit task. Therefore, when device i’s task is executed locally, the computation time delay can be expressed as(1)tiloc=ciRfiloc,where ci (kbit) represents device i’s task size.According to the general definition of computing capability in CMOS circuits [25], the device i’s computing capability can be written as(2)piloc=δiV2filoc,where δi is the effective capacitance coefficient of local device and V represents the power supply voltage. Since V is linear in proportion to filoc, piloc can be directly expressed by δi and filoc [26].Consequently, the local computing energy consumption can be given as(3)eiloc=piloctiloc=δifilocciR.


## 2.2. Task Offloading Model

Owing to limited resource of user devices, the task will be offloaded to the edge node for computing when there are not enough local computing resources to handle the current task. Therefore, when the user layer performs data transmission through the wireless channel, we mark the channel gain of the wireless channel asgi. According to Shannon theory, the transmission rate from terminal device i to the edge node is(4)riup=Biuplog21+pigi2σ2,where Biup is the uplink bandwidth, σ2 is the white noise power of the edge server, and pi is the transmitting power of device i.Restricted by the single antenna of the user device, the terminal devices cannot be charged and transmit computing tasks in parallel mode during offloading process. Then, the delay and energy consumption required for devicei to offload the task to the edge node are, respectively, given as(5)tioff=ci1−αiriup,eioff=pitioff.


## 2.3. Energy-Harvesting Model

Limited to single-channel transmission, each terminal device adopts a time division multiplexing circuit to avoid mutual interference between energy harvesting and computation offloading. We divide the task completion time into equal time intervalsT, each time interval T contains the time of energy harvesting and task offloading of each terminal device, and the corresponding allocation ratios are, respectively, denoted by αi and 1−αi, where 0≤αi≤1. The remaining battery energy of each device i is defined as a random constant bi.According to the related theories raised by Bi et al. in [27], the energy harvested through wireless charging can be expressed as(6)eihar=νphiαiT,where ν represents the energy conversion efficiency, p represents the transmission power of energy wireless charging, and hi represents the wireless channel gain from the energy base station to the user device i.


## 3. Optimization Problem Formulation

We formulate an optimization problem of total energy consumption for terminal devices in this paper, aiming to minimize the system energy consumption by optimizing the offloading decisionxi, the time allocation radio of energy harvesting αi, and the local CPU computing capability filoc. According to the definition of system model in Section 2, the energy consumption of device i within the time interval T is expressed as(7)ei=1−xieiloc+xieioff−eihar,where xi denotes the task offloading decision of device i.Therefore, the optimization problem of minimizing the total energy consumption is specifically organized as follows:(8)P1:minxi,αi,filoc∑i∈12…,Nei,(8a)0<filoc≤fimax,(8b)0≤ciriup≤1−αiT,(8c)0≤eiloc≤eihar+bi,(8d)0≤eioff≤eihar+bi,(8e)0≤αi≤1,(8f)xi∈0,1,i∈N.Constraint (8a) indicates the CPU computing resource constraint on device i. Constraint (8b) demonstrates that the task offloading should be completed within the specified time. Constraints (8c) and (8d) indicate that the energy consumption of the task should not exceed the sum of the energy obtained by wireless charging and the remaining energy of the battery in the case of local computing and data transmission. Constraint (8e) shows that the time allocation ratio of energy harvesting cannot exceed 1. Constraint (8f) demonstrates that the value of offloading decision is either 0 or 1.


## 4. Optimization Algorithm

The optimization problem formulated in the previous section is a mixed-integer programming problem, and the traditional methods have certain restrictions when solving such NP-hard problems. To overcome this difficulty, we propose a deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm to solve optimization problem P1. This algorithm achieves the optimal offloading decision based on deep neural networks (DNN) with both offloading decision and resource allocation taken into account, and it is combined with the momentum gradient descent to optimize the allocation of resources, further significantly reducing the system energy consumption.Considering the features of P1, with the increase in the number of devices, the complexity of the traditional method becomes higher. Given the optimal offloading decisionxi∗, problem P1 can be rewritten as problem P2, which is(9)P2:minαi,filoc∑i∈1,2,…,Neixi∗,(9a)0<filoc≤fimax,(9b)0≤ciriup≤1−αiT,(9c)0≤eiloc≤eihar+bi,(9d)0≤eioff≤eihar+bi,(9e)0≤αi≤1.Consequently, optimization problem P1 can be split into two subproblems, i.e., offloading decision and resource allocation (P2) problems.


### 4.1. Offloading Decision Generation

In this subsection, we develop a deep learning-based efficient and energy-saving offloading decision method to solve the offloading decision problem. In order to make the convergence faster and more stable, this paper constructs a deep neural network to generate binary offloading decision, as shown in Figure2. It consists of four parts, namely, input, deep neural network, experience replay buffer, and output. Initially, we obtain the labeled data through the greedy algorithm and then input the labeled data to train the initial DNN. Finally, the well-trained DNN is employed to make optimal offloading decision. Besides, in order to achieve ideal fitting effect, the output of each layer of the DNN is regularized. Furthermore, we adopt the stochastic gradient descent when it minimizes the loss function. This solving method updates the gradient function based on a single sample, which speeds up the convergence. Additionally, the stochastic gradient descent can also update the model in real time according to new samples, which has better adaptability.Figure 2
The generation process of offloading decision.Initially,N tasks with size ci are randomly inputted, where i∈1,2,…,N. According to the greedy strategy, 2N actions can be generated, and the optional actions increase exponentially with the increase of the number of tasks. Moreover, due to the variety and complexity of randomly generated tasks, it is crucial to avoid the system performance degradation caused by data growth. Our objective is to generate an offloading strategy function Π to obtain the optimal offloading action xi∗∈0,1 based on the consideration of minimizing total energy consumption. The offloading strategy function is described as(10)Π:ci↦xi∗.Considering the one-to-many feature of mapping, the time complexity of its processing is high, and this paper approximatesΠ via the parameterized function Fω,b based on DNN. We choose the action based on the principle of minimizing the total energy consumption of user devices, and the optimal offloading decision can be obtained, which is(11)x∗=argmin∑i∈1,2,…,Neici,xi∗.The DNN developed in this paper is composed of one input layer, three hidden layers, and one output layer, and it is fully connected from layer to layer. The activation function of the hidden layer is the ELU function, because the linear part of the ELU function can alleviate the disappearance of the gradient, and the other part can make the ELU more robust to input changes. At the same time, the output mean value of ELU is close to zero, which has a faster convergence rate. Assuming that the loss function of the sampleq∈1,2,…,m is the mean squared error loss function, the loss function of all m samples can be expressed as(12)Lossω,b=1m∑q=1myp−Fω,bcq2.Therefore, to prevent overfitting, the output of the previous layer is regularized to calculate the regularized loss function:(13)Lossω,b=1m∑q=1myi−Fω,bcq2+λm∑l=2Lω2.The network parameters of the neural network are updated by minimizing the value ofLossω,b by using the stochastic gradient descent. The updating definition is given as follows:(14)ω←ω−β∇ωLossω,b,(15)b←b−β∇bLossω,b,where β represents the iteration step size.After the neural network is trained, its weight coefficients and bias values reach the optimal value, and then the optimal offloading decision of the devicei will be obtained by inputting ci into the parameterized function Fω,b:(16)xi∗=Fω,bci.


### 4.2. Optimal Allocation of Resources

Once the optimal offloading decision is obtained, problem P1 can be converted into problem P2. From formula (9), it can be seen that problem P2 can be solved by traditional mathematical optimization methods. Therefore, we introduce the momentum gradient descent to solve problem P2. Compared with the traditional gradient descent algorithm, the momentum gradient descent algorithm accelerates the convergence rate.Initially, in terms of the obtained optimal offloading strategyxi∗, the energy consumption of device i within the time interval T can be indicated as(17)ei=1−xi∗δifiloc2ciR+xi∗cipi1−αiriup−νphiαiT.Gradient functions ofαi and filoc are, respectively, calculated through gradient descent and are defined as(18)∂ei∂αi=xicipi1−αi2riup−νphiT,∂ei∂filoc=21−xiδifilocciR.Subsequently, the variablesαi and filoc are calculated by utilizing the momentum gradient descent, and the update equation can be expressed as(19)αij+1=αij−uij+1,filocj+1=filocj−zij+1,where(20)uij+1=γ⋅uij+s⋅dij,zij+1=γ⋅zij+s⋅dij,where j represents the index of iteration; γ represents the attenuation coefficient; s indicates the iteration step size; variables ui and zi, respectively, denote the accumulated momentum of αi and filoc during the process of iteration; and di refers to the gradient function of ei, which is expressed as follows:(21)di=∂ei∂αi,∂ei∂filoc.Based on above solutions, the optimal time allocation ratioαi∗ and computing capability filoc∗ of the user device can be obtained when the maximum number of iterations is reached. Correspondingly, the minimum energy consumption sum of N devices can be obtained, that is,(22)e∗=∑i∈1,2,…,Neixi∗,αi∗,filoc∗.In order to facilitate a better understanding, the joint solution process of the above problems is summarized and presented in Algorithm1.Algorithm 1: Deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm.
Input: task sizeci,i∈1,2,…,N.Output: the optimal valuexi∗,filoc∗,αi∗ and minimum energy consumption e∗.(1)
Begin(2)
Initialize variablesfiloc,αi;(3)
Randomly inputN tasks with size ci;(4)
Obtain2N possible offloading actions;(5)
Calculate the optimal offloading actionx∗ by (11);(6)
Inputci,xi∗ to train DNN network, and update network parameters according to (14) and (15);(7)
Obtain the optimal parameterized functionFω,b;(8)
Input random new taskci into the well-trained DNN network (i.e., the parameterized function Fω,b, and achieve the optimal offloading action xi∗;(9)
while constraints (9a) to (9e) are all satisfied and j is within the maximum value; do(10)
Update thefiloc and αi by (19) based on accumulated momentum (20) and the gradient descent function (21);(11)
j=j+1;(12)
end while(13)
Obtainxi∗,filoc∗,αi∗, and the minimum total energy consumption e∗ according to (22).(14)
end


## 4.1. Offloading Decision Generation

In this subsection, we develop a deep learning-based efficient and energy-saving offloading decision method to solve the offloading decision problem. In order to make the convergence faster and more stable, this paper constructs a deep neural network to generate binary offloading decision, as shown in Figure2. It consists of four parts, namely, input, deep neural network, experience replay buffer, and output. Initially, we obtain the labeled data through the greedy algorithm and then input the labeled data to train the initial DNN. Finally, the well-trained DNN is employed to make optimal offloading decision. Besides, in order to achieve ideal fitting effect, the output of each layer of the DNN is regularized. Furthermore, we adopt the stochastic gradient descent when it minimizes the loss function. This solving method updates the gradient function based on a single sample, which speeds up the convergence. Additionally, the stochastic gradient descent can also update the model in real time according to new samples, which has better adaptability.Figure 2
The generation process of offloading decision.Initially,N tasks with size ci are randomly inputted, where i∈1,2,…,N. According to the greedy strategy, 2N actions can be generated, and the optional actions increase exponentially with the increase of the number of tasks. Moreover, due to the variety and complexity of randomly generated tasks, it is crucial to avoid the system performance degradation caused by data growth. Our objective is to generate an offloading strategy function Π to obtain the optimal offloading action xi∗∈0,1 based on the consideration of minimizing total energy consumption. The offloading strategy function is described as(10)Π:ci↦xi∗.Considering the one-to-many feature of mapping, the time complexity of its processing is high, and this paper approximatesΠ via the parameterized function Fω,b based on DNN. We choose the action based on the principle of minimizing the total energy consumption of user devices, and the optimal offloading decision can be obtained, which is(11)x∗=argmin∑i∈1,2,…,Neici,xi∗.The DNN developed in this paper is composed of one input layer, three hidden layers, and one output layer, and it is fully connected from layer to layer. The activation function of the hidden layer is the ELU function, because the linear part of the ELU function can alleviate the disappearance of the gradient, and the other part can make the ELU more robust to input changes. At the same time, the output mean value of ELU is close to zero, which has a faster convergence rate. Assuming that the loss function of the sampleq∈1,2,…,m is the mean squared error loss function, the loss function of all m samples can be expressed as(12)Lossω,b=1m∑q=1myp−Fω,bcq2.Therefore, to prevent overfitting, the output of the previous layer is regularized to calculate the regularized loss function:(13)Lossω,b=1m∑q=1myi−Fω,bcq2+λm∑l=2Lω2.The network parameters of the neural network are updated by minimizing the value ofLossω,b by using the stochastic gradient descent. The updating definition is given as follows:(14)ω←ω−β∇ωLossω,b,(15)b←b−β∇bLossω,b,where β represents the iteration step size.After the neural network is trained, its weight coefficients and bias values reach the optimal value, and then the optimal offloading decision of the devicei will be obtained by inputting ci into the parameterized function Fω,b:(16)xi∗=Fω,bci.


## 4.2. Optimal Allocation of Resources

Once the optimal offloading decision is obtained, problem P1 can be converted into problem P2. From formula (9), it can be seen that problem P2 can be solved by traditional mathematical optimization methods. Therefore, we introduce the momentum gradient descent to solve problem P2. Compared with the traditional gradient descent algorithm, the momentum gradient descent algorithm accelerates the convergence rate.Initially, in terms of the obtained optimal offloading strategyxi∗, the energy consumption of device i within the time interval T can be indicated as(17)ei=1−xi∗δifiloc2ciR+xi∗cipi1−αiriup−νphiαiT.Gradient functions ofαi and filoc are, respectively, calculated through gradient descent and are defined as(18)∂ei∂αi=xicipi1−αi2riup−νphiT,∂ei∂filoc=21−xiδifilocciR.Subsequently, the variablesαi and filoc are calculated by utilizing the momentum gradient descent, and the update equation can be expressed as(19)αij+1=αij−uij+1,filocj+1=filocj−zij+1,where(20)uij+1=γ⋅uij+s⋅dij,zij+1=γ⋅zij+s⋅dij,where j represents the index of iteration; γ represents the attenuation coefficient; s indicates the iteration step size; variables ui and zi, respectively, denote the accumulated momentum of αi and filoc during the process of iteration; and di refers to the gradient function of ei, which is expressed as follows:(21)di=∂ei∂αi,∂ei∂filoc.Based on above solutions, the optimal time allocation ratioαi∗ and computing capability filoc∗ of the user device can be obtained when the maximum number of iterations is reached. Correspondingly, the minimum energy consumption sum of N devices can be obtained, that is,(22)e∗=∑i∈1,2,…,Neixi∗,αi∗,filoc∗.In order to facilitate a better understanding, the joint solution process of the above problems is summarized and presented in Algorithm1.Algorithm 1: Deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm.
Input: task sizeci,i∈1,2,…,N.Output: the optimal valuexi∗,filoc∗,αi∗ and minimum energy consumption e∗.(1)
Begin(2)
Initialize variablesfiloc,αi;(3)
Randomly inputN tasks with size ci;(4)
Obtain2N possible offloading actions;(5)
Calculate the optimal offloading actionx∗ by (11);(6)
Inputci,xi∗ to train DNN network, and update network parameters according to (14) and (15);(7)
Obtain the optimal parameterized functionFω,b;(8)
Input random new taskci into the well-trained DNN network (i.e., the parameterized function Fω,b, and achieve the optimal offloading action xi∗;(9)
while constraints (9a) to (9e) are all satisfied and j is within the maximum value; do(10)
Update thefiloc and αi by (19) based on accumulated momentum (20) and the gradient descent function (21);(11)
j=j+1;(12)
end while(13)
Obtainxi∗,filoc∗,αi∗, and the minimum total energy consumption e∗ according to (22).(14)
end


## 5. Performance Evaluation

In this section, the effectiveness of the proposed mechanism is evaluated via numerical simulations, and the performance advantages of which are demonstrated by comparing it with other three methods.In our simulation, the transmitting powerpi of each device i is set to 0.8 W, and the task transmission rate riup is set to 12 Mb/s. The computing capability filoc of the terminal device is randomly generated from 0 to 8 MCycles/s. The number of CPU cycles required by the terminal device to compute 1 kbit task R is 6 MCycles, and the effective capacitance coefficient δi of the terminal device i is 0.000 01. In the energy-harvesting environment, we define the energy conversion efficiency ν as 0.78 and the initial value of the transmission power p as 11 W, and set the wireless channel gain hi from the energy base station to device i to 1. The time interval T is set to 1 s. In addition, we assume that the user layer contains 10 terminal devices and that the task size of each device i is randomly generated between 100 kbit and 200 kbit.Figure3 shows the influence of four optimization methods (stochastic gradient descent (SGD), Adam, RMSprop, and Adadelta) on the convergence rate of loss function when the DNN is constructed in this paper. It can be observed from the curves in the figure that as the number of iterations increases, the loss function values of the optimization methods except for Adadelta decrease sharply and reach the convergence value. Specifically, the SGD optimization method has the optimal convergence performance, and the loss function converges to a stable value within 40 iterations. The performance of Adam and RMSprop is relatively weaker. When the number of iterations is about 60 times, they will be convergent. Conversely, when the number of iterations reaches 100 times, the Adadelta optimization method still shows a large fluctuation without any sign for convergence. Consequently, in order to improve the convergence performance of loss function, we choose SGD as the optimization method to update the parameters of DNN in the following simulations.Figure 3
The influence of different optimization methods on loss function.Figure4 depicts the specific convergence effect of DNN loss function in our proposed algorithm. The value of loss function decreases sharply in the first 20 iterations and basically converges and stabilizes within 40 iterations. Because the DNN training results differ greatly from the ideal value in the initial iteration, with the number of training iterations increasing, the results gradually approach the optimal values, and the optimal neural network parameters are obtained by continuous training. Consequently, the loss function value decreases and closely reaches zero.Figure 4
The convergence effect of loss function.To demonstrate the performance advantages of the proposed mechanism, in the following simulations, we compare our proposed mechanism with other three related methods. “Full offloading” indicates that all tasks are all offloaded to edge nodes; “local computing” means that all tasks are computed in the local device; “proposed scheme” denotes the proposed mechanism in this paper; “greedy algorithm” indicates the greedy algorithm.Figure5 describes the total energy consumption for four different schemes under different numbers of terminals. This figure reveals that the total energy consumption for the four schemes shows an overall upward trend with the increase in the number of terminal devices. Initially, the number of tasks is less than 2. Since the required resources do not exceed the local computing capability, all schemes except “full offloading” choose to compute locally. However, with the increase of the number of tasks, the local resource is insufficient, and the local device begins to offload the tasks to the edge node, which will decrease the total energy consumption. In general, the “full offloading” scheme has the highest total energy consumption, followed by “local computing.” The total energy consumption of our proposed mechanism is the closest to the greedy algorithm. In terms of obtaining the optimal offloading decision, the time and energy costs of the greedy algorithm are much higher than our proposed mechanism. Therefore, the greedy algorithm is not applicable to practical scenarios, especially for handling complex big data problems. Based on the above comparisons, we can infer that the proposed mechanism in this paper has extraordinary performance advantages.Figure 5
Total energy consumption for different schemes.In Figure6, we analyze the influence on system energy consumption when the maximum computing capability of local device is set to 8, 12, and 16 MCycles/s. It can be seen from this bar chart that whatever the value of the maximum local computing capability fmax is, the larger the task data, the more the total energy consumed. For the tasks with the same size, the larger fmax is, the more energy is consumed. Specifically, as the number of tasks increases, more tasks choose to be executed locally due to the relatively abundant local computing resources, which results in large amount of energy consumption. By comparing the energy consumption of different task sizes, when fmax=8 MCycles/s, although the task size is increasing, the growth rate of energy consumption is relatively slow. Conclusively, in practical applications, energy consumption can be saved to a certain extent by dynamically adjusting the maximum computing capability of local device.Figure 6
Total energy consumption under different maximum computing capabilities of local device.


## 6. Conclusions

To build an efficient and energy-saving edge computing system for IoT, in this paper, we formulate an efficient and energy-saving computation offloading mechanism with energy harvesting. First, an optimization problem is established to minimize the total energy consumption of all terminal devices, with local computing resources, time allocation ratio of energy harvesting, and offloading decision jointly optimized. Second, to solve the previous optimization problem, we propose a deep learning-based efficient and energy-saving offloading decision and resource allocation algorithm and then obtain the optimal offloading and resource allocation strategy. Finally, we confirm the effectiveness of our proposed mechanism via simulation analysis. Compared with other benchmark methods, the proposed mechanism has a significant performance advantage in saving energy, and it can obtain the optimal value that approximates to the solution of greedy algorithm. In future work, we will plan to integrate blockchain technology into computation offloading with energy-harvesting mechanism for system security, such as ensuring the legitimacy of terminal devices [28].



---

*Source: 8167796-2021-12-27.xml*