Resource Allocation Strategy of Edge Systems Based on Task Priority and an Optimal Integer Linear Programming Algorithm

: With the emergence of increasingly computing-intensive and delay-sensitive tasks, the processing of computing tasks on cloud servers cannot meet the current needs any longer. The emergence of mobile edge computing (MEC) technology and the popularity of 5G applications can solve these demands. O ﬄ oading tasks to the MEC server reduces the energy consumption of local devices, and also has a lower latency than o ﬄ oading to the cloud server. In this paper, an MEC–edge cloud server collaborative system model with energy harvesting technology is designed to minimize the processing delay of computing tasks by allocating computing resources. We propose an optimal integer linear programming (OILP) algorithm with two steps. Firstly, we propose a Lyapunov stability optimization algorithm based on task priority. With the constraints of local mobile device power stability, the divide-and-conquer idea is used for solving the target values of the processing tasks locally, and the MEC and edge cloud servers separately. Therefore, the objective problem is transformed into an integer linear programming problem, and then an integer linear programming algorithm based on CPU utilization optimization is proposed to obtain a resource allocation scheme. Simulation results show that the proposed OILP algorithm can further reduce the delay, improve the CPU’s utilization of the MEC server, and reduce the number of the tasks that cannot be processed under the condition of the energy stability of the local device.


Introduction
With the development of mobile communication technology and the popularization of smart mobile devices, such as smart phones and smart watches, various network services and applications are constantly emerging [1,2]. These new mobile applications, such as e-health, biometric recognition [3], surveillance, and augmented reality/virtual reality (AR/VR), require not only a large amount of computing, but also a high energy consumption [4]. Benefiting from the widespread application of "Internet of Things" (IoT) and "cloud computing" technologies, mobile cloud computing (MCC) has become a potential solution to enhance the computing capabilities of IoT applications, shifting the computing tasks of IoT devices to those with sufficient computing and storage capabilities on a centralized cloud server [5]. However, users accessing the remote centralized cloud computing and storage resources through the internet will cause a relatively long delay, which makes MCC unable to meet the conditions of some delay-sensitive applications.
The European Telecommunications Standardization Institute (ETSI) proposed mobile edge computing (MEC) in 2014 to solve the problems of cloud computing models. Mobile edge computing (MEC) provides cloud computing capabilities in the radio access network (RAN), with a new paradigm (1) Propose a local, MEC server, and edge cloud server collaborative processing task system, reasonably allocate energy and computing resources, and improve system performance, e.g., task processing capacity; (2) Use Lyapunov stability theory for local mobile device power stability and task processing delay as optimization goals, and jointly consider the local mobile device's energy collection, computing power allocation, wireless link transmit power allocation, and MEC-edge cloud server resource allocation problem. In order to solve this problem, a Lyapunov algorithm based on task priority is first proposed to decompose this NP-hard problem into an integer programming problem. The task priority attribute can improve the performance of the system, and then an integer programming algorithm based on CPU utilization optimization is proposed to obtain the optimal resource allocation strategy. By comparing and analyzing with the integer linear programming (ILP) algorithm, the optimal integer linear programming (OILP) algorithm proposed has the lower latency and higher resource utilization; (3) Considering that MEC server resources are scarce, especially during the peak traffic, the CPU computing resources provided by the server through virtualization technology may not be utilized effectively. When the CPU resources are insufficient to handle the entire unload task, the proposed algorithm will split the task into two parts, one of which will be processed on the local device, and the other on the MEC server. This not only increases server resource utilization, but also reduces the number of tasks that cannot be processed. The simulation results show that the number of unprocessed tasks can be optimized by more than 10%.
In Section 2, we review related research work from recent years. The system model and the objective problem of Lyapunov optimization are described in Section 3. In order to solve the objective problem, an optimal integer linear programming (OILP) algorithm is proposed in Section 4, which includes the Lyapunov optimization, based on task priority, and the integer linear programming algorithm, based on the CPU utilization optimization strategy. In Section 5, we analyze the simulation results. Finally, in Section 6 we summarize this article and look forward to future work.

Related Work
In recent years, the research on the simulation model of computing offloading of MEC systems has attracted the attention of many scholars. In [22], the joint offloading of downlink and uplink edge computing in ultra-dense heterogenous networks (HetNets) is studied, with minimizing the overall task delay and equipment energy consumption as goals. Here, the planning problem is transformed into resource allocation sub-problem and offloading calculation sub-problem. Deng et al. [10] studied the offloading decision between multiple devices and an MEC server. Ahn et al. [16] studied the problems of the partial offloading from the perspective of noncooperative games, and designed an energy-oriented task scheduling scheme. Cheng et al. [23] considered a signal access MEC server system using an orthogonal frequency division multiplexing (OFDMA) transmission mechanism, and optimized offload strategy and radio resource allocation. Ndikumana et al. [24] considered joint computing, caching, communication, and control as an optimization problem, and adopted a block successive, upper-bound minimization method to minimize bandwidth consumption and delay. Zhao et al. [25] took offloading decisions, wireless resource optimization, and computing resource optimization as the key elements to achieve energy-saving goals. In [26], the joint multi-user offloading and transmission power control optimization problems in the multi-channel wireless interference scenarios are studied, and a semi-distributed algorithm is proposed to obtain the optimal solution to minimize the computational overhead of the entire system. In order to avoid the network congestion and load balancing, a joint optimization of data caching and request forwarding was considered by Liu et al. [27]. A Lyapunov stochastic optimization model was used for limiting the network stability and minimizing the average transmission cost.
Due to the limited battery power of mobile devices, low-power local mobile devices cannot offload computing tasks to the MEC server via wireless channels. Therefore, research on systems with battery energy harvesting has also received scholars' attention. Min et al. [28] proposed an IoT device offloading scheme based on reinforcement learning. The edge device and offloading rate were selected by analyzing the current battery power, the previous radio transmission rate to each edge device, and the predicted harvested energy amount. Zhou et al. [29] applied energy harvesting research based on the radio frequency (RF) to a UAV, multi-user MEC system, and discusses the binary and partial computing offloading methods separately to solve the problem of the maximizing computing speed. Yao et al. [18] considered the importance of battery power stability for local mobile devices, and introduced a Lyapunov optimization model to minimize the processing delay of computing tasks under the constraints of battery power stability of the local mobile devices. However, the model only considers the scenario of one mobile device and one MEC server. Therefore, in [12], a scenario model of multiple mobile devices and multiple MEC servers was proposed, taking into account the capacity limitations of the MEC server and under the condition of guaranteeing QoE, and the tasks were first offloaded to the MEC server for processing. However, in the model, the upper limit of the number of computing tasks offloaded to the MEC server is used as a capacity limit. This design cannot maximize the use of resources, and in real scenarios, the CPU usage of the MEC server will negatively affect task processing when it reaches a certain level. Therefore, we need to consider how to control CPU usage at a safe value. In addition, in terms of resource allocation, the priority of each type of offloading task to obtain resources are different, and the higher priority tasks need to be processed first.
In some cases, due to the limitation of the local device power and the processing capacity, it is also necessary to consider the cloud server and the other means of system offloading. In [30], a scalable vehicle-assisted MEC (SVMEC) paradigm was proposed, and then the offloading decision problem is solved by using integer nonlinear programming. Similarly, the collaboration between the cloud and MEC can further break through the limitation of MEC server capabilities and obtain better processing results. Guo et al. [31] proposed a cloud-MEC collaborative computing offload architecture, using WiFi to access networks. Under this framework, an approximate collaborative computing offloading scheme and a game collaborative computing offloading scheme are proposed to obtain better offloading performance.

System Model and Problem Formulation
The system model diagram and the summary of key notations are shown in Figure 1 and Table 1 respectively. In campus, it is assumed that there are N local mobile devices with energy collection and M small base stations; each small base station deploys a MEC server. The edge cloud servers are deployed near the MEC servers to supplement the computing capability of MEC servers, and the edge cloud service servers have lower latency than the cloud server. The local mobile device is denoted by I = {1, 2, . . . , N}, and the MEC server is denoted by J = {1, 2, . . . , M}. Each local device is connected to the MEC server through a wireless link, and each MEC server can be connected to the edge cloud server through a wired link. It is supposed that there are T time slots, each time slot interval is τ, and each device generates one computing task with fixed size (bits) in each time slot. Considering the mobility of the device, at the t-th time slot, the distance between the local device n i and the server m j is denoted as d t i,j , i ∈ I, j ∈ J, t ∈ T.
4 of 20 The system model diagram and the summary of key notations are shown in Figure 1 and Table  1 respectively. In campus, it is assumed that there are local mobile devices with energy collection and small base stations; each small base station deploys a MEC server. The edge cloud servers are deployed near the MEC servers to supplement the computing capability of MEC servers, and the edge cloud service servers have lower latency than the cloud server. The local mobile device is denoted by = {1,2, … , }, and the MEC server is denoted by = {1,2, … , }. Each local device is connected to the MEC server through a wireless link, and each MEC server can be connected to the edge cloud server through a wired link. It is supposed that there are time slots, each time slot interval is , and each device generates one computing task with fixed size (bits) in each time slot. Considering the mobility of the device, at the -th time slot, the distance between the local device and the server is denoted as , , ∈ , ∈ , ∈ .  the energy consumption of the task processing locally task size (bits) generated by local device , the time delay of the task processing locally number of CPU cycles required to process one bit of data , the energy consumption of task processing by the MEC server task priority , the time delay of task processing by the MEC server probability of high priority tasks , the energy consumption of task processing by the edge cloud server the size (bits) of task that be processed by MEC server , the time delay of task processing by the edge cloud server the size (bits) of task that be

Task Offloading Model
Let D t i be the task size (bits) generated by local device n i at the t-th time slot, and C be the number of CPU cycles required to process one bit of data, and define ρ = {0, 1} as the task priority. If ρ = 1, the task is to be priority processing. At the t-th time slot, the task can be chosen to be processed locally, via the MEC or edge cloud servers, or not be processed. This is expressed as In this system, the computing task can only select one of the modes of processing. That is,

Local Computing
The first processing mode is that the task is selected to be processed locally. The delay generated is only the processing time of the local device. In order to successfully execute the task generated by the local device n i at the t-th time slot, D t i C cycles are required. The frequency arranged for the D t i C cycles at the t-th time slot is expressed as f t i , which can be achieved by adjusting the chip voltage using DVFS [32]. As a result, the local processing time T t i,l generated by the local device n i at the t-th time slot is expressed as Due to the limitation of the local device processing capacity, f max l is defined as the maximum CPU frequency of the local mobile device, so it needs to satisfy The local processing energy consumption of mobile device n i at the t-th time slot only includes the energy consumption E t i,l of the task processing locally. In addition, k is expressed as the chip's effective capacitance coefficient, and E t i,l is expressed as

MEC Server Computing
The second processing mode is that the local device n i offloads the task to the MEC server for processing through a wireless link. When X t i,m = 1, the task needs to decide which MEC server to offload, so defining c t i,j = {0, 1} and c t i,j = 1 indicates the connection between n t i and m t j . In addition, each task generated by the local device at t-th time slot can only be processed by one MEC server, so c t The task generated by the local device is offloaded to the MEC server through the wireless link. Assuming that wireless channel bandwidths are evenly distributed and do not interfere with each other, the channel transmission rate of the device transmission task to the MEC server is obtained according to Shannon Hartley Formula: In the above formula, and is the channel gain (γ t i,j is the fading power gain, g 0 is the loss constant, d 0 is the relative distance, and µ is the loss index); B is the channel bandwidth; p t i is the transmission power; and σ is the noise power. The time consumption considers the time costed when the task is transmitted to the MEC server, and the processing time of the MEC server, f mec , is the frequency of MEC server. Then the processing time T t i,j at the t-th time slot when the task is offloaded to the MEC server is expressed as Since the task offloading to the MEC server via the wireless link requires the energy of the local mobile device, the energy consumption only considers the transmit power of the local device, and the energy consumption E t i,j of the second processing scenario is expressed as

Edge Cloud Server Computing
The third processing mode occurs when the local device n i offloads the task to the MEC server through a wireless link; when the MEC server has insufficient CPU resources, the device can upload the task to the edge cloud server for processing through the wired link on the MEC server, so the task processing time at the edge cloud server at the t-th time slot is the sum of wireless transmission, wired transmission, and the processing time of the edge cloud server. Let r mc be the backhaul fiber link rate, and the frequency of the edge cloud server is f c . In particular, considering the congestion of wired links, the links from each MEC server to edge cloud server are divided into H to achieve the function of the speed-limiting shunt. Therefore, the processing time T t i,c is expressed as Similar to the MEC processing mode, when X t i,c = 1, the task needs to decide by which MEC server to upload the data to the edge cloud server, so defining g t i,j = {0, 1}, and g t i,j = 1 indicates that the local device n t i offloads the task to the MEC server m t j via wireless link, and then uploads it to the edge cloud server for processing. In addition, g t i,j needs to satisfy As for the energy consumption of edge cloud server processing, as far as the local device is concerned, it is consistent with the energy consumption of an MEC server. The local device consumes energy only on wireless transmission, which is expressed as

Energy Harvesting Model
To sum up, the total energy consumption E t i,all of mobile device n i at the t-th time slot can be expressed as Define the battery level of the local device n i with energy harvesting technology at the t-th time slot as b t i , and the maximum power possessed by the local mobile device as E max ; therefore, the following conditions need to be satisfied: At the same time, e t i is defined as the energy supplemented by the local device n i at the t-th time slot through energy harvesting technology, and E t i,H is the maximum energy limit that can be replenished, so the battery level of the device n i at next time slot is expressed as

Objective Function Based on Lyapunov Optimization
Through the above analysis of the three processing modes, the total processing time T t i,all of the mobile devices n i at t-th time slot can be obtained as It should be noted that the processing time of the task cannot be higher than the time slot interval τ, which is expressed as In this paper, the total consumption cost t of all mobile devices at the t-th time slot is used as an optimization goal, which is composed of the time delay and the penalty for the task not being processed. The total consumption cost t is expressed as where the penalty for the task not being processed is Φ. In order to minimize the cost t , the objective function at the t-th time slot is defined as P1 s.t.Equations(1), (2), (4), (6), (11), (14), (16), (18) Regarding the constraints, Equation (20) indicates that the CPU usage of the MEC server cannot exceed the maximum value, and the CPU usage U j of the m j server at the t-th time slot can be expressed as Equation (21) indicates the upper and lower limits of the device's transmit power. Equation (22) indicates the limit on the total number of links available for each MEC server to connect to the edge cloud server and act as a speed limit.
Therefore, solving the P1 problem can obtain the result A t for all mobile device resource allocation at the t-th time slot, and the result for the local device n i can be expressed as Among these variables, X t i is the decision vector for the task selection processing scenario, which can be expressed as where f t i is the CPU processing frequency of the local device in the first processing mode, p t i is the wireless transmission power value of the local device to the MEC server when the task is selected to offload to the second or third mode, and c t i is expressed as the decision vector of the local device choosing which MEC server to offload tasks to when X t i,m = 1. This is similar to c t i when X t i,c = 1, and g t i indicates that the local device n t i offloads the task to a particular MEC server via wireless link, and then uploads it to the edge cloud server for processing.
where e t i is the energy value collected by the local device n i at the t-th time slot. However, this goal can be solved without considering the power of the local equipment. Because the system always wants the task to be processed, the power of the local device is always low. Considering that the task is generated by the application of the local mobile device, in order to maintain the stability of the power of the local mobile device, ensure that it has sufficient power to handle tasks that cannot be offloaded, e.g., the call service of mobile phones requires a certain amount of power, but the service task can only be handled locally. This article introduces the Lyapunov function to optimize local device power stability. Through stability analysis [18] for each mobile device, we use the perturbation parameter to define virtual power b t i , which can be expressed as The perturbation parameter θ is defined as: where E max = min max kD t C f max l 2 , p max τ , E max .
Then the Lyapunov optimization function and the Lyapunov drift function can be expressed as Using Equation (15), we can obtain b t+1 As a result, we have: In other words, the power of the system can be stabilized.
By analyzing Equations (19) and (33), considering the trade-off between the energy stability of the equipment battery and the processing consumption, the objective function of the resource allocation scheme at the t-th time slot is obtained, which is expressed as P2: (4), (6), (11), (14), (16), (18), (20), (21), (22) whereV represents the weight of the battery energy stability and delay. This weight can be initialized according to the battery power demand of the local device.

Proposed Algorithm
According to the objective function proposed by the above analysis, the purpose is to solve the problem of minimizing the processing delay under the constraint of battery energy stability, which is an NP-hard problem. This is considering that the tasks generated by mobile devices can be processed in three processing modes: local, MEC server, and edge cloud server. A method of solving the problem step-by-step is proposed. First, the target value of each processing scenario is obtained by dividing and conquering. The problem is transformed into an integer linear programming problem, and then an integer programming algorithm is used for finding the optimal target value. In order to get a better solution, this paper proposes an optimal integer linear programming (OILP) algorithm, which is performed in two steps. The first step is to propose a Lyapunov optimization based on task priority, in order to convert the problem into an integer programming problem. The second step is to propose an integer programming algorithm based on the CPU utilization optimization strategy, in order to obtain the optimal resource allocation plan.

Lyapunov Optimization Based on Task Priority
Divide problem P2 into problems P3 and P4, according to the divide-and-conquer idea, and solve them separately.
By decomposing the P4 problem into sub-problems for solving the three modes of local, MEC server, and edge cloud server, the decomposition formula is as follows: The sub-problems S t i,l , S t i,cj = S t i,c1 , S t i,c2 , . . . , S t i,cM , and S t i,j = S t i,1 , S t i,2 , . . . , S t i,M are solved as linear problems. By solving the optimization problem S t i,l for local scene processing, the local processing frequency f t i can be obtained, and the corresponding transmit power p t i can be obtained by solving the optimization problem S t i,j of the MEC server mode processing [18]. Because the time slot interval τ can be considered as the maximum time for tasks to complete processing, defining Φ = τ is the penalty value if the task cannot be processed. Therefore, the target value S t i,d indicating that the task is not processed is expressed as Therefore, in the end, the value of the decision vector for the task selection processing mode X t i , as well as the decision vectors c t i = c t i,1 , . . . , c t i,M and g t i = g t i,1 , . . . , g t i,M of the local device choosing on which MEC server to offload tasks to need to be obtained. This problem is solved by the proposed second-step integer linear programming algorithm.
In addition, because the P4 problem considers the power stability of the local mobile device, the system will not process some tasks that consume power in order to maintain the power stability. Therefore, the Lyapunov stability optimization will give up certain task processing performance. At this time, some tasks will not be processed, which will affect QoS, especially for some tasks that need to be processed urgently. Therefore, a Lyapunov algorithm based on task priority is proposed. This algorithm adds the task priority due to the Lyapunov stability optimization, which can guarantee the processing rate of high-priority tasks. For the task of ρ = 1, it is necessary to increase the penalty value when the task is not processed. Therefore, the target value S t i,d indicating that the task is not processed is redefined.
where α is defined as when the task cannot be processed in any mode under the constraints of local energy and time interval τ, which is S t i,l = S t i,c = S t i,j = α. To ensure that high-priority tasks can be processed, β is defined as This can be guaranteed that when the local mobile device generates a high-priority task, and the task will be processed as long as the current battery is sufficient and the task can be processed within the time interval τ.

Integer Programming Algorithm Based on CPU Utilization Optimization Strategy
In order to solve the problem P4, after obtaining the target values of S t i,l , S t i,cj , S t i,j , and S t i,d , the problem can be converted into an integer linear programming problem. Through the integer programming algorithm, a resource allocation scheme can be obtained that minimizes the task processing delay at the t-th time slot.
Construct an integer programming problem as follows: In the above formula, A, b, Aeq, beq, lb,ub are respectively inequality constraint matrix, inequality constraint column vector, equality constraint matrix, equality constraint column vector, lower and upper values. F T is the problem coefficient matrix, and the target values of S t i,l , S t i,cj , S t i,j and S t i,d , which are obtained by the first step, are used as the coefficient matrix element of the problem. This is expressed as The matrix element s t i is the target value of each scene at the t-th time slot by the local device n i , which is defined as Therefore, the decision solution obtained at the t-th time slot is defined as This corresponds to the coefficient matrix, x t i which is defined as Finally, the P4 problem is converted to P5: U jGood represents reasonable CPU usage value for the MEC server. For security reasons, in the real environment, the server's CPU resources cannot be fully used for computing tasks, and if the server CPU runs for a long time with high values, problems like downtime will be generated, which will seriously affect QoS. Therefore, it is necessary to control the CPU usage of the server to provide computing resources within a safe range. U jGood is introduced to satisfy The P5 problem can be solved by a integer linear programming algorithm. However, in the case of task density, due to the shortage of CPU resources of the MEC server and the bandwidth resources of the edge cloud link, some tasks will not be processed, especially when the tasks are relatively large, which affects the resource utilization of the MEC server-e.g., when the remaining resources of the MEC server can process only 10 Kb of data, but the amount of work to be processed is 15 Kb, so the task is not processed and the resource utilization is low. Therefore, an integer linear programming algorithm based on CPU utilization optimization is proposed.
Firstly, after solving the P5 problem, the initial resource allocation strategy must be obtained. Then, the unhandled tasks are divided into two parts. Let D t il be the part of the task size (bits) that the local device n t i needs to handle, and let D t ij be the part of task size (bits) that the MEC server m t j needs to handle. Finally, the optimal resource allocation scheme can be obtained.
Task sizes satisfy the following formula: Equation (44) indicates the full use of the MEC server's resources, and then place the remaining tasks on the local device to process.
The available energy is E t i,j which has been obtained in the Lyapunov optimization based on the task priority algorithm, satisfies Therefore, the CPU processing frequency of the local device can be expressed as Then the processing time T t i,j at t-th time slot is expressed as Therefore, at the t-th time slot, for local devices n t i , the P6 problem is expressed as Therefore, solving the P6 problem algebraically can obtain f t i and p t i for the local device n t i , so the optimal result of resource allocation at the t-th time slot can be obtained.
Algorithm 1 gives the main part of the OILP algorithm.

Algorithm 1. Optimal integer linear programming (OILP) algorithm.
Input: Obtain the values of S t i,l , S t i,c j , S t i, j and S t i,d through the Lyapunov optimization, based on the task priority 4. End for 5. Solve P5 by integer programming algorithm 6. Find the tasks that cannot be processed 7. If the task was not processed due to the insufficient MEC server CPU resources and the edge cloud link resources then 8. Split the task, offload one part to MEC server, process the other locally, and keep the energy consumption as the energy consumed if the total task is offloaded to the MEC server for processing 9. Solve P6 algebraically to obtain f t i , p t i and T t i, j 10. If T t i, j ≤ τ then 11. Implement the optimization strategy and update the MEC server CPU usage 12. else 13. Continue to optimize the next unhandled task 14. endif 15. endif 16.t = t + 1 17. End for

Simulation Results
In this section, the proposed system and algorithm are verified by the simulation experiments. The battery energy stability of the local device, the number of unprocessed tasks, the delay of task processing, the CPU utilization of the MEC server, and the impact of task priority on the system were analyzed. Throughout the experimental analysis, the OILP algorithm can improve server utilization, reduce the number of unprocessed tasks, and reduce the time delay while keeping the system power stable.

System Setting
We used MATLAB for simulation experiments on WIN7 64-bit system. We assumed that each local device generates a computing task with fixed size (bits) in each time slot, and the probability that ρ = 1 is ρ p . In addition, the wireless link environment parameters were consistent with the literature [18], and the remaining specific parameters are shown in Table 2. If there is no special explanation in the simulation, the parameters in the Table 2 are used in the simulation.

Results Analysis
As shown in Figure 2, Lyapunov stability optimization can ensure that the power level of the local mobile device is maintained in a stable state. On the one hand, the task can be offloaded based on the battery power. On the other hand, the mobile device can locally have enough power to keep other applications running. In the experiment, the power of the mobile device is initially zero. As the energy is continuously collected and combined with the energy consumption of the task processing, the power will eventually remain in a stable state. Because the OILP algorithm considers the task priority, it will prioritize high-priority tasks at the beginning, and take energy supplement as a secondary consideration, which will lead to a longer time for the battery energy to reach stability, as shown in Figure 2a, when the number of the local device N = 6, the number of the MEC server M = 2, and the penalty value for the unprocessed tasks Φ = τ. The power of the local mobile devices that use the system and algorithm of this paper tend to be stable at about the 200th time slot. However, when we set the penalty value for the unprocessed tasks Φ = 2τ, as shown in Figure 2b, the power of the local mobile devices tends to be stable at about the 600th time slot, and is less stable than what is shown in Figure 2a. This is because a high penalty value ignores the local battery energy level, resulting in system energy instability. Therefore, in this paper, the penalty value Φ for ordinary tasks that cannot be processed is the time slot interval τ, while for the tasks with priority, the consumption of unprocessed tasks is redefined in Equation (36), so as to ensure that the tasks with priority are processed.
Local CPU maximum ( ) 1.5 GHz MEC CPU capability ( ) 4 Ghz Edge cloud CPU capability ( ) 4 Ghz Wired link upload rate ( ) 100 M/bps Number of wired speed limit links ( ) 3 Probability of generating a priority task ( ) 0.2

Results Analysis
As shown in Figure 2, Lyapunov stability optimization can ensure that the power level of the local mobile device is maintained in a stable state. On the one hand, the task can be offloaded based on the battery power. On the other hand, the mobile device can locally have enough power to keep other applications running. In the experiment, the power of the mobile device is initially zero. As the energy is continuously collected and combined with the energy consumption of the task processing, the power will eventually remain in a stable state. Because the OILP algorithm considers the task priority, it will prioritize high-priority tasks at the beginning, and take energy supplement as a secondary consideration, which will lead to a longer time for the battery energy to reach stability, as shown in Figure 2a, when the number of the local device = 6, the number of the MEC server = 2, and the penalty value for the unprocessed tasks = . The power of the local mobile devices that use the system and algorithm of this paper tend to be stable at about the 200th time slot. However, when we set the penalty value for the unprocessed tasks = 2 , as shown in Figure 2b, the power of the local mobile devices tends to be stable at about the 600th time slot, and is less stable than what is shown in Figure 2a. This is because a high penalty value ignores the local battery energy level, resulting in system energy instability. Therefore, in this paper, the penalty value for ordinary tasks that cannot be processed is the time slot interval , while for the tasks with priority, the consumption of unprocessed tasks is redefined in Equation (36), so as to ensure that the tasks with priority are processed. The experimental data were obtained by averaging 10 experiments, and the confidence intervals for the number of unprocessed tasks are shown in the locally zoomed, dotted intervals in Figure 3. Considering that the system power is stable after about the 300th time slot in the simulation, in Figure The experimental data were obtained by averaging 10 experiments, and the confidence intervals for the number of unprocessed tasks are shown in the locally zoomed, dotted intervals in Figure 3. Considering that the system power is stable after about the 300th time slot in the simulation, in Figure 3a, when the number of the local device N = 15 and the number of the MEC server M = 3, the relationship between the different data size of the task and the number of unprocessed tasks in the 300th to 500th time slots is shown by comparing the integer linear programming (ILP) algorithm with the optimization (OILP) algorithm proposed in this paper. What is more, when the number of the MEC server M = 3 and the task size D = 4Kb, the relationship between the number of the local devices and the number of unprocessed tasks in the 300th to 500th time slots is shown in Figure 3b. From the simulation results, as the size of the tasks and the number of local devices increase, the resources of the MEC server and the edge cloud link become increasingly rare, so the number of unprocessed tasks increases. the optimization (OILP) algorithm proposed in this paper. What is more, when the number of the MEC server = 3 and the task size = 4 Kb, the relationship between the number of the local devices and the number of unprocessed tasks in the 300th to 500th time slots is shown in Figure 3b. From the simulation results, as the size of the tasks and the number of local devices increase, the resources of the MEC server and the edge cloud link become increasingly rare, so the number of unprocessed tasks increases. However, when the number of the local device = 15 and the task size = 4 Kb, as shown in Figure 3c. As the number of MEC servers increases, the number of unprocessed tasks decreases.
In Figure 3d, we reveal the relationship between the number of unprocessed tasks and the number of wired speed limit links of each MEC server. According to the experimental analysis, in the case of random distribution of mobile devices, to get the lowest number of unprocessed tasks, the value of should not be greater than , i.e., is equivalent to the average number of wired speed However, when the number of the local device N = 15 and the task size D = 4Kb, as shown in Figure 3c. As the number of MEC servers increases, the number of unprocessed tasks decreases.
In Figure 3d, we reveal the relationship between the number of unprocessed tasks and the number of wired speed limit links of each MEC server. According to the experimental analysis, in the case of random distribution of mobile devices, to get the lowest number of unprocessed tasks, the value of H should not be greater than N M , i.e., N M is equivalent to the average number of wired speed limit links per MEC server provided to the local device to connect to the edge cloud server. Since the total bandwidth of wired links is constant, when the number of wired speed limit links is small, although high bandwidth can be provided, the available link connections will be more competitive. When the number of wired speed limit links is large, although the available wired link resources are more abundant, the bandwidth provided by each link is reduced, which will affect the QoS of some applications, resulting in tasks that cannot be processed. As shown in Figure 3d, when the number of the local devices N = 15, the number of the MEC servers M = 2 and the task size D = 4 Kb, the number of unprocessed tasks is lowest when H = 3. However, when the task size D = 3 Kb , H can be set a little bit higher; this is because, when the task size is small, the transmission of the tasks needs only a small amount of bandwidth to meet the delay requirement, so the number of links can be increased. In addition, the optimal value of H is also related to the number of mobile devices. If the number of mobile devices is small, the value of H should be set relatively small. In a word, the optimal value of H is associated with factors like the number of mobile devices, the number of servers and the size of tasks. Therefore, it makes sense to give H the right value.
When the number of the local device N = 30 and the number of the MEC server M = 3, the consumption of all local devices in each time slot was averaged for statistics. As shown in Figure 4, because the OILP algorithm in this paper can reduce the number of unprocessed tasks, the average time delay consumption will also be optimized, especially after the power of the system is stable (after about the 300th time slot), and the optimization effect is particularly obvious.
of the local devices = 15, the number of the MEC servers = 2 and the task size = 4 Kb, the number of unprocessed tasks is lowest when H = 3. However, when the task size = 3 Kb, can be set a little bit higher; this is because, when the task size is small, the transmission of the tasks needs only a small amount of bandwidth to meet the delay requirement, so the number of links can be increased. In addition, the optimal value of is also related to the number of mobile devices. If the number of mobile devices is small, the value of should be set relatively small. In a word, the optimal value of is associated with factors like the number of mobile devices, the number of servers and the size of tasks. Therefore, it makes sense to give the right value. When the number of the local device = 30 and the number of the MEC server = 3, the consumption of all local devices in each time slot was averaged for statistics. As shown in Figure 4, because the OILP algorithm in this paper can reduce the number of unprocessed tasks, the average time delay consumption will also be optimized, especially after the power of the system is stable (after about the 300th time slot), and the optimization effect is particularly obvious.   Figure 5b show the CPU resource utilization of the MEC server. When the local device number = 30, the data size of each task = 4Kb, and the reasonable CPU usage value = 0.7, then the (OILP) algorithm proposed in this paper can increase the CPU utilization of the MEC servers. Because of the large size of the tasks to be processed, the virtual resources provided by the MEC server cannot handle multiple tasks, but they can be processed by task segmentation, which can improve both resource utilization and the performance. At the same time, the risk of server failures can be reduced by limiting the usage of the CPU resource.  Figure 5a,b show the CPU resource utilization of the MEC server. When the local device number N = 30, the data size of each task D t i = 4Kb, and the reasonable CPU usage value U jGood = 0.7, then the (OILP) algorithm proposed in this paper can increase the CPU utilization of the MEC servers. Because of the large size of the tasks to be processed, the virtual resources provided by the MEC server cannot handle multiple tasks, but they can be processed by task segmentation, which can improve both resource utilization and the performance. At the same time, the risk of server failures can be reduced by limiting the usage of the CPU resource. In the simulation, the experimental data were obtained by averaging 10 experiments, and the proportion of tasks with priority was simulated by setting the value of , as the value of determines whether the generated tasks have priority or not. When the number of the local device = 6 and the number of the MEC server = 2, we analyzed the impact of task priorities on the system. As shown in Figure 6a, as the proportion of tasks marked with priority goes up, the number of tasks that cannot be processed goes down, so the performance of the system can be improved and In the simulation, the experimental data were obtained by averaging 10 experiments, and the proportion of tasks with priority was simulated by setting the value of ρ p , as the value of ρ p determines whether the generated tasks have priority or not. When the number of the local device N = 6 and the number of the MEC server M = 2, we analyzed the impact of task priorities on the system. As shown in Figure 6a, as the proportion of tasks marked with priority goes up, the number of tasks that cannot be processed goes down, so the performance of the system can be improved and the (OILP) algorithm can reduce the number of unprocessed tasks by more than the (ILP) algorithm. However, overprioritizing tasks will affect the power stability of the system. As shown in Figure 6b, as the proportion of tasks marked with priority increases, the longer it takes for the system to reach stability. In particular, when ρ p = 1, the system will almost always be in a state of low power. This is because the tasks with priority must be processed when the power is sufficient, so the power will be consumed all the time. Therefore, it is necessary to reasonably set the proportion of tasks with priority.
(a) (b) Figure 5. The CPU usage of each MEC server in each time slot. (a) the CPU resource utilization of the MEC server by ILP algorithm; (b) the CPU resource utilization of the MEC server by OILP algorithm.
In the simulation, the experimental data were obtained by averaging 10 experiments, and the proportion of tasks with priority was simulated by setting the value of , as the value of determines whether the generated tasks have priority or not. When the number of the local device = 6 and the number of the MEC server = 2, we analyzed the impact of task priorities on the system. As shown in Figure 6a, as the proportion of tasks marked with priority goes up, the number of tasks that cannot be processed goes down, so the performance of the system can be improved and the (OILP) algorithm can reduce the number of unprocessed tasks by more than the (ILP) algorithm. However, overprioritizing tasks will affect the power stability of the system. As shown in Figure 6b, as the proportion of tasks marked with priority increases, the longer it takes for the system to reach stability. In particular, when = 1, the system will almost always be in a state of low power. This is because the tasks with priority must be processed when the power is sufficient, so the power will be consumed all the time. Therefore, it is necessary to reasonably set the proportion of tasks with priority.

Conclusions
In this article, we propose an MEC-edge cloud server collaborative system model with energy harvesting technology, in order to minimize the processing delay of computing tasks and maximize MEC CPU resource utilization by allocating computing and network resources. We first use the Lyapunov stability theory to propose an objective function for the local device power stability. Then we propose an optimized integer linear programming (OILP) algorithm, which is performed in two steps. Those are the Lyapunov optimization algorithm, based on task priority, and the integer programming algorithm, based on the CPU utilization optimization strategy. Through analysis, the system and algorithm proposed in this paper can improve the utilization of the server and reduce the number of unprocessed tasks and the time delay, while keeping the system power stable. Finally, through simulation experiments, the better effect of the algorithm in this paper was obtained. Even though in an actual environment deployment, the complex environment will bring different parameters, and the different parameters will cause the different results, the idea proposed in this paper is still effective and valuable. In future studies, the attributes and scenarios like partial offloading and the relevance of task processing results need to be considered. In particular, hardware properties like memory and caching need to be studied for heterogeneous systems. In addition, the optimization of wired and wireless backhaul networks is also worth studying.