Path planning method based on genetic algorithm
Through the genetic algorithm path planning method of dual population co-evolution and adversarial training, the robustness and energy consumption problems of drone path planning under external interference were solved, and a path planning scheme that performed well in harsh environments was generated, which improved the efficiency and reliability of drone missions.
Patent Information
- Application Number
- CN202510855850.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Traditional drone path planning methods are not robust enough in the face of external environmental interference, affecting task efficiency and reliability, and have high energy consumption.
Using a genetic algorithm-based path planning method, through dual population co-evolution and adversarial training, a path planning scheme that performs well under harsh perturbations, including cross-and-mutation operations of candidate populations and adversarial populations, combined with worst-case optimization and weighted fitness assessment.
Improves the robustness of drone swarm path planning, reduces energy consumption, and maintains good performance in the face of various interferences.
Smart Images

Figure CN120368987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path planning, and particularly to a path planning method based on genetic algorithm. Background Art
[0002] The application of unmanned aerial vehicle (UAV) technology is becoming more and more extensive, and there are a large number of applications in military, civilian, aerial photography and other fields. In practical applications, multiple UAVs are usually required to cooperate to complete tasks. Therefore, the path planning of UAV swarms has become a key issue. Traditional path planning methods are mainly based on deterministic models, ignoring the uncertainty of the external environment and interference factors, such as wind force, visibility, etc. These interference factors may cause the UAVs to deviate from the predetermined path, affect the efficiency of task completion, and reduce the reliability and practicality of path planning.
[0003] Genetic Algorithm (GA) is an optimization algorithm based on natural selection and genetic mechanism, and has been widely applied to the UAV path planning problem. However, traditional genetic algorithms have certain limitations in dealing with external interference and cannot guarantee the robustness of the planned path in complex environments.
[0004] Therefore, a new path planning method is needed, which can plan a collaborative path with lower energy consumption for UAV swarms while considering external interference. Summary of the Invention
[0005] Aiming at the above problems, the purpose of the present invention is to provide a path planning method based on genetic algorithm, which can effectively cope with external interference, improve the robustness and practicality of UAV swarm path planning, and reduce energy consumption.
[0006] The present invention provides a path planning method based on genetic algorithm, including: Obtaining UAV information and parameter information of genetic algorithm, and establishing a UAV path planning model according to the UAV information and the parameter information of genetic algorithm; the parameter information at least includes: candidate population, adversarial population, number of iterations and mutation probability; Initializing the candidate population and the adversarial population; Calculating the first fitness of each candidate solution in the candidate population under all adversarial solutions in the adversarial population, selecting candidate solutions from the candidate population according to the first fitness and tournament selection algorithm, and performing crossover and mutation operations on the selected candidate solutions to generate a new candidate population; Calculating the second fitness of each adversarial solution in the adversarial population under all candidate solutions in the new candidate population, selecting adversarial solutions from the adversarial population according to the second fitness and tournament selection algorithm, and performing 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 according to 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 according to the third fitness with the largest value; Determine the final planned path according to the optimal candidate solution and the maximum adversarial perturbation.
[0007] In a possible implementation manner, the establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Calculate the speed of a single UAV according to the following formula : ; Wherein, is the path of each UAV in the UAV swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind perturbation.
[0008] In a possible implementation manner, the establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Calculate the energy consumption of the UAV according to the following formula : ; Wherein, and are the energy consumption coefficients, is the path of each UAV in the UAV swarm, is the abscissa of the trajectory, is the ordinate of the trajectory.
[0009] In a possible implementation manner, the establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Determine the distance between UAVs according to the following formula : ; ; Wherein, is the minimum safety distance between two UAVs, is the maximum communication range of the UAV, is the path of each UAV in the UAV swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind perturbation.
[0010] In a possible implementation, establishing a UAV path planning model based on the UAV information and the parameter information of the genetic algorithm includes: Making the UAV path avoid obstacles according to the following formula: ; Wherein, is the set of obstacles, is the UAV at time position.
[0011] In a possible implementation, performing crossover and mutation operations on the selected candidate solutions to generate a new candidate population includes: Randomly generate a number not greater than the path length of the candidate solution; According to the number, disconnect two randomly selected candidate solutions to obtain a 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, perform a mutation operation on the new path sequence to obtain a mutated path sequence; Generate a new candidate population according to the new path sequence and the mutated path sequence.
[0012] In a possible implementation, performing a mutation operation on the new path sequence to obtain a mutated path sequence includes: Add a Gaussian distribution random number on the basis of the new path sequence and limit the path value of the path sequence within a preset two-dimensional wind disturbance range to obtain a mutated path sequence.
[0013] In a possible implementation, calculating 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 perform a weighted combination of the "worst-case" cost and the average cost to obtain the first fitness; Calculate the first fitness according to the following formula : ; Wherein, is the weight coefficient, is the "worst-case" cost, is the average cost.
[0014] In a possible implementation, determining the final planned path according to the optimal candidate solution and the maximum adversarial perturbation includes: Calculating the final planned path of each drone under the maximum adversarial perturbation according to the following formula: ; where is the final planned path, is the original planned position, is the maximum adversarial perturbation, is the time.
[0015] The path planning method based on the genetic algorithm provided by the present invention uses the genetic algorithm to find a path that still performs well under the worst perturbations, so that the finally found path can maintain good performance in the face of various possible interferences, thereby improving the robustness of path planning and reducing energy consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a schematic flow chart of the path planning method based on the genetic algorithm provided by the embodiment of the present invention; Figure 2 is a schematic diagram of the selection operation provided by the embodiment of the present invention; Figure 3 is a schematic diagram of the crossover operation provided by the embodiment of the present invention; Figure 4(a) is a path planning diagram of the traditional method; Figure 4(b) is a path planning diagram provided by the example of the present invention; Figure 5 is a comparison diagram of the convergence curves provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] The following further describes in detail the embodiments of the present invention with reference to the drawings and embodiments. The detailed description and drawings of the following embodiments are used to exemplarily illustrate the principles of the present invention, but cannot 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.
[0018] In the description of the present invention, it should be noted that unless otherwise specified, the meaning of "a plurality of" is two or more; the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance; for those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0019] For ease of understanding, the proprietary terms involved in this application are first explained.
[0020] The Genetic Algorithm (GA) is a computational model that simulates the natural selection of Darwin's theory of biological evolution and the biological evolution process of genetic mechanisms. It is a method for searching for the optimal solution by simulating the natural evolution process. Its main characteristics are directly operating on structural objects, without the limitations of derivative calculation and function continuity; having inherent implicit parallelism and better global optimization ability; adopting a probabilistic optimization method, which can automatically obtain and guide the optimization search space without definite rules and adaptively adjust the search direction. The genetic algorithm takes all individuals in a population as objects and uses randomization techniques to guide the efficient search of a coded parameter space. Among them, selection, crossover, and mutation constitute the genetic operations of the genetic algorithm; the five elements of parameter coding, setting of the initial population, design of the fitness function, design of genetic operations, and setting of control parameters constitute the core content of the genetic algorithm.
[0021] Different from the GAN network structure for online training, adversarial training is an offline model enhancement training method. Adversarial training is to combine clean original samples with adversarial samples or other noise samples to retrain the model, strengthen the model's resistance to adversarial samples or noise, and improve the model's robustness.
[0022] Figure 1 The flowchart of the path planning method based on the genetic algorithm provided by the embodiment of the present invention is as Figure 1 shown. The present invention provides a path planning method based on the genetic algorithm, including: Step S1, obtain the drone information and the parameter information of the genetic algorithm, and establish a drone path planning model according to the drone information and the parameter information of the genetic algorithm; Among them, the parameter information at least includes: candidate population , adversarial population , number of iterations, and mutation probability; the drone information at least includes: number of drones , number of time steps , total energy of a single drone , energy consumption coefficient and , maximum speed , time step , communication range , coverage radius
[0023] In a possible implementation manner, the speed of a single drone is calculated according to the following formula : ; Among them, is the path of each drone in the drone swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind disturbance, and it is required that .
[0024] In a possible implementation, the energy consumption of the UAV is related to the flight path length and speed, and the energy consumption of the UAV is calculated according to the following formula : ; where and are the energy consumption coefficients, is the path of each UAV in the UAV swarm, is the abscissa of the trajectory, is the ordinate of the trajectory.
[0025] In a possible implementation, at each moment, the distance between any two UAVs cannot be greater than the communication range.
[0026] The distance between UAVs is determined according to the following formula : ; ; where is the minimum safe distance between two UAVs, is the maximum communication range of the UAV, is the path of each UAV in the UAV swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind disturbance.
[0027] In a possible implementation, the UAV path needs to avoid obstacles , that is, any point on the path is not within the obstacle area; the UAV path is made to avoid obstacles according to the following formula: ; where is the set of obstacles, is the UAV at time . Judging whether the line segment between two coordinates has an intersection with a circular obstacle is essentially judging whether there is a common point between the line segment and the circle, which can be expressed as , and the constraint condition is .
[0028] Step S2, initialize the candidate population and the adversarial population; In a possible implementation, initialize the candidate population , where each candidate solution represents a path planning scheme for the UAV swarm. Set the starting point and target point of the UAV, and generate points at each moment through linear interpolation. Then initialize the adversarial population , and randomly generate two-dimensional wind disturbances from the allowed additional wind speed range.
[0029] 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 according to 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; In a possible implementation, use the tournament selection algorithm to select candidate solutions from the candidate population. Figure 2 This is the schematic diagram of the selection operation provided by the embodiment of the present invention.
[0030] Randomly generate a number not greater than the path length of the candidate solution; disconnect two randomly selected candidate solutions according to the number to obtain the disconnected path sequence; perform crossover operation on the path sequence to obtain a new path sequence; Figure 3 This is the schematic diagram of the crossover operation provided by the embodiment of the present invention.
[0031] 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 mutation operation on the new path sequence to obtain the path sequence after mutation operation; Generate a new candidate population according to the new path sequence and the path sequence after mutation operation.
[0032] In an example, the mutation probability is 0.1. Traverse each path sequence and randomly generate a random number between 0 and 1. Add a random number subject to a Gaussian distribution with a mean of 0 and a standard deviation of 5 to the new path sequence, and limit the path value of the path sequence within the preset two-dimensional wind disturbance range to obtain the path sequence after mutation operation.
[0033] In a possible implementation, calculating the first fitness of each candidate solution in the candidate population under all adversarial solutions includes: Calculate the candidate solutions in the candidate population The cost of the candidate solution Under the adversarial solution in the adversarial population And find the candidate solution The maximum cost under all adversarial solutions That is, the "worst-case" cost. Calculate the candidate solution
[0034] The candidate solution Under all adversarial solutions The average cost under [condition], a weighted combination of the "worst-case" cost and the average cost is performed to obtain the first fitness; Calculate the first fitness according to the following formula : ; Among them, is the weight coefficient, is the "worst-case" cost, is the average cost.
[0035] 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 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; In a possible implementation, calculate the adversarial population in the adversarial solution under all candidate populations in the candidate solution to obtain the average cost.
[0036] Use the tournament selection algorithm to select individuals from the adversarial population and perform crossover and mutation operations on the selected individuals to generate a new adversarial population .
[0037] Step S5, determine whether the maximum number of iterations is reached; When the maximum number of iterations is not reached, return to execute Step S3; when the maximum number of iterations is reached, execute Step S6, and determine the optimal candidate solution according to the candidate solution corresponding to the first fitness with the smallest value; In a possible implementation, select the candidate solution with the smallest fitness from the candidate solution population and reshape it into to obtain the original planned position of the UAV swarm . Among them, represents the number of UAVs, represents the number of time steps, and 2 represents the two-dimensional space coordinates.
[0038] 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 according to the maximum value of the third fitness; Traverse each adversarial solution in the adversarial population , calculate the cost of the best candidate solution under this adversarial solution, continuously update the maximum cost, and finally obtain the adversarial perturbation that maximizes the cost of the best candidate solution.
[0039] Step S8. Determine the final planned path according to the optimal candidate solution and the maximum adversarial perturbation.
[0040] In a possible implementation, calculate the final planned path of each UAV under the maximum adversarial perturbation according to the following formula: ; where is the final planned path, is the original planned position, is the maximum adversarial perturbation, is the time.
[0041] The path planning method based on the genetic algorithm with adversarial training provided by the present invention uses adversarial training to find a path that still performs well under the most adverse perturbations, so that the finally found path can maintain good performance in the face of various possible interferences, thereby improving the robustness of path planning and reducing energy consumption.
[0042] Figure 4(a) is the path planning diagram of the traditional method, and Figure 4(b) is the path planning diagram provided by the embodiment of the present invention. As shown in the figure, by introducing an adversarial population and performing adversarial training with the candidate population, they co-evolve. Compared with the traditional method, the path planned by the algorithm based on adversarial training of the present invention is shorter in length, enabling the UAV to consume less energy; the path planned by the present invention reduces the turning of the UAV, reduces the smoothing cost, and can better resist the interference caused by wind perturbation. Figure 5 This is the comparison diagram of the convergence curves provided by the embodiments of the present invention. As Figure 5 shown, by introducing an adversarial population and performing adversarial training with the candidate population, they co-evolve. Compared with the traditional method, the fitness curve of the present invention converges faster than the original algorithm.
[0043] The key points of the present invention are as follows: Dual-population co-evolution. The candidate solution population represents the candidate flight paths of all UAV groups. The goal is to make the total cost (fitness) of these paths as low as possible. The adversarial population represents the candidate solutions of perturbations (such as wind perturbations). Its goal is to make the cost of the candidate paths as high as possible when suffering from these perturbations, playing the role of "challenging" the candidate paths. This framework is similar to the game between the generator and the discriminator in GAN: the generator (the candidate path here) hopes to generate a solution that is difficult for the adversarial network (perturbation) to "defeat", while the adversarial network tries to find a perturbation that can make the generator "perform" worse.
[0044] Worst-case optimization Minimax. In the code, for each candidate path, the fitness function calculates the costs 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 perturbations. This solution strategy is equivalent to solving a game problem between minimizing (candidate path) and maximizing (perturbation), similar to the minimax optimization objective of the GAN network.
[0045] The idea of adversarial training. Evolve the candidate path and the perturbation simultaneously. The candidate path is optimized by reducing the costs under various perturbations; while the perturbation counteracts the path optimization by increasing the costs of the candidate path. Training these two populations with different objectives simultaneously makes the finally selected candidate path not only have a lower cost in the ideal case, but also be more robust when facing perturbations, that is, it has better anti-interference ability.
[0046] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A path planning method based on genetic algorithm, characterized in that Including: Obtain the information of the unmanned aerial vehicle (UAV) and the parameter information of the genetic algorithm, and establish a UAV path planning model according to the UAV information and the parameter information of the genetic algorithm; The parameter information at least includes: 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 according to 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, determine the optimal candidate solution according to 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 according to the third fitness with the largest value; Determine the final planned path according to the optimal candidate solution and the maximum adversarial perturbation.
2. The path planning method according to claim 1, wherein The establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Calculate the speed of a single drone according to the following formula : ; Among them, is the path of each drone in the drone swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind disturbance.
3. The path planning method according to claim 1, wherein The establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Calculate the energy consumption of the drone according to the following formula :[[]]END]] ; Among them, and are the energy consumption coefficients, is the path of each drone in the drone swarm, is the abscissa of the trajectory, is the ordinate of the trajectory.
4. The path planning method according to claim 1, characterized in that, The establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Determine the distance between drones according to the following formula : ; ; Among them, is the minimum safety distance between two drones, is the maximum communication range of the drones, is the path of each drone in the drone swarm, is the abscissa of the trajectory, is the ordinate of the trajectory, is the random two-dimensional wind disturbance.
5. The path planning method according to claim 1, characterized in that The establishing of the UAV path planning model according to the UAV information and the parameter information of the genetic algorithm includes: Make the UAV path avoid obstacles according to the following formula: ; Among them, is the set of obstacles, is the UAV at time position.
6. The path planning method according to claim 1, characterized in that, The performing of crossover and mutation operations on the selected candidate solutions to generate a new candidate population includes: Randomly generate a number not greater than the path length of the candidate solution; Disconnect two randomly selected candidate solutions according to the number to obtain a 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, perform a mutation operation on the new path sequence to obtain a mutated path sequence; Generate a new candidate population according to the new path sequence and the mutated path sequence.
7. The path planning method according to claim 6, wherein The performing of a mutation operation on the new path sequence to obtain a mutated path sequence includes: Add a Gaussian distribution random number on the basis of the new path sequence and limit the path value of the path sequence within a preset two-dimensional wind perturbation range to obtain a mutated path sequence.
8. The path planning method according to claim 1, wherein The calculating 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 perform a weighted combination of the "worst-case" cost and the average cost to obtain the first fitness; Calculate the first fitness according to the following formula : ; wherein, is a weight coefficient, is the "worst case" cost, is the average cost.
9. The path planning method according to claim 1, wherein The determining of the final planned path according to the optimal candidate solution and the maximum adversarial perturbation includes: Calculate the final planned path of each UAV under the maximum adversarial perturbation according to the following formula: ; Among them, is the final planned path, is the original planned position, is the maximum adversarial perturbation, is the time.
Citation Information
Patent Citations
Route planning method based on non-dominated sorting genetic algorithm II
CN104729509A
Unmanned aerial vehicle path planning method and device
CN111664852A
Unmanned aerial vehicle path planning method based on improved genetic algorithm
CN117742373A
Unmanned aerial vehicle intelligent path planning method and system
CN119739183A
Unmanned surface vehicle path planning method and system based on improved genetic algorithm
WO2021022637A1
Cited By
Unmanned aerial vehicle path planning method based on hybrid strategy improved Kepler algorithm
CN121761890A