A method and device for allocating unmanned aerial vehicle tasks based on ant colony algorithm

By applying ant colony algorithm and clustering algorithm in drone task allocation, the problem of low computing efficiency in multi-drone task allocation is solved, and faster and more efficient task allocation decisions are achieved.

CN119273103BActive Publication Date: 2025-03-21BEIJING INST OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411794579.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-21
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

The multi-drone mission allocation problem is due to the complexity of constraints and the high demand for multi-objective optimization, resulting in exponential growth of solution space and low computing efficiency.

Method used

The drone task allocation method based on ant colony algorithm is adopted to classify task points through clustering algorithms, and the improved ant colony algorithm is used to determine the path order between task points to generate drone task trajectories.

Benefits of technology

The solution rate and allocation capability of multi-UAV task allocation problems have been improved, the consumption of computing resources has been reduced, and the quality of decisions has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273103B_ABST
    Figure CN119273103B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for allocating unmanned aerial vehicle tasks based on an ant colony algorithm, which relates to the field of unmanned aerial vehicle technology. The method includes determining task information of multiple task points to be executed in a target area; classifying multiple task points by a clustering algorithm, and treating multiple task points in each category as a set of unmanned aerial vehicle tasks; for each set of unmanned aerial vehicle tasks, based on an improved ant colony algorithm, determining the path sequence between multiple task points in the set of unmanned aerial vehicle tasks to generate a corresponding unmanned aerial vehicle task trajectory; based on each unmanned aerial vehicle task trajectory, controlling the corresponding unmanned aerial vehicle to fly according to the unmanned aerial vehicle task trajectory to deliver corresponding resources to each task point in the unmanned aerial vehicle task trajectory. Through the task layering strategy and the improved ant colony optimization algorithm, the solution rate and decision quality in the process of multi-unmanned aerial vehicle multi-task allocation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of drone technology, and more specifically, to a method and device for allocating drone tasks based on an ant colony algorithm. Background Art

[0002] With the continuous expansion of drone mission areas, drone swarm collaboration technology has become a current research focus.

[0003] The core goal of multi-UAV task allocation is to reasonably allocate tasks to each UAV under the premise of considering multiple constraints such as UAV performance and external environment, so as to ensure the efficiency and feasibility of task execution. At present, there are two main methods for UAV task allocation: centralized control and distributed control. However, due to the complexity of the constraints of the multi-UAV task allocation problem and the high demand for multi-objective optimization, the solution space grows exponentially and the algorithm has high computational efficiency requirements. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method and device for UAV task allocation based on ant colony algorithm, so as to improve the solution rate and allocation capability of multi-UAV task allocation problem.

[0005] In a first aspect, the present invention provides a method for allocating unmanned aerial vehicle (UAV) tasks based on an ant colony algorithm, the method comprising: determining task information of multiple task points to be executed in a target area, each task information comprising location coordinates corresponding to the task point and resource requirements; classifying the multiple task points through a clustering algorithm, and treating the multiple task points in each category as a UAV task set; for each UAV task set, based on an improved ant colony algorithm, determining the path sequence between the multiple task points in the UAV task set to generate a corresponding UAV task trajectory; based on each UAV task trajectory, controlling the corresponding UAV to fly according to the UAV task trajectory to deliver corresponding resources to each task point in the UAV task trajectory.

[0006] In an optional embodiment, multiple task points are classified by a clustering algorithm, and the steps of treating multiple task points in each category as a UAV task set specifically include: determining the number of clusters based on the total resource demand of all task points and the total load of all UAVs; randomly determining the cluster centers of the number of clusters; for each task point, assigning the task point to a corresponding cluster center to obtain multiple task points corresponding to each cluster center; for each cluster center, determining whether to update the position coordinates of the cluster center based on the match between the position coordinates of the multiple task points corresponding to the cluster center and the position coordinates of the cluster center; if updating is required, updating the position coordinates of the cluster center, and returning to execute the step of assigning the task point to a corresponding cluster center; if updating is not required, outputting the multiple task points corresponding to each cluster center as the corresponding UAV task set.

[0007] In an optional implementation, for each task point, the step of assigning the task point to a corresponding cluster center to obtain a plurality of task points corresponding to each cluster center specifically includes:

[0008] All task points are sorted in descending order according to the amount of required resources; for each sorted task point, the task point is assigned to a corresponding cluster center in the following ways: the distance value between the task point and each cluster center is calculated to determine the target cluster center; whether the target cluster center reaches the preset load capacity is determined; if so, the target cluster center is replaced based on the distance value, and the step of determining whether the target cluster center reaches the preset load capacity is returned to execute; if not, the task point is assigned to the target cluster center, and the current load capacity of the target cluster center is updated.

[0009] In an optional implementation, whether to update the position coordinates of the cluster center is determined in the following manner: based on the position coordinates of multiple task points currently corresponding to the cluster center, the centroid coordinates of the task points of this category are calculated; the centroid coordinates are compared to see if they are consistent with the current position coordinates of the cluster center; if they are consistent, the position coordinates of the cluster center do not need to be updated; if they are inconsistent, the position coordinates of the cluster center are updated to the centroid coordinates of the task points of this category.

[0010] In an optional embodiment, for each drone task set, the path order between multiple task points in the drone task set is determined by iteratively executing the following steps: for each ant in a specified number of ants, the storage point is used as the starting task point, and based on the distance value between adjacent task points, the transition probability value of the ant moving between adjacent task points is calculated to obtain the movement trajectory of the ant; based on the total path length corresponding to the movement trajectories of all ants, a target movement trajectory is determined; the total path length of the target movement trajectory is optimized to determine an optimized movement trajectory, and the optimized movement trajectory is used to indicate the path order of the drones in the drone task set from the starting task point through multiple task points and finally returning.

[0011] In an optional embodiment, the optimized moving trajectory is determined in the following manner: for multiple task points in the target moving trajectory, two task point data pairs are randomly determined, wherein each task point data pair includes two adjacent task points; one of the task points in the two task point data pairs is swapped to generate a swapped moving trajectory; it is determined whether the total path length of the swapped moving trajectory is less than the target moving trajectory; if so, the swapped moving trajectory is determined to be the optimized moving trajectory.

[0012] In a second aspect, the present invention provides a drone task allocation device based on an ant colony algorithm, the device comprising:

[0013] A receiving module is used to determine the task information of multiple task points to be executed in the target area, each task information includes the location coordinates corresponding to the task point and the resource demand;

[0014] A hierarchical module is used to classify multiple mission points through a clustering algorithm and treat multiple mission points in each category as a UAV mission set;

[0015] An allocation module is used to determine the path sequence between multiple task points in each UAV task set based on an improved ant colony algorithm to generate a corresponding UAV task trajectory;

[0016] The control module is used to control the corresponding drone to fly according to each drone mission trajectory based on the drone mission trajectory, so as to deliver corresponding resources to each mission point in the drone mission trajectory.

[0017] In an optional embodiment, the hierarchical module is specifically used to determine the number of clusters based on the total resource requirements of all task points and the total payload of all drones; randomly determine the cluster centers of the number of clusters; for each task point, assign the task point to a corresponding cluster center to obtain multiple task points corresponding to each cluster center; for each cluster center, based on the position coordinates of multiple task points currently corresponding to the cluster center, calculate the center of gravity coordinates of the task point of this category; compare the center of gravity coordinates with the current position coordinates of the cluster center for consistency; if consistent, the position coordinates of the cluster center do not need to be updated; if inconsistent, update the cluster center position coordinates, and return to execute the step of assigning the task point to a corresponding cluster center; if no update is required, output the multiple task points corresponding to each cluster center as the corresponding drone task set.

[0018] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the drone task allocation method based on the ant colony algorithm as described in any of the aforementioned implementations.

[0019] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for allocating unmanned aerial vehicle tasks based on an ant colony algorithm as described in any of the aforementioned embodiments are executed.

[0020] The present application provides a method and device for allocating unmanned aerial vehicle tasks based on an ant colony algorithm, wherein the method includes determining task information of multiple task points to be executed in a target area, each task information including the location coordinates and resource requirements corresponding to the task point; classifying multiple task points by a clustering algorithm, and treating multiple task points in each category as a set of unmanned aerial vehicle tasks; for each set of unmanned aerial vehicle tasks, based on an improved ant colony algorithm, determining the path sequence between multiple task points in the set of unmanned aerial vehicle tasks to generate a corresponding unmanned aerial vehicle task trajectory; based on each unmanned aerial vehicle task trajectory, controlling the corresponding unmanned aerial vehicle to fly according to the unmanned aerial vehicle task trajectory to deliver corresponding resources to each task point in the unmanned aerial vehicle task trajectory. Through the task layering strategy and the improved ant colony optimization algorithm, the solution rate and decision quality in the process of multi-unmanned aerial vehicle multi-task allocation are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A flowchart of a method for allocating unmanned aerial vehicle tasks based on an ant colony algorithm provided in an embodiment of the present application;

[0023] Figure 2 A task point distribution diagram provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of a step flow of stratifying tasks using an improved K-Means algorithm provided in an embodiment of the present application;

[0025] Figure 4 A schematic flow chart of the steps of solving the execution order of drones in a subsystem using an improved ant colony algorithm provided in an embodiment of the present application;

[0026] Figure 5 A schematic diagram of a 2-opt algorithm for performing a node pair exchange operation provided in an embodiment of the present application;

[0027] Figure 6 A schematic diagram of a drone mission trajectory provided in an embodiment of the present application;

[0028] Figure 7 A schematic diagram of the structure of a drone task allocation device based on an ant colony algorithm provided in an embodiment of the present application;

[0029] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] First, the application scenario of the present application is described. The technical solution of the present application is applicable to the allocation of multiple tasks of multiple drones.

[0031] Compared with a single drone, a multi-drone collaborative system has the characteristics of distributed functions, easy expansion, and strong fault tolerance, which has great advantages in handling complex and tedious transportation tasks. Drone task allocation and decision-making are important problems in the field of multi-drone collaboration, and are crucial to achieving efficient collaboration between drones.

[0032] Therefore, the present application provides a method and device for UAV task allocation based on ant colony algorithm, so as to improve the solution rate and allocation capability of multi-UAV task allocation problem.

[0033] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0034] Embodiment 1

[0035] Figure 1 The following is a flow chart of a method for allocating drone tasks based on an ant colony algorithm provided in an embodiment of the present application. Figure 1 As shown, the allocation method provided in the embodiment of the present application includes:

[0036] S1. Determine the task information of multiple task points to be executed in the target area, each task information includes the location coordinates and resource requirements corresponding to the task point.

[0037] Here, we need to collect the original information of the set U of M drones and the set T of N transport task points to provide basic data support for subsequent task allocation. For example, the total number of drones is , through the collection Indicates that the total number of tasks is , through the collection express.

[0038] In a specific embodiment of the present application, the target area can be There are 40 mission points in this area. Multiple drones need to start from storage points (bases or resource warehouses) to carry out transportation tasks to transport resources to each mission point. The distribution of mission points can be as follows: Figure 2 shown.

[0039] Based on the collected drone and mission information, a corresponding drone task allocation model can be constructed.

[0040] In one embodiment of the present application, the main idea is to decompose the entire multi-drone multi-objective transportation problem into multiple transportation problem subsystems corresponding to the number of drones. In each subsystem, the transportation task points are further sorted, and the sorted multiple subtasks are assigned to the corresponding drone individuals.

[0041] The goal of mission stratification is to ensure that each drone Corresponding to a subsystem , expressed as:

[0042]

[0043] In the formula, Indicates The first drone subtasks.

[0044] If a subsystem Existence subtasks, then the subsystem The set of subtasks to be assigned in is expressed as:

[0045]

[0046] In the formula, Indicates The first drone task.

[0047] Taking into account the performance indicators of the drone, the objective function of solving the execution order problem of the drone in the subsystem is composed of factors such as flight distance and power consumption cost. The physical characteristics constraints of the drone are introduced, including:

[0048] (a) Task execution frequency constraints:

[0049] In the process of multiple drones performing multiple transport tasks, the number of transport tasks is much greater than the number of drones, so it is required that each transport task can only be performed by one drone and can only be performed once. This constraint can be expressed as:

[0050]

[0051] In the formula, Indicates Whether the drone is executing 1 means execution, 0 means no execution.

[0052] (b) UAV mission payload constraints:

[0053] Since drones are small in size and have limited load capacity, the load of drones during transportation missions must not exceed their maximum cargo capacity. The upper limit of load is , then the UAV's mission load constraint in the task allocation problem can be expressed as:

[0054]

[0055] In the formula, Indicates The drone carried out The total number of UAVs required for each mission is The total number of tasks is .

[0056] (3) Maximum track distance constraint:

[0057] During the mission, in order to ensure that the drone has enough power to return to the base, it is necessary to introduce a maximum track distance constraint based on the distance between the drone and the mission point. The distance between two mission nodes of the drone can be expressed as:

[0058]

[0059] In the formula, l represents the two task nodes The distance between Indicates the current mission node position coordinates of the drone, Indicates the coordinates of the next mission node of the drone. The total distance traveled from the base to the base after completing all transport tasks It can be expressed as:

[0060]

[0061] In the formula, Indicates drone Execute from base The total flight path distance after the mission to return to the base. At the same time, assuming that the maximum range of the drone is , then the maximum range constraint that the UAV needs to meet is:

[0062]

[0063] (4) Maximum power constraint:

[0064] In order to ensure that the drone can return to the base safely after completing all tasks, power constraints need to be introduced. The present invention calculates the power consumption of the drone based on the flight distance and load with larger power constraints. Assume that the load limit of the drone is , two mission nodes of the drone The distance between , the current actual load is There is a certain relationship between the load of the human-machine and the power consumption. The power consumption generated by the load of the drone is expressed as:

[0065]

[0066] In the formula, Indicates the drone's own weight. Indicates the power consumption rate of the drone when it is idling. Indicates the power consumption rate of the drone when fully loaded.

[0067] Drones Execute from base Total power consumption after returning to base after missions It can be expressed as:

[0068]

[0069] The power constraint can be expressed as:

[0070]

[0071] In the formula, Indicates drone The power situation.

[0072] Then, the task allocation model can be constructed as:

[0073]

[0074]

[0075] In the formula, They represent the weight coefficients of the flight distance and power consumption function respectively. Indicates the flight distance of the drone. Indicates the power consumption of the drone.

[0076] S2. Classify multiple mission points through clustering algorithm, and regard multiple mission points in each category as a UAV mission set.

[0077] In step S2, the multiple task points are classified by a clustering algorithm, and the multiple task points in each category are regarded as a UAV task set, which specifically includes:

[0078] Based on the total resource requirements of all mission points and the total payload of all drones, the number of clusters is determined. The cluster centers of the number of clusters are randomly determined. For each mission point, the mission point is assigned to a corresponding cluster center to obtain multiple mission points corresponding to each cluster center. For each cluster center,

[0079] Based on the position coordinates of multiple task points currently corresponding to the cluster center, calculate the center of gravity coordinates of the task point of this category; compare the center of gravity coordinates with the current position coordinates of the cluster center to see if they are consistent; if they are consistent, the position coordinates of the cluster center do not need to be updated; if they are inconsistent, update the cluster center position coordinates and return to execute the step of assigning the task point to a corresponding cluster center. If no update is required, output the multiple task points corresponding to each cluster center as the corresponding drone task set.

[0080] The step of assigning each task point to a corresponding cluster center to obtain multiple task points corresponding to each cluster center specifically includes:

[0081] All task points are sorted in descending order according to the amount of required resources. For each task point after sorting, the task point is assigned to a corresponding cluster center in the following ways:

[0082] Calculate the distance between the task point and each cluster center to determine the target cluster center. Determine whether the target cluster center reaches the preset load capacity. If so, replace the target cluster center based on the distance value, and return to the step of determining whether the target cluster center reaches the preset load capacity. If not, assign the task point to the target cluster center and update the current load capacity of the target cluster center.

[0083] And, determine whether to update the location coordinates of the cluster center in the following way:

[0084] Based on the position coordinates of multiple task points currently corresponding to the cluster center, calculate the centroid coordinates of the task points of this category; compare whether the centroid coordinates are consistent with the current position coordinates of the cluster center; if they are consistent, the position coordinates of the cluster center do not need to be updated; if they are inconsistent, update the cluster center position coordinates to the centroid coordinates of the task points of this category.

[0085] In step S2, based on the aforementioned task allocation model, the K-Means algorithm can be used to preliminarily divide the complex task group into multiple subgroups. By stratifying the task set into different subsets, each subset corresponds to multiple task points assigned to a drone, thereby reducing the complexity of the problem.

[0086] S3. For each UAV task set, based on the improved ant colony algorithm, determine the path sequence between multiple task points in the UAV task set to generate the corresponding UAV task trajectory.

[0087] In step S3, for each drone task set, the path sequence between multiple task points in the drone task set can be determined by iteratively performing the following steps:

[0088] For each ant in the specified number of ants, the storage point is used as the starting task point. Based on the distance value between adjacent task points, the transition probability value of the ant moving between adjacent task points is calculated to obtain the movement trajectory of the ant. Based on the total path length corresponding to the movement trajectory of all ants, a target movement trajectory is determined. The total path length of the target movement trajectory is optimized to determine the optimized movement trajectory. The optimized movement trajectory is used to indicate the path sequence of the drone in the drone task set from the starting task point through multiple task points and finally returning.

[0089] Specifically, the optimized moving trajectory can be determined by the following methods:

[0090] For multiple task points in the target moving trajectory, two task point data pairs are randomly determined, wherein each task point data pair includes two adjacent task points. One of the task points in the two task point data pairs is swapped to generate a swap moving trajectory. It is determined whether the total path length of the swap moving trajectory is less than the target moving trajectory. If so, the swap moving trajectory is determined to be an optimized moving trajectory.

[0091] By improving the ant colony algorithm, the optimization can be achieved in a shorter time, which accelerates the convergence speed of the entire solution process and reduces the number of unnecessary iterations.

[0092] like Figure 6 The figure shows the drone mission trajectory determined in a specific embodiment of the present application. The number of mission points here is 40. Through the task allocation method provided by the present application, 5 drone mission trajectories are finally planned, that is, 5 drones are needed to complete the corresponding transportation tasks.

[0093] S4. Based on each UAV mission trajectory, control the corresponding UAV to fly according to the UAV mission trajectory to deliver corresponding resources to each mission point in the UAV mission trajectory.

[0094] The embodiment of the present application provides a method for allocating drone tasks based on an ant colony algorithm, which takes into account the relationship between drone power consumption and real-time load, and the impact of flight distance on task results, and establishes an objective function for solving the drone execution order problem composed of factors such as flight distance and power consumption cost in the drone task subsystem. Compared with the objective function of a single factor, it is more beneficial to optimize resource allocation and improve decision-making quality. At the same time, through the task layering strategy and the improved ant colony optimization algorithm, the solution rate and decision-making quality in the multi-drone multi-task allocation process are improved.

[0095] Embodiment 2

[0096] like Figure 3 As shown, the present invention optimizes the clustering quantity determination method of the K-Means algorithm according to the maximum task load constraint in the task allocation model, and updates the specific allocation process of the task points on this basis, which can be specifically implemented by the following steps:

[0097] Step 21: According to the maximum mission load constraint of the UAV, this step optimizes the K-Means algorithm to determine the number of clusters, and determines the number of clusters based on the ratio of the total demand to the load of a single UAV. :

[0098]

[0099] In the formula, drone The upper limit of load is , No. The demand for a task point is .

[0100] Step 22: Randomly select the coordinates of the demand point as the initial cluster center . And calculate the distance from the cluster center to each task point , It is expressed by the Euclidean distance from the cluster center to each task point:

[0101]

[0102] Step 23. Similarly, in order to meet the UAV mission load constraints, improve the K-Means clustering algorithm process. Sort the task points from large to small according to the resource requirements of each task point, and assign them to the nearest cluster center according to the distance. If the capacity of the cluster center is sufficient and does not reach the preset load capacity, then assign it. Otherwise, try to assign it to the suboptimal cluster center and check the capacity. Repeat the above steps until all constraints are met.

[0103] Here, it is determined whether the target cluster center reaches the preset load capacity, that is, the sum of the total required resource amounts corresponding to the task points assigned to the target cluster center is calculated to be less than the preset load capacity. The preset load capacity here can be determined according to the unmanned load capacity.

[0104] Step 24. After the allocation is completed, the centroid of each cluster is recalculated. The centroid coordinates of the recalculated cluster center can be calculated according to the following formula:

[0105]

[0106] in, The cluster center The location coordinate information of all assigned task points.

[0107] Step 25. Check whether the new cluster center has changed. If it has changed, update the centroid coordinates of the cluster center to , and return to Step 23 for iteration. Otherwise, save the result and end the algorithm.

[0108] In one embodiment provided by the present application, the method for determining the number of clusters of the K-Means algorithm is optimized according to the maximum task load constraint in the task allocation model, and the number of clusters is determined according to the ratio of the total resource demand of the task point to the load of a single drone, and the number of clusters is the number of drones and subsystems. On this basis, the specific allocation process of the task point is updated, which effectively improves the rationality and accuracy of the task stratification strategy.

[0109] Embodiment 3

[0110] like Figure 4 As shown, in order to simplify the solution process of drone allocation tasks and reduce the consumption of computing resources, in one embodiment of the present application, it is considered to introduce a 2-opt algorithm to perform local search on the initial solution node based on the initial optimal path obtained by the ant colony algorithm.

[0111] Specifically, the improved ant colony optimization algorithm can be implemented by the following steps:

[0112] Step 41. Ant colony algorithm parameter initialization: set the number of ants , pheromone evaporation rate , pheromone increases intensity coefficient , Iterations , the importance of pheromones , heuristic information importance ,Will The first ant is placed at the starting point and the iteration begins.

[0113] Exemplarily, the number of ants may be 25, the pheromone increase intensity coefficient may be 10, the number of iterations may be 100, the pheromone importance may be 3, the heuristic information importance may be 1, and the pheromone evaporation rate may be 0.2.

[0114] Step 42. Set the heuristic function .

[0115] When an ant moves from the current node to the next node, it will calculate the selection probability of each point in the visible area according to the heuristic function, and use the distance between the two nodes as the independent variable of the heuristic function. The heuristic function can be expressed as:

[0116]

[0117] In the formula, Indicates the task point With mission points The distance between is the current iteration number.

[0118] Step 43: Build the path, calculate the transfer probability, and select the next target for the ant to move to.

[0119] Ant The current mission point is , then the next step is to execute the task The probability of satisfying the following formula:

[0120]

[0121]

[0122] In the formula, Indicates the serial number of the ant, , represents the path memory vector, that is, the set of task points that the ant passes through, Indicates the task point With mission points The pheromone concentration between Represents heuristic information, used to instruct ants to move from task point to task point. Transfer to the mission point The expected value of Indicates the task point With mission points The smaller the distance and the greater the pheromone concentration, the higher the probability of the path being selected. and are pre-set parameters, representing the importance of pheromone concentration and heuristic information respectively.

[0123] Step 44: Update the path information and repeat Step 43 until all ants have gone through a cycle.

[0124] Step 45: Optimize the initial solution generated by the ant colony algorithm. Based on the existing initial path T, traverse all node pairs in the path to find two sets and , , , , , and use replace , which makes the cost of the new set, that is, the total length of the path, smaller. The specific path is Among them, b and f are two different coordinates randomly selected, c and e are the adjacent coordinates, and the corresponding edge set is , by finding better coordinate points, a new edge set is formed . When the following conditions are met:

[0125] ;

[0126] like Figure 5 As shown, the new coordinate sequence If the path is shorter, the nodes can be exchanged until the optimal path is obtained.

[0127] Step 46, determine whether the current optimal path meets the constraints. If the planned path length meets the maximum path distance constraint of the drone, execute step 47; if it does not meet the constraint, search the path again.

[0128] Step 47. Update pheromones.

[0129] The release of pheromones by ants and the evaporation of pheromones between task points are carried out simultaneously. After each path search, the pheromone concentration on the path is updated. The update of pheromones during the iteration process satisfies the following formula:

[0130]

[0131] in,

[0132]

[0133] In the formula, represents the number of ants, represents the evaporation rate of pheromone, , It is Ants from the task point To the mission point The amount of pheromone released on the path between Indicates the total length of the path.

[0134] Step 48, determine whether the maximum number of iterations has been reached. If the maximum number of iterations has been reached, proceed to Step 49, if not, return to execute Step 43.

[0135] Step 49, output the results.

[0136] In this embodiment, based on the initial optimal path obtained by the ant colony algorithm, the 2-opt algorithm is introduced to perform local search on the initial solution node. The 2-opt algorithm can optimize the path in a local range by removing and reconnecting the two edges in the path. At the same time, the 2-opt algorithm can significantly improve the initial solution in a shorter time. Compared with the traditional ant colony algorithm, the ant colony algorithm improved by the 2-opt algorithm can improve the accuracy of the solution, accelerate the convergence speed of the entire solution process, and reduce the number of unnecessary iterations.

[0137] Figure 7 The following is a schematic diagram of a UAV task allocation device based on an ant colony algorithm provided in an embodiment of the present application. Figure 7 As shown, based on the same inventive concept, an embodiment of the present application further provides a drone task allocation device based on an ant colony algorithm, and the device 70 includes:

[0138] The receiving module 710 is used to determine the task information of multiple task points to be executed in the target area, each task information includes the location coordinates and resource requirements corresponding to the task point;

[0139] A stratification module 720 is used to classify the multiple task points by using a clustering algorithm, and to classify the multiple task points in each category as a UAV task set;

[0140] The allocation module 730 is used to determine the path sequence between multiple task points in each drone task set based on the improved ant colony algorithm to generate a corresponding drone task trajectory;

[0141] The control module 740 is used to control the corresponding drone to fly according to each drone mission trajectory based on the drone mission trajectory, so as to deliver corresponding resources to each mission point in the drone mission trajectory.

[0142] In an optional embodiment, the hierarchical module 720 is specifically used to determine the number of clusters based on the total resource requirements of all task points and the total payload of all drones; randomly determine the cluster centers of the number of clusters; for each task point, assign the task point to a corresponding cluster center to obtain multiple task points corresponding to each cluster center; for each cluster center, determine whether to update the position coordinates of the cluster center based on the degree of match between the position coordinates of the multiple task points corresponding to the cluster center and the position coordinates of the cluster center; if updating is required, then update the position coordinates of the cluster center, and return to execute the step of assigning the task point to a corresponding cluster center; if updating is not required, then output the multiple task points corresponding to each cluster center as the corresponding drone task set.

[0143] In an optional embodiment, the hierarchical module 720 assigns each task point to a corresponding cluster center to obtain a plurality of task points corresponding to each cluster center, specifically including: sorting all task points in order of required resource quantity from large to small; for each sorted task point, assigning the task point to a corresponding cluster center in the following manner: calculating the distance value between the task point and each cluster center to determine the target cluster center; determining whether the target cluster center reaches the preset load capacity; if so, replacing the target cluster center based on the distance value, and returning to execute the step of determining whether the target cluster center reaches the preset load capacity; if not, assigning the task point to the target cluster center, and updating the current load capacity of the target cluster center.

[0144] In an optional embodiment, the hierarchical module 720 determines whether to update the position coordinates of the cluster center by: calculating the centroid coordinates of the task point of the category based on the position coordinates of multiple task points currently corresponding to the cluster center. Compare whether the centroid coordinates are consistent with the current position coordinates of the cluster center. If they are consistent, the position coordinates of the cluster center do not need to be updated. If they are inconsistent, the position coordinates of the cluster center are updated to the centroid coordinates of the cluster center.

[0145] In an optional embodiment, the allocation module 730 determines, for each drone task set, a path order between multiple task points in the drone task set by iteratively executing the following steps: for each ant among a specified number of ants, taking the storage point as the starting task point, based on the distance value between adjacent task points, calculating the transition probability value of the ant moving between adjacent task points to obtain the moving trajectory of the ant; determining a target moving trajectory based on the total path length corresponding to the moving trajectories of all ants; optimizing the total path length of the target moving trajectory to determine an optimized moving trajectory, which is used to indicate the path order of the drones in the drone task set from the starting task point through multiple task points and finally returning.

[0146] In an optional embodiment, the allocation module 730 determines the optimized moving trajectory in the following manner: for multiple task points in the target moving trajectory, randomly determine two task point data pairs, wherein each task point data pair includes two adjacent task points; swap one of the task points in the two task point data pairs to generate a swapped moving trajectory; determine whether the total path length of the swapped moving trajectory is less than the target moving trajectory; if so, determine that the swapped moving trajectory is the optimized moving trajectory.

[0147] See also Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown in , the electronic device 800 includes a processor 810 , a memory 820 and a bus 830 .

[0148] The memory 820 stores machine-readable instructions executable by the processor 810. When the electronic device 800 is running, the processor 810 communicates with the memory 820 through the bus 830. When the machine-readable instructions are executed by the processor 810, the steps of a drone task allocation method based on an ant colony algorithm in the above method embodiment can be executed. The specific implementation method can be found in the method embodiment, which will not be repeated here.

[0149] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for allocating unmanned aerial vehicle tasks based on an ant colony algorithm in the above-mentioned method embodiment can be executed. The specific implementation method can be found in the method embodiment, which will not be repeated here.

[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0151] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0152] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0154] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0155] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0156] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for allocating unmanned aerial vehicle tasks based on ant colony algorithm, characterized in that: The method comprises: Determine the task information of multiple task points to be executed in the target area, each task information includes the location coordinates corresponding to the task point and the resource requirement; Multiple mission points are classified by clustering algorithm, and multiple mission points in each category are regarded as a UAV mission set; For each UAV task set, based on the improved ant colony algorithm, the path sequence between multiple task points in the UAV task set is determined to generate the corresponding UAV task trajectory; Based on each drone mission trajectory, control the corresponding drone to fly according to the drone mission trajectory to deliver corresponding resources to each mission point in the drone mission trajectory; The step of classifying the multiple task points by using a clustering algorithm and treating the multiple task points in each category as a UAV task set specifically includes: Determine the number of clusters based on the total resource requirements of all mission points and the total payload of all drones : Among them, drones The upper limit of load is , No. The demand for a task point is ; Randomly determine the cluster centers of the number of clusters; For each task point, the task point is assigned to a corresponding cluster center to obtain multiple task points corresponding to each cluster center; For each cluster center, based on the matching degree between the position coordinates of multiple task points corresponding to the cluster center and the position coordinates of the cluster center, determine whether to update the position coordinates of the cluster center; If updating is required, the position coordinates of the cluster center are updated, and the process returns to execute the step of assigning the task point to a corresponding cluster center; If no update is required, multiple task points corresponding to each cluster center are output as the corresponding drone task set; Whether to update the location coordinates of the cluster center is determined in the following way: Based on the position coordinates of multiple task points currently corresponding to the cluster center, the centroid coordinates of the task points of this category are calculated; Compare the center of gravity coordinates with the current position coordinates of the cluster center to see if they are consistent; If they are consistent, the location coordinates of the cluster center do not need to be updated; If they are inconsistent, the cluster center position coordinates are updated to the centroid coordinates of the task points of this category.

2. The method according to claim 1, characterized in that The step of assigning each task point to a corresponding cluster center to obtain a plurality of task points corresponding to each cluster center specifically includes: Sort all task points in descending order of required resource amounts; For each sorted task point, assign the task point to a corresponding cluster center in the following ways: Calculate the distance between the task point and each cluster center to determine the target cluster center; Determine whether the target cluster center reaches the preset load capacity; If yes, then the target cluster center is replaced based on the distance value, and the step of determining whether the target cluster center reaches the preset load capacity is returned to be executed; If not, the task point is assigned to the target cluster center and the current load capacity of the target cluster center is updated.

3. The method according to claim 1, characterized in that For each drone mission set, the path order between multiple mission points in the drone mission set is determined by iteratively executing the following steps: For each ant among the specified number of ants, the storage point is used as the starting task point, and based on the distance values ​​between adjacent task points, the transition probability value of the ant moving between adjacent task points is calculated to obtain the movement trajectory of the ant; Determine a target moving trajectory based on the total path length corresponding to the moving trajectories of all ants; The total path length of the target moving trajectory is optimized to determine an optimized moving trajectory, where the optimized moving trajectory is used to indicate the path sequence of the drone in the drone mission set from the starting mission point through multiple mission points and finally returning.

4. The method according to claim 3, characterized in that: The optimal movement trajectory is determined by: For multiple task points in the target moving trajectory, two task point data pairs are randomly determined, wherein each task point data pair includes two adjacent task points; Swap one of the task points in the two task point data pairs to generate a swap movement trajectory; Determining whether the total path length of the swap movement trajectory is less than the target movement trajectory; If so, the swap movement trajectory is determined to be an optimized movement trajectory.

5. A drone task allocation device based on ant colony algorithm, characterized in that: The device comprises: A receiving module is used to determine the task information of multiple task points to be executed in the target area, each task information includes the location coordinates corresponding to the task point and the resource demand; A hierarchical module is used to classify multiple mission points through a clustering algorithm and treat multiple mission points in each category as a UAV mission set; An allocation module is used to determine the path sequence between multiple task points in each UAV task set based on an improved ant colony algorithm to generate a corresponding UAV task trajectory; A control module, for controlling the corresponding drone to fly according to each drone mission trajectory based on the drone mission trajectory, so as to deliver corresponding resources to each mission point in the drone mission trajectory; The hierarchical module is specifically used to determine the number of clusters based on the total resource requirements of all mission points and the total load of all drones. : Among them, drones The upper limit of load is , No. The demand for a task point is ; Randomly determine the cluster centers of the number of clusters; For each task point, the task point is assigned to a corresponding cluster center to obtain multiple task points corresponding to each cluster center; For each cluster center, based on the matching degree between the position coordinates of multiple task points corresponding to the cluster center and the position coordinates of the cluster center, determine whether to update the position coordinates of the cluster center; If updating is required, the position coordinates of the cluster center are updated, and the process returns to execute the step of assigning the task point to a corresponding cluster center; If no update is required, multiple task points corresponding to each cluster center are output as the corresponding drone task set; The following method is used to determine whether to update the location coordinates of the cluster center: Based on the position coordinates of multiple task points currently corresponding to the cluster center, the centroid coordinates of the task points of this category are calculated; Compare the center of gravity coordinates with the current position coordinates of the cluster center to see if they are consistent; If they are consistent, the location coordinates of the cluster center do not need to be updated; If they are inconsistent, the cluster center position coordinates are updated to the centroid coordinates of the task points of this category.

6. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the drone task allocation method based on the ant colony algorithm as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for allocating unmanned aerial vehicle tasks based on an ant colony algorithm as claimed in any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Hierarchical target allocation method for multiple unmanned aerial vehicle formations

    CN103744290A

  • Staged multi-base unmanned aerial vehicle task allocation and flight path planning method

    CN113671985A

  • Unmanned aerial vehicle flight path planning method based on improved ant colony algorithm

    CN114578845A

  • Non-crowd group construction method based on capability matching clustering algorithm

    CN117407738A