UAV network edge service deployment method based on improved whale optimization algorithm
By improving the whale optimization algorithm, building the fitness function and introducing nonlinear convergence factors and cross-learning strategies, the problems of slow convergence speed and high cost in the deployment of edge service of UAV network are solved, and faster convergence and higher benefits are achieved.
Patent Information
- Application Number
- CN202510572690.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-05-06
AI Technical Summary
When traditional heuristic algorithms and reinforcement learning algorithms are used for UAV network edge service deployment, there is a problem that the algorithm converges slowly, has poor optimization ability, is prone to falling into local optimality, and does not consider storage capacity limitations and service deployment costs, resulting in low actual deployment benefits.
The improved whale optimization algorithm is adopted to build a mathematical model of the benefits and costs of service deployment, define the fitness function, and introduce nonlinear convergence factors, horizontal and vertical crossover and elite reverse learning strategies to optimize the service deployment candidate solutions to improve convergence speed and optimization ability.
The convergence speed of edge service deployment is improved, avoiding falling into local optimality, reducing service deployment costs, and improving service deployment benefits. The simulation results show that the convergence speed is increased by 33.3% and the cost reduction is reduced by 18.3% compared with the IGA algorithm, and the profit is increased by 27.1% compared with the DRL method.
Smart Images

Figure CN120091320B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of edge computing technology, and specifically relates to a method for deploying edge services in a drone network based on an improved whale optimization algorithm. Background Art
[0002] With the rapid development of communications technology, ground infrastructure has experienced explosive growth. In areas affected by natural disasters such as earthquakes, floods, and typhoons, as well as in stadiums hosting large-scale sports events or concerts, ground infrastructure is damaged or inadequate. Traditional ground networks are unable to provide real-time communication and computing services, severely hindering emergency response and mission execution efficiency. Using unmanned aerial vehicles (UAVs) or hot air balloons (HABs) as aerial base stations, combined with mobile edge computing (MEC) technology, to temporarily build wide-area wireless communication networks, thereby providing temporary communication and computing services to users when ground infrastructure is damaged, has become the most promising solution to these problems.
[0003] However, when using UAVs as aerial base stations, the corresponding computing services must be pre-deployed on the edge servers onboard the UAVs for them to function. For example, before executing an image recognition task, the corresponding image recognition service must be pre-deployed on the target UAV's edge server. In reality, UAVs are payload-constrained and cannot carry large edge servers. This results in limited storage capacity on the edge servers onboard UAVs, making it impossible to deploy all services. Since edge servers on ground base stations do not suffer from payload constraints, existing research generally assumes that all required services are available on the edge servers, but this does not apply to UAV networks.
[0004] Using traditional heuristic algorithms to solve the service deployment problem is a common approach. For example, Beijing University of Posts and Telecommunications, in its patent application document "Adaptive Multi-Service Flow Distributed Service Deployment Method and System for Low-Earth Orbit Satellites" (filing date: April 16, 2024, application number: 202410457470.4, application publication number: CN118487642 A), discloses a service deployment method based on the heuristic atomic orbital search (AOS) algorithm, which simulates the service deployment mechanism as an atomic model. This heuristic AOS-based service deployment method has the following shortcomings: all candidate solutions for service deployment are generated by a single algorithm iteration, resulting in insufficient population diversity. The structure and content within the candidate solution set (i.e., the population) are relatively similar, resulting in a weak algorithm's optimization ability and a tendency to fall into local optimal solutions. Xidian University, the applicant, disclosed a service deployment method based on an improved genetic algorithm (IGA) in its patent application, "Method and System for Service Deployment in Edge Environments Based on an Improved Genetic Algorithm" (filing date: April 17, 2024, application number: 202410459145.1, publication number: CN118101500 A). This IGA-based service deployment method has the following shortcomings: its algorithm uses a linear update iteration method, which slows convergence when the population size is large; and the objective function's constraints fail to consider storage capacity, making it unsuitable for UAV networks with limited storage capacity.
[0005] With the development of artificial intelligence technology, some researchers have begun using reinforcement learning algorithms to solve service deployment problems. For example, the applicant, East China Jiaotong University, disclosed a service deployment method based on deep reinforcement learning (DRL) in its patent application document "Method for Deploying Mobile Edge Computing Services in Internet of Vehicles Based on Deep Reinforcement Learning" (Application Date: July 29, 2024, Application Number: 202411017827.3, Application Publication Number: CN118555578 A). This service deployment method based on deep reinforcement learning has the following shortcomings: the training cost of deep reinforcement learning is high, deep neural networks are difficult to deploy directly on UAVs, and the goal of this method is to maximize the benefits of service deployment, but it lacks consideration of the cost of service deployment. If the cost of service deployment is too high, the actual benefits of service deployment will be reduced.
[0006] In summary, when traditional heuristic algorithms or reinforcement learning algorithms are used for UAV network edge service deployment, the algorithm has slow convergence speed and poor optimization ability, and is prone to falling into local optimality and high service deployment costs and low benefits. Summary of the Invention
[0007] Purpose of the invention: When solving the service deployment problem based on traditional heuristic algorithms, it usually relies on a single iteration to generate candidate solutions, resulting in insufficient population diversity, limited optimization ability, and easy to fall into local optimality; and when the population size is large, the service deployment convergence speed is significantly reduced. In addition, the objective function does not consider the storage capacity limit in the constraints, which makes it difficult to apply to UAV networks with limited storage capacity; at the same time, there is a lack of consideration of the service deployment cost, resulting in low actual deployment benefits. The present invention proposes a drone network edge service deployment method based on an improved whale optimization algorithm to make up for the shortcomings of the above technologies.
[0008] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0009] The present invention provides a method for deploying edge services in a drone network based on an improved whale optimization algorithm, comprising the following steps:
[0010] S1: Deploy drones in a designated area and establish a temporary network to initialize candidate service deployment solutions;
[0011] S2: Establish mathematical models for the benefits and costs of service deployment, and define a fitness function based on the benefits and costs of service deployment. The fitness function is defined as the difference between the service deployment cost and the service deployment benefit. The service deployment cost is composed of the storage, computing power, and energy consumption occupied by the deployed service. The service deployment benefit is composed of the user computing tasks actually processed by the service and the resource utilization of the service, and is defined as a logarithmic function.
[0012] S3: Using the improved whale optimization algorithm that introduces nonlinear convergence factors, horizontal and vertical crossover and elite reverse learning strategies, the candidate solutions for service deployment are iteratively updated; the horizontal and vertical crossover is divided into horizontal crossover and vertical crossover. The horizontal crossover generates child solutions by crossover operations in the same dimension, and the vertical crossover generates child solutions by crossover operations in different dimensions; the elite reverse learning strategy uses the current optimal solution , the maximum value of the candidate solution and minimum value Construct an elite reverse solution, which is defined as ;
[0013] S4: The fitness function value is calculated after each iteration. If a better solution is found, the global optimal solution is updated until the convergence condition is met or the maximum number of iterations is reached. The algorithm terminates and outputs the global optimal service deployment plan.
[0014] Furthermore, the step S1 is specifically as follows:
[0015] S1-1: Deploy drones in a designated area and establish a temporary network:
[0016] Deploy in designated areas UAV, and with the ground segment users to form a temporary network; the drone set and user set are represented as and Among them, the drone is equipped with an edge server to provide computing services to users; Represents a collection of services. Due to the limited storage capacity of the edge server carried by the drone, each drone can only deploy a part of the services;
[0017] S1-2: Initialize service deployment candidate solutions:
[0018] In the initial stage of the network, the service deployment scheme is randomly initialized, and the candidate solutions for drone service deployment are defined as:
[0019] (1),
[0020] in, is the number of candidate solutions in the search space, and each candidate solution is represented as follows:
[0021] (2),
[0022] Among them, the binary function Indicates the UAVs among the candidate solutions Do you need to deploy services? ,when When indicating drone No deployment service required ,when When indicating drone Requires deployment service ;definition For service The storage capacity occupied, candidate solutions must meet , namely drones The service deployed on the network cannot exceed a single drone. Maximum capacity .
[0023] Furthermore, the step S2 is specifically as follows:
[0024] S2-1: Establish mathematical models for service deployment benefits and costs:
[0025] The service deployment cost is composed of three parts: storage, computing power, and energy consumption generated by the use of drone resources, which are defined as:
[0026] drones Service deployment storage resource usage cost :
[0027] (3),
[0028] in, For service The storage capacity occupied, binary function Indicates drone Is the service deployed? ,when When indicating drone Deployed the service ,when When indicating drone No deployment service ;
[0029] drones Computing resource usage cost of service deployment :
[0030] (4),
[0031] in, For service The computing resources used;
[0032] drones Service deployment energy cost :
[0033] (5),
[0034] in, For drones Services deployed on Response time for processing user tasks; For drones Give Service The computing power required to provide computing support; therefore, the cost of deploying services in the network is represented as:
[0035] (6),
[0036] in, is the total storage capacity of the UAV, is the total computing power resource of the drone, is the total energy capacity of the drone battery; the service deployment benefit in the network is represented as:
[0037] (7),
[0038] in, For service The resource utilization rate ranges from 0 to 1. The larger the value, the higher the resource utilization of the service; For drones Services on board The actual amount of user computing tasks processed; represents the logarithmic function;
[0039] S2-2: Define the fitness function based on service deployment benefits and costs:
[0040] In the iterative process of improving the whale optimization algorithm, the algorithm fitness function Defined as:
[0041] =k Cost-(1-k) Ben (8),
[0042] in, is the performance gain coefficient, ranging from 0 to 1. The larger k is, the more attention is paid to the service deployment cost.
[0043] Furthermore, the step S3 is specifically as follows:
[0044] S3-1: Defining the Convergence Factor For nonlinear update:
[0045] (9),
[0046] in, is the number of iterations, is the maximum number of iterations, is the maximum value of the convergence factor, is the minimum value of the convergence factor, is pi;
[0047] S3-2: Use the improved whale optimization algorithm to iteratively update the candidate solutions for service deployment:
[0048] Defining random parameters , ,in and is a random number generated in the interval [0,1] at each iteration; for each candidate solution , generate random numbers , perform the following updates:
[0049] like and , update the way to surround the prey to:
[0050] (10),
[0051] in, Indicates the Candidate solution at +1 iteration, Indicates the The optimal solution at the iteration time; Indicates the Candidate solution at the iteration time;
[0052] like and , update the bubble net attack method to:
[0053] (11),
[0054] in, is the spiral coefficient constant, is a random number generated in the interval [−1,1], is the base of the natural logarithm function;
[0055] like , update the random search method to:
[0056] (12),
[0057] in, For the A random individual in the population at the iteration;
[0058] S3-3: Add horizontal and vertical cross-strategy:
[0059] If the crossover probability , the following strategy is executed:
[0060] Horizontal crossover: randomly select two candidate solutions 、 , perform crossover operations in the same dimension to generate sub-solutions;
[0061] Vertical intersection: the same candidate solution In different dimensions and Inter-cross generation of sub-solutions;
[0062] S3-4: Join the elite reverse learning strategy:
[0063] Using the current optimal solution Constructing an elite reverse solution :
[0064] (13),
[0065] in, and are the maximum and minimum values of the candidate solutions in the current solution space, respectively.
[0066] Furthermore, the step S4 is specifically as follows:
[0067] S4-1: Repeat step S3 until the convergence condition is met or the maximum number of iterations is reached:
[0068] After each round of iteration, the fitness function value of the updated candidate solution is calculated; if a better solution appears in the current iteration, the global optimal solution is updated Repeat step S3 until the maximum number of iterations is reached or the convergence threshold is met , that is, satisfy one of the conditions of formula (14):
[0069] (14),
[0070] Among them, condition 2 means that the algorithm is continuous The change in the fitness function value during the round iteration is less than the convergence threshold , indicating that the optimal solution has been basically stable, and the iteration is stopped in advance;
[0071] S4-2: The algorithm terminates and outputs the global optimal service deployment solution:
[0072] After the algorithm stops iterating, it outputs the global optimal service deployment solution ; and the corresponding service deployment benefits and cost ;
[0073] S4-3: Dynamic adjustment of service deployment plan and resource recovery and release:
[0074] Every time T, periodically monitor the drone service deployment benefits Changes and historical returns With current earnings Compare, if:
[0075] (15),
[0076] in, To prevent the denominator from being a very small positive number of zero, when formula (15) is greater than the service revenue change threshold When the service revenue change threshold is reached, re-execute steps S2-S4 to dynamically adjust and optimize the existing service deployment plan; The value range is in the interval [0.1, 0.3]. The monitoring period T is set to be inversely proportional to the fluctuation intensity of service revenue, and is defined as:
[0077] (16),
[0078] in, is the maximum monitoring period allowed, is the adjustment coefficient, which is used to control the sensitivity of revenue fluctuation to the monitoring period. The greater the fluctuation of service revenue, the shorter the monitoring period T, so as to quickly adapt to the dynamic changes of user needs in the network. Finally, the optimized service deployment plan is compared with the current plan. If the drone On Service In the new plan If the value changes from 1 to 0, the service no longer needs to be deployed, and the storage and computing resources occupied by the service are immediately released. If the service changes from an undeployed state to a deployed state, the storage and computing resources of the drone are allocated accordingly to meet the new demand.
[0079] The advantages and technical effects of the present invention are as follows:
[0080] The present invention first constructs a fitness function based on the benefits and costs of service deployment, so that the edge service deployment tends to choose a deployment scheme that maximizes benefits and minimizes costs during the optimization process, thereby effectively improving the benefits of service deployment and reducing costs; then, by introducing a nonlinear convergence factor, the convergence speed of edge service deployment is improved; using an improved whale optimization algorithm that combines horizontal and vertical crossover and elite reverse learning strategies, the diversity of the population is increased, the optimization ability of edge service deployment is improved, and it can quickly find the global optimal solution. Finally, after simulation verification, the edge service deployment method based on the improved whale optimization algorithm in the present invention improves the convergence speed by about 33.3% compared to the edge service deployment method based on the IGA algorithm; when the maximum capacity of the UAV is 4GB, the present invention reduces the service deployment cost by about 18.3% and increases the service deployment benefit by about 27.1% compared to the DRL method.
[0081] In summary, the present invention can effectively improve the convergence speed and optimization capability of edge service deployment, avoid falling into local optimality, increase service deployment benefits and reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is an overall flow chart of an embodiment of the present invention;
[0083] Figure 2 is a network architecture diagram of an embodiment of the present invention;
[0084] Figure 3The following is a comparison of the convergence speed simulation results using the present invention and the traditional heuristic method according to an embodiment of the present invention;
[0085] Figure 4 This is a comparison of cost change simulation results for service deployment using the present invention and a deep reinforcement learning method in an embodiment of the present invention.
[0086] Figure 5 This is a comparison of simulation results of revenue changes for service deployment using the present invention and a deep reinforcement learning method in accordance with an embodiment of the present invention. DETAILED DESCRIPTION
[0087] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0088] This embodiment proposes a method for deploying drone network edge services based on an improved whale optimization algorithm. The overall flow chart is as follows: Figure 1 As shown, the following steps are included:
[0089] S1: Deploy drones in a designated area and establish a temporary network to initialize the service deployment candidate solution. The specific steps are as follows:
[0090] S1-1: Deploy drones in a designated area and establish a temporary network:
[0091] like Figure 2 As shown in the figure, 4 drones are deployed in the designated area and form a temporary network with 5 users on the ground. The drone set and user set are represented as and Among them, the drone is equipped with an edge server to provide computing services to users; Represents a collection of services. Due to the limited storage capacity of the edge server carried by the drone, each drone can only deploy a part of the services;
[0092] S1-2: Initialize service deployment candidate solutions:
[0093] In the initial stage of the network, the service deployment scheme is randomly initialized, and the candidate solutions for drone service deployment are defined as:
[0094] (1)
[0095] in, is the number of candidate solutions in the search space, and each candidate solution is represented as follows:
[0096] (2)
[0097] Among them, the binary function Indicates the UAVs among the candidate solutions Do you need to deploy services? ,when When indicating drone No deployment service required ,when When indicating drone Requires deployment service ;definition For service The storage capacity occupied, candidate solutions must meet , namely drones The service deployed on the network cannot exceed a single drone. Maximum capacity .
[0098] S2: Establish mathematical models for service deployment benefits and costs respectively, and define a fitness function based on the benefits and costs of service deployment. The fitness function is defined as the difference between the service deployment cost and the service deployment benefit. The service deployment cost is composed of the storage, computing power, and energy consumption occupied by the deployed service. The service deployment benefit is composed of the user computing tasks actually processed by the service and the resource utilization rate of the service, and is defined as a logarithmic function. The specific steps are as follows:
[0099] S2-1: Establish mathematical models for service deployment benefits and costs:
[0100] The service deployment cost is composed of three parts: storage, computing power, and energy consumption generated by the use of drone resources, which are defined as:
[0101] drones Service deployment storage resource usage cost :
[0102] (3)
[0103] in, For service The storage capacity occupied, binary function Indicates drone Is the service deployed? ,when When indicating drone Deployed the service ,when When indicating drone No deployment service ;
[0104] drones Computing resource usage cost of service deployment :
[0105] (4)
[0106] in, For service The computing resources used;
[0107] drones Service deployment energy cost :
[0108] (5)
[0109] in, For drones Services deployed on Response time for processing user tasks; For drones Give Service The computing power required to provide computing support; therefore, the cost of deploying services in the network is represented as:
[0110] (6)
[0111] in, is the total storage capacity of the UAV, is the total computing power resource of the drone, is the total energy capacity of the drone battery; the service deployment benefit in the network is represented as:
[0112] (7)
[0113] in, For service The resource utilization rate ranges from 0 to 1. The larger the value, the higher the resource utilization of the service; For drones Services on board The actual amount of user computing tasks processed; Represents a logarithmic function, drone The more services deployed on a drone, the more user computing tasks it actually handles, but the less storage resources are available. Therefore, when the number of services deployed on a drone reaches a certain level, the growth rate of service deployment benefits will slow down, avoiding waste caused by over-deployment.
[0114] S2-2: Define the fitness function based on service deployment benefits and costs:
[0115] In the iterative process of improving the whale optimization algorithm, the algorithm tends to find the solution with the minimum value of the fitness function, that is, the global optimal solution of the service deployment scheme in the network; therefore, the algorithm fitness function Defined as:
[0116] =k Cost-(1-k) Ben (8)
[0117] in, is the performance gain coefficient, and its value range is between 0 and 1. The larger k is, the more attention is paid to the service deployment cost. In this embodiment, k=0.92.
[0118] S3: Using the improved whale optimization algorithm that introduces nonlinear convergence factors, horizontal and vertical crossover and elite reverse learning strategies, the candidate solutions for service deployment are iteratively updated; the horizontal and vertical crossover is divided into horizontal crossover and vertical crossover. The horizontal crossover generates child solutions by crossover operations in the same dimension, and the vertical crossover generates child solutions by crossover operations in different dimensions; the elite reverse learning strategy uses the current optimal solution , the maximum value of the candidate solution and minimum value Construct an elite reverse solution, which is defined as , the specific steps are as follows:
[0119] S3-1: Defining the Convergence Factor For nonlinear update:
[0120] In order to speed up the convergence of edge service deployment, the present invention defines the convergence factor For nonlinear update:
[0121] (9)
[0122] in, is the number of iterations, is the maximum number of iterations. In this embodiment, the maximum number of iterations is taken =10, is the maximum value of the convergence factor, is the minimum value of the convergence factor. In this embodiment, =2, =0.8, is pi;
[0123] S3-2: Use the improved whale optimization algorithm to iteratively update the candidate solutions for service deployment:
[0124] Defining random parameters , ,in and is a random number generated in the interval [0,1] at each iteration; for each candidate solution , generate random numbers , perform the following updates:
[0125] like and , update the way to surround the prey to:
[0126] (10)
[0127] in, Indicates the Candidate solution at +1 iteration, Indicates the The optimal solution at the iteration time; Indicates the Candidate solution at the iteration time;
[0128] like and , update the bubble net attack method to:
[0129] (11)
[0130] in, is the spiral coefficient constant, is a random number generated in the interval [−1,1], is the base of the natural logarithm function;
[0131] like , update the random search method to:
[0132] (12)
[0133] in, For the A random individual in the population at the iteration;
[0134] S3-3: Add horizontal and vertical cross-strategy:
[0135] In order to increase population diversity and improve optimization ability, a horizontal and vertical crossover strategy is introduced. If the crossover probability , the following strategy is executed:
[0136] Horizontal crossover: randomly select two candidate solutions 、 , perform crossover operations in the same dimension to generate sub-solutions;
[0137] Vertical intersection: the same candidate solution In different dimensions and Inter-cross generation of sub-solutions;
[0138] In this embodiment, the crossover probability =0.8;
[0139] S3-4: Join the elite reverse learning strategy:
[0140] To prevent edge service deployment from falling into local optimality, the current optimal solution is used Constructing an elite reverse solution :
[0141] (13)
[0142] in, and are the maximum and minimum values of the candidate solutions in the current solution space, respectively.
[0143] S4: After each iteration, the fitness function value is calculated. If a better solution is found, the global optimal solution is updated until the convergence condition is met or the maximum number of iterations is reached. The algorithm terminates and outputs the global optimal service deployment solution. The specific steps are as follows:
[0144] S4-1: Repeat step S3 until the convergence condition is met or the maximum number of iterations is reached:
[0145] After each round of iteration, the fitness function value of the updated candidate solution is calculated; if a better solution appears in the current iteration, the global optimal solution is updated Repeat step S3 until the maximum number of iterations is reached or the convergence threshold is met , that is, satisfy one of the conditions of formula (14):
[0146] (14)
[0147] Among them, condition 2 means that the algorithm is continuous The change in the fitness function value during the round iteration is less than the convergence threshold , indicating that the optimal solution has been basically stable, and the iteration is stopped in advance to save computing resources. In this embodiment, the convergence threshold is =0.01;
[0148] S4-2: The algorithm terminates and outputs the global optimal service deployment solution:
[0149] After the algorithm stops iterating, it outputs the global optimal service deployment solution ; and the corresponding service deployment benefits and cost ;
[0150] S4-3: Dynamic adjustment of service deployment plan and resource recovery and release:
[0151] During network operation, due to the dynamic changes in user demand, the previously deployed service solution may no longer be optimal; therefore, every time T, the drone service deployment benefits are periodically monitored. Changes and historical returns With current earnings Compare, if:
[0152] (15)
[0153] in, In order to prevent the denominator from being a very small positive number of zero, in this embodiment, =0.0001, when formula (15) is greater than the service revenue change threshold When the service revenue change threshold exceeds 10%, the service revenue change threshold is re-executed to dynamically adjust and optimize the existing service deployment plan; since the revenue change exceeds 10%, it can effectively reflect the significant change in demand, and when it exceeds 30%, the response is obviously delayed; therefore, the service revenue change threshold in the present invention is The value range is in the interval [0.1, 0.3]. In this embodiment, =0.2; the monitoring period T is set to be inversely proportional to the fluctuation intensity of service revenue, which is defined as:
[0154] (16)
[0155] in, The maximum monitoring period allowed is =1 hour; is the adjustment coefficient, which is used to control the sensitivity of revenue fluctuation to the monitoring period; the greater the fluctuation of service revenue, the shorter the monitoring period T, so as to quickly adapt to the dynamic changes of user needs in the network; in this embodiment, =10; Finally, compare the optimized service deployment plan with the current plan. If the drone On Service In the new plan If the value changes from 1 to 0, the service no longer needs to be deployed, and the storage and computing resources occupied by the service are immediately released. If the service changes from an undeployed state to a deployed state, the storage and computing resources of the drone are allocated accordingly to meet the new demand.
[0156] The simulation comparison results of the convergence speed using the method provided by the present invention and the traditional heuristic method are as follows: Figure 3As shown, the traditional heuristic algorithms are an edge service deployment method based on an improved genetic algorithm (IGA) and an edge service deployment method based on an atomic orbital search algorithm (AOS). This embodiment was simulated in Matlab R2021a, using a computer with 32GB of memory and an x64-based Intel Core i5-12400F CPU processor. The specific parameters of all simulations in this embodiment are listed in Table 1.
[0157] Table 1 Simulation parameters
[0158]
[0159] from Figure 3 From the simulation results, it can be seen that the edge service deployment method based on AOS performs the worst in terms of convergence speed, and convergence is achieved at the 10th iteration. This is because AOS lacks effective population expansion and global search mechanisms and is prone to falling into local optimality. In comparison, the edge service deployment method based on IGA has better performance, but still has the problem of slow convergence speed, and convergence is achieved at the 6th iteration. The method proposed in the present invention is obviously superior to the edge service deployment methods based on AOS and IGA, and converges at the 4th iteration, which is about 33.3% faster than the edge service deployment method based on IGA. This is mainly due to the fact that the present invention introduces improvement strategies such as nonlinear convergence factor, horizontal and vertical cross and elite reverse learning, which effectively enhance the algorithm's exploration ability in the solution space, thereby achieving faster convergence speed.
[0160] Comparison of cost change simulation results of service deployment using the present invention and deep reinforcement learning (DRL) method. Figure 4 Comparison of the simulation results of the benefits of service deployment using the present invention and the DRL method. Figure 5 shown.
[0161] from Figure 4 The simulation results show that as the maximum capacity of the UAV increases, the service deployment cost of both methods also increases. This is mainly because the increase in the maximum capacity of the UAV supports more service deployments, which leads to an increase in the cost of service deployment. However, the present invention is less affected by the increase in the maximum capacity of the UAV. This is because the present invention takes the service deployment cost into account when constructing the fitness function, resulting in a lower service deployment cost than the DRL method. When the maximum capacity of the UAV is 4GB, the present invention reduces the service deployment cost by approximately 18.3% compared to the DRL method.
[0162] from Figure 5It can be seen from the simulation results that as the maximum capacity of the UAV increases, the service deployment benefits of the two methods show an increasing trend, and the service deployment benefit of the present invention is higher. When the maximum capacity of the UAV is 4GB, the service deployment benefit of the present invention is improved by about 27.1% compared with the DRL method.
[0163] In summary, the present invention can effectively improve the algorithm convergence speed and optimization ability, avoid falling into local optimality, increase service deployment benefits and reduce costs.
[0164] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.
Claims
1. A method for deploying edge services in a drone network based on an improved whale optimization algorithm, characterized in that: The method comprises the following steps: S1: Deploy drones in a designated area and establish a temporary network to initialize candidate service deployment solutions; S2: Establish mathematical models for the benefits and costs of service deployment, and define a fitness function based on the benefits and costs of service deployment. The fitness function is defined as the difference between the service deployment cost and the service deployment benefit. The service deployment cost is composed of the storage, computing power, and energy consumption occupied by the deployed service. The service deployment benefit is composed of the user computing tasks actually processed by the service and the resource utilization of the service, and is defined as a logarithmic function. S3: The improved whale optimization algorithm that introduces nonlinear convergence factors, horizontal and vertical crossover and elite reverse learning strategies is used to iteratively update the candidate solutions for service deployment. The horizontal and vertical crossover is divided into horizontal crossover and vertical crossover. The horizontal crossover generates child solutions by crossover operation in the same dimension, and the vertical crossover generates child solutions by crossover operation in different dimensions. The elite reverse learning strategy is to use the current optimal solution H leader , the maximum value of candidate solutions H max and the minimum value H min Construct an elite reverse solution, which is defined as H′=H max +H min -H leader ; S4: After each iteration, the fitness function value is calculated. If a better solution is found, the global optimal solution is updated until the convergence condition is met or the maximum number of iterations is reached. The algorithm terminates and outputs the global optimal service deployment solution. The step S2 is specifically as follows: S2-1: Establish mathematical models for service deployment benefits and costs: The service deployment cost is composed of three parts: storage, computing power, and energy consumption generated by the use of drone resources, which are defined as: ① Storage resource usage cost C of drone n service deployment n : in, is the storage capacity occupied by service j, the binary function λ j,n Indicates whether drone n has deployed service j, when λ j,n =1 means that drone n deploys service j, when λ j,n =0, indicating that drone n has not deployed service j; ② UAV n service deployment computing resource occupation cost F n : in, The computing resources occupied by service j; ③ UAV service deployment energy consumption cost E n : E n =∑ j∈J′ P j,n ·c j,n ·l j,n (5) Among them, γ j,n The response time of service j∈J′ deployed on drone n to process user tasks; P j,n The computing power required for drone n to provide computing support for service j; therefore, the service deployment cost in the network is expressed as: Among them, C max is the total storage capacity of the UAV, F max is the total computing power resource of the UAV, E max is the total energy capacity of the drone battery; the service deployment benefit Ben in the network is expressed as: Among them, α j is the resource utilization of service j, ranging from 0 to 1, α j The larger the value, the higher the resource utilization of the service; Calculate the number of user tasks actually processed by service j on drone n; log(·) represents the logarithmic function; S2-2: Define the fitness function based on service deployment benefits and costs: In the iterative process of improving the whale optimization algorithm, the algorithm fitness function F′(H g ) is defined as: F′(H g )=k·Cost-(1-k)·Ben (8) Among them, k is the performance gain coefficient, and its value range is between 0 and 1. The larger k is, the more attention is paid to the service deployment cost.
2. The method for deploying edge services in a drone network based on an improved whale optimization algorithm according to claim 1, wherein: The step S1 is specifically as follows: S1-1: Deploy drones in a designated area and establish a temporary network: N drones are deployed in a designated area and form a temporary network with U users on the ground. The drone set and user set are represented as N′={1,...,n,...,N} and U ′ ={1,...,u,...,U}; where the drone is equipped with an edge server to provide computing services to users; let J ′ ={1,2,...,j,...,J} represents the set of services. Due to the limited storage capacity of the edge server carried by the drone, each drone can only deploy a part of the services; S1-2: Initialize service deployment candidate solutions: In the initial stage of the network, the service deployment scheme is randomly initialized, and the candidate solutions for drone service deployment are defined as: H=[H 1 ,...,H g ,...,H G ] (1) Where G is the number of candidate solutions in the search space, and each candidate solution is represented as follows: Among them, the binary function Indicates whether drone n needs to deploy service j in the g-th candidate solution. When , it means that drone n does not need to deploy service j. When it means that drone n needs to deploy service j; define is the storage capacity occupied by service j, and the candidate solution must satisfy That is, the service deployed on drone n cannot exceed the maximum capacity Z of a single drone n n .
3. The method for deploying edge services in a drone network based on an improved whale optimization algorithm according to claim 1 or 2, wherein: The step S3 is specifically as follows: S3-1: Define the convergence factor δ′ as a nonlinear update: Among them, t′ is the number of iterations, Max _ iter is the maximum number of iterations, δ′ max is the maximum value of the convergence factor, δ′ min is the minimum value of the convergence factor, and π is the ratio of circumference to circumference; S3-2: Use the improved whale optimization algorithm to iteratively update the candidate solutions for service deployment: Define random parameters A′=2δ′·r′1-δ′, C′=2r′2, where r′1 and r′2 are random numbers generated in the interval [0,1] at each iteration; for each candidate solution H g , generate a random number p∈[0,1] and perform the following update: ① If p<0.5 and |A′|<1, update the encirclement method to: H g (t′+1)=H leader (t′)-A′·|C′·H leader (t′)-H g (t′)| (10) Among them, H g (t′+1) represents the candidate solution at the t′+1th iteration, H leader (t′) represents the optimal solution at the t′th iteration; H g (t′) represents the candidate solution at the t′th iteration; ② If p≥0.5 and |A′|<1, update the bubble network attack method to: H g (t′+1)=|H leader (t′)-H g (t′)|·e b·u′ ·cos(2π·u′)+H g (t′) (11) Where b is the spiral coefficient constant, u′ is a random number generated in the interval [-1,1], and e is the base of the natural logarithm function; ③If |A′|≥1, update the random search method to: H g (t′+1)=H rand (t′)-A′·|C′·H rand (t′)-H g (t′)| (12) Among them, H rand (t′) is a random individual in the population at the t′th iteration; S3-3: Add horizontal and vertical cross-strategy: If the crossover probability p c >Random(0,1), then execute the following strategy: ① Horizontal crossover: Randomly select two candidate solutions H u′ 、H v′ , perform crossover operations in the same dimension to generate sub-solutions; ② Vertical crossover: the same candidate solution H u′ In different dimensions and Inter-cross generation of sub-solutions; S3-4: Join the elite reverse learning strategy: Using the current optimal solution H leader Construct the elite reverse solution H′: H′=H max +H min -H leader (13) Among them, H max and H min are the maximum and minimum values of the candidate solutions in the current solution space, respectively.
4. The method for deploying edge services in a drone network based on an improved whale optimization algorithm according to claim 3, wherein: The step S4 is specifically as follows: S4-1: Repeat step S3 until the convergence condition is met or the maximum number of iterations is reached: After each round of iteration, the fitness function value of the updated candidate solution is calculated; if a better solution appears in the current iteration, the global optimal solution H is updated. leader Repeat step S3 until the maximum number of iterations is reached or the convergence threshold ε′ is met, that is, one of the conditions of formula (14) is met: Among them, condition 2 means that the change in the fitness function value of the algorithm in consecutive t'' rounds of iteration is less than the convergence threshold ε', indicating that the optimal solution has been basically stable and the iteration is stopped early; S4-2: The algorithm terminates and outputs the global optimal service deployment solution: After the algorithm stops iterating, it outputs the global optimal service deployment solution H leader ; and the corresponding service deployment benefits Ben and costs Cost; S4-3: Dynamic adjustment of service deployment plan and resource recovery and release: Every time T, periodically monitor the changes in the drone service deployment revenue Ben and use the historical revenue Ben prev With current earnings Ben current Compare, if: Where, ∈ is a very small positive number to prevent the denominator from being zero. When formula (15) is greater than the service revenue change threshold θ Ben When , re-execute steps S2-S4 to dynamically adjust and optimize the existing service deployment plan; the service revenue change threshold θ Ben The value range is in the interval [0.1, 0.3]. The monitoring period T is set to be inversely proportional to the fluctuation intensity of service revenue, and is defined as: Among them, T max is the maximum monitoring period allowed, and η is the adjustment coefficient, which is used to control the sensitivity of revenue fluctuations to the monitoring period. The greater the fluctuation of service revenue, the shorter the monitoring period T, so as to quickly adapt to the dynamic changes of user needs in the network. Finally, the optimized service deployment plan is compared with the current plan. If service j on drone n is in the new plan, j,n If the value changes from 1 to 0, the service no longer needs to be deployed, and the storage and computing resources occupied by the service are immediately released. If the service changes from an undeployed state to a deployed state, the storage and computing resources of the drone are allocated accordingly to meet the new demand.
Citation Information
Patent Citations
Service deployment method and system in edge environment based on improved genetic algorithm
CN118101500A
A Service Deployment Method and System in Edge Environment Based on Improved Genetic Algorithm
CN118101500B
Self-adaptive multi-service-flow distributed service deployment method and system for low-orbit satellites
CN118487642A
Internet of vehicles mobile edge computing service deployment method based on deep reinforcement learning
CN118555578A
Deployment method of mobile edge computing services in Internet of Vehicles based on deep reinforcement learning
CN118555578B