Maneuvering decision training method based on online / offline hybrid reinforcement learning

Through the online/offline hybrid reinforcement learning method, combined with offline data and online data, the neural network is used to train UAV agents, which solves the problem of insufficient adaptability of traditional UAV autonomous decision-making algorithms in complex environments and achieves more efficient Autonomous decision-making and intelligence level.

CN118605156APending Publication Date: 2024-09-06AERONAUTICS RES INST OF CHINA
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410664644.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Traditional rule-based drone autonomous decision-making algorithms are difficult to adapt to complex operating environments. Reinforcement learning algorithms face problems such as sparse rewards and policy loops when making autonomous decisions, and offline reinforcement learning cannot encourage agents to explore new actions, leading to problems in complex environments. Insufficient adaptability.

Method used

Adopt a maneuver decision-making training method based on online/offline hybrid reinforcement learning, conduct flight competition training with rule-based expert models, mix offline training data and online data for policy updates, establish an online/offline hybrid SAC policy model, and use neural networks to conduct Strategy training and reward design for agents.

Benefits of technology

It improves the autonomous decision-making ability and intelligence level of drones in complex environments, improves training efficiency, and enables agents to have a higher ability to adapt to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118605156A
    Figure CN118605156A
Patent Text Reader

Abstract

The invention belongs to the technical field of unmanned aerial vehicles, and particularly relates to a maneuvering decision training method based on online / offline hybrid reinforcement learning. According to the technical scheme, the method comprises the following steps that a flight simulation environment is built, and flight competition rules are designed; an online / offline mixed SAC strategy model is built, and network parameters are designed; establishing an unmanned aerial vehicle continuous action space model; establishing state space input of the strategy model; designing an unmanned aerial vehicle flight competition award function; and building a flight competition training framework and training a hybrid online / offline hybrid SAC strategy model based on the framework. According to the method, strategy updating is carried out by mixing off-line training data of the expert model and on-line training data of the intelligent agent. Under the condition that the training efficiency is improved, the intelligent agent has a higher intelligent decision-making level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of unmanned aerial vehicles (UAVs), and in particular relates to a maneuver decision training method based on online / offline hybrid reinforcement learning. Background Art

[0002] In the future, drones, characterized by low cost, high payload, and high flexibility, are expected to become a vital component in various fields. However, the challenges posed by complex and changing operating environments are gradually becoming apparent. To improve drone operational capabilities, autonomous intelligent decision-making has become an essential development direction. By researching and applying advanced artificial intelligence technologies, drones can make autonomous decisions in various operational scenarios and adapt to changing operating environments, providing greater advantages for future applications. Therefore, the development trend of autonomous intelligent decision-making in drones cannot be ignored.

[0003] With the development of artificial intelligence algorithms, autonomous decision-making algorithms for drones based on reinforcement learning have become a research hotspot. Traditional rule-based autonomous decision-making algorithms for drones struggle to adapt to complex operating environments. Reinforcement learning algorithms can overcome this problem. Reinforcement learning can be divided into offline and online reinforcement learning. In online reinforcement learning, an agent learns optimal strategies through real-time interaction with the environment. Shan Shengzhe proposed a self-game reinforcement learning-based approach for autonomous decision-making in drones, improving the agent's performance through a "two-way competition" approach. Yang Kaida combined coalition training with the SAC algorithm to train agents for autonomous decision-making, improving the diversity of their strategies. Wang Baolai addressed the overfitting and policy looping issues of traditional reinforcement learning in solving autonomous decision-making problems and proposed a population game-based autonomous decision-making model training paradigm. Online reinforcement learning can fully leverage the agent's balance between exploration and exploitation, improving its adaptability to complex environments. However, it faces challenges such as sparse rewards and difficult reward design.

[0004] Compared to online reinforcement learning, offline reinforcement learning uses previously collected offline data for training, eliminating the need for real-time decision-making and interaction in the real environment. Its advantages include low sample collection costs and high sample data efficiency. However, it also suffers from the problem of exploration difficulties, failing to encourage the agent to explore new actions and instead limiting it to learning existing strategic actions.

[0005] When implementing autonomous decision-making for drones through reinforcement learning algorithms, efficiently utilizing empirical data and giving full play to the exploratory role of reinforcement learning are the key to ensuring the intelligence level of drones and improving the efficiency of algorithm training. Summary of the Invention

[0006] To sum up, the present invention provides a maneuver decision training method based on online / offline hybrid reinforcement learning, which performs flight competition training with a rule-based expert model and updates the strategy by mixing the offline training data of the expert model and the online training data of the intelligent agent.

[0007] The technical solutions for implementing the present invention are as follows:

[0008] 1. A maneuver decision training method based on online / offline hybrid reinforcement learning, comprising the following steps:

[0009] S1. Establish a six-degree-of-freedom dynamics model and a control model for the UAV, build a flight simulation environment, and design flight competition rules;

[0010] S2. Build an online / offline hybrid SAC strategy model, including two hybrid experience cache pools for storing offline and online data, and five neural networks; the five neural networks are the strategy actor network, two Q networks, a V value network, and a target V value network, and design the network parameters;

[0011] S3. Based on the UAV six-degree-of-freedom dynamics model and the UAV control model, a continuous motion space of the UAV is established to control the UAV movement;

[0012] S4. Generate the attitude, position relationship, and velocity relationship of the two UAVs based on the flight simulation environment, and establish the state space for building an online / offline hybrid SAC strategy model;

[0013] S5. Design a reward function for the drone flight competition based on the flight competition rules to judge the pros and cons of the situation and guide the neural network training and updating of the strategy model;

[0014] S6. Build an online / offline hybrid SAC strategy model agent and expert model flight competition training framework and train the hybrid online / offline hybrid SAC strategy model.

[0015] In step S1, the six-degree-of-freedom dynamic model of the drone takes the center of mass of the drone as the origin of the body coordinate system. The six-degree-of-freedom dynamic model of the drone is described by the six-degree-of-freedom dynamic equation of the drone. The six-degree-of-freedom dynamic equation of the drone is as follows:

[0016]

[0017] Among them, x, y, z are the three components of the UAV position in the ground coordinate system, V is the velocity, χ is the heading angle, γ is the track angle, α is the angle of attack, μ is the roll angle, p is the roll angular velocity, q is the pitch angular velocity, r is the yaw angular velocity, g is the acceleration of gravity, m is the mass, and I xx , I yy , Izz is the moment of inertia, L, D, Y, T are lift, drag, side force and thrust respectively, M x , M y , M z They are rolling moment, pitching moment and yaw moment respectively.

[0018] In step S1, the drone control model is specifically as follows: the lateral movement of the joystick controls the yaw motion of the drone, the longitudinal movement of the joystick controls the pitch motion of the drone; the pedals control the roll motion of the drone; and the throttle lever controls the thrust of the drone engine. According to the six-degree-of-freedom dynamic equation of the drone, by decoupling the net external force and torque acting on the drone, the net external force is the resultant force of lift, drag, side force and thrust; the torque is the roll moment, pitch moment and yaw moment, the control equation of the drone is constructed as follows:

[0019]

[0020] Where, F x ,F y ,F z They represent the components of the net external force F in the three directions in the ground coordinate system, C1 is the lateral displacement of the joystick; C2 is the longitudinal displacement of the joystick; C3 is the pedal displacement; T is the throttle lever displacement; Q is the control transfer matrix, which is determined by the model of the UAV.

[0021] In step S1, the flight simulation environment is established by instantiating two drones when the environment is initialized. The flight area of ​​the two drones is limited to a rectangular space of lkm×wkm×hkm, and the initial states of the two drones, including position, speed, attitude angle and track angle, are randomly initialized within the limited range.

[0022] In step S1, the flight competition rules are as follows: a drone controlled by an online / offline hybrid SAC strategy model and a drone controlled by a rule-based expert model compete in a flight competition. Both drones can obtain the position and speed information of the other drone. The drones use the relative position and relative angle conditions to determine the position and speed of the drones. If the position score obtained by one drone reaches a specified value or one drone stalls or crashes, the competition is deemed to be over, and the winner is determined based on the final result.

[0023] In step S2, the offline and online data acquisition method is as follows: the UAV controlled by the online / offline hybrid SAC strategy model and the UAV controlled by the rule-based expert model continuously interact with the environment during the flight competition to generate experience data, which is represented as online data and offline data, respectively. The online data comes from the UAV controlled by the online / offline hybrid SAC strategy model, and the offline data comes from the UAV controlled by the rule-based expert model.

[0024] In the step S2,

[0025] The hidden layer of the Actor network consists of two fully connected layers. The network size is 256×256 and the activation function is tanh. The input of the Actor network is the current state of the drone s. t , the output is the mean u and variance σ of the action Gaussian distribution, that is, the probability distribution π(a|s), and the action a in the current state is obtained by sampling the Gaussian distribution t ; By optimizing the Actor network parameters to continuously fit the approximate strategy π, the best action prediction for the current state is achieved; the strategy Actor network Φ is updated by gradient descent, and the loss function is defined as:

[0026]

[0027] Where λ is the temperature coefficient used to balance the proportional relationship between entropy H and reward r. The expression of entropy H is:

[0028]

[0029] The Q network hidden layer consists of two fully connected layers, the network structure size is 256×256, the activation function is tanh; the network input is the current state of the drone s t and the action a performed t , the network output is the Q value predicted by the neural network, which is used to evaluate the drone's execution of action a in the current state t The quality of Q network parameters Θ is updated by gradient descent, and the loss function is defined as:

[0030]

[0031] Where Q Θ (s t , a t ) is the output Q value of the soft-Q network, in The output V value of the target V value network; the two Q networks predict the Q value respectively, and the over-estimation of the Q value is prevented by selecting a smaller Q value, and the smaller network is selected to update the V value network.

[0032] The hidden layer of the V-value network consists of two fully connected layers. The network structure size is 256×256, and the activation function is tanh. The network input is the current state of the drone s t , the network output is the size of the V value predicted by the neural network, which is used to judge the state s t The quality of V value network parameter Ψ is updated by gradient descent, and the loss function is defined as:

[0033]

[0034] Where, Indicates taking the smaller estimated Q value of the two soft-Q networks.

[0035] The hidden layer of the target V value network consists of two fully connected layers. The network structure size is 256×256, and the activation function is tanh. The network input is the current state of the drone s t , the network output is the size of the V value predicted by the neural network; the target V value network parameter There is no need to update independently. It is only necessary to soft update the V value network sampling at a certain time Δt. The parameter update method is:

[0036] Ψ2=τΨ1+(1-τ)Ψ2, where τ is the soft update coefficient, which is used to control the soft update speed of the target V value network.

[0037] In step S3, the action space includes maneuvering decisions and missile launch decisions, which are specifically set as follows:

[0038] A=[C1,C2,C3,T,F m ]

[0039] Among them F m is the missile launch control quantity, C1, C2, and C3 are the lateral control, longitudinal control, and pedal of the joystick respectively.

[0040] In step S4, the state space is the observation quantity of the intelligent agent, which is the perception input of the drone to the flight competition situation. It can be described by the posture, position relationship, and speed relationship of the two flight competition teams. The state space of the models of the two competition teams is set to be the same, and the state space is set to:

[0041] S=[H,v x , v y , v z , δ ATA , δ AA , Δx, Δy, Δz, v enemy , v enemy , v enemy ] where H is the height of one’s own drone, Δx, Δy, Δz are the relative positions of one’s own drone and the other’s drone in three directions in the ground coordinate system, and u enemy 、v enemy 、w enemy is the speed of the other party's UAV in three directions in the ground coordinate system.

[0042] In step S5, the reward function for the designed drone flight competition is composed of a weighted combination of an occupation area reward function, an energy reward function, a distance reward function, an angle reward function, and an occupation success reward function, specifically:

[0043] (1) Occupancy zone reward function: describes whether the other party's drone is within the maximum occupation distance and the optimal occupation distance. When the other party's drone is outside the maximum occupation distance or within the minimum occupation distance, there is no reward; when the other party's drone is within the optimal occupation distance and the maximum occupation distance, a reward value of 0.75 is given; when the other party's drone is within the minimum occupation distance and the optimal occupation distance, a reward value of 2 is given. The specific reward function is as follows:

[0044]

[0045] Where r max Where r is the maximum occupied distance, noescape Where is the optimal occupancy distance, r min Where is the minimum occupation distance;

[0046] (2) Energy reward function: The energy in the flight competition includes potential energy and kinetic energy. Potential energy is represented by the height difference, and kinetic energy is represented by the speed difference. The energy advantage reward is set as:

[0047]

[0048] Where ΔV is the speed difference between the two aircraft, and ΔH is the height difference between the two aircraft;

[0049] (3) Distance reward function: To ensure that the UAV approaches the other party during the training process, a distance reward is set. When the UAV approaches the other party, a certain reward is given. The distance advantage reward is set as:

[0050]

[0051] Where R t is the distance between the two aircraft at time t;

[0052] (4) Angle reward function: In a flight competition, the field of view angle and antenna deflection angle are used to measure the angular advantage of both parties in the flight competition. The field of view angle is the angle between the velocity vector of the other party's drone and the line of sight, and the antenna deflection angle is the angle between the velocity vector of one's own drone and the line of sight. When the drone is in the state of tail chasing the target, it has a large angle reward, that is, the closer the field of view angle and antenna deflection angle are to zero, the greater the angle advantage. Based on the relationship between the two, the angle advantage reward function is designed as follows:

[0053]

[0054] Where, δ AA is the viewing angle, δATA is the antenna deflection angle;

[0055] (5) Reward function for successful occupation: When the drone successfully obtains the occupation score, it is rewarded. The occupation success is set as:

[0056]

[0057] Where, T kill A binary value indicating whether a placeholder score is obtained. If a placeholder score is obtained successfully, the score is 1; otherwise, the score is 0.

[0058] (6) The final reward function is composed of the weighted combination of the above five reward functions. During the flight competition simulation, at time t, the drone is in state s t Action taken when a t The reward value obtained is r(s t , a t ), the rule-based expert model is in state Take action When

[0059] r(s t , a t )=ω1r fire_control +ω2r energy +ω3r dis +ω4r angle +ω5r kill

[0060] Where ω1 to ω5 are the weight coefficients of the corresponding reward items.

[0061] In step S6, the flight competition training framework is specifically described as follows: an online / offline hybrid SAC strategy model is used to control drone A, and a rule-based expert model is written to control drone B. The two drones are randomly initialized and fly in competition with each other, generating a large amount of experience data and storing it in their respective experience buffer pools. When the strategy is updated, batches of experience data are randomly extracted proportionally from the two experience buffer pools to update the five neural networks. The specific steps are as follows:

[0062] (1) Initialize the Q value network with random network parameters Θ1, Θ2 and Φ respectively and Actor Network π Φ (s), and initialize the V value network with random network parameters Ψ1 And copy the same network parameters Ψ2←Ψ1, initialize the target V value network

[0063] (2) Set hyperparameters: learning rate lr, batch size batch_size, discount factor γ, experience replay cache size, maximum training round epoch max , temperature coefficient λ, offline data ratio w, initial training round number epocg0 = 1;

[0064] (3) Initialize the state s of the agent and the expert model t 、

[0065] (4) Change the state s t Input into the main strategy Actor network to obtain action a t At the same time, the state Input into the expert model, which generates actions based on the rules In state s t Next, perform action a t Get the next moment state s t+1 And the current reward r(s t , a t ), record training data t , a t , s t+1 ,r(s t , a t )>, put it into the agent's experience cache pool, and at the same time, Input into the expert model, which generates actions based on the rules In state Next action Get the next moment status and current rewards Record training data Put it into the experience cache pool of the expert model;

[0066] (5) When the amount of training data in the experience buffer pool of the agent and the expert model is greater than the batch size, w batch_size experience data is randomly extracted from the experience buffer pool of the expert model, and (1-w) batch_size experience data is randomly extracted from the experience buffer pool of the agent to form a batch of experience data for updating the Actor network, Q value network, V value network and target V value network in the agent strategy; under the learning rate lr, the Adam optimizer and the loss function defined by each network are used to update the network parameters;

[0067] (6) If the agent and the expert model end the simulation of this round, execute step (3) and set epoch now =epoch now +1, otherwise let s t =s​t+1 , continue with steps (4) and (5);

[0068] (7) If the algorithm model reaches the maximum training round, epoch now epoch max , then the training ends and the trained policy model is saved; otherwise, go to step (3).

[0069] The present invention provides a method for training maneuverable decision-making based on online / offline hybrid reinforcement learning. This method updates strategies by blending offline expert model training data with online agent training data. This improves training efficiency and enables agents to achieve higher levels of intelligent decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The accompanying drawings are intended to further explain the present invention in combination with examples and are not intended to limit the present invention.

[0071] Figure 1 This is the overall flow chart of the flight competition maneuver decision algorithm based on online / offline hybrid reinforcement learning of the present invention;

[0072] Figure 2 This is a training framework diagram for flight competition between an intelligent agent and an expert model of the present invention;

[0073] Figure 3 This is a training flow chart of the flight competition maneuver decision algorithm based on online / offline hybrid reinforcement learning of the present invention. DETAILED DESCRIPTION

[0074] In order to more accurately describe the technical solutions and features of the present invention, the present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0075] The present invention provides a maneuver decision training method based on online / offline hybrid reinforcement learning, such as Figure 1 Shown, including:

[0076] 1. Establish a six-degree-of-freedom dynamic model and a control model for the UAV, build a flight simulation environment, and design flight competition rules;

[0077] 1.1 Constructing a six-degree-of-freedom dynamic model of the drone

[0078] Taking the center of mass of the drone as the origin of the body coordinate system, the six-degree-of-freedom dynamic equation of the drone is as follows:

[0079]

[0080] Where x, y, and z are the three components of the UAV's position in the ground coordinate system, V is the velocity, χ is the heading angle, γ is the track angle, α is the angle of attack, μ is the roll angle, p is the roll angular velocity, q is the pitch angular velocity, r is the yaw angular velocity, g is the acceleration of gravity, m is the mass, and I is the velocity. xx , I yy , I zz is the moment of inertia, L, D, Y, T are lift, drag, side force and thrust respectively, M x , M y , M z They are rolling moment, pitching moment and yaw moment respectively.

[0081] 1.2 Building a drone control model

[0082] UAVs are fixed-wing aircraft, and their control quantities are the displacement of the joystick, pedals, and throttle lever. The joystick and pedals change the aerodynamic force by changing the deflection angles of the elevator or all-moving horizontal stabilizer, ailerons, and rudder, thereby changing the attitude angle of the drone to achieve control of the pitch angle, roll angle, and yaw angle. Specifically, the joystick is divided into lateral movement and longitudinal movement. The lateral movement of the joystick controls the yaw movement of the drone, and the longitudinal movement of the joystick controls the pitch movement of the drone. The pedals control the roll movement of the drone. The throttle lever controls the thrust of the drone engine. The control quantity of the drone is decoupled to the net external force and torque acting on the drone through the control equation. The control equation is as follows:

[0083]

[0084] Where C1 is the lateral displacement of the joystick; C2 is the longitudinal displacement of the joystick; C3 is the pedal displacement; T is the throttle lever displacement; Q is the control transfer matrix, which is determined by the model of the UAV.

[0085] 1.3 Building a flight simulation environment

[0086] The flight competition is calculated in rounds, and each round requires environment initialization. During environment initialization, two drones are instantiated and controlled by an online / offline hybrid SAC policy model and a rule-based expert model, respectively. The flight competition area for the two drones is confined to a rectangular space measuring 35 km x 35 km x 20 km. The initial states of the two drones, including position, velocity, attitude angle, and track angle, are randomly generated within the specified range.

[0087] 1.4 Design Flight Competition Rules

[0088] Two drones, controlled by an online / offline hybrid SAC strategy model and a rule-based expert model, compete in a flight competition. One drone obtains the other's position and velocity information and earns a positional score when specified relative position and angle conditions are met. The round ends if either drone's positional score reaches a specified threshold, or if either drone stalls or crashes.

[0089] 2. Build an online / offline hybrid SAC strategy model and set network parameters

[0090] The online / offline hybrid SAC strategy model includes the construction of two hybrid experience cache pools for storing offline and online data respectively and five neural networks. The neural networks include one policy actor network, two Q-value networks, one V-value network and one target V-value network. The parameters of the five neural networks are Φ, Θ1, Θ2, Ψ1 and Ψ2 respectively.

[0091] 2.1 The offline and online data acquisition methods are as follows: During the flight competition, the UAVs controlled by the online / offline hybrid SAC strategy model and the UAVs controlled by the rule-based expert model continuously interact with the environment to generate experience data, which are represented as online data and offline data, respectively. The online data comes from the UAV controlled by the online / offline hybrid SAC strategy model, and the offline data comes from the UAV controlled by the rule-based expert model.

[0092] 2.2 Design Strategy Actor network, whose hidden layer consists of two fully connected layers, the network structure is 256×256, and the activation function is tanh. The input of the Actor network is the current state of the drone s t , the output is the mean u and variance σ of the action Gaussian distribution, that is, the probability distribution π(a|s), and the action a in the current state is obtained by sampling the Gaussian distribution t By optimizing the Actor network parameters to continuously fit the approximate strategy π, the best action prediction for the current state is achieved. The strategy Actor network Φ is updated by gradient descent, and the loss function is defined as:

[0093]

[0094] Where λ is the temperature coefficient used to balance the proportional relationship between entropy H and reward r. The expression of entropy H is:

[0095]

[0096] 2.3 Construct the Q network, whose hidden layer consists of two fully connected layers, the network structure is 256×256, and the activation function is tanh. The network input is the current state of the drone s t and the action a performedt , the network output is the Q value predicted by the neural network, which is used to evaluate the drone's execution of action a in the current state t The Q network parameters Θ are updated by gradient descent, and the loss function is defined as:

[0097]

[0098] Where Q Θ (s t , a t ) is the output Q value of the soft-Q network, in The output V value of the target V value network. The two Q networks predict the Q value respectively, and the over-estimation of the Q value is prevented by selecting the smaller Q value, and the smaller network is selected to update the V value network.

[0099] 2.4 Design the V value network, whose hidden layer consists of two fully connected layers, the network structure is 256×256, and the activation function is tanh. The network input is the current state of the drone s t , the network output is the size of the V value predicted by the neural network, which is used to judge the state s t The V value network parameter Ψ is updated by gradient descent, and the loss function is defined as:

[0100]

[0101] Where, Indicates taking the smaller estimated Q value of the two Q networks.

[0102] 2.5 Build the target V value network, whose hidden layer consists of two fully connected layers, the network structure is 256×256, and the activation function is tanh. The network input is the current state of the drone s t , the network output is the size of the V value predicted by the neural network. target V value network parameter There is no need to update independently. It is only necessary to soft update the V value network sampling at a certain time Δt. The parameter update method is:

[0103] Ψ2=τΨ1+(1-τ)Ψ2

[0104] Wherein, τ is the soft update coefficient, which is used to control the soft update speed of the target V value network. In the embodiment of the present invention, τ is set to 0.005.

[0105] 3. Based on the UAV's six-degree-of-freedom dynamics model and the UAV control model, establish an intelligent agent continuous action space model to control the UAV's motion;

[0106] 3.3 Designing the Action Space for UAV Flight Competition

[0107] The UAV's action space includes maneuvering decisions and missile launch decisions. The action space is set according to the six-degree-of-freedom UAV dynamics model and control model. The action space includes maneuvering decisions and missile launch decisions. The specific settings are:

[0108] A=[C1,C2,C3,T,F m ]

[0109] Where, F m It is the missile launch control quantity.

[0110] In the specific example of the present invention, in order to make the algorithm converge faster, the action space is normalized, that is, C1, C2, C3, T, F m ∈[-1, 1]. Among them, C1, C2, C3 are the lateral control, longitudinal control and pedal of the joystick. When C1, C2, C3 are all 0, it means that the rudder angle for controlling pitch, yaw and roll is 0; when C1, C2, C3 are plus or minus 1, it means that the rudder angle is at the extreme position; T represents the control of the throttle stick. When T = -1, it means that the throttle thrust is minimum, when T = 1, it means that the throttle thrust is maximum; when F m >0, it means launching missiles. m When <0, it means no missile is launched.

[0111] 4. Generate the attitude, position, and velocity relationships of the two drones based on the flight simulation environment, and establish the state space for building an online / offline hybrid SAC strategy model;

[0112] The state space is the observation quantity of the agent and the perception input of the drone to the flight competition situation. It can be described by the posture, position relationship, and speed relationship of the two competing parties. The state space is set according to the information obtained in step 1.3. In this invention, the state space setting of the agent and the expert model is the same, both of which are:

[0113] S=[H,v x , v y , v z , δ ATA , δ AA , Δx, Δy, Δz, v x , v y , v z ]

[0114] Where H is the height of one's own drone, Δx, Δy, Δz are the relative positions to the other drone, and u enemy 、v enemy 、w enemy is the speed of the other drone. s tRepresents the state at time t.

[0115] 5. According to the flight competition rules, the reward function for the designed drone flight competition is composed of a weighted combination of the occupation area reward function, energy reward function, distance reward function, angle reward function, and occupation success reward function, which is used to judge the pros and cons of the situation;

[0116] 5.1 Placeholder Reward Function

[0117] It is used to describe whether the other party's drone is within the maximum occupation distance and the optimal occupation distance of the fire control solution. When the other party's drone is outside the maximum occupation distance or within the minimum safe launch distance, there is no reward; when the other party's drone is within the optimal occupation distance and the maximum occupation distance, a reward value of 0.75 is given; when the other party's drone is within the minimum safe launch distance and the optimal occupation distance, a reward value of 2 is given. The specific reward function is as follows:

[0118]

[0119] Where r max Where r is the maximum occupied distance, noescape Where is the optimal occupancy distance, r min Where is the minimum space distance.

[0120] 5.2 Energy Reward Function

[0121] The energy during the flight competition includes potential energy and kinetic energy. Potential energy is reflected by the altitude difference, and kinetic energy is reflected by the speed difference. The energy advantage reward is set as:

[0122]

[0123] Where ΔV is the speed difference between the two aircraft, and ΔH is the height difference between the two aircraft.

[0124] 5.3 Distance Reward Function

[0125] In order to ensure that the agent approaches the other party during training, a distance reward is set. When the agent approaches the other party, a certain reward is given. The distance advantage reward is set as:

[0126]

[0127] 5.4 Angle Reward Function

[0128] In flight competitions, the field of view angle and antenna deflection angle are used to measure the angular advantage of each competitor. The field of view angle is the angle between the opponent's drone's velocity vector and the line of sight, while the antenna deflection angle is the angle between the own drone's velocity vector and the line of sight. When a drone is in a tail-chasing state, it has a large angular reward. That is, the closer the field of view angle and antenna deflection angle are to zero, the greater the angular advantage. Based on the relationship between the two, the angular advantage reward function is designed as follows:

[0129]

[0130] 5.5 Placeholder Success Reward Function

[0131] When the aircraft successfully obtains the occupation score, it will be rewarded. The occupation score is set as:

[0132]

[0133] Where, T kill A binary value indicating whether a placeholder score is obtained. If a placeholder score is obtained successfully, the value is 1; otherwise, the value is 0.

[0134] 5.6 Final Flight Competition Reward Function

[0135] The final reward function is composed of the weighted combination of the above five reward functions. During the flight competition simulation, the drone is in state s at time t. t Action taken when a t The reward value obtained is r(s t , a t ), the rule-based expert model is in state Take action When

[0136] r(s t , α t )=ω1r fire_control +ω2r energy +ω3r dis Ten ω4r angle Ten ω5r kill

[0137] Where ω1 to ω5 are weight coefficients of the corresponding reward items. In the examples of the present invention, w is always 1.

[0138] 6. Build a flight competition training framework for intelligent agents and expert models and train an online / offline hybrid SAC strategy model;

[0139] 6.1 According to step 3, an online / offline hybrid SAC strategy model is set up to control UAV A, and a rule-based expert model is used to control UAV B. The two UAVs have random initial states and engage in flight competitions with each other, generating a large amount of experience data and storing it in their respective experience cache pools. When the strategy is updated, batch experience data is randomly extracted from the two experience cache pools at a certain ratio.

[0140] 6.2 The specific steps of training the network are as follows, and the flow chart is as follows Figure 3 As shown:

[0141] (1) Initialize the Q value network with random network parameters Θ1, Θ2 and Φ respectively and Actor Network π Φ (s), and initialize the V value network with random network parameters ψ1 And copy the same network parameters ψ2←ψ1, initialize the target V value network

[0142] (2) Set hyperparameters: learning rate lr, batch size batch_size, discount factor γ, experience replay cache size, maximum training round epoch max , temperature coefficient λ, offline data ratio w, initial training round number epoch0 = 1. In the embodiment of the present invention, the learning rate lr is 0.0001, the batch size batch_size is 128, the temperature coefficient λ = 1, and the offline data ratio w = 0.2.

[0143] (3) Initialize the state s of the agent and the expert model t 、

[0144] (4) Change the state s t Input into the main strategy Actor network to obtain action a t At the same time, the state Input into the expert model, which generates actions based on the rules In state s t Next, perform action a t Get the next moment state s t+1 And the current reward r(s t , a t ), record training data t , a t , s t+1 ,r(s t , a t )>, put it into the agent's experience cache pool, and at the same time, Input into the expert model, which generates actions based on the rules In state​ Next action Get the next moment status and current rewards Record training data Put it into the experience cache pool of the expert model.

[0145] (5) When the amount of training data in the experience pools of the agent and expert model exceeds batch_size, experience data of size w·batch_size is randomly extracted from the expert model experience pool, and experience data of size (1-ω)·batch_size is randomly extracted from the agent experience pool to form batch experience data for updating the Actor network, Q-value network, V-value network, and target V-value network in the agent strategy. Network parameters are updated using the Adam optimizer and the loss function defined for each network at a learning rate of lr.

[0146] (6) If the agent and the expert model end the simulation of this round, execute step (3) and set epoch now =epoch now +1, otherwise let s t =s t+1 , continue with steps (4) and (5).

[0147] (7) If the algorithm model reaches the maximum training round, epoch now epoch max , then the training ends and the trained policy model is saved; otherwise, go to step (3). Specific embodiment 1:

[0149] The implementation steps are as follows:

[0150] (1) Design the UAV dynamics model and flight simulation environment according to the method proposed in this invention.

[0151] (2) Design the state space, action space and reward function according to the method proposed in this invention.

[0152] (3) Build an online / offline hybrid SAC strategy model and set network parameters according to the method proposed in this invention.

[0153] (4) According to the method proposed in this invention, a training framework for the flight competition between intelligent agents and expert models is constructed and an online / offline hybrid SAC strategy model is trained.

Claims

1. A maneuver decision training method based on online / offline hybrid reinforcement learning, characterized in that: The following steps are involved: S1. Establish a six-degree-of-freedom dynamics model and a control model for the UAV, build a flight simulation environment, and design flight competition rules; S2. Build an online / offline hybrid SAC strategy model, including building two hybrid experience cache pools for storing offline and online data and five neural networks; the five neural networks are the strategy Actor network, two Q networks, a V value network and a target V value network, and design the network parameters; S3. According to the UAV six-degree-of-freedom dynamics model and the UAV control model, a UAV continuous motion space is established to control the UAV movement; S4. Generate the attitude, position relationship and speed relationship of the two UAVs according to the flight simulation environment, and establish the state space of the online / offline hybrid SAC strategy model; S5. According to the flight competition rules, design the reward function of the drone flight competition to judge the pros and cons of the situation and guide the neural network training and updating of the strategy model; S6. Build an online / offline hybrid SAC strategy model agent and expert model flight competition training framework and train a hybrid online / offline hybrid SAC strategy model.

2. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 1, characterized in that: In step S1, the six-degree-of-freedom dynamics model of the drone takes the center of mass of the drone as the origin of the body coordinate system. The six-degree-of-freedom dynamics model of the drone is described by the six-degree-of-freedom dynamics equation of the drone. The six-degree-of-freedom dynamics equation of the drone is as follows: Among them, x, y, z are the three components of the drone's position in the ground coordinate system, V is the velocity, χ is the heading angle, γ is the track angle, α is the angle of attack, μ is the roll angle, p is the roll angular velocity, q is the pitch angular velocity, r is the yaw angular velocity, g is the gravitational acceleration, m is the mass, and I is the xx , I yy , I zz is the moment of inertia, L, D, Y, T are lift, drag, side force and thrust respectively, M x , M y , M z They are rolling moment, pitching moment and yaw moment respectively.

3. The online / offline hybrid reinforcement learning maneuver decision training method as claimed in claim 2, characterized in that: In step S1, the drone control model is specifically as follows: the lateral movement of the joystick controls the yaw motion of the drone, the longitudinal movement of the joystick controls the pitch motion of the drone; the pedals control the roll motion of the drone; the throttle lever controls the thrust of the drone engine; according to the six-degree-of-freedom dynamics equation of the drone, by decoupling the combined external force and torque acting on the drone; the combined external force is the combined force of lift, drag, side force and thrust; the torque is the roll torque, pitch torque and yaw torque, the control equation of the drone is constructed as follows: In the formula, F x , F y , F z They respectively represent the components of the resultant external force F in the three directions in the ground coordinate system, C1 is the lateral displacement of the joystick; C2 is the longitudinal displacement of the joystick; C3 is the pedal displacement; T is the throttle lever displacement; Q is the control transfer matrix, which is determined by the model of the UAV.

4. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 1, characterized in that: In step S1, the flight simulation environment is established by instantiating two UAVs when the environment is initialized. The flight area of ​​the two UAVs is limited to a rectangular space of lkm×wkm×hkm. The initial states of the two UAVs, including position, speed, attitude angle and track angle, are randomly initialized within the limited range.

5. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 1, characterized in that: In step S1, the flight competition rules are as follows: the drones controlled by the online / offline hybrid SAC strategy model and the drones controlled by the rule-based expert model compete in flight. Both drones can obtain the position information and speed information of the other drones, and the occupancy score is judged by the relative position and relative angle conditions. If the occupancy score obtained by one party reaches the specified value or one party stalls or falls to the ground, the game is judged to be over, and the winner is determined based on the final result.

6. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 1, characterized in that: In step S2, the offline and online data acquisition method is as follows: the UAV controlled by the online / offline hybrid SAC strategy model and the UAV controlled by the rule-based expert model continuously interact with the environment during the flight competition to generate experience data, which are respectively represented as online data and offline data. The online data comes from the UAV controlled by the online / offline hybrid SAC strategy model, and the offline data comes from the UAV controlled by the rule-based expert model.

7. The online / offline hybrid reinforcement learning maneuver decision training method as claimed in claim 1, characterized in that: In step S2, The hidden layer of the Actor network consists of two fully connected layers. The network structure size is 256*256, and the activation function is tanh. The input of the Actor network is the current state of the drone s t , the output is the mean u and variance σ of the action Gaussian distribution, that is, the probability distribution π(a|s). The action a in the current state is obtained by sampling the Gaussian distribution t ; By optimizing the Actor network parameters to continuously fit the approximate strategy π, the best action prediction for the current state is achieved; the strategy Actor network Φ is updated by gradient descent, and the loss function is defined as: Where λ is the temperature coefficient used to balance the proportional relationship between entropy H and reward r. The expression of entropy H is: The Q network hidden layer consists of two fully connected layers. The network structure size is 256*256, and the activation function is tanh. The network input is the current state of the drone s t and the action performed t The network output is the Q value predicted by the neural network, which is used to evaluate the drone's execution of action a in the current state. t The quality of Q network parameters Θ is updated by gradient descent, and the loss function is defined as: In the formula, Ω θ (s t , a t ) is the output Q value of the soft-Q network, in is the output V value of the target V value network; the two Q networks predict the Q value respectively, and the over-estimation of the Q value is prevented by selecting a smaller Q value, and the smaller network is selected to update the V value network. The hidden layer of the V value network consists of two fully connected layers. The network structure size is 256*256, and the activation function is tanh. The network input is the current state of the drone s t The network output is the value of V predicted by the neural network, which is used to judge the state s t The quality of V value network parameter ψ is updated by gradient descent, and the loss function is defined as: In the formula, Indicates taking the smaller estimated Q value of the two soft-Q networks. The hidden layer of the target V value network consists of two fully connected layers. The network structure size is 256*256, and the activation function is tanh. The network input is the current state of the drone s t , the network output is the size of the V value predicted by the neural network; the targetV value network parameter There is no need to update independently. It only needs to soft update the V value network sampling at a certain time Δt. The parameter update method is: Ψ2=τΨ1+(1-τ)Ψ2 Where τ is the soft update coefficient, which is used to control the soft update speed of the target V value network.

8. The online / offline hybrid reinforcement learning maneuver decision training method as claimed in claim 3, characterized in that: In step S3, the action space includes maneuver decisions and missile launch decisions, which are specifically set as: A=[C1,C2,C3,T,F m ] where F m is the missile launch control quantity, C1, C2, C3 are the lateral control, longitudinal control and pedal of the joystick respectively.

9. The online / offline hybrid reinforcement learning maneuver decision training method as claimed in claim 1, characterized in that: In step S4, the state space is the observation quantity of the intelligent agent, which is the perception input of the drone to the flight competition situation. It can be described by the posture, position relationship, and speed relationship of the two flight competition parties. The state space of the models of the two competition parties is set to the same, and the state space is set to: S=[H,v x ,v y ,v z ,δ ATA ,δ AA ,Δx,Δy,Δz,v enem y,v enemy ,v enemy ] Where H is the height of the drone, Δx, Δy, Δz are the relative positions of the drone and the other drone in the three directions in the ground coordinate system, and u enemy 、v enemy 、w enemy is the speed of the other party’s UAV in three directions in the ground coordinate system.

10. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 1, characterized in that: In step S5, the reward function for the designed drone flight competition is composed of a weighted combination of an occupation area reward function, an energy reward function, a distance reward function, an angle reward function, and an occupation success reward function, specifically: (1) Occupancy zone reward function: describes whether the other party’s drone is within the maximum occupation distance and the optimal occupation distance. When the other party’s drone is outside the maximum occupation distance or within the minimum occupation distance, there is no reward; when the other party’s drone is within the optimal occupation distance and the maximum occupation distance, a reward value of 0.75 is given; when the other party’s drone is within the minimum occupation distance and the optimal occupation distance, a reward value of 2 is given. The specific reward function is as follows: In the formula, r max Where is the maximum occupied distance, r noeseape Where is the optimal occupancy distance, r min Where is the minimum occupied distance; (2) Energy reward function: The energy in the flight competition process includes potential energy and kinetic energy. Potential energy is reflected by the height difference, and kinetic energy is reflected by the speed difference. The energy advantage reward is set as: In the formula, ΔV is the speed difference between the two aircraft, and ΔH is the height difference between the two aircraft; (3) Distance reward function: To ensure that the UAV approaches the other party during the training process, a distance reward is set. When the UAV approaches the other party, a certain reward is given. The distance advantage reward is set as: In the formula, R t is the distance between the two aircraft at time t; (4) Angle reward function: In a flight competition, the field of view angle and antenna deflection angle are used to measure the angle advantage of both parties in the flight competition. The field of view angle is the angle between the speed vector of the other party's drone and the line of sight, and the antenna deflection angle is the angle between the speed vector of one's own drone and the line of sight. When the drone is in a tail-chasing state, it has a large angle reward, that is, the closer the field of view angle and antenna deflection angle are to zero, the greater the angle advantage. The angle advantage reward function is designed based on the relationship between the two: In the formula, δ AA is the viewing angle, δ ATA is the antenna deflection angle; (5) Reward function for successful occupation: When the drone successfully obtains the occupation score, it is rewarded. The occupation success is set as: Where, T kill A binary value indicating whether a placeholder score is obtained. If a placeholder score is obtained successfully, the value is 1; otherwise, the value is 0. (6) The final reward function is composed of the weighted combination of the above five reward functions. During the flight competition simulation, the drone is in state s at time t. t Action taken when a t The reward value obtained is r(s t , a t ), the rule-based expert model is in state Take Action When r(s t ,a t )=ω1r fire_control +ω2r energy +ω3r dis +ω4r angle +ω5r kill Where ω1 to ω5 are the weight coefficients of the corresponding reward items.

11. The online / offline hybrid reinforcement learning maneuver decision training method according to claim 5, characterized in that: In step S6, the flight competition training framework is specifically described as follows: an online / offline hybrid SAC strategy model is used to control UAV A, and a rule-based expert model is written to control UAV B. The two UAVs have random initial states and compete with each other in flight, generating a large amount of experience data and storing them in their respective experience cache pools. When the strategy is updated, batch experience data is randomly extracted from the two experience cache pools in proportion to update the five neural networks. The specific steps are as follows: (1) Initialize the Q value network with random network parameters Θ1, Θ2 and Φ respectively and Actor Network π Φ (s), and initialize the V value network with random network parameters Ψ1 And copy the same network parameters Ψ2←Ψ1, initialize the target V value network (2) Set hyperparameters: learning rate lr, batch size batch_size, discount factor γ, experience replay cache size, maximum training round epoch max , temperature coefficient λ, offline data ratio w, initial training round number epoch0 = 1; (3) Initialize the state s of the agent and the expert model t , (4) Set the state s t Input into the main strategy Actor network to get action a t At the same time, the state Input into the expert model, which generates actions based on rules In status t Next, perform action a t Get the next moment state s t+1 And the current reward r(s t , a t ), record the training data t , a t ,s t+1 ,r(s t , a t )>, put it into the agent's experience cache pool, and at the same time, Input into the expert model, which generates actions based on rules In Status Next action Get the next moment status And the current rewards Recording training data Put it into the experience cache pool of the expert model;​ (5) When the amount of training data in the experience buffer pool of the agent and the expert model is greater than the batch size, w·batch_size experience data is randomly extracted from the experience buffer pool of the expert model, and (1-w)·batch_size experience data is randomly extracted from the experience buffer pool of the agent to form batch experience data for updating the Actor network, Q value network, V value network and target V value network in the agent strategy; at the learning rate lr, the Adam optimizer and the loss function defined by each network are used to update the network parameters; (6) If the agent and the expert model end the simulation of this round, execute step (3) and set epoch now =epoch now +1, otherwise let s t =s t+1 , continue with steps (4) and (5); (7) If the algorithm model reaches the maximum training round, epoch now >epoch max , then the training is finished and the trained policy model is saved; otherwise, go to step (3).

Citation Information

Cited By

  • Video behavior prediction method and system based on world knowledge model

    CN119068401A

  • Flight special situation task training quality improvement method and system based on reinforcement learning

    CN119357531A

  • Unmanned aerial vehicle evasion strategy determination method and device based on reinforcement learning, equipment and medium

    CN119861744A

  • Distributed multi-agent traffic signal cooperative control method

    CN119889066A