Unmanned aerial vehicle path planning method and system based on ant colony optimization algorithm
Through the drone path planning method based on ant colony optimization algorithm, the drone path at the fire site is automatically calculated and compensated, which solves the complex problem of traditional drone operations and realizes automatic information collection of drones at forest fire sites.
Patent Information
- Application Number
- CN202510341764.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional drones collect information at forest fire scenes and require professional operators to operate throughout the process, which is complex and inconvenient for automated execution.
The drone path planning method based on ant colony optimization algorithm is adopted. By simulating the shortest path of the drone through the monitoring point, the simulated optimal path is output, and error compensation is performed in combination with the three-dimensional wind field model to obtain the optimal path to automatically control the drone to perform information collection tasks.
The drone information collection task can be automatically performed without professional operators, which improves operational convenience and efficiency and reduces human error.
Smart Images

Figure CN120215522A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of path planning, and more specifically, to a method and system for unmanned aerial vehicle path planning based on an ant colony optimization algorithm. Background Art
[0002] With the continuous development of unmanned aerial vehicle technology, the application of unmanned aerial vehicles has become more and more extensive, such as medical material delivery and environmental monitoring and analysis. Forest fires have always been one of the most serious disasters at present. For example, the Australian bushfires from 2019 to 2020 and the Chongqing mountain fires in 2022 have all caused huge losses. Collecting pictures of the fire scene by unmanned aerial vehicles and analyzing the fire situation are common means for unmanned aerial vehicles to be applied to forest fires. Since forest fires generally cover a large area and last for a long time, it is necessary to analyze the situation at the fire scene and perform corresponding fire extinguishing tasks. The traditional method is generally that an operator manually controls the unmanned aerial vehicle to collect information at the fire scene. This method requires professional unmanned aerial vehicle operators and also requires the operator to control the whole process, which is rather troublesome in actual implementation. Summary of the Invention
[0003] The present invention provides a method and system for unmanned aerial vehicle path planning based on an ant colony optimization algorithm. The shortest path for the unmanned aerial vehicle to pass through all monitoring points is simulated and calculated by the ant colony algorithm, and the simulated optimal path is output. Then, the simulated optimal path and the three-dimensional wind field model are sent into an error compensation model for processing to obtain the optimal path, and the unmanned aerial vehicle is controlled to automatically perform the information collection task according to this optimal path, without the need for professional personnel to operate, which is convenient to use.
[0004] A method for unmanned aerial vehicle path planning based on an ant colony optimization algorithm includes: Constructing a grid model of the fire scene, which specifically includes the following contents: obtaining a three-dimensional model of the forest area, taking the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, taking the horizontal right direction as the X-axis, taking the horizontal backward direction as the Y-axis, and taking the vertical direction as the Z-axis, dividing the entire coordinate system into grid cells, the size of the grid cell is (N x , N y , N z , ), the total number of grid cells is (L / N x ) × (W / N y ) × (H / N z ), where L is the length of the three-dimensional model of the forest area, N x is the maximum length of the unmanned aerial vehicle, W is the width of the three-dimensional model of the forest area, N y is the maximum width of the unmanned aerial vehicle, H is the height of the three-dimensional model of the forest area, and N z is the maximum thickness of the unmanned aerial vehicle; recording the coordinates of each grid cell as (x, y, z); Number the grid cells according to the following rules: Obtain the coordinates (x, y, z) corresponding to the grid cell, then the number corresponding to this grid cell , and μ ∈ {1, 2, 3 ······ }; Assign a feasibility value to the grid cells according to the three-dimensional model of the forest area and establish an obstacle set. The specific steps are as follows: Obtain the grid cells one by one, and map them to the three-dimensional model of the forest area according to the coordinates corresponding to this grid cell. If there is an obstacle at the corresponding position of the three-dimensional model of the forest area, assign a feasibility value of 0 to this grid cell; otherwise, assign a feasibility value of 1 to this grid cell; form an obstacle set ε with the coordinates of all grid cells with a feasibility value of 0; Determine the number T of the kth monitoring point k , k = 1, 2, 3 ······ K, where K is the total number of monitoring points, and T k ∈ {1, 2, 3 ······ }, where T1 is the grid cell from which the UAV departs, and T K is the grid cell where the UAV is to reach the destination. The monitoring points are fixed positions that the UAV needs to pass through when performing information collection tasks; Determine the number U of the rth ignition point r , r = 1, 2, 3 ······ R, where R is the total number of ignition points, and U r ∈ {1, 2, 3 ······ }, and the ignition point is the position where the fire is too large at the fire scene; Based on the grid model of the fire scene, the obstacle set ε, the monitoring points, and the ignition points, calculate the simulated optimal path according to the improved ant colony algorithm, and send the simulated optimal path and the three-dimensional wind field model into the error compensation model for processing to obtain the optimal path, and control the UAV to perform automatic inspection and information collection tasks according to the optimal path to analyze the situation of the fire scene.
[0005] As a preferred aspect of the present invention, calculating the simulated optimal path according to the improved ant colony algorithm specifically includes the following steps: S1: Set the maximum number of iterations G; Let g = 1, and g is used to record the number of iterations; S2: Place M ants in the grid cell T1 from which the UAV departs; S3: Simulate the paths of the M ants in parallel and output the path set and all path segments ESg m(T p , T w ), where m is the number corresponding to the ant, m ∈ {1, 2, 3 ······ M}, and the path segment ESg m(T p , T w ) refers to the adjacent two monitoring points T p and Tw The set of grid cell numbers between; S4: Continuously obtain the set of output paths The number φ of, if "φ≥f1M", stop the current path simulation, where f1 is the threshold of the number of path sets; put all the output path sets The corresponding ant number m into the task completion number set finish(g), and put the ant number m that satisfies the condition "m∈{1, 2, 3······M}&m∉finish(g)" into the task unfinished number set unfinish(g); and put all the path segments (T p , T w ) into the set of segments to be recombined Recombinant(g); S5: Denote the numbers in the path set as , , is the total number of numbers in the path set , represents the th number in the path set , calculate the fitness values corresponding to all the output path sets , refers to the Euclidean distance between the grid cell corresponding to the number and the grid cell corresponding to , select the path set corresponding to the minimum fitness value as the optimal output path, and denote this optimal output path as , where v is the ant number corresponding to the optimal output path; S6: Obtain the optimal output path , and obtain the optimal monitoring point traversal order set ψ(g) according to the optimal output path . The optimal monitoring point traversal order set ψ(g) is the numbers of all the monitoring points arranged in order in the optimal output path . Construct the recombinant path RL a (g), where a = 1, 2, 3·······A, and A is the total number of the recombinant path RL a (g); S7: Denote the numbers in the recombinant path RL a (g) as ξ a,n , where n = 1, 2, 3······N, and N is the total number of the recombinant path RLa The total number of numbers numbered in (g), ξ a,n represents the recombination path RL a The nth number in (g), calculate the fitness value ρ of each recombination path RL a The fitness value ρ of (g) a , refers to the number The Euclidean distance between the corresponding grid cells and The corresponding grid cells, and according to the recombination path RL a The fitness value ρ of (g) a Calculate the recombination path RL a The selection probability of (g) , the formula is as follows: According to the selection probability And the roulette wheel selection algorithm selects φ recombination paths RL a from (g) a The selected φ recombination paths RL a in (g) and the φ output path sets Lg m form the simulated path parent, and the selected φ recombination paths RL a in (g) and the φ output path sets are denoted as the parent simulation path FSM e in (g), e = 1, 2, 3 ······ 2φ; S8: Perform crossover operations on the parent simulation path FSM e in the simulated path parent to generate the simulated path offspring, and the simulated path offspring includes the offspring simulation path ZSM e in (g); S9: Denote the numbers in the offspring simulation path ZSM e in (g) as , is the total number of numbers in the offspring simulation path ZSM e in (g), represents the offspring simulation path ZSM e in (g) the th number, calculate the fitness value of the offspring simulation path ZSM e in (g), refers to the number The Euclidean distance between the corresponding grid cells and The corresponding grid cells, obtain the offspring simulation path ZSM with the smallest fitness value e in (g), denoted as the offspring simulation path , according to the offspring simulation path ZSM e in (g) perform global pheromone update, the formula is as follows: Among them is the pheromone volatilization factor, is the pheromone constant; S10: Select the optimal output path , the sub-simulation path and the simulation optimal path with the smallest fitness among the simulation optimal paths in the simulation optimal path library are used as the simulation optimal path to replace the simulation optimal path in the simulation optimal path library, and the simulation optimal path library is initially empty; S11: Determine whether "g < G" holds. If "g < G" holds, assign g + 1 to g and return to S2; if "g < G" does not hold, output the simulation optimal path in the simulation optimal path library.
[0006] As a preferred aspect of the present invention, M ants are used to perform path simulation in parallel, and the path set and all path segments are output. Specifically, it includes the following steps: S3.1: Establish a monitoring point set , the monitoring point set stores the numbers corresponding to all monitoring points except T1, and a path set is established. The path set initially includes the grid cell T1 where the drone departs; S3.2: Obtain the ant The number of the grid cell where the ant is currently located is denoted as i, , and the transition probability of the ant moving to the next grid cell is calculated through the following formula ;
[0007] where j is the number corresponding to the next grid cell that the ant moves to, is the pheromone intensity corresponding to the path between grid cell i and grid cell j, which is determined by the cooperation of the monitoring point and the ignition point; is the heuristic value, is the Euclidean distance between grid cell i and grid cell j; is the pheromone intensity influence factor, is the heuristic value influence factor; is the ant δ m the set of numbers of the grid cells that are allowed to be selected after the ant is used for traversing the numbers is the total number of elements in the set; is a random number between [0, 1], is the division constant; S3.3: Based on the transition probability , using the roulette wheel selection algorithm to select ants The next grid cell to move to is j, and the ant Move the current position to the grid cell corresponding to number j and judge Is it established? If yes Not true, add j to the path set , return to S3.2; if This monitoring point is recorded as T w , gather the monitoring points Medium T w Delete and create a path collection Get the path fragment , T p Point to the path collection Middle monitoring point T w The last monitoring point of Refers to the path collection The grid unit number set between two adjacent monitoring points in the input image is entered into S3.4; S3.4: Judgment Is it established? If yes Not true, return to S3.2; if Established, enter S3.5; S3.5: Determine whether "h=0" holds, where h is the path set The total number of elements currently. If "h=0" is not true, output all path fragments ; If "h=0" holds, output the path set .
[0008] As a preferred aspect of the present invention, the monitoring point and the ignition point are determined , specifically including the following steps: Get the monitoring point T k , ignition point U r ,calculate , the formula is as follows: in is the vector between the center of grid cell i and the center of grid cell j, For grid cells Center and grid cell The vector between the centers, is the vector between the centers of the grid cells; is the initial amount of pheromone; Update the ignition point according to the change of the fire situation, which specifically includes the following: Obtain the time-series dataset of the temperature change of grid cells. The time-series dataset of the temperature change of grid cells includes the temperature data of grid cells obtained at several monitoring time points. The temperature data of grid cells includes the coordinates and corresponding temperature values of all grid cells. Send the time-series dataset of the temperature change of grid cells into the analysis model of the temperature change of grid cells for processing, and output the predicted time-series dataset of the temperature change of grid cells. The predicted time-series dataset of the temperature change of grid cells includes several predicted temperature data of grid cells. Calculate the flight time TM of the drone corresponding to grid cell j j , according to the flight time TM of the drone j Determine the simulated grid cell temperature data when the drone is located in grid cell j from the predicted time-series dataset of the temperature change of grid cells. The simulated grid cell temperature data includes the coordinates and corresponding temperature values of all grid cells. Traverse the grid cells in the simulated grid cell temperature data. If the temperature value corresponding to the grid cell is higher than the temperature threshold, mark the grid cell as the ignition point. If the temperature value corresponding to the grid cell is not higher than the temperature threshold, do not mark the grid cell as the ignition point.
[0009] As a preferred aspect of the present invention The establishment of includes the following steps: Obtain grid cell i, then form the surrounding number set around by all the numbers from (i - 13) to (i + 13) i , and then the surrounding number set around i Remove the elements in the intersection of and the obstacle set ε from the surrounding number set around i to form .
[0010] As a preferred aspect of the present invention, construct the recombinant path RL a (g) according to the optimal monitoring point traversal order set ψ(g) and the fragment set to be recombined Recombinant(g), including the following steps: Traverse the optimal monitoring point traversal order set ψ(g) in sequence. For every two adjacent monitoring points T p and T w , randomly select the corresponding path segment ESg m(T p , T w ) from the fragment set to be recombined Recombinant(g), and construct the recombinant path RL a (g).
[0011] As a preferred aspect of the present invention, the crossover operation includes the following steps: Set the crossover probability P c , randomly select two parent simulation paths FSM e (g), and generate a random number. If the random number is less than the crossover probability Pc Then, the two selected parent simulation path FSMs e (g) are crossed, and during the crossing, the path segments with the same monitoring points at both ends in the two selected parent simulation path FSMs e (g) are replaced; if the random number is not less than the crossover probability P c , then no crossover operation is performed.
[0012] As a preferred aspect of the present invention, the error compensation model includes a wind field distribution feature extraction layer, a path reconstruction layer, a wind field influence correction layer, an input layer, a hidden layer, and an output layer. The wind field distribution feature extraction layer is used to extract features from the three-dimensional wind field model through a 3D convolutional kernel to construct wind field distribution features; the path reconstruction layer is used to traverse the grid cells in the simulated optimal path. For each grid cell, determine the coordinates of the grid cell and the wind field vector corresponding to the grid cell from the three-dimensional wind field model, and add the corresponding wind field vector at the end of the coordinates of the grid cell to construct a grid cell vector. Then, splice all the grid cell vectors corresponding to the grid cells in the order of the simulated optimal path from top to bottom to construct a path feature map; the wind field influence correction layer is used to perform a self-attention mechanism on the path feature map based on the wind field distribution features to output a corrected path feature map; the input layer is used to receive the corrected path feature map; the hidden layer is used to perform a fully connected process on the corrected path feature map to obtain the optimal path; the output layer is used to output the optimal path.
[0013] An unmanned aerial vehicle path planning system based on an ant colony optimization algorithm, comprising: A fire scene grid model construction module, used to construct a fire scene grid model, specifically including the following content: obtaining a three-dimensional model of the forest area, using the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, using the horizontal right as the X-axis, using the horizontal backward as the Y-axis, and using the vertical direction as the Z-axis, and dividing the entire coordinate system into grid cells; A grid cell numbering module, used to number the grid cells; An obstacle set establishment module, used to assign a feasibility value to the grid cells according to the three-dimensional model of the forest area and establish an obstacle set; A monitoring point determination module, used to determine the monitoring points; A fire point determination module, used to determine the fire point and update the fire point; An optimal path calculation module, used to calculate the simulated optimal path through the fire scene grid model, the obstacle set ε, the monitoring points, and the fire point, and send the simulated optimal path and the three-dimensional wind field model into the error compensation model for processing to obtain the optimal path.
[0014] The present invention has the following advantages: 1. The present invention simulates and calculates the shortest path for a drone to pass through all monitoring points by using the ant colony algorithm, outputs the simulated optimal path, and sends the simulated optimal path and the three-dimensional wind field model into an error compensation model for processing to obtain the optimal path, and controls the drone to automatically execute the information collection task based on this optimal path, without the need for professional operation, which is convenient to use.
[0015] 2. The present invention adjusts the pheromone distribution between grid cell i and grid cell j by calculating the coincidence amplitude between the path between grid cell i and grid cell j and the straight-line path between the starting point and the destination, so that the pheromone towards the destination is higher and the pheromone deviating from the destination is lower, guiding the ants towards the destination and avoiding too high randomness and too long simulation time during path simulation; by combining the coincidence amplitude between the path between grid cell i and grid cell j and the path between grid cell i and the ignition point, the pheromone distribution between grid cell i and grid cell j is adjusted, so that the ants stay away from the ignition point during path simulation, avoiding the thick smoke caused by the large fire from affecting the use of the drone.
[0016] 3. The present invention combines the genetic algorithm and performs crossover replacement on the simulated path according to path segments, enabling the path simulation to break out of the limitation of pheromone, thus avoiding falling into a local optimal solution during the simulation process, and quickly updating the pheromone distribution through the genetic algorithm to avoid too long simulation time caused by slow pheromone update in the initial stage of the ant colony algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic structural diagram of a drone path planning system based on the ant colony optimization algorithm adopted in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0019] Embodiment 1, a drone path planning method based on the ant colony optimization algorithm, includes: Construct a grid model of the fire scene, specifically including the following content: Obtain the three-dimensional model of the forest area. It should be noted that for general forests, the forestry bureau will scan the terrain in advance by using a drone to generate a geographical three-dimensional model of the corresponding area, and this part of the geographical three-dimensional model can be used as the three-dimensional model of the forest area to generate the grid model of the fire scene; Take the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, take the horizontal right direction as the X-axis, take the horizontal backward direction as the Y-axis, and take the vertical direction as the Z-axis, and divide the entire coordinate system into grid cells, and the size of the grid cells is (N x , N y, N z ), the total number of grid cells is (L / N x ) × (W / N y ) × (H / N z ), where L is the length of the three - dimensional model of the forest area, N x is the maximum length of the UAV, W is the width of the three - dimensional model of the forest area, N y is the maximum width of the UAV, H is the height of the three - dimensional model of the forest area, N z is the maximum thickness of the UAV, that is, the coordinate axis X is drawn lines at intervals of length N x , the coordinate axis Y is drawn lines at intervals of length N y , the coordinate axis Z is drawn lines at intervals of length N z , and the cube formed by the lines is the grid cell; record the coordinates of each grid cell as (x, y, z). It should be noted that the x value in the grid cell coordinates refers to the corresponding number of the part between the lines after the X - axis is drawn. For example, if L is 100 and N x is 2, then the corresponding x value on the X - axis ranges from 0 to 50.
[0020] Number the grid cells, and the numbering rule is as follows: Obtain the coordinates (x, y, z) corresponding to the grid cell, then the number corresponding to this grid cell and μ ∈ {1, 2, 3 ······ }}; Assign a feasibility value to the grid cells according to the three - dimensional model of the forest area and establish an obstacle set. The specific steps are as follows: Obtain each grid cell one by one, and map it to the three - dimensional model of the forest area according to the coordinates corresponding to this grid cell. If there are obstacles at the corresponding position of the three - dimensional model of the forest area, such as tree tops, etc., then assign the feasibility value of this grid cell to 0; otherwise, assign the feasibility value of this grid cell to 1; form the obstacle set ε with the coordinates of all grid cells with a feasibility value of 0; Determine the number T of the k - th monitoring point k , k = 1, 2, 3 ······ K, where K is the total number of monitoring points, , where T1 is the grid cell from which the UAV departs, T K is the grid cell where the UAV is to reach the destination. The monitoring points are fixed positions that the UAV needs to pass through when performing the information collection task, and are set by the operator; Determine the number U of the r - th ignition point r , r = 1, 2, 3 ······ R, where R is the total number of ignition points, , The ignition point is the location where the fire is too large at the fire scene. Since the thick smoke caused by the large fire will affect the use of the drone, before the drone performs the automatic inspection and collection task, the operator controls the drone to scan the fire scene and determine the location of the ignition point. Generally, it is determined by whether the temperature value corresponding to the grid unit is higher than the temperature threshold. The temperature threshold is determined by the staff, and the smoke concentration is characterized by the temperature; Based on the grid model of the fire scene, the obstacle set ε, the monitoring points, and the ignition point, the simulated optimal path is calculated according to the improved ant colony algorithm, and the simulated optimal path and the three-dimensional wind field model are sent into the error compensation model for processing to obtain the optimal path, and the drone is controlled to perform the automatic inspection and information collection tasks according to the optimal path, and the situation of the fire scene is analyzed.
[0021] The shortest path for the drone to pass through all monitoring points is simulated and calculated by the ant colony algorithm, and the simulated optimal path is output. Then, the simulated optimal path and the three-dimensional wind field model are sent into the error compensation model for processing to obtain the optimal path, and the drone is controlled to automatically perform the information collection task according to this simulated optimal path, without the need for professional personnel to operate, which is convenient to use.
[0022] Calculating the simulated optimal path according to the improved ant colony algorithm specifically includes the following steps: S1: Set the maximum number of iterations G; Let g = 1, and g is used to record the number of iterations; S2: Place M ants in the grid unit T1 where the drone starts; S3: Simulate the paths of the M ants in parallel and output the path set and all path segments (T p , T w ), where m is the number corresponding to the ant, m ∈ {1, 2, 3 ······ M}, and the path segment (T p , T w ) refers to the set of grid unit numbers between two adjacent monitoring points T p and T w . It should be noted that, for example, a path set is {1, 7, 5, 11, 13, 19, 25 ···}, where 1 and 13 are the numbers corresponding to the monitoring points, then 1 and 13 are adjacent monitoring points, and {1, 7, 5, 11, 13} is a path segment. Simulate the paths of the M ants in parallel and output the path set and all path segments (T p , T w ), which specifically includes the following steps: S3.1: Establish a set of monitoring points , the set of monitoring points Store the numbers corresponding to all monitoring points except T1, and establish a path set , the path set Initially includes the grid cell T1 where the UAV departs; S3.2: Obtain the ant The number of the grid cell where the ant is currently located is denoted as i, , and calculate the transition probability of the ant moving to the next grid cell through the following formula ;
[0023] where j is the number corresponding to the next grid cell that the ant moves to, is the pheromone intensity corresponding to the path between grid cell i and grid cell j, which is determined by the cooperation of the monitoring point and the ignition point; is the heuristic value, used to simulate the tendency intensity of the ant moving from grid cell i to grid cell j, usually set to is the Euclidean distance between grid cell i and grid cell j; is the pheromone intensity influence factor, is the heuristic value influence factor; is the ant δ m , the set of numbers of the grid cells that are allowed to be selected after the ant moves, used for traversing the numbers ; is the total number of elements in the set; q is a random number between [0, 1], is the partition constant, set by the user; when , calculate the transition probability according to the pheromone intensity and the heuristic value ; when , according to the total number of elements in the set to calculate the transition probability , so by increasing the selection direction of the path, it can avoid the algorithm from converging too quickly and falling into the local optimal solution; at the same time, when the next grid cell that the ant moves to is a monitoring point or the destination, directly select this grid cell to move, ensuring that the process of the ant moving can traverse all monitoring points; Determined by the cooperation of the monitoring point and the ignition point , specifically including the following steps: Obtain the monitoring point T k , the ignition point U r , calculate , the formula is as follows:
[0024] Among them is the vector formed between the center of grid cell i and the center of grid cell j, is the grid cell center and the grid cell is the vector formed between the centers; is the grid cell center and the grid cell is the vector formed between the centers; is the initial amount of pheromone; in this application, by calculating the coincidence amplitude between the path between grid cell i and grid cell j and the straight-line path between the starting point and the destination, the pheromone distribution between grid cell i and grid cell j is adjusted, so that the pheromone towards the destination is higher and the pheromone deviating from the destination is lower, guiding the ants towards the destination and avoiding too high randomness and too long simulation time when the ants simulate the path; by combining the coincidence amplitude between the path between grid cell i and grid cell j and the path between grid cell i and the ignition point, the pheromone distribution between grid cell i and grid cell j is adjusted, so that the ants stay away from the ignition point when simulating the path and avoid the thick smoke caused by the large fire from affecting the use of the UAV; Update the ignition point according to the change of the fire situation, which specifically includes the following content: obtain the grid cell temperature change time series data set, which includes the grid cell temperature data obtained at several monitoring time points. The grid cell temperature data includes the coordinates and corresponding temperature values of all grid cells. It should be noted here that the grid cell temperature change time series data set is historical data collected before the UAV executes the flight mission and can be realized by infrared scanning. Send the grid cell temperature change time series data set into the grid cell temperature change analysis model for processing to output the predicted grid cell temperature change time series data set. The grid cell temperature change analysis model here is set based on the LSTM model and is pre-trained through the collected historical data. The training process is prior art and will not be elaborated here. The predicted grid cell temperature change time series data set includes several predicted grid cell temperature data, and calculate the UAV flight time TM j of the grid cell j, which can be calculated by dividing the path distance to the grid cell j by the average speed of the UAV. According to the UAV flight time TM jDetermine the simulated grid cell temperature data when the UAV is located in grid cell j from the predicted grid cell temperature change time series dataset. Considering that the predicted grid cell temperature change time series dataset corresponds to the predicted grid cell temperature data at several discrete time points, the simulated grid cell temperature data can be estimated by interpolation. The simulated grid cell temperature data includes the coordinates of all grid cells and the corresponding temperature values. Traverse the grid cells in the simulated grid cell temperature data. If the temperature value corresponding to a grid cell is higher than the temperature threshold, mark the grid cell as a fire point; if the temperature value corresponding to a grid cell is not higher than the temperature threshold, do not mark the grid cell as a fire point.
[0025] The establishment includes the following steps: Obtain grid cell i, and then form the surrounding number set around by all numbers from (i - 13) to (i + 13). i , and then the surrounding number set around i Remove the elements in the intersection of and the obstacle set ε from the surrounding number set around i to form .
[0026] S3.3: According to the transition probability , use the roulette wheel selection algorithm to select the next grid cell for the ant to move to, denoted as j, and move the current position of the ant to the grid cell corresponding to the number j, and judge whether it holds. If does not hold, it means that the ant has not reached the monitoring point yet. Add j to the path set , and return to S3.2; if holds, it means that the ant has reached the monitoring point. Denote this monitoring point as T w , delete T from the monitoring point set, and obtain the path segment w from the established path set where (T p , T w ), T p refers to the previous monitoring point of the monitoring point T in the path set, and the path segment w (T (T p , T w ) refers to the set of grid cell numbers between two adjacent monitoring points in the path set , and enter S3.4; S3.4: Judge whether it holds. If Not true, indicating that ants The destination has not been reached yet, return to S3.2; if Established, indicating that ants Having reached the destination, enter S3.5; S3.5: Determine whether "h=0" holds, where h is the path set The total number of elements at the moment. If "h=0" does not hold, it means that the ant Without traversing all monitoring points, all path segments are output (T p , T w ); if "h=0" holds, it means that the ant Traverse all monitoring points and output path set ; S4: Continuously obtain the output path set If the number of ants is φ, stop the path simulation, where f1 is the path set number threshold, which is generally 0.5. Since it is impossible to ensure that each ant can simulate a complete path during the path simulation with M ants, or the time to simulate a complete path is too long, this application stops the path simulation when the output path set exceeds the general number of ants to avoid too long simulation time; all output path sets are The corresponding ant number m is stored in the task completion number set finish(g), and the ant number m that satisfies the condition "m∈{1, 2, 3······M}&m∉finish(g)" is stored in the task unfinished number set unfinish(g); and all path fragments corresponding to the ant number m that satisfies the condition "m∈unfinish(g)" are (T p , T w ) is stored in the fragment set to be recombined Recombinant (g); S5: Path collection The number in is recorded as A collection of paths The total number of numbers in Represents a set of paths The first Number, calculate the path set of all outputs The corresponding fitness value is Refer to the number The corresponding grid cells and The Euclidean distance between the corresponding grid cells, select the minimum fitness value The corresponding path set As the optimal output path, this optimal output path is recorded as , where v is the ant number corresponding to the optimal output path; S6: Obtain the optimal output path , and according to the optimal output path obtain the optimal monitoring point traversal order set ψ(g). The optimal monitoring point traversal order set ψ(g) is the numbers of all monitoring points arranged in order in the optimal output path . Construct the recombinant path RL a (g), a = 1, 2, 3 ······ A, where A is the total number of recombinant paths RL a (g); Construct the recombinant path RL a (g) as follows: Traverse the optimal monitoring point traversal order set ψ(g) in sequence. For every two adjacent monitoring points T p and T w , randomly select the corresponding path segment from the recombinant fragment set Recombinant(g) to construct the recombinant path RL a (g). For example, if the optimal monitoring point traversal order set ψ(g) is {1, 8, 15, 26}, then sequentially select the path segments with both ends being (1, 8), (8, 15), and (15, 26) from the recombinant fragment set Recombinant(g) and fill them in to construct a complete recombinant path; S7: Denote the numbers in the recombinant path RL a (g) as ξ a,n , n = 1, 2, 3 ······ N, where N is the total number of numbers in the recombinant path RL a (g). ξ a,n represents the nth number in the recombinant path RL a (g). Calculate the fitness value ρ a of each recombinant path RL a , , which refers to the Euclidean distance between the grid cell corresponding to the number and the grid cell corresponding to . And calculate the selection probability a of the recombinant path RL a (g) according to the fitness value ρ a of the recombinant path RL . The formula is as follows:
[0027] According to the selection probability and the roulette wheel selection algorithm, select from the recombinant path RL aSelect φ recombination paths RL from (g). a (g), and the selected φ recombination paths RL a (g) and the φ output path sets constitute the simulated path parent, and the selected φ recombination paths RL a (g) and the φ output path sets are denoted as the parent simulated path FSM e (g), e = 1, 2, 3 ······ 2φ; S8: Perform crossover operation on the parent simulated path FSM e (g) in the simulated path parent to generate the simulated path offspring, and the simulated path offspring includes the offspring simulated path ZSM e (g); It should be noted that the crossover operation generally includes the following steps: Set the crossover probability P c , randomly select two parent simulated paths FSM e (g), and generate a random number. If the random number is less than the crossover probability P c , then perform crossover on the selected two parent simulated paths FSM e (g), and replace the path segments with the same end monitoring points in the selected two parent simulated paths FSM e (g) during crossover; if the random number is not less than the crossover probability P c , then no crossover operation is performed; S9: Denote the numbers in the offspring simulated path ZSM e as is the total number of numbers in the offspring simulated path ZSM e (g), represents the e th number in the offspring simulated path ZSM (g), calculate the fitness value of the offspring simulated path ZSM e (g) refers to the Euclidean distance between the grid cell corresponding to the number and the grid cell corresponding to , obtain the offspring simulated path ZSM with the smallest fitness value e (g), denoted as the offspring simulated path , perform global pheromone update according to the offspring simulated path ZSM e (g), and the formula is as follows:
[0028] where is the pheromone evaporation factor, is the pheromone constant; To avoid falling into a local optimal solution, a range can also be set for the pheromone intensity; S10: Select the optimal output path , the sub-simulation path and the simulation optimal path with the minimum fitness among the simulation optimal paths in the simulation optimal path library is used as the simulation optimal path to replace the simulation optimal path in the simulation optimal path library. The simulation optimal path library is initially empty; S11: Determine whether "g < G" holds. If "g < G" holds, it means that the maximum number of iterations has not been reached. Assign g + 1 to g and return to S2. If "g < G" does not hold, it means that the maximum number of iterations has been reached, and the simulation optimal path in the simulation optimal path library is output.
[0029] This application combines the genetic algorithm and performs cross-replacement on the simulation paths according to path segments, enabling the path simulation to break out of the pheromone limitation, thereby avoiding falling into a local optimal solution during the simulation process. Moreover, the genetic algorithm is used to quickly update the pheromone distribution, avoiding the problem of slow pheromone update in the initial stage of the ant colony algorithm, which may lead to too long simulation time.
[0030] The error compensation model includes a wind field distribution feature extraction layer, a path reconstruction layer, a wind field influence correction layer, an input layer, a hidden layer, and an output layer. The wind field distribution feature extraction layer is used to extract features from the three-dimensional wind field model through 3D convolutional kernels to construct wind field distribution features; the path reconstruction layer is used to traverse the grid cells in the simulation optimal path. For each grid cell, determine the coordinates of the grid cell and the wind field vector corresponding to the grid cell from the three-dimensional wind field model, and add the corresponding wind field vector at the end of the coordinates of the grid cell to construct a grid cell vector. Then, splice all the grid cell vectors corresponding to the grid cells in the order of the simulation optimal path from top to bottom to construct a path feature map; the wind field influence correction layer is used to perform a self-attention mechanism on the path feature map based on the wind field distribution features to output a corrected path feature map; the input layer is used to receive the corrected path feature map; the hidden layer is used to perform a fully connected process on the corrected path feature map to obtain the optimal path; the output layer is used to output the optimal path; It should be noted that the three-dimensional wind field model here is obtained through lidar and includes the wind field vectors corresponding to each grid cell in the fire scene grid model. The wind field vector generally consists of wind speed and wind direction. Performing a self-attention mechanism on the path feature map based on the wind field distribution features specifically means constructing a corresponding value vector and key vector based on the path feature map and constructing a query vector based on the wind field distribution features. The specific operation refers to the Transformer model. The difference is that when the Transformer model performs a self-attention mechanism, it constructs a value vector, a key vector, and a query vector based on the feature map itself, and each neuron in the input layer will receive a row in the corrected path feature map; The simulated optimal path is processed by an error compensation model, which can correct the flight path error caused by the influence of the wind field on the UAV flight, and ensure the accuracy and stability of the UAV flight; Train the error compensation model, which specifically includes the following steps: Obtain the simulated path training samples. Here, the simulated path training samples refer to the simulated optimal path obtained when setting up the fire scene grid model, obstacle set ε, monitoring points, and ignition points through 3D simulation engines such as Unity / UnrealEngine, as well as the set 3D wind field model. Label the simulated path training samples through the optimal path. Here, the optimal path is the UAV flight path manually designed by the operator according to the set fire scene grid model, obstacle set ε, monitoring points, ignition points, and 3D wind field model. Combine all the labeled simulated path training samples into a simulated path training set, and train the error compensation model through the simulated path training set. The training method uses optimized cross-entropy loss.
[0031] Embodiment 2, a UAV path planning system based on the ant colony optimization algorithm, as Figure 1 shown, includes: A fire scene grid model construction module, used to construct a fire scene grid model, specifically including the following content: Obtain the three-dimensional model of the forest area, use the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, use the horizontal right as the X-axis, use the horizontal backward as the Y-axis, and use the vertical direction as the Z-axis, and divide the entire coordinate system into grid cells; A grid cell numbering module, used to number the grid cells; An obstacle set establishment module, used to assign feasibility values to the grid cells according to the three-dimensional model of the forest area and establish an obstacle set; A monitoring point determination module, used to determine the monitoring points; An ignition point determination module, used to determine the ignition point and update the ignition point; An optimal path calculation module, used to calculate the simulated optimal path through the fire scene grid model, obstacle set ε, monitoring points, and ignition points, and according to the improved ant colony algorithm.
[0032] It should be understood that for those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention. The parts not described in detail in this specification belong to the prior art well-known to those of ordinary skill in the art.
Claims
1. A UAV path planning method based on ant colony optimization algorithm, characterized in that: include: Based on the fire scene grid model, obstacle set ε, monitoring points and ignition points, the optimal path is calculated and simulated according to the improved ant colony algorithm, and the simulated optimal path and the three-dimensional wind field model are sent to the error compensation model for processing to obtain the optimal path, and the drone is controlled to perform automatic inspection and information collection tasks according to the optimal path to analyze the situation at the fire scene; the fire scene grid model includes several grid units; the error compensation model is established based on a multi-layer perceptron, and a wind field influence correction layer is set to correct the simulated optimal path according to the three-dimensional wind field model; In the process of calculating and simulating the optimal path by the improved ant colony algorithm, the improvements are reflected in: the pheromones between two adjacent grid cells on the simulated path are redistributed by the overlap between the direction between the two adjacent grid cells and the direction between the starting point and the destination, and the pheromones between two adjacent grid cells on the path are redistributed by the overlap between the direction between the two adjacent grid cells and the direction between the grid cell and the fire point; the path segments on the simulated path are cross-replaced by a genetic algorithm; and the fire point is updated according to the changes in the fire intensity.
2. The method for UAV path planning based on ant colony optimization algorithm according to claim 1, characterized in that: The construction of the fire scene grid model specifically includes the following contents: obtain the three-dimensional model of the forest area, take the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, take the horizontal right as the X-axis, the horizontal backward as the Y-axis, and the vertical direction as the Z-axis, and divide the entire coordinate system into grid units. The size of the grid unit is (Nx, Ny, Nz,), and the total number of grid units is (L / Nx)×(W / Ny)×(H / Nz), where L is the length of the three-dimensional model of the forest area, Nx is the maximum length of the drone, W is the width of the three-dimensional model of the forest area, Ny is the maximum width of the drone, H is the height of the three-dimensional model of the forest area, and Nz is the maximum thickness of the drone; mark the coordinates of each grid unit as (x, y, z); The numbering rule of the grid cell is as follows: get the coordinates (x, y, z) corresponding to the grid cell, then the number corresponding to this grid cell is μ=x+(y-1)L / N_x +(z-1)L^2 / (N_x N_y ), and μ∈{1, 2, 3·····L^3 / (N_x N_y N_z )}; The obstacle set is constructed through the following specific steps: obtain grid cells one by one, and map the coordinates corresponding to the grid cells to the three-dimensional model of the forest area. If there is an obstacle at the corresponding position of the three-dimensional model of the forest area, the feasibility of the grid cell is assigned to 0; otherwise, the feasibility of the grid cell is assigned to 1; all grid cell coordinates with a feasibility of 0 are combined into an obstacle set ε; Determine the number Tk of the kth monitoring point, k=1, 2, 3·····K, K is the total number of monitoring points, Tk∈{1, 2, 3·····L^3 / (N_x N_y N_z )}, where T1 is the grid unit from which the UAV departs, TK is the grid unit where the UAV wants to reach its destination, and the monitoring point is the fixed position that the UAV needs to pass through when performing the information collection task; determine the number Ur of the rth fire point, r=1, 2, 3······R, R is the total number of fire points, Ur∈{1, 2, 3·····L^3 / (N_x N_y N_z )}, and the fire point is the location where the fire is too large at the fire scene.
3. The method for UAV path planning based on ant colony optimization algorithm according to claim 2 is characterized in that: The optimal path is calculated and simulated according to the improved ant colony algorithm, which specifically includes the following steps: S1: Set the maximum number of iterations G; let g=1, g is used to record the number of iterations; S2: Set M ants to be placed in the grid cell T1 where the drone starts; S3: Simulate the paths of M ants in parallel and output a set of paths and all path segments , m is the number corresponding to the ant, m∈{1, 2, 3······M}, path segment Refers to two adjacent monitoring points T p and T w The set of grid cell numbers between ; S4: Continuously obtain the output path set If "φ≥f1M", stop the path simulation, where f1 is the path set number threshold; all output path sets The corresponding ant number m is stored in the task completion number set finish(g), and the ant number m that satisfies the condition "m∈{1, 2, 3······M}&m∉finish(g)" is stored in the task unfinished number set unfinish(g); and all path fragments corresponding to the ant number m that satisfies the condition "m∈unfinish(g)" are stored in the task unfinished number set Store the fragment set to be recombined Recombinant (g); S5: Path collection The number in is recorded as A collection of paths The total number of numbers in represents the path set Middle Numbers, calculate the path set of all outputs The corresponding fitness value Refer to the number The corresponding grid cells and The Euclidean distance between the corresponding grid cells, select the minimum fitness value The corresponding path set As the optimal output path, this optimal output path is recorded as , v is the ant number corresponding to the optimal output path; S6: Obtain the optimal output path , and according to the optimal output path Get the optimal monitoring point traversal order set ψ(g), which is the optimal output path The numbers of all monitoring points arranged in order in the , and the recombination path RL is constructed according to the optimal monitoring point traversal sequence set ψ(g) and the set of fragments to be recombined Recombinant(g) a (g), a=1, 2, 3·······A, A is the recombination path RL a (g) The total number of S7: Reorganize the path RL a The number in (g) is denoted by ξ a,n , n=1, 2, 3······N, N is the recombination path RL a The total number of numbers in (g), ξ a,n Recombination Path RL a For the nth number in (g), calculate each recombinant path RL in turn a The fitness value ρ of (g) a , Refer to the number The corresponding grid cells and The Euclidean distance between the corresponding grid cells and the reorganization path RL a The fitness value ρ of (g) a Calculate the recombination path RL a (g) The probability of selection , the formula is as follows: According to the probability of selection and roulette wheel selection algorithm from the reorganization path RL a (g) Select φ recombination paths RL a (g), and select the φ recombination paths RL a (g) Set of paths with φ outputs The simulated path parent is composed, and the selected φ recombination paths RL a (g) Set of paths with φ outputs Denoted as the parent simulation path FSM e (g), e=1, 2, 3······2φ; S8: The parent simulation path FSM in the simulation path parent e (g) After the crossover operation, a simulation path sub-book is generated, and the simulation path sub-book includes the sub-book simulation path ZSM e (g); S9: Sub-simulation path ZSM e The numbers in (g) are Simulate the path ZSM for the sub-sub e The total number of numbers in (g), Represents the sub-simulation path ZSM e (g) Number, calculate the sub-simulation path ZSM e (g) The fitness value Refers to the Euclidean distance between the grid cells corresponding to the numbers and the corresponding grid cells to obtain the fitness value Minimal Sub-simulation Path ZSM e (g), denoted as the sub-simulation path , according to the sub-simulation path ZSM e (g) Perform global pheromone update, the formula is as follows: in It is a pheromone volatile factor. is the pheromone constant; S10: Select the optimal output path , sub-simulation path and the simulated optimal path in the simulated optimal path library with the smallest fitness as the simulated optimal path to replace the simulated optimal path in the simulated optimal path library, and the simulated optimal path library is initially empty; S11: Determine whether "g<G" holds. If so, assign g+1 to g and return to S2; if not, output the simulated optimal path in the simulated optimal path library.
4. The method for UAV path planning based on ant colony optimization algorithm according to claim 3 is characterized in that: Simulate the paths of M ants in parallel and output a set of paths and all path segments , specifically including the following steps: S3.1: Establish a set of monitoring points , monitoring point set Store the numbers corresponding to all monitoring points except T1 and establish a path set , path collection Initially, it includes the grid cell T1 where the drone departs; S3.2: Get ants The number of the current grid cell is recorded as i, i∈{1, 2, 3... }, calculate ants by the following formula The transition probability of moving to the next grid cell ; Where j is an ant The number of the next grid cell to move. is the pheromone intensity corresponding to the path between grid unit i and grid unit j, which is determined by the coordination of monitoring point and ignition point; is the heuristic value, is the Euclidean distance between grid cell i and grid cell j; is the influencing factor of pheromone intensity, is the heuristic value impact factor; is the ant δ m The set of grid cell numbers that can be selected after moving. Used as a number traversal ; for The total number of elements in the collection; is a random number between [0,1], is the partition constant; S3.3: Based on the transition probability , using the roulette wheel selection algorithm to select ants The next grid cell to move to is j, and the ant The current position moves to the grid cell corresponding to number j, and determines Is it established? If so, Not true, add j to the path set , return to S3.2; if This monitoring point is recorded as T w , gather the monitoring points Medium T w Delete and create a path collection Get the path fragment , T p Point to the path collection Middle monitoring point T w The last monitoring point of Refers to the path collection The grid unit number set between two adjacent monitoring points in the input image is entered into S3.4; S3.4: Judgment Is it established? If so, Not true, return to S3.2; if Established, enter S3.5; S3.5: Determine whether "h=0" holds, where h is the path set The total number of elements currently. If "h=0" is not true, output all path fragments ; If "h=0" holds, output the path set .
5. The method for UAV path planning based on ant colony optimization algorithm according to claim 4 is characterized in that: Determined by coordination between monitoring point and ignition point , specifically including the following steps: Get the monitoring point T k , ignition point U r ,calculate , the formula is as follows: in is the vector between the center of grid cell i and the center of grid cell j, For grid cells Center and grid cell The vector between the centers, For grid cells Center and grid cell The vector between the centers; is the initial amount of pheromone; The ignition point is updated according to the change of fire intensity, which specifically includes the following contents: obtaining a grid cell temperature change time series data set, which includes grid cell temperature data obtained at several monitoring time points, and the grid cell temperature data includes the coordinates of all grid cells and the corresponding temperature values, sending the grid cell temperature change time series data set to the grid cell temperature change analysis model for processing, outputting a predicted grid cell temperature change time series data set, and the predicted grid cell temperature change time series data set includes several predicted grid cell temperature data, and calculating the UAV flight time TM corresponding to grid cell j. j , according to the drone flight time TM j The simulated grid cell temperature data when the UAV is located in grid cell j is determined from the predicted grid cell temperature change time series data set. The simulated grid cell temperature data includes the coordinates and corresponding temperature values of all grid cells. The grid cells in the simulated grid cell temperature data are traversed. If the temperature value corresponding to the grid cell is higher than the temperature threshold, the grid cell is recorded as a ignition point. If the temperature value corresponding to the grid cell is not higher than the temperature threshold, the grid cell is not recorded as a ignition point.
6. The method for UAV path planning based on ant colony optimization algorithm according to claim 5, characterized in that: The establishment of includes the following steps: Get grid cell i, then all numbers from (i-13) to (i+13) form the surrounding number set around i , and then set the surrounding numbers around i The elements in the intersection with the obstacle set ε are from the surrounding number set around i Remove, form .
7. The method for UAV path planning based on ant colony optimization algorithm according to claim 6, characterized in that: Construct the recombination path RL based on the optimal monitoring point traversal order set ψ(g) and the fragment set to be recombined Recombinant(g) a (g), including the following steps: traverse the optimal monitoring point traversal sequence set ψ (g) in turn, for every two adjacent monitoring points T p and T w , randomly select the corresponding path segment from the segment set to be recombined Recombinant (g) , construct the recombination path RL a (g).
8. The method for UAV path planning based on ant colony optimization algorithm according to claim 7, characterized in that: The crossover operation includes the following steps: setting the crossover probability P c , randomly select two parents to simulate the path FSM e (g) and generate a random number. If the random number is less than the crossover probability P c , then the two selected parent simulation paths FSM e (g) Perform crossover, during which the two selected parents will simulate the path FSM e (g) The path segments with the same monitoring points at both ends are replaced; if the random number is not less than the crossover probability P c , no crossover operation is performed.
9. The method for UAV path planning based on ant colony optimization algorithm according to claim 8, characterized in that: The error compensation model includes a wind field distribution feature extraction layer, a path reconstruction layer, a wind field impact correction layer, an input layer, a hidden layer and an output layer, wherein the wind field distribution feature extraction layer is used to extract features of the three-dimensional wind field model through a 3D convolution kernel to construct wind field distribution features; the path reconstruction layer is used to traverse the grid cells in the simulated optimal path, determine the coordinates of the grid cell for each grid cell and determine the wind field vector corresponding to the grid cell from the three-dimensional wind field model, and add the corresponding wind field vector to the end of the coordinates of the grid cell to construct a grid cell vector, and then splice the grid cell vectors corresponding to all grid cells from top to bottom in the order of simulating the optimal path to construct a path feature map; the wind field impact correction layer is used to perform a self-attention mechanism on the path feature map based on the wind field distribution features and output a corrected path feature map; the input layer is used to receive the corrected path feature map; the hidden layer is used to perform full-connection processing on the corrected path feature map to obtain the optimal path; the output layer is used to output the optimal path.
10. A UAV path planning system based on ant colony optimization algorithm, characterized in that: The system applies a drone path planning method based on an ant colony optimization algorithm as described in any one of claims 1 to 9, comprising: The fire scene grid model construction module is used to construct the fire scene grid model, which specifically includes the following contents: obtaining a three-dimensional model of the forest area, taking the lower left corner of the three-dimensional model of the forest area as the origin of the coordinate system, taking the horizontal right as the X axis, taking the horizontal backward as the Y axis, and taking the vertical direction as the Z axis, and dividing the entire coordinate system into grid units; A grid unit numbering module, used for numbering grid units; The obstacle set establishment module is used to assign feasibility values to grid cells according to the three-dimensional model of the forest area and establish an obstacle set; A monitoring point determination module, used to determine the monitoring points; An ignition point determination module, used to determine and update the ignition point; The optimal path calculation module is used to calculate and simulate the optimal path through the fire scene grid model, obstacle set ε, monitoring points and ignition points according to the improved ant colony algorithm, and send the simulated optimal path and the three-dimensional wind field model into the error compensation model for processing to obtain the optimal path.