Abstract
Electric Internet of things (EIoT) that integrates 5G and edge computing can provide data transmission and processing guarantee for smart grid. However, computation offloading optimization including joint optimization of server selection and computation resource allocation still faces several challenges such as difficulty in tradeoff balance among various quality of service (QoS) parameters, coupling between server selection and computation resource allocation, and multi-device competition. To address these challenges, we propose an empirical matching-based computation offloading optimization algorithm for 5G and edge computing-integrated EIoT. The optimization objective is to minimize the computation offloading delay by jointly optimizing large timescale server selection and small timescale computation resource allocation. We first model the large timescale server selection problem as a many-to-one matching problem, which can be decoupled from small timescale computation resource allocation by establishing a matching preference list based on empirical performance. Then, the large timescale server selection problem is solved by pricing-based matching with a quota algorithm. Furthermore, based on the obtained suboptimal result of large timescale server selection, the small timescale computation resource allocation problem is subsequently solved by Lagrange dual decomposition, the result of which is used to update large timescale empirical performance. Finally, extensive simulations are carried out to demonstrate the superior performance of the proposed algorithm by comparing it with existing algorithms.
1. Introduction
In order to achieve the energy supply-demand balance and the safe and stable operation of the smart grid, massive electric Internet of things (EIoT) devices need to be deployed to support multiple types of real-time data collection, such as voltage, current, active/reactive power, electric energy, temperature, and humidity [1–3]. The integration of 5G and edge computing provides a viable solution for the real-time data monitoring. Specifically, 5G provides communication guarantee for real-time data collection and information interaction due to the advantages of high reliability, wide connection, and low delay [4]. Compared with ad hoc networks, 5G with central control functionality can achieve centralized and efficient resource scheduling and management for computation offloading optimization in EIoT. Edge computing provides computation guarantee for real-time data processing with the superiority of high-speed computation and low-delay transmission [5, 6]. Compared with cloud computing, edge computing alleviates the high transmission delay and network congestion by reducing transmission distance between devices and servers. In addition, it outperforms fog computing in terms of privacy, security, and computation capacity due to the unified security management and abundant computation resources.
Computation offloading plays a crucial role in 5G and edge computing-integrated EIoT, which includes server selection and computation resource allocation [7, 8]. First, devices select an appropriate server and offload the computation task to the selected edge server via 5G for real-time processing. Then, edge servers allocate computation resources based on service requirements and computation capacity to reduce computation delay [9]. However, the computation offloading optimization for 5G and edge computing-integrated EIoT still faces several challenges. (i)Difficulty in tradeoff balance among various QoS parameters: services in 5G and edge computing-integrated EIoT have differentiated quality of service (QoS) requirements in delay, reliability, and so on. The QoS parameters are mutually influencing; e.g., improving reliability by using extra signaling overhead may harm delay and vice versa. Hence, it is necessary to balance the tradeoff among various QoS parameters through computation offloading optimization.(ii)Coupling between large timescale server selection and small timescale computation resource allocation: server selection in large timescale leads to changes in the characteristics and number of devices served by servers, which in turn affects the computation resource allocation in small timescale. The inefficient decisions of computation resource allocation in small timescale directly affect the data computation delay performance of devices, which in turn affects the evaluation of the empirical performance of the servers in large timescale and may result in frequent server selection switching.(iii)Multi-device competition in server selection and computation resource allocation: the contradiction between limited computation resources and multiple devices not only leads to competition for powerful servers in large timescale server selection but also causes competition for CPU frequency in small timescale computation resource allocation. In particular, the performance of delay and reliability is severely reduced by the competition for the same server.
Computation offloading within multi-access edge computing (MEC) has drawn extensive research in academia. In [10], Zaman et al. provided a survey of mobility management-based task offloading in edge networks. The taxonomy of research work classification is based on objectives, constraints, models, scenarios, and so on, and several future research directions for offloading in edge computing were presented. Lagrange dual approach has been widely adopted for addressing computation offloading problems with convex properties. In [11], Zhou et al. studied a multi-access edge computing-based task offloading algorithm for lightweight user by combining machine learning with Lagrange dual approach to minimize offloading energy consumption. In [12], Wang et al. proposed a Lagrange dual method-based communication resource allocation algorithm to minimize the weighted sum-energy consumption in MEC. Nevertheless, Lagrange dual approach cannot handle nonconvex problems which are common in multi-access networks. As an alternative approach, game theory is explored to cope with multi-user task offloading problems in MEC. In [13], Apostolopoulos et al. proposed a noncooperative game-based distributed cognitive data offloading algorithm to maximize users’ utilities. In [14], Wang et al. proposed a noncooperative game-based computation offloading algorithm to adjust the offloading probability of each user and maximize vehicular utility. The drawback of game theory lies on required prior knowledge to derive utilities of players, which are essential to solve both cooperative and noncooperative games. Compared with game theory, reinforcement learning is more suitable for addressing computation offloading problems with uncertain information. In [15], Dinh et al. studied a model-free reinforcement learning-based computation offloading mechanism to maximize the utility function of each mobile user. In [16], Gao et al. proposed a novel learning-based computation offloading scheme for MEC system to minimize the system loss function. However, the aforementioned works have not considered the difficulty in tradeoff balance among various QoS requirements such as delay and reliability. Moreover, they focus on single timescale computation offloading optimization, while the coupling and mutual interconnection between large timescale server selection and small timescale computation resource allocation are neglected. The elimination of multi-access competition requires cooperation among different devices, which imposes another challenge on reinforcement learning-based computation offloading.
Matching theory is an effective method to solve the optimization of mutual relationship between two sides [17]. In [18], Seng et al. proposed an efficient task virtual machine matching algorithm to coordinate the offloading problems among mobile users and edge servers. In [19], Zhou et al. proposed a low complexity and stable computation offloading mechanism to minimize the total network delay based on pricing-based matching. However, the existing works only consider the one-to-one matching, which is not suitable to the scenario that the same server can serve multiple devices at the same time. In [20], Liu et al. proposed a many-to-one matching-based channel allocation algorithm for mobile users, which achieves higher throughput performance. In [21], Wang et al. proposed a many-to-one matching theory-based subchannel allocation algorithm to reduce the energy efficiency. However, the joint optimization of reliability and delay is ignored. In [22], Zhang et al. proposed a joint optimization algorithm of computation offloading and computation resource allocation, which optimizes network stability and achieves the tradeoff between energy efficiency and average service delay. Nevertheless, the aforementioned works do not consider the coupling between small timescale computation resource allocation and large timescale sever selection.
Motivated by the aforementioned challenges including difficulty in tradeoff balance among various QoS parameters, coupling between large timescale server selection and small timescale computation resource allocation, and the multi-device competition in server selection and computation resource allocation, we propose an empirical matching-based computation offloading optimization algorithm for 5G and edge computing-integrated EIoT. The optimization objective is to minimize the computation offloading delay by jointly optimizing large timescale server selection and small timescale computation resource allocation. We first model the large timescale server selection problem as a many-to-one matching problem, which can be decoupled from small timescale computation resource allocation by establishing matching preference lists based on empirical performance. Then, the large timescale server selection problem is solved by pricing-based matching with quota algorithm. Furthermore, based on the obtained suboptimal result of large timescale server selection, the small timescale computation resource allocation problem is subsequently solved by Lagrange dual decomposition, the result of which is used to update large timescale empirical performance. Finally, extensive simulations are carried out to demonstrate the superior performance of the proposed algorithm by comparing it with existing algorithms. The main contributions of this paper are summarized as follows: (i)Differentiated QoS guarantee: differentiated QoS demands such as reliability and delay are guaranteed through the minimization of the long-term total delay of all devices under the constrains of server computation capacity and transmission signal-to-interference-plus-noise ratio (SINR). Specifically, reliability is enforced by eliminating servers which cannot satisfy the SINR constraint from the device preference lists.(ii)Multi-timescale computation offloading optimization: server selection is optimized in large timescale based on empirical matching with empirical performance enabled matching preference list and pricing-based matching with quota enabled matching conflict elimination. On the basis, computation resource allocation is optimized in small timescale based on Lagrange dual decomposition to reduce computation delay.(iii)Extensive performance evaluation: compared with two state-of-the-art algorithms, simulation results demonstrate that the proposed algorithm has superior performance in computation offloading delay. Moreover, the impacts of key parameters such as quota and SINR threshold on delay performance are revealed to provide guidance for the real-world implementation of computation offloading optimization in 5G and edge computing-integrated EIoT.
The rest of the paper is organized as follows. Section 2 demonstrates the system model of computation offloading for 5G and edge computing-integrated EIoT and formulates the multi-timescale joint optimization problem. Section 3 introduces the proposed empirical matching-based computation offloading optimization algorithm. The simulation results are shown in Section 4. Section 5 concludes the paper.
2. System Model
In this paper, we consider a scenario of computation offloading for 5G and edge computing-integrated EIoT, as shown in Figure 1. The set of devices and base stations (BSs) are represented as and , respectively. The edge server and BS are located in the same place to provide computation and communication services. For simplicity, we denote the sets of BS and edge server as . An example is shown in Figure 1, where the process of computation offloading includes two stages, i.e., server selection and computation resource allocation. In the first stage, when devices , , and select the same BS with limited offloading quota of devices, BS chooses to allocate computation resources for devices and and reject the access request of device . Device finally offloads the computation task to BS with a larger quota. We assume that BSs receive the time synchronization signal from the 5G time synchronization network and broadcast to all edge servers and devices to ensure that computation offloading is performed on the basis of time synchronization [15, 23].

A slot model is adopted [24] where server selection is optimized in large timescale, i.e., epoch, and computation resource allocation is optimized in small timescale, i.e., slot. The total optimization period has epochs, each of which consists of slots, i.e., . The sets of epochs and slots are denoted as and . The slot set of the -th epoch is given by
The key notations used in this paper are summarized in Table 1.
2.1. Transmission Model
At each epoch, a device selects a server for computation offloading. Define as the server selection variable, where represents that device selects server for computation offloading, and otherwise, . Considering uplink data transmission, the SINR between device and server in the -th slot is [25] where is the transmission bandwidth. is the transmission power, is the channel gain between device and server in the -th slot, is the noise spectral power density, and is the electromagnetic interference power.
To ensure reliability requirement, SINR constraint is given by where is SINR threshold for data reliable transmission. The transmission rate between device and server in the -th slot is given by
We assume that the size of packets arriving at device in the -th slot is . Hence, the transmission delay of device offloading data to server in the -th slot is
2.2. Computation Model
Define as the allocated computation resources by server to device . The computation delay for processing data in the -th slot [26] is given by where is the data computation density of device , i.e., the required CPU cycles to process one bit data.
The total allocated computation resource of server should be lower than the maximum computation resource , i.e.,
2.3. Problem Formulation
The total delay that device selects server for computation offloading is composed of the transmission delay and the computation delay, i.e.,
The objective is to minimize the long-term total delay of all devices under the constrains of servers’ computation capacity and transmission reliability, which can be expressed as where is the quota of server , represents that each edge server can be selected by at most devices at the same time, represents that each device can select only one edge server for computation offloading in an epoch, represents the edge server computation resource constraint, and represents the SINR constraint.
We neglect energy consumption because major delay-sensitive EIoT devices can continuously draw energy from the power grid. Nevertheless, the proposed algorithm can also be extended to the scenario where energy consumption is minimized.
3. Empirical Matching-Based Computation Offloading Optimization Algorithm for 5G and Edge Computing-Integrated EIoT
In this section, we introduce the problem transformation. Then, we propose the empirical matching-based large timescale server selection algorithm and Lagrange dual decomposition-based small timescale computation resource allocation for 5G and edge computing-integrated EIoT.
3.1. Problem Transformation
The long-term stochastic joint optimization problem includes two subproblems, i.e., large timescale server selection problem and small timescale computation resource allocation problem. The large timescale server selection problem is first modeled as a many-to-one matching problem, which is decoupled from small timescale computation resource allocation by establishing matching preference list based on empirical performance of delay and reliability. Then, the large timescale server selection problem is solved by pricing-based matching with quota algorithm. Based on the obtained suboptimal result of large timescale server selection strategy, the small timescale computation resource allocation problem is subsequently solved by Lagrange dual decomposition, the result of which is used to update large timescale empirical performance.
3.2. Empirical Matching-Based Large Timescale Server Selection
The large timescale server selection optimization problem is transformed into a many-to-one matching problem, which is defined as a triple (), where and represent the sets of matching devices and servers, respectively, and represents the preference list of devices.
Theorem 1. A matching is a many-to-one correspondence of set to set based on the preference list . represents the matching of device and server , i.e., . Specially, server can match at most devices at the same time.
To decouple the large timescale server selection from the small timescale resource allocation, the preference list is established based on empirical performance of delay and reliability. The empirical matching-based large timescale server selection algorithm is summarized in Algorithm 1, including preference list establishment and the pricing-based iterative matching [27].
3.2.1. Preference List Establishment
In the initialization, each EIoT device first traverses all servers once to obtain the value of . At the beginning of the -th period, the server selection decision is made based on the empirical information up to the current period. Thus, the preference value of device towards server in the -th period is defined as , which is expressed as where represents the server price of matching device with server , the initial value of which is set as zero and represents the average offloading delay of device in the -th epoch, which is expressed as
3.2.2. The Implementation Procedure of Pricing-Based Iterative Matching
3.2.3. Empirical Matching-Based Large Timescale Server Selection Algorithm
(Step 1)When , initialize , , , [1]. Define as the set of unmatched devices, and set at the beginning. Define as the set of devices proposed to server , and set at the beginning. All devices traverse all servers once to complete the initialization of the preference list .(Step 2)When $g \le G$, each calculates its preference value towards as (10) and sorts in descending order to obtain the preference list .(Step 3)Each proposes its most preferred server in . Each server, e.g., , adds into if proposes . For, if , matches with the devices, e.g., , from the proposed devices, i.e., . Update . Update . Otherwise, updates the price as (13). Unmatched devices execute steps , until every device has been matched with a server, i.e., , or there exists no available server for unmatched device .
The implementation procedure of pricing-based matching consists of three phases, which are introduced as follows.
Step 1. When , initialize , , , , the set of unmatched devices as , and the set of devices which proposed to server as .
Step 2. Each calculates the preference value for unmatched device towards as (10) and sorts in a descending order to obtain the preference list . We introduce to compare the preferences towards different servers. For example, means that device prefers server than server , which is expressed as When a server is selected by multiple devices exceeding to its quota, the server increases the price with increment to eliminate matching conflicts, which is expressed as Then, the preference list is updated according to new preference value as and .
Step 3. Each proposes to its most preferred server in . Then, each server, e.g., , adds into if proposes to . matches with the devices, e.g., , from the proposed devices, i.e., . Repeat until every device has been matched with a server.
Therefore, the optimal matching result can be obtained as
3.2.4. Complexity Analysis
The computation complexity of the proposed server selection algorithm mainly depends on preference value calculation, preference list establishment, and pricing-based iterative matching process, where the complexities of these three steps are, respectively , , and . Hence, the complexity of the proposed algorithm is .
3.3. Lagrange Dual Decomposition-Based Small Timescale Computation Resource Allocation
Based on the many-to-one matching-based large timescale server selection, the small timescale computation resource allocation is subsequently optimized. For edge server , the computation resource allocation problem in the -th slot can be expressed as where can be expressed as
Based on Jensen’s inequality theorem [28], (16) satisfies while is a convex function. Therefore, P2 is a convex function and can be solved by Lagrange dual decomposition [29]. Define as a Lagrangian subvector corresponding to constraint . The Lagrange equation can be expressed as
Based on Lagrange dual decomposition, can be transformed as
Based on Karush-Kuhn-Tucker conditions, it can obtain where is the iterative index of Lagrangian multiplier update. Lagrangian multiplier update can be expressed as where is the update step length.
4. Simulation Results
In this section, we introduce the simulation results and analysis. We consider a computation offloading scenario of EIoT with devices and servers. In the case of largescale fading, the channel gain is calculated according to [30], where is the distance between device and server , and distributed within km. According to the actual environment of EIoT, the electromagnetic interference power varies from dBm to dBm. The specific simulation parameters are summarized in Table 2 [31–35]. Two existing algorithms are employed for comparison. The first one is the price matching-based computation offloading (PMCO) algorithm [27], where server-side computation resources are allocated equally. The second one is the greedy matching-based computation offloading (GMCO) algorithm [36], where large timescale server selection is solved based on greedy matching strategy and small timescale computation resource allocation is implemented once in the first time slot of each epoch. In addition, we extend the proposed algorithm to a large-scale computation offloading scenario with 100 devices to verify its effectiveness and robustness. The simulation software is MATLAB 2021. The real execution time of the proposed algorithm is about 49 ms per time slot, which achieves real-time or near-real-time. When adopting dedicated execution module such as DSP, the real execution time can be further reduced to millisecond level or even microsecond level.
4.1. Transmission Delay Performance
Figure 2 shows the box plots of transmission delay. Compared with PMCO and GMCO, the proposed algorithm can reduce the median transmission delay by and and reduce the transmission delay fluctuation by and , respectively. The proposed algorithm utilizes empirical matching-based large timescale server selection to reduce the transmission delay, thus performing the best. PMCO outperforms GMCO in terms of transmission delay because PMCO considers the server selection optimization based on price matching, thus effectively reducing the transmission delay.

4.2. Computation Delay Performance
Figure 3 show the box plots of computation delay. Compared with PMCO and GMCO, the median computation delay is decreased by and , and the computation delay fluctuation is decreased by and , respectively. The proposed algorithm utilizes Lagrange dual decomposition-based small timescale computation resource allocation to improve computation delay performance, thus performing the best. PMCO performs worse than GMCO in terms of computation delay. The reason is that GMCO considers the computation resource allocation, which leads to a lower computation delay.

4.3. Total Computation Offloading Delay Performance
Figure 4 shows the total computation offloading delay versus time slot. The proposed algorithm outperforms PMCO and GMCO by and . The reason is that the proposed algorithm can avoid adversarial channels to improve delay performance through large timescale server selection. Then, given the large timescale server selection strategies, it further optimizes the small timescale computation resource allocation in each slot. However, PMCO neglects the optimization of computation resource allocation. The GMCO algorithm based on greedy matching and single-slot computation resource allocation cannot solve matching conflict from the perspective of the whole network and adjust the allocation strategies based on real-time information.

Figure 5 shows the total computation offloading delay versus number of devices. As the number of devices increases from to , the total computation offloading delay of PMCO and GMCO increases by and , while the total computation offloading delay of the proposed algorithm is slightly increased by . The reason why total computation offloading delay increases is that the conflicts caused by multiple devices selecting the same server increases, and the computation resource allocated to each device is poorer. Even in a multi-access scenario with 100 devices, the proposed algorithm can adaptively balance the performance return of all devices through pricing-based iterative matching and adjust the resource allocation strategies based on dynamic data arrival.

Figure 6 shows the impact of the quota on transmission delay and computation delay. The bars in the figure represent the transmission delay and the curves represent the computation delay. When increases from to , the transmission delay and computation delay of PMCO and GMCO are decreased by , , , and , in which those of the proposed algorithm are obviously decreased by and . The reason for it is that the final delay performance depends on the worst computation offloading situation, where the larger means the greater offloading possibility to servers with better channels and computation resources for devices. In addition, the proposed algorithm can well coordinate the competition among multiple devices for servers and computation resources based on empirical information and real-time resource allocation.

Table 3 shows the impact of on total computation offloading delay. With the increasing of , the total computation offloading delay decreases first and then increases. When dB, the total computation offloading delay reaches the minimum value. The reason is that when increases from to dB, stringent reliability constraints impel devices to select servers with better empirical channel states, thus significantly reducing transmission delay at the beginning. However, as continues to increase from to dB, the servers with better channel states will be occupied by more devices resulting in a higher computation delay.
5. Conclusion
In this paper, we investigated a multi-timescale computation offloading optimization problem for 5G and edge computing-integrated EIoT. Specifically, we proposed an empirical matching-based computation offloading optimization algorithm, which includes the joint optimization of large timescale server selection and small timescale computation resource allocation. Compared with the existing PMCO and GMCO algorithms, the proposed algorithm could reduce the total computation offloading delay by and , respectively. It could also reduce the median transmission delay by and , the transmission delay fluctuation by and , the median computation delay by and , and the computation delay fluctuation by and . Finally, future research directions are outlined.
5.1. Computation Offloading under Extensive EIoT Scenarios with Incomplete Information
In large-scale EIoT scenarios, considering the prohibitive signaling overheads, global state information such as the channel state between devices and servers, the amount of available computation resources of servers, and the computation resource allocation policy of servers is unknown to devices. Server selection needs to be optimized under incomplete information. A feasible approach is to empower computation offloading for EIoT by learning through interaction with the environment by exploring advanced artificial intelligence algorithms such as deep reinforcement learning and federated learning.
5.2. Insecure Computation Offloading under Malicious Attack
With the extensive access of massive devices, EIoT faces various malicious attacks including distributed denial of services (DDoS), time synchronization attack, sinkhole attack, and tampering attack. These malicious attacks make computation offloading in EIoT insecure, which results in loss and tampering of important information, such as fault data, alarm data, and load fluctuation, endangering the supply-demand balance as well as stable and secure operation of power grid. To solve this problem, advanced security technologies such as blockchain, identity authentication, encryption, and trusted computing can be adopted to ensure the secure data transmission and processing in computing offloading.
Data Availability
The data used to support the findings of this study are included within the article.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This work is supported by the National Key R&D Program of China (2020YFB0905900) and is funded by the Science and Technology Project of SGCC (State Grid Corporation of China): The Key Technologies for Electric Internet of Things (SGTJDK00DWJS2100223).