A linear dependency task offloading method for UAV edge computing network
By deploying edge servers on drones, optimizing offload decisions and resource allocation, the service interruption caused by fixed locations of traditional edge servers is solved, efficient computing and offloading of IoT devices is achieved, reducing energy consumption and improving drones computing service capability.
Patent Information
- Application Number
- CN202210268185.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-17
AI Technical Summary
The fixed location installation of traditional edge servers results in the inability to effectively provide computing offload services for IoT mobile devices during natural disasters or large outdoor activities, and the computing resources and battery capacity of IoT devices are limited, making it difficult to perform computing-intensive tasks.
By deploying edge servers on drones, a drone-assisted mobile edge computing system is built, and mathematical models are used to optimize offload decisions, resource allocation and drone trajectory to achieve linear dependencies and minimize the task.
It effectively reduces the energy consumption of equipment, improves the computing and offloading capabilities of IoT devices in emergencies, and improves the efficiency and flexibility of drones when providing computing services.
Smart Images

Figure CN114599102B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of wireless networks and relates to a method for unloading linearly dependent tasks in an edge computing network of an unmanned aerial vehicle. Background Art
[0002] By deploying edge servers on highly maneuverable drones, flexible MEC services can be provided to users in wireless networks. In recent years, drone-based edge computing networks have received increasing attention. Due to their advantages such as low cost, high mobility, and on-demand deployment, drones have great application potential in wireless communication systems.
[0003] UAV-based edge computing refers to the combination of edge computing architecture and UAV platform. UAVs can act as user nodes to offload computation-intensive tasks to edge servers located at ground base stations, or they can act as edge servers in the air to provide computational offloading services for multiple ground user nodes. With the rapid development of IoT technology and edge intelligence (e.g., the number of IoT mobile devices such as smartphones, tablets, and wearable devices has exploded), emerging and diverse smart applications on IoT mobile devices, such as face recognition and augmented reality, have enabled mobile users to enjoy a high-quality experience. However, most of these applications are computationally intensive tasks that consume a lot of energy. Due to the limited computing resources and battery capacity of IoT mobile devices, it is very challenging to execute these applications. Using mobile edge computing technology, IoT mobile devices can offload some complex computationally intensive tasks to edge servers with powerful computing capabilities, which can greatly reduce the energy consumption of the device. Traditional edge servers are usually installed in fixed-location cellular base stations, which makes them unable to effectively provide computational offloading services for IoT mobile devices when they are damaged by natural disasters or face sudden large-scale outdoor activities. With the continuous breakthroughs and improvements in drone technology, equipping drones with edge servers has become a good way. Compared with traditional architectures, drones equipped with edge servers can provide computing offload services for IoT mobile devices more efficiently due to their advantages such as fast deployment, strong scalability, and flexibility.
[0004] In view of the above considerations, the present invention provides a method for unloading linearly dependent tasks in a UAV edge computing network. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method for unloading linearly dependent tasks in a drone edge computing network. The goal is to minimize energy consumption by jointly optimizing unloading decisions, resource allocation, and drone trajectories.
[0006] The technical solution of the invention is as follows:
[0007] A method for offloading linearly dependent tasks in a drone edge computing network is proposed. First, a drone-assisted mobile edge computing system is constructed, which consists of K = {1, 2, ..., k, ..., |K|} terminal users and a drone equipped with a MEC server. All devices are equipped with a single antenna. Each terminal user has 1 task, and the computing task of terminal user k∈K can be executed locally or offloaded to the drone for execution.
[0008] The method for unloading linear dependent tasks in the edge computing network of a drone proposed in the present invention comprises the following steps:
[0009] 1. Construct a mathematical model for linear dependent task offloading in the UAV edge computing network. The steps are as follows:
[0010] There is a linear dependency between the tasks of the end user k∈K. The task of each end user k∈K is represented as a four-tuple Task k =(L k , I k , C k , O k ), where Task k The data consists of two parts, L k Indicates the program data of the task, in bits; I k Indicates the input data of the task, in bits, input data I k Depends on L k-1 The output result of C k Indicates the number of CPU cycles required to process the task, in cycles / bits; k Represents a task k The calculation result (output data) of is in bits. k The input data I k Equal to dependent task Task k-1 Output data O k-1 , that is I k =O k-1 , for the task of the first terminal user, I1=O0=0.
[0011] a k Task k The uninstall decision, a k =0 means local calculation, a k =1 means to set the task k Offloading to UAV computing. The offloading of end-user tasks consists of two stages: 1) the user transfers the program / result data to the UAV, and 2) the UAV computes the task.
[0012] The completion time of all computing tasks is f seconds. For the sake of convenience, this model adopts the time slot mechanism. We divide the period T into N = {1, 2, ..., n, ..., |N|} with a duration of At the same time, we set the time slot duration τ to be small enough to ensure that the position of the drone is relatively static within each time slot τ.
[0013] Within the task completion time T, the position of each end user is fixed, and the drone flies at a fixed height H above the ground. The horizontal coordinate of the end user k∈K is represented by w k =[x k ,y k ] T , the horizontal coordinate of the drone in the n∈N time slot is marked as Q[n]=[x u [n],y u [n]] T . V max is the maximum speed of the drone, in meters per second, and the maximum flight distance of the drone in each time slot is D max =V max τ. The starting point and the end point of the drone are recorded as Q[1]=Q I , Q[N]=Q F The distance between the positions of two adjacent time slots is less than the maximum flight distance.
[0014] S1-1 Task Dependency Model
[0015] Task of end user k∈K k The task of the end user k-1∈K can be executed locally or by drone. k-1 It can also be executed locally or by drone, so Task k and Task k-1 There are four types of dependencies:
[0016] (1) Case 1, for Task k-1 Execute locally, Task k Also in the case of local execution, Task k-1 Output data O k-1 It needs to be transmitted from the end user k-1∈K to the drone first, and then transmitted to the end user k∈K through the drone.
[0017] (2) Case 2, Task k-1 Execute locally, Task k In the case of drone execution, Task k-1 Output data O k-1It needs to be transmitted from the end user k-1∈K to the UAV.
[0018] (3) Case 3, Task k-1 In drone execution, Task k In the case of local execution, Task k-1 Output data O k-1 needs to be transmitted from the UAV to the end user k∈K.
[0019] (4)Case 4, Task k-1 In drone execution, Task k In the case of drone execution, Task k-1 and Task k All program data needs to be transmitted to the drone.
[0020] S1-2 Calculation Model
[0021] S1-2-1 Task of end user k∈K k Execute locally
[0022] In time slot n∈N, end user k∈K performs task Task k The amount of data is shown in (1)
[0023]
[0024] in It represents the CPU frequency (in cycles / s) of the end user k∈K in the n∈Nth time slot.
[0025] In time slot n∈N, end user k∈K performs task Task k The computational energy consumption is shown in (2)
[0026]
[0027] in represents the effective capacitance coefficient of the end user k∈K.
[0028] Therefore, the total computing energy consumption of all end users can be expressed as
[0029]
[0030] S1-1-2 Task k Offloading to drone computing
[0031] In time slot n∈N, the drone performs task Task k The amount of data is shown in (4)
[0032]
[0033] in It represents the CPU frequency of the drone in the n∈Nth time slot (in cycles / s).
[0034] In time slot n∈N, the drone performs task Task k The computational energy consumption is shown in (5)
[0035]
[0036] where ψ k Represents the effective capacitance coefficient of the drone.
[0037] Therefore, the computing energy consumption of the drone can be expressed as
[0038]
[0039] S1-3 communication model
[0040] In time slot n∈N, the uplink transmission rate from end user k∈K to the UAV is shown in (7)
[0041]
[0042] Where B represents the channel bandwidth between the end user k∈K and the UAV. The bandwidth between all end users and the UAV is equal, and the unit is Hz. k [n] represents the transmission power from the end user k∈K to the UAV, g k [n] is the channel gain between the end user k∈K and the UAV, as shown in formula (8):
[0043]
[0044] Where β represents the channel gain when the distance between the end user and the drone is 1m, which depends on the carrier frequency and antenna gain.
[0045] In time slot n∈N, the amount of uplink data transmitted from end user k∈K to the UAV is shown in (9)
[0046]
[0047] In time slot n∈N, the downlink transmission rate from the UAV to the end user k∈K is shown in (10)
[0048]
[0049] where q k [n] represents the transmission power from the UAV to the end user k∈K.
[0050] In time slot n∈N, the amount of downlink transmission data from the UAV to the end user k∈K is shown in (11)
[0051]
[0052] Based on (7) and (9), the transmission power between the end user k∈K and the UAV in time slot n∈N is shown in formula (12):
[0053]
[0054] Similarly, based on (10) and (11), the transmission power q from the drone to the end user k∈K in time slot n∈N can be calculated: k [n], as shown in formula (13):
[0055]
[0056] In time slot n∈N, the uplink transmission energy consumption from the end user to the UAV is shown in (14):
[0057]
[0058] Therefore, the total uplink transmission energy consumption of all end users can be expressed as
[0059]
[0060] The uplink transmission from the end user k∈K to the UAV has two cases of transmission energy consumption depending on whether the transmission is the calculation result or program data:
[0061] (1) Task of end user k∈K k (Non-task Task |K| ) is executed locally, the end user k∈K assigns the task Task k The calculation result of O k Unload to the drone end and upload the calculation results. The calculation formula is shown in formula (16):
[0062]
[0063] (2) Task of end user k∈K k When executing on the drone side, the drone will task Task k Program data L k The calculation formula for unloading to the drone and uploading program data is shown in (17):
[0064]
[0065] Combining formula (13) and formula (14), the calculation formula for uploaded data is shown in (18):
[0066]
[0067] In time slot n∈N, the downlink transmission energy consumption from the UAV to the end user k∈K is shown in (19)
[0068]
[0069] Therefore, the total energy consumption of the downlink transmission of the UAV can be expressed as
[0070]
[0071] The downlink transmission from the UAV to the end user k∈K can only be the calculation result, and only the task Task k Downlink Task is only required when executing locally k-1 Output data O k-1 .
[0072] Task of end user k∈K k When executing locally, the drone will k The input data I k (Dependent Task k-1 Output data O k-1 ) is transmitted to the terminal user k∈K, and the calculation formula for the downlink transmission calculation result is shown in formula (21)
[0073]
[0074] S1-4 UAV flight energy consumption model
[0075] In time slot n∈N, the flight energy consumption of the UAV is shown in (22)
[0076]
[0077] in W m Represents constants related to drone weight, wingspan efficiency, wing area, etc.
[0078] The total energy consumption of the UAV flight is shown in (23)
[0079]
[0080] S1-5 Problem Description
[0081] Define the mathematical model P1 to minimize the energy consumption of all tasks in the system while satisfying the constraints, as follows:
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089] Q[1]=Q I , Q[N]=Q F (24h)
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096] Formula (24a) is the objective function, where ω k and ω u denote the weight factors of the end user and the UAV, γ is the UAV flight energy consumption factor, χ=(A,Ω,L,F) denotes the optimization variable,
[0097] Formula (24b) represents the data size constraint of the system calculation.
[0098] Equations (24c) and (24d) represent the maximum computing frequency constraints of the end user and the drone.
[0099] Equations (24e) and (24f) represent the data volume constraints for the system's uplink and downlink transmissions.
[0100] Equations (24g) and (24h) represent the position and trajectory constraints of the UAV.
[0101] Formula (24i) indicates that the UAV will not perform task calculations in the first and last time slots.
[0102] Equation (24j) indicates that the terminal user will not have uplink data transmission in the last two time slots.
[0103] Formula (24k) indicates that the UAV will not have downlink data transmission in the first two time slots.
[0104] Equation (241) represents the task offloading decision.
[0105] Equation (24m) and Equation (24n) represent the value range constraints of the optimization variables.
[0106] 2. Find the optimal trajectory of the drone based on convex optimization. The steps are as follows:
[0107] S2-1 constructs a mathematical model under given frequency, unloading decision and unloading data volume. Under given frequency, unloading decision and unloading data volume, the flight trajectory of the UAV is optimized and solved by convex optimization method. The goal of solving the flight trajectory of the UAV is consistent with problem P1, which is to minimize the energy consumption of the system. The mathematical model of the optimization problem P2 can be written as follows:
[0108]
[0109]
[0110] Q[1]=Q I , Q[N]=Q F (25c)
[0111] Where (25a) is the objective function, (25b) and (25c) are constraints, is the optimization variable.
[0112] S2-2 uses the gradient descent method to solve the flight trajectory of the drone. The specific steps are as follows:
[0113] i) Solve problem P2, construct the Lagrangian function and dual problem of P2, let The Lagrange multiplier λ in equation (25b) is defined as [λ1, λ2, …, λ N ], the Lagrangian function of problem P3 is as follows:
[0114]
[0115] The dual function of the mathematical model P2 is defined as The dual problem is stλ≥0;
[0116] ii) The partial derivative of the Lagrangian function (26) with respect to Q[n] is as follows:
[0117]
[0118] According to the KKT condition, we can obtain Q[n]* The expression is as follows:
[0119]
[0120] iii) Initialize the learning rate ζ 1,n , convergence accuracy δ, k is the number of iterations, set k = 0, the initial position of the drone Q[1] = Q I ;
[0121] iv) Calculate the initial point Q[n] in sequence according to formula (28) * , According to formula (26), the Lagrangian function is calculated The value of Ω * =Q[n] * ,
[0122] v) Update the Lagrange multiplier λ based on the gradient descent method n , as shown below:
[0123]
[0124] vi) Calculate the new UAV position Q[n] according to formula (28) * , According to formula (26), the Lagrangian function is calculated The value of
[0125] vii) Judgment Is it true? If so, the iteration ends, indicating that the optimal UAV flight trajectory has been obtained; if not, continue to the next round of iteration, k=k+1, and go to step v).
[0126] S2-3 Under the given frequency, unloading decision and unloading data volume, the flight trajectory of the UAV is obtained according to S2-2, and then the system energy consumption is calculated according to formula (24a), and the target value is recorded as E′.
[0127] 3. According to the UAV trajectory Ω obtained in step 2, solve the unloading decision and resource allocation plan. The solution steps are as follows:
[0128] The goal of the S3-1 unloading decision and resource allocation problem is to minimize the system weighted and energy consumption. The mathematical model P3 of the optimization problem can be written as follows:
[0129]
[0130] (24b), (24c), (24d), (24e), (24f), (24i), (24j), (24k), (241), (24m), (24n) (30b)
[0131] Where χ′=(A,L,F) is the optimization variable,
[0132] After obtaining the UAV trajectory according to step 2, S3-2 uses dynamic programming to solve the minimum energy consumption min{dp[|K|][1][|N|], dp[|K|][0][|N|]} for completing the tasks of |K| terminal users under a given time slot length |N|.
[0133] The system energy consumption is mainly composed of the transmission energy consumption and computing energy consumption of executing each task. The transmission energy consumption includes uplink transmission energy consumption and downlink transmission energy consumption. The uplink transmission energy consumption is divided into the uplink transmission energy consumption of the calculation result and the uplink transmission energy consumption of the program data according to the different transmission data. When the offloading decision of the current task is local calculation, the transmission energy consumption is the downlink transmission energy consumption. The computing energy consumption is divided into local computing energy consumption and drone computing energy consumption according to the task execution location. Two consecutive tasks are executed locally and by drone, respectively, with a total of four combinations: (1) When the previous task and the current task are both executed locally, the system energy consumption is the sum of the uplink transmission energy consumption, the downlink transmission energy consumption and the computing energy consumption. (2) When the previous task is executed locally and the current task is executed by drone, the system energy consumption is the sum of the uplink transmission energy consumption and the computing energy consumption. (3) When the previous task is executed by drone and the current task is executed locally, the system energy consumption is the sum of the downlink transmission energy consumption and the computing energy consumption. (4) When both the previous task and the current task are executed by the UAV, the system energy consumption is the sum of the uplink transmission energy consumption and the computing energy consumption.
[0134] Next, we calculate the task Task of the terminal user k∈K k The system transmission and computing energy consumption when executing on the drone and locally are as follows:
[0135] S3-2-1 In time slot n∈N, when task Task k When the drone is executing, the system transmission and computing energy consumption dp[k][1][n] is
[0136]
[0137] Where dp[k][1][n] represents the task of the end user k∈K k When offloading to the drone, the first k end users use the minimum energy consumption of n∈N time slots; dp[k-1][0][nc] represents the task of end user k-1∈K k-1 When performing computation locally, the first k-1 end users use the minimum energy consumption of nc∈N time slots, Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) Uplink transmission energy consumption, task Task k The energy consumption of program data uplink transmission and task Task k The sum of the computational energy consumed by the drone; dp[k-1][1][nc] represents the task of the end user k-1∈K k-1 When the drone performs computation, the first k-1 end users use the minimum energy consumption of nc∈N time slots, Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The energy consumption of program data uplink transmission and task Task k The sum of the energy consumed by the computations performed on the drone.
[0138] S3-2-2 In time slot n∈N, when task Task k When executing locally, the system transmission and computing energy consumption is
[0139]
[0140] Where dp[k][0][n] represents the task of the end user k∈K k When performing computation locally, the first k end users use the minimum energy consumption of n∈N time slots; Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) The uplink transmission energy consumption and task Task from the end user k-1∈K to the UAV k The input data I k Downlink transmission energy consumption from UAV to end user k∈K and task Task k The sum of the energy consumption of the computations performed locally; Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) The downlink transmission energy consumption from the UAV to the end user k∈K and the task Task kThe sum of the energy consumed by computations performed locally.
[0141] S3-3 According to different task offloading decisions, the following gives the formula (31) and formula (32): and Definition:
[0142] S3-3-1 Task k-1 Execute locally, Task k Also executed locally, transmission and computing energy consumption As shown in formula (33)
[0143]
[0144] in When the transmission time slot length is ijz, the task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) The uplink transmission energy consumption from the end user k-1∈K to the UAV; When the transmission time slot length is j, the task k The input data I k The downlink transmission energy consumption from the UAV to the end user k∈K; To calculate the time slot length z, the task Task k computing energy consumption.
[0145] S3-3-2 Task k-1 Execute locally, Task k Energy consumption of execution, transmission and computing in drones As shown in formula (34)
[0146]
[0147] in When the transmission time slot length is ij, the task k The input data I k (Task of end user k-1∈K k-1 The calculation result of O k-1 ) Uplink transmission energy consumption; When the transmission time slot length is (nc)+ij, the task k Energy consumption of program data uplink transmission; To calculate the time slot length j, the task Task k The computational energy consumption; (nc) means that the first k-1 terminal users are allocated nc∈N time slots.
[0148] S3-3-3 Task k-1 In drone execution, Task k Local execution, transmission and computing energy consumption As shown in formula (35)
[0149]
[0150] in When the transmission time slot length is ij, the task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) The downlink transmission energy consumption from the UAV to the end user k∈K, To calculate the time slot length j, the task Task k computing energy consumption.
[0151] S3-3-4 Task k-1 In drone execution, Task k Also executed in drones, transmission and computing energy consumption As shown in formula (36)
[0152]
[0153] in When the transmission time slot length is (nc)+ij, the task k The energy consumption of program data uplink transmission, To calculate the time slot length j, the task Task k The computational energy consumption is nc∈N. (nc) indicates that the first k-1 terminal users are allocated nc∈N time slots.
[0154] S3-4 structure uplink transmission energy consumption and Downlink transmission energy consumption Calculating energy consumption The sub-problem model of is as follows:
[0155] S3-4-1 When the transmission time slot length is i, the task Task k The input data I k (Task of end user k-1∈K k-1 The calculation result of O k-1 ) Uplink transmission energy consumption The sub-problem is shown in model P4:
[0156]
[0157]
[0158]
[0159] in Task k-1 The uplink transmission of the calculation results starts from The time slot starts at The time slot ends, L is the optimization variable, S3-4-2 When the transmission time slot length is i, the task Task k Energy consumption of program data uplink transmission The sub-problem is shown in model P5:
[0160]
[0161]
[0162]
[0163] in Task k The program data upload starts from the 1st time slot and ends at the time slots before the end, L1 is the optimization variable,
[0164] S3-4-3 When the transmission time slot length is i, the task Task k The input data I k (Task of end user k-1∈K k-1 Output data O k-1 ) The downlink transmission energy consumption from the UAV to the end user k∈K The sub-problems are shown in model P6:
[0165]
[0166]
[0167]
[0168] in Task k The downlink transmission of the calculation results starts from The time slot starts at The time slot ends, L2 is the optimization variable, S3-4-4 calculates the time slot length when it is i, task Task k Computational energy consumption The sub-problems are shown in model P7:
[0169]
[0170]
[0171]
[0172] in Task k The calculation is performed from The time slot starts at The time slot ends, F is the optimization variable,
[0173] S3-5 uses convex optimization to solve the transmission energy consumption problem. For the uplink transmission energy consumption models P4 and P5 and the downlink transmission energy consumption model P6, the solution method is the same, and the gradient descent method can be used to solve them. The following takes the solution of P4 as an example to introduce the steps as follows:
[0174] S3-5-1 Construct the Lagrangian function and dual problem of problem P4, and introduce the Lagrangian multiplier vector μ = [μ1, μ2, …, μ K ], the Lagrangian function of P4 is as follows:
[0175]
[0176] The dual function of mathematical model P4 is defined as The dual problem is
[0177] S3-5-2 The partial derivative of the Lagrangian function (41) with respect to L1 is as follows:
[0178]
[0179] According to the KKT condition, we can get The expression is as follows:
[0180]
[0181] S3-5-3 Initialize learning rate ζ 2,k , convergence accuracy δ, m is the number of iterations, set m = 0;
[0182] S3-5-4 is calculated according to formula (43) According to formula (41), the Lagrangian function is calculated The value of
[0183] S3-5-5 Update the Lagrange multiplier μ based on the gradient descent method k , as shown below:
[0184]
[0185] S3-5-6 is calculated according to formula (43) According to formula (41), the Lagrangian function is calculated The value of
[0186] S3-5-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; if not, continue with the next round of iteration, m=m+1, and go to step S3-5-5.
[0187] S3-6 uses convex optimization to solve the computational energy consumption problem. The steps of solving problem P7 using the gradient descent method are as follows:
[0188] S3-6-1 Construct the Lagrangian function and dual problem of problem P7, and introduce the Lagrangian multiplier vector θ = [θ1, θ2, …, θ K ], the Lagrangian function of P4 is as follows:
[0189]
[0190] The dual function of mathematical model P7 is defined as The dual problem is
[0191] S3-6-2 Lagrangian function (44) Find the partial derivative as follows:
[0192]
[0193]
[0194] According to the KKT condition, we can get and The expression is as follows:
[0195]
[0196]
[0197] S3-6-3 Initialize learning rate ζ 3,k and 4,k , convergence accuracy δ, m is the number of iterations, set m = 0;
[0198] S3-6-4 is calculated according to formula (48) and formula (49): and According to formula (44), the Lagrangian function is calculated The value of
[0199] S3-6-5 Update the Lagrange multiplier θ based on the gradient descent method k , as shown below:
[0200]
[0201] S3-6-6 Calculated according to formula (48) and formula (49) and According to formula (44), the Lagrangian function is calculated The value of
[0202] S3-6-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; if not, continue with the next round of iteration, m=m+1, and go to step S3-6-5.
[0203] In S3-7, when the UAV trajectory Ω is obtained in step 2, the unloading decision and resource allocation plan are solved from S3-1 to S3-6, and then the system energy consumption is calculated according to formula (24a), and the target value is recorded as E.
[0204] 4. Calculate the difference between the current target value E and the previous target value E′. If the difference is less than the threshold ε, that is, |EE′|<ε, the loop iteration ends, indicating that the optimal UAV trajectory, unloading decision and resource allocation plan have been obtained. Otherwise, jump to step 2.
[0205] Beneficial Effects
[0206] The invention solves a method for unloading linearly dependent tasks in the edge computing network of drones, effectively obtaining the optimal value of energy consumption, thereby reducing the energy consumption of equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0207] Figure 1 It is a schematic diagram of the scene model of the present invention;
[0208] Figure 2 This is a flow chart of the task offloading and resource allocation method proposed by the present invention;
[0209] Figure 3 This is a flow chart of the optimization solution of the UAV trajectory based on the gradient descent method of the present invention;
[0210] Figure 4 A flowchart of the unloading decision and resource allocation solution based on dynamic programming and convex optimization of the present invention;
[0211] Figure 5 The present invention takes problem P4 as an example to illustrate the flow chart of unloading decision and resource allocation solution; DETAILED DESCRIPTION
[0212] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0213] Embodiment 1:
[0214] L1 In this embodiment, Figure 1 The following is a schematic diagram of the drone edge computing scenario model, which contains a drone equipped with an edge server, k∈K end users, each user has 1 task, k=3. The location of the end user is w1=[3.6, 3] T , w2=[33,46] T , w3 = [58, 16] T Each task is Task k =(L k , I k , C k , O k ). Processing Task k The CPU cycles required are C k The maximum CPU frequency for end users is The maximum CPU frequency of the edge server is 10Ghz. Assume that the maximum completion time of each task is T max =2s, time slot length τ = 0.2s. During the flight of the drone, the network channel of the drone is time-varying. In order to calculate the channel gain more accurately, this paper sets the time slot duration τ to be small enough to ensure that the position of the drone is relatively static within each time slot τ. The starting and ending positions of the drone are Q I =[0,0] T , Q F =[50,0] T The task is to serially offload to the UAV edge server. Assume that the transmission bandwidth is B = 4 MHZ and the noise power is σ 2 =-70dBm, reference channel power β = -30dBm. End user weight factor ω k =1, drone weight factor ω u =0.2, UAV flight energy consumption factor γ = 10 -4 , UAV maximum flight speed V max =50m / s. Effective capacitance coefficient of drone and terminal equipment ψ u =10 -28 , W m =10kg, learning factor ζ 1,n =0.01,ζ 2,n =0.01,ζ 3,n =0.01,ζ 4,n =0.01.
[0215] L1-1 Initialization task, Task k L k ,I k and O k As shown in Table 1, C k =1000 cycles / bit Each task's pending data is its program data L k and its dependent data I k , unit: Mbits. The initialization of each user’s offloading decision is shown in Table 2, and the initialization of the CPU frequency and the amount of transmitted data in each time slot is shown in Table 3.
[0216] Table 1 Task parameters
[0217] <![CDATA[Task1]]> <![CDATA[Task2]]> <![CDATA[Task3]]> <![CDATA[L k ]]> 0.24 0.24 0.24 <![CDATA[I k ]]> 0.12 0.12 0.12 <![CDATA[O k ]]> 0.12 0.12 0.12
[0218] Table 2 Unloading decisions
[0219] Offloading Policy <![CDATA[Task1]]> 0 <![CDATA[Task2]]> 0 <![CDATA[Task3]]> 0
[0220] Table 3 CPU frequency and amount of data transferred
[0221]
[0222] L2 uses the gradient descent algorithm to find the optimal trajectory of the drone:
[0223] L2-1 transforms the optimization problem P1 into the optimization problem P2 under the given frequency, unloading decision and unloading data volume, and solves the optimization problem P2 using the gradient descent algorithm.
[0224] L2-2-1 constructs the Lagrangian function (25) and the dual problem (26) of P2.
[0225] L2-2-2 According to KKT conditions, we can obtain Q[n] * Expression (27).
[0226] L2-2-3 Initialize learning rate ζ 1,n =0.1, convergence accuracy δ = 10 -2 , the Lagrange multiplier k is the number of iterations, k=0, the initial position of the drone is Q[1]=Q I , Q[N]=Q F .
[0227] L2-2-4 Calculate the initial point Q[n] in sequence according to formula (28) * , As shown in Table 4, the Lagrangian function is calculated according to formula (26): Value Ω * =Q[n]* ,
[0228] Table 4 UAV trajectories
[0229] N=1 N=2 N=3 N=4 N=5 N=6 N=7 N=8 N=9 N=10 <![CDATA[Q[n].x u [n]]> 0 0 0.003152 0.008935 0.008935 0.008935 0.059722 0.069877 0.069877 50 <![CDATA[Q[n].y u [n]]> 0 0 0.002627 0.010689 0.010689 0.010689 0.024692 0.027492 0.027492 0
[0230] L2-2-5 Update the Lagrange multiplier λ based on the gradient descent method n As shown in Table 5.
[0231] Table 5 Lagrange multiplier λ n
[0232] n=2 n=3 n=4 n=5 n=6 n=7 n=8 n=9 n=10 <![CDATA[λ n ]]> 0 4.99959 4.99901 5 5 4.99473 4.99895 5 0.00698694
[0233] L2-2-6 Calculate the new UAV position Q[n] according to formula (26) * , calculate the new Lagrangian function according to formula (26) L(Ω * ,λ) value.
[0234] L2-2-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; if not, continue with the next round of iteration, k=k+1, and go to L2-2-5.
[0235] L2-3, under the given frequency, unloading decision and unloading data volume, calculates the system energy consumption according to the flight trajectory of the UAV obtained in L2-2 and formula (24a), and the target value is recorded as E′.
[0236] Finally, the trajectory of the UAV is obtained through convex optimization as shown in Table 6, and the target value E′=0.211314.
[0237] Table 6 UAV trajectories
[0238] N=1 N=2 N=3 N=4 N=5 N=6 N=7 N=8 N=9 N=10 <![CDATA[Q[n].x u [n]]]> 4.97 9.95 14.92 19.94 24.95 29.96 34.97 39.99 44.99 50 <![CDATA[Q[n].y u [n]]]> 0.09 0.18 0.28 0.36 0.41 0.45 0.50 0.34 0.17 0
[0239] L3 uses dynamic programming algorithms and convex optimization methods to make load decisions and resource allocation plans:
[0240] L3-1 substitutes the optimal trajectory Q[n] of the drone obtained in step S5-2 into the objective equation (23a) to construct the optimization problem P4.
[0241] After L3-2 obtains the optimal trajectory of the UAV according to step S5-2, it uses the dynamic programming algorithm to decompose the convex optimization problem P4 into multiple sub-problems. The energy consumption recursive formulas (29) and (30) for the task UAV calculation and local calculation are established.
[0242] L3-3 establishes formulas (32), (33), (34) and (35) for task energy consumption according to different task offloading decisions.
[0243] L3-4 structure uplink transmission energy consumption and Downlink transmission energy consumption Calculating energy consumption sub-problem model.
[0244] L3-4-1 structure input data uplink transmission energy consumption Sub-problem P4.
[0245] L3-4-2 structure program data uplink transmission energy consumption Sub-question P5.
[0246] L3-4-3 structure downlink transmission energy consumption Sub-question P6.
[0247] L3-4-4 Structure calculation energy consumption Sub-question P7.
[0248] L3-5 uses convex optimization to solve the transmission energy consumption problem. Let’s take solving P4 as an example.
[0249] L3-5-1 constructs the Lagrangian function (40) and dual problem (41) of P4.
[0250] L3-5-2 According to KKT conditions, we can get Expression (42)
[0251] L3-5-3 Initialize learning rate ζ 1,n =0.1, convergence accuracy δ = 10 -2 , the Lagrange multiplier m is the number of iterations, set m=0.
[0252] L3-5-4 is calculated according to formula (41) As shown in Table 7, the Lagrangian function is calculated according to formula (40): Value
[0253] Table 7 Transmission data volume
[0254]
[0255] L3-5-5 Update the Lagrange multiplier μ based on the gradient descent method k As shown in Table 8.
[0256] Table 8 Lagrange multiplier μ k
[0257] k=1 k=2 k=3 <![CDATA[μ k ]]> 0.012 0.012 0.012
[0258] L3-5-6 Calculate the new According to formula (40), the new Lagrangian function is calculated The value of .
[0259] L3-5-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; if not, continue with the next round of iteration, m=m+1, and go to step 5-3-5-5.
[0260] L3-6 uses convex optimization to solve the computational energy consumption problem, and the gradient descent method is used to solve problem P7.
[0261] L3-6-1 constructs the Lagrangian function (44) and the dual problem of P7.
[0262] L3-6-2 According to KKT conditions, we can get and Expressions (47) and (48).
[0263] L3-6-3 Initialize learning rate ζ 3,k = 0.1 and ζ 4,k =0.1, convergence accuracy δ = 10 -2 , the Lagrange multiplier m is the number of iterations, set m=0.
[0264] L3-6-4 is calculated according to formula (46) and formula (47) and As shown in Table 9, the Lagrangian function is calculated according to formula (43): Value
[0265] Table 9 CPU frequency
[0266]
[0267] L3-6-5 Update the Lagrange multiplier θ based on the gradient descent method k As shown in Table 10.
[0268] Table 10 Lagrange multiplier θ k
[0269] k=1 k=2 k=3 <![CDATA[λ n ]]> 0.012 0.012 0.012
[0270] L3-6-6 Calculate the new and According to formula (44), the new Lagrangian function is calculated The value of
[0271] L3-6-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; if not, continue with the next round of iteration, m=m+1, and go to step L3-6-5.
[0272] In L3-7, under the condition of the drone trajectory Ω obtained in step 2, the unloading decision and resource allocation plan are solved from L3-1 to L3-6, and then the system energy consumption is calculated according to formula (23a), and the target value is recorded as E = 0.175017.
[0273] Table 11 Unloading decision
[0274] Offloading Policy <![CDATA[Task1]]> 1 <![CDATA[Task2]]> 1 <![CDATA[Task3]]> 0
[0275] Table 12 CPU frequency and amount of data transferred
[0276]
[0277] L4-4 compares E and E′. If the difference between the target values optimized by step L2 and step L3 is less than the threshold, that is, EE′<ε, the iteration ends, otherwise jumps to L2.
[0278] After multiple iterations of optimization, the final target value is 0.174857. The UAV trajectory, the CPU frequency of all task offloading decision calculations, and the optimal task transmission bits are shown in Tables 13, 14, and 15.
[0279] Table 13 UAV trajectories
[0280] N=1 N=2 N=3 N=4 N=5 N=6 N=7 N=8 N=9 N=10 <![CDATA[Q[n].x u [n]]]> 5.13 10.26 15.31 20.28 25.25 30.22 35.17 40.11 45.06 50 <![CDATA[Q[n].y u [n]]]> 0.33 0.59 0.71 0.62 0.52 0.43 0.33 0.22 0.11 0
[0281] Table 14 Unloading decision
[0282] Offloading Policy <![CDATA[Task1]]> 1 <![CDATA[Task2]]> 1 <![CDATA[Task3]]> 0
[0283] Table 15 CPU frequency and amount of data transferred
[0284]
Claims
1. A method for unloading linear dependent tasks in a UAV edge computing network, comprising the following steps: Step 1: Construct a mathematical model P1 of dependent tasks in the UAV edge computing network; Step 2: Given the frequency F, unloading decision A and unloading data volume L, construct the mathematical model P2; use convex optimization to solve problem P2, obtain the optimal UAV trajectory Ω, calculate the system energy consumption, and record the target value as E′; Step 3: According to the optimal UAV trajectory Ω obtained in step 2, construct the mathematical model P3, use the convex optimization and dynamic programming algorithms to solve the offloading decision and resource allocation scheme in the UAV edge computing network, calculate the system energy consumption, and record the target value as E; Step 4: Calculate the difference between the target value E and E′. If the difference is less than the threshold, that is, |EE′|<ε, the loop iteration ends, otherwise jump to step 2; Step 1: Construct a mathematical model of dependent tasks in the drone edge computing network. The steps are as follows: There is a linear dependency between the tasks of the end user k∈K. The task of each end user k∈K is represented as a four-tuple Task k =(L k , I k , C k , O k ), where Task k The data consists of two parts, L k Indicates the program data of the task, in bits; I k Indicates the input data of the task, in bits, input data I k Depends on L k-1 The output result of C k Indicates the number of CPU cycles required to process the task, in cycles / bits; k Represents a task k The calculation result, that is, the output data, is in bits; Task k The input data I k Equal to dependent task Task k-1 Output data O k-1 , that is I k =O k-1 , for the first terminal user’s task, I1=O0=0; a k Task k The uninstall decision, a k =0 means local calculation, a k =1 means to set the task k Offloading to UAV computing; The offloading of end-user tasks includes two stages: 1) the user transfers the program / result data to the UAV, 2) the UAV computes the task; The completion time of all computing tasks is T seconds. This model adopts the time slot mechanism. We divide the period T into N = {1, 2, ..., n, ..., |N|} with a duration of At the same time, we set the time slot duration τ to be small enough to ensure that the position of the drone is relatively static within each time slot τ; Within the task completion time T, the position of each end user is fixed, and the UAV flies at a fixed height H above the ground; the horizontal coordinate of the end user k∈K is expressed as W k =[x k ,y k ] T , the horizontal coordinate of the drone in the n∈N time slot is marked as Q[n]=[x u [n],y u [n]] T ; V max is the maximum speed of the drone, in meters per second, and the maximum flight distance of the drone in each time slot is D max =V max τ; the starting point and the end point of the UAV are recorded as Q[1] = Q I , Q[N]=Q F ; The distance between the positions of two adjacent time slots is less than the maximum flight distance. S1-1 Task Dependency Model Task of end user k∈K k The task of the end user k-1∈K can be executed locally or by drone. k-1 It can also be executed locally or by drone, so Task k and Task k-1 There are four types of dependencies: (1) Case 1, for Task k-1 Execute locally, Task k Also in the case of local execution, Task k-1 Output data O k-1 It needs to be transmitted from the end user k-1∈K to the drone first, and then transmitted to the end user k∈K through the drone; (2) Case 2, Task k-1 Execute locally, Task k In the case of drone execution, Task k-1 Output data O k-1 Need to be transmitted from end user k-1∈K to the UAV; (3) Case 3, Task k-1 In drone execution, Task k In the case of local execution, Task k-1 Output data O k-1 needs to be transmitted from the UAV to the end user k∈K; (4) Case 4, Task k-1 In drone execution, Task k In the case of drone execution, Task k-1 and Task k All program data needs to be transmitted to the drone; S1-2 Calculation Model S1-2-1 Task of end user k∈K k Execute locally In time slot n∈N, end user k∈K performs task Task k The amount of data is shown in (1) in It represents the CPU frequency of the end user k∈K in the n∈Nth time slot, in cycles / s; In time slot n∈N, end user k∈K performs task Task k The computational energy consumption is shown in (2) in represents the effective capacitance coefficient of the end user k∈K; Therefore, the total computing energy consumption of all end users can be expressed as S1-1-2 Task k Offloading to drone computing In time slot n∈N, the drone performs task k The amount of data is shown in (4) in It represents the CPU frequency of the drone in the n∈Nth time slot, in cycles / s; In time slot n∈N, the drone performs task k The computational energy consumption is shown in (5) where ψ k represents the effective capacitance coefficient of the drone; Therefore, the computing energy consumption of the drone can be expressed as S1-3 communication model In time slot n∈N, the uplink transmission rate from end user k∈K to the UAV is shown in (7) Where B represents the channel bandwidth between the end user k∈K and the UAV. The bandwidth between all end users and the UAV is equal, and the unit is Hz. k [n] represents the transmission power from the end user k∈K to the UAV, g k [n] is the channel gain between the end user k∈K and the UAV, as shown in formula (8): Where H represents the fixed height of the drone from the ground, β represents the channel gain when the distance between the end user and the drone is 1m, which depends on the carrier frequency and antenna gain; In time slot n∈N, the amount of uplink data transmitted from end user k∈K to the UAV is shown in (9) In time slot n∈N, the downlink transmission rate from the UAV to the end user k∈K is shown in (10) where q k [n] represents the transmission power from the UAV to the end user k∈K; In time slot n∈N, the amount of downlink transmission data from the UAV to the end user k∈K is shown in (11) Based on (7) and (9), the transmission power between the end user k∈K and the UAV in time slot n∈N is shown in formula (12): Similarly, based on (10) and (11), the transmission power q from the drone to the end user k∈K in time slot n∈N can be calculated: k [n], as shown in formula (13): In time slot n∈N, the uplink transmission energy consumption from the end user to the UAV is shown in (14): Therefore, the total uplink transmission energy consumption of all end users can be expressed as The uplink transmission from the end user k∈K to the UAV has two cases of transmission energy consumption depending on whether the transmission is the calculation result or program data: (1) Task of end user k∈K k When executing locally, the end user k∈K assigns the task Task k The calculation result of O k Unload to the drone end and upload the calculation results. The calculation formula is shown in formula (16): (2) Task of end user k∈K k When executing on the drone side, the drone will task Task k Program data L k The calculation formula for unloading to the drone and uploading program data is shown in (17): Combining formula (13) and formula (14), the calculation formula for uploaded data is shown in (18): In time slot n∈N, the downlink transmission energy consumption from the UAV to the end user k∈K is shown in (19) Therefore, the total energy consumption of the downlink transmission of the UAV can be expressed as The downlink transmission from the UAV to the end user k∈K can only be the calculation result, and only the task Task k Downlink Task is only required when executing locally k-1 Output data O k-1 ; Task of end user k∈K k When executing locally, the drone will k The input data I k Transmitted to the end user k∈K, where I k That is the dependent task Task k-1 Output data O k-1 , the calculation formula for the downlink transmission calculation result is shown in formula (21) S1-4 UAV flight energy consumption model In time slot n∈N, the flight energy consumption of the UAV is shown in (22) in W m represents constants related to the weight, wingspan efficiency, and wing area of the UAV; The total energy consumption of the UAV flight is shown in (23) S1-5 Problem Description Define the mathematical model P1 to minimize the energy consumption of all tasks in the system while satisfying the constraints, as follows: Q[1]=Q I ,Q[N]=Q F (24h) Formula (24a) is the objective function, where ω k and ω u denote the weight factors of the end user and the UAV, γ is the UAV flight energy consumption factor, χ=(A,Ω,L,F) denotes the optimization variable, Formula (24b) represents the data size constraint of the system calculation; Equations (24c) and (24d) represent the maximum computing frequency constraints of the end user and the UAV; Equation (24e) and Equation (24f) represent the data volume constraints of the system uplink transmission and downlink transmission; Equations (24g) and (24h) represent the position and trajectory constraints of the UAV; Formula (24i) indicates that the UAV will not perform task calculations in the first and last time slots; Equation (24j) indicates that the end user will not have uplink data transmission in the last two time slots; Formula (24k) indicates that the UAV will not have downlink data transmission in the first two time slots; Formula (24l) represents the task offloading decision; Formula (24m) and Formula (24n) represent the value range constraints of the optimization variables; Step 2: Find the optimal trajectory of the drone based on convex optimization. The steps are as follows: S2-1 constructs a mathematical model under given frequency, unloading decision and unloading data volume. Under given frequency, unloading decision and unloading data volume, the flight trajectory of the UAV is optimized and solved by convex optimization method. The goal of solving the flight trajectory of the UAV is consistent with problem P1, which is to minimize the energy consumption of the system. The mathematical model P2 of the optimization problem can be written as follows: Q[1]=Q I ,Q[N]=Q F (25c) Where (25a) is the objective function, (25b) and (25c) are constraints, is the optimization variable; S2-2 uses the gradient descent method to solve the flight trajectory of the drone. The specific steps are as follows: i) Solve the mathematical model P2, construct the Lagrangian function and dual problem of P2, let The Lagrange multiplier λ in equation (25b) is defined as [λ1,λ2,…,λ N ], the Lagrangian function of problem P3 is as follows: The dual function of the mathematical model P2 is defined as The dual problem is ii) The partial derivative of the Lagrangian function (26) with respect to Q[n] is as follows: According to the KKT condition, we can obtain Q[n] * The expression is as follows: iii) Initialize the learning rate ζ 1,n , convergence accuracy δ, k is the number of iterations, set k = 0, the initial position of the drone Q[1] = Q I ; iv) Calculate the initial points in sequence according to formula (28): According to formula (26), the Lagrangian function is calculated The value of v) Update the Lagrange multiplier λ based on the gradient descent method n , as shown below: vi) Calculate the new drone position according to formula (28) According to formula (26), the Lagrangian function is calculated The value of vii) Judgment Is it true? If so, the iteration ends, indicating that the optimal UAV flight trajectory has been obtained; if not, continue to the next round of iteration, k=k+1, and go to step v); S2-3 Under the given frequency, unloading decision and unloading data volume, the flight trajectory of the UAV is obtained according to S2-2, and then the system energy consumption is calculated according to formula (24a), and the target value is recorded as E′; Step 3: According to the UAV trajectory Ω obtained in step 2, solve the unloading decision and resource allocation plan. The solution steps are as follows: The goal of the S3-1 unloading decision and resource allocation problem is to minimize the system weighted and energy consumption. The mathematical model P3 of the optimization problem can be written as follows: (24b), (24c), (24d), (24e), (24f), (24i), (24j), (24k), (241), (24m), (24n) (30b) Where χ′=(A,L,F) is the optimization variable, S3-2 After obtaining the trajectory of the drone according to step 2, dynamic programming is used to solve the minimum energy consumption min{dp[|K|][1][|N|], dp[|K|][0][|N|]} for completing the tasks of |K| end users under a given time slot length |N|; The system energy consumption is mainly composed of the transmission energy consumption and computing energy consumption of executing each task. The transmission energy consumption includes uplink transmission energy consumption and downlink transmission energy consumption. The uplink transmission energy consumption is divided into the uplink transmission energy consumption of the calculation result and the uplink transmission energy consumption of the program data according to the different transmission data. When the offloading decision of the current task is local calculation, the transmission energy consumption is the downlink transmission energy consumption. The computing energy consumption is divided into local computing energy consumption and UAV computing energy consumption according to the task execution location; two consecutive tasks are executed locally and by UAV respectively, with a total of four combinations: (1) When the previous task and the current task are both executed locally, the system energy consumption is the sum of uplink transmission energy consumption, downlink transmission energy consumption and computing energy consumption; (2) When the previous task is executed locally and the current task is executed by UAV, the system energy consumption is the sum of uplink transmission energy consumption and computing energy consumption; (3) When the previous task is executed by UAV and the current task is executed locally, the system energy consumption is the sum of downlink transmission energy consumption and computing energy consumption; (4) When the previous task and the current task are both executed by UAV, the system energy consumption is the sum of uplink transmission energy consumption and computing energy consumption. Next, we calculate the task Task of the terminal user k∈K k The system transmission and computing energy consumption when executing on the drone and locally are as follows: S3-2-1 In time slot n∈N, when task Task k When the drone is executing, the system transmission and computing energy consumption dp[k][1][n] is Where dp[k][1][n] represents the task of the end user k∈K k When offloading to the drone, the first k end users use the minimum energy consumption of n∈N time slots; dp[k-1][0][nc] represents the task of end user k-1∈K k-1 When performing computation locally, the first k-1 end users use the minimum energy consumption of nc∈N time slots, Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k Uplink transmission energy consumption, task Task k The energy consumption of program data uplink transmission and task Task k The sum of the computational energy consumed by the drone; dp[k-1][1][nc] represents the task of the end user k-1∈K k-1 When the drone performs computation, the first k-1 end users use the minimum energy consumption of nc∈N time slots, Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The energy consumption of program data uplink transmission and task Task k The sum of the energy consumption of the computations performed on the drone; S3-2-2 In time slot n∈N, when task Task k When executing locally, the system transmission and computing energy consumption is Where dp[k][0][n] represents the task of the end user k∈K k When performing computation locally, the first k end users use the minimum energy consumption of n∈N time slots; Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k Uplink transmission energy consumption and task from end user k-1∈K to UAV k The input data I k Downlink transmission energy consumption from UAV to end user k∈K and task Task k The sum of the energy consumption of the computations performed locally; Indicates that from the n-c+1th time slot to the nth time slot, with a total of c time slots, the task Task k The input data I k Downlink transmission energy consumption from UAV to end user k∈K and task Task k The sum of the energy consumption of the computations performed locally; S3-3 According to different task offloading decisions, the following gives the formula (31) and formula (32): and Definition: S3-3-1 Task k-1 Execute locally, Task k Also executed locally, transmission and computing energy consumption As shown in formula (33) in When the transmission time slot length is ijz, the task k The input data I k The uplink transmission energy consumption from end user k-1∈K to the UAV; When the transmission time slot length is j, the task k The input data I k The downlink transmission energy consumption from the UAV to the end user k∈K; To calculate the time slot length z, the task Task k The computing energy consumption of S3-3-2Task k-1 Execute locally, Task k Energy consumption of execution, transmission and computation in drones As shown in formula (34) in When the transmission time slot length is ij, the task k The input data I k Uplink transmission energy consumption; When the transmission time slot length is (nc)+ij, the task k Energy consumption of program data uplink transmission; To calculate the time slot length j, the task Task k The computational energy consumption; (nc) indicates that the first k-1 terminal users are allocated nc∈N time slots; S3-3-3 Task k-1 In drone execution, Task k Local execution, transmission and computing energy consumption As shown in formula (35) in When the transmission time slot length is ij, the task k The input data I k The downlink transmission energy consumption from the UAV to the end user k∈K, To calculate the time slot length j, the task Task k The computing energy consumption of S3-3-4 Task k-1 In drone execution, Task k Also executed in drones, transmission and computing energy consumption As shown in formula (36) in When the transmission time slot length is (nc)+ij, the task k The energy consumption of program data uplink transmission, To calculate the time slot length j, the task Task k The computational energy consumption; (nc) indicates that the first k-1 terminal users are allocated nc∈N time slots; S3-4 structure uplink transmission energy consumption and Downlink transmission energy consumption Calculating energy consumption The sub-problem model of is as follows: S3-4-1 When the transmission time slot length is i, the task Task k The input data I k Uplink transmission energy consumption The sub-problem is shown in model P4: in Task k-1 The uplink transmission of the calculation results starts from The time slot starts at The time slot ends, L is the optimization variable, S3-4-2 When the transmission time slot length is i, the task Task k Energy consumption of program data uplink transmission The sub-problem is shown in model P5: in Task k The program data upload starts from the 1st time slot and ends at the time slots before the end, L1 is the optimization variable, S3-4-3 When the transmission time slot length is i, the task Task k The input data I k Energy consumption of downlink transmission from UAV to end user k∈K The sub-problems are shown in model P6: in Task k The downlink transmission of the calculation results starts from The time slot starts at The time slot ends, L2 is the optimization variable, S3-4-4 calculates the time slot length when it is i, task Task k Computational energy consumption The sub-problems are shown in model P7: in Task k The calculation is performed from The time slot starts at The time slot ends, F is the optimization variable, S3-5 uses convex optimization to solve the transmission energy consumption problem. For the uplink transmission energy consumption models P4 and P5 and the downlink transmission energy consumption model P6, the solution method is the same, and the gradient descent method can be used to solve them. The following takes the solution of P4 as an example to introduce the steps as follows: S3-5-1 Construct the Lagrangian function and dual problem of problem P4, and introduce the Lagrangian multiplier vector μ=[μ1,μ2,…,μ K ], the Lagrangian function of P4 is as follows: The dual function of mathematical model P4 is defined as The dual problem is S3-5-2 The partial derivative of the Lagrangian function (41) with respect to L1 is as follows: According to the KKT condition, we can get The expression is as follows: S3-5-3 Initialize learning rate ζ 2,k , convergence accuracy δ, m is the number of iterations, set m = 0; S3-5-4 Calculated according to formula (43) According to formula (41), the Lagrangian function is calculated The value of S3-5-5 Update the Lagrange multiplier μ based on the gradient descent method k , as shown below: S3-5-6 is calculated according to formula (43) According to formula (41), the Lagrangian function is calculated The value of S3-5-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; If not, continue to the next iteration, m=m+1, and go to step S3-5-5; S3-6 uses convex optimization to solve the computational energy consumption problem. The steps of solving problem P7 using the gradient descent method are as follows: S3-6-1 Construct the Lagrangian function and dual problem of problem P7, and introduce the Lagrangian multiplier vector θ=[θ1,θ2,…,θ K ], the Lagrangian function of P4 is as follows: The dual function of mathematical model P7 is defined as The dual problem is S3-6-2 Lagrangian function (44) Find the partial derivative as follows: According to the KKT condition, we can get and The expression is as follows: S3-6-3 Initialize learning rate ζ 3,k and 4,k , convergence accuracy δ, m is the number of iterations, set m = 0; S3-6-4 is calculated according to formula (48) and formula (49): and According to formula (44), the Lagrangian function is calculated The value of S3-6-5 Update the Lagrange multiplier θ based on the gradient descent method k , as shown below: S3-6-6 Calculated according to formula (48) and formula (49) and According to formula (44), the Lagrangian function is calculated The value of S3-6-7 Judgment Is it true? If so, the iteration ends, indicating that the optimal solution has been found; If not, continue to the next iteration, m=m+1, and go to step S3-6-5; S3-7, in the case of the drone trajectory Ω obtained in step 2, solve the unloading decision and resource allocation plan from S3-1 to S3-6, and then calculate the system energy consumption according to formula (24a), and the target value is recorded as E; Step 4 calculates the difference between the current target value E and the previous target value E′. If the difference is less than the threshold ε, that is, |EE′|<ε, the loop iteration ends, indicating that the optimal UAV trajectory, unloading decision and resource allocation plan have been obtained. Otherwise, jump to step 2.
