A path planning method based on genetic algorithm
By employing a genetic algorithm based on dual-population co-evolution and adversarial training, the robustness of UAV path planning under external interference was solved, achieving efficient and low-energy path planning in harsh environments.
Patent Information
- Application Number
- CN202510855850.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Traditional drone path planning methods cannot guarantee the robustness and practicality of path planning when faced with external environmental interference, especially changes in wind and visibility, causing drones to deviate from the predetermined path and affecting mission efficiency.
A path planning method based on genetic algorithms is adopted. Through dual-population co-evolution and adversarial training, a path plan that performs well under severe perturbations is generated. By utilizing the mutual challenge and optimization between the candidate population and the adversarial population, the robustness of the path planning is improved and the energy consumption is reduced.
It improves the robustness of drone swarm path planning, enabling it to maintain good performance in the face of various interferences, reduce energy consumption, and achieve shorter paths with less energy consumption.
Smart Images

Figure CN120368987B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of path planning technology, and more specifically to a path planning method based on genetic algorithms. Background Technology
[0002] The application of drone technology is becoming increasingly widespread, with numerous applications in military, civilian, and aerial photography fields. In practical applications, multiple drones often need to coordinate to complete tasks, making drone swarm path planning a critical issue. Traditional path planning methods are mainly based on deterministic models, ignoring uncertainties and interference factors in the external environment, such as wind and visibility. These interference factors may cause drones to deviate from the predetermined path, affecting the efficiency of task completion and reducing the reliability and practicality of path planning.
[0003] Genetic Algorithm (GA) is an optimization algorithm based on natural selection and genetic mechanisms, and has been widely used in UAV path planning problems. However, traditional genetic algorithms have certain limitations in handling external disturbances and cannot guarantee the robustness of the planned path in complex environments.
[0004] Therefore, a new path planning method is needed that can plan low-energy collaborative paths for drone swarms while taking into account external interference. Summary of the Invention
[0005] To address the aforementioned problems, the purpose of this invention is to provide a path planning method based on genetic algorithms, which can effectively cope with external interference, improve the robustness and practicality of UAV swarm path planning, and reduce energy consumption.
[0006] This invention provides a path planning method based on genetic algorithms, comprising:
[0007] The process involves acquiring UAV information and genetic algorithm parameter information, and then establishing a UAV path planning model based on the UAV information and genetic algorithm parameter information. The parameter information includes at least: candidate population, adversarial population, number of iterations, and mutation probability.
[0008] Initialize the candidate population and the adversarial population;
[0009] Calculate the first fitness of each candidate solution in the candidate population under all adversarial solutions in the adversarial population, select candidate solutions from the candidate population based on the first fitness and the tournament selection algorithm, and perform crossover and mutation operations on the selected candidate solutions to generate a new candidate population.
[0010] Calculate the second fitness of each adversarial solution in the adversarial population under all candidate solutions in the new candidate population, select adversarial solutions from the adversarial population based on the second fitness and the tournament selection algorithm, and perform crossover and mutation operations on the selected adversarial solutions to generate a new adversarial population;
[0011] When the maximum number of iterations is reached, the optimal candidate solution is determined based on the candidate solution corresponding to the first fitness with the smallest value.
[0012] Calculate the third fitness of the optimal candidate solution under all adversarial solutions in the new adversarial population, and determine the maximum adversarial perturbation of the optimal candidate solution based on the third fitness with the largest value.
[0013] The final planned path is determined based on the optimal candidate solution and the maximum adversarial disturbance.
[0014] In one possible implementation, establishing the UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes:
[0015] The speed of a single drone can be calculated using the following formula. :
[0016] ;
[0017] in, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, It represents a random two-dimensional wind disturbance.
[0018] In one possible implementation, establishing the UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes:
[0019] Calculate the drone's energy consumption using the following formula. :
[0020] ;
[0021] in, and Energy consumption coefficient, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, y is the vertical coordinate of the trajectory.
[0022] In one possible implementation, establishing the UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes:
[0023] The distance between drones is determined using the following formula. :
[0024] ;
[0025] ;
[0026] in, The minimum safe distance between the two drones. For the maximum communication range of drones, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, It represents a random two-dimensional wind disturbance.
[0027] In one possible implementation, establishing the UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes:
[0028] The following formula enables the drone to avoid obstacles:
[0029] ;
[0030] in, A collection of obstacles For drones In time The location.
[0031] In one possible implementation, the process of performing crossover and mutation operations on the selected candidate solutions to generate a new candidate population includes:
[0032] Randomly generate a number whose path length is no greater than that of the candidate solution;
[0033] Based on the given number, two randomly selected candidate solutions are disconnected to obtain the disconnected path sequence;
[0034] Perform a crossover operation on the path sequence to obtain a new path sequence;
[0035] Traverse the new path sequence and generate a random number between 0 and 1;
[0036] When the random number is less than the mutation probability, a mutation operation is performed on the new path sequence to obtain the mutated path sequence.
[0037] Based on the new path sequence and the path sequence after mutation, a new candidate population is generated.
[0038] In one possible implementation, the new path sequence is mutated to obtain the mutated path sequence, which includes:
[0039] A Gaussian distributed random number is added to the new path sequence, and the path value of the path sequence is restricted to a preset two-dimensional wind disturbance range to obtain the path sequence after the mutation operation.
[0040] In one possible implementation, calculating the first fitness of each candidate solution in the candidate population under all adversarial solutions includes:
[0041] Calculate the average cost of the candidate solution under all adversarial solutions, and then weight the worst-case cost and the average cost to obtain the first fitness.
[0042] The first fitness is calculated using the following formula. :
[0043] ;
[0044] in, These are the weighting coefficients. For the "worst-case scenario" This is the average cost.
[0045] In one possible implementation, determining the final planning path based on the optimal candidate solution and the maximum adversarial perturbation includes:
[0046] The final planned path for each drone under maximum adversarial disturbance is calculated using the following formula:
[0047] ;
[0048] in, For the final planned route, For the original planned location, To maximize the countermeasures against disturbances, For time.
[0049] The path planning method based on genetic algorithm provided by this invention uses genetic algorithm to find paths that still perform well under the worst perturbation, so that the finally found path can maintain good performance when facing various possible disturbances, thereby improving the robustness of path planning and reducing energy consumption. Attached Figure Description
[0050] Figure 1 A flowchart illustrating a path planning method based on a genetic algorithm provided for an embodiment of the present invention;
[0051] Figure 2 This is a schematic diagram of the selection operation provided in an embodiment of the present invention;
[0052] Figure 3 This is a schematic diagram of cross-operation provided in an embodiment of the present invention;
[0053] Figure 4(a) shows the path planning diagram of the traditional method;
[0054] Figure 4(b) is a path planning diagram provided in the example of the present invention;
[0055] Figure 5 A comparison chart of convergence curves provided for embodiments of the present invention. Detailed Implementation
[0056] The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. The following detailed description of the embodiments and the accompanying drawings are used to illustrate the principles of the present invention by way of example, but should not be used to limit the scope of the present invention. That is, the present invention is not limited to the described preferred embodiments, and the scope of the present invention is defined by the claims.
[0057] In the description of this invention, it should be noted that, unless otherwise stated, "a plurality of" means two or more; the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance; those skilled in the art can understand the specific meaning of the above terms in this invention as appropriate.
[0058] To facilitate understanding, the proprietary terms used in this application will be explained first.
[0059] Genetic Algorithms (GAs) are computational models that simulate the biological evolutionary process based on Darwin's theory of evolution, specifically natural selection and genetic mechanisms. They are methods for searching for optimal solutions by simulating natural evolution. Their main characteristics include direct manipulation of structural objects, without the constraints of differentiation or function continuity; inherent implicit parallelism and better global optimization capabilities; and the use of probabilistic optimization methods, which automatically acquire and guide the search space without the need for predetermined rules, adaptively adjusting the search direction. A GA uses all individuals in a population as its object and leverages randomization techniques to efficiently search an encoded parameter space. Selection, crossover, and mutation constitute the genetic operations of a GA; parameter encoding, initial population setting, fitness function design, genetic operation design, and control parameter setting form the core of a GA.
[0060] Unlike online-trained GAN network structures, adversarial training is an offline model enhancement training method. Adversarial training combines clean original samples with adversarial samples or other noisy samples to retrain the model, strengthening the model's resistance to adversarial samples or noise and improving the model's robustness.
[0061] Figure 1A flowchart illustrating the path planning method based on genetic algorithms provided for embodiments of the present invention is shown below. Figure 1 As shown, this invention provides a path planning method based on a genetic algorithm, comprising:
[0062] Step S1: Obtain UAV information and genetic algorithm parameter information, and establish a UAV path planning model based on the UAV information and genetic algorithm parameter information;
[0063] The parameter information includes at least: candidate population , combating the population The number of iterations and mutation probability; drone information should include at least the number of drones. Time steps Total energy of a single drone Energy consumption coefficient and Maximum speed Time step Communication range Coverage radius
[0064] In one possible implementation, the speed of a single drone is calculated according to the following formula. :
[0065] ;
[0066] in, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, For random two-dimensional wind disturbances, the following is required: .
[0067] In one possible implementation, the drone's energy consumption is related to the flight path length and speed, and the drone's energy consumption is calculated according to the following formula. :
[0068] ;
[0069] in, and Energy consumption coefficient, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, y is the vertical coordinate of the trajectory.
[0070] In one possible implementation, at any given moment, the distance between any two drones cannot exceed the communication range.
[0071] The distance between drones is determined using the following formula. :
[0072] ;
[0073] ;
[0074] in, The minimum safe distance between the two drones. For the maximum communication range of drones, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, It represents a random two-dimensional wind disturbance.
[0075] In one possible implementation, the drone's path needs to avoid obstacles. That is, any point on the path Neither of them are within the obstacle area; the following formula ensures the drone's path avoids the obstacle:
[0076] ;
[0077] in, A collection of obstacles For drones In time The position of the line segment between two coordinates. Determining whether the line segment intersects the circular obstacle is essentially determining whether the line segment and the circle have a common point, which can be represented as: The constraints are .
[0078] Step S2: Initialize the candidate population and the adversarial population;
[0079] In one possible implementation, the candidate population is initialized. Each candidate solution represents a path planning scheme for the drone swarm. The starting and target points of the drones are set, and the points at each time step are generated using linear interpolation. Then, the adversarial swarm is initialized. Two-dimensional wind disturbances are randomly generated from within the allowable additional wind speed range.
[0080] Step S3: Calculate the first fitness of each candidate solution in the candidate population under all adversarial solutions in the adversarial population. Select candidate solutions from the candidate population based on the first fitness and the tournament selection algorithm. Perform crossover and mutation operations on the selected candidate solutions to generate a new candidate population.
[0081] In one possible implementation, a tournament selection algorithm is used to select candidate solutions from the candidate population. Figure 2 This is a schematic diagram of the selection operation provided in an embodiment of the present invention.
[0082] Randomly generate a path number no greater than the length of a candidate solution; disconnect two randomly selected candidate solutions based on the path number to obtain a sequence of disconnected paths; perform a crossover operation on the path sequences to obtain a new path sequence. Figure 3 This is a schematic diagram of cross-operation provided in an embodiment of the present invention.
[0083] Traverse the new path sequence and generate a random number between 0 and 1; when the random number is less than the mutation probability, perform a mutation operation on the new path sequence to obtain the mutated path sequence.
[0084] A new candidate population is generated based on the new path sequence and the path sequence after mutation.
[0085] In one example, the mutation probability is 0.1. Each path sequence is iterated over, and a random number between 0 and 1 is generated. A random number following a Gaussian distribution with a mean of 0 and a standard deviation of 5 is added to the new path sequence, and the path values of the path sequence are restricted to a preset two-dimensional wind disturbance range to obtain the path sequence after mutation.
[0086] In one possible implementation, calculating the first fitness of each candidate solution in the candidate population across all adversarial solutions includes:
[0087] Calculate candidate population Candidate solutions In the fight against the population The adversarial solution in The cost of finding candidate solutions. In all adversarial solutions The maximum cost, i.e. the "worst-case" cost.
[0088] Calculate candidate solutions In all adversarial solutions The average cost under the given conditions is used to weight and combine the worst-case cost with the average cost to obtain the first fitness.
[0089] The first fitness is calculated using the following formula. :
[0090] ;
[0091] in, These are the weighting coefficients. For the "worst-case scenario" This is the average cost.
[0092] Step S4: Calculate the second fitness of each adversarial solution in the adversarial population under all candidate solutions in the new candidate population. Select adversarial solutions from the adversarial population based on the second fitness and the tournament selection algorithm. Perform crossover and mutation operations on the selected adversarial solutions to generate a new adversarial population.
[0093] In one possible implementation, the adversarial population is computed. China's confrontation solution In all candidate populations Candidate solutions The fitness of the target population is determined, and the average cost is calculated.
[0094] Using a tournament selection algorithm from adversarial populations Select individuals, perform crossover and mutation operations on the selected individuals, and generate a new adversarial population. .
[0095] Step S5: Determine whether the maximum number of iterations has been reached;
[0096] If the maximum number of iterations has not been reached, return to step S3; if the maximum number of iterations has been reached, proceed to step S6 to determine the optimal candidate solution based on the candidate solution corresponding to the first fitness with the smallest value.
[0097] In one possible implementation, from the candidate solution population Select the candidate solution with the minimum fitness and reshape it into The shape was used to obtain the original planned location of the drone swarm. .in, Indicates the number of drones, 2 represents the time step and 2 represents the two-dimensional spatial coordinates.
[0098] Step S7: Calculate the third fitness of the optimal candidate solution under all adversarial solutions in the new adversarial population, and determine the maximum adversarial perturbation of the optimal candidate solution based on the third fitness with the largest value.
[0099] Traversing the opposing population Each adversarial solution in Calculate the cost of the best candidate solution under this adversarial solution. By continuously updating the maximum cost, we eventually obtain the solution that maximizes the cost against perturbations and is the best candidate solution.
[0100] Step S8: Determine the final planned path based on the optimal candidate solution and the maximum adversarial disturbance.
[0101] In one possible implementation, the final planned path for each UAV under maximum adversarial disturbance is calculated according to the following formula:
[0102] ;
[0103] in, For the final planned route, For the original planned location, To maximize the countermeasures against disturbances, For time.
[0104] The path planning method based on adversarial training genetic algorithm provided by this invention uses adversarial training to find paths that still perform well under the worst perturbations, so that the finally found path can maintain good performance when facing various possible disturbances, thereby improving the robustness of path planning and reducing energy consumption.
[0105] Figure 4(a) shows the path planning diagram of the traditional method, and Figure 4(b) shows the path planning diagram provided by the example of the present invention. As shown, by introducing an adversarial population and conducting adversarial training with the candidate population, co-evolution occurs. Compared with the traditional method, the path planned by the algorithm based on adversarial training in this invention is shorter, resulting in less energy consumption by the UAV. The path planned by this invention reduces the UAV's turning, lowers the smoothing cost, and can better resist interference caused by wind disturbances. Figure 5 A comparison chart of convergence curves provided in the embodiments of the present invention, such as... Figure 5 As shown, by introducing an adversarial population and training it against the candidate population, co-evolution occurs. Compared to traditional methods, the fitness curve of this invention converges faster than the original algorithm.
[0106] The key points of this invention are as follows:
[0107] Co-evolution of two populations. Candidate solution population. This represents the candidate flight paths for all drone swarms. The goal is to minimize the total cost (fitness) of these paths. (Adversarial swarm) Candidate solutions represent perturbations (such as wind perturbations). The goal is to make the cost of candidate paths as high as possible when subjected to these perturbations, thus "challenging" the candidate paths. This architecture is similar to the game between the generator and discriminator in GANs: the generator (the candidate paths here) hopes to generate solutions that are difficult for the adversarial network (perturbations) to "beat," while the adversarial network tries to find perturbations that make the generator "perform" worse.
[0108] Worst-case optimization of Minimax. In the code, for each candidate path, the fitness function calculates the cost under different perturbations and uses a weighted combination to evaluate the path. This is equivalent to finding a path that still performs well under the worst perturbation. This solution strategy is essentially solving a game problem between minimizing (candidate paths) and maximizing (perturbations), similar to the minimax optimization objective of GAN networks.
[0109] The concept of adversarial training involves simultaneously evolving candidate paths and perturbations. Candidate paths are optimized by reducing their cost under various perturbations, while perturbations counteract path optimization by increasing the cost of candidate paths. This simultaneous training of populations with two different objectives ensures that the final selected candidate paths not only have lower costs under ideal conditions but are also more robust to perturbations, i.e., they exhibit better resistance to interference.
[0110] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A path planning method based on genetic algorithms, characterized in that, include: Obtain UAV information and genetic algorithm parameter information, and establish a UAV path planning model based on the UAV information and genetic algorithm parameter information; The parameter information includes at least: candidate population, adversarial population, number of iterations, and mutation probability; Initialize the candidate population and the adversarial population; Calculate the first fitness of each candidate solution in the candidate population under all adversarial solutions in the adversarial population, select candidate solutions from the candidate population based on the first fitness and the tournament selection algorithm, and perform crossover and mutation operations on the selected candidate solutions to generate a new candidate population. Calculate the second fitness of each adversarial solution in the adversarial population under all candidate solutions in the new candidate population, select adversarial solutions from the adversarial population according to the second fitness and the tournament selection algorithm, and perform crossover and mutation operations on the selected adversarial solutions to generate a new adversarial population; When the maximum number of iterations is reached, the optimal candidate solution is determined based on the candidate solution corresponding to the first fitness with the smallest value. Calculate the third fitness of the optimal candidate solution under all adversarial solutions in the new adversarial population, and determine the maximum adversarial perturbation of the optimal candidate solution based on the third fitness with the largest value. The final planned path is determined based on the optimal candidate solution and the maximum adversarial disturbance. The process of establishing a UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes: The speed of a single drone can be calculated using the following formula. : in, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, For random two-dimensional wind disturbance; Calculate the drone's energy consumption using the following formula. : in, and Energy consumption coefficient, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory; The distance between drones is determined using the following formula. : in, The minimum safe distance between the two drones. For the maximum communication range of drones, For the path of each drone in the drone swarm, The x-coordinate of the trajectory, The vertical coordinate of the trajectory, For random two-dimensional wind disturbance; The following formula enables the drone to avoid obstacles: in, A collection of obstacles For drones In time The location.
2. The path planning method according to claim 1, characterized in that, The step of performing crossover and mutation operations on the selected candidate solutions to generate a new candidate population includes: Randomly generate a number whose path length is no greater than that of the candidate solution; Based on the given number, two randomly selected candidate solutions are disconnected to obtain the disconnected path sequence; Perform a crossover operation on the path sequence to obtain a new path sequence; Traverse the new path sequence and generate a random number between 0 and 1; When the random number is less than the mutation probability, a mutation operation is performed on the new path sequence to obtain the mutated path sequence. Based on the new path sequence and the path sequence after mutation, a new candidate population is generated.
3. The path planning method according to claim 2, characterized in that, The step of performing a mutation operation on the new path sequence to obtain the mutated path sequence includes: A Gaussian distributed random number is added to the new path sequence, and the path value of the path sequence is restricted to a preset two-dimensional wind disturbance range to obtain the path sequence after the mutation operation.
4. The path planning method according to claim 1, characterized in that, The calculation of the first fitness of each candidate solution in the candidate population under all adversarial solutions includes: Calculate the average cost of the candidate solution under all adversarial solutions, and then weight the worst-case cost and the average cost to obtain the first fitness. The first fitness is calculated using the following formula. : in, These are the weighting coefficients. For the "worst-case scenario" This is the average cost.
5. The path planning method according to claim 1, characterized in that, The process of determining the final planned path based on the original planned location of the drone swarm and the maximum counter-disturbance includes: The final planned path for each drone under maximum adversarial disturbance is calculated using the following formula: in, For the final planned route, For the original planned location, To maximize the countermeasures against disturbances, For time.
Citation Information
Patent Citations
Unmanned aerial vehicle intelligent path planning method and system
CN119739183A