Simulated adversarial training method based on multi-agent reinforcement learning

Through the simulated confrontation training method of multi-agent reinforcement learning, the obstacle avoidance strategy of the drone is automatically optimized, which solves the problems in the existing technology that drone training relies on manual monitoring and lacks the ability to recognize dynamic obstacles, and achieves a more efficient and Safe flight.

CN118394109BActive Publication Date: 2024-10-01CHINA AVIATION MARINE EQUIP YANTAI TECH CO LTD
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202410830849.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-01
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

Existing UAV training methods require real-time manual monitoring, are costly and have poor ability to avoid dynamic obstacles, making it impossible to determine the optimal obstacle avoidance distance.

Method used

The simulated adversarial training method of multi-agent reinforcement learning is used to obtain the obstacle type and movement speed by establishing an adversarial training coordinate system. Combination with UAV flight data is used for adversarial training to optimize obstacle avoidance strategies and automatically determine the best obstacle avoidance distance.

Benefits of technology

It improves the flight efficiency and safety of drones, reduces obstacle avoidance and detours, and reduces the risk of collision and the possibility of personal injury.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394109B_ABST
    Figure CN118394109B_ABST
Patent Text Reader

Abstract

The present invention discloses a simulated adversarial training method based on multi-agent reinforcement learning, relates to the field of unmanned aerial vehicles, solves the problem that the existing unmanned aerial vehicle obstacle avoidance training method has poor effect, comprises step S1: establishes an adversarial training coordinate system, obtains obstacle data according to the adversarial training coordinate system, step S2: obtains unmanned aerial vehicle data according to the obstacle data, step S3: conducts adversarial training on the unmanned aerial vehicle according to the obstacle data and the unmanned aerial vehicle data, and obtains the first round of adversarial analysis data, step S4: performs obstacle avoidance optimization on the unmanned aerial vehicle according to the first round of adversarial analysis data, and the present invention determines the optimal obstacle avoidance distance of obstacles through multiple adversarial trainings, can effectively improve the flight efficiency of the unmanned aerial vehicle, and avoids unnecessary obstacle avoidance detours.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of unmanned aerial vehicles and relates to flight simulation technology, in particular to a simulation adversarial training method based on multi-agent reinforcement learning. Background Art

[0002] Multi-agent reinforcement learning refers to multiple agents collaborating or competing with each other in a shared environment, achieving individual or overall goals through interaction and learning. In multi-agent reinforcement learning, the reward coefficient is a very critical concept used to guide agents to learn and make behavioral decisions. The reward coefficient plays an important role in multi-agent reinforcement learning. By designing a suitable reward coefficient, cooperation and competition between agents can be promoted to achieve the optimization of the overall goal.

[0003] Existing drone training methods have the following defects:

[0004] 1. Currently, most drones require real-time monitoring, intervention and operation by operators during the obstacle avoidance process, which increases labor costs and flight risks;

[0005] 2. Existing methods usually use obstacle avoidance algorithms based on static maps, which have poor recognition and avoidance capabilities for dynamic obstacles and are unable to determine the optimal obstacle avoidance distance;

[0006] To this end, we propose a simulated adversarial training method based on multi-agent reinforcement learning. Summary of the invention

[0007] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a simulated adversarial training method based on multi-agent reinforcement learning. The present invention is based on establishing an adversarial training coordinate system, obtaining obstacle type classification data and the real-time movement speed of obstacles according to the adversarial training coordinate system, obtaining obstacle data, obtaining the real-time flight acceleration and the real-time flight speed of the drone according to the obstacle data, obtaining drone data, conducting adversarial training on the drone according to the obstacle data and the drone data, obtaining the first reward parameter, the second reward parameter, the total distance of the obstacle and the first round of adversarial training reward coefficient, obtaining the first round of adversarial analysis data, and optimizing the obstacle avoidance of the drone according to the first round of adversarial analysis data;

[0008] In order to achieve the above object, the present invention adopts the following technical scheme to implement the simulation adversarial training method based on multi-agent reinforcement learning, which includes the following specific steps:

[0009] Step S1: Establish an adversarial training coordinate system, obtain obstacle type classification data and obstacle real-time movement speed according to the adversarial training coordinate system, and obtain obstacle data;

[0010] Step S2: acquiring the real-time flight acceleration and the real-time flight speed of the drone according to the obstacle data, and obtaining the drone data;

[0011] Step S3: Conducting adversarial training on the drone according to the obstacle data and the drone data, obtaining the first reward parameter, the second reward parameter, the total obstacle distance, and the first round of adversarial training reward coefficient, and obtaining the first round of adversarial analysis data;

[0012] Step S4: Perform multiple rounds of adversarial analysis based on the first round of adversarial analysis data to achieve obstacle avoidance optimization for the UAV.

[0013] Furthermore, in step S1, obstacle data is acquired, and the specific steps are as follows:

[0014] Step S11: In the UAV training environment, take the initial take-off position of the UAV as the coordinate origin, draw two straight lines parallel to the ground and perpendicular to each other through the coordinate origin, mark them as the coordinate X axis and the coordinate Y axis respectively, and draw a straight line perpendicular to the plane where the coordinate X axis and the coordinate Y axis are located through the coordinate origin, mark it as the coordinate Z axis;

[0015] Step S12: Name the three-dimensional coordinate system consisting of the coordinate origin, the coordinate X-axis and the coordinate Y-axis in the UAV training environment as the adversarial training coordinate system;

[0016] Step S13: Mark multiple environmental objects in the UAV training environment as the first obstacle to the ath obstacle, mark a training monitoring time point every feature training duration in the UAV training environment, and obtain the three-dimensional coordinates of each obstacle at different training monitoring time points through the adversarial training coordinate system to obtain a set of obstacle three-dimensional coordinates;

[0017] Step S14: judging the motion state of each obstacle according to the three-dimensional coordinate set, and classifying the first obstacle to the ath obstacle into first motion type obstacles and second motion type obstacles, respectively, to obtain obstacle type classification data;

[0018] Step S15: acquiring the real-time moving speed of the obstacle of the first movement type to obtain the real-time moving speed of the obstacle;

[0019] Step S16: defining the adversarial training coordinate system, obstacle type classification data, and obstacle real-time movement speed as obstacle data.

[0020] Furthermore, the step S14 further includes the following specific steps:

[0021] Step S141: selecting the three-dimensional coordinates corresponding to two consecutive training monitoring points of the first obstacle before the current moment in the obstacle three-dimensional coordinate set to obtain a first monitoring three-dimensional coordinate and a second monitoring three-dimensional coordinate;

[0022] Step S142: if the first monitoring three-dimensional coordinates and the second monitoring three-dimensional coordinates are the same, taking the first obstacle corresponding to the current moment as a first motion type obstacle;

[0023] Step S143: if the first monitoring three-dimensional coordinates are different from the second monitoring three-dimensional coordinates, the first obstacle corresponding to the current moment is used as a second motion type obstacle;

[0024] Step S144: Repeat the process of classifying the motion type of the first obstacle, and classify the motion type of each obstacle respectively.

[0025] Furthermore, the step S15 further includes the following specific steps:

[0026] Step S151: if the first obstacle is a first motion type obstacle, obtain its real-time moving speed;

[0027] The specific steps are as follows:

[0028] Step S1511: Obtain a duration value corresponding to the feature training duration to obtain a feature training duration value;

[0029] Step S1512: Calculate the feature training duration value, the first monitoring three-dimensional coordinate, and the second monitoring three-dimensional coordinate to obtain the real-time moving speed corresponding to the first motion type obstacle;

[0030] Step S152: Repeat the above process of acquiring the real-time moving speed corresponding to the first motion type obstacle, acquire the real-time moving speed corresponding to each first motion type obstacle, and obtain the real-time moving speed of the obstacle.

[0031] Furthermore, in step S2, the drone data is acquired, and the specific steps are as follows:

[0032] Step S21: Obtain obstacle data, and obtain an adversarial training coordinate system according to the obstacle data;

[0033] Step S22: In the adversarial training coordinate system, the coordinate point where the drone is currently located is taken as the first drone coordinate point, and the first drone coordinate point is taken as the reference drone coordinate point, and the time value corresponding to when the drone is at the reference drone coordinate point is obtained to obtain the coordinate point reference time value;

[0034] Obtain the coordinate point of the drone at a characteristic time length before the coordinate point reference time value, and obtain the coordinate point of the second drone;

[0035] Obtain the coordinate point of the drone when the coordinate point reference time value is two characteristic time lengths ahead, and obtain the coordinate point of the third drone;

[0036] Step S23: obtaining the three-dimensional coordinates corresponding to the first UAV coordinate point, the second UAV coordinate point, and the third UAV coordinate point respectively through the adversarial training coordinate system;

[0037] Step S24: Acquire the duration value corresponding to the characteristic time length to obtain the characteristic duration value;

[0038] Step S25: Calculate the real-time flight speed value corresponding to the first UAV coordinate point through the three-dimensional coordinates corresponding to the first UAV coordinate point, the three-dimensional coordinates corresponding to the second UAV coordinate point, and the characteristic duration value;

[0039] Step S26: defining the real-time flight speed value corresponding to the first UAV coordinate point as the real-time flight speed of the UAV;

[0040] Step S27: Repeat the above calculation process of the real-time flight speed value corresponding to the first UAV coordinate point, and calculate the real-time flight speed value corresponding to the second UAV coordinate point according to the three-dimensional coordinates corresponding to the second UAV coordinate point, the three-dimensional coordinates corresponding to the third UAV coordinate point, and the characteristic duration value;

[0041] Step S28: Calculate the real-time flight acceleration of the drone by using the real-time flight speed value corresponding to the first drone coordinate point, the real-time flight speed value corresponding to the second drone coordinate point, and the characteristic duration value;

[0042] Step S29: define the real-time flight acceleration and the real-time flight speed of the drone as drone data.

[0043] Furthermore, in step S3, the first round of adversarial analysis data is obtained, and the specific steps are as follows:

[0044] Step S31: Obtain obstacle data, and obtain an adversarial training coordinate system, obstacle type classification data, and real-time movement speed of the obstacle according to the obstacle data;

[0045] Step S32: Acquire the drone data, and acquire the real-time flight acceleration and the real-time flight speed of the drone according to the drone data;

[0046] Step S33: acquiring the three-dimensional coordinate point position corresponding to each second type obstacle according to the adversarial training coordinate system to obtain the fixed point coordinates;

[0047] Step S34: performing a first round of adversarial training on the UAV to obtain a first reward parameter, a second reward parameter, a total obstacle distance, and a first round of adversarial training reward coefficient;

[0048] Step S35: define the first reward parameter, the second reward parameter, the total obstacle distance, and the first round of adversarial training reward coefficient as the first round of adversarial analysis data.

[0049] Furthermore, the step S34 further includes the following specific steps:

[0050] Step S341: Obtain the shortest coordinate straight-line distance between the UAV and the fixed point coordinates in the first round of confrontation training according to the confrontation training coordinate system to obtain a first training distance;

[0051] Step S342: Obtain the shortest coordinate straight-line distance between the UAV and the first type of obstacle in the first round of confrontation training according to the confrontation training coordinate system, obtain a second training distance, and obtain the UAV real-time flight acceleration, UAV real-time flight speed, and obstacle real-time movement speed corresponding to when the UAV and the first type of obstacle are at the second training distance;

[0052] Step S343: Substitute the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle into the drone obstacle avoidance reward function as parameters to calculate the first round of adversarial training reward coefficient;

[0053] Step S344: Create a drone obstacle avoidance reward function, as follows:

[0054]

[0055] Among them, in creating the drone obstacle avoidance reward function, Wj1 is the reward coefficient for the first round of adversarial training, Xjc1 is the first training distance, Sfjc1 is the real-time flight speed of the drone corresponding to the second training distance, Ssdc1 is the real-time movement speed of the obstacle corresponding to the second training distance, Fsjc1 is the real-time movement speed of the obstacle corresponding to the second training distance, Xjc2 is the second training distance, S1 is the first reward parameter, and S2 is the second reward parameter;

[0056] Step S345: The first training distance and the second training distance are summed to obtain a total obstacle distance.

[0057] Furthermore, in step S4, obstacle avoidance optimization is performed on the drone, and the specific steps are as follows:

[0058] Step S41: Obtaining the first round of adversarial analysis data;

[0059] Step S42: obtaining a first reward parameter, a second reward parameter, a total obstacle distance, and a first round of adversarial training reward coefficient according to the first round of adversarial analysis data;

[0060] Step S43: Obtain the total obstacle distance and the total obstacle distance threshold. When the total obstacle distance is less than the total obstacle distance threshold, perform a second round of confrontation training on the UAV.

[0061] Step S44: performing a second round of confrontation training on the UAV, obtaining the first training distance, the second training distance, the real-time flight acceleration of the UAV corresponding to the second training distance, the real-time flight speed of the UAV, and the real-time movement speed of the obstacle generated in the second round of confrontation training;

[0062] Step S45: Substitute the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle generated in the second round of adversarial training into the drone obstacle avoidance reward function to obtain the second round of adversarial training reward coefficient;

[0063] Step S46: calculating the first round adversarial training reward coefficient and the second round adversarial training reward coefficient to obtain a change in the first training reward coefficient;

[0064] Step S47: Obtain and update the total obstacle distance;

[0065] Step S48: defining the first updated reward parameter, the second updated reward parameter, the updated obstacle total distance, and the second round adversarial training reward coefficient as the second round adversarial analysis data;

[0066] Step S49: Update the total obstacle distance to be equal to the total obstacle distance threshold for numerical comparison, and further optimize the obstacle avoidance distance based on the result.

[0067] Furthermore, the step S47 further includes the following specific steps:

[0068] Step S471: the first reward parameter is updated year-on-year according to the first training reward coefficient change ratio, the second reward parameter remains unchanged, and the updated first reward parameter is named the first updated reward parameter;

[0069] Step S472: Substitute the first updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance, and obtain an updated first training distance;

[0070] Step S473: updating the second reward parameter year-on-year according to the first training reward coefficient change ratio, the first reward parameter remains unchanged, and the updated second reward parameter is named the second updated reward parameter;

[0071] Step S474: Substitute the second updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance to obtain an updated second training distance, calculate the sum of the updated first training distance and the updated second training distance, and obtain the updated total obstacle distance.

[0072] Furthermore, the step S49 further includes the following specific steps:

[0073] Step S491: If the updated total obstacle distance is equal to the total obstacle distance threshold, the confrontation training is stopped, the first training distance is updated to be the optimal obstacle avoidance distance for the drone facing a stationary obstacle under the same current external conditions, and the second training distance is updated to be the optimal obstacle avoidance distance for the drone facing a moving obstacle;

[0074] Step S492: If the updated total obstacle distance is less than or equal to the total obstacle distance threshold, the second round of adversarial analysis data is invalid, and the first round of adversarial analysis data is used for the third round of training.

[0075] Step S493: If the updated total obstacle distance is greater than the total obstacle distance threshold, the second round of adversarial analysis data is used to perform a third round of adversarial training;

[0076] Step S494: repeating steps S491 to S493, respectively performing n rounds of adversarial training on the UAV, obtaining n-1 groups of updated obstacle total distances, and comparing the n-1 groups of updated obstacle total distances with the values;

[0077] Step S495: defining the updated first training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing the stationary obstacle under the current external conditions;

[0078] Step S496: define the updated second training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing moving obstacles under the current external conditions.

[0079] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0080] 1. The present invention determines the optimal obstacle avoidance distance through multiple confrontation trainings, which can effectively improve the flight efficiency of the UAV and avoid unnecessary obstacle avoidance detours;

[0081] 2. When conducting obstacle avoidance training, the present invention determines the optimal obstacle avoidance distance of the drone in an automated manner, which can help the drone to make obstacle avoidance actions in time when encountering obstacles, avoid collisions or accidents, thereby improving flight safety and reducing the possibility of damage to the drone and personal injury. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0083] Figure 1 It is a diagram of the implementation steps of the present invention;

[0084] Figure 2 Schematic diagram of the adversarial training coordinate system in the present invention;

[0085] Figure 3 Schematic diagram of training distance in the present invention. DETAILED DESCRIPTION

[0086] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0087] See also Figure 1 The present invention provides a technical solution: a simulated adversarial training method based on multi-agent reinforcement learning, the specific steps are as follows:

[0088] Step S1: simulate the UAV training environment and obtain obstacle data;

[0089] Step S11: In the UAV training environment, take the initial take-off position of the UAV as the coordinate origin, draw two straight lines parallel to the ground and perpendicular to each other through the coordinate origin, mark them as the coordinate X axis and the coordinate Y axis respectively, and draw a straight line perpendicular to the plane where the coordinate X axis and the coordinate Y axis are located through the coordinate origin, mark it as the coordinate Z axis;

[0090] Step S12: Name the three-dimensional coordinate system consisting of the coordinate origin, the coordinate X-axis and the coordinate Y-axis in the UAV training environment as the adversarial training coordinate system;

[0091] Step S13: Please refer to Figure 2 , mark multiple environmental objects in the UAV training environment as the first obstacle to the ath obstacle, mark a training monitoring time point every feature training time in the UAV training environment, obtain the three-dimensional coordinates of each obstacle at different training monitoring time points through the adversarial training coordinate system, and obtain the obstacle three-dimensional coordinate set;

[0092] It should be noted here that:

[0093] The a involved here specifically refers to the number of obstacles in the UAV training environment;

[0094] Step S14: judging the motion state of each obstacle according to the three-dimensional coordinate set, and classifying the first obstacle to the ath obstacle into first motion type obstacles and second motion type obstacles, respectively, to obtain obstacle type classification data;

[0095] The step S14 further includes the following specific steps:

[0096] Step S141: selecting the three-dimensional coordinates corresponding to two consecutive training monitoring points of the first obstacle before the current moment in the obstacle three-dimensional coordinate set to obtain a first monitoring three-dimensional coordinate and a second monitoring three-dimensional coordinate;

[0097] Step S142: if the first monitoring three-dimensional coordinates and the second monitoring three-dimensional coordinates are the same, taking the first obstacle corresponding to the current moment as a first motion type obstacle;

[0098] Step S143: if the first monitoring three-dimensional coordinates are different from the second monitoring three-dimensional coordinates, the first obstacle corresponding to the current moment is used as a second motion type obstacle;

[0099] Step S144: repeating the process of classifying the motion type of the first obstacle, and classifying the motion type of each obstacle respectively;

[0100] It should be noted here that:

[0101] In this application, the first type of obstacle is a moving obstacle, and the second type of obstacle is a stationary obstacle;

[0102] In this application, since the time interval between two consecutive training monitoring points is short, in the specific implementation, the short-distance round-trip motion of the object in a short time is recognized as a stationary state in this application;

[0103] Step S15: acquiring the real-time moving speed of the first movement type obstacle;

[0104] The step S15 further includes the following specific steps:

[0105] Step S151: if the first obstacle is a first motion type obstacle, obtain its real-time moving speed;

[0106] The specific steps are as follows:

[0107] Step S1511: Obtain a duration value corresponding to the feature training duration to obtain a feature training duration value;

[0108] Step S1512: Calculate the feature training duration value, the first monitoring three-dimensional coordinate, and the second monitoring three-dimensional coordinate to obtain the real-time moving speed corresponding to the first motion type obstacle;

[0109] Calculate the real-time moving speed corresponding to the first motion type obstacle. The specific formula configuration is as follows:

[0110] ;

[0111] Among them, Sad1 is the real-time moving speed corresponding to the first motion type obstacle, (Xz1, Yz1, Zz1) is the first monitoring three-dimensional coordinate, (Xz2, Yz2, Zz2) is the second monitoring three-dimensional coordinate, and Tsc is the feature training duration value;

[0112] Step S152: Repeat the above process of acquiring the real-time moving speed corresponding to the first motion type obstacle, acquire the real-time moving speed corresponding to each first motion type obstacle, and obtain the real-time moving speed of the obstacle;

[0113] Step S16: defining the adversarial training coordinate system, obstacle type classification data, and obstacle real-time movement speed as obstacle data;

[0114] Step S2: Obtaining drone data based on obstacle data;

[0115] Step S21: Obtain obstacle data, and obtain an adversarial training coordinate system according to the obstacle data;

[0116] Step S22: In the adversarial training coordinate system, the coordinate point where the drone is currently located is taken as the first drone coordinate point, and the first drone coordinate point is taken as the reference drone coordinate point, and the time value corresponding to when the drone is at the reference drone coordinate point is obtained to obtain the coordinate point reference time value;

[0117] Obtain the coordinate point of the drone at a characteristic time length before the coordinate point reference time value, and obtain the coordinate point of the second drone;

[0118] Obtain the coordinate point of the drone when the coordinate point reference time value is two characteristic time lengths ahead, and obtain the coordinate point of the third drone;

[0119] For example: Assuming that the time value corresponding to the drone is 6 o'clock when it is at the reference drone coordinate point, and the length of a characteristic time is one hour, then the second drone coordinate point is the drone's coordinate point at 5 o'clock, and the third drone coordinate point is the drone's coordinate point at 4 o'clock;

[0120] Step S23: obtaining the three-dimensional coordinates corresponding to the first UAV coordinate point, the second UAV coordinate point, and the third UAV coordinate point respectively through the adversarial training coordinate system;

[0121] Step S24: Acquire the duration value corresponding to the characteristic time length to obtain the characteristic duration value;

[0122] Step S25: Calculate the real-time flight speed value corresponding to the first UAV coordinate point through the three-dimensional coordinates corresponding to the first UAV coordinate point, the three-dimensional coordinates corresponding to the second UAV coordinate point, and the characteristic duration value;

[0123] Calculate the real-time flight speed value corresponding to the first drone coordinate point. The specific formula configuration is as follows:

[0124] ;

[0125] Among them, Sfj1 is the real-time flight speed value corresponding to the first UAV coordinate point, Tjc is the characteristic duration value, (Xj1, Yj1, Zj1) is the three-dimensional coordinate corresponding to the first UAV coordinate point, and (Xj2, Yj2, Zj2) is the three-dimensional coordinate corresponding to the second UAV coordinate point;

[0126] Step S26: defining the real-time flight speed value corresponding to the first UAV coordinate point as the real-time flight speed of the UAV;

[0127] Step S27: Repeat the above calculation process of the real-time flight speed value corresponding to the first UAV coordinate point, and calculate the real-time flight speed value corresponding to the second UAV coordinate point according to the three-dimensional coordinates corresponding to the second UAV coordinate point, the three-dimensional coordinates corresponding to the third UAV coordinate point, and the characteristic duration value;

[0128] Step S28: Calculate the real-time flight acceleration of the drone by using the real-time flight speed value corresponding to the first drone coordinate point, the real-time flight speed value corresponding to the second drone coordinate point, and the characteristic duration value;

[0129] Calculate the real-time flight acceleration of the drone. The specific formula configuration is as follows:

[0130] ;

[0131] Among them, Fsj is the real-time flight acceleration of the drone, Sfj1 is the real-time flight speed value corresponding to the coordinate point of the first drone, Sfj2 is the real-time flight speed value corresponding to the coordinate point of the second drone, and Tjc is the characteristic duration value;

[0132] Step S29: defining the real-time flight acceleration and the real-time flight speed of the drone as drone data;

[0133] Step S3: Conduct confrontation training on the drone based on obstacle data and drone data, and obtain the first round of confrontation analysis data;

[0134] Step S31: Obtain obstacle data, and obtain an adversarial training coordinate system, obstacle type classification data, and real-time movement speed of the obstacle according to the obstacle data;

[0135] Step S32: Acquire the drone data, and acquire the real-time flight acceleration and the real-time flight speed of the drone according to the drone data;

[0136] Step S33: acquiring the three-dimensional coordinate point position corresponding to each second type obstacle according to the adversarial training coordinate system to obtain the fixed point coordinates;

[0137] Step S34: performing the first round of confrontation training on the UAV;

[0138] The step S34 further includes the following specific steps:

[0139] Step S341: Obtain the shortest coordinate straight-line distance between the UAV and the fixed point coordinates in the first round of confrontation training according to the confrontation training coordinate system to obtain a first training distance;

[0140] The specific steps are as follows:

[0141] Step S3411: Please refer to Figure 3 , assuming that the three-dimensional coordinates of the fixed point coordinates in the adversarial training coordinate system are (Xg, Yg, Zg), and the real-time coordinates of the drone in the adversarial training coordinate system are (Xs, Ys, Zs). Here, the first training distance is calculated, and the specific formula configuration is as follows:

[0142] ;

[0143] Among them, (Xg, Yg, Zg) is the three-dimensional coordinates of the fixed point in the adversarial training coordinate system, (Xs, Ys, Zs) is the real-time coordinates of the drone in the adversarial training coordinate system, and Xjc is the first training distance;

[0144] Step S342: Obtain the shortest coordinate straight-line distance between the UAV and the first type of obstacle in the first round of confrontation training according to the confrontation training coordinate system, obtain a second training distance, and obtain the UAV real-time flight acceleration, UAV real-time flight speed, and obstacle real-time movement speed corresponding to when the UAV and the first type of obstacle are at the second training distance;

[0145] It should be noted here that:

[0146] Step S343: Substitute the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle into the drone obstacle avoidance reward function as parameters to calculate the first round of adversarial training reward coefficient;

[0147] Step S344: Create a drone obstacle avoidance reward function, as follows:

[0148]

[0149] Among them, in creating the drone obstacle avoidance reward function, Wj1 is the reward coefficient for the first round of adversarial training, Xjc1 is the first training distance, Sfjc1 is the real-time flight speed of the drone corresponding to the second training distance, Ssdc1 is the real-time movement speed of the obstacle corresponding to the second training distance, Fsjc1 is the real-time movement speed of the obstacle corresponding to the second training distance, Xjc2 is the second training distance, S1 is the first reward parameter, and S2 is the second reward parameter;

[0150] Step S345: summing the first training distance and the second training distance to obtain a total obstacle distance;

[0151] Step S35: defining the first reward parameter, the second reward parameter, the total distance of obstacles, and the first round of adversarial training reward coefficient as the first round of adversarial analysis data;

[0152] Step S4: Perform multiple rounds of confrontation analysis based on the first round of confrontation analysis data to achieve obstacle avoidance optimization for the UAV;

[0153] Step S41: Obtaining the first round of adversarial analysis data;

[0154] Step S42: obtaining a first reward parameter, a second reward parameter, a total obstacle distance, and a first round of adversarial training reward coefficient according to the first round of adversarial analysis data;

[0155] Step S43: Obtain the total obstacle distance and the total obstacle distance threshold. When the total obstacle distance is less than the total obstacle distance threshold, perform a second round of confrontation training on the UAV.

[0156] It should be noted here that:

[0157] The total obstacle distance threshold involved here is the sum of the preset shortest obstacle avoidance distances between the drone and stationary obstacles and moving obstacles;

[0158] Step S44: performing a second round of confrontation training on the UAV, obtaining the first training distance, the second training distance, the real-time flight acceleration of the UAV corresponding to the second training distance, the real-time flight speed of the UAV, and the real-time movement speed of the obstacle generated in the second round of confrontation training;

[0159] It should be noted here that:

[0160] The first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle involved here are obtained in the second round of confrontation training;

[0161] Step S45: Substitute the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle generated in the second round of adversarial training into the drone obstacle avoidance reward function to obtain the second round of adversarial training reward coefficient;

[0162] Step S46: calculating the first round adversarial training reward coefficient and the second round adversarial training reward coefficient to obtain a change in the first training reward coefficient;

[0163] The change ratio of the first training reward coefficient is calculated as follows:

[0164] ;

[0165] Among them, Wjb1 is the change ratio of the first training reward coefficient, Wj1 is the first round of adversarial training reward coefficient, and Wj2 is the second round of adversarial training reward coefficient;

[0166] Step S47: Obtain and update the total obstacle distance;

[0167] The specific steps are as follows:

[0168] Step S471: the first reward parameter is updated year-on-year according to the first training reward coefficient change ratio, the second reward parameter remains unchanged, and the updated first reward parameter is named the first updated reward parameter;

[0169] Step S472: Substitute the first updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance, and obtain an updated first training distance;

[0170] Step S473: updating the second reward parameter year-on-year according to the first training reward coefficient change ratio, the first reward parameter remains unchanged, and the updated second reward parameter is named the second updated reward parameter;

[0171] Step S474: Substitute the second updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance, and obtain an updated second training distance;

[0172] Step S47: Calculate the sum of the updated first training distance and the updated second training distance to obtain the updated total obstacle distance;

[0173] Step S48: defining the first updated reward parameter, the second updated reward parameter, the updated obstacle total distance, and the second round adversarial training reward coefficient as the second round adversarial analysis data;

[0174] Step S49: updating the total obstacle distance to be equal to the total obstacle distance threshold for numerical comparison, and further optimizing the obstacle avoidance distance according to the result;

[0175] The specific steps are as follows:

[0176] Step S491: If the updated total obstacle distance is equal to the total obstacle distance threshold, the confrontation training is stopped, the first training distance is updated to be the optimal obstacle avoidance distance for the drone facing a stationary obstacle under the same current external conditions, and the second training distance is updated to be the optimal obstacle avoidance distance for the drone facing a moving obstacle;

[0177] Step S492: If the updated obstacle total distance is less than or equal to the obstacle total distance threshold, the second round of adversarial analysis data is invalid, and the first round of adversarial analysis data is used for the third round of training.

[0178] Step S493: If the updated total obstacle distance is greater than the total obstacle distance threshold, the second round of adversarial analysis data is used to perform a third round of adversarial training;

[0179] Step S494: repeating steps S491 to S493, respectively performing n rounds of adversarial training on the UAV, obtaining n-1 groups of updated obstacle total distances, and comparing the n-1 groups of updated obstacle total distances with the values;

[0180] It should be noted here that:

[0181] The n involved here is the number of adversarial training rounds conducted on the drone;

[0182] Step S495: defining the updated first training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing the stationary obstacle under the current external conditions;

[0183] Step S496: defining the updated second training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing moving obstacles under the current external conditions;

[0184] It should be noted here that:

[0185] In the present application, the current external conditions involved here include the obstacle movement speed, the UAV flight speed and the current flight acceleration of the UAV, and in the above process of obtaining the optimal obstacle avoidance distance, the specific values ​​corresponding to the obstacle movement speed, the UAV flight speed and the current flight acceleration of the UAV are the same;

[0186] And in this application, the current external conditions can be set by the staff to obtain specific data collected in actual applications for assignment;

[0187] In this application, if corresponding calculation formulas appear, the above calculation formulas are all dimensionless and take their numerical calculations. The weight coefficients, proportional coefficients and other coefficients in the formulas are set to a result value obtained by quantifying each parameter. The size of the weight coefficient and the proportional coefficient can be determined as long as it does not affect the proportional relationship between the parameter and the result value.

[0188] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A simulated adversarial training method based on multi-agent reinforcement learning, characterized in that: The specific steps include: Step S1: establishing an adversarial training coordinate system, obtaining obstacle type classification data and obstacle real-time movement speed according to the adversarial training coordinate system, and obtaining obstacle data; Step S2: acquiring the real-time flight acceleration and the real-time flight speed of the drone according to the obstacle data to obtain the drone data; Step S3: conducting adversarial training on the drone according to the obstacle data and the drone data, obtaining a first reward parameter, a second reward parameter, a total obstacle distance, and a first-round adversarial training reward coefficient, and obtaining first-round adversarial analysis data; Step S4: performing multiple rounds of confrontation analysis based on the first round of confrontation analysis data to achieve obstacle avoidance optimization for the UAV; In step S3, the first round of adversarial analysis data is obtained, and the specific steps are as follows: Step S31: Obtain the obstacle data, and obtain an adversarial training coordinate system, obstacle type classification data, and real-time movement speed of the obstacle according to the obstacle data; Step S32: Acquire the drone data, and acquire the real-time flight acceleration and the real-time flight speed of the drone according to the drone data; Step S33: acquiring the three-dimensional coordinate point position corresponding to each second type obstacle according to the adversarial training coordinate system to obtain fixed point coordinates; Step S34: performing a first round of adversarial training on the UAV to obtain a first reward parameter, a second reward parameter, a total obstacle distance, and a first round of adversarial training reward coefficient; Step S35: defining the first reward parameter, the second reward parameter, the total distance of obstacles, and the first round of adversarial training reward coefficient as first round of adversarial analysis data; The step S34 further includes the following specific steps: Step S341: Obtain the shortest coordinate straight-line distance between the UAV and the fixed point coordinates in the first round of confrontation training according to the confrontation training coordinate system to obtain a first training distance; Step S342: Obtain the shortest coordinate straight-line distance between the UAV and the first type of obstacle in the first round of confrontation training according to the confrontation training coordinate system, obtain a second training distance, and obtain the UAV real-time flight acceleration, UAV real-time flight speed, and obstacle real-time movement speed corresponding to when the UAV and the first type of obstacle are at the second training distance; Step S343: Substituting the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle into the drone obstacle avoidance reward function as parameters, and calculating the first round of adversarial training reward coefficient; Step S344: Create a drone obstacle avoidance reward function, as follows: Among them, in creating the drone obstacle avoidance reward function, Wj1 is the reward coefficient for the first round of adversarial training, Xjc1 is the first training distance, Sfjc1 is the real-time flight speed of the drone corresponding to the second training distance, Ssdc1 is the real-time movement speed of the obstacle corresponding to the second training distance, Fsjc1 is the real-time flight acceleration of the drone corresponding to the second training distance, Xjc2 is the second training distance, S1 is the first reward parameter, and S2 is the second reward parameter; Step S345: summing the first training distance and the second training distance to obtain a total obstacle distance; In step S4, obstacle avoidance optimization is performed on the drone, and the specific steps are as follows: Step S41: Obtaining the first round of adversarial analysis data; Step S42: obtaining a first reward parameter, a second reward parameter, a total obstacle distance, and a first round of adversarial training reward coefficient according to the first round of adversarial analysis data; Step S43: Obtain the total obstacle distance and the total obstacle distance threshold. When the total obstacle distance is less than the total obstacle distance threshold, perform a second round of confrontation training on the UAV. Step S44: performing a second round of confrontation training on the UAV, obtaining the first training distance, the second training distance, the real-time flight acceleration of the UAV corresponding to the second training distance, the real-time flight speed of the UAV, and the real-time movement speed of the obstacle generated in the second round of confrontation training; Step S45: Substitute the first training distance, the second training distance, the real-time flight acceleration of the drone corresponding to the second training distance, the real-time flight speed of the drone, and the real-time movement speed of the obstacle generated in the second round of adversarial training into the drone obstacle avoidance reward function to obtain the second round of adversarial training reward coefficient; Step S46: calculating the first round adversarial training reward coefficient and the second round adversarial training reward coefficient to obtain a change in the first training reward coefficient; Step S47: Obtain and update the total obstacle distance; Step S48: defining the first updated reward parameter, the second updated reward parameter, the updated obstacle total distance, and the second round adversarial training reward coefficient as the second round adversarial analysis data; Step S49: updating the total obstacle distance to be equal to the total obstacle distance threshold for numerical comparison, and further optimizing the obstacle avoidance distance according to the result; The step S47 further includes the following specific steps: Step S471: the first reward parameter is updated year-on-year according to the change in the first training reward coefficient, the second reward parameter remains unchanged, and the updated first reward parameter is named the first updated reward parameter; Step S472: Substitute the first updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance, and obtain an updated first training distance; Step S473: the second reward parameter is updated year-on-year according to the change in the first training reward coefficient, the first reward parameter remains unchanged, and the updated second reward parameter is named the second updated reward parameter; Step S474: Substitute the second updated reward parameter back into the drone obstacle avoidance reward function, calculate the first training distance to obtain an updated second training distance, calculate the sum of the updated first training distance and the updated second training distance, and obtain an updated total obstacle distance; The step S49 further includes the following steps: Step S491: If the updated total obstacle distance is equal to the total obstacle distance threshold, the confrontation training is stopped, the first training distance is updated to be the optimal obstacle avoidance distance for the drone facing a stationary obstacle under the same current external conditions, and the second training distance is updated to be the optimal obstacle avoidance distance for the drone facing a moving obstacle; Step S492: If the updated total obstacle distance is less than the total obstacle distance threshold, the second round of adversarial analysis data is invalid, and the first round of adversarial analysis data is used for the third round of training; Step S493: If the updated total obstacle distance is greater than the total obstacle distance threshold, the second round of adversarial analysis data is used to perform a third round of adversarial training; Step S494: repeating steps S491 to S493, respectively performing n rounds of adversarial training on the UAV, obtaining n-1 groups of updated obstacle total distances, and comparing the n-1 groups of updated obstacle total distances with the values; Step S495: defining the updated first training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing the stationary obstacle under the current external conditions; Step S496: define the updated second training distance corresponding to the updated obstacle total distance with the smallest value as the optimal obstacle avoidance distance for the UAV facing moving obstacles under the current external conditions.

2. The method for simulated adversarial training based on multi-agent reinforcement learning according to claim 1, characterized in that: In step S1, the obstacle data is acquired, and the specific steps are as follows: Step S11: In the UAV training environment, take the initial take-off position of the UAV as the coordinate origin, draw two straight lines parallel to the ground and perpendicular to each other through the coordinate origin, mark them as the coordinate X axis and the coordinate Y axis, and draw a straight line perpendicular to the plane where the coordinate X axis and the coordinate Y axis are located through the coordinate origin, mark it as the coordinate Z axis; Step S12: Name the three-dimensional coordinate system consisting of the coordinate origin, the coordinate X-axis and the coordinate Y-axis in the UAV training environment as the adversarial training coordinate system; Step S13: Mark multiple environmental objects in the UAV training environment as the first obstacle to the ath obstacle respectively; In the UAV training environment, a training monitoring time point is marked at each feature training duration interval, and the three-dimensional coordinates corresponding to each obstacle at different training monitoring time points are obtained through the adversarial training coordinate system to obtain a set of obstacle three-dimensional coordinates; Step S14: judging the motion state of each obstacle according to the three-dimensional coordinate set, and classifying the first obstacle to the ath obstacle into first motion type obstacles and second motion type obstacles, respectively, to obtain obstacle type classification data; Step S15: acquiring the real-time moving speed of the obstacle of the first movement type to obtain the real-time moving speed of the obstacle; Step S16: defining the adversarial training coordinate system, obstacle type classification data, and obstacle real-time movement speed as obstacle data.

3. The method for simulated adversarial training based on multi-agent reinforcement learning according to claim 2, characterized in that: The step S14 further includes the following specific steps: Step S141: selecting the three-dimensional coordinates corresponding to two consecutive training monitoring points of the first obstacle before the current moment from the obstacle three-dimensional coordinate set to obtain a first monitoring three-dimensional coordinate and a second monitoring three-dimensional coordinate; Step S142: if the first monitoring three-dimensional coordinates and the second monitoring three-dimensional coordinates are different, taking the first obstacle corresponding to the current moment as a first motion type obstacle; Step S143: if the first monitoring three-dimensional coordinates and the second monitoring three-dimensional coordinates are the same, taking the first obstacle corresponding to the current moment as a second motion type obstacle; Step S144: Repeat the process of classifying the motion type of the first obstacle, and classify the motion type of each obstacle.

4. The method for simulated adversarial training based on multi-agent reinforcement learning according to claim 2, characterized in that: The step S15 further includes the following steps: Step S151: if the first obstacle is a first motion type obstacle, obtain its real-time moving speed; Step S1511: Obtain a duration value corresponding to the feature training duration to obtain a feature training duration value; Step S1512: Calculate the feature training duration value, the first monitoring three-dimensional coordinate, and the second monitoring three-dimensional coordinate to obtain the real-time moving speed corresponding to the first motion type obstacle; Step S152: Repeat the process of acquiring the real-time moving speed, acquire the real-time moving speed corresponding to each obstacle of the first movement type, and obtain the real-time moving speed of the obstacle.

5. The method for simulated adversarial training based on multi-agent reinforcement learning according to claim 1, characterized in that: In step S2, the drone data is acquired, and the specific steps are as follows: Step S21: Obtain obstacle data, and obtain an adversarial training coordinate system according to the obstacle data; Step S22: In the adversarial training coordinate system, the coordinate point where the drone is currently located is taken as the first drone coordinate point, and the first drone coordinate point is taken as the reference drone coordinate point, and the time value corresponding to when the drone is at the reference drone coordinate point is obtained to obtain the coordinate point reference time value; Obtain the coordinate point of the drone at a characteristic time length before the coordinate point reference time value, and obtain the coordinate point of the second drone; Obtain the coordinate point of the drone when the coordinate point reference time value is two characteristic time lengths ahead, and obtain the coordinate point of the third drone; Step S23: obtaining three-dimensional coordinates corresponding to the first UAV coordinate point, the second UAV coordinate point, and the third UAV coordinate point respectively through the adversarial training coordinate system; Step S24: Acquire the duration value corresponding to the characteristic time length to obtain the characteristic duration value; Step S25: obtaining a real-time flight speed value corresponding to the first UAV coordinate point by calculating the three-dimensional coordinate corresponding to the first UAV coordinate point, the three-dimensional coordinate corresponding to the second UAV coordinate point, and the characteristic duration value; Step S26: defining the real-time flight speed value corresponding to the first UAV coordinate point as the real-time flight speed of the UAV; Step S27: Repeat the calculation process of the real-time flight speed value corresponding to the first UAV coordinate point, and calculate the real-time flight speed value corresponding to the second UAV coordinate point according to the three-dimensional coordinates corresponding to the second UAV coordinate point, the three-dimensional coordinates corresponding to the third UAV coordinate point, and the characteristic duration value; Step S28: Calculate the real-time flight acceleration of the drone by using the real-time flight speed value corresponding to the first drone coordinate point, the real-time flight speed value corresponding to the second drone coordinate point, and the characteristic duration value; Step S29: defining the real-time flight acceleration of the drone and the real-time flight speed of the drone as drone data.

Citation Information

Patent Citations

  • Collision avoidance planning method for mobile robots based on deep reinforcement learning in dynamic environment

    CN110632931A

  • Multi-unmanned aerial vehicle cooperative adversarial decision-making method based on evaluation-execution architecture

    CN112180967A

  • Unmanned cluster task collaboration method based on multi-agent reinforcement learning

    CN113589842A

  • Multi-robot cooperative confrontation method and device, electronic equipment and storage medium

    CN113894780A

  • Mobile agent dynamic path planning method in stage environment

    CN114815834A