Automatic driving simulation test scene generation method, system and device and storage medium

Through the test scenario generation method based on differential evolution algorithm, combined with multi-elite individual guidance strategies and dynamic parameter adjustment, the problem of low quality of test scenarios in the existing technology is solved, and more efficient testing and potential safety hazard discovery are achieved.

CN119808597AActive Publication Date: 2025-04-11HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)

Patent Information

Application Number
CN202510278999.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-04-11
Estimated Expiration
2045-03-11

AI Technical Summary

Technical Problem

The quality of the test scenarios generated by the existing autonomous driving test methods is not high, and it is difficult to discover new and potentially dangerous situations. The main reason is that the traditional methods lack effective exploration mechanisms.

Method used

The test scenario generation method based on differential evolution algorithm is adopted, and the test scenario variation operation is carried out through multi-elite individual guidance strategy to generate diverse traffic scenarios, and the algorithm exploration ability is improved by dynamically adjusting the scaling factor and the number of elite individuals.

Benefits of technology

It improves testing efficiency, can more effectively discover potential safety hazards of autonomous driving software, and improves global search capabilities by generating diverse test scenarios to avoid local optimal solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808597A_ABST
    Figure CN119808597A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic driving simulation test scene generation method, system and device and a storage medium, and the method carries out the test scene generation based on a differential evolution algorithm, and comprises the steps: setting mutation operation parameters; initializing a test scene population, including setting the size N of an initial population, and generating a random test scene as the initial population; judging the number of current test iterations and executing a test scene variation operation on the test scene by adopting a multi-elite individual guidance strategy to generate a variation scene Xn; crossing the variation scene Xn and the reference scene Xg to generate a crossing scene Xu; determining a next-generation test scene based on the fitness value; testing and recording key data by using a next-generation test scene; and based on the recorded key data, analyzing whether a traffic accident occurs and returning to iteration. According to the method, diversified traffic scenes can be automatically generated, the test efficiency can be improved, and potential safety hazards of automatic driving software can be found.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of autonomous driving, and specifically relates to a method, system, device and storage medium for generating an autonomous driving simulation test scenario. Background Art

[0002] With the rapid development of autonomous driving technology, ensuring that autonomous driving vehicles can operate safely and reliably in various complex environments has become an important topic in research and engineering practice. In order to fully evaluate the safety of autonomous driving systems, they must be tested extensively and in depth.

[0003] High-quality test scenarios are crucial for discovering potential system problems because they increase the likelihood of finding defects in the autonomous driving system. However, existing testing methods often generate low-quality test scenarios, mainly because traditional methods that rely on predefined rules or random generation strategies lack effective exploration mechanisms and are difficult to discover new and potentially dangerous situations. Summary of the invention

[0004] In response to the above-mentioned problems, the present invention provides a method, system, electronic device and storage medium for generating an autonomous driving simulation test scenario, aiming to improve test efficiency and the success rate of finding problem scenarios.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for generating an autonomous driving simulation test scenario is provided. The method generates a test scenario based on a differential evolution algorithm, comprising the following steps: Set the scaling factor F and mutation factor C of the differential evolution algorithm r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; Initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; Determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C r and the maximum number of iterations G, a multi-elite individual guidance strategy is used to perform test scenario mutation operations on the test scenario to generate a mutation scenario X n ; Change scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Determine cross-scene X u Is the fitness value of the benchmark scenario X g If the fitness value is greater than , the crossover scenario X is selected. uAdd the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; Import the next generation test scenarios into the simulator, and the autonomous driving software under test will perform the driving tasks set in the test scenarios and record key data; Based on the recorded key data, analyze whether a traffic accident has occurred. If a traffic accident has occurred, add the test scenario to the dangerous scenario library; if no traffic accident has occurred, put the test scenario into the historical scenario library; add 1 to the test iteration number, and return to determine whether the current test iteration number g is greater than the maximum iteration number G.

[0006] In some embodiments, a test scenario mutation operation is performed on the test scenario using a multi-elite individual guidance strategy, specifically including the following steps: Calculate the relative improvement rate of the fitness value between the current test scenario and the previous generation test scenario. If the relative improvement rate does not exceed the threshold, select a scenario from the historical mutation scenario library as the mutation scenario X. n , otherwise the leader individual is calculated based on multiple elite individuals, including the following steps: Arrange the individuals in the current test scene population in descending order according to their fitness values, and select the first m individuals as elite individuals; According to the fitness value of the elite individuals, the weighted average is calculated to obtain the leader individual X e ; Generate a variant scenario X based on the baseline scenario, the leader individual, and an individual randomly selected from the population n .

[0007] In some embodiments, a variant scenario X is generated. n The specific expression is: , X g is the reference scene, F is the scaling factor, X e For the leader individual; X r is another individual randomly selected from the population.

[0008] In some embodiments, the method further comprises dynamically adjusting the scaling factor F, that is, according to the initial value and the final value of the scaling factor, the current iteration number and the maximum iteration number G, the scaling factor F is inversely proportional to the current iteration number.

[0009] In some embodiments, the method further includes dynamically adjusting the number m of elite individuals, that is, the initial value of the number m of elite individuals is half of the population number N, and gradually decreases with the increase of the current number of iterations.

[0010] In some embodiments, the variant scene X nCompared with the baseline scenario X g Cross-Generation Cross-Scene X u , specifically including the following steps: For each scenario, we traverse all the parameters and transform the mutated scenario X n Compared with the baseline scenario X g Cross Generation X u , the selection criteria of parameters are: Generate a random number in the interval [0, 1]. If the random number is less than the mutation factor C r , then the parameter selection mutation scenario X n Otherwise, select the benchmark scene X g parameter.

[0011] In some embodiments, the fitness value f is calculated as: f = w 1⋅( MaxDist − minDist )+ w 2⋅(− laneDeviationCount )+ w 3⋅(− trafficRuleViolationCount ) in, w 1, w 2, w 3 are the weights set for the minimum relative distance, the number of lane departures, and the number of traffic rule violations; MaxDist Indicates the preset maximum safe distance between the tested vehicle and the NPC vehicle. minDist Indicates the minimum relative distance between the tested vehicle and the NPC vehicle. laneDeviationCount Indicates the number of lane departures, trafficRuleViolationCount Indicates the number of traffic violations.

[0012] According to a second aspect of an embodiment of the present disclosure, there is provided a system for generating a simulation test scenario for an autonomous driving system. The system generates a test scenario based on a differential evolution algorithm, comprising: Mutation operation setting module, used to set the scaling factor F and mutation factor C of the differential evolution algorithm r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; A test scenario initialization module is used to initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; The test scenario mutation operation module is used to determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C rand the maximum number of iterations G, use the multi-elite individual guidance strategy to perform test scenario mutation operations on the test scenario to generate the mutation scenario X n ; The cross-scenario generation module is used to transform the mutated scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Next generation test scenario selection module for judging cross-scenario X u Is the fitness value of the scene smaller than the benchmark scene X? g If the fitness value is greater than , the crossover scenario X is selected. u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; The test module is used to import the next generation test scenarios into the simulator. The autonomous driving software under test performs the driving tasks set in the test scenarios and records key data. The accident judgment module is used to analyze whether a traffic accident has occurred based on the recorded key data. If a traffic accident has occurred, the test scenario will be added to the dangerous scenario library; if no traffic accident has occurred, the test scenario will be placed in the historical scenario library; the test iteration number is increased by 1, and it is returned to determine whether the current test iteration number g is greater than the maximum iteration number G.

[0013] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for generating a simulation test scenario for autonomous driving when executing the program.

[0014] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the above-mentioned method for generating a simulation test scenario for autonomous driving are implemented.

[0015] The embodiments of the present disclosure provide a method, system, electronic device, and storage medium for generating a simulation test scenario for an autonomous driving test, aiming to design an efficient algorithm that can automatically generate a test scenario for an autonomous driving simulation test. Specifically: The present invention designs a test scenario generation method based on the Differential Evolution Algorithm (DE), which can automatically generate a variety of traffic scenarios, improve test efficiency, and discover potential safety hazards of autonomous driving software; The algorithm of the present invention adopts a multi-elite individual guidance strategy, which can explore the solution space more efficiently. In the mutation operation, multiple elite individuals (i.e., high fitness individuals) are introduced as guides. This strategy enables the algorithm to comprehensively consider the information of multiple excellent individuals in each generation, thereby improving the convergence speed; The algorithm of the present invention can dynamically adjust the scaling factor F and the number parameter m of elite individuals according to the current state of the population at different stages; The algorithm of the present invention will save historical variation scenarios. When it converges to a certain degree, it will reselect the variation direction according to the historical variation scenarios. By reselecting the variation direction, the algorithm can jump out of the local optimal solution and continue to explore areas that have not been fully explored, thereby improving the global search capability.

[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the present invention; Figure 1 is a schematic diagram of a flow chart of a method for generating a simulation test scenario for autonomous driving according to an embodiment of the present invention; Figure 2 is a flow chart of performing test scenario variation operations in an embodiment of the present invention; Figure 3 is a schematic diagram of the structure of an autonomous driving simulation test scenario generation system in an embodiment of the present invention; Figure 4 It is a schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0019] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0020] The embodiments of the present invention provide the following embodiments for a method, system, electronic device, and storage medium for generating an autonomous driving simulation test scenario: A test scenario generation method based on adaptive differential evolution algorithm and guided by multiple elite individuals. The flow chart of the autonomous driving simulation test scenario generation method based on differential evolution is as follows: Figure 1 As shown, the following steps are included: Step 1: Set the scaling factor F, mutation factor Cr and maximum number of iterations G of the differential evolution algorithm. The scaling factor F is used to control the step size of the mutation operation, and the mutation factor C is used to control the step size of the mutation operation. r Used to control the probability of mutation operation, the mutation factor is initialized to 0.8 in the preferred embodiment. The maximum number of iterations G sets the maximum number of iterations of the algorithm to prevent infinite loops. In step 5, the algorithm will dynamically adjust the scaling factor F through an adaptive method, which will be detailed in step 5.

[0021] Step 2: Initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; In this step, it is necessary to define the representation of the scene, clarify which parameters are used to construct the scene, and then define their value ranges to ensure that the symbols of these parameters satisfy the physical meaning.

[0022] According to the 6-layer description model of the scene, the embodiment selects parameters such as road type (city streets, highways, rural roads), traffic density (free flow, light congestion, severe congestion), weather conditions (clear, rainy, foggy, snowy), time (day, dusk, night), lighting conditions, surrounding environment (stationary obstacles, dynamic obstacles such as pedestrians and animals), and vehicle status (speed, acceleration, steering angle) to describe the scene. Therefore, each test scene is composed of several parameters, which specify the driving tasks, road environment, weather environment and other elements of the tested vehicle and NPC vehicle.

[0023] Then, the size of the initial population is set to N, indicating that there are N test scenarios in the initial population. Then, N random test scenarios are generated as the initial population, and the parameters of each scenario are randomly initialized.

[0024] Step 3: Determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, the test iteration is terminated based on the scaling factor F and the variation factor C. r and the maximum number of iterations G, use the multi-elite individual guidance strategy to perform test scenario mutation operations on the test scenario to generate the mutation scenario X n ; Step 4: Test scene variation operations, such as Figure 2 As shown, the specific steps include: Step 41, calculate the relative improvement rate. The relative change of the fitness value between the current generation and the previous generation is used to determine whether the algorithm has approached the optimal solution. The relative improvement rate of the fitness value between the current test scenario and the previous generation test scenario is determined. If the relative improvement rate does not exceed the threshold, a scenario is selected from the historical scenario library as the variant scenario X. n , otherwise the leader individual is calculated based on multiple elite individuals.

[0025] Specifically, the embodiment creates a data structure to store historical mutation scenarios and their fitness values. In each generation, the generated mutation scenarios and their fitness values ​​are saved in the historical mutation scenario library. Before the mutation begins, the relative improvement rate r of the best fitness value of the scenario of this generation and the scenario of the previous generation is calculated. If r is less than a threshold, a scenario is selected from the historical scenario library as X. n , otherwise the leader individual is calculated based on multiple elite individuals.

[0026] The calculation formula of relative improvement rate r is as follows: , where f c is the fitness value of the current generation, f p is the fitness value of the previous generation.

[0027] Step 42, calculating the leader individual based on multiple elite individuals, includes the following steps: Arrange the individuals in the current test scene population in descending order according to their fitness values, and select the first m individuals as elite individuals; According to the fitness value of the elite individuals, the weighted average is calculated to obtain the leader individual X e .

[0028] , Among them, X b is the individual with the highest fitness value among the first m individuals in the current population, X w It is the individual with the lowest fitness value among the first m individuals in the current population.

[0029] Step 43: Generate a variant scenario X based on the baseline scenario, the leader individual and a random individual n .

[0030] The specific formula is , where X g is the individual currently selected for mutation operation (i.e., the benchmark scenario), which will be combined with the other two individuals to generate a new mutation scenario; X e It is a leader individual obtained by weighted averaging of multiple high fitness individuals (i.e. elite individuals); X r It is another individual randomly selected from the population to increase the diversity of the mutation process and prevent the algorithm from falling into a local optimal solution.

[0031] Step 44: At different stages of mutation, the scaling factor F and the number of elite individuals m need to be dynamically adjusted.

[0032] The scaling factor F is dynamically adjusted, that is, according to the initial value and final value of the scaling factor, the current number of iterations and the maximum number of iterations G, the scaling factor F is inversely proportional to the current number of iterations.

[0033] Specifically, in the early stages of the algorithm, we hope to enhance the exploration capability and search the solution space extensively. Therefore, a larger scaling factor F is usually set to increase the variable step length, and more elite individuals (larger m) are selected to provide diversified search directions. In the later stages of the algorithm, the main goal is to further refine the search and improve the development capability. At this point, the scaling factor F is further reduced to ensure that the search is concentrated in the most promising area. At the same time, the value of m is reduced so that the leader individual is more focused on the current optimal solution. The calculation formula for the scaling factor F is as follows: , where F start is the initial value of the scaling factor, F end is the final value of the scaling factor, g is the current iteration number, and G is the preset maximum iteration number.

[0034] The number of elite individuals m is dynamically adjusted, that is, the initial value of the number of elite individuals m is half of the population number N, and it gradually decreases with the increase of the current number of iterations.

[0035] Specifically, the number of elite individuals m will gradually decrease with the number of test rounds. The initial value of the number of elite individuals m is set to half of the population N. As the number of test rounds g increases, the value of m will gradually decrease. The calculation formula is as follows: , where round(k) function represents the maximum value of integers less than or equal to k.

[0036] Step 5: Mutate scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; The specific steps include: For each scenario, we traverse all the parameters and transform the mutated scenario X n Compared with the baseline scenario X g Cross Generation X u , the selection criteria of parameters are: Generate a random number in the interval [0, 1]. If the random number is less than the mutation factor Cr, the parameter selects the mutation scenario X. n Otherwise, select the benchmark scene X g parameter.

[0037] In the specific implementation process, since each scene contains multiple parameters, each scene is actually equivalent to a multidimensional vector, and each dimension is a parameter. It is necessary to traverse all dimensions and transform the mutated scene X n Compared with the baseline scenario X g Cross Generation X u For each dimension j (1≤j≤D), a new scene X is generated according to the following formula: u,j : , where rand(0,1) means generating a random number in the interval [0, 1].

[0038] Step 6: Determine the cross scene X u The fitness value f(X u ) is smaller than the baseline scenario X g The fitness value f(X g ), if it is greater, select cross scene X u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario; Specifically, a linear function is designed to calculate the fitness value to evaluate the probability of a traffic accident in the test scenario. Specifically, a linear model based on multiple key indicators is constructed, including the minimum relative distance between two vehicles, the number of lane departures, and the number of traffic rule violations. Through the weighted sum of these indicators, we can quantify the safety of each test scenario and evaluate its probability of a traffic accident.

[0039] The calculation formula of the fitness value f is: f = w 1⋅( MaxDist − minDist )+ w 2⋅(− laneDeviationCount )+ w 3⋅(− trafficRuleViolationCount ) in, w 1, w 2, w 3 are the weights set for the minimum relative distance, the number of lane departures, and the number of traffic rule violations; MaxDist Indicates the preset maximum safe distance between the tested vehicle and the NPC vehicle. minDist Indicates the minimum relative distance between the tested vehicle and the NPC vehicle. laneDeviationCount Indicates the number of lane departures, trafficRuleViolationCount Indicates the number of traffic violations.

[0040] Step 7: Import the next generation test scenario into the simulator, and the autonomous driving software under test executes the driving task set in the test scenario and records key data; Specifically, the test scenario is imported into the simulator, and the autonomous driving software under test is made to perform the driving tasks set in the test scenario, and the NPC vehicle is also made to perform the driving tasks set in the test scenario. During the test, the behavior of the autonomous driving software under test and the NPC vehicle is monitored in real time, and key data such as vehicle trajectory, speed, acceleration, collision events, etc. are recorded. These data will be used for subsequent analysis and evaluation.

[0041] Step 8: Based on the recorded key data, analyze whether a traffic accident has occurred. If a traffic accident has occurred, add the test scenario to the dangerous scenario library. If no traffic accident has occurred, put it into the historical scenario library. Add 1 to the test iteration number, and return to step 3 to determine whether the current test iteration number g is greater than the maximum iteration number G.

[0042] Another embodiment is used to illustrate an autonomous driving simulation test scenario generation system 300. The system 300 generates a test scenario based on a differential evolution algorithm, including: The mutation operation setting module 310 is used to set the scaling factor F and mutation factor C of the differential evolution algorithm. r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; A test scenario initialization module 320 is used to initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; The test scenario mutation operation module 330 is used to determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C r and the maximum number of iterations G, use the multi-elite individual guidance strategy to perform test scenario mutation operations on the test scenario to generate the mutation scenario X n ; The cross-scenario generation module 340 is used to convert the variant scenario X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Next generation test scenario selection module 350, used to determine the cross scenario X u Is the fitness value of the scene smaller than the benchmark scene X? g If the fitness value is greater than , the crossover scenario X is selected. u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X gFor the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; The test module 360 ​​is used to import the next generation test scenario into the simulator, and the autonomous driving software under test performs the driving task set in the test scenario and records key data; The accident judgment module 370 is used to analyze whether a traffic accident has occurred based on the recorded key data. If a traffic accident has occurred, the test scenario will be added to the dangerous scenario library; if no traffic accident has occurred, the test scenario will be placed in the historical scenario library; the test iteration number is increased by 1, and it is returned to determine whether the current test iteration number g is greater than the maximum iteration number G.

[0043] The test scenario variation operation module 330 specifically includes the following steps: Determine the relative improvement rate of the fitness value between the current test scenario and the previous generation test scenario. If the relative improvement rate does not exceed the threshold, select a scenario from the historical scenario library as the variation scenario X. n , otherwise the leader individual is calculated based on multiple elite individuals, including the following steps: Arrange the individuals in the current test scene population in descending order according to their fitness values, and select the first m individuals as elite individuals; According to the fitness value of the elite individuals, the weighted average is calculated to obtain the leader individual X e ; Generate a variant scenario X based on the baseline scenario, the leader individual, and a random individual n .

[0044] In addition to the above modules, the system may also include other components. However, since these components are irrelevant to the content of the embodiments of the present disclosure, their illustration and description are omitted here.

[0045] The other specific working processes of the autonomous driving simulation test scenario generation system 300 refer to the description of the above-mentioned autonomous driving simulation test scenario generation method embodiment and will not be repeated here.

[0046] Another embodiment is used to illustrate that the system of the present invention can also be used with the help of Figure 4 The architecture of the computing device shown is implemented. Figure 4 The architecture of the computing device is shown. Figure 4 As shown, a computer system 410, a system bus 430, one or more CPUs 440, an input / output 420, a memory 450, etc. The memory 450 can store various data or files used for computer processing and / or communication and program instructions executed by the CPU including the method for generating a simulation test scenario for autonomous driving according to an embodiment. Figure 4 The architecture shown is only exemplary and can be adjusted according to actual needs when implementing different devices. Figure 4One or more components in. The memory 450, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for generating a simulation test scenario for autonomous driving in an embodiment of the present invention (for example, the variation operation setting module 310, the test scenario initialization module 320, the test scenario variation operation module 330, the cross-scenario generation module 340, the next-generation test scenario selection module 350, the test module 360 ​​and the accident judgment module 370 in the autonomous driving simulation test scenario generation system 300). One or more CPUs 440 execute various functional applications and data processing of the system of the present invention by running the software programs, instructions and modules stored in the memory 450, that is, to implement the above-mentioned method for generating a simulation test scenario for autonomous driving, which generates a test scenario based on a differential evolution algorithm, and includes the following steps: Set the scaling factor F and mutation factor C of the differential evolution algorithm r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; Initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; Determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C r and the maximum number of iterations G, a multi-elite individual guidance strategy is used to perform test scenario mutation operations on the test scenario to generate a mutation scenario X n ; Change scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Determine cross-scene X u Is the fitness value of the benchmark scenario X g If the fitness value is greater than , the crossover scenario X is selected. u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; Import the next generation test scenarios into the simulator, and the autonomous driving software under test will perform the driving tasks set in the test scenarios and record key data; Based on the recorded key data, analyze whether a traffic accident has occurred. If a traffic accident has occurred, add the test scenario to the dangerous scenario library; if no traffic accident has occurred, put the test scenario into the historical scenario library; add 1 to the test iteration number, and return to determine whether the current test iteration number g is greater than the maximum iteration number G.

[0047] Of course, the processor of the server provided in the embodiment of the present invention is not limited to executing the method operations described above, but can also execute related operations in the autonomous driving simulation test scenario generation method provided in any embodiment of the present invention.

[0048] The memory 450 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 450 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 450 may further include a memory remotely arranged relative to one or more CPUs 440, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0049] The input / output 420 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The input / output 420 may also include a display device such as a display screen.

[0050] The embodiment of the present invention also provides a non-temporary computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, the method for generating a simulation test scenario for an autonomous driving described in the above embodiment is implemented. The computer-readable storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device or device.

[0051] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0052] The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.

[0053] In addition, other specific working processes of a non-temporary computer-readable storage medium refer to the description of the above-mentioned embodiment of the autonomous driving simulation test scenario generation method and will not be repeated here.

[0054] In summary, the technical solutions provided by the above embodiments, a method, system, electronic device and storage medium for generating a simulation test scene for autonomous driving, a method, system, electronic device and storage medium for generating a simulation test scene for autonomous driving provided by the embodiments of the present disclosure, the method of the present invention is an active learning method based on a multi-centroid comparison autoencoder, which can effectively reduce the dimension of network traffic features based on the multi-centroid comparison autoencoder, and screen samples that affect data distribution for fine-tuning, thereby improving the detection efficiency of the model; the backbone model of the multi-centroid comparison autoencoder is used to represent the network traffic features, and the statistical characteristics of the traffic are fully utilized to obtain a more effective feature representation. In addition, the method of the present invention proposes an effective sample collection method, which combines the nearest centroid ratio and uncertainty to directly screen out the sample set that affects the distribution difference, which is conducive to further fine-tuning. Furthermore, the method of the present invention allows the distribution characteristics of network traffic to be continuously learned in a flexible manner by using multi-centroid comparison autoencoders, nearest centroid ratios and uncertainty sampling, without forgetting the learned distribution characteristics, thereby protecting the target network system from malicious attacks. In summary, the method of the present invention has good dimensionality reduction and representation capabilities for high-dimensional features, and has a continuous and efficient discrimination capability for normal traffic and malicious traffic.

[0055] In this document, the terms "comprises," "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, such that a step or method that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such step or method.

[0056] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A method for generating an autonomous driving simulation test scenario, characterized in that: The method generates a test scenario based on a differential evolution algorithm, and includes the following steps: Set the scaling factor F and mutation factor C of the differential evolution algorithm r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; Initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; Determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C r and the maximum number of iterations G, a multi-elite individual guidance strategy is used to perform test scenario mutation operations on the test scenario to generate a mutation scenario X n ; Change scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Determine cross-scene X u Is the fitness value of the scene smaller than the benchmark scene X? g If the fitness value is greater than , the crossover scenario X is selected. u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; Import the next generation test scenarios into the simulator, and the autonomous driving software under test will perform the driving tasks set in the test scenarios and record key data; Based on the recorded key data, analyze whether a traffic accident has occurred. If a traffic accident has occurred, add the test scenario to the dangerous scenario library; if no traffic accident has occurred, put the test scenario into the historical scenario library; add 1 to the test iteration number, and return to determine whether the current test iteration number g is greater than the maximum iteration number G.

2. The method for generating an autonomous driving simulation test scenario according to claim 1, characterized in that: The multi-elite individual guidance strategy is used to perform test scenario mutation operations on the test scenario, which specifically includes the following steps: Calculate the relative improvement rate of the fitness value between the current test scenario and the previous generation test scenario. If the relative improvement rate does not exceed the threshold, select a scenario from the historical mutation scenario library as the mutation scenario X. n , otherwise the leader individual is calculated based on multiple elite individuals, including the following steps: Arrange the individuals in the current test scene population in descending order according to their fitness values, and select the first m individuals as elite individuals; According to the fitness value of the elite individuals, the weighted average is calculated to obtain the leader individual X e ; Generate a variant scenario X based on the baseline scenario, the leader individual, and an individual randomly selected from the population n .

3. The method for generating an autonomous driving simulation test scenario according to claim 2, characterized in that: The specific expression for generating the mutation scenario Xn is: , X g is the reference scene, F is the scaling factor, X e For the leader individual; X r is another individual randomly selected from the population.

4. The method for generating an autonomous driving simulation test scenario according to claim 2, characterized in that: The method further comprises dynamically adjusting the scaling factor F, that is, according to the initial value and the final value of the scaling factor, the current number of iterations and the maximum number of iterations G, making the scaling factor F inversely proportional to the current number of iterations.

5. The method for generating an autonomous driving simulation test scenario according to claim 2, characterized in that: The method also includes dynamically adjusting the number m of elite individuals, that is, the initial value of the number m of elite individuals is half of the population number N, and gradually decreases with the increase of the current number of iterations.

6. The method for generating an autonomous driving simulation test scenario according to claim 1, characterized in that: Change scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u , specifically including the following steps: For each scenario, we traverse all the parameters and transform the mutated scenario X n Compared with the baseline scenario X g Cross Generation X u , the selection criteria of parameters are: Generate a random number in the interval [0, 1]. If the random number is less than the mutation factor C r , then the parameter selection mutation scenario X n Otherwise, select the benchmark scene X g parameter.

7. The method for generating an autonomous driving simulation test scenario according to claim 1, characterized in that: The calculation formula of the fitness value f is: f = w 1⋅( MaxDist − minDist )+ w 2⋅(− laneDeviationCount )+ w 3⋅(− trafficRuleViolationCount ) in, w 1, w 2, w 3 are the weights set for the minimum relative distance, the number of lane departures, and the number of traffic rule violations; MaxDist Indicates the preset maximum safe distance between the tested vehicle and the NPC vehicle. minDist Indicates the minimum relative distance between the tested vehicle and the NPC vehicle. laneDeviationCount Indicates the number of lane departures, trafficRuleViolationCount Indicates the number of traffic violations.

8. An autonomous driving simulation test scenario generation system, characterized in that: The system generates test scenarios based on a differential evolution algorithm, including: Mutation operation setting module, used to set the scaling factor F and mutation factor C of the differential evolution algorithm r and the maximum number of iterations G, the scaling factor F is used to control the step size of the mutation operation, and the mutation factor C r Used to control the probability of mutation operation; A test scenario initialization module is used to initialize the test scenario population, including setting the size N of the initial population and generating a random test scenario as the initial population; The test scenario mutation operation module is used to determine whether the current test iteration number g is greater than the maximum iteration number G. If it is greater, the iteration is terminated; if it is less, based on the scaling factor F and the mutation factor C r and the maximum number of iterations G, a multi-elite individual guidance strategy is used to perform test scenario mutation operations on the test scenario to generate a mutation scenario X n ; The cross-scenario generation module is used to transform the mutated scene X n Compared with the baseline scenario X g Cross-Generation Cross-Scene X u ; Next generation test scenario selection module for judging cross-scenario X u Is the fitness value of the scene smaller than the benchmark scene X? g If the fitness value is greater than , the crossover scenario X is selected. u Add the next generation test scenario; otherwise select the baseline scenario X g Added the next generation test scenario, the benchmark scenario X g For the current test scenario, the fitness value is the linear weighted sum of multiple traffic indicators; The test module is used to import the next generation test scenarios into the simulator. The autonomous driving software under test performs the driving tasks set in the test scenarios and records key data. The accident judgment module is used to analyze whether a traffic accident has occurred based on the recorded key data. If a traffic accident has occurred, the test scenario will be added to the dangerous scenario library; if no traffic accident has occurred, the test scenario will be placed in the historical scenario library; the test iteration number is increased by 1, and it is returned to determine whether the current test iteration number g is greater than the maximum iteration number G.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for generating an autonomous driving simulation test scenario as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the method for generating an autonomous driving simulation test scenario as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Test case generation method, system and equipment based on genetic algorithm and medium

    CN114185800A

  • Automatic driving safety critical scene generation method based on accident data driving

    CN116880235A

  • Automatic driving scene test case generation method and device

    CN117909249A

  • Automatic driving simulation test scene generation method and system and medium

    CN118672931A

Cited By

  • Vehicle test boundary scene generation method and system based on pre-boundary scene

    CN120951839A

  • A method and system for generating a vehicle test boundary scenario based on a pre-boundary scenario

    CN120951839B