# Dynamic Resource Allocation and Task Offloading for NOMA-Enabled IoT Services in MEC

Authors: Hua Xing; Jiajie Xu; Jintao Hu; Ying Chen; Jiwei Huang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Integrating nonorthogonal multiple access (NOMA) and edge computing into the Internet of Things (IoT) for resource allocation and computing offloading can effectively reduce delay and energy consumption and improve spectrum efficiency. Computation tasks can be split into several independent subtasks and can be locally processed by IoT devices or offloaded to the MEC servers to process. The limited computing resources deteriorate the system performance. Thus, it is crucial to design the reasonable allocation strategies of computation resource and transmission power resource. In this paper, we jointly determine the CPU-cycle frequency allocation and transmission power allocation and formulate a stochastic optimization to minimize the energy consumption of IoT devices. Based on the Lyapunov optimization theory, we decompose the optimization problem into two deterministic subproblems to solve separately. One of them is obtained by seeking the first derivative, and the other is solved by using the best response idea after establishing the game model. Meanwhile, we propose a dynamic resource allocation and task offloading (DRATO) algorithm. Moreover, the simulation experiments show that the proposed algorithm effectively improves system performance and reduces energy consumption compared to three other benchmark methods.


---

## Body

## 1. Introduction

With the rapid development of Internet of Things (IoT) and mobile communication technology, there are more and more types of IoT devices and IoT applications, which provide abundant and convenient services for end users [1–3]. However, the computing load and energy load for IoT devices are also aggravated [4–6]. The computing resource and energy resource of IoT devices are limited, which cannot effectively support these applications [7, 8]. The mobile cloud computing (MCC) allows IoT devices to offload computing tasks to the cloud servers for processing and make use of the powerful computing power to make up for the shortage of computing resources [9–11]. However, the long-distance transmission of tasks will lead to high transmission delay and communication energy consumption.The mobile edge computing (MEC) technology is proposed as a new computing paradigm to tackle this challenge [12–14]. It can provide computing resources and service to edge devices and users. Specifically, the IoT devices can offload local tasks to the MEC server deployed in the BS for processing, which can effectively reduce system delay and energy consumption [15–17]. With the connection demand of massive devices and increasingly scarce spectrum resources, the traditional orthogonal multiple access (OMA) technology cannot meet the communication demand. Thus, the nonorthogonal multiple access (NOMA) has attracted extensive attention as a new generation of mobile communication access technology. The NOMA technology enables multiple devices to be multiplexed on the same time-frequency resource block, which increases the number of user access [18]. In the uplink, BS can use successive interference cancellation (SIC) technology to effectively eliminate the interference among IoT devices, which can improve the spectrum resource utilization.In particular, the current research works focus on the application of NOMA in the single BS and multiuser scenario, which only studies the intracell interference among devices and ignores the intercell interference [19]. Based on the above analysis, our paper considers the resource allocation and computing offloading scenario based NOMA among multiple BSs and multiple devices. We aim to minimize the energy consumption of IoT devices. According to the Lyapunov optimization technology, the optimization problem is divided into two parts and solved separately. This includes CPU-cycle frequency allocation and transmission power allocation. In addition, a dynamic resource allocation and task offloading (DRATO) algorithm is proposed [20], and we evaluate the performance of the DRATO algorithm through simulation experiments. Our main contributions are as follows:(i)
We consider a joint resource allocation and computation offloading for the multi-BS and multidevice-based NOMA system. The BSs are allocated to the MEC servers to provide computing resources for the IoT devices. When IoT devices transmit tasks to the MEC servers, we regard not only the interference of devices in the same BS using the same channel but also the interference of other BSs using the same channel.(ii)
We formulate the problem to minimize the energy consumption of all devices by jointly optimizing the computation resource allocation and transmission power allocation. We use the Lyapunov technology to transform problem and build model game to solve it. Firstly, based on Lyapunov theory, we divide our optimization problem into two subproblems. Then, one is solved by derivation, and the other is modeled as a noncooperative game model to solve.(iii)
We propose a DRATO algorithm to obtain the desired strategy sets of CPU-cycle frequency allocation and transmission power allocation. In addition, the effectiveness of our algorithm is verified by the parameter analysis and comparison experiments.The rest of this paper is organized as follows. We build the system model and formulate the research problem in Section2. The optimization problem is divided into two parts and we design DRATO algorithm in Section 3. In Section 4, the performance of DRATO algorithm is verified. The related work is presented in Section 5. Furthermore, we summarize this paper in Section 6.


## 2. System Model and Problem Formulation

In this section, we present the system model of resource allocation and computation offloading among the multi-BS and multidevice-based NOMA, while we also formulate the problem to minimize the energy consumption of all devices by jointly optimizing the computation resource allocation and transmission power allocation.


### 2.1. System Framework

As depicted in Figure1, we consider a joint resource allocation and computation offloading system among multi-BS and multi-IoT-device-based NOMA. The BSs are equipped with MEC servers and denoted by a set ℳ=1,2,…,M. The IoT devices are defined by a set ℐ=1,2,…,I, which can process their tasks locally or offload them to MEC servers to process via several wireless channels. There is interference among devices sharing the same wireless channel. Based on [21], a discrete time-slotted model is considered; we define each time slot length as τ and t∈0,1,…,T−1. In addition, the main notations are listed in Table 1.Figure 1
Multidevice system-based NOMA in MEC.Table 1
Notations.
SymbolDescriptionℐThe set of IoT devicesℳThe set of BSsNThe set of channelsτTime slot lengthfi,mtThe CPU-cycle frequency for devicei of BS mfmaxThe CPU-cycle frequency constraint for devicesciThe required CPU cycles to compute 1-bit data of deviceikiThe effective switched capacitance of the CPU chip structure of deviceiBi,mltThe number of data bits computed locally for devicei of BS mEi,mltThe energy consumed of local computation for devicei of BS mpi,m,ntThe amount of transmit power of devicei of BS m on channel npmaxThe transmission power constraint of devicesRi,mtThe data transmission rate from devicei to BS mBi,mrtThe number of data bits transmitted fromi-th device to BS mEi,mrtThe energy consumption of data transmission from devicei to BS mri,m,ntThe interference for devicei caused by other devices of same BS m on channel nr˜i,m,ntThe interference for devicei caused by other devices of other BSs on channel ngi,m,ntThe channel gain for devicei of BS m on channel nQiQueue length ofi-th deviceVThe trade-off parameter of queue length and energy consumptionBThe bandwidth of the devicesEtTotal energy consumption of devicesSm,nThe set of devices transmitting tasks to BSm on channel n


### 2.2. Local Processing Model

The tasks of IoT devices can be processed locally or offloaded to MEC servers to process. In thet-th time slot, the number of data bits computed locally for device i of BS m is given as follows:(1)Bi,mlt=τfi,mtci,∀i∈I,m∈M,where fi,mt represents the CPU-cycle frequency for device i of BS m. ci denotes the required CPU-cycles for computing 1 bit of device i and τ is the time slot length.In thet-th time slot, the computation energy consumption for local processing of device i of BS m is obtained as follows:(2)Ei,mlt=kifi,mt2ciBi,ml,where ki is the effective switched capacitance, which depends on the chip structure of the IoT device i [22].


### 2.3. Task Offloading Model

We denote the transmission power and the transmission power constraint for IoT devicei of BS m on channel n in t-th time slot as pi,m,nt and pmax, respectively [23]. Thus, we have(3)0≤pi,m,nt≤pmax.In NOMA, a subchannel can be allocated to multiple devices in the same time slott. Based on [19], the BS adopts SIC technique to eliminate the interference from the received signal. The devices with higher channel gains are decoded in turn and the other devices are seen as the interference. In time slot t, gi,m,nt represents the uplink channel gain from device i to BS m on channel n. We assume that the channel gain of each device is in an increasing order; that is, g1,m,nt≤g2,m,n≤…≤gi,m,nt≤…≤gI,m,n. The signal-to-interference-plus-noise ratio (SINR) of the signal received by device i is given as follows:(4)ri,m,nt=∑iϵSm,n|gu,m,n<gi,m,npu,m,ntgu,m,nt,where Sm,n is the set of devices transmitting tasks to BS m on channel n. iϵSm,n|gu,m,n<gi,m,n means that device i is in Sm,n and its channel gain is greater than device u. pu,m,nt represents the transmission power of the IoT device i from BS m on channel n in t-th time slot [24, 25].On channeln, device i is not only interfered by devices in the same BS but also interfered by devices in other BSs on channel n. Thus, the received SINR of device i from BS v on channel n in time slot t is given as follows:(5)r˜i,m,nt=∑v=1,v≠mM∑i=1Ipi,v,ntgi,v,nt.Referring toShannonformula, the data transmission rate for device i of BS m on the n-th channel at time slot t is shown as follows:(6)Ri,m,nt=Blog21+pi,m,ntgi,m,ntσ2+ri,m,nt+r˜i,m,nt,where B is bandwidth of BSs. For each IoT device i, we define σ2 as the noise power.The energy consumed by offloading tasks from devicei to BS m during time period τ is obtained as follows:(7)Ei,mrt=τpi,m,nt.If we denoteAit as the number of new generated tasks by the i-th device in time slot t and the tasks can be processed in the next time slot t+1, the queue length of the i-th IoT device’s task buffer in time slot t is denoted by Qit. Thus, the queue length in time slot t+1 is as follows:(8)Qit+1=maxQit−Bi,mlt−Bi,mrt,0+Ait,where Bi,mlt represents the number of data bits computed locally for device i of BS m in t-th time slot. Bi,mrt is the number of data bits transmitted from device i to BS m in t-th time slot.


### 2.4. Problem Formulation

According to above local processing model and task offloading model, the total energy consumption is represented as(9)Et=∑i=1IEi,mlt+Ei,mrt.In this paper, the objective is to minimize the average total energy consumption of all devices by jointly optimizing computation resource allocation and transmission power allocation under CPU-cycle frequency constraint, transmission power constraint, and task buffers constraint. Then, the optimization problem can be formulated as follows:(10)P1minfi,mt,pi,m,ntE¯t=limT⟶∞1T∑t=1TE∑i=1IEi,mlt+Ei,mrts.t.,C1.0≤fi,mt≤fmax,C2.0≤pi,m,nt≤pmax,C3.limt⟶∞EQitt=0.It is obvious that problemP1 is a stochastic optimization problem. It is because the new arrival tasks and the transmission power of IoT devices are difficult to predict, which are dynamic and stochastic. Thus, we take advantage of Lyapunov optimization technology, which can decompose the stochastic optimization problem into several deterministic optimization subproblems [26, 27].


## 2.1. System Framework

As depicted in Figure1, we consider a joint resource allocation and computation offloading system among multi-BS and multi-IoT-device-based NOMA. The BSs are equipped with MEC servers and denoted by a set ℳ=1,2,…,M. The IoT devices are defined by a set ℐ=1,2,…,I, which can process their tasks locally or offload them to MEC servers to process via several wireless channels. There is interference among devices sharing the same wireless channel. Based on [21], a discrete time-slotted model is considered; we define each time slot length as τ and t∈0,1,…,T−1. In addition, the main notations are listed in Table 1.Figure 1
Multidevice system-based NOMA in MEC.Table 1
Notations.
SymbolDescriptionℐThe set of IoT devicesℳThe set of BSsNThe set of channelsτTime slot lengthfi,mtThe CPU-cycle frequency for devicei of BS mfmaxThe CPU-cycle frequency constraint for devicesciThe required CPU cycles to compute 1-bit data of deviceikiThe effective switched capacitance of the CPU chip structure of deviceiBi,mltThe number of data bits computed locally for devicei of BS mEi,mltThe energy consumed of local computation for devicei of BS mpi,m,ntThe amount of transmit power of devicei of BS m on channel npmaxThe transmission power constraint of devicesRi,mtThe data transmission rate from devicei to BS mBi,mrtThe number of data bits transmitted fromi-th device to BS mEi,mrtThe energy consumption of data transmission from devicei to BS mri,m,ntThe interference for devicei caused by other devices of same BS m on channel nr˜i,m,ntThe interference for devicei caused by other devices of other BSs on channel ngi,m,ntThe channel gain for devicei of BS m on channel nQiQueue length ofi-th deviceVThe trade-off parameter of queue length and energy consumptionBThe bandwidth of the devicesEtTotal energy consumption of devicesSm,nThe set of devices transmitting tasks to BSm on channel n


## 2.2. Local Processing Model

The tasks of IoT devices can be processed locally or offloaded to MEC servers to process. In thet-th time slot, the number of data bits computed locally for device i of BS m is given as follows:(1)Bi,mlt=τfi,mtci,∀i∈I,m∈M,where fi,mt represents the CPU-cycle frequency for device i of BS m. ci denotes the required CPU-cycles for computing 1 bit of device i and τ is the time slot length.In thet-th time slot, the computation energy consumption for local processing of device i of BS m is obtained as follows:(2)Ei,mlt=kifi,mt2ciBi,ml,where ki is the effective switched capacitance, which depends on the chip structure of the IoT device i [22].


## 2.3. Task Offloading Model

We denote the transmission power and the transmission power constraint for IoT devicei of BS m on channel n in t-th time slot as pi,m,nt and pmax, respectively [23]. Thus, we have(3)0≤pi,m,nt≤pmax.In NOMA, a subchannel can be allocated to multiple devices in the same time slott. Based on [19], the BS adopts SIC technique to eliminate the interference from the received signal. The devices with higher channel gains are decoded in turn and the other devices are seen as the interference. In time slot t, gi,m,nt represents the uplink channel gain from device i to BS m on channel n. We assume that the channel gain of each device is in an increasing order; that is, g1,m,nt≤g2,m,n≤…≤gi,m,nt≤…≤gI,m,n. The signal-to-interference-plus-noise ratio (SINR) of the signal received by device i is given as follows:(4)ri,m,nt=∑iϵSm,n|gu,m,n<gi,m,npu,m,ntgu,m,nt,where Sm,n is the set of devices transmitting tasks to BS m on channel n. iϵSm,n|gu,m,n<gi,m,n means that device i is in Sm,n and its channel gain is greater than device u. pu,m,nt represents the transmission power of the IoT device i from BS m on channel n in t-th time slot [24, 25].On channeln, device i is not only interfered by devices in the same BS but also interfered by devices in other BSs on channel n. Thus, the received SINR of device i from BS v on channel n in time slot t is given as follows:(5)r˜i,m,nt=∑v=1,v≠mM∑i=1Ipi,v,ntgi,v,nt.Referring toShannonformula, the data transmission rate for device i of BS m on the n-th channel at time slot t is shown as follows:(6)Ri,m,nt=Blog21+pi,m,ntgi,m,ntσ2+ri,m,nt+r˜i,m,nt,where B is bandwidth of BSs. For each IoT device i, we define σ2 as the noise power.The energy consumed by offloading tasks from devicei to BS m during time period τ is obtained as follows:(7)Ei,mrt=τpi,m,nt.If we denoteAit as the number of new generated tasks by the i-th device in time slot t and the tasks can be processed in the next time slot t+1, the queue length of the i-th IoT device’s task buffer in time slot t is denoted by Qit. Thus, the queue length in time slot t+1 is as follows:(8)Qit+1=maxQit−Bi,mlt−Bi,mrt,0+Ait,where Bi,mlt represents the number of data bits computed locally for device i of BS m in t-th time slot. Bi,mrt is the number of data bits transmitted from device i to BS m in t-th time slot.


## 2.4. Problem Formulation

According to above local processing model and task offloading model, the total energy consumption is represented as(9)Et=∑i=1IEi,mlt+Ei,mrt.In this paper, the objective is to minimize the average total energy consumption of all devices by jointly optimizing computation resource allocation and transmission power allocation under CPU-cycle frequency constraint, transmission power constraint, and task buffers constraint. Then, the optimization problem can be formulated as follows:(10)P1minfi,mt,pi,m,ntE¯t=limT⟶∞1T∑t=1TE∑i=1IEi,mlt+Ei,mrts.t.,C1.0≤fi,mt≤fmax,C2.0≤pi,m,nt≤pmax,C3.limt⟶∞EQitt=0.It is obvious that problemP1 is a stochastic optimization problem. It is because the new arrival tasks and the transmission power of IoT devices are difficult to predict, which are dynamic and stochastic. Thus, we take advantage of Lyapunov optimization technology, which can decompose the stochastic optimization problem into several deterministic optimization subproblems [26, 27].


## 3. Dynamic Resource Allocation and Task Offloading for IoT in MEC

### 3.1. Problem Transformation

According to Lyapunov optimization technology, the optimization problem (10) is transformed into two deterministic optimization subproblems [28]. We define Zt as the queue backlog matrix, and Zt=Q1t,Q2t,…,Qnt. When t = 0, LZt = 0. The Lyapunov function is defined as(11)LZt=12∑i=1IQi2t.Specifically,LZt represents the queue backlog state of the IoT devices. If and only if the task queues’ congestion is large, LZt will be large. When the queue backlogs of IoT devices become small, LZt will be small. Thus, we can reduce the value of LZt to obtain the low congestion state of queue.Theone-slot conditional Lyapunov driftΔZt is represented as follows:(12)ΔZt=ELZt+1−LZt|Zt.Combining our optimization problem to minimize the transmission energy consumption and the IoT devices’ queue length, we define thedrift-plus-energy equation in each time slot as follows:(13)ΔvZt=ΔZt+VEE|Zt,where V is the trade-off parameter between the queue length and energy consumption. Without loss of generality, V≥0. The greater the value of V and the greater the weight of energy consumption, we give the upper bound of the drift-plus-energy.Theorem 1.
For0≤fi,mt≤fmax and 0≤pi,m,nt≤pmax, the function ΔvZt satisfies the following inequality:(14)ΔZt+VEEt|Qt≤η+VEEt|Qt+E∑i=1IQitAit−B∑i,mtZt|,where η is a fixed value.Proof.
According to equation (8) and maxa−b,02≤a−b2 for a,b>0, we let maxQit−Bi,mlt−Bi,mrt,0=Qit−B∑i,mt, where B∑i,mt=Bi,mlt+Bi,mrt or B∑i,mt=Qit. Thus, we have(15)Qit+12=maxQit−Bi,mlt−Bi,mrt,02+Ait2+2AitmaxQit−Bi,mlt−Bi,mrt,0≤Qit−B∑i,mt2+Ait2+2AitQit.
SubtractingQit2 from both sides of the inequality in (15) and dividing by 2, we have(16)12Qit+12−Qit2≤12B∑i,mt2+Ait2+QitAit−B∑i,mt.
Summarizing the above equations (11) and (12) and the inequality in (16), we obtain(17)ΔZt≤12∑i=1IB∑i,mt2+Ait2+∑i=1IQitEAit−B∑i,mt|Zt.
Finally, we addVEt to both sides of equation (17) and get conditional expectation value, which is as follows:(18)ΔZt+VEEt|Zt≤12E∑i=1IAit2+B∑i,mt2|Zt+VEEt|Zt+E∑i=1IQitAit−B∑i,mt|Zt.
Note thatAit+B∑i,mt2 with condition Zt is deterministic; hence,(19)E∑i=1IAit2+B∑i,mt2|Zt=∑i=1IAit2+B∑i,mt2.
Definingη=∑i=1IAit2+B∑i,mt2, the proof of Theorem 1 is completed.


### 3.2. Dynamic Resource Allocation and Task Offloading Algorithm Design

Becauseη and Ait are the constants in each slot, the optimization problem is rewritten as follows:(20)P2minfi,mt,pi,m,ntVEt−∑i=1IQitB∑i,mt.s.t.(21)C1⋅0≤fi,mt≤fmax,(22)C2⋅0≤pi,m,nt≤pmax.Obviously, problemP2 can be divided into two parts to optimize. The optimization of the first part is related to local computing, and the main parameter of optimization is the device’s CPU-cycle frequency strategy. The optimization of the second part is related to the task offloading. The optimization parameter is the transmission power strategy of the device offloading tasks to the MEC servers. Thus, problem (20) can be converted into two independent subproblems P2.1 and P2.2, and we will solve them separately.


#### 3.2.1. Computation Resource Allocation

This part mainly studies the CPU-cycle frequency strategy optimization in local calculation.(23)P2.1minfi,mt∑i=1IτVkifi,mt3−Qitfi,mtci,s.t.(24)0≤fi,mt≤fmax.ProblemP2.1 is convex and the optimal solution is straightforward. The formula took the derivative with respect to fi,mt, which is expressed as 3Vkifi,mt2τ−τQit/ci. Firstly, we make the derivative be zero and get fi,mt=Qit/3Vkici. Then, we get its second derivative function as 6Vkifi,mtτ≥0. Thus, we obtain the optimal solution of fi,mt, which is as follows:(25)fi,mt=minQit3Vkici,fmax.


#### 3.2.2. Transmission Power Allocation

This part mainly studies the optimization of transmission power strategy in task offloading process.(26)P2.2minpi,m,nt∑i=1IVEi,mrt−QitBi,mrt,s.t.(27)0≤pi,m,nt≤pmax.In the transmission power decision-making problem among multiple devices, the power decision of each device depends not only on its own power strategy but also on the power strategies of other devices. All devices want to choose the optimal power strategies to reduce owner energy consumption, so there is a competitive relationship of transmission power resources among devices. Game theory is a good tool to solve the problem of competition decision-making among players, which uses a mathematical model to solve the interest conflict among multiple players and obtain the best strategy set [29]. Thus, we can use game theory to address the problem of transmission power decision-making.In this part, the transmission power decision-making problem among devices is modeled as a transmission power game. In this game, the players are all devices competing for power resources to minimize their owner energy consumption. The transmission power strategy game can be defined asΓ=ℐ,pi∈ℐ,Fi∈ℐ, where ℐ is the set of devices and p is the feasible strategy set of devices. The energy consumption function is F. Each device seeks a profitable power strategy to minimize its own energy consumption.Formula (26) is simplified and expressed as(28)Fpi,m,nt,p−i,m,nt=τ∑i=1IVpi,m,nt−BQitlog21+pi,m,ntgi,m,ntσ2+ri,m,nt+r˜i,m,nt.Definition 1 (Nash Equilibrium).
For a noncooperative gameΓ, if there is a strategy set p∗=p1∗,p2∗,…,pI∗ and no device wants to reduce its own energy consumption by changing owner strategy, then we call p∗ an NE strategy profile.(29)Fipi,m,nt∗,p−i,m,nt∗≤Fipi,m,nt,p−i,m,nt∗,where Fi is device i’s energy consumption and p−i,m,n∗ presents the strategies chosen by devices excluding device i.The NE is a stable state, in which no device has any intention to change its strategy for reducing energy consumption. Thus, we can obtain the optimal strategy set by proving the existence of NE. The definition of the exact potential game is given as follows.Definition 2.
(Potential Game) For Γ, if and only if there is a potential function Φpi,m,nt,p−i,m,nt, the relationship between Φpi,m,nt,p−i,m,nt and Fipi,m,nt,p−i,m,nt is as follows:(30)Fipi,m,nt,p−i,m,nt−Fipi,m,n't,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n't,p−i,m,nt.
Γ is an exact potential game, and there is at least a pure strategy NE, which should be proved by us. The specific certification process is as follows.Theorem 2.
Γ is an exact potential game, and the potential function is as follows:(31)Φpi,m,nt,p−i,m,nt=τVpi,m,nt−BQitlog2pi,m,ntgi,m,nt+σ2+ri,m,nt+r˜i,m,nt.Proof.
Based on formula (31), when devices’ power strategies change, we get the following equation:(32)Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt=Vτ∑j∈ℐ/j≠ipj,m,nt+Vτpi,m,n′t−τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj−τQitBlog2pi,m,n′tgi,m,nt+δi+τ∑j∈ℐ/j≠iQjtBlog2δj+τQitBlog2δi−Vτ∑j∈ℐ/j≠ipj,m,nt−Vτpi,m,nt+τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj+τQitBlog2pi,m,ntgi,m,nt+δi−τ∑j∈ℐ/j≠iQjtBlog2δj−τQitBlog2δi=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi,where δi=σ2+ri,m,nt+r˜i,m,nt.
With the devices’ power strategies changing, we get the change of the potential function as follows:(33)Φpi,m,n′t,p−i,m,nt−Φpi,m,nt,p−i,m,nt=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi=Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt.
Thus,(34)Fipi,m,nt,p−i,m,nt−Fipi,m,n′t,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n′t,p−i,m,nt.
Theorem2 is proved.Summarizing the above two parts, we can determine the optimal computing resource allocation decisions and transmission power allocation decisions. The specific steps are described in Algorithm1.Algorithm 1: The dynamic resource allocation and task offloading (DRATO) algorithm.
Require:(1)
Input:ℐ,ℳ, N, Sm,n, ci, ki, gi,m,nt, B, σ, Ait;(2)
Output: The CPU-cycle frequency decisionf∗t and transmission power decision p∗t;(3)
forw←1 to Wdo(4)
fori←1 to Ido(5)
Computefi,mt according to the formula (25);(6)
ComputeBi,mlt according to (1);(7)
Fit are calculated according to the formula (28);(8)
Obtain the power strategypi,m,nt of device i with the minimal energy consumption pit=argminpi,m,n∈pFpi,m,nt,p−i,m,nt;(9)
ComputeBi,mrt=τRi,m,nt based on the known variable values;(10)
Update queue lengthQit according to (8);(11)
end for(12)
Each devicei attains the best power strategies pi,m,nt in the w-th iterations;(13)
Generate the updated strategy profile,pw+1=p1w+1,p2w+1,…,pIw+1;(14)
end forTo effectively solve the optimization problem, we propose the dynamic resource allocation and task offloading (DRATO) algorithm. In the DRATO algorithm, we adopt the idea of best response to attain the optimal strategy set. In steps 5–7, we obtain the values offi,mt, Bi,mlt, and Fit based on initialized parameters. In step 8, we always select the transmission power strategy of device i with the minimal energy consumption in each iteration w. According to the power strategy obtained, we calculate Bi,mrt and update the queue length. After each iteration for all devices, we will update the policy set of the device and take it as the initial policy set for the next iteration. Because of the existence of NE, we can obtain the optimal strategy set through finite iterations. When the number of iteration is W, the iteration ends. Meanwhile, IoT devices get the lowest energy consumption and the optimal strategy set.


## 3.1. Problem Transformation

According to Lyapunov optimization technology, the optimization problem (10) is transformed into two deterministic optimization subproblems [28]. We define Zt as the queue backlog matrix, and Zt=Q1t,Q2t,…,Qnt. When t = 0, LZt = 0. The Lyapunov function is defined as(11)LZt=12∑i=1IQi2t.Specifically,LZt represents the queue backlog state of the IoT devices. If and only if the task queues’ congestion is large, LZt will be large. When the queue backlogs of IoT devices become small, LZt will be small. Thus, we can reduce the value of LZt to obtain the low congestion state of queue.Theone-slot conditional Lyapunov driftΔZt is represented as follows:(12)ΔZt=ELZt+1−LZt|Zt.Combining our optimization problem to minimize the transmission energy consumption and the IoT devices’ queue length, we define thedrift-plus-energy equation in each time slot as follows:(13)ΔvZt=ΔZt+VEE|Zt,where V is the trade-off parameter between the queue length and energy consumption. Without loss of generality, V≥0. The greater the value of V and the greater the weight of energy consumption, we give the upper bound of the drift-plus-energy.Theorem 1.
For0≤fi,mt≤fmax and 0≤pi,m,nt≤pmax, the function ΔvZt satisfies the following inequality:(14)ΔZt+VEEt|Qt≤η+VEEt|Qt+E∑i=1IQitAit−B∑i,mtZt|,where η is a fixed value.Proof.
According to equation (8) and maxa−b,02≤a−b2 for a,b>0, we let maxQit−Bi,mlt−Bi,mrt,0=Qit−B∑i,mt, where B∑i,mt=Bi,mlt+Bi,mrt or B∑i,mt=Qit. Thus, we have(15)Qit+12=maxQit−Bi,mlt−Bi,mrt,02+Ait2+2AitmaxQit−Bi,mlt−Bi,mrt,0≤Qit−B∑i,mt2+Ait2+2AitQit.
SubtractingQit2 from both sides of the inequality in (15) and dividing by 2, we have(16)12Qit+12−Qit2≤12B∑i,mt2+Ait2+QitAit−B∑i,mt.
Summarizing the above equations (11) and (12) and the inequality in (16), we obtain(17)ΔZt≤12∑i=1IB∑i,mt2+Ait2+∑i=1IQitEAit−B∑i,mt|Zt.
Finally, we addVEt to both sides of equation (17) and get conditional expectation value, which is as follows:(18)ΔZt+VEEt|Zt≤12E∑i=1IAit2+B∑i,mt2|Zt+VEEt|Zt+E∑i=1IQitAit−B∑i,mt|Zt.
Note thatAit+B∑i,mt2 with condition Zt is deterministic; hence,(19)E∑i=1IAit2+B∑i,mt2|Zt=∑i=1IAit2+B∑i,mt2.
Definingη=∑i=1IAit2+B∑i,mt2, the proof of Theorem 1 is completed.


## 3.2. Dynamic Resource Allocation and Task Offloading Algorithm Design

Becauseη and Ait are the constants in each slot, the optimization problem is rewritten as follows:(20)P2minfi,mt,pi,m,ntVEt−∑i=1IQitB∑i,mt.s.t.(21)C1⋅0≤fi,mt≤fmax,(22)C2⋅0≤pi,m,nt≤pmax.Obviously, problemP2 can be divided into two parts to optimize. The optimization of the first part is related to local computing, and the main parameter of optimization is the device’s CPU-cycle frequency strategy. The optimization of the second part is related to the task offloading. The optimization parameter is the transmission power strategy of the device offloading tasks to the MEC servers. Thus, problem (20) can be converted into two independent subproblems P2.1 and P2.2, and we will solve them separately.


### 3.2.1. Computation Resource Allocation

This part mainly studies the CPU-cycle frequency strategy optimization in local calculation.(23)P2.1minfi,mt∑i=1IτVkifi,mt3−Qitfi,mtci,s.t.(24)0≤fi,mt≤fmax.ProblemP2.1 is convex and the optimal solution is straightforward. The formula took the derivative with respect to fi,mt, which is expressed as 3Vkifi,mt2τ−τQit/ci. Firstly, we make the derivative be zero and get fi,mt=Qit/3Vkici. Then, we get its second derivative function as 6Vkifi,mtτ≥0. Thus, we obtain the optimal solution of fi,mt, which is as follows:(25)fi,mt=minQit3Vkici,fmax.


### 3.2.2. Transmission Power Allocation

This part mainly studies the optimization of transmission power strategy in task offloading process.(26)P2.2minpi,m,nt∑i=1IVEi,mrt−QitBi,mrt,s.t.(27)0≤pi,m,nt≤pmax.In the transmission power decision-making problem among multiple devices, the power decision of each device depends not only on its own power strategy but also on the power strategies of other devices. All devices want to choose the optimal power strategies to reduce owner energy consumption, so there is a competitive relationship of transmission power resources among devices. Game theory is a good tool to solve the problem of competition decision-making among players, which uses a mathematical model to solve the interest conflict among multiple players and obtain the best strategy set [29]. Thus, we can use game theory to address the problem of transmission power decision-making.In this part, the transmission power decision-making problem among devices is modeled as a transmission power game. In this game, the players are all devices competing for power resources to minimize their owner energy consumption. The transmission power strategy game can be defined asΓ=ℐ,pi∈ℐ,Fi∈ℐ, where ℐ is the set of devices and p is the feasible strategy set of devices. The energy consumption function is F. Each device seeks a profitable power strategy to minimize its own energy consumption.Formula (26) is simplified and expressed as(28)Fpi,m,nt,p−i,m,nt=τ∑i=1IVpi,m,nt−BQitlog21+pi,m,ntgi,m,ntσ2+ri,m,nt+r˜i,m,nt.Definition 1 (Nash Equilibrium).
For a noncooperative gameΓ, if there is a strategy set p∗=p1∗,p2∗,…,pI∗ and no device wants to reduce its own energy consumption by changing owner strategy, then we call p∗ an NE strategy profile.(29)Fipi,m,nt∗,p−i,m,nt∗≤Fipi,m,nt,p−i,m,nt∗,where Fi is device i’s energy consumption and p−i,m,n∗ presents the strategies chosen by devices excluding device i.The NE is a stable state, in which no device has any intention to change its strategy for reducing energy consumption. Thus, we can obtain the optimal strategy set by proving the existence of NE. The definition of the exact potential game is given as follows.Definition 2.
(Potential Game) For Γ, if and only if there is a potential function Φpi,m,nt,p−i,m,nt, the relationship between Φpi,m,nt,p−i,m,nt and Fipi,m,nt,p−i,m,nt is as follows:(30)Fipi,m,nt,p−i,m,nt−Fipi,m,n't,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n't,p−i,m,nt.
Γ is an exact potential game, and there is at least a pure strategy NE, which should be proved by us. The specific certification process is as follows.Theorem 2.
Γ is an exact potential game, and the potential function is as follows:(31)Φpi,m,nt,p−i,m,nt=τVpi,m,nt−BQitlog2pi,m,ntgi,m,nt+σ2+ri,m,nt+r˜i,m,nt.Proof.
Based on formula (31), when devices’ power strategies change, we get the following equation:(32)Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt=Vτ∑j∈ℐ/j≠ipj,m,nt+Vτpi,m,n′t−τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj−τQitBlog2pi,m,n′tgi,m,nt+δi+τ∑j∈ℐ/j≠iQjtBlog2δj+τQitBlog2δi−Vτ∑j∈ℐ/j≠ipj,m,nt−Vτpi,m,nt+τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj+τQitBlog2pi,m,ntgi,m,nt+δi−τ∑j∈ℐ/j≠iQjtBlog2δj−τQitBlog2δi=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi,where δi=σ2+ri,m,nt+r˜i,m,nt.
With the devices’ power strategies changing, we get the change of the potential function as follows:(33)Φpi,m,n′t,p−i,m,nt−Φpi,m,nt,p−i,m,nt=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi=Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt.
Thus,(34)Fipi,m,nt,p−i,m,nt−Fipi,m,n′t,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n′t,p−i,m,nt.
Theorem2 is proved.Summarizing the above two parts, we can determine the optimal computing resource allocation decisions and transmission power allocation decisions. The specific steps are described in Algorithm1.Algorithm 1: The dynamic resource allocation and task offloading (DRATO) algorithm.
Require:(1)
Input:ℐ,ℳ, N, Sm,n, ci, ki, gi,m,nt, B, σ, Ait;(2)
Output: The CPU-cycle frequency decisionf∗t and transmission power decision p∗t;(3)
forw←1 to Wdo(4)
fori←1 to Ido(5)
Computefi,mt according to the formula (25);(6)
ComputeBi,mlt according to (1);(7)
Fit are calculated according to the formula (28);(8)
Obtain the power strategypi,m,nt of device i with the minimal energy consumption pit=argminpi,m,n∈pFpi,m,nt,p−i,m,nt;(9)
ComputeBi,mrt=τRi,m,nt based on the known variable values;(10)
Update queue lengthQit according to (8);(11)
end for(12)
Each devicei attains the best power strategies pi,m,nt in the w-th iterations;(13)
Generate the updated strategy profile,pw+1=p1w+1,p2w+1,…,pIw+1;(14)
end forTo effectively solve the optimization problem, we propose the dynamic resource allocation and task offloading (DRATO) algorithm. In the DRATO algorithm, we adopt the idea of best response to attain the optimal strategy set. In steps 5–7, we obtain the values offi,mt, Bi,mlt, and Fit based on initialized parameters. In step 8, we always select the transmission power strategy of device i with the minimal energy consumption in each iteration w. According to the power strategy obtained, we calculate Bi,mrt and update the queue length. After each iteration for all devices, we will update the policy set of the device and take it as the initial policy set for the next iteration. Because of the existence of NE, we can obtain the optimal strategy set through finite iterations. When the number of iteration is W, the iteration ends. Meanwhile, IoT devices get the lowest energy consumption and the optimal strategy set.


## 3.2.1. Computation Resource Allocation

This part mainly studies the CPU-cycle frequency strategy optimization in local calculation.(23)P2.1minfi,mt∑i=1IτVkifi,mt3−Qitfi,mtci,s.t.(24)0≤fi,mt≤fmax.ProblemP2.1 is convex and the optimal solution is straightforward. The formula took the derivative with respect to fi,mt, which is expressed as 3Vkifi,mt2τ−τQit/ci. Firstly, we make the derivative be zero and get fi,mt=Qit/3Vkici. Then, we get its second derivative function as 6Vkifi,mtτ≥0. Thus, we obtain the optimal solution of fi,mt, which is as follows:(25)fi,mt=minQit3Vkici,fmax.


## 3.2.2. Transmission Power Allocation

This part mainly studies the optimization of transmission power strategy in task offloading process.(26)P2.2minpi,m,nt∑i=1IVEi,mrt−QitBi,mrt,s.t.(27)0≤pi,m,nt≤pmax.In the transmission power decision-making problem among multiple devices, the power decision of each device depends not only on its own power strategy but also on the power strategies of other devices. All devices want to choose the optimal power strategies to reduce owner energy consumption, so there is a competitive relationship of transmission power resources among devices. Game theory is a good tool to solve the problem of competition decision-making among players, which uses a mathematical model to solve the interest conflict among multiple players and obtain the best strategy set [29]. Thus, we can use game theory to address the problem of transmission power decision-making.In this part, the transmission power decision-making problem among devices is modeled as a transmission power game. In this game, the players are all devices competing for power resources to minimize their owner energy consumption. The transmission power strategy game can be defined asΓ=ℐ,pi∈ℐ,Fi∈ℐ, where ℐ is the set of devices and p is the feasible strategy set of devices. The energy consumption function is F. Each device seeks a profitable power strategy to minimize its own energy consumption.Formula (26) is simplified and expressed as(28)Fpi,m,nt,p−i,m,nt=τ∑i=1IVpi,m,nt−BQitlog21+pi,m,ntgi,m,ntσ2+ri,m,nt+r˜i,m,nt.Definition 1 (Nash Equilibrium).
For a noncooperative gameΓ, if there is a strategy set p∗=p1∗,p2∗,…,pI∗ and no device wants to reduce its own energy consumption by changing owner strategy, then we call p∗ an NE strategy profile.(29)Fipi,m,nt∗,p−i,m,nt∗≤Fipi,m,nt,p−i,m,nt∗,where Fi is device i’s energy consumption and p−i,m,n∗ presents the strategies chosen by devices excluding device i.The NE is a stable state, in which no device has any intention to change its strategy for reducing energy consumption. Thus, we can obtain the optimal strategy set by proving the existence of NE. The definition of the exact potential game is given as follows.Definition 2.
(Potential Game) For Γ, if and only if there is a potential function Φpi,m,nt,p−i,m,nt, the relationship between Φpi,m,nt,p−i,m,nt and Fipi,m,nt,p−i,m,nt is as follows:(30)Fipi,m,nt,p−i,m,nt−Fipi,m,n't,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n't,p−i,m,nt.
Γ is an exact potential game, and there is at least a pure strategy NE, which should be proved by us. The specific certification process is as follows.Theorem 2.
Γ is an exact potential game, and the potential function is as follows:(31)Φpi,m,nt,p−i,m,nt=τVpi,m,nt−BQitlog2pi,m,ntgi,m,nt+σ2+ri,m,nt+r˜i,m,nt.Proof.
Based on formula (31), when devices’ power strategies change, we get the following equation:(32)Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt=Vτ∑j∈ℐ/j≠ipj,m,nt+Vτpi,m,n′t−τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj−τQitBlog2pi,m,n′tgi,m,nt+δi+τ∑j∈ℐ/j≠iQjtBlog2δj+τQitBlog2δi−Vτ∑j∈ℐ/j≠ipj,m,nt−Vτpi,m,nt+τ∑j∈ℐ/j≠iQjtBlog2pj,m,ntgj,m,nt+δj+τQitBlog2pi,m,ntgi,m,nt+δi−τ∑j∈ℐ/j≠iQjtBlog2δj−τQitBlog2δi=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi,where δi=σ2+ri,m,nt+r˜i,m,nt.
With the devices’ power strategies changing, we get the change of the potential function as follows:(33)Φpi,m,n′t,p−i,m,nt−Φpi,m,nt,p−i,m,nt=Vτpi,m,n′t−Vτpi,m,nt−τQitBlog2pi,m,n′tgi,m,nt+δi+τQitBlog2pi,m,ntgi,m,nt+δi=Fpi,m,n′t,p−i,m,nt−Fpi,m,nt,p−i,m,nt.
Thus,(34)Fipi,m,nt,p−i,m,nt−Fipi,m,n′t,p−i,m,nt=Φpi,m,nt,p−i,m,nt−Φpi,m,n′t,p−i,m,nt.
Theorem2 is proved.Summarizing the above two parts, we can determine the optimal computing resource allocation decisions and transmission power allocation decisions. The specific steps are described in Algorithm1.Algorithm 1: The dynamic resource allocation and task offloading (DRATO) algorithm.
Require:(1)
Input:ℐ,ℳ, N, Sm,n, ci, ki, gi,m,nt, B, σ, Ait;(2)
Output: The CPU-cycle frequency decisionf∗t and transmission power decision p∗t;(3)
forw←1 to Wdo(4)
fori←1 to Ido(5)
Computefi,mt according to the formula (25);(6)
ComputeBi,mlt according to (1);(7)
Fit are calculated according to the formula (28);(8)
Obtain the power strategypi,m,nt of device i with the minimal energy consumption pit=argminpi,m,n∈pFpi,m,nt,p−i,m,nt;(9)
ComputeBi,mrt=τRi,m,nt based on the known variable values;(10)
Update queue lengthQit according to (8);(11)
end for(12)
Each devicei attains the best power strategies pi,m,nt in the w-th iterations;(13)
Generate the updated strategy profile,pw+1=p1w+1,p2w+1,…,pIw+1;(14)
end forTo effectively solve the optimization problem, we propose the dynamic resource allocation and task offloading (DRATO) algorithm. In the DRATO algorithm, we adopt the idea of best response to attain the optimal strategy set. In steps 5–7, we obtain the values offi,mt, Bi,mlt, and Fit based on initialized parameters. In step 8, we always select the transmission power strategy of device i with the minimal energy consumption in each iteration w. According to the power strategy obtained, we calculate Bi,mrt and update the queue length. After each iteration for all devices, we will update the policy set of the device and take it as the initial policy set for the next iteration. Because of the existence of NE, we can obtain the optimal strategy set through finite iterations. When the number of iteration is W, the iteration ends. Meanwhile, IoT devices get the lowest energy consumption and the optimal strategy set.


## 4. Simulation Results

This section consists of parameter analysis and comparison experiments. We have analyzed the influence of four parameters on the energy consumption and queue length. The performance of DRATO algorithm is evaluated by comparison experiments.We consider a NOMA-MEC-enabled network with 3 BSs and 9 IoT devices. The IoT devices are randomly distributed to the BSs’ coverage area. There are overlapping areas among BSs. The system bandwidth is available to all BSs, which is 1e6 Hz [26]. The time slot of simulation results is 3000 s. Moreover, the simulation parameters used throughout the simulations are set in Table 2.Figure 2
Effect ofV on energy consumption.Figure 3
Effect ofV on queue length.Figure 4
Effect of the task arrival rate on energy consumption.Figure 5
Effect of task arrival rate on queue length.Figure 6
Effect of the computing resource constraint on energy consumption.Figure 7
Effect of transmission power constraint on energy consumption.Table 2
Parameters used in the evaluation.
ParametersValueThe number of devices9The number of BSs3The number of channels9The required CPU-cycles to compute1-Bit data of devices737.5 cycles/bit [23]The max CPU-cycle frequency for devices1e9 Hz [23]The bandwidth of the BS1e6 HzThe transmission power for each device[0.02, 0.1] W [22]The background noise3.98e − 21 W [30]


### 4.1. Parameter Analysis

(1)
Impact of trade-off parameterV: Figures 2 and 3 describe the impact of trade-off parameter V on energy consumption and queue length. As shown in Figure 2, as V increases, the energy consumption will decrease. It is because the larger V is, the higher the weight of energy consumption is compared to the queue length. The DRATO algorithm reduces the energy consumption of the system by adjusting the allocation strategies of CPU-cycle frequency and transmission power. According to Figure 3, the queue length also increases with the rise of V. With the increase of V, the system always waits for the best time to process tasks. For example, devices backlog a number of tasks locally and then offload the backlog of tasks to the edge servers to process in a specific time slot. It will lead to the queue backlog. Combined with Figures 2 and 3, it means that DRATO algorithm can achieve a trade-off between energy consumption and queue length by adjusting parameter V, which also can keep the stability of the queue.(2)
Impact of task arrival rate: Figures4 and 5 describe the effect of task arrival rate on energy consumption and queue length. We consider that the task arrival rate is α·Ait, and α is 0.2, 0.4, and 0.6, respectively. As shown in Figure 4, with the growth of task arrival rates, energy consumption has an upward trend. It is because, with more tasks, more tasks need to be computed locally or offloaded to MEC servers to process. Meanwhile, total energy consumption becomes large. According to Figure 5, when the task arrival rate increases, queue length will tend to rise. The reason is that the number of tasks increases and tasks are not handled in time, which will lead to a backlog of tasks and result in the increase of queue length.(3)
Impact of computing resource constraintfmax: Figure 6 depicts the effect of computing resource constraint fmax on total energy consumption including energy consumption of local computation and energy consumption of task offloading process. As shown in Figure 6, when the CPU-cycle frequency rises, the energy consumption will increase accordingly. It is because local computing energy consumption increases with the increase of CPU-cycle frequency allocated for devices, which leads to higher total energy consumption for devices.(4)
Impact of transmission power constraintpmax: Figure 7 shows the effect of transmission power constraint pmax on total energy consumption. With the increase of the transmission power constraint, the total energy consumption also shows an upward trend. The reason is that the larger the transmission power allocated, the larger transmission energy consumption during task offloading process. Meanwhile, the total energy consumption will increase.


### 4.2. Comparison Experiment

To further verify the effectiveness of the proposed DRATO algorithm, we compare the energy consumption and queue length with three benchmark algorithms which are stated as follows:(i)
AllLocal: In each time slot, all devices choose to compute all tasks locally.(ii)
AllOffload: In each time slot, all computation tasks of each device are offloaded to MEC servers to process.(iii)
Random: In each time slot, all devices randomly assign tasks to compute locally or offload to MEC servers for execution.Figure8 describes the energy consumption of four different algorithms in the fixed time slot. With the change of time, the energy consumption of AllOffload algorithm increases sharply, and energy consumptions of the other three algorithms remain stabilized at a low value all the time. It can be observed that the energy consumption of the DRATO algorithm is lowest among four algorithms, which is 47% lower than that of AllOffload algorithm. It can be seen that the DRATO algorithm can effectively reduce the total energy consumption.Figure 8
Performance comparison in terms of energy consumption.Figure9 depicts the queue length of four different algorithms in the fixed time slot. Obviously, the queue length of the DRATO algorithm is lowest among four algorithms and it remains stable all the time. It is because the proposed DRATO algorithm can dynamically schedule the CPU-cycle frequency strategy and transmission power strategy to adapt to the changes of tasks arriving. As shown in Figure 9, AllOffload algorithm and AllLocal algorithm increase linearly with time. The reason is that the computation resources and transmission power resources of devices are limited. When the number of tasks is too large, there will be a backlog of tasks and the queue length will continue to increase. In the meantime, we can see that the queue lengths of the DRATO algorithm and the random algorithm remain at a low level.Figure 9
Performance comparison in terms of queue length.Together with Figures8 and 9, the proposed DRATO algorithm can effectively reduce the energy consumption and queue length, which has better performance.


## 4.1. Parameter Analysis

(1)
Impact of trade-off parameterV: Figures 2 and 3 describe the impact of trade-off parameter V on energy consumption and queue length. As shown in Figure 2, as V increases, the energy consumption will decrease. It is because the larger V is, the higher the weight of energy consumption is compared to the queue length. The DRATO algorithm reduces the energy consumption of the system by adjusting the allocation strategies of CPU-cycle frequency and transmission power. According to Figure 3, the queue length also increases with the rise of V. With the increase of V, the system always waits for the best time to process tasks. For example, devices backlog a number of tasks locally and then offload the backlog of tasks to the edge servers to process in a specific time slot. It will lead to the queue backlog. Combined with Figures 2 and 3, it means that DRATO algorithm can achieve a trade-off between energy consumption and queue length by adjusting parameter V, which also can keep the stability of the queue.(2)
Impact of task arrival rate: Figures4 and 5 describe the effect of task arrival rate on energy consumption and queue length. We consider that the task arrival rate is α·Ait, and α is 0.2, 0.4, and 0.6, respectively. As shown in Figure 4, with the growth of task arrival rates, energy consumption has an upward trend. It is because, with more tasks, more tasks need to be computed locally or offloaded to MEC servers to process. Meanwhile, total energy consumption becomes large. According to Figure 5, when the task arrival rate increases, queue length will tend to rise. The reason is that the number of tasks increases and tasks are not handled in time, which will lead to a backlog of tasks and result in the increase of queue length.(3)
Impact of computing resource constraintfmax: Figure 6 depicts the effect of computing resource constraint fmax on total energy consumption including energy consumption of local computation and energy consumption of task offloading process. As shown in Figure 6, when the CPU-cycle frequency rises, the energy consumption will increase accordingly. It is because local computing energy consumption increases with the increase of CPU-cycle frequency allocated for devices, which leads to higher total energy consumption for devices.(4)
Impact of transmission power constraintpmax: Figure 7 shows the effect of transmission power constraint pmax on total energy consumption. With the increase of the transmission power constraint, the total energy consumption also shows an upward trend. The reason is that the larger the transmission power allocated, the larger transmission energy consumption during task offloading process. Meanwhile, the total energy consumption will increase.


## 4.2. Comparison Experiment

To further verify the effectiveness of the proposed DRATO algorithm, we compare the energy consumption and queue length with three benchmark algorithms which are stated as follows:(i)
AllLocal: In each time slot, all devices choose to compute all tasks locally.(ii)
AllOffload: In each time slot, all computation tasks of each device are offloaded to MEC servers to process.(iii)
Random: In each time slot, all devices randomly assign tasks to compute locally or offload to MEC servers for execution.Figure8 describes the energy consumption of four different algorithms in the fixed time slot. With the change of time, the energy consumption of AllOffload algorithm increases sharply, and energy consumptions of the other three algorithms remain stabilized at a low value all the time. It can be observed that the energy consumption of the DRATO algorithm is lowest among four algorithms, which is 47% lower than that of AllOffload algorithm. It can be seen that the DRATO algorithm can effectively reduce the total energy consumption.Figure 8
Performance comparison in terms of energy consumption.Figure9 depicts the queue length of four different algorithms in the fixed time slot. Obviously, the queue length of the DRATO algorithm is lowest among four algorithms and it remains stable all the time. It is because the proposed DRATO algorithm can dynamically schedule the CPU-cycle frequency strategy and transmission power strategy to adapt to the changes of tasks arriving. As shown in Figure 9, AllOffload algorithm and AllLocal algorithm increase linearly with time. The reason is that the computation resources and transmission power resources of devices are limited. When the number of tasks is too large, there will be a backlog of tasks and the queue length will continue to increase. In the meantime, we can see that the queue lengths of the DRATO algorithm and the random algorithm remain at a low level.Figure 9
Performance comparison in terms of queue length.Together with Figures8 and 9, the proposed DRATO algorithm can effectively reduce the energy consumption and queue length, which has better performance.


## 5. Related Work

A number of research works focused on resource allocation and computing offloading in MEC in recent years [22, 31–35]. In [31], the authors jointly optimized the offline mode, channel allocation, and device-to-device (D2D) pairing to minimize the computational pressure of large-scale computing in MEC. They modeled the problem as the computing offloading task game among multiple users. Yu et al. considered the edge computing system-based NOMA in the power Internet of Things (PIoT). They exploited the Lyapunov technology to decompose the optimization problem into three subproblems: task splitting, resource block allocation, and computation resource allocation [32]. Zhao et al. studied a dynamic optimization problem of minimizing energy consumption and computing resources in MEC and decomposed the problem into four subproblems to solve based on the Lyapunov technology [22]. In [33], the authors considered joint edge computing and the cloud computing to achieve secure task offloading based blockchain scenario. They aimed to minimize energy consumption and the response time of task.The NOMA technology can effectively improve spectral efficiency, which has been widely studied. Liu et al. considered uplink resource allocation NOMA-based scenario in 6G. They focused on maximizing the average total transmission rate of 6G-enabled cognitive IoT (CIoT) under the minimum transmission rates constraint [36]. In [37], the authors studied the intelligent uplink resource allocation based-NOMA system. They adapted the deep reinforcement learning (DRL) and SARSA-learning to design an effective algorithm. Liu et al. focused on the radio resource allocation and computation allocation-based NOMA for IoT devices scenario. They maximized energy efficiency by adjusting the strategy of the subchannel allocation and power allocation [38].For the stochastic optimization problem, a number of works use Lyapunov method and reinforcement learning method [39–41]. In [39], the authors formulated a nonlinear integral dynamic optimization problem to reduce the cost and number of fresh sensors needed. They firstly transformed the optimization problem to the static problem. Then, they conducted a game model to solve problems, which can effectively reduce the complexity of the algorithm. Based on deep learning, Gu et al. proposed a job resource demand estimation method based on regression model to avoid overallocation of computing resources.Different from existing research work, we study the computation resource allocation and transmission power allocation in combining resource allocation and computing offloading scenario. We formulate the stochastic problem to minimize the total energy consumption of IoT devices and apply the Lyapunov technology to transform it into two subproblems. In addition, we introduce the NOMA technology to eliminate the interinterference and intrainterference of IoT devices.


## 6. Conclusion

In this paper, we investigate the computing resource allocation and transmission power allocation to minimize total energy consumption for multidevice-based NOMA in MEC. Based on Lyapunov theory, we transform optimization problem into two deterministic subproblems and build the noncooperative game model to solve. A dynamic resource allocation and task offloading (DRATO) algorithm has been proposed to obtain the desired strategy sets of CPU-cycle frequency and transmission power. In addition, the effectiveness of our algorithm is verified by the simulation results.



---

*Source: 8072493-2022-08-31.xml*