A phased multi-base UAV task allocation and trajectory planning method
Through the phased multi-base drone mission allocation and track planning methods, the problem of high regional crossing and high computational complexity in multi-drone collaborative tasks is solved, and efficient task allocation and tracking under heterogeneous base configuration is realized. Planning ensures the rationality and safety of tasks.
Patent Information
- Application Number
- CN202110854920.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-28
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-07-28
AI Technical Summary
The existing UAV mission planning methods have problems such as regional crossover, high computational complexity, difficulty in dealing with heterogeneous base configuration and dynamic mission changes in multi-UAV collaborative tasks, and have failed to effectively consider the range estimates of threat areas. Influence.
Adopt phased multi-base drone task allocation and track planning methods, including regional settings, improved A* algorithm prediction range matrix, task allocation based on K-means and deep traversal, timing task allocation of travel merchant models and genetic algorithms , and the smooth track of the cubic B-spline curve ensures the track avoids threat areas and adapts to heterogeneous base configuration.
It improves the effectiveness and scalability of task allocation, reduces the computational complexity, ensures the rationality and safety of the track, and is suitable for complex application environments.
Smart Images

Figure CN113671985B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle (UAV) mission planning, and in particular to a phased multi-base UAV mission allocation and track planning method. Background Art
[0002] With the widespread use of drones in emergency rescue, mapping, monitoring and other fields, the requirements for drone operation security are becoming increasingly higher. Due to the complexity and diversity of the drone use environment, especially in application fields such as disaster rescue and war, this requirement is particularly prominent. However, due to the performance limitations of a single drone platform such as action radius, endurance, practical ceiling and mission payload, it is often difficult to meet actual application needs. Multi-drone collaborative mission planning has become a topic of widespread concern at home and abroad.
[0003] Task allocation and trajectory planning are key technical issues in multi-UAV task planning. Domestic and foreign scholars have conducted extensive research on UAV task allocation and trajectory planning, and have made great progress. In the current research on multi-UAV task planning, a global task planning method based on a multi-objective optimization function is usually used to complete the task grouping, task division, time sequence allocation and trajectory planning of multiple UAVs in the same stage. The current method has the following shortcomings: ① It does not match the command process of hierarchical command and regional coordination, and the trajectory planning is prone to regional intersection, which increases the complexity of UAV space-time collision avoidance coordination; ② It is difficult to handle complex heterogeneous situations such as base evacuation configuration, different numbers and performances of UAVs in each base, and the constructed multi-objective optimization function is too cumbersome; ③ When the task changes dynamically, there is a lot of computational redundancy in the dynamic redistribution of tasks, which is easy to cause large computational complexity, poor effectiveness and scalability; ④ In the process of task allocation research, when considering the distance cost, the straight-line Euclidean distance is usually used to approximate the range, without considering the impact of constraints such as threat areas on range estimation, which can easily lead to unreasonable task allocation.
[0004] Therefore, in response to this situation, a phased multi-base UAV task allocation and trajectory planning method was developed with heterogeneous multi-UAVs dispersedly deployed in multiple bases and collaboratively performing multi-target detection tasks to meet the needs of actual use. Summary of the invention
[0005] The invention discloses a phased multi-base UAV task allocation and track planning method to solve the problems existing in the prior art.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0007] A phased multi-base UAV task allocation and trajectory planning method comprises the following steps:
[0008] S1, area setting, first, in the geographic information system, click on the base coordinates and mission coordinates in turn to determine the mission planning area; then, in the planning area, use different geometric shapes to mark the threat area;
[0009] S2, Task Allocation,First, in the range estimation stage, improve A * Algorithm, build A between each base and each mission point * Estimate the flight matrix; secondly, in the multi-base multi-UAV task allocation stage, when the number of tasks is large and the regional distribution is concentrated, the improved K-means algorithm is used to achieve target area clustering, cluster target allocation for each position, and UAV task allocation within the position; when the number of tasks is small and the distribution is sparse, the deep traversal method is used to achieve accurate task allocation; finally, in the single UAV time-series task allocation stage, the time-series task allocation of a single UAV in each base is solved based on the traveling salesman model and genetic algorithm;
[0010] S3, trajectory planning, first, adopt the improved A * The algorithm plans and draws the track; then, the track is smoothed based on a cubic B-spline curve.
[0011] Preferably, in the step S1, when performing regional setting, the following steps are performed:
[0012] The first step is regional planning. In the geographic information system, click to select and mark the locations of multiple bases and multiple tasks, number each base and task in the order of clicks, and determine the regional scope of task planning. Suppose the maximum position Gaussian coordinate values of each base and task are X max , Y max , let the minimum position Gaussian coordinates be X min , Y min , assuming that the expansion distance value of the planning space is H, then the four vertices of the rectangular planning area can be determined to be (X min -H,Y min -H)、(X min -H,Y max +H)、(X max +H,Y max +H)、(X min -H,Y max +H); discretize the two-dimensional planning space into a grid, (X mi nH,Y min -H) is the origin, and h is the length of the grid side. Then the grid coordinates (x g ,y g ) is expressed as:
[0013] The second step is threat setting. Based on basic geographic information and regional situation information, terrain, radar detection, air defense firepower, no-fly zones and other flight threat areas are mapped in GIS. According to the characteristics of different threat models, the threat areas are marked with different shapes such as circles, rectangles, polygons, etc. by hand-drawing or annotation in the GIS system. The grid coordinates (x gt ,y gt ), construct the threat area matrix G[x][y], let G[x gt ][y gt ]=1 means that the grid is a threat grid, G[x gt ][y gt ]=0 means that the grid is not a threat grid;
[0014] Preferably, in step S2, when performing task allocation, the following steps are performed:
[0015] The first step is to improve the design of the A* algorithm. On the basis of setting the planning area and threat space, each base and mission point is used as the starting and ending points, and the A* algorithm is used to heuristically search for the optimal path, and the flight distance between each base and each mission point and between each mission point is estimated. Combined with the specific application background, the traditional A* algorithm is optimized mainly in terms of constraining the search area and re-adjusting the track nodes. The specific expression is as follows:
[0016] 1. Define the cost function. The cost function of the A* algorithm is expressed as: f(n)=g(n)+h(n), where n is the current node, f(n) is the cost function from the starting point to the target point via node n, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the target node.
[0017] g(n) is the actual cost function from the starting point to node n, which can be expressed as: g(n) = ω1l n +ω2J n +ω3z n , where l n For the voyage cost, J n For the threat cost, z n is the height cost, ω1, ω2 and ω3 represent the track cost weights respectively; the track is required to avoid all threat areas, the threat cost is set to infinity, and ω2=∞; in the actual cruising flight of the UAV, the UAV is set to cruise at a fixed altitude, and the three-dimensional space track search problem is simplified to a two-dimensional problem, and ω1=1, ω3=0.
[0018] h(n) can be understood as a heuristic function, guiding the node (x n ,y n ) to the target point (x t ,y t) direction search expansion, which can be expressed as:
[0019] 2. Define constraints: Considering the maximum range, minimum trajectory length, maximum turning angle and other performance constraints of the UAV, in order to optimize the search space and improve the search speed, the following constraints are set in the heuristic track search process:
[0020] a. Maximum range: the total range f of a single UAV track search should be less than the maximum range L of the UAV max , that is, f <L max ;
[0021] b. Minimum trajectory length: Due to the constraints of maneuverability, the drone needs to fly a certain distance in the original direction before changing its flight direction. That is, the shortest direct flight distance is h. min In A * In the algorithm, the grid side length h is the search step length, which should be greater than the minimum track segment length, that is, h>h min ;
[0022] c. Maximum turning angle. When searching for the next node in the planning space, the search is limited to the fan-shaped constraint area instead of traversing each adjacent node. The maximum turning angle θ corresponds to the minimum turning radius R min , the node expansion angle α is searched in the fan-shaped area within the range of 2θ, thereby reducing the search space and speeding up the search;
[0023] 3. Track node adjustment. During the grid node expansion process, the node expansion is mainly limited to the intersection of the grid lines, which will cause some tracks to be jagged. It is necessary to optimize some jagged broken line tracks to straight lines. Suppose the initial track node sequence v of the drone w is w1 [r], the number of node sequences is r, then the node readjustment process is:
[0024] a. Initially set j = r;
[0025] b. Cycle check (v w1 [i],v w1 [j]) whether the line between them passes through the threat area, i∈[1,...,j-1]; if it passes through the threat area, let i=i+1; if it does not pass through the threat area, let j=i, and set v w1 [j] Save as the adjusted track node;
[0026] c. Repeat the above cycle until j = 1, stop the cycle, and generate the adjusted track sequence v w2 [l], the number of node sequences after adjustment is l;
[0027] 4. Track search process. During the heuristic search, two tables, OPEN and CLOSE, are established. The OPEN table is used to store nodes that have been calculated but not expanded, and the CLOSE table is used to store nodes that have been expanded. The data storage structure is represented by {(x i ,y i ),f i ,g i ,h i ,p i},(x i ,y i ) is the grid coordinate of the node, f i ,g i ,h i ,p i are the variable values of the cost function, p i Represents the parent node of the current node. The main process of track search is described as follows:
[0028] a. Initialization; set the step size and obstacle area, initialize the OPEN and CLOSE tables, and put the starting point into the OPEN table as the current node;
[0029] b. Node expansion and storage; If the adjacent node of the current node meets the constraint conditions and is not in the current OPEN and CLOSE tables, then add the valid node to the OPEN table; Move the node A with the lowest cost in the OPEN table to the CLOSE table; Determine whether node A is the end point, if it is the end point, exit the node search, if not, continue node expansion; Extract the initial track node sequence v from the CLOSE table w1 [r], the cost function value of the end point is used as the estimated voyage;
[0030] c. Track node adjustment, initial setting v w1 The initial track starting point in [r] is the adjustment starting point, and the initial track end point is the adjustment relay point; starting from the adjustment starting point, determine v w1 [r] Whether the line connecting each track point and the adjustment relay point passes through the obstacle area; if the line connecting the adjustment starting point and the adjustment relay point passes through the obstacle, the next point of the current adjustment starting point is updated as the adjustment starting point, and continue to judge whether it passes through the obstacle; if the line connecting the adjustment starting point and the adjustment relay point does not pass through the obstacle, the current adjustment relay point is saved as a route point after the track adjustment, and the current adjustment starting point is updated as the adjustment relay point, and the judgment cycle continues; until the current adjustment relay point is the starting point, the cycle stops, and the adjusted track sequence v is constructed by combining various adjustment relay points w2 [l];
[0031] The second step is to allocate tasks to multiple bases and multiple drones. Assume that the base sequence is P = {P1, P2, P3, ... Pn}, the number of bases is n; the task target sequence is T = {T1, T2, T3, ... Tm}, the number of tasks is m; construct a distance matrix d[n][m] to represent the distance A between each base and each target * Distance; construct a distance matrix represented as q[m][m], which is used to represent the distance between any two targets. * distance; the sequence of the number of drones at each base is U = {U1, U2, U3, ... U n}, used to indicate the number of drones deployed at each base;
[0032] According to the number and distribution of tasks, multi-UAV task allocation can be solved in two different situations: ① When the number of tasks is large and the distribution is concentrated in the area, a solution method based on target clustering is adopted. This method includes multiple processing links such as target area clustering, cluster target allocation, and UAV task allocation within the position. It can simplify large-scale target allocation problems and has good timeliness and scalability; ② When the number of tasks is small and the distribution is sparse, a solution method based on deep traversal is adopted. This method is suitable for situations where the calculation scale is small and the initial parameters of the target clustering are difficult to determine. It simplifies the solution process and directly uses the deep traversal method for accurate task allocation. The solution process processing method is:
[0033] (1) Solution method based on target clustering
[0034] The solution method based on target clustering includes three processing steps: target area clustering, cluster target allocation, and multi-UAV task allocation within the base; target area clustering is to achieve regional clustering of targets according to their geographical distribution and clustering characteristics; cluster target allocation is to achieve the allocation of each cluster target area to the nearest UAV base; multi-UAV task allocation within the base is to achieve the target allocation of multiple UAVs within the UAV base;
[0035] Preferably, when the number of tasks is large and the tasks are concentrated in the area, the multi-base multi-UAV task allocation is solved based on the target clustering method, and the following steps are performed:
[0036] By improving K-means clustering target clustering, the multi-task allocation problem of multi-base UAVs is clustered and analyzed, and the functions of target area clustering and cluster target allocation are realized. The targets are divided into task areas according to their geographical distribution, and the task areas are allocated to the nearest UAV bases.
[0037] Select and apply A in the initial cluster center * The traditional K-means clustering algorithm is improved in terms of distance estimation, adding total mission range constraints, and determining the corresponding bases of clustering targets. The processing flow of the improved K-means clustering algorithm is specifically described as follows:
[0038] a. Target clustering initialization: select K dispersed target points as initial cluster centers. According to the distribution of each location point on the GIS system, select K relatively dispersed targets as initial cluster centers.
[0039] b. Determine the correspondence between the drone base and the target cluster, and assign the drone base to the nearest cluster center point;
[0040] c. Circular target clustering, based on the range cost, the distance from each target point to each cluster center is calculated cyclically, and each target is classified into the target area class with the closest distance. When a cluster target sequence is randomly selected, and the total range between it and the corresponding base exceeds the maximum range of all drones in the base, a target closest to the center of the adjacent target cluster is selected from the target class and added to the adjacent target cluster.
[0041] d. Update the target cluster center point, calculate the region centroid position based on the average distance value of all data points, and adjust the cluster center to the central target point of each regional class;
[0042] e. Repeat b, c, and d until the cluster center no longer changes or the maximum number of iterations is reached;
[0043] For task allocation within a single base, if a single drone can complete the task, then the single drone will be used first; if a single drone cannot complete all tasks, it is necessary to estimate the number of drones k required based on the total range of the mission and the maximum range of a single drone, and then use the clustering method to allocate tasks again according to the number of drones.
[0044] (2) Solution method based on depth traversal
[0045] Preferably, when the number of tasks is small and the evacuation distribution is sparse, solving the multi-base multi-UAV task allocation based on the deep traversal method is performed according to the following steps:
[0046] Assign the nearest target to each base, and the objective function Z is expressed as d ij is the A* distance from UAV i to target j; the constraints include: ① Maximum range constraint, the total range of a UAV at a single base performing multiple tasks cannot exceed its maximum range L max ;② Mission constraints: one drone per base participates in the mission, and each target has at least one drone to perform the mission.
[0047] The process of deep traversal and accurate solution is described as follows:
[0048] a. According to the number of the target sequence T, according to the objective function Z, start from the first target and loop in sequence; compare the distance between the target and each UAV base, and select the UAV base closest to the current target; loop and compare in sequence, and finally determine the UAV base sequence corresponding to the target sequence T, set as H = {H1, H2, H3, ... H m}.
[0049] b. Combine the correspondence between sequences T and H, assign tasks to each drone, and obtain the task grouping corresponding to the w-th drone as h w [k].
[0050] The third step is to allocate the time-sequential tasks of a single UAV within the base. In the multi-base UAV task allocation scheme, if a single UAV is assigned multiple tasks, it is necessary to allocate multiple tasks to a single UAV in a sequential manner. The time-sequential task allocation of a single UAV is solved based on the estimated flight matrix of the improved A* algorithm using the TSP traveling salesman model.
[0051] Preferably, the traveling salesman model for the time-series task allocation of a single UAV in the base is solved by the following steps:
[0052] Use A * The algorithm estimates the distance between the take-off point of the drone and multiple mission target points. For the w-th drone, the corresponding task group is h w [k], construct A * The distance matrix is represented as p w [k][k], k is the corresponding mission number of the w-th UAV, the starting point and the end point are the UAV bases, and 1, 2 to k represent the target numbers.
[0053] The objective function R is expressed as: h ij is the A* distance of the drone from target i to target j, c ij ∈{0,1} is the decision variable.
[0054] If the time series task allocation scale is small, the depth traversal method is used to cyclically compare any possible solution to accurately obtain the optimal solution. If the time series task allocation scale is large and the exact algorithm is too computationally intensive to solve, the genetic algorithm is used. The main processing flow based on the genetic algorithm solution is expressed as follows:
[0055] a. Initialization: Initially set the population size, individual length, number of iterations, crossover and mutation probabilities, etc. A single chromosome is the target number sequence with a length of k.
[0056] b. Initial population: randomly generate the initial population of target sequences.
[0057] c. Genetic operation: selection operation, calculate the fitness value according to the objective function R, select chromosomes according to the fitness value, and adopt the roulette method to select. The larger the fitness value, the greater the probability of being selected; crossover operation, using the permutation crossover method, randomly select a gene fragment from the two parents to exchange; mutation operation, two genes on a chromosome are exchanged with a certain probability to generate a new individual;
[0058] d. Optimal operation, comprehensively select excellent individuals from the parent group and the child group, and eliminate individuals with poor fitness. If the optimal individual does not meet the requirements or the number of iterations is not reached, continue to perform selection, crossover, and mutation operations; otherwise, stop the cycle. Finally, the optimal task number sequence is generated. The time sequence target sequence of the w-th drone is represented by u w [k], k is the number of sequential tasks.
[0059] Preferably, in step S3, the track planning is performed according to the following steps:
[0060] The first step is trajectory optimization. Based on the allocation scheme of multi-UAV task allocation and single-machine sequential task allocation, trajectory planning is performed separately according to the task sequence of each UAV based on the improved A* algorithm.
[0061] The starting point and time sequence u of drone w w Each task point in [k] and the recovery point of UAV w constitute a track point sequence. Starting from the starting point, two consecutive time nodes in the track sequence are taken as A. * The starting and ending points of the search are used to obtain the initial track sequence v between each consecutive node w1 [r], and the adjusted track sequence v w2 [l]. v between any two sequentially consecutive nodes w2 [l], which are combined together to form the total track v of the w-th UAV w3 [q], the total number of track points is q.
[0062] The UAV's track point v w3 [q], convert the geographic coordinates and draw them on the geographic information system to get the UAV track map. Draw the track points of each UAV in turn to get the track planning map of multiple bases and multiple UAVs.
[0063] The second step is to smooth the track. The track drawn by track optimization is a broken line graph, which does not conform to the actual track. It is necessary to convert the broken line track into a smooth curve to obtain a track curve that meets the flight constraints and use a cubic B-Spline curve to mark and display it.
[0064] Preferably, when the cubic spline curve is used to smooth the flight path curve, based on A * The track control point obtained by track optimization is P i(i=0,1,…,n), a cubic spline curve is used for smoothing, and each curve is determined by four consecutive adjacent track control points; and w3 Add control points near each track point of [q], and then perform curve smoothing operation.
[0065] P i is a sequence of track points, and the cubic B-Spline curve is expressed as
[0066]
[0067] The present invention discloses a phased multi-base UAV task allocation and track planning method, including three steps: area setting, task allocation and track planning. The present invention is based on the application background of heterogeneous multi-UAV evacuation configuration in multiple bases and collaborative execution of multi-target detection tasks. By regional setting, improving A * The algorithm estimates the range matrix, multi-base multi-UAV task allocation, single UAV time-series task allocation within the position, trajectory planning and other stages to achieve multi-base multi-UAV task planning. In the multi-base multi-UAV task allocation stage, when the number of tasks is large and the regional distribution is concentrated, the solution is based on the improved K-means algorithm; when the number of tasks is small and the evacuation distribution is scattered, the solution is based on the deep traversal method; the single UAV time-series task allocation stage is based on the TSP model and genetic algorithm; in the trajectory planning stage, the trajectory is optimized based on the improved A* algorithm and the cubic B-spline curve method. This method matches the command process of hierarchical command and regional coordination, and is suitable for complex application environments such as base evacuation configuration and heterogeneous UAVs in each base. It simplifies the problem, has good effectiveness and scalability, and is easy to implement and apply in engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a schematic diagram of the process of the present invention;
[0069] Figure 2 The principle block diagram of the multi-base UAV mission planning of the present invention;
[0070] Figure 3 A schematic diagram of the space planning for the present invention;
[0071] Figure 4 It is a principle block diagram of the multi-stage task allocation of the present invention;
[0072] Figure 5 A schematic diagram of a fan-shaped search area for a track node of the present invention;
[0073] Figure 6 This is a schematic diagram of track node adjustment of the present invention;
[0074] Figure 7 Improved A* algorithm flow chart for the present invention;
[0075] Figure 8 A schematic diagram of the coding for task allocation of multi-base UAVs of the present invention;
[0076] Fig. 9 Improved K-means clustering algorithm flow chart for the present invention;
[0077] Fig.10 A schematic diagram of coding for sequential task allocation of the present invention;
[0078] Fig.11 The present invention is based on the genetic algorithm solution flow chart;
[0079] Fig.12 A test graph for task planning based on target clustering of the present invention;
[0080] Fig.13 A test graph for task planning based on depth traversal of the present invention. DETAILED DESCRIPTION
[0081] The present invention can be better understood according to the following examples. However, it is easy for those skilled in the art to understand that the contents described in the examples are only used to illustrate the present invention, and should not and will not limit the present invention described in detail in the claims.
[0082] like Figure 1 As shown in FIG. 13 , a method for multi-base UAV task allocation and trajectory planning in stages includes the following steps:
[0083] S1, area setting, first in the Geographic Information System (GIS), click to determine the coordinates of each base and mission in turn, determine the scope of the mission planning area, and then use different geometric shapes to mark the threat area in the planning area;
[0084] S2, Task Allocation,First, in the range estimation stage, improve A * Algorithm, build A between each base and each mission point * Estimate the flight matrix; secondly, in the multi-base multi-UAV task allocation stage, when the number of tasks is large and the regional distribution is concentrated, the improved K-means algorithm is used to achieve target area clustering, cluster target allocation for each position, and UAV task allocation within the position; when the number of tasks is small and the distribution is sparse, the deep traversal method is used to achieve accurate task allocation; finally, in the single UAV time-series task allocation stage, the traveling salesman problem (TSP) and genetic algorithm are used to solve the time-series task allocation of a single UAV in each base;
[0085] S3, track planning; first adopt the improved A* The algorithm plans and draws the trajectory, and then smoothes the trajectory based on a cubic B-spline curve.
[0086] In order to better explain the application method and working principle of the present invention in actual use, the technical contents involved in the present invention are further described and introduced;
[0087] Step 1: Regional settings.
[0088] In the Geographic Information System (GIS), click on the base coordinates and mission coordinates in turn to determine the scope of the mission planning area, and use different geometric shapes to mark the threat area in the planning area.
[0089] Step 1.1, regional planning. In the geographic information system, click to select and mark the locations of multiple bases and multiple missions, number each base and mission in the order of clicking, and determine the regional scope of mission planning. Figure 3 As shown, let the maximum position Gaussian coordinates be X max , Y max , let the minimum position Gaussian coordinates be X min , Y min , assuming that the expansion distance value of the planning space is H, then the four vertices of the rectangular planning area can be determined to be (X min -H,Y min -H)、(X min -H,Y max +H)、(X max +H,Y max +H)、(X min -H,Y max +H).
[0090] Discretize the two-dimensional planning space into grids, (X min -H,Y min -H) is the origin, and h is the length of the grid side. Then the grid coordinates (x g ,y g ) is expressed as:
[0091]
[0092] Step 1.2, threat setting. In complex special application environments such as complex electromagnetic, geographical and meteorological environments, high-intensity confrontation, and airspace resource shortages, drones will face various threat challenges when performing missions. Based on basic geographic information and regional situation information, flight threat areas such as terrain, radar detection, air defense firepower, and no-fly zones are mapped in GIS. According to the characteristics of different threat models, the threat areas are marked in different shapes such as circles, rectangles, and polygons in the GIS system through hand-drawing or annotation. The grid coordinates (x gt ,y gt ), construct the threat area matrix G[x][y], let G[x gt ][y gt ]=1 means that the grid is a threat grid, G[x gt ][y gt ]=0 means that the grid is not a threat grid.
[0093] Step 2: Task allocation.
[0094] Multi-UAV task allocation can be simply described as: given multiple UAVs and multiple tasks at multiple bases, a task area is assigned to each base, and a UAV is found to be responsible for executing each subtask, so that the cost of the entire system is minimized and the benefit is maximized during the task execution process.
[0095] The present invention adopts a multi-stage task allocation strategy, mainly based on the following considerations: ① The phased task allocation matches the command process. According to the command strategy of hierarchical command and regional coordination, the multi-UAV collaborative task planning will present a phased application style, including the demarcation of task areas by each UAV base, the allocation of multi-UAV targets in each base, and the timing allocation of each UAV target. ② Phased task allocation is suitable for complex application environments. In the application environment of dynamic uncertainty, strong confrontation, wide-area distribution of tasks, and heterogeneous configuration of multi-base UAVs, the global task allocation based on the multi-objective optimization model will be too complicated, and there will be a lot of computational redundancy when tasks are dynamically allocated; phased task allocation can effectively reduce the algorithm complexity and the scale of problem solving through decoupling splitting and distributed solution; ③ The improved A* algorithm is used to estimate the range. In the task allocation process, the improved A* algorithm is used to estimate the range, which fully considers the influence of constraints such as threat areas on the distance cost, and avoids the calculation error caused by directly using the straight-line Euclidean distance; ④ Phased task allocation is simple and effective. The phased allocation simplifies the problem, and the algorithm is flexible, the ideas are clear, the effectiveness and scalability are good, and it is easy to implement and apply in engineering.
[0096] like Figure 4As shown in the figure, multi-stage task allocation mainly includes three stages: range estimation, multi-base multi-UAV task allocation, and single UAV time-series task allocation within the base. Among them, multi-base UAV task allocation includes three stages: target area clustering, clustered target allocation to each base, and multi-UAV task allocation within the base. Range estimation refers to obtaining the estimated range matrix required for task allocation based on the improved A* algorithm; multi-position multi-UAV task allocation, when the number of tasks is large and the area is concentrated, is solved based on the improved K-means algorithm; when the number of tasks is small and the distribution is sparse, the deep traversal method is used to achieve accurate task allocation; single UAV time-series task allocation, based on the TSP model and genetic algorithm, solves the problem of multi-target task sequence allocation for a single UAV.
[0097] Step 2.1, Improve A * Algorithm design. * The algorithm is a heuristic search algorithm that heuristically searches for nodes and constructs the optimal trajectory by continuously evaluating the path function value in the grid space. * The algorithm has good globality, runs fast, and is easy to implement. Based on the setting of the planning area and threat space, the UAV base and the mission point are used as the starting and ending points respectively. * The algorithm heuristically searches for the optimal path and estimates the distance between the UAV base and each mission point, and between each mission point. Combined with the specific application background, it mainly improves the traditional A * The algorithm was improved and designed by constraining the fan-shaped search area to reduce the search calculation cost and optimizing the sawtooth track by adjusting the track nodes. The specific description is as follows.
[0098] ① Determine the cost function. * The cost function of the algorithm is expressed as:
[0099] f(n)=g(n)+h(n) (2)
[0100] Where n is the current node, f(n) is the cost function from the starting point to the target point via node n, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the target node.
[0101] g(n) is the actual cost function from the starting point to node n, which can be expressed as:
[0102] g(n)=ω1l n +ω2J n +ω3z n (3)
[0103] Among them, l n For the voyage cost, J n For the threat cost, z nis the height cost, ω1, ω2 and ω3 represent the track cost weights. Under high-confrontation application conditions, safe flight of UAVs is the primary indicator, requiring the track to avoid all threat areas, setting the threat cost to infinity, and setting ω2 = ∞; in the actual cruise flight of UAVs, fixed altitude cruise is usually preferred. In order to simplify the track optimization problem and reduce the amount of calculation, the UAV is set to cruise at a fixed altitude, simplifying the three-dimensional space track search problem to a two-dimensional problem, setting ω1 = 1, ω3 = 0.
[0104] h(n) can be understood as a heuristic function, guiding the node (x n ,y n ) to the target point (x t ,y t ) direction search expansion, which can be expressed as:
[0105]
[0106] ② Set constraints. Considering the performance constraints of the UAV such as the maximum range, minimum trajectory length, and maximum turning angle, in order to optimize the search space and increase the search speed, the following constraints are set in the heuristic track search process:
[0107] a. Maximum range
[0108] The maximum range of a drone is limited by factors such as the data link range and flight power. The total range f of a single drone track search should be less than the maximum range L of the drone. max ,Right now
[0109] f <L max (5)
[0110] b. Minimum track segment length
[0111] Due to the constraints of maneuverability, the drone needs to fly a certain distance in the original direction before changing its flight direction. That is, the shortest direct flight distance is h min In A * In the algorithm, the grid side length h is the search step length, and the search step length should be greater than the minimum track segment length, that is,
[0112] h>h min (6)
[0113] c. Maximum turning angle
[0114] When searching for the next node in the planning space heuristic, the search is limited to the fan-shaped constraint area instead of traversing every adjacent node. Figure 5 As shown, the shaded area represents the fan-shaped search area, and the maximum turning angle θ corresponds to the minimum turning radius R min, the node expansion angle α is searched in the fan-shaped area within the range of 2θ, thereby reducing the search space and speeding up the search.
[0115] ③ Track node adjustment. During the grid node expansion process, node expansion is mainly limited to the intersection of grid lines, which may cause some tracks to be jagged. In order to avoid jagged tracks, track nodes need to be adjusted again to optimize some jagged broken line tracks into straight lines. Figure 6 As shown, the dotted line track in the figure is optimized to a solid line track.
[0116] Assume that the initial track node sequence v of UAV w is w1 [r], the number of node sequences is r, then the node readjustment process is: a. Initially set j = r; b. Cycle check (v w1 [i],v w1 [j]) whether the line between them passes through the threat area, i∈[1,...,j-1]; if it passes through the threat area, let i=i+1; if it does not pass through the threat area, let j=i, and set v w1 [j] is saved as the readjusted track node; c. Repeat the above cycle until j = 1, stop the cycle, and generate the readjusted track sequence v w2 [l], the number of node sequences after adjustment is l.
[0117] ④ Track search process. During the heuristic search, two tables, OPEN and CLOSE, are established. The OPEN table is used to store nodes that have been calculated but not expanded, and the CLOSE table is used to store nodes that have been expanded. The data storage structure is represented by {(x i ,y i ),f i ,g i ,h i ,p i},(x i ,y i ) is the grid coordinate of the node, f i ,g i ,h i ,p i are the variable values of the cost function, p i Represents the parent node of the current node. Figure 7 As shown in the figure, the main process of track search is:
[0118] a. Initialization. Set the step size and obstacle area, initialize the OPEN and CLOSE tables, and put the starting point into the OPEN table as the current node.
[0119] b. Node expansion and storage. If the adjacent nodes of the current node meet the constraints and are not in the current OPEN and CLOSE tables, add the valid node to the OPEN table; move the node A with the lowest cost in the OPEN table to the CLOSE table; determine whether node A is the end point, if it is the end point, exit the node search, if not, continue node expansion. Extract the initial track node sequence v from the CLOSE table w1 [r], the cost function value of the end point is used as the estimated flight distance.
[0120] c. Track node adjustment. Initial setting w1 The initial track starting point in [r] is the adjustment starting point, and the initial track end point is the adjustment relay point; starting from the adjustment starting point, determine v w1 [r] Whether the line connecting each track point and the adjustment relay point passes through the obstacle area; if the line connecting the adjustment starting point and the adjustment relay point passes through the obstacle, the next point of the current adjustment starting point is updated as the adjustment starting point, and continue to judge whether it passes through the obstacle; if the line connecting the adjustment starting point and the adjustment relay point does not pass through the obstacle, the current adjustment relay point is saved as a route point after the track adjustment, and the current adjustment starting point is updated as the adjustment relay point, and the judgment cycle continues; until the current adjustment relay point is the starting point, the cycle stops, and the adjusted track sequence v is constructed by combining various adjustment relay points w2 [l].
[0121] Step 2.2, multi-base multi-UAV task allocation. Let the base sequence be P = {P1, P2, P3, ... P n}, the number of bases is n; the task target sequence is T = {T1, T2, T3, ... Tm}, the number of tasks is m; construct a distance matrix d[n][m] to represent the distance A between each base and each target * Distance; construct a distance matrix represented as q[m][m], which is used to represent the distance between any two targets. * distance; the sequence of the number of drones at each base is U = {U1, U2, U3, ... U n}, used to indicate the number of drones deployed at each base.
[0122] like Figure 8As shown in the figure, it is the task allocation code of multi-base UAVs, and each task is performed by a UAV. According to the number and distribution of tasks, the multi-UAV task allocation can be solved in two situations: ① When the number of tasks is large and the area is concentrated, a solution method based on target clustering is adopted. This method includes multiple processing links such as target area clustering, cluster target allocation, and UAV task allocation in the position. It can simplify large-scale target allocation problems and has good timeliness and scalability; ② When the number of tasks is small and the distribution is sparse, a solution method based on deep traversal is adopted. This method is suitable for situations where the calculation scale is small and the initial parameters of target clustering are difficult to determine. It simplifies the solution process and directly uses the deep traversal method for accurate task allocation.
[0123] (1) Solution method based on target clustering
[0124] The solution method based on target clustering includes three processing steps: target area clustering, cluster target allocation, and multi-UAV task allocation within the base. Target area clustering is to achieve regional clustering of targets according to their geographical distribution and agglomeration characteristics; cluster target allocation is to achieve the allocation of each cluster target area to the nearest UAV base; multi-UAV task allocation within the base is to achieve the target allocation of multiple UAVs within the UAV base.
[0125] K-means clustering algorithm is an iterative clustering analysis method with simple principle, fast convergence speed and good practicality. The distance between each target is used as the similarity evaluation index, and K compact and relatively independent target clusters are finally determined through multiple rounds of iteration. It should be noted that due to the heterogeneity of UAV bases, the number and models of UAVs equipped at each UAV base are different. Therefore, the clustering target should not exceed the mission capability of the nearest base, and the main focus is on the total mission range of each base.
[0126] Combined with the specific application background, the initial cluster center is selected and applied * The traditional K-means clustering algorithm is improved in terms of estimating distance, adding total mission range constraints, and determining the corresponding bases of clustering targets. Fig. 9 As shown, the processing flow of the improved K-means clustering algorithm is:
[0127] a. Target clustering initialization. Select K dispersed target points as the initial cluster centers. To save computational overhead, K relatively dispersed targets can be manually selected as the initial cluster centers based on the distribution of each location point on the GIS system;
[0128] b. Determine the correspondence between the drone base and the target cluster. Assign the drone base to the nearest cluster center point;
[0129] c. Circular target clustering. Calculate the distance from each target point to each cluster center in a loop, and assign each target to the target area class that is closest to it. To prevent the number of targets in the cluster area from exceeding the mission capability value of the nearest base, make a judgment based on the range cost. If a cluster target sequence is randomly selected, and the total range between it and the corresponding base exceeds the maximum range of all drones in the base, select a target from the target class that is closest to the center of the adjacent target cluster, and add the target to the adjacent target cluster;
[0130] d. Update the target cluster center point. Calculate the region centroid position based on the average distance value of all data points, and adjust the cluster center to the central target point of each region class;
[0131] e. Repeat steps b, c, and d until the cluster center no longer changes or the maximum number of iterations is reached.
[0132] Through the improved K-means target clustering method, two functions, target area clustering and cluster target allocation, are realized. The targets are divided into mission areas according to their geographical distribution, and the mission areas are allocated to the nearest UAV bases.
[0133] For the allocation of UAV tasks within a single base, if a single UAV can complete the task, it will be given priority to use the single UAV for execution; if a single UAV cannot complete all tasks, the total flight range of the task and the maximum flight range of a single UAV are combined to estimate the number of UAVs k required, and then the K-means clustering method is used to allocate tasks again according to the number of UAVs. Finally, tasks are assigned to each UAV, and the task group corresponding to the wth UAV is h w [k].
[0134] (2) Solution method based on depth traversal
[0135] When the number of tasks is small and sparsely distributed, the calculation scale is usually small, and the deep traversal method is directly used for accurate task allocation.
[0136] Assign the nearest target to each base, and the objective function Z is expressed as
[0137]
[0138] Among them, d ij A is the distance from UAV i to target j * distance.
[0139] The constraints include: ① Maximum range constraint. The total range of a single base UAV performing multiple tasks cannot exceed its maximum range L max ② Mission constraints. One drone per base participates in the mission, and at least one drone per target performs the mission.
[0140] The process of traversal and exact solution is described as follows:
[0141] a. According to the number of the target sequence T, start from the first target and loop in sequence; compare the distance between the target and each drone base, and select the drone base closest to the current target; loop and compare in sequence, and finally determine the drone base sequence corresponding to the target sequence T, set as H = {H1, H2, H3, ... H m};
[0142] b. Combine the correspondence between sequences T and H, assign tasks to each drone, and obtain the task grouping corresponding to the w-th drone as h w [k].
[0143] The third step is the allocation of time-sequential tasks for individual UAVs within the base.
[0144] In the multi-base UAV task allocation scheme, if a single UAV is assigned multiple tasks, it is necessary to perform single UAV multi-task sequential allocation. The single UAV sequential task allocation adopts the TSP traveling salesman model.
[0145] The TSP problem is a classic path optimization problem. A single traveler starts from a starting point, passes through multiple target points, and finally returns to the starting point, seeking a route that minimizes the path cost. When solving the traditional TSP model, when calculating the distance between each path point, the distance between each point is usually simplified to a straight-line Euclidean distance. In a complex and highly confrontational application environment, if the distance between target points does not take into account the avoidance of the threat area, there will be a large error, and the TSP solution will be difficult to obtain a reasonable result. Therefore, the TSP solution method is improved, and the distance between any two points is calculated using A * The algorithm estimates the distance.
[0146] Consider avoiding the threat area and adopt A * The algorithm estimates the distance between the drone take-off point and multiple mission target points, and constructs A * The distance matrix is represented as p w [k][k], k is the corresponding mission number of the w-th UAV.
[0147] like Fig.10 As shown in FIG. 1 , it is the coding for the UAV timing task allocation. The starting point and end point of the UAV timing task allocation are the UAV bases, and 1, 2 to k represent the target numbers.
[0148] The objective function R is expressed as:
[0149]
[0150] Among them, h ij A is the distance from target i to target j of the UAV * Distance, cij ∈{0,1} is the decision variable.
[0151] If the time series task allocation scale is small, the depth traversal method is preferred to cyclically compare any possible solution to accurately obtain the optimal solution. If the time series task allocation scale is large and the exact algorithm is too computationally intensive to solve, the genetic algorithm is used. Fig.11 As shown in the figure, the main processing flow based on genetic algorithm is:
[0152] a. Initialization. Initially set the population size, individual length, number of iterations, crossover and mutation probabilities, etc.
[0153] b. Initial population. Randomly generate the initial population of target sequences. A single chromosome is the target number sequence.
[0154] c. Genetic operation. Selection operation, calculate the fitness value according to the objective function R, select chromosomes according to the fitness value, and adopt the roulette method to select. The larger the fitness value, the greater the probability of being selected; crossover operation, using the permutation crossover method, randomly select a gene fragment from the two parents to exchange; mutation operation, two genes on a chromosome are exchanged with a certain probability to produce a new individual.
[0155] d. Optimal operation. Select excellent individuals from the parent group and the child group, and eliminate individuals with poor fitness. If the optimal individual does not meet the requirements or the number of iterations is not reached, continue to perform selection, crossover, and mutation operations; otherwise, stop the loop. Finally, the optimal task number sequence u[k] is generated. The time sequence target sequence of the w-th drone is represented as u w [k], k is the number of sequential tasks.
[0156] Step 3: Route planning. Using improved A * The algorithm plans and draws the trajectory, and performs trajectory smoothing based on a cubic B-spline curve.
[0157] Step 3.1, track optimization.
[0158] Based on the allocation scheme of multi-UAV task allocation and single-machine sequential task allocation, the trajectory planning is carried out according to the task sequence of each UAV, and the improved A * The algorithm is used to optimize the trajectory. * The algorithm is executed according to step 2.1.
[0159] Taking the w-th drone as an example, the starting point and time sequence u of drone w w Each task point in [k] and the recovery point of UAV w constitute a track point sequence. Starting from the starting point, two consecutive time nodes in the track sequence are taken as A. * The starting and ending points of the search are used to obtain the initial track sequence v between each consecutive node w1[r], and the adjusted track sequence v w2 [l]. v between any two sequentially consecutive nodes w2 [l], which are combined together to form the total track v of the w-th UAV w3 [q], the total number of track points is q.
[0160] The UAV's track point v w3 [q], convert the geographic coordinates and draw them on the geographic information system to get the UAV track map. Draw the track points of each UAV in turn to get the track planning map of multiple bases and multiple UAVs.
[0161] Step 3.2, track smoothing.
[0162] The trajectory drawn by trajectory optimization is a broken line graph, which does not conform to the actual trajectory. It is necessary to convert the broken line trajectory into a smooth curve to obtain a trajectory curve that meets the flight constraints. The cubic B-Spline curve has the characteristics of locality, convex hull and C2 continuity, and has a good smoothing effect.
[0163] The track control point obtained based on A* track optimization is P i (i=0,1,…,n), a cubic spline curve is used for smoothing, and each curve is determined by four consecutive adjacent track control points. The track points of the improved A* algorithm are often easy to be sparse, making the track smoothing curve closer to the initial track polyline. It can be considered to be in v w3 Add control points near each track point of [q], such as track point v w3 [i] with node v w1 [j] is consistent, v w3 [i] Add control point v at point w1 [j+1], and then perform the curve smoothing operation.
[0164] The cubic B-spline fitting curve is expressed as
[0165]
[0166] like Fig.12As shown, a task planning test based on improved K-means target clustering was conducted. The positions of three UAV positions and 18 targets were determined in GIS by clicking on them, and multiple threat areas were marked by hand. The A* range between each location point was estimated by clicking on “Range Estimation”. The initial cluster centers of the three targets were determined by clicking on “Cluster Selection”, and the solid dots in the GIS area represent the initial cluster centers. The target area clustering was achieved by clicking on “Target Clustering”, and the solid dots in the GIS area are the initial cluster centers and the centers after K-means clustering, respectively. The three cluster target groups were assigned to the three UAV positions by clicking on “Task Assignment”. After clicking on “Track Search”, the A* search tracks between each UAV and its sequential tasks were drawn in the GIS area. The tracks were able to avoid obstacles, but some of the tracks were jagged because the A* search was limited to the grid intersections. After clicking on “Track Adjustment”, the adjusted and optimized tracks were drawn in the GIS area, and some A* search jagged broken line track segments were optimized to straight lines. After clicking on “Track Smoothing”, the B-spline smoothed tracks were drawn in the GIS area. The test shows that the target clustering allocation and target timing allocation are reasonable, the track avoids the obstacle area, the track is optimized through track adjustment and track smoothing, and there is no obvious delay in the test process calculation.
[0167] like Fig.13 As shown in the figure, a task planning test based on deep traversal was conducted. In GIS, 5 UAV positions and 7 evacuation distribution target positions were clicked to determine them respectively, and multiple threat areas were marked by hand-drawing; click "Range Estimation" to estimate the A* range between each position point, click "Task Assignment" to assign UAVs to each target, and the assignment results are displayed in the task display area. Two UAV positions participated in the task execution; click "Track Search" to draw the A* search track between each UAV and its sequential task in the GIS area; click "Track Adjustment" to optimize some A* search zigzag broken line track segments; click "Track Smoothing" to draw a B-spline smooth track in the GIS area. The test shows that the evacuation distribution targets are reasonably allocated to each UAV position, and the track of each UAV effectively avoids the threat area. The track of the UAV is optimized through track adjustment and track smoothing.
[0168] The present invention discloses a phased multi-base UAV task allocation and track planning method, including three steps: area setting, task allocation and track planning. The present invention is based on the application background of heterogeneous multi-UAV evacuation configuration in multiple bases and collaborative execution of multi-target detection tasks. By regional setting, improving A *The algorithm estimates the range matrix, multi-base multi-UAV task allocation, single UAV time-series task allocation within the position, trajectory planning and other stages to achieve multi-base multi-UAV task planning. In the multi-base multi-UAV task allocation stage, when the number of tasks is large and the regional distribution is concentrated, the solution is based on the improved K-means algorithm; when the number of tasks is small and the evacuation distribution is scattered, the solution is based on the deep traversal method; the single UAV time-series task allocation stage is based on the TSP model and genetic algorithm; in the trajectory planning stage, the trajectory is optimized based on the improved A* algorithm and the cubic B-spline curve method. This method matches the command process of hierarchical command and regional coordination, and is suitable for complex application environments such as base evacuation configuration and heterogeneous UAVs in each base. It simplifies the problem, has good effectiveness and scalability, and is easy to implement and apply in engineering.
[0169] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A phased multi-base UAV task allocation and trajectory planning method, characterized in that: The phased multi-base UAV task allocation and trajectory planning method comprises the following steps: S1, area setting, first, in the geographic information system, click on the base coordinates and mission coordinates in turn to determine the mission planning area; then, in the planning area, use different geometric shapes to mark the threat area; S2, task allocation. First, in the range estimation stage, the A* algorithm is improved to construct the A* estimated range matrix between each base and each task point. Secondly, in the multi-base multi-UAV task allocation stage, when the number of tasks is large and the area is concentrated, the improved K-means algorithm is used to achieve target area clustering, cluster target allocation for each position, and UAV task allocation within the position. When the number of tasks is small and the distribution is sparse, the deep traversal method is used to achieve accurate task allocation. Finally, in the single UAV time-series task allocation stage, the time-series task allocation of a single UAV in each base is solved based on the traveling salesman model and genetic algorithm. The first step is to improve the design of the A* algorithm. On the basis of setting the planning area and threat space, each base and mission point is used as the starting and ending points, and the A* algorithm is used to heuristically search for the optimal path, and the distance between each base and each mission point and between each mission point is estimated. Combined with the specific application background, the traditional A* algorithm is optimized mainly in terms of constraining the search area and readjusting the track nodes. The second step is multi-base multi-UAV task allocation. Let the base sequence be P = {P 1 , P 2 , P 3 , … P n}, and the number of bases be n; the task target sequence be T = {T 1 , T 2 , T 3 , … T m}, and the number of tasks be m; construct a distance matrix d[n][m] to represent the A* distance from each base to each target; construct a distance matrix represented by q[m][m] to represent the A* distance between any two targets; the sequence of the number of UAVs at each base is U = {U 1 , U 2 , U 3 , … U n}, to represent the number of UAVs deployed at each base; According to the number and distribution of tasks, multi-UAV task allocation can be solved in two different situations: ① When the number of tasks is large and the distribution is concentrated in the area, a solution method based on target clustering is adopted; this method includes multiple processing links such as target area clustering, cluster target allocation, and UAV task allocation in the position, which can simplify large-scale target allocation problems and has good timeliness and scalability; ② When the number of tasks is small and the distribution is sparse, a solution method based on deep traversal is adopted; this method is suitable for situations where the calculation scale is small and the initial parameters of target clustering are difficult to determine, simplifies the solution process, and directly uses the deep traversal method for accurate task allocation; The third step is to allocate the time-sequential tasks of a single UAV within the base. In the multi-base UAV task allocation scheme, if a single UAV is assigned multiple tasks, it is necessary to allocate the time-sequential tasks of a single UAV. The time-sequential task allocation of a single UAV is solved based on the estimated distance matrix obtained by the improved A* algorithm and the TSP traveling salesman model; S3, track planning, first, the improved A* algorithm is used to plan and draw the track; then, the track is smoothed based on the cubic B-spline curve.
2. A method for multi-base UAV task allocation and trajectory planning in stages according to claim 1, characterized in that: The first step, when improving the A* algorithm design, is to proceed according to the following steps: (1) Determine the cost function. The cost function of the A* algorithm is expressed as: f(n) = g(n) + h(n), where n is the current node, f(n) is the cost function from the starting point to the target point via node n, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the target node; g(n) is the actual cost function from the starting point to the node n, g(n) = ω 1 ln + ω 2 J n + ω 3 zn , ln is the distance cost, J n is the threat cost, zn is the height cost, ω 1 , ω 2 and ω 3 represent the track cost weights respectively; the track is required to avoid all threat areas, the threat cost is set to infinity, and ω 2 = ∞; in the actual cruising flight of the UAV, the UAV is set to cruise at a fixed altitude, and the three-dimensional space track search problem is simplified to a two-dimensional problem, and ω 1 = 1, ω 3 = 0; h(n) is the heuristic function, which guides the node (xn, yn) to search and expand in the direction of the target point (xt, yt). (2) Limiting constraints: Considering the maximum range, minimum trajectory length, and maximum turning angle performance constraints of the UAV, in order to optimize the search space and improve the search speed, the following constraints are set during the heuristic trajectory search process: a. Maximum range: the total range f of a single UAV track search should be less than the maximum range L max of the UAV, f <Lmax ; b. Minimum track segment length. Due to the constraints of maneuverability, the UAV needs to fly a certain distance in the original direction before changing the flight direction. That is, the shortest direct flight distance is h min . In the A* algorithm, the grid edge length h is the search step length. The search step length should be greater than the minimum track segment length, h>h min ; c. Maximum turning angle: When searching for the next node in the planning space heuristically, the search is limited to the fan-shaped constraint area instead of traversing each adjacent node; the maximum turning angle θ corresponds to the minimum turning radius R min , and the node expansion angle α is searched in the fan-shaped area within the range of 2θ, thereby reducing the search space and speeding up the search; (3) Track node adjustment. During the grid node expansion process, the node expansion is limited to the intersection of the grid lines, which will cause some tracks to be jagged. Some jagged broken line tracks need to be optimized to straight lines. Suppose the initial track node sequence of UAV w is v w1 [r], and the number of node sequences is r, then the node readjustment process is: a. Initially set j = r; b. Loop and check whether the line between (vw1[i],vw1[j]) passes through the threat area, i∈[1,...,j-1]; if it passes through the threat area, let i=i+1; if it does not pass through the threat area, let j=i, and save vw1[j] as the readjusted track node; c. Repeat the above cycle until j=1, stop the cycle, and generate the adjusted track sequence v w2 [l], the number of adjusted node sequences is l; (4) Track search process. During the heuristic search, two tables, OPEN and CLOSE, are established. The OPEN table is used to store nodes that have been calculated but not expanded, and the CLOSE table is used to store nodes that have been expanded. The data storage structure is represented by {(xi, yi), fi, gi, hi, pi}, where (xi, yi) is the grid coordinate of the node, fi, gi, hi are the variable values of the cost function, and pi represents the parent node of the current node. The track search process is expressed as: a. Initialization; set the step size and obstacle area, initialize the OPEN and CLOSE tables, and put the starting point into the OPEN table as the current node; b. Node expansion and storage; if the neighboring node of the current node meets the constraint conditions and is not in the current OPEN and CLOSE tables, add the neighboring node to the OPEN table; move the node A with the lowest cost in the OPEN table to the CLOSE table; determine whether node A is the end point, if it is the end point, exit the node search, if not, continue node expansion; extract the initial track node sequence v w1 [r] from the CLOSE table, and use the cost function value of the end point as the estimated flight distance; c. Track node adjustment, initially set the initial track starting point in v w1 [r] as the adjustment starting point, and the initial track end point as the adjustment relay point; starting from the adjustment starting point, determine in turn whether the line connecting each track point in v w1 [r] and the adjustment relay point passes through the obstacle area; If the line connecting the adjustment starting point and the adjustment relay point passes through the obstacle, the next point of the current adjustment starting point is updated to the adjustment starting point, and the judgment is continued to determine whether it passes through the obstacle; if the line connecting the adjustment starting point and the adjustment relay point does not pass through the obstacle, the current adjustment relay point is saved as a route point after the track adjustment, and the current adjustment starting point is updated to the adjustment relay point, and the judgment is continued in a loop; until the current adjustment relay point is the starting point, the loop is stopped, and the adjusted track sequence v w2 [l] is constructed by combining the various adjustment relay points.
3. The method for phased multi-base UAV task allocation and trajectory planning according to claim 1 is characterized in that: In the second step, when there are many tasks and they are concentrated in the area, a solution method based on target clustering is adopted, and the following steps are performed: The solution method based on target clustering includes three processing steps: target area clustering, cluster target allocation, and multi-UAV task allocation within the base; target area clustering is to achieve regional clustering of targets according to their geographical distribution and agglomeration characteristics; Cluster target allocation is to allocate each cluster target area to the nearest UAV base; The task allocation of multiple drones in the base is to achieve the target allocation of multiple drones in the drone base; By improving the K-means clustering target clustering, the multi-task allocation problem of multi-base UAVs is clustered and analyzed, and the target area clustering and cluster target allocation functions are realized. The targets are divided into task areas according to geographical distribution, and the task areas are allocated to the nearest UAV bases. The traditional K-means clustering algorithm is improved in terms of selecting the initial cluster center, applying the A* algorithm to estimate the distance, adding the total mission range constraint, and determining the corresponding base of the cluster target; the processing flow of the improved K-means clustering algorithm is specifically described as follows: a. Target clustering initialization: select K dispersed target points as initial cluster centers. According to the distribution of each location point on the GIS system, select K relatively dispersed targets as initial cluster centers. b. Determine the correspondence between the drone base and the target cluster, and assign the drone base to the nearest cluster center point; c. Circular target clustering, based on the range cost, the distance from each target point to each cluster center is calculated cyclically, and each target is classified into the target area class with the closest distance. When a cluster target sequence is randomly selected, and the total range between it and the corresponding base exceeds the maximum range of all drones in the base, a target closest to the center of the adjacent target cluster is selected from the target class and added to the adjacent target cluster. d. Update the target cluster center point, calculate the region centroid position based on the average distance value of all data points, and adjust the cluster center to the central target point of each regional class; e. Repeat b, c, and d until the cluster center no longer changes or the maximum number of iterations is reached; For task allocation within a single base, if a single drone can complete the task, the single drone will be used first; if a single drone cannot complete all tasks, it is necessary to estimate the number of drones k required based on the total range of the mission and the maximum range of a single drone, and then use the clustering method to allocate tasks again according to the number of drones.
4. The method for phased multi-base UAV task allocation and trajectory planning according to claim 1, characterized in that: In the second step, when the number of tasks is small and the evacuation distribution is sparse, a solution method based on depth traversal is adopted, and the following steps are performed: When the number of tasks is small and the evacuation distribution is sparse, the calculation scale is small. The distance is directly estimated according to the A* algorithm, and the deep traversal method is used for accurate task allocation. The nearest target is assigned to each base, and the objective function Z is expressed as d ij is the A* distance from drone i to target j. The constraints include: ① maximum range constraint, the total range of drones performing multiple tasks at a single base cannot exceed its maximum range L max ; ② task constraint, one drone at each base participates in the task, and each target has at least one drone to perform the task. The process of deep traversal accurate solution is expressed as: a. According to the number of the target sequence T, according to the objective function Z, start from the first target and loop in sequence; compare the distance between the target and each UAV base, and select the UAV base closest to the current target; loop and compare in sequence, and finally determine the UAV base sequence corresponding to the target sequence T, set as H = {H 1 ,H 2 ,H 3 ,…H m}; b. Based on the correspondence between sequences T and H, assign tasks to each UAV and obtain the task grouping corresponding to the w-th UAV as hw[k].
5. The method for phased multi-base UAV task allocation and trajectory planning according to claim 1, characterized in that: In the third step, when solving the TSP traveling salesman model for the time-series task allocation of a single UAV in the base, the following steps are performed: The A* algorithm is used to estimate the distance between the take-off point of the UAV and multiple mission target points. For the w-th UAV, its corresponding task group is hw[k], and the A* distance matrix is constructed as pw[k][k], where k is the corresponding task number of the w-th UAV, the starting point and the end point are the UAV base, 1, 2 to k represent the target sequence number, and the objective function R is expressed as: hij is the A* distance of the UAV from target i to target j, and cij∈{0,1} is the decision variable; If the time series task allocation scale is small, the depth traversal method is used to cyclically compare any possible solution to accurately obtain the optimal solution. If the time series task allocation scale is large and the exact algorithm solution is too large, the genetic algorithm is used. The processing flow based on the genetic algorithm solution is expressed as follows: a. Initialization: initially set the population size, individual length, number of iterations, crossover and mutation probabilities; a single chromosome is the target number sequence with a length of k; b. Initial population, randomly generate the initial population of target sequences; c. Genetic operation: selection operation, calculate the fitness value according to the objective function R, select chromosomes according to the fitness value, and adopt the roulette method to select. The larger the fitness value, the greater the probability of being selected; crossover operation, using the permutation crossover method, randomly select a gene fragment from the two parents to exchange; mutation operation, two genes on a chromosome are exchanged with a certain probability to generate a new individual; d. Optimal operation: select excellent individuals from the parent group and the child group, and eliminate individuals with poor fitness. If the optimal individual does not meet the requirements or the number of iterations is not reached, continue to perform selection, crossover, and mutation operations; otherwise, stop the cycle; and finally generate the optimal task number sequence; the time sequence target sequence of the w-th UAV is represented by uw [k], where k is the number of time sequence tasks.
6. The method for phased multi-base UAV task allocation and trajectory planning according to claim 1, characterized in that: In the step S1, when performing regional settings, follow the steps below: The first step is regional planning. In the geographic information system, click to select and mark the locations of multiple bases and multiple tasks. Number each base and task in the order of clicking, determine the regional scope of task planning, set the maximum position Gaussian coordinate values of each base and task to X max and Y max respectively, set the minimum position Gaussian coordinate values to X min and Y min respectively, set the expansion distance value of the planning space to H, then the four vertices of the rectangular planning area can be determined to be (X min -H, Y min -H), (X min-H, Y max +H), (X max +H, Y max +H), (X min -H, Y max +H); discretize the two-dimensional planning space into grids, (X min -H, Y min -H) as the origin, set h as the grid side length, then the grid coordinates (xg , yg ) of any point (x, y) in the planning space are expressed as: The second step is threat setting. Based on basic geographic information and regional situation information, terrain, radar detection, air defense firepower, and no-fly zone flight threat areas are mapped in GIS. According to the characteristics of different threat models, threat areas are marked in the GIS system in different shapes such as circles, rectangles, and polygons by hand-drawing or annotation. The grid coordinates (x gt , y gt ) of the boundary of the threat area can be calculated to construct the threat area matrix G[x][y], where G[x gt ][y gt ] = 1 indicates that the grid is a threat grid, and G[x gt ][y gt ] = 0 indicates that the grid is not a threat grid.
7. The method for phased multi-base UAV task allocation and trajectory planning according to claim 1, characterized in that: In step S3, the track planning is performed according to the following steps: The first step is to optimize the trajectory. Based on the allocation scheme of multi-UAV task allocation and single-UAV sequential task allocation, the trajectory planning is performed based on the improved A* algorithm according to the task sequence of each UAV. The starting point of drone w, each mission point in the time sequence uw [k], and the recovery point of drone w constitute a track point sequence. Starting from the starting point, two consecutive time nodes in the track sequence are used as the start and end points of A* search in turn to obtain the initial track sequence vw1 [r] and the adjusted track sequence vw2 [l] between each consecutive node; vw2 [l] between any two consecutive time nodes are combined to finally form the total track vw3 [q] of the wth drone, and the total number of track points is q; The track points v w3 [q] of the UAV are converted into geographic coordinates and plotted on the geographic information system to obtain the UAV track map. The track points of each UAV are plotted in turn to obtain the track planning map of multiple bases and multiple UAVs. The second step is track smoothing. The track drawn by track optimization is a broken line graph, which does not conform to the actual track. It is necessary to convert the broken line track into a smooth curve to obtain a track curve that meets the flight constraints. The track control points obtained based on A* track optimization are Pi (i=0,1,…,n). Cubic spline curves are used for smoothing. Each curve is determined by 4 consecutive adjacent track control points; and control points are added near each track point of v w3 [q], and then the curve smoothing operation is performed.
