Method and facility for generating test case for automated driving scenario

The integration of information entropy and genetic algorithms optimizes test case generation for autonomous driving, addressing resource inefficiencies by prioritizing critical scenarios and improving test coverage and reliability.

JP2025146618AActive Publication Date: 2025-10-03CHINA AUTOMOTIVE TECH & RES CENT CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2024185282
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-20
Filing Date
2024-10-21
Publication Date
2025-10-03
Estimated Expiration
2044-10-21

AI Technical Summary

Technical Problem

Traditional combinatorial testing methods for autonomous driving systems do not adequately consider the importance and occurrence probability of test cases, leading to insufficient attention on critical scenarios and resource wastage.

Method used

A method incorporating information entropy and genetic algorithms to generate test cases, weighing parameter importance and occurrence frequency, and iteratively improving test scenarios through fitness functions and genetic operations.

Benefits of technology

Enhances test coverage and efficiency, revealing potential system failures in complex environments, optimizing test case quality and reliability for autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025146618000001_ABST
    Figure 2025146618000001_ABST
Patent Text Reader

Abstract

To provide a method and facility for generating a test case of an automated driving scenario that improve the quality of a test case while securing the test coverage rate and verify and optimize the performance and safety of a system more effectively.SOLUTION: The method according to the present invention includes: initializing a plurality of test cases by a genetic algorithm; calculating information entropy of each parameter value in each test case, based on an occurrence frequency of parameter values in a scenario database; performing weighted summation on information entropies of all parameter values in each test case in accordance with an importance degree of a parameter type to obtain a comprehensive information entropy of each test case; constructing a fitness function based on the comprehensive information entropy in each test case, a vehicular crash risk during application, a parameter coverage rate and test efficiency; and iteratively generating a new test case based on the fitness function until a termination condition is satisfied.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to the field of data processing, and in particular to a method and equipment for generating test cases for autonomous driving scenarios. [Background technology]

[0002] With the rapid development of autonomous driving technology, one of the key challenges is ensuring the safe and reliable operation of autonomous driving systems in diverse road and traffic environments. Evaluating and verifying the performance of autonomous driving systems requires extensive testing that covers a wide range of driving scenarios and conditions, including everyday traffic conditions, bad weather, and emergency situations.

[0003] Traditional combinatorial testing methods, such as All-pairs testing (AETG) and Combinatorial Testing Based on Complexity (CTBC), can generate a large number of test cases, but they do not fully consider the importance and occurrence probability of the test cases. As a result, important test scenarios receive insufficient attention, while less important scenarios are overtested, leading to a waste of resources.

[0004] Research has shown that corner cases have a relatively low probability of occurring, but are essential for the validation and safety of autonomous driving systems. Such corner cases include rare traffic situations, abnormal road conditions, and unexpected events. Therefore, to allocate test resources more efficiently, it is necessary to consider the importance and probability of occurrence of test cases. Summary of the Invention

[0005] In view of this, the present invention has been proposed.

[0006] To solve the above technical problems, the present invention provides a method and equipment for generating test cases for autonomous driving scenarios, incorporating an improved combination of information entropy and genetic algorithms to test the autonomous driving test scenario generation algorithm, improving the quality of the test cases while ensuring test coverage, and enabling the performance and safety of autonomous driving systems to be verified and optimized in a more effective manner.

[0007] An embodiment of the present invention provides a method for generating test cases for an autonomous driving scenario, the method comprising: S1, initialize multiple test cases by genetic algorithm, each test case contains different types of parameter values; S2. Calculating the information entropy of each parameter value in each test case based on the occurrence frequency of the parameter value in the scenario database; S3. The information entropy of all parameter values ​​in each test case is weighted according to the importance of the parameter type to obtain a comprehensive information entropy of each test case; S4, constructing a fitness function based on the comprehensive information entropy of each test case, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency; S5, iteratively generating new test cases based on the fitness function until a termination condition is met.

[0008] An embodiment of the present invention provides an electronic device, the electronic device comprising: It has a processor and memory, The processor is used to execute the steps of the method for generating test cases for autonomous driving scenarios described in any of the embodiments by calling programs or instructions stored in the memory.

[0009] The embodiments of the present invention have the following technical effects.

[0010] By incorporating information entropy, test scenario generation does not rely solely on parameter combinations, but also considers the diversity and probability of parameter value distributions. This approach increases the breadth and depth of test scenarios, more effectively revealing potential system failure points in complex and uncertain environments. Furthermore, through genetic operations such as selection, crossover, and mutation, the algorithm can efficiently develop higher-performing test cases from the initially generated test scenarios. This not only improves the quality of test cases, but also increases the efficiency and reliability of testing. It provides more accurate and comprehensive test coverage, especially in complex and diverse fields like autonomous driving testing.

[0011] This invention innovatively combines genetic algorithms with traditional scenario generation methods to optimize test scenario generation. Through operations such as selection, crossover, and mutation in genetic algorithms, the process of developing optimized test cases is streamlined, improving overall system performance. This not only improves the quality of test cases, but also improves the efficiency and reliability of testing.

[0012] By comprehensively calculating the fitness function by combining information entropy, collision risk, test efficiency, and coverage rate, the efficiency of test scenario generation is greatly improved, ensuring test coverage while reducing redundant scenarios. This means that more representative and challenging test scenarios can be generated in a shorter time, allowing for more efficient verification and optimization of the performance and safety of autonomous driving systems, playing an important role in accelerating the R&D and testing cycle of autonomous driving systems. [Brief explanation of the drawings]

[0013] In order to more clearly describe the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings used in the description of the specific embodiments or the prior art. The drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative efforts. [Figure 1] 1 is a flowchart of a method for generating test cases for autonomous driving scenarios provided by an embodiment of the present invention. [Figure 2] 1 is a schematic diagram illustrating the structure of an electronic device provided by an embodiment of the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0014] In order to make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions of the present invention. The described embodiments are only a part of the embodiments of the present invention, but not all of them. Based on the embodiments in the present invention, all other embodiments that can be obtained by those skilled in the art without any creative efforts shall fall within the protection scope of the present invention.

[0015] Example 1 The method for generating test cases for autonomous driving scenarios according to an embodiment of the present invention is mainly applied to automatically generating test cases for testing the performance of autonomous vehicles, and is executed by an electronic device.

[0016] 1 is a flowchart of a method for generating test cases for autonomous driving scenarios according to an embodiment of the present invention. Referring to FIG. 1, the method for generating test cases for autonomous driving scenarios specifically includes the following five steps:

[0017] S1, initialize multiple test cases by genetic algorithm, and each test case contains different types of parameter values.

[0018] To obtain multiple test cases, we first need to determine the space of test scenarios and explicitly enumerate all possible scenarios so that the tests sufficiently cover the various combinations of parameters.

[0019] Step 1: First, select the key parameters that affect the performance of autonomous driving.

[0020] To comprehensively cover potential risk points in autonomous driving, parameters such as road type (urban roads, highways), driving scenarios (intersections, overtaking), traffic conditions (high-density, low-density), environmental conditions (sunny, rainy, snowy), and vehicle behavior (normal driving, sudden braking) are selected. First, the driving area must be divided into urban areas, highways, and rural areas. Urban areas include busy city roads where traffic congestion is common, so test scenarios can cover a variety of urban road environments, such as downtown areas, around schools, and residential areas. These areas typically have complex traffic flows, multiple lanes, traffic lights, zebra crossings, and various road signs and markings. The highway area simulates highway driving, including straight ahead driving, overtaking, and on-ramps and off-ramps. Test scenarios may include different speed limits, number of lanes, highway traffic signs and markings, etc. In rural areas, they simulate country roads and rural environments that are relatively narrow, have low traffic volumes, and may be used by agricultural vehicles, pedestrians, and animals. Test scenarios may include typical rural scenarios such as curvy roads, unexpected traffic conditions, and passing through rural markets, as shown in Table 1.

[0021] Table 1 Road types JPEG2025146618000002.jpg4773

[0022] The driving scenarios are then divided into five categories: intersections, curves, overtaking, parking, and emergency situations. Intersection scenarios concern traffic and signal control at intersections. Test scenarios include various types of intersections, such as crossroads, T-junctions, and roundabouts. These scenarios concern vehicle behavior in driving straight, turning left or right, and obeying traffic signals. Curve scenarios concern vehicle maneuvers involving left or right turns or U-turns. Test scenarios include various types of curved roads, such as right-angle curves, diagonal curves, and arc-shaped curves. These scenarios concern vehicle behavior in choosing appropriate curve routes, coordinating with other vehicles, and complying with traffic rules. Overtaking scenarios simulate vehicles overtaking and being overtaken. Test scenarios include overtaking on highways and lane changes and overtaking on urban roads. These scenarios concern vehicle behavior in accelerating, decelerating, judging safe distances, and changing lanes. Parking scenarios simulate parallel and perpendicular parking maneuvers, and the test scenarios cover various types of parking scenes, such as on-street parking, parking space parking, and parking lot parking. These scenarios involve the vehicle's precise parking position, parking posture, and compliance with parking rules. Emergency scenarios deal with situations that require the vehicle to brake suddenly, avoid obstacles, or deal with unexpected situations. Test scenarios include the sudden appearance of an obstacle, a pedestrian suddenly crossing the road, and dealing with unexpected traffic situations. These scenarios involve the vehicle's reaction speed, judgment ability, and evasive measures.

[0023] Table 2 Driving scenarios JPEG2025146618000003.jpg97118After determining the road type and driving scenario, the relevant road environment parameters are determined.

[0024] Table 3 Road environment parameters JPEG2025146618000004.jpg38117

[0025] Table 4 Road environment parameters JPEG2025146618000005.jpg38117

[0026] Table 5 Weather and light parameters JPEG2025146618000006.jpg54117

[0027] Table 6 Vehicle state parameters JPEG2025146618000007.jpg3280

[0028] Table 7. Sensor parameters JPEG2025146618000008.jpg32117

[0029] Table 8. Road facility parameters JPEG2025146618000009.jpg3281

[0030] Table 9 Vehicle behavior parameters JPEG2025146618000010.jpg31117

[0031] Table 10. Road topography parameters JPEG2025146618000011.jpg31117

[0032] Step 2: Create a multi-dimensional parameter space, with each dimension representing one test parameter. To define the test scenario space, the ranges or discrete values ​​of each parameter are combined to form possible test scenarios. This process can be expressed using mathematical symbols and formulas. Assuming there are n parameters, each with m possible values, the size of the test scenario space is m. n is.

[0033] As an example, we select three parameters: road type, vehicle speed, and weather condition. Possible values ​​are: road type: urban road (U), highway (H), country road (R); vehicle speed: slow (S), medium (M), fast (F); weather condition: sunny (S), rainy (R), snowy (W). By combining these parameters and their possible values, we obtain a test scenario space TS.

[0034] By defining a test scenario space, all possible test scenarios are explicitly enumerated to ensure that tests sufficiently cover the various combinations of parameters.

[0035] The initial population is obtained by randomly selecting parameter values ​​from a multidimensional parameter space, i.e., initializing multiple test cases. Each test case corresponds to an individual in the genetic algorithm, and these test cases can be represented as an encoded string of parameter values. For example, the test scenario space is shown below.

[0036] Table 11 Test space JPEG2025146618000012.jpg32117 Initialize a population containing five test cases. Randomly select parameter values ​​to create the initial test cases.

[0037] Table 12 Initial test cases JPEG2025146618000013.jpg82117S2,Based on the occurrence frequency of parameter values ​​in the scenario database, we calculate the information entropy of each parameter value in each test case.

[0038] To evaluate the contribution of each parameter to test case diversity, we calculate the parameter's information entropy. Calculating the parameter's information entropy allows us to understand the diversity and distribution of each parameter's value. The higher the information entropy, the greater the parameter value diversity and the higher the test case coverage rate. If the information entropy of a parameter is low—that is, if the parameter value distribution is relatively concentrated—this indicates that the parameter's coverage rate in test cases is low and requires more attention. Therefore, for parameter values ​​with high information entropy, more diverse test cases can be generated to cover various combinations of parameter values. Conversely, for parameter values ​​with low information entropy, the number of generated test cases can be appropriately reduced to avoid repetition and redundancy.

[0039] For a parameter, there are m possible values, p1, p2, ..., p m The probability of occurrence of the value can be approximated by the frequency (or number of times) in past data. Therefore, in this embodiment, the information entropy H(X i,j ) is calculated.

[0040] JPEG2025146618000014.jpg18112 where N(X i ) is the number of occurrences of the parameter type to which parameter X belongs in the scenario database, and N(X i,j ) is the number of occurrences of the parameter value of parameter X in the scenario database, i is assumed to be 10 as the type number, j is the parameter value number, and the total δ i There are values ​​P(X i,j ) are the probabilities of the possible values ​​of the parameters of X.

[0041] Here, the scenario database includes a plurality of test cases that have been generated in the past and used in actual tests.

[0042] Furthermore, the information entropy of each parameter value is normalized.

[0043] JPEG2025146618000015.jpg1098Here, H n (X i,j ) represents the normalized information entropy of the parameter, and H min (X i,α ) indicates the minimum information entropy for the parameter type of parameter X, and H max (X i,β ) denotes the maximum information entropy for the parameter type of parameter X.

[0044] Preferably, in addition to calculating the probability based on the occurrence frequency of the parameter value, the probability of the possible values ​​of the parameter can be estimated by combining a Bayesian model. Specifically, the information entropy of each parameter value in each test case is calculated based on the occurrence frequency of the parameter value in the scenario database and a Bayesian network model.

[0045] A Bayesian network is a probabilistic graphical model used to represent dependencies between variables and take into account correlations between them. For example, a Bayesian network can be used to represent dependencies between road type, weather conditions, and traffic conditions. A Bayesian network can then be used to estimate the probability of each possible value for each parameter and take into account correlations between these parameters. For example, to estimate the probability that road type is R, weather conditions are W, and traffic conditions are T, the following formula can be used:

[0046] JPEG2025146618000016.jpg689Here, P(R) is the prior probability of R, P(W / R) is the posterior probability of W given R, and P(T / R,W) is the posterior probability of T given R and W. These prior and posterior probabilities can also be determined based on the frequency of occurrence of the corresponding parameters in the scenario database. In this way, the probability of the value of a parameter (R) under certain conditions (e.g., W or T) can be obtained, and consequently, the probability of its possible values ​​under specified conditions can be obtained. This allows the generated test cases to be more targeted and avoid redundancy. The probability calculated based on the parameter frequency and the probability obtained from the model are weighted together to obtain the final probability value, and information entropy is calculated.

[0047] Additionally, domain expert judgment may be employed to optimize the probabilities of possible values.

[0048] JPEG2025146618000017.jpg1073where μ, θ, and λ represent weight assignment based on frequency and distribution, weight assignment based on domain expert judgment, and weight assignment based on the model, respectively; Ψ is the probability of the possible values ​​of the parameters determined by the domain expert; and Φ is This is the probability of the possible values ​​of parameters determined based on a Bayesian model. Probability of occurrence frequency is estimated by collecting and analyzing existing data. Domain expert judgment is a subjective judgment made by a domain expert based on their experience and specialized knowledge about the probability of the possible values ​​of different parameters. Model inference requires estimating the probability of the possible values ​​of parameters using a Bayesian network model. Combining these three methods can provide more accurate probabilities of the possible values ​​of parameters. As an example, the probabilities of the possible values ​​of some parameters are shown below.

[0049] Table 13. Probability of possible parameter values JPEG2025146618000018.jpg127118

[0050] S3, the information entropy of all parameter values ​​in each test case is weighted and added according to the importance of the parameter type to obtain the comprehensive information entropy of each test case.

[0051] JPEG2025146618000019.jpg8103Here, case k c represents each individual in the population, i.e., each test case. k c ) represents the comprehensive information entropy corresponding to the individual, and W i represents the weight corresponding to this kind of parameter, the higher the importance, the higher the weight, which can be determined according to the actual test. n (X i,j ) represents the information entropy of the parameter, σ represents the number of individuals in the population, i is the parameter type number, n is the total number of parameter types, j is the parameter value number, and the total δ i There is a value of

[0052] S4, construct a fitness function based on the comprehensive information entropy of each test case, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency.

[0053] The fitness function is used to evaluate the performance of each test case (individual) and is the basis used for selection in the genetic algorithm, and can be defined according to different test objectives and requirements.

[0054] The fitness function in this embodiment is a weighted sum combining the comprehensive information entropy of each test case, the vehicle crash risk when applied, the parameter coverage rate, and the test efficiency.

[0055] JPEG2025146618000020.jpg6110Here, F(case k c ) is the fitness of the test case, and S(case kc ), E(case k c ), CO(case k c ) and H(case k c ) respectively represent the vehicle collision risk, test efficiency, parameter coverage rate and comprehensive information entropy when applying the test case, and w1, w2, w3 and w4 are the corresponding weights.

[0056] The comprehensive information entropy is obtained according to S4, and the following details the calculation of collision risk, parameter coverage rate, test efficiency and weights when applied.

[0057] Collision risk in application: Evaluation is based on the vehicle's collision risk in various scenarios, with a lower score indicating higher safety. Physical simulation or statistical models are used to predict the vehicle's collision risk in each test case, and this collision risk is normalized. Factors such as the distance, speed, and acceleration between the vehicle and surrounding obstacles are taken into account, and the collision risk value is finally normalized to an appropriate range. Here, physical simulation is a method of simulating physical phenomena in the real world using a computer. It can be used to simulate the movement of an autonomous vehicle in various scenarios and calculate the collision risk with surrounding obstacles. Physical simulation can estimate collision risk very accurately, but it requires a lot of calculations. Statistical models are models that use statistical data to predict the probability of future events and are used to estimate the collision risk of autonomous vehicles in various scenarios.

[0058] JPEG2025146618000021.jpg3597The distance between the vehicle and the surrounding obstacles is d, its velocity is v, and its acceleration is a. f1, f2, and f3 are all contribution functions obtained from experimental fitting. The f function is used to adjust the contribution of different factors to the collision risk and represents the collision risk of the vehicle in the test case, R min and R max represent the minimum and maximum collision risk values, respectively.

[0059] Parameter coverage rate: The parameter coverage rate CO is determined based on the number of different road types and weather conditions covered by the test cases, with a higher score indicating more comprehensive coverage. The number of different road types and weather conditions covered by the test scenarios is calculated, and the road type coverage rate and weather condition coverage rate are finally normalized to an appropriate range.

[0060] JPEG2025146618000022.jpg1151 where C i represents the coverage of the scenario parameters, where n represents the number of different road types and weather conditions covered, and n max represents the maximum number of covered numbers. h(C i ) represents coverage corresponding to road type or weather conditions.

[0061] Test Efficiency: The time required for each test case is calculated based on road conditions and the time it takes for the vehicle to navigate an obstacle. The shorter the time, the higher the test efficiency. Road conditions, such as highway or rain, are directly obtained from the test cases. The time required for the vehicle to navigate an obstacle can be calculated based on a combination of the vehicle's average reaction speed, obstacle avoidance measures, obstacle size, travel distance, and speed. Specific values ​​are obtained through experiments. The time required to perform a task is calculated by adding the obtained average vehicle reaction speed, obstacle avoidance measures, obstacle avoidance time depending on the obstacle size, and travel time obtained based on travel distance and speed.

[0062] Finally, task completion times are normalized to an appropriate range.

[0063] JPEG2025146618000023.jpg1151 where T represents the time it takes for the vehicle to perform the task, and T min and T maxrepresent the minimum and maximum task completion times, respectively. Assume that in a test scenario, the minimum task completion time is 10 seconds and the maximum is 100 seconds. In this scenario, the vehicle takes 30 seconds to complete the task, and the normalized value is 0.78.

[0064] JPEG2025146618000024.jpg1077The method for determining the weights of the fitness function is as follows.

[0065] S41, based on the analysis of past test cases, a regression algorithm is used to determine the weights of comprehensive information entropy, vehicle collision risk when applied, parameter coverage rate and test efficiency.

[0066] Specifically, test cases with high safety and efficiency ratings in actual or simulated tests are selected from the scenario database and scored, allowing testers to set scores based on their own experience and actual tests. The score is calculated as a weighted sum of comprehensive information entropy, vehicle collision risk during application, parameter coverage rate, and test efficiency, and is fitted using a regression algorithm to obtain the weight of each item, i.e., the importance of each item in the final expression of the test case.

[0067] Furthermore, the weight of each item can be determined taking into account the experience of the experts.

[0068] S42, based on the weights, weighted sum the comprehensive information entropy, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency to obtain a fitness function.

[0069] The objective of the tests is to maximize safety and efficiency and ensure coverage of a wide range of road and weather conditions by defining one multi-objective fitness function.

[0070] Finally, the calculated weights are applied to actual or simulated autonomous driving test data to verify their validity and reliability. By comparing test results with different weight settings, weight assignment can be optimized.

[0071] As an example, the indicator weights of the fitness function can be defined according to specific needs, and are shown here as follows:

[0072] Table 14. Weight assignment results JPEG2025146618000025.jpg4777Finally, the fitness value (F) of the scenario is calculated using the fitness function formula.

[0073] JPEG2025146618000026.jpg13151For each test case initialized in Table 12, the fitness value is calculated using the defined fitness function, and the calculated fitness values ​​are as follows:

[0074] Table 15 Fitness values JPEG2025146618000027.jpg4078

[0075] These fitness values ​​reflect the performance of each test case, with higher values ​​indicating better performance. Through an iterative process of the genetic algorithm, better test scenarios are selected based on the fitness values.

[0076] S5, iteratively generate new test cases based on the fitness function until a termination condition is met.

[0077] S51, a test case is selected from the current plurality of test cases using a fitness-weighted random selection roulette wheel method.

[0078] The cumulative probability is calculated based on the fitness function, and if the randomly generated probability is greater than the cumulative probability, it is selected to obtain a case set that will become new parent candidates. The cumulative probability makes it easier to select individuals with high fitness.

[0079] S52: Crossover and mutation of the selected test cases are performed to generate new test cases.

[0080] The selected test cases are then crossed over with a certain probability to generate new test cases. The crossover operation uses single-point mutation to compare two consecutive individuals in the population, randomly generate a marker position, and swap two individuals from all scenario factors after the marker position. In this way, two consecutive individuals are processed sequentially to obtain a new set of parent candidate relationship cases.

[0081] Each newly generated test case is mutated with a certain probability. The mutation operation uses a mutation threshold to traverse all scenario factors of each individual, randomly generate a decimal within the range [0, 1], and determine whether the decimal exceeds the mutation threshold. If the decimal is greater than the mutation threshold, select one of the scenario factors and replace the corresponding scenario factor. This process is repeated for each individual, and finally a set of new parent candidate cases is obtained.

[0082] S53, select the next generation population from the new test cases based on the fitness function and return to S51 until the termination condition is met.

[0083] The newly generated test cases are evaluated and selected, and the test cases with the highest fitness are selected as the next generation population. After each iteration, all newly generated test cases are evaluated according to a fitness function. Then, based on these fitness values, a subset of the best-performing test cases are selected as the next generation population, and the fitness of the new parent candidate case set is recalculated.

[0084] Set termination conditions for the genetic algorithm to determine when to stop iterating. Two termination conditions can be set: one is to stop iterating when the maximum number of iterations is reached, and the other is to stop iterating when the fitness reaches a threshold and the fitness value of the test case exceeds or is equal to the threshold.

[0085] Example 2 2 is a schematic diagram illustrating the structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 2, an electronic device 200 includes one or more processors 201 and a memory 202.

[0086] The processor 201 may be a central processing unit (CPU) or other type of processing device having data processing and / or instruction execution capabilities, and may control other components within the electronic equipment 200 to perform desired functions.

[0087] The memory 202 includes one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions may be stored in the computer-readable storage medium, and the processor 201 may execute the program instructions to realize the test case generation method for autonomous driving scenarios according to any embodiment of the present invention and / or other desired functions. The computer-readable storage medium may also store various contents, such as initial external parameters and thresholds.

[0088] In one embodiment, the electronic equipment 200 may further include an input device 203 and an output device 204, and these components may be interconnected via a bus system and / or other type of connection mechanism (not shown). The input device 203 may include, for example, a keyboard, a mouse, etc. The output device 204 may output various information to the outside, such as a warning alert message or braking force. The output device 204 may include, for example, a display, a speaker, a printer, a communication network, and remote output equipment connected thereto.

[0089] 2 shows only some of the components of the electronic device 200 that are relevant to the present invention, and omits components such as buses and input / output interfaces, etc. In addition, the electronic device 200 may further include other appropriate components depending on the specific application.

[0090] It should be noted that the terms used in the present invention are intended to describe specific embodiments and are not intended to limit the scope of the present application. As shown in the specification of the present invention, unless the context clearly suggests otherwise, terms such as "one," "one," "one kind," and / or "the," do not specifically refer to the singular but can also include the plural. "Comprises," "having," or other variations are intended to be non-exclusive inclusive, so that a process, method, or facility that includes a set of elements includes not only those elements but also other elements not expressly listed or elements inherent in the process, method, or facility. Unless further limited, an element limited by the phrase "comprises one ..." does not exclude the presence of other identical elements in the process, method, or facility that includes the element.

[0091] As will be further explained, terms such as "center," "up," "down," "left," "right," "vertical," "horizontal," "inside," and "outside" indicate orientations or positional relationships based on those shown in the accompanying drawings and are intended to facilitate and simplify the description of the present invention. They do not indicate or suggest that the referenced devices or elements have a specific orientation or must be constructed and operated in a specific orientation, and therefore should not be understood as limitations of the present invention. Terms such as "attached," "connected," and "coupled" should be understood broadly unless otherwise specified or limited, and may refer to, for example, fixed connection, detachable connection, or integral connection, mechanical connection, electrical connection, direct connection, indirect connection via an intermediate medium, or internal communication between the two components. Those skilled in the art can understand the specific meanings of the above terms in this application according to the actual situation.

[0092] Finally, it should be explained that the above-mentioned embodiments are only for illustrating the technical solutions of the present invention, and are not intended to limit the same. Although the present invention has been described in detail with reference to the above-mentioned embodiments, those skilled in the art can understand that the technical solutions described in the above-mentioned embodiments may be modified, or some or all of the technical features may be equivalently replaced, and such modifications or replacements will not deviate from the essence of the corresponding technical solutions of the embodiments of the present invention.

Claims

1. A method for generating test cases for an autonomous driving scenario, comprising: S1, initialize multiple test cases by a genetic algorithm, each test case including different types of parameter values; S2. Calculating the information entropy of each parameter value in each test case based on the occurrence frequency of the parameter value in the scenario database; S3. Weighting and summing the information entropies of all parameter values ​​in each test case according to the importance of the parameter type to obtain a comprehensive information entropy for each test case; S4. Construct a fitness function based on the comprehensive information entropy of each test case, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency; S5. iteratively generating new test cases based on the fitness function until a termination condition is met; Here, S2 is The information entropy H(X) of each parameter value is calculated using the following formula: i,j ) and Here, N(X i ) is the number of occurrences of the parameter type to which parameter X belongs in the scenario database, and N(X i,j ) is the number of occurrences of the parameter value of parameter X in the scenario database, i is the type number assumed to be 10, j is the parameter value number, and the total δ i There is a value of P(X i,j ) are the probabilities of the possible values ​​of the parameters of X, The information entropy of each parameter value is calculated using the following formula: n (X i,j ) and normalizing it as Here, H min (X i,α ) is the minimum information entropy among the parameter types of parameter X, and H max (X i,β ) is the maximum information entropy among the parameter types of parameter X, Here, S4 is S41, based on the analysis of past test cases, using a regression algorithm to determine the weights of comprehensive information entropy, vehicle collision risk when applied, parameter coverage rate and test efficiency; S42. According to the weights, weighted summing the comprehensive information entropy, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency to obtain a fitness function. Before S4, the method further includes: calculating the time to be used for each test case based on road conditions and the time it takes for the vehicle to deal with obstacles; normalizing the time for each test case so that shorter times result in higher testing efficiency; and determining the parameter coverage rate based on the number of different road types and weather conditions that the test cases cover.

2. Before S4, using physical simulation or statistical models to predict the collision risk of the vehicle in each test case; and normalizing the collision risk.

3. The S1 is Selecting key parameters that affect the performance of autonomous driving; 2. The method for generating test cases for autonomous driving scenarios according to claim 1, further comprising: creating a multidimensional parameter space; randomly selecting parameter values ​​from the multidimensional parameter space; and constructing a plurality of test cases as an initial population of the genetic algorithm.

4. The step S5 is S51, selecting a test case from a current plurality of test cases based on a fitness-weighted random selection roulette wheel method; S52: Crossover and mutation of the selected test cases to generate new test cases; 2. The method for generating test cases for autonomous driving scenarios according to claim 1, further comprising: S53: selecting a next generation population from the new test cases based on the fitness function and returning to S51 until a termination condition is met.

5. An electronic device comprising: It has a processor and memory, The processor is used to execute steps of the test case generation method for automated driving scenarios described in any one of claims 1 to 4 by calling a program or instruction stored in the memory.

Citation Information

Patent Citations

  • Genetic-algorithm-based method for automatically generating data stream test cases

    CN103593287A

  • Class integration test sequence generation method

    CN108399127A

  • Fuzzy test method for vehicle-mounted CAN bus, terminal and computer equipment

    CN113872985A

  • Unit test case automatic generation method based on loss function

    CN114490316A

  • Automatic driving scene recovery and automatic driving prototype test method and system

    CN116310748A