Dynamic Task Offloading for NOMA-Enabled Mobile Edge Computing with Heterogeneous Networks

With the rapid development of the Internet of 'ings (IoT), more and more computation-intensive tasks are generated by IoT devices. Due to their own limitations, IoT devices cannot process all tasks locally, and some tasks need to be offloaded to edge servers for processing. In addition, nonorthogonal multiple access (NOMA) technology allows multiple IoT devices to share the same frequency resource. IoT devices can use NOMA technology to transmit data to increase the data transmission rate. In this article, we study the problem of NOMA-enabled dynamic task offloading in heterogeneous networks. We formulate a stochastic optimization problem to minimize system energy consumption. Using stochastic optimization techniques, we transform this problem into a deterministic optimization problem and decompose it into five sub-problems to solve. At the same time, we propose a NOMA-enabled dynamic task offloading (NDTO) algorithm. 'en, we mathematically analyze the performance of the NDTO algorithm. We conduct a series of parameter analysis experiments and comparative experiments, and the results verify the performance of the NDTO algorithm.


Introduction
In recent years, with the rapid development of Internet of ings (IoT) technology, various IoT devices have appeared in people's lives [1,2]. At the same time, more and more computation-intensive applications are emerging, such as virtual reality. ese computation-intensive applications generate a large number of computation-intensive tasks as they work. However, due to the limited computing resources and battery capacity of IoT devices, these computation-intensive tasks cannot be fully handled [3][4][5]. To cope with this situation, mobile cloud computing (MCC) came into being [6][7][8]. However, offloading tasks to cloud computing centers for processing will introduce significant delays [9][10][11]. e emergence of mobile edge computing (MEC) provides a new solution [12][13][14]. At the same time, in order to cope with the problem of data traffic explosion brought by the increasing number of IoT devices, a two-layer heterogeneous small cell network (SCN) is proposed [15]. e SCN is usually composed of macro base station (MBS) and small base station (SBS). Both the MBS and the SBS are generally deployed with an MEC server for providing services. SCN can expand network coverage and further improve user experience quality. erefore, SCN will play an important role in the future [16].
With the rapid increase of IoT devices and various computation-intensive applications, the traditional orthogonal multiple access (OMA) technology can no longer meet the increasing communication demands. Non-orthogonal multiple access (NOMA) technology is a promising technology that can alleviate the problem of scarcity of spectrum resources [17][18][19]. NOMA uses power multiplexing technology that allows multiple devices to share the same spectrum resources. us, NOMA can greatly improve the resource utilization efficiency of the wireless access network [20,21].
Since both the computing resources of IoT devices and the computing resources that MEC can provide are limited, it is challenging to design a suitable task offloading scheme to maximize the use of available computing resources [22][23][24]. First, the generation and arrival of tasks are dynamic. Second, the quality of the wireless channel is timevarying. Whether the wireless channel state is good or bad will have a great impact on task offloading. At the same time, the statistics of these factors are difficult to predict. erefore, it is urgent to design a task offloading scheme that can dynamically adapt to changes in wireless channels and task arrivals.
In this article, we study the NOMA-enabled dynamic task offloading problem in MEC. We work to minimize the long-term average energy consumption of the system. Meanwhile, we design a NOMA-enabled dynamic task offloading (NDTO) algorithm using stochastic optimization techniques. Moreover, we evaluate the performance of the NDTO algorithm through a series of experiments. Our contributions are as follows: (1) We study the problem of dynamic task offloading for SBSs and devices based on NOMA. Both SBSs and MBS are deployed with MEC servers. IoT devices can offload tasks to SBS for processing through NOMA technology. At the same time, the SBS can also offload the collected tasks to the MBS for processing. Our goal is to minimize the long-term average energy consumption of the system. (2) Since task arrival and channel state are time-varying. erefore, we transform the above problem into a deterministic optimization problem using stochastic optimization techniques. en, we decompose it into multiple sub-problems to solve. Meanwhile, we design the NDTO algorithm to solve this problem.
(3) We verify the effectiveness of the NDTO algorithm through parameter analysis and comparative experiments. Experimental results demonstrate the effectiveness of the NDTO algorithm in minimizing system energy consumption and maintaining task queue stability. e remainder of this article is as follows. In Section 2, we present the system model and problem formulation. A NOMA-enabled dynamic task offloading algorithm is proposed in Section 3. In Section 4, we analyze the NDTO algorithm mathematically. In Section 5, we experimentally verify the performance of the NDTO algorithm. In Section 6, we discuss related works. In Section 7, we conclude this study.

System Model.
In this study, we consider a system with one MBS and multiple SBSs. Each SBS is deployed with an MEC server to serve IoT devices. In this work, IoT devices can offload tasks to SBS for processing. In our model, there are S SBSs, which are defined as S � 1, 2, . . . , s, . . . , S { }. Each SBS has a fixed service area, and the service areas of any two SBSs do not overlap. Among them, there are N s IoT devices located in the service area of SBS s, which is represented as N s � 1, 2, . . . , i, . . . , N s . For the convenience of description, we denote the IoT device i within the service area of SBS s as U s,i . We consider a discrete slot model denoted as At the same time, t ∈ T, and the length of each slot is τ.
e main symbols are listed in Table 1.

Task and Communication
Model. In this study, each IoT device maintains two task queues, namely the local computing queue and the local offloading queue. e tasks in the local computing queue are processed locally by IoT devices. e tasks in the local offloading queue are offloaded to the SBS for processing. In each time slot, the size of the task generated by the IoT device U s,i is denoted as A s,i (t). I s,i (t) is an offload decision, indicating whether newly arrived tasks are placed on the local computing queue or the local offloading queue. When I s,i (t) � 0, the newly arrived task is placed in the local computing queue, otherwise, it is placed in the local offloading queue.
IoT devices communicate with SBS via NOMA wireless network. h s,i (t) represents the channel gain from the IoT device U s,i to the SBS s. We assume that the channel gain of IoT devices within the SBS's service area is in nonincreasing order, i.e., h s, Using the SIC technique, the signal is iteratively decoded in order of the IoTdevice's channel gain [25]. erefore, we can get the signal-to-noise ratio when the IoT device U s,i communicates with the SBS s as follows: where P s,i (t) represents the transmit power of the IoT device U s,i and σ 2 represents the channel noise power. erefore, the achievable data transmission rate when the IoT device U s,i communicates with the SBS s is expressed as follows: where B s represents the channel bandwidth allocated by SBS s to IoT devices. Orthogonal frequency division multiple access technology is used when SBS communicates with MBS. g s (t) represents the channel gain when the SBS s communicates with the MBS. P s (t) represents the transmit power of the SBS s. erefore, we can get the achievable data transmission rate when the SBS s communicates with the MBS as follows: where B m represents the channel bandwidth allocated by MBS to SBSs.

Queuing Model.
Each IoT device maintains a local computing queue and a local offloading queue. e number of CPU cycles consumed by the IoT device U s,i to process 1 bit of data is φ s,i . e amount of tasks processed locally by the IoT device in the time slot t is denoted as D l s,i (t), and the specific calculation method is as follows: where f l s,i (t) represents the CPU cycle frequency of the IoT device U s,i .
We define the maximum CPU cycle frequency of the IoT device U s,i as f l, max s,i . us, we can get: We use Q l s,i (t) to denote the task backlog of the local computing queue of IoT device U s,i . en, the evolution of Q l s,i (t) can be obtained as follows: e amount of tasks offloaded by IoT device U s,i in time slot t is denoted as D o s,i (t). Because the data transmission rate of IoT devices has an upper limit, the amount of offloaded tasks should satisfy: We define Q o s,i (t) as the task backlog of the local offloading queue of IoT device U s,i . en, we give the evolution of Q o s,i (t) as follows: Each SBS maintains a task queue for each IoT device in its service area to store tasks offloaded from IoT devices. In each time slot, the amount of tasks from the IoT device U s,i processed locally by the SBS is μ l s,i (t). en, μ o s,i (t) represents the amount of tasks from the IoT device U s,i that the SBS offloads to the MBS.
We define H s,i (t) to represent the task queue backlog that IoT device U s,i offloads to SBS s. en, the evolution of H s,i (t) is as follows:

Energy Consumption Model.
For each IoT device, its energy consumption includes two parts, namely local computing energy consumption and local offloading energy consumption. We know that the local computing energy consumption of an IoT device is closely related to its CPU frequency [26]. We denote the energy consumption of IoT device U s,i locally calculated in time slot t as E l s,i (t), as follows: where ξ s,i denotes the effective switched capacitance of the CPU. e offloading energy consumption of IoT devices is closely related to its transmit power. e energy consumption generated by IoT device U s,i offloading tasks to SBS s in time slot t is denoted by: In each time slot, the energy consumption generated by SBS includes two parts, one part is computing energy consumption, and the other part is offloading energy consumption. During time slot t, the energy consumption generated by the tasks from the IoT device U s,i processed by the SBS s is denoted as: where l 1 denotes the energy consumption coefficient of the MEC server in SBS s [27]. en, the energy consumption generated by SBS s offloading tasks to MBS is denoted as: All tasks offloaded by SBS will be handled by MBS. We set the energy consumption generated by the MBS to process the tasks from the IoT device U offloaded by the SBS s as: where l 2 is the energy consumption coefficient of MBS. erefore, in a time slot t, the total energy consumption generated by the system is as follows:

Problem Formulation.
Within each slot, we make a decision to determine whether newly arrived tasks should be executed locally or offloaded to the SBS for processing. Our goal is to minimize the long-term average energy consumption of the system, as follows: ere are certain challenges to solving this problem. First, the generation and arrival of tasks are random. Second, the wireless channel state is also constantly changing.
erefore, next, we use stochastic optimization techniques to solve this problem.

NOMA-Enabled Dynamic Task Offloading Algorithm Design
In this section, we introduce stochastic optimization techniques to solve problem (16). Using stochastic optimization techniques, we design a NOMA-enabled Dynamic Task Offloading (NDTO) algorithm [28]. e NDTO algorithm can make optimal offloading decisions without the need for future statistics. en, we decompose the optimization problem into five sub-problems to solve.

Problem Transformation.
In order to maintain the stability of the task queue, we define the Lyapunov function as follows: where indicates the queue backlog vector. en, the Lyapunov drift function is given as follows: Our goal is to keep the task queue stable while minimizing energy consumption. To this end, we give the Lyapunov drift plus penalty function as follows: where V is the trade-off parameter. We can minimize energy consumption by minimizing the upper bound of (19). e following theorem gives the upper bound of (19).

Theorem 1.
e upper bound of the drift plus penalty function is shown below.
where Z is a constant.

NOMA-Enabled Dynamic Task Offloading Algorithm.
In this section, we propose the NDTO algorithm to minimize the upper bound of (19). We define Since Z is a constant, the upper bound minimization problem can be formulated as follows: In Problem (25), its decision variables are I(t), f l (t), D o (t), μ l (t), and μ o (t). Because the decision variables are decoupled, we can decompose Problem (25) into five corresponding sub-problems. Below, we will give the optimal solution for each sub-problem.

Offloading Decision.
By separating out the part related to I s,i (t) in Problem (25), the offloading decision sub-problem is given as follows: Problem (26) is a zero-one integer programming problem. erefore, we give the optimal solution for the offloading decision as follows:

CPU Frequency for IoT Devices.
e optimal CPU frequency of IoT devices in each time slot can be obtained by solving the following sub-problems: Problem (28) is a convex optimization problem. Its first derivative function is 3Vξ s,i f l,2 s,i (t)τ − Q l s,i (t)τ/φ s,i . When its first derivative function is equal to 0, we can get f l s,i (t) � ��������������� (Q l s,i (t)/3Vξ s,i φ s,i ). en, we can get its second derivative function as 6Vξ s,i f l s,i (t)τ ≥ 0. us, the optimal solution of f l s,i (t) as follows:

Offloading Computation for IoT Devices.
e subproblem of offloading computation for IoT devices is described as follows: Problem (30) is a linear programming problem. We define W s,i (t) � (VP s,i (t)/R s,i (t)) − Q o s,i (t) + H s,i (t). us, the offloading computation D o s,i (t) of the IoT device U s,i is calculated as follows:

SBS Local Computation Allocation.
e SBS local computation allocation sub-problem is formulated as follows: Problem (32) can be viewed as a knapsack problem, where the weights of μ l s,i (t) are Vl 1 − H s,i (t). e specific steps to solve this problem are given as follows: (1) We initialize the amount of tasks that SBS s can handle in the time slot t as C l s � f e s,i (t)τ/φ e . (2) For each SBS, the IoT devices in its service area are sorted according to the value of Vl 1 − H s,i (t) from low to high. (3) e SBS s sequentially assigns the size of the SBS local computation to the IoT device U s,i according to the sorting results, as follows: where i * � arg min i∈N s Vl 1 − H s,i (t) . (4) Updating the amount of tasks that SBS s can still process in the time slot t is C l s � C l s − μ l, * s,i (t).

SBS Offloading Computation Allocation.
e SBS Offloading computation allocation sub-problem is formulated as follows: We define Y s,i (t) � VP s (t)/R s (t) − H s,i (t) + Vl 2 . Similar to solving Problem (32), the specific steps to solve this problem are given as follows: (1) We initialize the amount of tasks that SBS s can offload in time slot t as C o s � R s (t)τ. (2) For each SBS, the IoT devices in its service area are sorted according to the value of Y s,i (t) from low to high. (3) e SBS s sequentially assigns the size of the SBS local computation to the IoT device U s,i according to the sorting results, as follows: where i * � arg min i∈N s Y s,i (t) .

Analysis of NOMA-Enabled Dynamic Task Offloading Algorithm
In this section, we analyze the performance of the NDTO algorithm mathematically. We give the following lemma to demonstrate the performance of the NDTO algorithm. Lemma 1. No matter how the task arrival rate λ changes, there is always an optimal decision π * that is independent of the queue length. From this, we can get: where E * (λ) is minimum energy consumption with λ.
Proof. Caratheodory's theorem can be used to prove Lemma 1. Here, we will not repeat them. □ It is worth noting that the task arrival rate is capped. erefore, the upper limit of the system energy consumption is denoted as E, and the lower limit is denoted as � E. We define L � lim . According to Lemma 1, we give eorem 2 to analyze the performance of NDTO. □ Theorem 2. For any value of V, when the task arrival rate is λ + ϵ, according to NDTO, we have: Proof. Based on Lemma 1, for any decision π and task arrival rate λ + ϵ, we can get: Our NDTO algorithm is to minimize the value of (19). us, for decision π, we have:

Evaluation
In this section, we evaluate the performance of the NDTO algorithm through a series of experiments.

Experiment Setup.
In the experiments, we consider a system with 100 IoTdevices, 5 SBSs, and 1 MBS. Within each time slot, the task arrival rate satisfies a uniform distribution, i.e., A s,i (t) ∼ U[0, 1.4] Mb. For each IoT device, the maximum CPU frequency is 1 GHz, and the transmit power is uniformly distributed, which is P s,i (t) ∼ U[0.01, 0.1]w. For each SBS, the transmit power is uniformly distributed, which is P(t) ∼ U [1,5]w. We set the wireless channel bandwidth to 10 6 Hz, the channel noise power to 10 − 13 w, and the number of CPU cycles required to process 1-bit data to 1000. Furthermore, the effective switched capacitance is 10 − 27 , the time slot length is 1 s, and l 1 � 10 − 4 J/b [29,30]. Figure 1 shows the effect of different parameter V on energy consumption. It can be seen that energy consumption decreases as V increases, which is consistent with the result of (37). is is because the greater the value of V, the greater the weight of the system energy consumption. erefore, the NDTO algorithm will dynamically adjust the offloading strategy to reduce energy consumption. Figure 2 shows the effect of different parameter V on the queue length. It can be seen that the queue length increases as V increases, which is consistent with the result of (38). Combining Figures 1 and 2, it can be seen that the NDTO algorithm can achieve a trade-off between energy consumption and queue length. Figures 3 and 4 show the effect of different task arrival rates on energy consumption and queue length. We set the task arrival rate to α · A s,i (t), where α � 0.8, 1.0, and 1.2. As can be seen from Figure 3, the  higher the task arrival rate, the higher the system energy consumption. An increase in the task arrival rate leads to an increase in computing tasks, and thus an increase in energy consumption. As can be seen from Figure 4, the higher the task arrival rate, the larger the queue length. Because the transmission capacity and computing power of IoT devices will not change due to the change of task arrival rate. Taken together, the NDTO algorithm can adapt to changes of the task arrival rate to achieve a trade-off between energy consumption and queue length.  consumption and queue length. We set the number of IoT devices to increase from 30 to 120 in increments of 10 each. Figure 5 shows that energy consumption increases as the number of devices increases. Because the amount of generated tasks increases with the number of devices, energy consumption increases accordingly. But the computing power and transmission capacity of SBS are limited. erefore, as shown in Figure 6, the queue length increases with the number of devices.

Comparison Experiment.
We compare the NDTO algorithm with two other baseline algorithms to further evaluate the performance of NDTO. e tasks generated by IoT devices are all placed on the local offloading queue. Figures 7 and 8 show the relationship between energy consumption and queue length for different algorithms, respectively. As can be seen from Figure 7, the energy consumption of the offload-only computation algorithm is the lowest, followed by the NDTO algorithm, and finally the local-only computation algorithm.
It can be seen from Figure 8 that the queue length of the offload-only computation algorithm increases linearly, which will lead to instability of the task queue. At the same time, we can see that the change in queue length of the NDTO algorithm and the local-only computation algorithm is basically the same. Taken together, our NDTO algorithm is more advantageous in minimizing system energy consumption and maintaining task queue stability.

Related Work
In recent years, with the development and popularization of IoT and wireless communication technologies, the number of IoT devices has exploded [31,32]. In addition, the proliferation of mobile devices has facilitated the development of computation-intensive applications [33,34]. e emergence of the MEC paradigm has attracted great attention from industry and academia. Mao et al. [35] proposed an online joint radio and computational resource management algorithm for multi-user MEC systems. e algorithm implements a trade-off between power consumption and execution delay. Chen et al. [36] studied the problem of energy-saving task offloading in MEC systems. en, they propose an energy-efficient dynamic offloading algorithm. e algorithm can minimize the transmission energy consumption while limiting the queue length. Huang et al. [37] considered wirelessly powered MEC networks with the binary offload. ey propose an online algorithm that adapts task offloading decisions and radio resource allocation to time-varying radio channel conditions. e above work only considers the situation that one base station provides services for multiple users, but does not consider the situation that one MBS covers multiple SCNs. e problem of one MBS covering multiple SCNs has also been extensively studied. Guo et al. [38] studied the problem of energy-efficient computation offloading in MEC systems with SCN. Wherein each user equipment not only decided whether to perform offloading, but also decided to which base station to offload. Wang et al. [39] studied the problem of computational offloading and content caching in heterogeneous wireless SCNs. en, they proposed an ADMM-based distributed algorithm to solve the proposed problem. e above work is based on OMA technology. But with the explosive growth of IoT devices, OMA technology can no longer meet user needs. erefore, NOMA technology is applied in SCN as a new generation of mobile communication technology. Yang et al. [40] considered the task offloading problem in NOMAbased small cell MEC networks. Meanwhile, a hybrid genetic hill climbing algorithm is proposed to minimize the weighted total cost of energy consumption and latency. Most of these works can be predicted based on task arrival or channel state. However, task arrival and channel state are affected by many factors, and it is unrealistic to achieve accurate prediction.
In our work, we study the problem of NOMA-based dynamic task offloading in heterogeneous networks. We specify stochastic problems to minimize the total energy consumption of the system. Meanwhile, we transform it into five sub-problems using stochastic optimization techniques. Finally, we design an NDTO algorithm to solve this problem.

Conclusion
In this article, we study the NOMA-enabled dynamic task offloading problem in MEC. We describe it as a stochastic optimization problem, where the goal is to minimize system energy consumption while keeping the task queue stable. Using stochastic optimization techniques, we decompose this problem into five deterministic sub-problems to solve. en, an NDTO algorithm is designed to solve this problem. Meanwhile, we evaluate the performance of the NDTO algorithm through mathematical analysis and experiments. e experimental results show that the NDTO algorithm is effective in minimizing energy consumption while maintaining queue stability.

Data Availability
e data used to support the findings of this study can be obtained from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.