Highway lane change test scene generation method based on multi-agent reinforcement learning

Generating highway lane-changing test scenarios through multi-agent reinforcement learning solves the problems of insufficient diversity and uncertainty in test scenarios in the existing technology, achieves efficient and high-quality test scenario generation, and enhances the testing of autonomous driving algorithms. ability.

CN118709529APending Publication Date: 2024-09-27HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing autonomous driving testing methods have shortcomings in the diversity and uncertainty of test scenarios. Traditional testing methods are time-consuming and labor-intensive. Although methods based on single-agent reinforcement learning increase the diversity of scenarios, the scene construction is complex and cannot be generated efficiently. Radical and uncertain testing scenarios.

Method used

A highway lane-changing test scenario generation method based on multi-agent reinforcement learning is adopted. By defining the vehicle status and action set, a strategy and value network are constructed, and the optimal strategy network model of the two vehicles is trained using the reward function to generate a diversity and Uncertain highway lane changing test scenario.

Benefits of technology

It improves the efficiency and quality of test scene generation. The generated trajectory flow is more in line with the real situation, increases the dynamic game-playing of edge scenes, and generates test scenes that are more aggressive and random, improving the ability to test autonomous driving algorithms. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709529A
    Figure CN118709529A
Patent Text Reader

Abstract

The invention discloses a multi-agent reinforcement learning-based highway lane change test scene generation method, which comprises the steps of 1, building a highway lane change scene, 2, defining a state, an action and a reward function required by multi-agent reinforcement learning according to scene requirements, 3, building a strategy, a value and a target network required by reinforcement learning, 4, extracting the state from the scene, the method comprises the following steps of 1, selecting a strategy network, and updating a scene state according to an action output by the strategy network, 5, sampling data in an experience playback pool, and updating network parameters by using an MADDPG algorithm, and 6, returning to the step 4, and sequentially executing until network training is completed. According to the method, the highway test scene with certain aggressive and random behaviors can be trained through a multi-agent reinforcement learning method, so that a more anthropomorphic and random test scene can be generated through a simple method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving testing, and specifically to a method for generating aggressive vehicle behavior in a high-speed lane-changing scenario based on multi-agent reinforcement learning. Background Art

[0002] At present, with the rapid development of autonomous driving technology, autonomous driving vehicles are gradually moving from test demonstration to mass production and commercialization. Ensuring that autonomous driving vehicles undergo rigorous safety tests before they go on the road is an important part of protecting people’s lives and property.

[0003] How to test autonomous vehicles efficiently, safely and economically has become one of the urgent needs of many car companies. At present, domestic and foreign autonomous driving test methods can be divided into two categories: traditional test methods and scenario-based virtual simulation tests. With the continuous improvement of the level of autonomous driving, traditional test methods have shown great disadvantages in terms of safety, test cycle and test cost. The scenario-based virtual simulation test method has shown great advantages in terms of scenario configuration, test efficiency, safety, test cost and test repeatability. However, most of the current scenario generation is based on fixed driving algorithms, which cannot fully consider the diversity and uncertainty of test scenarios. A few test scenarios are generated by single-agent reinforcement learning, that is, in the process of test scenario generation, only the vehicle trajectory flow of traffic vehicles is trained, and the tested vehicle still uses traditional algorithms. Although this method can increase the diversity and uncertainty of test scenarios to a certain extent, the construction of the scenario still requires the addition of complex traditional driving algorithms, which is time-consuming and labor-intensive. Summary of the invention

[0004] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a method for generating highway lane changing test scenarios based on multi-agent reinforcement learning, in order to generate dangerous test scenarios with diversity and uncertainty while having a certain degree of simplicity in high-speed lane changing test scenarios, so as to effectively solve the problem of difficulty in generating marginal test scenarios, thereby improving the efficiency of test scenario generation and improving the problems of monotony and determinism of test scenarios.

[0005] To achieve the above object, the present invention adopts the following technical solution:

[0006] The method for generating a highway lane-changing test scenario based on multi-agent reinforcement learning of the present invention is characterized in that it is applied to a straight-line scenario of a one-way two-lane highway, wherein the straight-line scenario of the highway includes an agent 1 car and an agent 2 car, wherein the agent 1 car is driving in the left lane, and the agent 2 car is driving in the right lane in the same direction as the car, and when the agent 1 car intends to overtake the agent 2 car, the highway lane-changing test scenario generation includes the following steps:

[0007] Step 1: Establish a global coordinate system with the midpoint of the starting lines of the two lanes as the origin, the forward direction of the road as the x-axis direction, and the right side of the road as the y-axis direction. Obtain the state parameters and scene information of the vehicle in the global coordinate system, including: the coordinates of agent 1 (x1, y1), the speed v1 of agent 1, and the acceleration of agent 1 The driving angle θ1 of agent1's car, the yaw rate of agent1's car The coordinates of agent2's car (x2, y2), the speed of agent2's car v2, and the acceleration of agent2's car The single refresh time DT of the scene, the timestamp t of the scene;

[0008] Step 2: Define the state set S=S1,S2 of agent1 and agent2, where S1 is the state of agent1, S2 is the state of agent2, and S1=S2=v1,v2,v2-v1,x1,y1,x2,y2,d,θ1, where d is the distance between agent1 and agent2.

[0009] Step 3: Define the action set A = A1, A2 of agent1 and agent2, where A1 is the action of agent1, A2 is the action of agent2, and and

[0010] Step 4: Construct the reward set R = R1, R2 for agent 1 and agent 2, where R1 is the reward for agent 1 and is obtained by equation (1), and R2 is the reward for agent 2.

[0011] Step 5: Randomly initialize two network parameters θ1 and θ2 to build the policy network of agent 1 and the policy network of agent2

[0012] Randomly initialize two network parameters ω1 and ω2 to build the agent 1 car-to-car strategy network Value Network and agent2 car-to-car strategy network Value Network

[0013] Build the target policy network for agent1 and the target policy network of agent2 in, Represent the target strategy network The target strategy network of Network parameters and initialization Among them, ← indicates assignment;

[0014] Construct the target value network of agent1 car and the target value network of agent2 car in, Represent the target value network and target value network The network parameters are initialized

[0015] Step 6: Initialize the experience replay pool

[0016] Step 7: Initialize the straight line scene on the highway so that the agent 1 car is in the left lane and behind the agent 2 car, and the agent 2 car is in the right lane;

[0017] Step 8: Get the state s1 of agent 1's car and the state s2 of agent 2's car at the current moment of the scene;

[0018] Step 9: Use equations (12) and (13) to get the action a1 selected by agent 1 and the action a2 selected by agent 2:

[0019]

[0020] In formula (12) and formula (13), Indicates noise;

[0021] Step 10: Use equations (14) and (15) to restrict and process a1 and a2 output by the policy network respectively, and obtain the acceleration of agent 1 and agent 2. and the yaw rate of agent1

[0022]

[0023] In formula (14) and formula (15), α1 and α2 represent the aggressiveness coefficients of agent1 and agent2, respectively, and α1>α2; and They represent the maximum acceleration and minimum acceleration of agent1 and agent2 respectively. and They represent the maximum yaw rate and minimum yaw rate of agent1 respectively;

[0024] Step 11: Agent 1 and Agent 2 perform actions and Use equations (16) and (17) to update the states s1 and s2 of the scene at the current moment, and get the state of agent 1's car and the state of agent 2's car at the next moment:

[0025]

[0026]

[0027] In equations (16) and (17), (x, 1, y, 1) represents the coordinates of agent 1's car at the next moment in the scene, v, 1 represents the speed of agent 1's car at the next moment in the scene, and θ, 1 represents the driving angle of agent 1's car at the next moment in the scene; (x, 2, y, 2) represents the coordinates of agent 2's car at the next moment in the scene, and v, 2 represents the speed of agent 2's car at the next moment in the scene;

[0028] Step 12: According to equations (1) and (8), the rewards r1 and r2 of the current scene are obtained, so that s1, s2, a1, a2, r1, r2, s,1, s,2 are stored as an experience in the experience replay pool. middle;

[0029] Step 13: Sample M experiences to adjust the strategy Perform a back propagation to obtain the updated policy network parameters θ`1 and θ`2; thus updating the policy, value, and target network parameters:

[0030] Step 14: Set the current state s'1 of agent 1's car as s1 of agent 1's car at the next moment, set the current state s'2 of agent 2's car as s2 of agent 2's car at the next moment, and return to step 8 to execute sequentially until the current scene ends;

[0031] Step 15, return to step 6 and execute sequentially until the number of training steps reaches the set value and stops training, thereby obtaining a highway lane changing test scenario with a certain degree of randomness and aggressiveness.

[0032] The method for generating a highway lane-changing test scenario based on multi-agent reinforcement learning of the present invention is also characterized in that in step 4, the reward R1 of the agent 1 car is obtained by using formula (1):

[0033] R1=r 1_c +r 1_r +r 1_f +r 1_cl +r 1_to +r 1_do(1)

[0034] In formula (1), r 1_c is the collision reward, and is obtained by formula (2), r 1_r is the aggressive reward, and is obtained from formula (3), r 1_f is the forward reward, and is obtained from formula (4), r 1_cl is the lane change reward, and is obtained from formula (5), r 1_to is the scene timeout reward, and is obtained by formula (6), r 1_do is the scene range reward, and is obtained by formula (7):

[0035]

[0036] In formula (2), δ1 is the collision penalty value of agent1;

[0037]

[0038] In formula (3), b is the lane-changing aggressiveness coefficient of agent 1. is the absolute value of the vehicle's acceleration projection on the x-axis;

[0039]

[0040] In formula (4), v y is the velocity projection of the vehicle on the y-axis, ψ is the threshold of the forward speed;

[0041]

[0042] In formula (5), δ2 is the lane change success reward value, τ is the distance threshold for determining whether the lane change is successful, and D x is the distance difference between agent1 car and agent2 car on the x-axis;

[0043]

[0044] In formula (6), is the maximum running time of a single scenario;

[0045]

[0046] In formula (7), ρ1 and ρ2 are the x-coordinates of the left boundary line of the lane where agent1 is located and the right boundary line of the lane where agent2 is located, respectively;

[0047] In step 4, the reward R2 of agent 2 is obtained by using formula (8):

[0048] R2=r 2_c +r 2_r +r2_f 8

[0049] In formula (8), r 2_c is the collision reward of agent 2, and is obtained by formula (9), r 2_r is the aggressive reward of agent 2, and is obtained by formula (10), r 2_f is the forward reward of agent 2, and is obtained from formula (11):

[0050]

[0051] In formula (9), δ3 is the collision penalty value of agent2;

[0052]

[0053] In formula (10), c is the lane-changing aggressiveness coefficient of agent 2, Δdis y is the difference between the y coordinates of agent1 and agent2;

[0054]

[0055] In formula (11), ψ is the forward speed threshold.

[0056] Step 13 includes:

[0057] Step 13.1. From Sample M experiences in, represents the state of agent 1's car at time j, represents the state of agent2's car at time j, represents the action of agent 1 at time j, represents the action of agent2 car at time j, represents the reward of agent1's car at time j, represents the reward of agent2's car at time j;

[0058] Step 13.2: Calculate the target value of agent 1 and agent 2 in the jth experience according to equations (18) and (19): and

[0059]

[0060] In formulas (18) and (19), γ is the discount factor; Represents the target policy network In Status the actions taken next; Represents the target policy network In Status the actions taken next;

[0061] Step 13.3, calculate the minimized target loss L1 of agent 1 and the minimized target loss L2 of agent 2 according to equations (20) and (21) respectively:

[0062]

[0063] Step 13.4: Value network based on L1 and L2 Perform a back propagation to obtain the updated parameters ω,1 and ω,2 of the value network;

[0064] Step 13.5: Calculate the policy gradient of agent 1 according to equations (22) and (23): And the policy gradient of agent2 car

[0065]

[0066] In formula (22) and formula (23), Representation Policy Network exist When in the state, find the gradient of parameter θ1; Representation Policy Network exist When in the state, find the gradient of parameter θ2; Representing the Value Network exist When in state, find the gradient of action a1; Representing the Value Network exist When in state , find the gradient of action a2;

[0067] Step 13.6, agent1 car and agent2 car are respectively based on the policy gradient Strategy Perform a back propagation to obtain the updated policy network parameters θ,1 and θ,2;

[0068] Step 13.7: Update the strategy, value, and target network parameters according to formula (24):

[0069]

[0070] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the method for generating a highway lane change test scenario, and the processor is configured to execute the program stored in the memory.

[0071] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the highway lane-changing test scenario generation method when the computer program is executed by a processor.

[0072] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0073] 1. The present invention takes advantage of the distributed decision-making of the multi-agent deep reinforcement learning algorithm, takes the autonomous driving test vehicle and the traffic vehicle as two agents, designs the input states and output actions of the neural networks of the two vehicles, constructs and trains the optimal strategy network models of the two vehicles based on the set reward function, and uses the model to determine the control strategy of the traffic vehicle in the highway lane changing test scenario, thereby generating a highway lane changing test scenario, ensuring the efficiency and quality of test scenario generation.

[0074] 2. The present invention utilizes the advantages of adversarial learning of the multi-agent deep reinforcement learning algorithm and uses the autonomous driving test vehicle and the traffic vehicle as two adversarial learning agents to generate a game-like trajectory flow for the two vehicles. Compared with the test scenario generation method based on a simplified vehicle model and traditional planning and control algorithm, the generated trajectory flow is more in line with the actual situation and has more uncertainty.

[0075] 3. Compared with the autonomous driving test scenarios generated based on fixed driving algorithms and single-agent reinforcement learning algorithms, the traffic vehicles in the present invention can have more aggressive and random actions at dangerous edge behaviors, which increases the number of small-probability edge scene samples in the autonomous driving algorithm test scenarios, thereby improving the dynamic game-playing nature of edge scenes for simulation capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 The present invention is a flowchart of a method for generating a highway lane-changing test scenario based on multi-agent reinforcement learning. DETAILED DESCRIPTION

[0077] In this embodiment, a method for generating a highway lane-changing test scenario based on multi-agent reinforcement learning is applied to a straight-line scenario of a one-way two-lane highway. The straight-line scenario of the highway includes an agent 1 car and an agent 2 car. The agent 1 car is driving in the left lane, and the agent 2 car is driving in the right lane in the same direction. When the agent 1 car wants to overtake the agent 2 car, Figure 1 As shown, the highway lane change test scenario generation includes the following steps:

[0078] Step 1: Establish a global coordinate system with the midpoint of the starting lines of the two lanes as the origin, the forward direction of the road as the x-axis direction, and the right side of the road as the y-axis direction. Obtain the vehicle state parameters and scene information in the coordinate system, including: the coordinates of agent 1 (x1, y1), the speed of agent 1 v1, and the acceleration of agent 1 The driving angle θ1 of agent1's car, the yaw rate of agent1's car The coordinates of agent2's car (x2, y2), the speed of agent2's car v2, and the acceleration of agent2's car The single refresh time DT of the scene, the timestamp t of the scene.

[0079] Step 2: Define the state set S=S1,S2 of agent1 and agent2, where S1 is the state of agent1, S2 is the state of agent2, and S1=S2=v1,v2,v2-v1,x1,y1,x2,y2,d,θ1, where d is the distance between agent1 and agent2.

[0080] Step 3: Define the action set A = A1, A2 of agent1 and agent2, where A1 is the action of agent1 and A2 is the action of agent2. Since agent1 needs to change lanes, it involves lateral and longitudinal control. Since agent2 is only involved in longitudinal control,

[0081] Step 4: Construct the reward set R = R1, R2 for agent1 and agent2, where R1 is the reward for agent1 and is obtained by equation (1), and R2 is the reward for agent2 and is obtained by equation (8):

[0082] R1=r 1_c +r 1_r +r 1_f +r 1_cl +r 1_to +r 1_do ()

[0083] In formula (1), r 1_c is the collision reward, and is obtained by formula (2), r 1_r is the aggressive reward, and is obtained from formula (3), r 1_f is the forward reward, and is obtained from formula (4), r 1_cl is the lane change reward, and is obtained from formula (5), r 1_to is the scene timeout reward, and is obtained by formula (6), r 1_do is the scene range reward, and is obtained by formula (7):

[0084]

[0085] In formula (2), δ1 is the collision penalty value of agent 1. When a collision occurs, a larger penalty should be given to agent 1.

[0086]

[0087] In formula (3), b is the lane-changing aggressiveness coefficient of agent 1. is the absolute value of the acceleration projection of the vehicle on the x-axis. The acceleration of agent 1 in the x-direction is used to determine whether the lane change of agent 1 is aggressive;

[0088]

[0089] In formula (4), v y is the projection of the vehicle's speed on the y-axis, and ψ is the threshold of the forward speed. This step is to ensure that the vehicle always moves forward and has a certain speed. If the conditions are met, a small reward is given;

[0090]

[0091] In formula (5), δ2 is the lane change success reward value, τ is the distance threshold for determining whether the lane change is successful, and D x is the distance difference between agent1 and agent2 on the x-axis. A large reward is given for a successful lane change;

[0092]

[0093] In formula (6), is the maximum running time of a single scenario. If the scenario running time exceeds and the lane change is not successful, it means that the aggressive behavior of agent1 is useless, which is deducted and the scenario is reset;

[0094]

[0095] In formula (7), ρ1 and ρ2 are the x-coordinates of the left boundary line of the lane where agent1 is located and the right boundary line of the lane where agent2 is located. If agent1 drives out of the lane, it means that the lane change fails, the scene is reset, and the aggressive reward of agent1 is deducted.

[0096] R2=r 2_c +r 2_r +r 2_f (8)

[0097] In formula (8), r 2_cis the collision reward of agent 2, and is obtained by formula (9), r 2_r is the aggressive reward of agent 2, and is obtained by formula (10), r 2_f is the forward reward of agent 2, and is obtained from formula (11):

[0098]

[0099] In formula (9), δ3 is the collision penalty value of agent 2. To avoid collision, a large penalty is given when a collision occurs.

[0100]

[0101] In formula (10), c is the lane-changing aggressiveness coefficient of agent 2, Δdis y is the difference between the y coordinates of agent1 and agent2. Agent2 wants to prevent agent1 from overtaking, so it can do so by closing the y-axis distance with agent1.

[0102]

[0103] In formula (11), v y is the projection of the vehicle speed on the y-axis, and ψ is the forward speed threshold. Similar to agent 1, agent 2 moves forward and gives a small reward when the speed is higher than a certain value.

[0104] Step 5: Randomly initialize two network parameters θ1 and θ2 to build the policy network of agent 1 and the policy network of agent2

[0105] Randomly initialize two network parameters ω1 and ω2 to build the agent 1 car-to-car strategy network Value Network and agent2 car-to-car strategy network Value Network

[0106] Build the target policy network for agent1 and the target policy network of agent2 in, Represent the target strategy network The target strategy network of Network parameters and initialization ← indicates assignment;

[0107] Construct the target value network of agent1 car and the target value network of agent2 car in, Represent the target value network and target value network The network parameters are initialized

[0108] Step 6: Initialize the experience replay pool The experience replay pool is responsible for collecting data during the scene operation process, and the algorithm uses the experience replay pool The data in is used to update the network parameters;

[0109] Step 7: Initialize the straight line scene on the highway. The overtaking scene requires that the agent 1 car is in the left lane and behind the agent 2 car, and the agent 2 car is in the right lane;

[0110] Step 8: Get the state s1 of agent 1's car and the state s2 of agent 2's car at the current moment of the scene.

[0111] Step 9: Use equations (12) and (13) to get the action a1 selected by agent 1 and the action a2 selected by agent 2:

[0112]

[0113] In formula (12) and formula (13), Indicates noise.

[0114] Step 10: Use equations (14) and (15) to restrict and process a1 and a2 output by the policy network respectively, and obtain the acceleration of agent 1 and agent 2. and the yaw rate of agent1

[0115]

[0116] In formula (14) and formula (15), α1 and α2 represent the aggressiveness coefficients of agent 1 and agent 2 respectively. In order to ensure that agent 1 can successfully overtake, agent 1 is required to be more aggressive than agent 2, so α1>α2; and They represent the maximum acceleration and minimum acceleration of agent1 and agent2 respectively. and They represent the maximum yaw rate and minimum yaw rate of agent1 respectively.

[0117] Step 11: Agent 1 and Agent 2 perform actions and Use equations (16) and (17) to update the states s1 and s2 of the scene at the current moment, and get the state of agent 1's car and the state of agent 2's car at the next moment.

[0118] s1=s2=

[0119] v,1,v,2,v,2-v,1,x,1,y,1,x,2,y,2,d,,θ,1;

[0120]

[0121] In equations (16) and (17), (x, 1, y, 1) represents the coordinates of agent 1’s car at the next moment in the scene, v, 1 represents the speed of agent 1’s car at the next moment in the scene, and θ, 1 represents the driving angle of agent 1’s car at the next moment in the scene; (x, 2, y, 2) represents the coordinates of agent 2’s car at the next moment in the scene, and v, 2 represents the speed of agent 2’s car at the next moment in the scene.

[0122] Step 12: According to equations (1) and (8), the rewards r1 and r2 of the current scene are obtained, so that s1, s2, a1, a2, r1, r2, s,1, s,2 are stored as an experience in the experience replay pool. middle.

[0123] Step 13: Sample M experiences in represents the state of agent 1's car at time j, represents the state of agent2's car at time j, represents the action of agent 1 at time j, represents the action of agent2 car at time j, represents the reward of agent1's car at time j, Represents the reward of agent2 car at time j.

[0124] Step 14: Calculate the target value of agent 1 and agent 2 in the jth experience according to equations (18) and (19): and

[0125]

[0126] In formulas (18) and (19), γ is the discount factor; Represents the target policy network In Status the actions taken next; Represents the target policy network In Status The following actions are taken.

[0127] Step 15: Calculate the minimized target loss L1 of agent 1 and the minimized target loss L2 of agent 2 according to equations (20) and (21):

[0128]

[0129] Step 16: Value network based on L1 and L2 Perform one back propagation and update the value network parameters once to obtain the updated value network parameters ω,1 and ω,2.

[0130] Step 17: Calculate the policy gradient of agent 1 according to equations (22) and (23): And the policy gradient of agent2 car

[0131]

[0132] In formula (22) and formula (23), Representation Policy Network exist When in the state, find the gradient of parameter θ1; Representation Policy Network exist When in the state, find the gradient of parameter θ2; Representing the Value Network exist When in state, find the gradient of action a1; Representing the Value Network exist When in state , find the gradient for action a2.

[0133] Step 18: Agent 1 and Agent 2 respectively follow the policy gradient Strategy Perform a back propagation and update the policy network parameters once to obtain the updated policy network parameters θ,1 and θ,2.

[0134] Step 19: Update the target network parameters according to formula (24):

[0135]

[0136] In formula (24), ← represents assignment.

[0137] Step 20: Set s1, s2 at the current moment as s1 and s2 at the next moment, and then return to step 8 to execute in sequence until the current scene ends. The scene end condition is that the agent 1 car changes lanes successfully, the scene running time times out, or the agent 1 car drives out of the lane.

[0138] Step 21, return to step 6 and execute sequentially until the number of training steps reaches the set value and stops training; thereby obtaining a highway lane-changing test scenario with a certain degree of randomness and aggressiveness.

[0139] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.

[0140] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.

Claims

1. A method for generating highway lane-changing test scenarios based on multi-agent reinforcement learning, characterized in that: It is applied to a straight line scene of a one-way two-lane highway. The straight line scene of the highway includes agent 1 and agent 2. Agent 1 is driving in the left lane, and agent 2 is driving in the right lane in the same direction. When agent 1 wants to overtake agent 2, the highway lane change test scene generation includes the following steps: Step 1: Establish a global coordinate system with the midpoint of the starting lines of the two lanes as the origin, the forward direction of the road as the x-axis direction, and the right side of the road as the y-axis direction. Obtain the state parameters and scene information of the vehicle in the global coordinate system, including: the coordinates of agent 1 (x1, y1), the speed v1 of agent 1, and the acceleration of agent 1 The driving angle θ1 of agent1's car, the yaw rate of agent1's car The coordinates of agent2's car (x2, y2), the speed of agent2's car v2, and the acceleration of agent2's car The single refresh time DT of the scene, the timestamp t of the scene; Step 2: Define the state set S = {S1, S2} of agent1 and agent2, where S1 is the state of agent1, S2 is the state of agent2, and S1 = S2 = {v1, v2, v2-v1, (x1, y1), (x2, y2), d, θ1}, where d is the distance between agent1 and agent2. Step 3: Define the action set A = {A1, A2} of agent1 and agent2, where A1 is the action of agent1, A2 is the action of agent2, and and Step 4: Construct the reward set R = {R1, R2} for agent 1 and agent 2, where R1 is the reward for agent 1 and is obtained by equation (1), and R2 is the reward for agent 2. Step 5: Randomly initialize two network parameters θ1 and θ2 to build the policy network of agent 1 and the policy network of agent2 Randomly initialize two network parameters ω1 and ω2 to build the agent 1 car-to-car strategy network Value Network and agent2 car-to-car strategy network Value Network Build the target policy network for agent1 and the target policy network of agent2 in, Represent the target strategy network The target strategy network of Network parameters and initialization Among them, ← indicates assignment; Construct the target value network of agent1 car and the target value network of agent2 car in, Represent the target value network and target value network The network parameters are initialized Step 6: Initialize the experience replay pool Step 7: Initialize the straight line scene on the highway so that the agent 1 car is in the left lane and behind the agent 2 car, and the agent 2 car is in the right lane; Step 8: Get the state s1 of agent 1's car and the state s2 of agent 2's car at the current moment of the scene; Step 9: Use equations (12) and (13) to get the action a1 selected by agent 1 and the action a2 selected by agent 2: In formula (12) and formula (13), Indicates noise; Step 10: Use equations (14) and (15) to restrict and process a1 and a2 output by the policy network respectively, and obtain the acceleration of agent 1 and agent 2. and the yaw rate of agent1 In formula (14) and formula (15), α1 and α2 represent the aggressiveness coefficients of agent1 and agent2, respectively, and α1>α2; and They represent the maximum acceleration and minimum acceleration of agent1 and agent2 respectively. and They represent the maximum yaw rate and minimum yaw rate of agent1 respectively; Step 11: Agent 1 and Agent 2 perform actions and Use equations (16) and (17) to update the states s1 and s2 of the scene at the current moment, and obtain the state of agent 1 car and the state of agent 2 car at the next moment s`1 = s`2 = {v`1, v`2, v`2-v`1, (x`1, y`1), (x`2, y`2), d`, θ`1}; In equations (16) and (17), (x`1, y`1) represents the coordinates of agent 1's car at the next moment in the scene, v`1 represents the speed of agent 1's car at the next moment in the scene, and θ`1 represents the driving angle of agent 1's car at the next moment in the scene; (x`2, y`2) represents the coordinates of agent 2's car at the next moment in the scene, and v`2 represents the speed of agent 2's car at the next moment in the scene; Step 12: According to equations (1) and (8), the rewards r1 and r2 at the current moment of the scene are obtained, so that (s1, s2, a1, a2, r1, r2, s`1, s`2) is stored as an experience in the experience replay pool. middle; Step 13: Sample M experiences to adjust the strategy Perform a back propagation to obtain the updated policy network parameters θ`1 and θ`2; thus updating the policy, value, and target network parameters: Step 14: Set the current state s'1 of agent 1's car as s1 of agent 1's car at the next moment, set the current state s'2 of agent 2's car as s2 of agent 2's car at the next moment, and return to step 8 to execute sequentially until the current scene ends; Step 15, return to step 6 and execute sequentially until the number of training steps reaches the set value and stops training, thereby obtaining a highway lane changing test scenario with a certain degree of randomness and aggressiveness.

2. The method for generating highway lane-changing test scenarios based on multi-agent reinforcement learning according to claim 1, characterized in that: In step 4, the reward R1 of agent 1 car is obtained by using formula (1): R1=r 1_c +r 1_r +r 1_f +r 1_cl +r 1_to +r 1_do (1) In formula (1), r 1_c is the collision reward, and is obtained by formula (2), r 1_r is the aggressive reward, and is obtained from formula (3), r 1_f is the forward reward, and is obtained by formula (4), r 1_cl is the lane change reward, and is obtained from formula (5), r 1_to is the scene timeout reward, and is obtained by formula (6), r 1_do is the scene range reward, and is obtained by formula (7): In formula (2), δ1 is the collision penalty value of agent1; In formula (3), b is the lane-changing aggressiveness coefficient of agent 1. is the absolute value of the vehicle's acceleration projection on the x-axis; In formula (4), v y is the velocity projection of the vehicle on the y-axis, ψ is the threshold of the forward speed; In formula (5), δ2 is the lane change success reward value, τ is the distance threshold for determining whether the lane change is successful, and D x is the distance difference between agent1 car and agent2 car on the x-axis; In formula (6), is the maximum running time of a single scenario; In formula (7), ρ1 and ρ2 are the x-coordinates of the left boundary line of the lane where agent1 is located and the right boundary line of the lane where agent2 is located, respectively.

3. The method for generating highway lane-changing test scenarios based on multi-agent reinforcement learning according to claim 2, characterized in that: In step 4, the reward R2 of agent 2 is obtained by using formula (8): R2=r 2_c +r 2_r +r 2_f (8) In formula (8), r 2_c is the collision reward of agent 2, and is obtained by formula (9), r 2_r is the aggressive reward of agent 2, and is obtained by formula (10), r 2_f is the forward reward of agent 2, and is obtained from formula (11): In formula (9), δ3 is the collision penalty value of agent2; In formula (10), c is the lane-changing aggressiveness coefficient of agent 2, Δdis y is the difference between the y coordinates of agent1 and agent2; In formula (11), ψ is the forward speed threshold.

4. The method for generating highway lane-changing test scenarios based on multi-agent reinforcement learning according to claim 3 is characterized in that: Step 13 includes: Step 13.

1. From Sample M experiences in, represents the state of agent 1's car at time j, represents the state of agent2's car at time j, represents the action of agent 1 at time j, represents the action of agent2 car at time j, represents the reward of agent1's car at time j, represents the reward of agent2's car at time j; Step 13.2: Calculate the target value of agent 1 and agent 2 in the jth experience according to equations (18) and (19): and In formulas (18) and (19), γ is the discount factor; Represents the target policy network In Status the actions taken next; Represents the target policy network In Status the actions taken next; Step 13.3, calculate the minimized target loss L1 of agent 1 and the minimized target loss L2 of agent 2 according to equations (20) and (21) respectively: Step 13.4: Value network based on L1 and L2 Perform a back propagation to obtain the updated parameters ω,1 and ω,2 of the value network; Step 13.5: Calculate the policy gradient of agent 1 according to equations (22) and (23): And the policy gradient of agent2 car In formula (22) and formula (23), Representation Policy Network exist When in the state, find the gradient of parameter θ1; Representation Policy Network exist When in the state, find the gradient of parameter θ2; Representing the Value Network exist When in state, find the gradient of action a1; Representing the Value Network exist When in state , find the gradient of action a2; Step 13.6, agent1 car and agent2 car are respectively based on the policy gradient Strategy Perform a back propagation to obtain the updated policy network parameters θ,1 and θ,2; Step 13.7: Update the strategy, value, and target network parameters according to formula (24):

5. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the method for generating a highway lane change test scenario as described in any one of claims 1 to 4, and the processor is configured to execute the program stored in the memory.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a highway lane-changing test scenario in any one of claims 1 to 4 are executed.