A simulation test technology for autonomous driving system based on scenario description language
Through automatic driving test simulation technology based on scene description language, test cases are automatically generated to detect loopholes in the automatic driving system, solving the problems of existing test methods that are time-consuming and labor-intensive and difficult to cover extreme scenarios, and realizing an efficient automatic driving system. Testing and security improvements.
Patent Information
- Application Number
- CN202111496446.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-12-09
AI Technical Summary
Existing autonomous driving system testing methods rely on manual data collection and annotation, which is time-consuming and labor-intensive, and difficult to construct complex extreme scenarios. This results in the autonomous driving system having hard-to-find defects during the training phase and failing to meet safety requirements.
Adopt automatic driving test simulation technology based on scene description language, jointly construct simulation scenarios through standardized language and simulation simulator, generate a large number of simulation test images, use abstract syntax tree mutation algorithm to automatically generate scene description language mutation scripts with test significance, and detect automatic Vulnerabilities in neural network algorithms for driving systems.
It saves testing costs, improves the efficiency and accuracy of autonomous driving system testing, can discover defects in the system within a limited time, and improves the safety of the autonomous driving system.
Smart Images

Figure CN114238097B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software testing and program analysis, and is particularly suitable for simulation testing of autonomous driving systems in software testing. Its purpose is to render high-value autonomous driving system test sets through batch simulation of a scene description language. It is a method that helps software testers find internal defects of autonomous driving systems within a limited time. Background Art
[0002] As artificial intelligence continues to develop and autonomous driving technology matures, the safety of autonomous driving systems has attracted more and more attention at home and abroad. Accidents have shown the importance of quality assurance for autonomous driving systems as safety-critical software. However, there are relatively few quality assurance methods for autonomous driving systems. Usually, they are done through manual means, such as road testing, manual data collection, and manual labeling of data sets. This is not only time-consuming and labor-intensive, but also because it is difficult to build complex and extreme scenarios, the trained autonomous driving systems often have defects that are difficult to detect, and when the consequences occur, it is too late. This shows that maintaining a high-quality test case set is a challenging task during the training stage of the autonomous driving system.
[0003] The autonomous driving system is divided into the perception layer, the decision layer and the execution layer. The core part is the decision layer, which is to collect real-time environmental information data from various sensors, calculate through the neural network, and finally issue commands about the vehicle steering angle, throttle and brake to the execution layer. Therefore, the autonomous driving system needs to continuously optimize and train the algorithm of the decision layer to achieve the effect of making correct decisions in various situations. Among them, the testing technology for the autonomous driving system is often trained for the decision layer. The traditional autonomous driving system training set often collects real-time images of the vehicle driving correctly, records the corresponding steering angle and throttle / brake data, and manually annotates the surrounding vehicles and pedestrians to construct the training set data. However, this method not only consumes cost and time, but also restricts the speed of obtaining training data and the size of the training set. In addition, this method is difficult to reproduce the complex and extreme road conditions that are relatively rare on real roads, which is also the fundamental cause and risk factor for serious driving errors of autonomous driving vehicles. Therefore, as a safety-critical system, the importance of quality assurance of the autonomous driving system is self-evident. At this stage, the manual collection and manual annotation methods used by developers are no longer sufficient to meet the needs of safety assurance.
[0004] At present, the academic and industrial circles have also conducted some research and application on the simulation test of system driving system. Some simulation simulators and scene construction methods have been proposed to synthesize realistic images comparable to the displayed road scenes, so as to replace manual training of autonomous driving algorithms. However, these methods only replace manual road tests with simulation scenes, and do not analyze and construct scenes for extreme situations that are difficult to appear in real scenes. Therefore, they cannot truly test the autonomous driving system comprehensively, and their test coverage has not really improved. Although the test cost can be reduced to a certain extent, it does not solve the quality assurance problem that is critical to safety.
[0005] In this regard, the present invention proposes an automatic driving test simulation technology based on a scene description language. The basic idea of the present invention is to construct a simulation scene by combining a standardized language with a simulation simulator. That is, by following the grammar, a scene description language script is written based on variables, and the simulation test image can be generated by jointly simulating with the simulator by executing the script. At the same time, the written script is used as a seed file, and an abstract syntax tree is constructed according to the scene description language grammar. Different scene description language variation scripts are generated in batches by a variation method based on the abstract syntax tree AST, and a large number of simulation test variation image test sets are generated by executing the script in conjunction with the simulator. Based on the fact that the decision of the automatic driving algorithm should not have a huge error when the surrounding environment does not change greatly, such as when the color of the front vehicle, pedestrians, and surrounding buildings changes, the decision of the automatic driving system should not change significantly, etc., the test set image is input into the automatic driving system to be tested for testing. If a large error occurs in the output of the decision layer of the automatic driving system in the similar test set part, it is determined that such scene description language variation is effective, and it is added to the priority sequence to continue to mutate first to screen valuable variation samples. After several rounds of testing, we can obtain a priority queue of variant samples ranked by value. By analyzing the simulated test images and scene description language in the queue through an abstract syntax tree and word frequency statistics, we can find vulnerabilities in the autonomous driving system.
[0006] Through this method, test cases can be automatically generated, and the autonomous driving system can be fully tested, and the results can be given in the form of a priority queue, which saves testing costs and improves the efficiency and accuracy of autonomous driving system testing. Summary of the invention
[0007] The present invention provides an autonomous driving system simulation test technology based on a scenario description language. By writing a scenario description language script and mutating it, a large number of simulation images with testing significance are automatically generated, thereby detecting loopholes in the neural network algorithm of the autonomous driving system, expanding the test set of the autonomous driving system, reducing resource and time costs, filling the gap in the simulation test technology of the autonomous driving system, and ensuring the quality of the autonomous driving system, a safety-critical system.
[0008] To achieve the above objectives, the present invention proposes a probability-based scenario description language. The language specifies a series of scenario-based grammars: Grammar , Scalar {Scalars, Vectors, Headings, Vector Fields, Regions} , Object {car_model, pedestrian…} ,distributed {Normal, Uniform, Discrete} ,statement {import, param, require, mutate} and specifiers {at, offset, by, ahead / behind, beyond, visible…} , which is used to build specific scenarios for the system. At the same time, write library files and underlying interface APIs, embed the underlying files of the simulator, realize the joint scene simulation of the scene description language and the simulator, and realize the batch generation of simulated synthetic images. Then, the scene description language seed script file is deconstructed through the abstract syntax tree AST algorithm based on the scene description language, and a large number of scene description language variant script files with testing significance are generated by mutating the target variables. Joint simulation is performed with the simulator to generate a variant image test set, which is input into the autonomous driving system for testing. During the test process, if valuable test cases are found, they will be stored in the priority script queue, and the scripts in the queue will continue to be mutated and tested in the next round. After several rounds of iterations, the scene description language scripts that have the greatest impact on the autonomous driving algorithm can be stored in the priority queue in descending order of value. By performing structural analysis through the AST abstract syntax tree again and analyzing its commonalities, the vulnerabilities contained in the autonomous driving system can be discovered. Specifically, the method comprises the following steps:
[0009] 1) Scenario description language seed script file construction. Seed file Seed 0 It is necessary to have rich mutable content for subsequent rounds of mutation. The initial scene needs to include but not be limited to the following elements: maps, pedestrians, vehicles, buildings, weather, time, etc. Write a scene description language script file with rich mutable content and in line with the logic and specifications of the daily driving environment in accordance with the specified grammar and constraints. The purpose of this step is to provide the initial original file for the next several rounds of mutation based on the AST abstract syntax tree.
[0010] 2) Scenario description language script variation based on abstract syntax tree AST. Given a scenario description language script file, an abstract syntax tree AST is used to specify the syntax. GScene Description Language Script Seed 0 Scan and build a tree structure, and parse the script file. By scanning word by word, when encountering spaces, operators and special symbols, the statements in the script file are parsed into representations tokens Key-value pairs {value, type} And it is stored in a fixed format. After scanning the entire file, all tokens will be constructed into an abstract syntax tree according to their type, where mutable variables are placed in leaf nodes, and their type values are used as their parent nodes according to the hierarchy, in preparation for subsequent script mutation. After the abstract syntax tree AST is constructed, the leaf nodes of the tree are replaced with variables according to the fixed mutation rules, so as to generate mutation script files in batches. Seed t ‘ .
[0011] 3) Autonomous driving system test based on variant scenario description language script. Seed t ‘ The generated images are used as the test set input of the autonomous driving system by performing joint simulation rendering with the simulator, and the steering angle, throttle / brake of the autonomous driving system decision layer are Seed 0 If the output is compared with the defined threshold threshold If a larger mutation occurs than the previous one, mark this script file Seed t ‘ For valuable variant samples, enter them into the priority queue Q In the next round of mutation testing, the priority queue will be continuously cycled, and mutation, input and comparison will be performed in turn. Finally, the script file will be Seed t ‘ In the priority queue according to its test value Q Sorted and presented in .
[0012] 4) Analysis of autonomous driving system defects based on the scenario description language script AST in the queue. Q In Seed t ‘ By outputting them one by one, we can get the synthetic image of the scene that has the greatest impact on the autonomous driving system. At the same time, we analyze the nodes in the abstract syntax tree AST and obtain the scene description language script through the hierarchical traversal process of the tree. type Type. typeThrough integrated analysis and sorting of types, we can discover the scenario factors that have the greatest impact on the autonomous driving system, thereby discovering the problems existing in the autonomous driving system and completing the test of the autonomous driving system. The data can be used as samples for the next round of testing.
[0013] Further, the specific steps of the above step 1) are as follows:
[0014] Step 1)-1: Starting state;
[0015] Step 1)-2: Retrieve the underlying library files required by the scene description language;
[0016] Step 1)-3: Add the scene's weather, environment, and time configuration;
[0017] Step 1)-4: Add various objects to the scene;
[0018] Step 1)-5: Add soft and hard constraints to scene objects;
[0019] Step 1)-6: Ensure that the scene description language script has no syntax errors by compiling and executing;
[0020] Step 1)-7: Get the scene description language seed script file Seed 0 ;
[0021] Step 1)-8: End state.
[0022] Further, the specific steps of the above step 2) are as follows:
[0023] Step 2)-1: Download the seed file Seed 0 , scene description language grammar G , as the algorithm input of the abstract syntax tree AST;
[0024] Step 2)-2: Follow the syntax G ,right Seed 0 Perform a scan;
[0025] Step 2)-3: Split the scan results into tokens key-value pairs according to spaces, brackets, delimiters, etc. {value, type} ;
[0026] Step 2)-4: Build an abstract syntax tree through the tokens structure AST 0 ;
[0027] Step 2)-5: By AST 0 Traverse the tree to find the amount of mutation to be made on the leaf node;
[0028] Step 2)-6: Values of leaf nodes under grammatical rules and soft and hard constraints value t Make a mutation;
[0029] Step 2)-7: Get a batch of script mutation files Seed t ‘ ;
[0030] Step 2)-8: End state.
[0031] Further, the specific steps of the above step 3) are as follows:
[0032] Step 3)-1: Execute the script file Seed 0 Co-simulation with the simulator to generate corresponding simulation images img 0 ;
[0033] Step 3)-2: Execute the script file Seed t ‘ Co-simulation with the simulator to generate corresponding simulation images img t ’ ;
[0034] Step 3)-3: img 0 Input to the autonomous driving system, output out 0 ;
[0035] Step 3)-4: img t ’ Input to the autonomous driving system, output out t ’ ;
[0036] Step 3)-5: img 0 and img t ’ For comparison, if out 0 and out t ’ Difference greater than threshold threshold , then the script file corresponding to this simulation image is entered into the priority queue Q middle;
[0037] Step 3)-6: Repeat this process, and you will eventually get a priority queue sorted by mutation value.Q ;
[0038] Step 3)-7: End state.
[0039] Further, the specific steps of the above step 4) are as follows:
[0040] Step 4)-1: Script file corresponding to the priority queue head node Seed ts ’ Out of the team;
[0041] Step 4)-2: Traverse the file hierarchically Seed ts ’ Corresponding abstract syntax tree AST s ’ , save the nodes in the path type And record the number of occurrences;
[0042] Step 4)-3: Repeat this process to count the most frequently occurring types, which are the scene variables that have the greatest impact on the autonomous driving system;
[0043] Step 4)-4: End state. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 The present invention is a flowchart of a scenario description language-based automatic driving system simulation test technology in the implementation of the present invention.
[0045] Figure 2 for Figure 1 Flowchart of scene description language seed script file construction.
[0046] Figure 3 for Figure 1 Flowchart of the scenario description language script mutation based on the abstract syntax tree AST.
[0047] Figure 4 for Figure 1 Flowchart of autonomous driving system testing based on variant scenario description language script.
[0048] Figure 5 for Figure 1 Flowchart of defect analysis of autonomous driving system based on scene description language script AST in the queue. DETAILED DESCRIPTION
[0049] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0050] Figure 1The present invention is a flowchart of a scenario description language-based autonomous driving system simulation test technology implemented by the present invention.
[0051] A scenario description language-based automatic driving system simulation test technology, characterized by comprising the following steps.
[0052] Step 1: Build the scenario description language seed script file. Testers write scenario description language script files that contain maps, pedestrians, vehicles, buildings, weather, time, etc. according to the specified syntax and constraints. The script files are rich in mutable content and conform to the logic and specifications of the daily driving environment, providing a basis for subsequent script file mutation testing.
[0053] Step 2 is based on the scene description language script variation of the abstract syntax tree AST. The scene description language grammar and the scene description language seed script file are used as the input of the AST abstract syntax tree algorithm. After scanning and segmentation steps, the AST abstract syntax tree corresponding to the script is generated.
[0054] Step 3 is the test of the autonomous driving system based on the variant scenario description language script. The variant scenario description language script is co-simulated with the simulator to generate variant scene images in batches. The original scene image and the variant scene image are used as the input of the autonomous driving system. The input of the decision layer of the autonomous driving system is collected and compared. If the difference is greater than the threshold, the variant scenario language script corresponding to the variant scene image is input into the priority queue.
[0055] Step 4: Analyze the defects of the autonomous driving system based on the AST script in the queue, and obtain the priority sequence sorted by value by the variant scenario description language through Step 3. Q ,Will Q The variant scenario description language script in the script is output by queue, and the variant scenario description language script AST is constructed at the same time. By stratifying the AST abstract syntax tree and counting the type information of the nodes, the variable type that has the greatest impact on the autonomous driving system is obtained.
[0056] Figure 2 A flowchart of constructing a scenario description language seed script file implemented in the present invention. A scenario description language script file with rich mutable content and conforming to the logic and specifications of the daily driving environment is written according to the specified grammar and constraints, so as to facilitate the subsequent mutation process of the script file. The specific steps are as follows:
[0057] Step 1: Starting state; Step 2: Retrieve the underlying library files required for the scene description language; Step 3: Add the scene's weather, environment, and time configurations; Step 4: Add various objects to the scene; Step 5: Add soft and hard constraints to the scene objects; Step 6: Ensure that the scene description language script has no syntax errors by compiling and executing; Step 7: Get the scene description language seed script file Seed 0 ; Step 8: End state.
[0058] Figure 3 This is a flowchart of a scenario description language script variant construction based on an abstract syntax tree AST implemented by the present invention. The specific steps are as follows:
[0059] The generated seed file and the scenario description language algorithm are used as the input of the abstract syntax tree AST algorithm. The seed file is scanned, segmented, and finally the AST syntax tree is constructed to prepare for the subsequent mutation algorithm based on the AST tree. The specific steps are as follows: Step 1: Seed 0 , scene description language grammar G , as the algorithm input of the abstract syntax tree AST; Step 2: According to the grammar G ,right Seed 0 Scan; Step 3: Split the script into tokens key-value pairs according to spaces, brackets, delimiters, etc. {value, type} ; Step 4: Build an abstract syntax tree through the tokens structure AST 0 ; Step 5: By AST 0 Traverse the tree first and find the variable to be mutated for the leaf node; Step 6: Change the value of the leaf node under the grammatical rules and soft and hard constraints value t Perform mutation; Step 7: Get a batch of script mutation files Seed t ‘ ; Step 8: End state.
[0060] Figure 4 This is a flow chart of the automatic driving system test based on the mutated scenario description language script of the present invention. The specific steps are as follows:
[0061] Step 1: Execute the script file Seed 0 Co-simulation with the simulator to generate corresponding simulation images img 0 ; Step 2: Execute the script file Seed t ‘ Co-simulation with the simulator to generate corresponding simulation imagesimg t ’ ; Step 3: img 0 Input to the autonomous driving system, output out 0 ; Step 4: img t ’ Input to the autonomous driving system, output out t ’ ; Step 5: img 0 and img t ’ For comparison, if out 0 and out t ’ Difference greater than threshold threshold , then the script file corresponding to this simulation image is entered into the priority queue Q Step 6: Repeat this process, and finally get a priority queue sorted by mutation value Q ; Step 7: End state.
[0062] Figure 5 This is a flowchart of the defect analysis of the autonomous driving system based on the scene description language script AST in the queue. The specific steps are as follows:
[0063] Step 1: Script file corresponding to the priority queue head node Seed ts ’ Dequeue; Step 2: Traverse the file hierarchically Seed ts ’ Corresponding abstract syntax tree AST s ’ , save the nodes in the path type And record the number of occurrences; Step 3: Repeat this process to count the type with the highest frequency of occurrence, that is, the scene variable that has the greatest impact on the autonomous driving system; Step 4: End state.
[0064] In summary, the present invention is used to fill the gap in simulation testing for autonomous driving systems, solve the problem that the current autonomous driving test set collection is time-consuming and labor-intensive and difficult to cover extreme scenarios, and help testers build an effective autonomous driving test case set within a limited time, test and analyze the autonomous driving system, thereby detecting defects in the autonomous driving system and improving the safety of the autonomous driving system.
Claims
1. A simulation test method for an autonomous driving system based on a scenario description language, characterized in that: Based on the scenario description language script mutation and the autonomous driving simulation simulator, a joint simulation test is conducted to construct a simulation environment image for autonomous driving algorithm testing; first, a seed script file that conforms to the scenario description language syntax and constraints and has strong variability is constructed. On this basis, the scenario description language seed script file is mutated by applying the scenario description language script mutation algorithm based on the abstract syntax tree AST, and the simulation image is input into the autonomous driving system for testing through a priority queue based on the fact that the output of the autonomous driving algorithm in similar scenarios should not change significantly. Based on the output difference between the mutated script and the seed script file, valuable mutated scripts are screened, and finally a series of scenario description language scripts and specific scene images that affect the autonomous driving system are obtained, and the defects of the autonomous driving system are analyzed by analyzing the commonality of their AST syntax structures; the purpose is to solve the problem that the collection of autonomous driving test sets is time-consuming and labor-intensive and difficult to cover extreme scenarios, and through low-cost, high-value test cases, it helps testers build an effective autonomous driving test case set within a limited time, test and analyze the autonomous driving system, thereby detecting the defects of the autonomous driving system and improving the safety of the autonomous driving system; the method comprises the following steps: 1) Construction of the scenario description language seed script file. The seed file Seed0 needs to have rich mutable content for subsequent rounds of mutation. The initial scene needs to include but not be limited to the following elements: maps, pedestrians, vehicles, buildings, weather, and time. Write a scenario description language script file with rich mutable content and in line with the logic and specifications of the daily driving environment in accordance with the specified grammar and constraints. The purpose of this step is to provide the initial original file for the next several rounds of mutation based on the AST abstract syntax tree. 2) Scenario description language script mutation based on abstract syntax tree AST: Given a scenario description language script file, the scenario description language script Seed0 is scanned and constructed in a tree structure based on the specified syntax G, and the script file is parsed. By scanning word by word, when encountering spaces, operators and special symbols, the statements in the script file are parsed into tokens key-value pairs {value, type} and stored in a fixed format; after scanning the entire file, all tokens are constructed into an abstract syntax tree according to their type, where mutable variables are placed in leaf nodes, and their type values are taken as their parent nodes according to the hierarchy, in preparation for subsequent script mutation; after the abstract syntax tree AST is constructed, the leaf nodes of the tree are replaced with variables according to the fixed mutation rules, so as to generate mutation script files Seedt' in batches; 3) For the test of the autonomous driving system based on the mutated scenario description language script, the script file Seedt' obtained in step 2) is co-simulated and rendered with the simulator, and the generated image is used as the test set input of the autonomous driving system. The steering angle and throttle / brake of the decision layer of the autonomous driving system are compared with Seed0. If its output has a large mutation compared with the threshold threshold, the script file Seedt' is marked as a valuable mutation sample and input into the priority queue Q. The next round of mutation test will continuously cycle from the priority queue, perform mutation, input and comparison in turn; finally, the script file Seedt' will be sorted and presented in the priority queue according to its test value; 4) Based on the defect analysis of the autonomous driving system of the scene description language script AST in the queue, the Seedt' in the priority queue Q obtained in step 3) is output in sequence to obtain a synthetic image of the scene that has the greatest impact on the autonomous driving system. At the same time, the nodes in its abstract syntax tree AST are analyzed. By traversing the tree level, the type of the scene description language script can be obtained. Through the integrated analysis and sorting of the type type, the scene factor composition that has the greatest impact on the autonomous driving system can be found, thereby discovering the problems existing in the autonomous driving system. The test of the autonomous driving system is completed, and its data can be used as a sample for the next round of testing.
2. The scenario description language based automatic driving system simulation test method according to claim 1, characterized in that: In step 1), a scenario description language seed script file is constructed; first, a scenario description language script file with rich variable content and conforming to the logic and specifications of the daily driving environment is written in accordance with the specified grammar and constraints, including but not limited to the following elements: map, pedestrians, vehicles, buildings, weather, time; Prepare for the subsequent mutation algorithm based on the abstract syntax tree AST.
3. The scenario description language based automatic driving system simulation test method according to claim 1, characterized in that: In step 2), the scene description language script is mutated based on the abstract syntax tree AST; given the scene description language seed script file written in step 1); the script file and the scene description language grammar are used as algorithm input, the script is scanned and split, and an abstract syntax tree AST is constructed with key-value pairs as nodes; by traversing the tree, the variables of the leaf nodes are replaced according to fixed mutation rules, thereby generating mutated script files in batches.
4. The scenario description language based automatic driving system simulation test method according to claim 1, characterized in that: In step 3), the autonomous driving system is tested based on the mutated scenario description language script; the script file obtained in step 2) is co-simulated and rendered with the simulator, and the generated image is used as the test set input of the autonomous driving system. The steering angle and throttle / brake of the autonomous driving system decision layer are compared with the results obtained with the non-mutated image. If its output undergoes a large mutation, the mutated script file is marked as a valuable mutation sample and input into the priority queue. The next round of mutation testing will continuously cycle from the priority queue, mutate, input and compare in turn; finally, a priority queue containing valuable mutation samples is obtained.
5. The scenario description language based automatic driving system simulation test method according to claim 1, characterized in that: In step 4), the defects of the autonomous driving system are analyzed based on the scene description language script AST in the queue; the variant script files in the priority queue are output in sequence to obtain a synthetic image of the scene that has the greatest impact on the autonomous driving system, and at the same time, the nodes in its abstract syntax tree AST are analyzed. By traversing the tree level, the type of the scene description language script can be obtained; by integrating and analyzing and sorting them, the scene factor composition that has the greatest impact on the autonomous driving system can be found, thereby discovering the problems existing in the autonomous driving system, and completing the test of the autonomous driving system. Its data can be used as a sample for the next round of testing.
