Method and equipment for generating test cases for autonomous driving scenarios

JP7638432B1Active Publication Date: 2025-03-03CHINA AUTOMOTIVE TECH & RES CENT CO LTD

Patent Information

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

Smart Images

  • Figure 0007638432000001_ABST
    Figure 0007638432000001_ABST
Patent Text Reader

Abstract

Provided is a method and equipment for generating test cases for autonomous driving scenarios that improves the quality of test cases while ensuring a test coverage rate, and more effectively verifies and optimizes system performance and safety. [Solution] The method includes initializing multiple test cases using a genetic algorithm, calculating the information entropy of each parameter value in each test case based on the occurrence frequency of the parameter value in a scenario database, weighting and adding 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 of each test case, 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, and iteratively generating new test cases based on the fitness function until a termination condition is met.
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 to ensure the safe and reliable operation of autonomous driving systems in diverse road and traffic environments. In order to evaluate and verify the performance of autonomous driving systems, extensive testing is required covering a wide range of driving scenarios and situations, including everyday traffic conditions, adverse weather conditions, 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 resource waste.

[0004] Research has shown that corner cases have a relatively low occurrence probability, 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, in order to allocate test resources more efficiently, it is necessary to consider the importance and occurrence probability of test cases. Summary of the Invention

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

[0006] In order to solve the above technical problems, the present invention provides a method and equipment for generating test cases for autonomous driving scenarios, and incorporates an improved combination of information entropy and genetic algorithms to test the autonomous driving test scenario generation algorithm, thereby improving the quality of the test cases while ensuring the test coverage rate, and verifying and optimizing the performance and safety of the autonomous driving system 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 a genetic algorithm, and 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. weighting and summing the information entropy of all parameter values ​​in each test case according to the importance of the parameter type to obtain a comprehensive information entropy of each test case; S4, constructing a fitness function according to 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 steps of the method for generating test cases for autonomous driving scenarios described in any of the embodiments by invoking programs or instructions stored in the memory.

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

[0010] By introducing information entropy, the generation of test scenarios does not only depend on the combination of parameters, but also takes into account the diversity and probability of the distribution of parameter values. In this way, the breadth and depth of test scenarios can be increased, and potential fault points of the system in a complex and uncertain environment can be more effectively revealed. Furthermore, through genetic operations such as selection, crossover and mutation, the algorithm can efficiently develop better-performing test cases from the initially generated test scenarios. In this way, it not only improves the quality of test cases, but also increases the efficiency and certainty of testing. It provides more accurate and comprehensive test coverage, especially in complex and diverse fields such as autonomous driving testing.

[0011] The present invention combines genetic algorithms with traditional scenario generation methods and is innovatively used to optimize the generation of test scenarios. Through the operations of genetic algorithm selection, crossover and mutation, the process of developing optimized test cases is streamlined and the overall system performance is improved, which not only improves the quality of test cases but also improves the efficiency and reliability of testing.

[0012] By comprehensively deriving the fitness function by combining information entropy, collision risk, test efficiency and coverage rate, the efficiency of test scenario generation is greatly improved, and redundant scenarios are reduced while ensuring test coverage. In other words, more representative and challenging test scenarios can be generated in a short time, so that the performance and safety of autonomous driving systems can be more efficiently verified and optimized, which plays an important role in accelerating the R&D and testing cycle of autonomous driving systems. [Brief description 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 briefly introduces drawings used in the description of the specific embodiments or the prior art, and 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 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. [Diagram 2] 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[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 driving vehicles. The method for generating test cases for autonomous driving scenarios according to an embodiment of the present invention is executed in an electronic device.

[0016] 1 is a flow chart 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, it is first necessary 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 for autonomous driving, parameters such as road type (urban road, highway), driving scenario (intersection, 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 city roads with high traffic volumes and are prone to traffic congestion, so the test scenarios can cover a variety of urban road environments, such as downtown areas, around schools, and residential areas. These areas usually have complex traffic flows, multiple lanes, traffic signals, zebra zones, and various road signs and markings. In the highway area, driving on the highway is simulated, including straight ahead, overtaking, and on-ramps / off-ramps. Test scenarios may include different speed limits, number of lanes, traffic signs and markings on highways, etc., and in rural areas, to simulate country roads and rural environments that are relatively narrow, have low traffic volume, and may include agricultural vehicles, pedestrians, and animals. Test scenarios may include typical rural scenarios such as curvy roads, unexpected traffic conditions, passing rural markets, etc., as shown in Table 1.

[0021] Table 1 Road types JPEG0007638432000002.jpg4773

[0022] The driving scenarios are then divided into five categories: intersection, curve, overtaking, parking, and emergency. The intersection scenario is related to traffic and signal control at an intersection, and the test scenarios can include various types of intersections, such as crossroads, T-junctions, and roundabouts. Such scenarios are related to the behavior of a vehicle going straight, turning left, turning right, and following signals. The curve scenario is related to the vehicle's left-turn, right-turn, or U-turn operation, and the test scenarios can include various types of curved roads, such as right-angle curves, diagonal curves, and arc-shaped curves. Such scenarios are related to the behavior of a vehicle selecting an appropriate curve route, coordinating with other vehicles, and complying with traffic rules. The overtaking scenario simulates a vehicle overtaking or being overtaken by another vehicle, and the test scenarios include overtaking on a highway, and lane changing and overtaking on an urban road. Such scenarios are related to the behavior of a vehicle accelerating, decelerating, judging a safe distance, and changing lanes. Parking scenarios simulate the vehicle's parallel and perpendicular parking maneuvers, and the test scenarios cover different types of parking scenes, e.g., on-street parking, parking space parking, and parking lot parking. Such scenarios concern the vehicle's exact 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, and test scenarios include the sudden appearance of an obstacle, a pedestrian suddenly crossing the road, and dealing with unexpected traffic situations. These scenarios concern the vehicle's reaction speed, judgment ability and avoidance measures.

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

[0024] Table 3 Road environment parameters JPEG0007638432000004.jpg38117

[0025] Table 4 Road environment parameters JPEG0007638432000005.jpg38117

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

[0027] Table 6 Vehicle state parameters JPEG0007638432000007.jpg3280

[0028] Table 7. Sensor parameters JPEG0007638432000008.jpg32117

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

[0030] Table 9 Vehicle behavior parameters JPEG0007638432000010.jpg31117

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

[0032] Step 2: Create a multi-dimensional parameter space, with each dimension representing one test parameter. To define the test scenario space, the possible 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, and each parameter has m possible values, the size of the test scenario space is m. n It is.

[0033] As an example, we select three parameters: road type, vehicle speed and weather condition. The 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 the 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 of which 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 JPEG0007638432000012.jpg32117Initialize a population containing 5 test cases. Randomly select parameter values ​​to create the initial test cases.

[0037] Table 12 Initial test cases JPEG0007638432000013.jpg82117S2, calculate the information entropy of each parameter value in each test case based on the occurrence frequency of the parameter value in the scenario database.

[0038] To evaluate the contribution of each parameter to the diversity of test cases, we calculate the information entropy of the parameter here. By calculating the information entropy of the parameter, we can grasp the diversity and distribution of each parameter value. The higher the information entropy, the higher the diversity of the parameter values ​​and the higher the coverage rate of the test cases. If the information entropy of a parameter is low, that is, the distribution of the parameter values ​​is relatively concentrated, it indicates that the coverage rate of the parameter for the test cases is low and more attention should be paid to it. 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 test cases generated can be moderately 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 ) to calculate

[0040] JPEG0007638432000014.jpg18112Here, 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 sum δ i There are values ​​P(X i,j ) are the probabilities for 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 testing.

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

[0043] JPEG0007638432000015.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, a Bayesian model can be combined to estimate the probability of the possible values ​​of the parameter. 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 the Bayesian network model.

[0045] A Bayesian network is a probabilistic graphical model that is used to represent dependencies between variables and to take into account correlations between variables. 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 possible values ​​for each parameter and to 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] JPEG0007638432000016.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,W. These prior and posterior probabilities can be determined based on the occurrence frequency of the corresponding parameters in the scenario database as well. In this way, the probability of the value of a parameter (R) under certain conditions (e.g., W and T) can be obtained, and as a result, the probability of its possible values ​​under specified conditions can be obtained, so that the generated test cases can be more targeted and redundancy can be avoided. The probability calculated based on the occurrence frequency of the parameters and the probability obtained from the model are weighted and added to obtain the final probability value, and the information entropy is calculated.

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

[0048] Here, μ, θ, and λ represent the weight assignment based on frequency and distribution, the weight assignment based on domain expert judgment, and the weight assignment based on the model, respectively. Ψ is the probability of the possible values ​​of the parameters as determined by the domain expert. Φ is the probability of the possible values ​​of the parameters as determined by the domain expert. This is the probability of the possible values ​​of a parameter 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 on the probability of possible values ​​of different parameters based on their experience and expertise. Model inference requires estimating the probability of possible values ​​of parameters using a Bayesian network model. Combining these three methods can provide more accurate probability of possible values ​​of parameters. As an example, the probabilities of possible values ​​of some parameters are shown below.

[0049] Table 13. Probabilities of possible parameter values JPEG0007638432000018.jpg127118

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

[0051] JPEG0007638432000019.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 H 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 sum δ i has 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] A fitness function is used to evaluate the performance of each test case (individual) and is the basis used for selection in the genetic algorithm; it 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] JPEG0007638432000020.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 crash risk, test efficiency, parameter coverage rate and comprehensive information entropy when the test case is applied, 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 when applied: Evaluated based on the collision risk of the vehicle in various scenarios, and the lower the score, the higher the safety. A physical simulation or statistical model is used to predict the collision risk of the vehicle 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 consideration, and finally the collision risk value is normalized to an appropriate range. Here, physical simulation is a method of simulating physical phenomena in the real world using a computer, and 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 the collision risk very accurately, but it is also computationally intensive. A statistical model is a model that uses statistical data to predict the probability of future events, and is used to estimate the collision risk of an autonomous vehicle in various scenarios.

[0058] JPEG0007638432000021.jpg3597The distance between the vehicle and the surrounding obstacles is d, the speed is v, and the 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: Determine the parameter coverage rate CO based on the number of different road types and weather conditions covered by the test cases, with a higher score indicating more comprehensive coverage. Collect statistics on the number of different road types and weather conditions covered by the test scenarios, and finally normalize the coverage rates of road types and weather conditions into appropriate ranges.

[0060] JPEG0007638432000022.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 covered. h(C i ) represents coverage for a road type or weather condition.

[0061] Test efficiency: Calculate the time taken for each test case based on the road conditions and the time taken for the vehicle to deal with the obstacle, and the shorter the time, the higher the test efficiency. Here, the road conditions such as highway, rain, etc. are obtained directly from the test cases. The time required for the vehicle to deal with the obstacle can be obtained based on the combination of the average reaction speed of the vehicle, the obstacle avoidance measures, the size of the obstacle, the travel distance and the speed, and the specific value is obtained through experiments, and the time required to perform the task is obtained by adding the obtained average reaction speed of the vehicle, the execution time of the obstacle avoidance measures, the obstacle avoidance time in the size of the obstacle, and the travel time obtained based on the travel distance and speed.

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

[0063] JPEG0007638432000023.jpg1151Here, 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 task completion time is 100 seconds. In this scenario, the vehicle takes 30 seconds to complete the task, but the normalized value is 0.78.

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

[0065] S41, based on the past test case analysis, 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 simulation tests are selected from the scenario database and scored, and testers can set scores based on their own experience and actual tests. The score is the weighted sum of the comprehensive information entropy, vehicle collision risk when applied, parameter coverage rate and test efficiency, and is fitted using a regression algorithm to obtain the weight of each item, that is, the importance of each item to the final expression of the test case.

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

[0068] S42, based on the weights, weight-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 to ensure coverage of a wide variety of road and weather conditions by defining one multi-objective fitness function.

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

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

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

[0073] JPEG0007638432000026.jpg13151 For 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 JPEG0007638432000027.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 roulette wheel selection method for weighted fitness random selection is used to select a test case from a current plurality of test cases.

[0078] A 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 be a new parent candidate. The cumulative probability makes it easier for individuals with high fitness to be selected.

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

[0080] The selected test cases are crossed over with a certain probability to generate new test cases. In the crossover operation, one-point mutation is used to compare two consecutive individuals in the population, generate a marker position with a random number, and exchange 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. In the mutation operation, we use the mutation threshold to traverse all scenario factors of each individual, randomly generate a decimal in the range of [0,1], and judge whether the decimal exceeds the mutation threshold. If the decimal is greater than the mutation threshold, we select one from the scenario factors to replace the corresponding scenario factor, and then process each individual in turn to finally obtain a set of new parent candidate cases.

[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 high fitness are selected as the next generation population. After each iteration, all the newly generated test cases are evaluated according to a fitness function. Then, based on these fitness values, a part 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 the termination conditions for the genetic algorithm to determine when to stop the iterations. Two termination conditions are set. One is to stop the iterations when the maximum number of iterations is reached. The other is to stop the iterations 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, the 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 device 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, a random access memory (RAM) and / or a cache memory (cache). The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. The computer-readable storage medium may store one or more computer program instructions, and the processor 201 may execute the program instructions to realize the test case generation method for an autonomous driving scenario according to any embodiment of the present invention described above and / or other desired functions. The computer-readable storage medium may store various contents, such as initial external parameters, threshold values, etc.

[0088] In one embodiment, the electronic equipment 200 may further include an input device 203 and an output device 204, which are interconnected via a bus system and / or other types of connection mechanisms (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 a 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] For the sake of simplicity, Fig. 2 only shows some of the components of the electronic device 200 that are relevant to the present invention, and omits components such as buses, input / output interfaces, etc. In addition, the electronic device 200 may further include other suitable components according to specific applications.

[0090] It should be noted that the terms used in the present invention are for describing 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, the terms "one", "one", "a kind" and / or "the" may include the plural, rather than specifically referring to the singular. "Comprise", "comprises" 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 to the process, method or facility. Unless further limited, an element limited by the description "comprises a ..." does not exclude the presence of another identical element in the process, method or facility that includes the element.

[0091] As will be further explained, the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., 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, and do not indicate or suggest that the referred devices or elements have a specific orientation and 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 in a broad sense unless otherwise specified or limited, for example, they may be fixedly connected, detachably connected or integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected through an intermediate medium, or internal communication between both members. Those skilled in the art can understand the specific meaning of the above terms in this application according to the actual situation.

[0092] Finally, it should be explained that the above-mentioned embodiments are merely 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 embodiments, those skilled in the art can understand that the technical solutions described in the above embodiments may be modified, or part or all of the technical features may be equivalently replaced, and such modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating test cases for an autonomous driving scenario, comprising: S1, a processor initializes a plurality of test cases by a genetic algorithm, each test case including a different type of parameter value; S2, the processor calculates 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 processor weights and sums the information entropy of all parameter values ​​in each test case according to the importance of the parameter type to obtain a comprehensive information entropy of each test case; S4. The processor constructs a fitness function according to the comprehensive information entropy of each test case, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency; S5. The processor iteratively generates new test cases based on the fitness function until a termination condition is met; Here, S2 is The processor calculates the information entropy H(X) of each parameter value 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 sum δ i There is a value of P(X i,j ) are the probabilities of the possible values ​​of the parameters of X, The processor calculates the information entropy of each parameter value as H using the following formula: n (X i,j ) 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, the processor uses a regression algorithm to determine the weights of comprehensive information entropy, vehicle collision risk when applied, parameter coverage rate and test efficiency based on past test case analysis; S42, the processor performs weighted summation of the comprehensive information entropy, the vehicle collision risk when applied, the parameter coverage rate and the test efficiency based on the weight to obtain a fitness function. The method for generating test cases for autonomous driving scenarios, further comprising, before S4, the processor calculating a time to be used for each test case based on road conditions and the time it takes for the vehicle to deal with an obstacle, the processor normalizing the time for each test case so that the shorter the time, the higher the test efficiency, and the processor determining the parameter coverage rate based on the number of different road types and weather conditions that the test cases cover.

2. Before S4, a processor predicting a collision risk of the vehicle in each test case using a physical simulation or a statistical model; The method for generating test cases for an autonomous driving scenario according to claim 1 , further comprising: a processor normalizing the collision risk.

3. The S1 is A processor selects key parameters that affect the performance of the autonomous driving; 2. The method for generating test cases for an autonomous driving scenario as described in claim 1, further comprising: a processor creating a multi-dimensional parameter space and randomly selecting parameter values ​​from the multi-dimensional parameter space to construct a plurality of test cases as an initial population of the genetic algorithm.

4. The above-mentioned S5 is S51, a processor selecting a test case from a current plurality of test cases based on a fitness-weighted random selection roulette wheel selection method; S52: A processor crossovers and mutates the selected test cases to generate new test cases; 2. The method for generating test cases for autonomous driving scenarios as described in claim 1, further comprising: S53, the processor selecting a next generation population from the new test cases based on the fitness function and returning to S51 until a termination condition is satisfied.

5. 1. An electronic device comprising: It has a processor and memory, The processor is used to execute steps of the test case generation method for autonomous 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

Cited By

  • Method and system for automatically generating heuristic test case in combination with information entropy

    CN120909946A

  • Test scene credible accelerated generation method based on consistency verification of multiple simulators

    CN122360966A