Driving scene generation method and device, electronic equipment and storage medium

By obtaining the parameters of the vehicle's lane-changing scene on the ramp, and using the monarch strategy genetic algorithm to generate driving scenarios of different levels of danger, the problem of insufficient data on the ramp lane-changing scene is solved, and the effect of autonomous driving test is improved.

CN120449651APending Publication Date: 2025-08-08CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510500140.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the existing autonomous driving test scenario generation technology, there is a lack of data on ramp lane-changing scenes, resulting in insufficient samples of test scenarios and affecting the test results.

Method used

By obtaining the scene parameters of the vehicle entering the scene on the ramp, it is divided into mutable chromosomes and immutable chromosomes, the monarch strategy genetic algorithm is used to generate driving scenarios of different levels of danger, and the fitness function is used to optimize the generation process, the target individual is selected, and the risk degree is divided.

Benefits of technology

It improves the efficiency of scene optimization generation, enriches the test scenarios of ramp lane-changing and entering the scene, provides effective and comprehensive driving scenario data, and improves the test effect of autonomous driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449651A_ABST
    Figure CN120449651A_ABST
Patent Text Reader

Abstract

The invention provides a driving scene generation method and device, electronic equipment and a storage medium. The method comprises the steps that scene parameters of a vehicle in a ramp lane changing cut-in scene are obtained, the scene parameters are divided into variable chromosomes and non-variable chromosomes, and the variable chromosomes and the non-variable chromosomes form individuals; a preset number of individuals form a parent population, the fitness value of each individual in the parent population is calculated by adopting a pre-generated fitness function, the individual with the highest fitness value is determined as a quisqualis individual, the quisqualis individual and the parent population are subjected to crossover variation to generate a plurality of new individuals, and the new individuals form a child population; and calculating the fitness value of each new individual in the sub-population by adopting a fitness function, combining the parent population and the sub-population, screening out a target individual, and carrying out danger degree division on the target individual according to the fitness values to obtain driving scenes with different danger degrees. According to the invention, effective and comprehensive ramp lane change cut-in driving scene data can be obtained.
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 technology, and in particular to a driving scene generation method, device, electronic device and storage medium. Background Art

[0002] The rapid development of autonomous driving systems (ADS) has placed higher requirements on the authenticity and diversity of test scenarios. Therefore, how to extract and optimize the generation of representative driving scenarios, especially dangerous scenarios, from real data has become an important research direction in the current field of autonomous driving testing.

[0003] At present, the existing autonomous driving test scene generation technology mainly relies on real data, that is, directly extracting scenes from real data. Although driving scenes can be extracted from real data, dangerous scenes are low-probability events, especially ramp lane change scenes, which have unique traffic characteristics and complexity and rarely appear in real data. Therefore, the driving scenes extracted from real data lack effective ramp lane change driving scene data, resulting in insufficient samples of autonomous driving test scenes, further affecting the test results. Summary of the Invention

[0004] In view of this, the present invention aims to propose a driving scenario generation method, device, electronic device and storage medium to solve the problem that the current driving scenarios extracted from real data lack effective ramp lane change driving scenario data, resulting in insufficient samples of autonomous driving test scenarios, further affecting the test results.

[0005] According to a first aspect of the present invention, a driving scene generation method is provided, the method comprising:

[0006] Obtaining scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point;

[0007] Dividing the scene parameters into variable chromosomes and non-variable chromosomes;

[0008] Grouping the variable chromosomes and the non-variable chromosomes into individuals, and grouping a preset number of individuals into a parent population;

[0009] Calculating the fitness value of each individual in the parent population using a pre-generated fitness function, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate a plurality of new individuals, and forming the new individuals into sub-populations;

[0010] Calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation, and screening out target individuals;

[0011] The target individuals are divided into different levels of danger according to their fitness values to obtain driving scenarios with different levels of danger.

[0012] Optionally, the acquiring of scenario parameters of a vehicle entering a lane change on a ramp, wherein the scenario parameters include vehicle speed and a distance between the vehicle and the ramp or entry point, includes:

[0013] A pre-built ramp lane change model is used to simulate driving scenarios and determine the trajectories of the cutting vehicle and the ego vehicle.

[0014] Extracting the corresponding vehicle speeds of the cutting-in vehicle and the own vehicle, and the distances between the vehicles and the ramp or the cutting-in point from the motion trajectories of the cutting-in vehicle and the own vehicle;

[0015] The vehicle speeds corresponding to the cutting-in vehicle and the own vehicle, and the distance between the vehicle and the ramp or the cutting-in point are determined as the scene parameters of the vehicle changing lanes on the ramp and cutting in.

[0016] Optionally, dividing the scene parameters into variable chromosomes and non-variable chromosomes includes:

[0017] Using the correlation coefficient to screen out scene parameters with correlation; the correlation of the scene parameters includes strong correlation and weak correlation;

[0018] The scene parameter sets with weak correlation are divided into mutable chromosomes, and the scene parameter sets with strong correlation are divided into non-mutable chromosomes.

[0019] Optionally, after dividing the scene parameters into variable chromosomes and non-variable chromosomes, and before grouping the variable chromosomes and the non-variable chromosomes into individuals, and before grouping a preset number of individuals into a parent population, the method further includes:

[0020] According to the preset value range of the scene parameter in the variable chromosome, the scene parameter in the variable chromosome is sampled according to a uniform distribution, and the sampled value obtained by sampling is determined as the initial value of the scene parameter in the variable chromosome;

[0021] Using a preset Gaussian mixture model to perform joint distribution probability density estimation on the scene parameters in the immutable chromosome, to obtain a joint distribution estimation result of the scene parameters in the immutable chromosome;

[0022] The initial values of the scene parameters in the immutable chromosome are determined according to the initial values of the scene parameters in the variable chromosome and the joint distribution estimation results of the scene parameters in the immutable chromosome.

[0023] Optionally, the step of using a pre-generated fitness function to calculate the fitness value of each individual in the parent population, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate a plurality of new individuals, and forming the new individuals into sub-populations includes:

[0024] The fitness value of each individual in the parent population is calculated using a pre-generated fitness function, initial values of the scene parameters in the individual's variable chromosome, and initial values of the scene parameters in the immutable chromosome, the individuals are sorted by fitness value, and the individual with the highest fitness value is determined as the monarch individual;

[0025] Selecting a mother from the individuals of the parent population using a preset crossover probability, and crossing the monarch individual with the mother in the parent population to generate a plurality of new individuals;

[0026] The new individuals are mutated using a preset mutation probability, and the mutated new individuals are formed into subpopulations.

[0027] Optionally, before calculating the fitness value of each individual in the parent population using a pre-generated fitness function, the method further includes:

[0028] Predetermining module parameters of the function to be generated and the importance of the module parameters, and sorting the module parameters by importance; wherein the module parameters include at least one of the scenario parameters;

[0029] According to the importance ranking of the module parameters, the relative importance between adjacent module parameters is calculated, and the corresponding weights of the module parameters are obtained by using the relative importance calculation;

[0030] A fitness function is generated according to the module parameters and the weights corresponding to the module parameters.

[0031] Optionally, the using the fitness function to calculate the fitness value of each new individual in the subpopulation, merging the parent population and the subpopulation, and screening out target individuals includes:

[0032] Calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation to obtain a new population;

[0033] Sorting the individuals in the new population by fitness value;

[0034] According to the fitness value ranking of the new population and the preset target population size, target individuals that meet the preset target population size are screened from the new population.

[0035] According to a second aspect of the present invention, a driving scene generation device is provided, the device comprising:

[0036] A parameter acquisition module is used to obtain scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point;

[0037] A parameter division module, used for dividing the scene parameters into variable chromosomes and non-variable chromosomes;

[0038] A first processing module is configured to group the variable chromosomes and the non-variable chromosomes into individuals, and to group a preset number of individuals into a parent population;

[0039] a second processing module, configured to calculate the fitness value of each individual in the parent population using a pre-generated fitness function, determine the individual with the highest fitness value as the monarch individual, cross-mutate the monarch individual with the parent population to generate a plurality of new individuals, and form the new individuals into sub-populations;

[0040] a target screening module, configured to calculate the fitness value of each new individual in the subpopulation using the fitness function, merge the parent population and the subpopulation, and screen out target individuals;

[0041] The scenario generation module is used to classify the target individuals into different levels of danger according to their fitness values, thereby obtaining driving scenarios with different levels of danger.

[0042] According to another aspect of the present invention, there is provided an electronic device, comprising:

[0043] processor;

[0044] a memory for storing instructions executable by the processor;

[0045] The processor is configured to execute the instructions to implement the driving scene generation method as described above.

[0046] According to another aspect of the present invention, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the driving scene generation method described above are implemented.

[0047] The driving scenario generation method provided by an embodiment of the present invention obtains scenario parameters of a vehicle changing lanes on a ramp, divides the scenario parameters into variable chromosomes and immutable chromosomes, groups the variable chromosomes and the immutable chromosomes into individuals, and groups a preset number of individuals into a parent population. A pre-generated fitness function is used to calculate the fitness value of each individual in the parent population, and the individual with the highest fitness value is determined as the monarch individual. The monarch individual and the parent population are cross-mutated to generate multiple new individuals, and the new individuals are formed into sub-populations. The fitness function is used to calculate the fitness value of each new individual in the sub-population, and the parent population and the sub-population are merged to screen out target individuals. The target individuals are divided into risk levels according to their fitness values to obtain driving scenarios with different risk levels. The embodiment of the present invention analyzes the scenario parameters of a small number of vehicles in the ramp lane change scenario, adopts the monarch strategy genetic algorithm, divides the scenario parameters into variable chromosomes and non-variable chromosomes, and generates a large number of test scenarios with different levels of danger through population iteration, thereby improving the efficiency of scenario optimization generation, enriching the test scenarios of ramp lane change scenarios in urban scenarios, and obtaining effective and comprehensive ramp lane change driving scenario data, which helps to improve the effect of autonomous driving testing.

[0048] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0050] Figure 1 This is a flowchart of the steps of a driving scene generation method provided by an embodiment of the present invention;

[0051] Figure 2 yes Figure 1 Flowchart of step 101 in the driving scene generation method provided by an embodiment of the present invention;

[0052] Figure 3 yes Figure 1 Flowchart of step 102 in the driving scene generation method provided by an embodiment of the present invention;

[0053] Figure 4 yes Figure 1 Flowchart of step 104 in the driving scene generation method provided by an embodiment of the present invention;

[0054] Figure 5 yes Figure 1 Flowchart of step 105 in the driving scene generation method provided by an embodiment of the present invention;

[0055] Figure 6 Schematic diagram of a driving scene according to a driving scene generation method provided by an embodiment of the present invention;

[0056] Figure 7 1 is a schematic structural diagram of a driving scene generating device provided by an embodiment of the present invention;

[0057] Figure 8 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, each embodiment of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in each embodiment of the present invention, many technical details are provided to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can be implemented. The division of the following embodiments is for convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with each other and referenced to each other under the premise that there is no contradiction.

[0059] Reference Figure 1 , shows a flowchart of the steps of a driving scene generation method provided by an embodiment of the present invention, the method may include:

[0060] Step 101: Acquire scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point.

[0061] In an embodiment of the present invention, to address the problem that driving scenarios currently extracted from real data lack effective ramp lane change driving scenario data, resulting in insufficient autonomous driving test scenario samples and further affecting test results, this embodiment establishes a vehicle ramp lane change model and analyzes the motion trajectories of real vehicles changing lanes into the main lane and the motion trajectories of vehicles in adjacent main lanes to obtain scenario parameters. Based on the actual data, the scenario parameter value range is determined, and a monarch strategy genetic algorithm is used to optimize and generate the scenario. A danger level evaluation index for the generated scenario is established as the algorithm's fitness function, and optimization iterations are performed. The danger level evaluation results are used to classify all generated dangerous scenarios into danger level categories, thereby obtaining effective ramp lane change driving scenarios with different danger levels to meet testing requirements.

[0062] Specifically, in this embodiment, a driving scenario model for a vehicle cutting into a lane on a ramp is established. The motion trajectories of real vehicles cutting into the main lane and the motion trajectories of vehicles in adjacent main lanes are analyzed. Features influencing the degree of danger of the scenario are extracted from the motion trajectories as scenario parameters for the driving scenario. The scenario parameters include vehicle speed and the distance between the vehicle and the ramp or cut-in point. Specifically, the speeds of the cutting-in vehicle and the ego vehicle at different cut-in times and the distance between the vehicle and the ramp or cut-in point are included. It should be noted that the speeds of the cutting-in vehicle and the ego vehicle can be detected by vehicle sensors, millimeter radar, and other equipment. Alternatively, the speeds of the cutting-in vehicle and the ego vehicle, as well as the distance between the vehicle and the ramp or cut-in point, can be extracted from the motion trajectories of the cutting-in vehicle and the ego vehicle. In this embodiment, the scenario parameters are directly determined based on real data, such as urban expressway data from the Mirror-Traffic real-world dataset. Mirror-Traffic is a public dataset. This embodiment does not specifically limit the source of the value range of the scenario parameters.

[0063] Specifically, refer to Figure 6 , shows a schematic diagram of a driving scenario for a driving scenario generation method provided by an embodiment of the present invention. The vehicle's driving direction is defined as the positive Y direction, and the opposite direction of the vehicle's cut-in direction is defined as the positive X direction. A lane-changing vehicle enters the acceleration lane from the ramp and accelerates to the left, cutting into the main lane. The ego vehicle maintains its original lane behind the ramp-cutting vehicle. As the ramp-cutting vehicle cuts into the main lane, the paths of the ramp-cutting vehicle and the ego vehicle conflict. Specifically, the ramp-cutting process is divided into four stages: exiting the ramp, before lane-cutting, during lane-cutting, and after lane-cutting. A represents the cut-in point of the cut-in vehicle into the main lane, B represents the ramp exit, G represents the distance between the ego vehicle and the cut-in vehicle in the x-direction at the time of lane-cutting, D represents the distance between the cut-in vehicle and the ego vehicle in the y-direction at the time of lane-cutting, l1 represents the distance between the cut-in vehicle and the ramp exit in the x-direction, and l2 represents the distance between the cut-in vehicle and the ramp exit in the y-direction.

[0064] In this embodiment, during the ramp exit phase, the cutting-in vehicle enters the acceleration lane from the ramp. During the initial lane change phase, the cutting-in vehicle travels in the acceleration lane and approaches the main lane, preparing to cut in. During the lane change phase, the cutting-in vehicle begins to cut into the main lane. At this point, the paths of the ego vehicle and the cutting-in vehicle conflict, requiring the ego vehicle to identify the cutting-in vehicle and adjust its speed promptly to avoid a collision. During the final lane change phase, the ego vehicle adjusts its speed and follows the cutting-in vehicle. Simulating a vehicle's lane change on a ramp reveals that the factors affecting the risk of a lane change cut-in scenario are primarily the relative distance and relative speed between the cutting-in vehicle and the ego vehicle. The smaller the relative distance and the greater the relative speed of the cutting-in vehicle and the ego vehicle, the shorter the time allowed for the ego vehicle to identify and respond, making the scenario more dangerous. Furthermore, the closer the cutting-in vehicle's cut-in point is to the ramp exit, the shorter the time allowed for the ego vehicle to identify and respond, making the scenario more dangerous. For the ego vehicle, the main factor affecting the danger level of the scene is the vehicle speed.

[0065] Therefore, in this embodiment, the factors affecting the danger level of the cut-in scenario are mainly the relative distance and relative speed between the cutting-in vehicle and the ego vehicle when exiting the ramp and changing lanes to cut in. Specifically, the scenario parameters of the vehicle in the ramp lane change and cut-in scenario include 9 parameters: vehicle speed, distance between the vehicle and the ramp or the cut-in point: parameter 1 is the x-direction speed of the cutting-in vehicle when exiting the ramp; parameter 2 is the x-direction distance between the cutting-in vehicle and the ramp exit when exiting the ramp; parameter 3 is the distance between the cut-in point and the ramp exit when changing lanes to cut in; parameter 4 is the x-direction speed of the cutting-in vehicle when changing lanes to cut in; parameter 5 is the y-direction speed of the cutting-in vehicle when changing lanes to cut in; parameter 6 is the y-direction distance between the ego vehicle and the cut-in point when changing lanes to cut in; parameter 7 is the x-direction distance between the ego vehicle and the cut-in point when changing lanes to cut in; parameter 8 is the x-direction speed of the ego vehicle when changing lanes to cut in; and parameter 9 is the y-direction speed of the ego vehicle when changing lanes to cut in.

[0066] Step 102: Divide the scene parameters into variable chromosomes and non-variable chromosomes.

[0067] In an embodiment of the present invention, due to the influence between different scene parameters, taking into account the correlation between different parameters, the joint distribution of the parameters with high correlation is estimated, so that when one parameter is known, the values of other parameters can be inferred and determined. Specifically, this embodiment uses the correlation coefficient to test the correlation of each parameter to ensure that the generated scene is more in line with the authenticity criterion, screens out scene parameters with correlation, and divides the scene parameters into strong correlation and weak correlation parameter sets, that is, variable chromosomes and non-variable chromosomes, among which the scene parameters with weak correlation are divided into variable chromosomes, and the scene parameters with strong correlation are divided into non-variable chromosomes.

[0068] It should be noted that the correlation coefficient can be the Spearman correlation coefficient, which measures the monotonic correlation between two variables by rank. The value range of the Spearman correlation coefficient is [-1,1]. A Spearman correlation coefficient close to 1 or -1 indicates a strong monotonic correlation, and a Spearman correlation coefficient close to 0 indicates a weak monotonic correlation. In this embodiment, under different scene parameters, the change of one scene parameter has little effect on another scene parameter, that is, the scene parameters show a weak correlation, otherwise, they show a strong correlation.

[0069] Step 103: Group the variable chromosomes and the non-variable chromosomes into individuals, and group a preset number of individuals into a parent population.

[0070] In an embodiment of the present invention, after the scene parameters are divided to obtain variable chromosomes and immutable chromosomes, a monarch strategy genetic algorithm is used to perform scene optimization generation, the scene generation problem is converted into a multi-objective optimization problem, individuals and populations participating in the genetic algorithm are established, and parameters such as the population size, number of chromosomes, and number of iterations are initialized. Specifically, each group of variable chromosomes and immutable chromosomes can constitute an individual, and a combination of multiple individuals can obtain a parent population. In this embodiment, the population size can be preset to 1,000 individuals, that is, a preset number of 1,000 individuals is required to constitute the parent population, that is, 1,000 groups of variable chromosomes and immutable chromosomes are first formed into 1,000 individuals, and then 1,000 individuals are formed into the parent population. Of course, the above is a specific example, and the preset number of individuals determines the population size. In this embodiment, the number of individuals is set and adjusted according to the scale of the scene parameter set and the scene optimization generation requirements. The specific value of the preset number of individuals is not limited here.

[0071] Step 104, using a pre-generated fitness function to calculate the fitness value of each individual in the parent population, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate multiple new individuals, and forming the new individuals into sub-populations.

[0072] In the embodiment of the present invention, the degree of danger of the generated driving scene is used as the fitness function for algorithm optimization. The process of pre-generating the fitness function refers to the second embodiment and will not be repeated here. The pre-generated fitness function is used to calculate the fitness value of each individual in the parent population, that is, the individuals in the parent population are substituted into the fitness function one by one for calculation to obtain the fitness value of each individual, and the fitness values of the individuals are sorted. The individual with the highest fitness value is determined as the monarch individual, and the monarch individual is cross-mutated with the parent population to generate multiple new individuals, and the new individuals are formed into a sub-population.

[0073] In this example, the individual with the highest fitness value is identified as the monarch individual and subjected to crossover mutation, which can quickly pass high-quality genes to the next generation. This is because the monarch individual represents the individual closest to the target (dangerous scenario) in the current population. Crossing with other individuals allows the new individual to inherit its dominant genes, accelerating the overall evolution of the population towards a more optimal direction, reducing the algorithm's search time for the optimal solution and improving convergence speed. The crossover operation generates a diverse set of new individuals by exchanging genes between different individuals; the mutation operation randomly changes genes with a certain probability, introducing new gene combinations into the population. The combination of the two generates more diverse scenarios, meeting the testing requirements for different dangerous scenarios and improving the comprehensiveness of scenario generation.

[0074] Step 105: Use the fitness function to calculate the fitness value of each new individual in the sub-population, merge the parent population and the sub-population, and screen out the target individual.

[0075] In an embodiment of the present invention, the same fitness function is used to calculate the fitness value of each new individual in the subpopulation, the parent population and the subpopulation are merged to obtain a new population, the individuals in the new population are sorted by fitness value, and based on the fitness value sorting of the new population and the preset target population size, target individuals that meet the preset target population size are screened from the new population.

[0076] It should be noted that as the population continues to iterate, new individuals gradually accumulate better genetic combinations, the individual fitness values in the sub-population continue to increase, and the generated scenarios are getting closer and closer to real and dangerous scenarios, providing more challenging and realistic test scenarios for the autonomous driving system, which helps to more effectively detect and optimize the performance of the autonomous driving algorithm in complex ramp lane change scenarios, and improve the safety and reliability of the autonomous driving system.

[0077] In step 106 , the target individuals are divided into different levels of danger according to their fitness values to obtain driving scenarios with different levels of danger.

[0078] In an embodiment of the present invention, target individuals are divided into different levels of danger according to their fitness values to obtain driving scenarios of different degrees of danger. That is, based on the scenario parameters of ramp lane change, a large amount of driving scenario data of ramp lane change can be obtained. The generated scenarios are classified according to the fitness function values, and the fitness values are divided into different levels of danger using preset intervals. For example, the fitness value intervals of 1, 5 or other arbitrary values are divided into one level. In this way, driving scenarios of different degrees of danger can be obtained for scenario testing. In this embodiment, the preset intervals for fitness value division are set according to the actual scenario testing requirements and are not specifically limited here.

[0079] The driving scenario generation method provided by an embodiment of the present invention obtains scenario parameters of a vehicle changing lanes on a ramp, divides the scenario parameters into variable chromosomes and immutable chromosomes, groups the variable chromosomes and the immutable chromosomes into individuals, and groups a preset number of individuals into a parent population. A pre-generated fitness function is used to calculate the fitness value of each individual in the parent population, and the individual with the highest fitness value is determined as the monarch individual. The monarch individual and the parent population are cross-mutated to generate multiple new individuals, and the new individuals are formed into sub-populations. The fitness function is used to calculate the fitness value of each new individual in the sub-population, and the parent population and the sub-population are merged to screen out target individuals. The target individuals are divided into risk levels according to their fitness values to obtain driving scenarios with different risk levels. The embodiment of the present invention analyzes the scenario parameters of a small number of vehicles in the ramp lane change scenario, adopts the monarch strategy genetic algorithm, divides the scenario parameters into variable chromosomes and non-variable chromosomes, and generates a large number of test scenarios with different levels of danger through population iteration, thereby improving the efficiency of scenario optimization generation, enriching the test scenarios of ramp lane change scenarios in urban scenarios, and obtaining effective and comprehensive ramp lane change driving scenario data, which helps to improve the effect of autonomous driving testing.

[0080] Further, refer to Figure 2 , showing Figure 1 A flowchart of step 101 in a driving scene generation method is provided. This method is substantially the same as the driving scene generation method provided in the first embodiment of the present invention. Step 101 may include:

[0081] Step 1011 , using a pre-built vehicle ramp lane change cut-in model to simulate a driving scenario, and determining the motion trajectories of the cut-in vehicle and the ego vehicle.

[0082] In this embodiment, a vehicle ramp lane change cut-in model can be pre-constructed using computer simulation software or modeling, wherein the vehicle ramp lane change cut-in model is constructed based on a large amount of real traffic data and dynamic principles, and is used to accurately simulate the movement of the vehicle in the ramp lane change cut-in scenario. The pre-constructed vehicle ramp lane change cut-in model is used to simulate the driving scenario, and the movement trajectories of the cutting-in vehicle and the own vehicle are determined. The model begins to simulate the movement of the cutting-in vehicle and the own vehicle according to the set conditions and relevant algorithms.

[0083] Specifically, the cutting-in vehicle starts to accelerate from the ramp acceleration lane, gradually increases its speed according to a certain acceleration, and at the same time adjusts its driving direction to prepare to change lanes to the left and cut into the main lane. The ego vehicle maintains its original speed and lane, but simulates possible avoidance actions based on the relative position and speed changes with the cutting-in vehicle. The motion trajectory of the cutting-in vehicle is a curve that gradually bends left from the ramp acceleration lane into the main lane. Its position coordinates change continuously at different time points. The motion trajectory of the ego vehicle is basically a straight line before the cutting-in vehicle changes lanes. When the cutting-in vehicle approaches and may affect the driving of the ego vehicle, the ego vehicle's trajectory undergoes slight adjustments, such as slightly slowing down or fine-tuning the direction, to avoid a collision.

[0084] Step 1012 , extracting the corresponding vehicle speeds of the cutting-in vehicle and the ego vehicle, and the distances between the vehicle and the ramp or the cutting-in point from the motion trajectories of the cutting-in vehicle and the ego vehicle.

[0085] In this embodiment, during the lane change and cut-in process, the factors affecting the danger level of the cut-in scene are mainly the relative distance and relative speed between the cut-in vehicle and the ego vehicle when the vehicle exits the ramp and changes lanes to cut in. Specifically, the vehicle speeds of the cut-in vehicle and the ego vehicle, and the distance between the vehicle and the ramp or the cut-in point are extracted from the motion trajectories of the cut-in vehicle and the ego vehicle. The vehicle speed of the cut-in vehicle includes the speed of the cut-in vehicle in the x direction when exiting the ramp, the speed of the cut-in vehicle in the x direction when changing lanes to cut in, and the speed of the cut-in vehicle in the x direction when changing lanes to cut in. The speed of the vehicle in the y direction; the distance between the entering vehicle and the ramp or entry point includes: the distance between the entering vehicle and the ramp exit in the x direction when exiting the ramp, the distance between the entry point and the ramp exit when changing lanes and entering, and the distance between the vehicle and the entry point in the y direction when changing lanes and entering; the vehicle speed of the own vehicle includes: the speed of the vehicle in the x direction when changing lanes and entering, and the speed of the vehicle in the y direction when changing lanes and entering; the distance between the own vehicle and the ramp or entry point includes the distance between the vehicle and the entry point in the x direction when changing lanes and entering.

[0086] In step 1013, the vehicle speeds of the cutting-in vehicle and the own vehicle, and the distance between the vehicle and the ramp or the cutting-in point are determined as the scenario parameters of the vehicle changing lanes on the ramp and cutting-in scenario.

[0087] The embodiment of the present invention determines the scenario parameters of the vehicle's lane change cut-in on the ramp by performing motion simulation analysis on the vehicle's lane change cut-in scenario, so as to generate a large number of effective ramp lane change cut-in test scenarios based on a small number of scenario parameters.

[0088] Further, refer to Figure 3 , showing Figure 1 A flowchart of step 102 in a driving scene generation method is provided. This method is substantially the same as the driving scene generation method provided in the first embodiment of the present invention. Step 102 may include:

[0089] Step 1021: Use the correlation coefficient to filter out scene parameters with correlation; the correlation of scene parameters includes strong correlation and weak correlation;

[0090] Step 1022: Divide the scene parameters with weak correlation into variable chromosomes, and divide the scene parameters with strong correlation into non-variable chromosomes.

[0091] In an embodiment of the present invention, taking into account the influence between different scene parameters, this embodiment uses a correlation coefficient to test the correlation of each scene parameter to ensure that the generated scene is more in line with the authenticity criterion, screens out scene parameters with correlation, and divides the scene parameters into strong correlation and weak correlation parameter sets, among which the scene parameters with weak correlation are divided into variable chromosomes, and the scene parameters with strong correlation are divided into non-variable chromosomes.

[0092] In this embodiment, the Spearman correlation coefficient is used as the correlation coefficient. The Spearman correlation coefficient measures the monotonic correlation between two variables by using ranks. Under different scenario parameters, changes in one scenario parameter have little effect on another scenario parameter, that is, the scenario parameters exhibit weak correlation. Otherwise, they exhibit strong correlation. For example, when analyzing parameter 2 (the distance in the x-direction between the entering vehicle and the ramp exit when exiting the ramp) and parameter 3 (the distance between the entry point and the ramp exit when changing lanes), these two parameters show a high trend of coordinated variation in most cases. When the value of parameter 2 is small, the value of parameter 3 also tends to be small, indicating a strong correlation between them. For parameter 5 (the speed of the entering vehicle in the y-direction when changing lanes) and parameter 8 (the speed of the own vehicle in the x-direction), the coordinated variation relationship between them is not obvious. Under different scenarios, changes in one parameter have little effect on the other parameter, that is, they exhibit weak correlation.

[0093] Specifically, during the genetic algorithm iteration process, changes in the mutable chromosomes can more specifically optimize the scenario, avoiding ineffective searches caused by excessive mutations, accelerating algorithm convergence, and improving the efficiency of scenario optimization generation. At the same time, the setting of non-mutable chromosomes maintains the stability of the scenario, allowing the genetic algorithm to optimize within a reasonable range and avoid falling into local optimal solutions. This helps find more optimal scenario combinations to meet the needs of different tests and research. Therefore, this embodiment divides scenario parameters according to correlation, classifying scenario parameters with weak correlations as mutable chromosomes and scenario parameters with strong correlations as non-mutable chromosomes.

[0094] Specifically, based on the correlation results, the nine scenario parameters are classified. In this embodiment, parameters 5 (the y-direction speed of the cutting-in vehicle during lane change cut-in), 6 (the y-direction distance between the vehicle and the cut-in point during lane change cut-in), 7 (the x-direction distance between the vehicle and the cut-in point during lane change cut-in), and 9 (the y-direction speed of the vehicle during lane change cut-in) are classified as mutable chromosomes because they mostly exhibit weak correlations with each other and with other parameters. Parameters 1 (the x-direction speed of the cutting-in vehicle during lane exit), 2 (the x-direction distance between the cutting-in vehicle and the ramp exit during lane exit), 3 (the distance between the cut-in point and the ramp exit during lane change cut-in), and 4 (the x-direction speed of the cutting-in vehicle during lane change cut-in) are classified as non-mutable chromosomes because they mostly exhibit strong correlations with each other and with other parameters.

[0095] This embodiment determines the correlation of scene parameters and divides them into strong correlation and weak correlation, which can more accurately capture the distribution characteristics and mutual relationships of scene parameters. The parameter correlation analysis and chromosome division based on this make the setting of variable chromosomes and non-variable chromosomes more in line with the actual scene logic.

[0096] Specifically, in some embodiments, after dividing the scene parameters into variable chromosomes and non-variable chromosomes according to the correlation, and before forming the variable chromosomes and the non-variable chromosomes into individuals, and forming a preset number of individuals into a parent population, the process further includes:

[0097] First, based on the preset value range of the scene parameters in the variable chromosome, the scene parameters in the variable chromosome are sampled according to a uniform distribution, and the sampled values obtained by sampling are determined as the initial values of the scene parameters in the variable chromosome;

[0098] Secondly, a preset Gaussian mixture model is used to estimate the joint distribution probability density of the scene parameters in the immutable chromosome, and the joint distribution estimation result of the scene parameters in the immutable chromosome is obtained;

[0099] Secondly, the initial values of the scene parameters in the mutable chromosome are determined according to the initial values of the scene parameters in the mutable chromosome and the joint distribution estimation results of the scene parameters in the immutable chromosome.

[0100] In the embodiment of the present invention, the scene parameters are pre-divided into variable chromosomes and non-variable chromosomes, wherein the variable chromosomes are set to 6 according to the cut-in vehicle and the own vehicle. The cut-in vehicle is set with 2 variable chromosomes, numbered a1 and a2, wherein the physical meaning of the variable chromosome a1 is the distance between the cut-in vehicle and the ramp exit in the x direction when exiting the ramp; the physical meaning of the variable chromosome a2 is the speed of the cut-in vehicle in the y direction when changing lanes and cutting in, which is used to calculate the collision time in the vehicle's driving direction (y direction); a total of 4 chromosomes are set for the own vehicle, numbered a3 to a6, wherein the physical meaning of the variable chromosome a3 is the distance between the own vehicle and the cutting-in point in the x direction when changing lanes and cutting in; the physical meaning of the variable chromosome a4 is the distance between the own vehicle and the cutting-in point in the y direction when changing lanes and cutting in; the physical meaning of the variable chromosome a5 is the speed of the own vehicle in the x direction when changing lanes and cutting in, which is used to calculate the collision time in the x direction; the physical meaning of the variable chromosome a6 is the speed of the own vehicle in the y direction when changing lanes and cutting in, which is used to calculate the collision time in the y direction. There are three immutable chromosomes, numbered n1 to n3. The physical meaning of the immutable chromosome n1 is the distance between the cutting-in point and the ramp exit when changing lanes; the physical meaning of the immutable chromosome n2 is the speed of the cutting-in vehicle in the x-direction when exiting the ramp; the physical meaning of the immutable chromosome n3 is the speed of the cutting-in vehicle in the x-direction when changing lanes, which can be used to calculate the collision time of the two vehicles in the x-direction.

[0101] It should be noted that since the value range of the scenario parameters of the variable chromosome is fixed, N values can be sampled from each variable chromosome in a uniformly distributed manner based on the value range of each variable chromosome to serve as the initial values of the scenario parameters in the variable chromosome. After determining the initial values of the scenario parameters in the variable chromosome, the initial values of the scenario parameters in the immutable chromosome can be inferred based on the joint distribution estimation results of the scenario parameters in the immutable chromosome.

[0102] It should be noted that a preset Gaussian mixture model is used to estimate the joint distribution probability density of the scene parameters in the immutable chromosome to obtain the joint distribution estimation result of the scene parameters in the immutable chromosome. The optimal mixing number of Gaussian models can be determined in advance, and the optimal mixing number of Gaussian models are mixed to obtain the preset Gaussian mixture model. Based on the pre-built vehicle ramp lane change model and the real traffic data from the urban expressway ramp, the ramp lane change scene parameters are extracted. In order to fit the scene parameters, this embodiment pre-determines the optimal mixing number of Gaussian models, and mixes the optimal mixing number of Gaussian models to obtain the preset Gaussian mixture model.

[0103] The optimal number of mixed Gaussian models can be determined using the absolute information criterion (AIC). Specifically, different numbers of Gaussian models can be fitted and tested, starting with a single Gaussian model and gradually increasing the number of models. The AIC value after fitting is calculated each time. After multiple tests, it is found that when K Gaussian models are used for mixing, the AIC value reaches the minimum. Then, the K Gaussian models are mixed according to certain weights to construct a preset Gaussian mixture model. Each Gaussian model is designed for different distribution characteristics of the scene parameters. For example, one Gaussian model mainly fits the distribution of vehicle speed in the scene parameters, one focuses on the distribution of the distance parameters between the vehicle and the ramp and the entry point in the scene parameters, and the other models the interaction between the scene parameters. Through repeated debugging and optimization, the mean, covariance and other parameters of each Gaussian model are determined, thereby obtaining a stable and reliable preset Gaussian mixture model. This embodiment does not specifically limit the mixing process of the preset Gaussian mixture model.

[0104] It should be noted that the Red Information Criterion (RIC) is often used to test model goodness of fit. When this technical solution uses a Gaussian mixture model to fit data, since it's not known in advance which Gaussian model will optimally fit the data, the RIC values are calculated for different numbers of models. The minimum RIC value indicates the best fit for that number of models, resulting in a more accurate fitting model and, therefore, ensuring that subsequent scenarios generated through scenario optimization based on that model are more realistic.

[0105] Specifically, the initial values of the scenario parameters in the immutable chromosome are determined based on the initial values of the scenario parameters in the mutable chromosome and the estimated joint distribution of the scenario parameters in the immutable chromosome. For example, based on the fitting results of the Gaussian mixture model of parameters 2 and 3, a two-dimensional Gaussian mixture model of parameters 2 and 3 is constructed to represent the joint distribution of parameters 2 and 3. By constructing the joint distribution of parameters 2 and 3, the distribution relationship between parameters 2 and 3 is analyzed. When the value of parameter 2 is known, the possible value of parameter 3 can be inferred from this relationship. Similarly, using the Gaussian mixture fitting results of parameter 3 and parameters 1 and 4, a three-dimensional Gaussian mixture model of parameters 3, parameter 1, and parameter 4 is constructed to represent the joint distribution model of these three parameters. By constructing the joint distribution of parameter 3 and parameters 1 and 4, the distribution relationship between parameter 3 and parameters 1 and 4 is analyzed. When the value of parameter 3 is known, the possible values of parameters 1 and 4 can be inferred from this relationship, thereby obtaining the initial values of the scenario parameters in the immutable chromosome.

[0106] Further, refer to Figure 4 , showing Figure 1 A flowchart of step 104 in a driving scene generation method is provided. This method is substantially the same as the driving scene generation method provided in the first embodiment of the present invention. Step 104 may include:

[0107] Step 1041, using the pre-generated fitness function, the initial values of the scene parameters in the individual's variable chromosome and the initial values of the scene parameters in the immutable chromosome, calculate the fitness value of each individual in the parent population, sort the individuals by fitness value, and determine the individual with the highest fitness value as the monarch individual.

[0108] Step 1042 , using a preset crossover probability to select a mother from the individuals in the parent population, cross the monarch individual with the mother in the parent population, and generate multiple new individuals.

[0109] Step 1043: mutate the new individuals using a preset mutation probability, and form the mutated new individuals into sub-populations.

[0110] It should be noted that in the embodiment of the present invention, when the monarch strategy genetic algorithm is used for scenario optimization generation, the scenario generation problem is converted into a multi-objective optimization problem, the individuals and populations participating in the genetic algorithm are established, and the optimization process parameters and fitness function are determined.

[0111] Specifically, a fitness function is pre-constructed and generated based on the scenario parameters. The fitness function comprehensively considers multiple key factors of the cutting-in vehicle and the ego vehicle during the lane change and cutting-in process, such as the distance between the cutting-in vehicle and the ramp edge at the ramp exit, the distance between the cutting-in vehicle and the ego vehicle at the cut-in point and the ramp exit, the distance between the cutting-in vehicle and the ego vehicle in the x-direction, and the distance between the cutting-in vehicle and the ego vehicle in the y-direction. The initial values of the scenario parameters in the individual's variable chromosomes and the initial values of the scenario parameters in the immutable chromosomes are substituted into the fitness function for calculation. The fitness value of each individual is calculated to evaluate the degree of danger of the scenario represented by the individual. The higher the fitness value, the more dangerous the scenario.

[0112] Specifically, the initial values of the scenario parameters in the variable chromosomes and the initial values of the scenario parameters in the immutable chromosomes of the individuals in the parent population are successively substituted into the fitness function for calculation. The calculated fitness values of all individuals are sorted from high to low, and the individual with the highest fitness value is determined as the monarch individual. The monarch individual represents the most dangerous scenario in the current parent population and plays an important role in subsequent genetic operations. A mother is selected from the individuals in the parent population using a preset crossover probability. The monarch individual is crossed with a mother in the parent population to generate multiple new individuals. The crossover probability can be pre-set to 0.1. Based on the crossover probability, a mother is randomly selected from the individuals in the parent population (excluding the monarch individual). A single-point crossover method is used to randomly select a crossover point on the chromosome. After the crossover operation, two new individuals are generated. In the same manner, the monarch individual is crossed with the other selected mothers to generate multiple new individuals.

[0113] In this embodiment, a preset mutation probability is used to mutate new individuals, and the mutated new individuals are formed into a subpopulation. The preset mutation probability can be set to 0.1. Each new individual generated is mutated according to the mutation probability. The mutation process specifically includes randomly selecting some gene positions of each individual and exchanging or perturbing the corresponding position genes of the monarch, which not only retains the excellent genetic characteristics but also introduces new changes. After the operation, the mutated individuals are checked to see if they meet the constraints (for example, whether the individual values after the mutation are within the real data interval). If not, they are repaired or mutated again. Finally, the qualified mutated individuals are returned to the population to update the population, that is, the mutated new individuals are collected to form a subpopulation. The subpopulation contains the new scenario parameter combination generated after the crossover and mutation operations, providing a new population basis for subsequent iterative optimization.

[0114] Specifically, before using the pre-generated fitness function to calculate the fitness value of each individual in the parent population, the method further includes:

[0115] First, the module parameters of the function to be generated and the importance of the module parameters are determined in advance, and the module parameters are sorted in order of importance; wherein the module parameters include at least one of the scenario parameters;

[0116] Secondly, according to the importance ranking of module parameters, the relative importance between adjacent module parameters is calculated, and the corresponding weights of module parameters are obtained by using the relative importance calculation;

[0117] Secondly, a fitness function is generated based on the module parameters and the corresponding weights of the module parameters.

[0118] It should be noted that the purpose of the embodiment of the present invention is to generate driving scenarios of varying degrees of danger, particularly ramp lane change and cut-in scenarios. Therefore, the degree of danger of the generated driving scenario is used as the fitness function for algorithm optimization. The module parameters of the function to be generated and the importance of the module parameters are predetermined, and the module parameters are ranked by importance. Based on the importance ranking of the module parameters, the relative importance between adjacent module parameters is calculated. The weights corresponding to the module parameters are calculated using the relative importance calculation, and a fitness function is generated based on the module parameters and the weights corresponding to the module parameters. The module parameters include at least one of the scenario parameters, which may specifically include the distance between the cut-in vehicle and the ramp exit at the time it exits the ramp, the distance between the cut-in vehicle and the ramp exit at the cut-in point, the distance between the cut-in vehicle and the vehicle in the x-direction, and the distance between the cut-in vehicle and the vehicle in the y-direction. This embodiment evaluates the degree of danger of the scenario from four scenario parameter dimensions. Therefore, the module parameters are set to the above four scenario parameters, and the fitness function f can be expressed as:

[0119] f=A+B+C+D

[0120] A, B, C, and D represent the distance between the cut-in vehicle and the ramp exit at the moment it exits the ramp, the distance between the cut-in vehicle and the ramp exit at the cut-in point, the x-distance between the cut-in vehicle and the ego vehicle, and the y-distance between the cut-in vehicle and the ego vehicle, respectively. Smaller values of A, B, C, and D indicate a more dangerous scene.

[0121] In this embodiment, when constructing the fitness function f, module parameters C and D are measured by collision time TTC, in seconds; at the same time, module parameters A and B are also measured by time, in seconds. Therefore, the fitness function of the algorithm can be ultimately defined as:

[0122]

[0123] Among them, G is the distance between the vehicle and the cutting-in vehicle in the x direction when changing lanes; D is the distance between the cutting-in vehicle and the vehicle in the y direction when changing lanes, v fx v is the speed of the vehicle in the x direction when changing lanes; fy is the speed of the vehicle in the y direction when changing lanes; l1 is the distance between the vehicle and the ramp exit in the x direction when the vehicle exits the ramp; l2 is the distance between the vehicle at the entry point and the ramp exit in the y direction; v cx represents the speed of the cutting vehicle in the x direction at the cutting point; v cy represents the speed of the cutting vehicle in the y direction at the cutting point; v cxr It represents the x-direction speed of the cutting vehicle when it exits the ramp, and α, β, γ and λ are the coefficients of the four module parameters.

[0124] Furthermore, to determine the weights of the four module parameters, the order relationship analysis method can be used to establish the order relationship between different factors and determine the weights based on the order relationship. First, determine the order relationship and rank the importance of each module parameter. For a parameter set with n module parameters {X1, X2, ..., X n}, first select the most important one from the n module parameters and record it as Then, select the most important module parameter from the remaining n-1 module parameters and record it as By analogy, the order relationship between n module parameters can be determined, which can be recorded as: For module parameters and Its relative importance can be expressed as:

[0125]

[0126] in, and Represents module parameters respectively and The weights are k=n,n-1,...,3,2.

[0127] According to the weight of the nth module parameter The weights of other indicators can be calculated separately:

[0128]

[0129] Finally, n evaluation indicators The subjective weight of Similarly, according to the above process, the values of the four coefficients α, β, γ and λ can be calculated, which will not be described in detail here.

[0130] Further, refer to Figure 5 , showing Figure 1 A flowchart of step 105 of a driving scene generation method is provided. This method is substantially the same as the driving scene generation method provided in the first embodiment of the present invention. Step 105 may include:

[0131] Step 1051: Use the fitness function to calculate the fitness value of each new individual in the sub-population, merge the parent population and the sub-population to obtain a new population.

[0132] Step 1052: sort the individuals in the new population by their fitness values.

[0133] Step 1053 , based on the fitness value ranking of the new population and the preset target population size, target individuals that meet the preset target population size are screened from the new population.

[0134] It should be noted that, in the embodiment of the present invention, the fitness function constructed previously is used to calculate the fitness value of each new individual in the sub-population, the parent population and the sub-population are merged to obtain a new population, and the individuals in the new population are sorted from high to low according to the fitness value. For example, after sorting, the individual with the highest fitness value is ranked first, and the individual with the lowest fitness value is ranked last. Through sorting, the relative advantages and disadvantages of each individual in the entire population can be clearly seen. According to the fitness value ranking of the new population and the preset target population size, the target individuals that meet the preset target population size are screened out from the new population.

[0135] In this embodiment, the preset target population size can be pre-set based on the population size and scenario generation requirements, and is not specifically limited to this. This embodiment uses a preset target population size of 500 as an example. The first 500 individuals from the sorted new population are selected as target individuals. These 500 individuals have higher fitness values than all other individuals, meaning that the ramp lane change scenarios they represent are relatively more dangerous and more consistent with the goal of optimizing dangerous scenarios. These 500 target individuals are retained to form a new population for subsequent iterations.

[0136] By calculating the fitness values of subpopulations and merging parent and subpopulations, the embodiment of the present invention can comprehensively consider the advantages and disadvantages of newly generated individuals and original individuals, sort and screen the new population, and select individuals with high fitness values. This improves the overall quality of the population after each round of iteration. In this way, continuous optimization generates more dangerous ramp lane change scenarios that better meet actual needs, thereby improving the efficiency of scenario optimization generation.

[0137] Reference Figure 7 , which shows a schematic structural diagram of a driving scene generation device provided by an embodiment of the present invention, the device comprising:

[0138] The parameter acquisition module 201 is used to acquire the scene parameters of the vehicle in the ramp lane change cut-in scene; wherein the scene parameters include the vehicle speed, the distance between the vehicle and the ramp or the cut-in point;

[0139] A parameter division module 202 is used to divide the scene parameters into variable chromosomes and non-variable chromosomes;

[0140] A first processing module 203 is configured to group the variable chromosomes and the non-variable chromosomes into individuals, and to group a preset number of individuals into a parent population;

[0141] The second processing module 204 is configured to calculate the fitness value of each individual in the parent population using a pre-generated fitness function, determine the individual with the highest fitness value as the monarch individual, cross-mutate the monarch individual with the parent population to generate multiple new individuals, and form the new individuals into sub-populations;

[0142] a target screening module 205 for calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation, and screening out target individuals;

[0143] The scenario generation module 206 is configured to classify the target individuals into different levels of danger according to their fitness values, thereby obtaining driving scenarios of different levels of danger.

[0144] Furthermore, the parameter acquisition module 201 includes:

[0145] The simulation submodule is used to simulate driving scenarios using a pre-built vehicle ramp lane change model to determine the motion trajectories of the cutting vehicle and the ego vehicle.

[0146] An extraction submodule, configured to extract the corresponding vehicle speeds of the cutting-in vehicle and the ego vehicle, and the distances between the vehicle and the ramp or the cutting-in point from the motion trajectories of the cutting-in vehicle and the ego vehicle;

[0147] The determination submodule is used to determine the vehicle speeds corresponding to the cutting-in vehicle and the own vehicle, and the distance between the vehicle and the ramp or the cutting-in point as the scene parameters of the vehicle changing lanes on the ramp and cutting in.

[0148] Furthermore, the parameter division module 202 includes:

[0149] A screening submodule is used to screen out scene parameters with correlation using a correlation coefficient; the correlation of the scene parameters includes strong correlation and weak correlation;

[0150] The division submodule is used to divide the scene parameters with weak correlation into variable chromosomes and the scene parameters with strong correlation into non-variable chromosomes.

[0151] Furthermore, the device further comprises:

[0152] a first initialization module, configured to sample the scene parameters in the variable chromosome according to a uniform distribution based on a preset value range of the scene parameters in the variable chromosome, and determine the sampled values as the initial values of the scene parameters in the variable chromosome;

[0153] The joint distribution estimation module is used to use a preset Gaussian mixture model to perform joint distribution probability density estimation on the scene parameters in the immutable chromosome to obtain a joint distribution estimation result of the scene parameters in the immutable chromosome.

[0154] The second initialization module is used to determine the initial values of the scene parameters in the immutable chromosome according to the initial values of the scene parameters in the variable chromosome and the joint distribution estimation results of the scene parameters in the immutable chromosome.

[0155] Furthermore, the second processing module 204 includes:

[0156] a calculation submodule, configured to calculate the fitness value of each individual in the parent population using a pre-generated fitness function, initial values of the scene parameters in the individual's variable chromosome, and initial values of the scene parameters in the immutable chromosome, sort the individuals by fitness value, and determine the individual with the highest fitness value as the monarch individual;

[0157] A generation submodule, configured to select a mother from the individuals of the parent population using a preset crossover probability, and cross the monarch individual with the mother in the parent population to generate a plurality of new individuals;

[0158] The processing submodule is used to perform mutation processing on the new individuals using a preset mutation probability, and form the mutated new individuals into sub-populations.

[0159] Furthermore, the device further comprises:

[0160] A parameter preprocessing module, configured to predetermine module parameters of the function to be generated and the importance of the module parameters, and to sort the module parameters by importance; wherein the module parameters include at least one of the scenario parameters;

[0161] A weight calculation module is used to calculate the relative importance of adjacent module parameters according to the importance ranking of the module parameters, and obtain the corresponding weights of the module parameters using the relative importance calculation;

[0162] The function generation module is used to generate a fitness function according to the module parameters and the weights corresponding to the module parameters.

[0163] Furthermore, the target screening module 205 includes:

[0164] a merging submodule, configured to calculate the fitness value of each new individual in the subpopulation using the fitness function, and merge the parent population and the subpopulation to obtain a new population;

[0165] A sorting submodule, used to sort the fitness values of individuals in the new population;

[0166] The screening submodule is used to screen target individuals that meet the preset target population size from the new population according to the fitness value ranking of the new population and the preset target population size.

[0167] The driving scene generation device provided by an embodiment of the present invention obtains scene parameters of a vehicle changing lanes on a ramp, divides the scene parameters into variable chromosomes and immutable chromosomes, groups the variable chromosomes and the immutable chromosomes into individuals, and groups a preset number of individuals into a parent population. A pre-generated fitness function is used to calculate the fitness value of each individual in the parent population, and the individual with the highest fitness value is determined as the monarch individual. The monarch individual and the parent population are cross-mutated to generate multiple new individuals, and the new individuals are formed into sub-populations. The fitness function is used to calculate the fitness value of each new individual in the sub-population, the parent population and the sub-population are merged, and target individuals are screened out. The target individuals are divided into dangerousness levels according to the fitness values to obtain driving scenes with different dangerousness levels. The embodiment of the present invention analyzes the scenario parameters of a small number of vehicles in the ramp lane change scenario, adopts the monarch strategy genetic algorithm, divides the scenario parameters into variable chromosomes and non-variable chromosomes, and generates a large number of test scenarios with different levels of danger through population iteration, thereby improving the efficiency of scenario optimization generation, enriching the test scenarios of ramp lane change scenarios in urban scenarios, and obtaining effective and comprehensive ramp lane change driving scenario data, which helps to improve the effect of autonomous driving testing.

[0168] Reference Figure 8 , an embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 301, a communication interface 303, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 303, and the memory 303 communicate with each other through the communication bus 304.

[0169] Processor 301, memory 303 for storing processor-executable instructions;

[0170] The processor 301 is configured to execute the instructions to implement the following driving scene generation method:

[0171] Obtaining scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point;

[0172] Dividing the scene parameters into variable chromosomes and non-variable chromosomes;

[0173] Grouping the variable chromosomes and the non-variable chromosomes into individuals, and grouping a preset number of individuals into a parent population;

[0174] Calculating the fitness value of each individual in the parent population using a pre-generated fitness function, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate a plurality of new individuals, and forming the new individuals into sub-populations;

[0175] Calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation, and screening out target individuals;

[0176] The target individuals are divided into different levels of danger according to their fitness values to obtain driving scenarios with different levels of danger.

[0177] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0178] The communication interface is used for communication between the above terminal and other devices.

[0179] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0180] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0181] In another embodiment provided by the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the driving scene generation method described in any of the above embodiments is implemented.

[0182] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0183] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0184] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.

[0185] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A driving scene generation method, characterized in that: The method comprises: Obtaining scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point; Dividing the scene parameters into variable chromosomes and non-variable chromosomes; Grouping the variable chromosomes and the non-variable chromosomes into individuals, and grouping a preset number of individuals into a parent population; Calculating the fitness value of each individual in the parent population using a pre-generated fitness function, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate a plurality of new individuals, and forming the new individuals into sub-populations; Calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation, and screening out target individuals; The target individuals are divided into different levels of danger according to their fitness values to obtain driving scenarios with different levels of danger.

2. The method according to claim 1, characterized in that The acquiring of scene parameters of a vehicle entering a lane change on a ramp, wherein the scene parameters include vehicle speed and the distance between the vehicle and the ramp or entry point, includes: A pre-built ramp lane change model is used to simulate driving scenarios and determine the trajectories of the cutting vehicle and the ego vehicle. Extracting the corresponding vehicle speeds of the cutting-in vehicle and the own vehicle, and the distances between the vehicles and the ramp or the cutting-in point from the motion trajectories of the cutting-in vehicle and the own vehicle; The vehicle speeds corresponding to the cutting-in vehicle and the own vehicle, and the distance between the vehicle and the ramp or the cutting-in point are determined as the scene parameters of the vehicle changing lanes on the ramp and cutting in.

3. The method according to claim 1, characterized in that The dividing the scene parameters into variable chromosomes and non-variable chromosomes includes: Using the correlation coefficient to screen out scene parameters with correlation; the correlation of the scene parameters includes strong correlation and weak correlation; The scene parameters with weak correlation are divided into variable chromosomes, and the scene parameters with strong correlation are divided into non-variable chromosomes.

4. The method according to claim 1, wherein After dividing the scene parameters into variable chromosomes and non-variable chromosomes, and before grouping the variable chromosomes and the non-variable chromosomes into individuals, and before grouping a preset number of individuals into a parent population, the method further includes: According to the preset value range of the scene parameter in the variable chromosome, the scene parameter in the variable chromosome is sampled according to a uniform distribution, and the sampled value obtained by sampling is determined as the initial value of the scene parameter in the variable chromosome; Using a preset Gaussian mixture model to perform joint distribution probability density estimation on the scene parameters in the immutable chromosome, to obtain a joint distribution estimation result of the scene parameters in the immutable chromosome; The initial values of the scene parameters in the immutable chromosome are determined according to the initial values of the scene parameters in the variable chromosome and the joint distribution estimation results of the scene parameters in the immutable chromosome.

5. The method according to claim 4, characterized in that The method comprises: using a pre-generated fitness function to calculate the fitness value of each individual in the parent population, determining the individual with the highest fitness value as the monarch individual, cross-mutating the monarch individual with the parent population to generate multiple new individuals, and forming the new individuals into sub-populations, including: Using a pre-generated fitness function, initial values of the scene parameters in the variable chromosome of the individual, and initial values of the scene parameters in the immutable chromosome, the fitness value of each individual in the parent population is calculated, the individuals are sorted by fitness value, and the individual with the highest fitness value is determined as the monarch individual; Selecting a mother from the individuals of the parent population using a preset crossover probability, and crossing the monarch individual with the mother in the parent population to generate a plurality of new individuals; The new individuals are mutated using a preset mutation probability, and the mutated new individuals are formed into subpopulations.

6. The method according to claim 1, characterized in that Before calculating the fitness value of each individual in the parent population using the pre-generated fitness function, the method further includes: Predetermining module parameters of the function to be generated and the importance of the module parameters, and sorting the module parameters by importance; wherein the module parameters include at least one of the scenario parameters; According to the importance ranking of the module parameters, the relative importance between adjacent module parameters is calculated, and the corresponding weights of the module parameters are obtained by using the relative importance calculation; A fitness function is generated according to the module parameters and the weights corresponding to the module parameters.

7. The method according to claim 1, characterized in that The step of using the fitness function to calculate the fitness value of each new individual in the subpopulation, merging the parent population and the subpopulation, and screening out target individuals comprises: Calculating the fitness value of each new individual in the subpopulation using the fitness function, merging the parent population and the subpopulation to obtain a new population; Sorting the individuals in the new population by fitness value; According to the fitness value ranking of the new population and the preset target population size, target individuals that meet the preset target population size are screened from the new population.

8. A driving scene generating device, characterized in that: The device comprises: A parameter acquisition module is used to obtain scenario parameters of a vehicle entering a lane change on a ramp; wherein the scenario parameters include vehicle speed and the distance between the vehicle and the ramp or the entry point; A parameter division module, used for dividing the scene parameters into variable chromosomes and non-variable chromosomes; A first processing module is configured to group the variable chromosomes and the non-variable chromosomes into individuals, and to group a preset number of individuals into a parent population; a second processing module, configured to calculate the fitness value of each individual in the parent population using a pre-generated fitness function, determine the individual with the highest fitness value as the monarch individual, cross-mutate the monarch individual with the parent population to generate a plurality of new individuals, and form the new individuals into sub-populations; a target screening module, configured to calculate the fitness value of each new individual in the subpopulation using the fitness function, merge the parent population and the subpopulation, and screen out target individuals; The scenario generation module is used to classify the target individuals into different levels of danger according to their fitness values, thereby obtaining driving scenarios with different levels of danger.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the instructions to implement the driving scene generation method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the driving scene generation method according to any one of claims 1 to 7 is implemented.