Test scene generation method, device, system and equipment and readable storage medium
By distributing and offsetting the real driving scene data, virtual test scenarios are generated, and the problem of insufficient scene data in the existing technology is solved and the efficiency of virtual testing is improved.
Patent Information
- Application Number
- CN202510204889.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, there is less scenario data that can be collected, which cannot meet the needs of simulation testing, resulting in low testing efficiency.
By distributing and fitting the scene data of the real driving scene, a first distribution model is obtained, and a second distribution model is obtained through offset, sampling is performed based on multiple second distribution models, a collection of scene data is obtained, and a virtual test scene is combined to construct a virtual test scene.
It effectively increases the probability of scene data appearing in dangerous scenarios, meets the scene data needs of virtual testing, and improves the efficiency of virtual testing.
Smart Images

Figure CN120144447A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of vehicle testing, and in particular, to a method, device, system, electronic device, and computer-readable storage medium for generating a test scenario. Background Art
[0002] With the development of vehicle manufacturing technology, the functions of vehicles are becoming more and more abundant. Among them, autonomous driving technology can reduce the vehicle operation of occupants. However, autonomous driving technology needs to be tested, and compared with real vehicle testing, virtual simulation testing based on the collected driving data is more efficient.
[0003] In the related art, during the driving process of a vehicle, when it is determined that the current is a dangerous scenario through some trigger conditions, relevant driving data, that is, scenario data, is collected, and testing is performed based on the scenario data of the dangerous scenario.
[0004] However, in the related art, the collected scenario data is less, which cannot meet the requirements of simulation testing, resulting in low testing efficiency. Summary of the Invention
[0005] In view of the above problems, embodiments of the present disclosure are proposed to provide a method, device, system, electronic device, and computer-readable storage medium for generating a test scenario that overcomes the above problems or at least partially solves the above problems.
[0006] In a first aspect, embodiments of the present disclosure disclose a method for generating a test scenario, including:
[0007] Performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model; the scenario data of different data types in different driving scenarios correspond to different first distribution models;
[0008] Performing an offset on the first distribution model to update the first distribution model, and using the updated first distribution model as a second distribution model;
[0009] Based on multiple second distribution models, sampling is respectively performed to obtain a scenario data set corresponding to each second distribution model; the data types of the scenario data within the scenario data set are the same; the data types corresponding to different scenario data sets are different;
[0010] Combining the scenario data in multiple scenario data sets to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
[0011] Optionally, the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model includes:
[0012] According to the scenario type, the scenario data corresponding to the real driving scenario is divided to obtain the scenario data corresponding to different scenario types respectively;
[0013] According to the data type, the scenario data of each scenario type is divided to obtain the scenario data corresponding to different data types under different driving scenarios;
[0014] For the scenario data corresponding to different data types respectively, distribution fitting is performed to obtain the first distribution model corresponding to each data type.
[0015] Optionally, the step of performing an offset on the first distribution model to update the first distribution model includes:
[0016] Based on a preset torsion parameter, exponential torsion is performed on the first distribution model to obtain a transformed distribution model; there is an offset between the first distribution model and the transformed distribution model;
[0017] Determine the theoretical distribution model corresponding to the first distribution model, and determine the difference degree between the theoretical distribution model and the transformed distribution model; there is an associated relationship between the difference degree and the offset value of the offset;
[0018] In the case where the difference degree is the smallest, determine the corresponding target offset value, and update the first distribution model according to the target offset value.
[0019] Optionally, the step of combining the scenario data in multiple scenario data sets to construct a virtual test scenario includes:
[0020] Based on the scenario data in each scenario data set, complete permutation and combination are performed to obtain a virtual test scenario including the scenario data combination;
[0021] Among them, any scenario data in any scenario data set has a combination relationship with any scenario data in other scenario data sets.
[0022] Optionally, the method further includes:
[0023] Determine the scenario data combination corresponding to each virtual test scenario, and the scenario data in the scenario data combination;
[0024] In the case where there are the same preset number of scenario data in at least two scenario data combinations, delete at least one scenario data combination so that the number of scenario data combinations including the preset number of scenario data is one.
[0025] Optionally, each scenario data carries a scenario identifier; the method further includes:
[0026] Based on the virtual test scenario to be measured, determine the target scenario identifier of the virtual test scenario;
[0027] Based on the target scenario identifier, in the scenario data corresponding to the real driving scenario, select the scenario data with the target scenario identifier, and enter the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain the first distribution model.
[0028] In a second aspect, an embodiment of the present disclosure discloses a test scenario generation device, including:
[0029] A distribution fitting module, configured to perform distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model; the scenario data of different data types in different driving scenarios correspond to different first distribution models;
[0030] A model offset module, configured to perform offset on the first distribution model to update the first distribution model, and use the updated first distribution model as the second distribution model;
[0031] A data sampling module, configured to respectively perform sampling based on a plurality of second distribution models to obtain a set of scenario data corresponding to each second distribution model; the data types of the scenario data within the set of scenario data are the same; the data types corresponding to different sets of scenario data are different;
[0032] A scenario construction module, configured to combine the scenario data in a plurality of sets of scenario data to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
[0033] Optionally, the distribution fitting module includes:
[0034] A scenario division sub-module, configured to divide the scenario data corresponding to the real driving scenario according to the scenario type to obtain the scenario data corresponding to different scenario types respectively;
[0035] A data division sub-module, configured to divide the scenario data of each scenario type according to the data type to obtain the scenario data corresponding to different data types in different driving scenarios respectively;
[0036] A respective fitting sub-module, configured to perform distribution fitting on the scenario data corresponding to different data types respectively to obtain a first distribution model corresponding to each data type.
[0037] Optionally, the model offset module includes:
[0038] An exponential torsion sub-module, configured to perform exponential torsion on the first distribution model based on preset torsion parameters to obtain a transformed distribution model; there is an offset between the first distribution model and the transformed distribution model;
[0039] A difference determination sub-module, configured to determine a theoretical distribution model corresponding to the first distribution model, and determine the degree of difference between the theoretical distribution model and the transformed distribution model; there is an association relationship between the degree of difference and the offset value of the offset;
[0040] A target offset sub-module, configured to determine a corresponding target offset value when the degree of difference is the smallest, and update the first distribution model according to the target offset value.
[0041] Optionally, the scenario construction module includes:
[0042] A permutation and combination sub-module, configured to perform a complete permutation and combination based on the scenario data in each scenario data set to obtain a virtual test scenario including scenario data combinations;
[0043] Wherein, any scenario data in any scenario data set has a combination relationship with any scenario data in other scenario data sets.
[0044] Optionally, the apparatus further includes:
[0045] A data content module, configured to determine the scenario data combination corresponding to each virtual test scenario, and the scenario data in the scenario data combination;
[0046] A scenario deletion module, configured to delete at least one scenario data combination when there are the same preset number of scenario data in at least two scenario data combinations, so that the number of scenario data combinations including the preset number of scenario data is one.
[0047] Optionally, each scenario data carries a scenario identifier; the apparatus further includes:
[0048] A target identifier module, configured to determine the target scenario identifier of the virtual test scenario based on the virtual test scenario to be measured;
[0049] A data screening module, configured to select the scenario data with the target scenario identifier from the scenario data corresponding to the real driving scenario based on the target scenario identifier, and enter the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model.
[0050] In a third aspect, an embodiment of the present disclosure also discloses a test system, the system includes:
[0051] A scenario generation subsystem, a vehicle test subsystem;
[0052] The scenario generation subsystem is configured to execute the steps of the test scenario generation method described in the first aspect to construct a virtual test scenario;
[0053] The vehicle test subsystem is configured to perform a simulation test on the vehicle according to the virtual test scenario constructed by the scenario generation subsystem.
[0054] In a fourth aspect, an embodiment of the present disclosure also discloses an electronic device, including a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the test scenario generation method described in the first aspect are implemented.
[0055] In a fifth aspect, an embodiment of the present disclosure also discloses a computer-readable storage medium. A program is stored on the readable storage medium. When the program is executed by a processor, the steps of the test scenario generation method described in the first aspect are implemented.
[0056] In the embodiment of the present disclosure, by performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model, the scenario data of different data types in different driving scenarios correspond to different first distribution models. For the first distribution model, an offset is performed to update and obtain a second distribution model. Based on multiple second distribution models, sampling is respectively performed to obtain a scenario data set corresponding to each second distribution model. The scenario data in multiple scenario data sets are combined to construct a virtual test scenario. By offsetting the first distribution model of the original data and performing sampling based on the second distribution model obtained by the offset, more dangerous scenarios can be sampled, effectively increasing the occurrence probability of the scenario data of the dangerous scenarios, and further being able to meet the scenario data requirements of the virtual test and improving the virtual test efficiency. Description of the Drawings
[0057] Figure 1 is a step diagram of a test scenario generation method provided by an embodiment of the present disclosure;
[0058] Figure 2 is a schematic diagram of the first distribution model and the second distribution model provided by an embodiment of the present disclosure;
[0059] Figure 3 is a step diagram of another test scenario generation method provided by an embodiment of the present disclosure;
[0060] Figure 4 is a schematic diagram of combining and deleting scenario data provided by an embodiment of the present disclosure;
[0061] Figure 5 is a schematic diagram of the generalization generation of the virtual test scenario provided by an embodiment of the present disclosure;
[0062] Figure 6 It is a block diagram of a test scenario generation device provided by an embodiment of the present disclosure;
[0063] Figure 7 It is a block diagram of a test system provided by an embodiment of the present disclosure;
[0064] Figure 8 It is a block diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0065] Hereinafter, exemplary embodiments of the present application will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be completely conveyed to those skilled in the art.
[0066] In the application of autonomous driving technology, the high cost and low efficiency of real vehicle testing are the main problems currently faced. In the development of an autonomous driving system, in order to quickly complete the iterative update of the algorithm, virtual testing methods need to be relied on, and the scenario-based testing method is an important technical means.
[0067] However, the complexity of the real driving environment and the diversity of traffic participants on the road lead to different test scenarios for autonomous driving, and at the same time, problems such as low test efficiency and low exposure rate of dangerous critical scenarios in real data are also faced, thus restricting the iteration and development of autonomous driving.
[0068] In the related art, the extraction of scenario data for dangerous scenarios is based on rules from real driving data. For example, according to the time distance between the target object and the detection vehicle, the relative speed between the detection vehicle and the target object is obtained. If the time distance is less than the set distance threshold and the relative speed is less than the set speed threshold, it is determined that a dangerous scenario is in progress, and the scenario data is extracted.
[0069] Although the rule-based method can also extract dangerous scenarios, formulating appropriate rules consumes a large amount of manpower, and different rules need to be formulated for extracting different scenarios. On the other hand, the number of dangerous scenarios in actual driving data is itself very small and cannot meet the test requirements of autonomous driving.
[0070] Figure 1 It is a step diagram of a test scenario generation method provided by an embodiment of the present disclosure. The method includes:
[0071] Step 101: Perform distribution fitting on the scenario data corresponding to the real driving scenario to obtain the first distribution model; the scenario data of different data types in different driving scenarios correspond to different first distribution models.
[0072] In the embodiments of the present disclosure, the scenario data in the real driving scenario can be obtained in advance. The scenario data can be data such as the speed of the host vehicle, the speed of the leading vehicle, the position of the host vehicle, the position of the leading vehicle, the maximum deceleration of the leading vehicle, the position of the obstacle, the own heading angle, etc., which are not limited herein. The scenario data is a description of a specific vehicle driving scenario and can restore the characteristics of a specific scenario. The scenario data representing a certain type of scenario can be X = {x 1 , x 2 ,..., x n}, where x i (i = 1, 2,..., n) are different data under this type of scenario.
[0073] For the scenario data, distribution fitting is performed, and the fitting result may be any one of various distributions. For example, it can be a normal distribution (Gaussian distribution), a uniform distribution, an exponential distribution, a gamma distribution, etc. The specific distribution type changes according to the change of the scenario data, which is not limited herein.
[0074] The first distribution model obtained by performing distribution fitting can be a probability density model used to represent different probabilities corresponding to different scenario data. For example, when the scenario data conforms to a normal distribution, the first distribution model can be:
[0075]
[0076] where x is the value of the random variable, representing the specific observed value or variable value in the normal distribution, and it can take any real number; π is the pi; μ is the mean, and the mean determines the position of the normal distribution, that is, the central position of the distribution; σ is the standard deviation, and the standard deviation determines the shape of the normal distribution. The larger the standard deviation, the flatter the curve and the more dispersed the data; the smaller the standard deviation, the steeper the curve and the more concentrated the data around the mean; exp is the exponential function.
[0077] The scenario data of different data types in different driving scenarios can be respectively fitted to obtain different first distribution models. Among them, the specific distribution model is not limited herein.
[0078] Step 102: Perform an offset on the first distribution model to update the first distribution model, and use the updated first distribution model as the second distribution model.
[0079] In the embodiments of the present disclosure, since there are differences in data among different scenario data, the types of the first distribution models obtained by fitting can also be different. Therefore, when offsetting the first distribution model, it is necessary to determine in combination with the type of the first distribution model. For example, if the first distribution model is a normal distribution model, in a normal distribution, since the mean determines the position of the distribution, that is, the central position of the distribution, and the standard deviation determines the shape of the distribution. Therefore, for the first distribution model of normal distribution, a mean offset can be performed, which can be to increase the mean based on the mean of the original first distribution model, so that the mean of the distribution is offset, and the second distribution model after the mean offset is obtained.
[0080] The first distribution model can also be a gamma distribution model. In the gamma distribution model, there are also similar shape and scale parameters. Adjusting the scale parameter can also change the position of the distribution, so as to achieve an offset. In addition, the exponential distribution model also has parameters that affect the shape of the distribution. The specific type of the first distribution model and how to perform an offset for different types are not specifically limited herein.
[0081] By offsetting the first distribution model to obtain the second distribution model, importance sampling can be further realized. That is, when the offset of the second distribution model is reasonable, the number of tests required to estimate the probability of a rare event occurring can be significantly reduced. By transforming the original first distribution model to form a new second distribution model, sampling the second distribution model can increase the generation probability of rare events.
[0082] By offsetting the first distribution model, importance sampling can be realized to improve the sample utilization rate and reduce the variance. By changing the sampling weights of the samples, more samples can be drawn in the area of interest to more accurately estimate rare events, that is, dangerous events occurring in dangerous scenarios.
[0083] The estimation accuracy of the probability of occurrence of rare event A can be calculated using the relative half-width l r . At a certain confidence level of 100(1-α)%, the relative half-width can be defined as:
[0084]
[0085] where l r is the relative half-width, γ is the probability of occurrence of the rare event, l α is the half-width, and l α can be expressed as:
[0086]
[0087] In the formula, represents the probability of rare event A in importance sampling, σ is the standard deviation in the normal distribution, and z α can be expressed as:
[0088] z α = Φ -1 (1 - α / 2)(4)
[0089] where Φ -1 is the inverse cumulative distribution function of the standard normal distribution, α represents the confidence level, and to meet the requirement of estimation accuracy, it is necessary to ensure that the relative half-width l r is less than a constant b.
[0090] When using the importance sampling method for test evaluation, the relative half-width l r can be expressed as:
[0091]
[0092] In the formula, E f* represents the expectation, n represents the number of tests, L(x) is the likelihood ratio, and I A (x) is the indicator function for evaluating the system performance. According to Equation 5 above, the minimum number of tests can be calculated as:
[0093]
[0094] And the number of tests when using the traditional Monte Carlo method to achieve the expected estimation accuracy:
[0095]
[0096] It can be seen from Equation 7 that when the γ value is smaller, the number of tests n required for the traditional method to achieve the expected confidence level is larger, resulting in low test efficiency.
[0097] Step 103: Based on multiple second distribution models, perform sampling respectively to obtain a set of scenario data corresponding to each second distribution model; the data types of the scenario data within the set of scenario data are the same; the data types corresponding to different sets of scenario data are different.
[0098] In the embodiments of the present disclosure, different types of scenario data can be respectively fitted to obtain different first distribution models. When obtaining the second distribution model according to the first distribution model, similarly, different first distribution models obtain corresponding second distribution models.
[0099] Sampling based on the processed second distribution model can obtain more scenario data of dangerous scenarios. For each second distribution model, sampling can obtain a set of scenario data corresponding to each second distribution model. The sampling processes for different distributions can be different. For example, the second distribution model after mean shift of the first distribution model of normal distribution is still a normal distribution. The sampling process of normal distribution is to sample new sample points from a standard normal distribution (mean is 0, standard deviation is 1), and then obtain sample points with specified mean and standard deviation through linear transformation and translation. Here, it does not specifically limit how to sample normal distribution and other types of distributions.
[0100] Figure 2 It is a schematic diagram of the first distribution model and the second distribution model provided by the embodiments of the present disclosure; Figure 2 It includes the first distribution model f(x) 201 and the second distribution model f * (x) 202 that are normal distributions. There is a mean shift between the first distribution model f(x) 201 and the second distribution model f * (x) 202. The scenario data of the second distribution model 202 shifts to a lower region, but the distribution type remains unchanged ( Figure 2 both the first distribution model 201 and the second distribution model 202 in it are normal distributions), so the probability of sampling the scenario data of dangerous scenarios is increased.
[0101] It can be assumed that the probability distribution function of the original scenario data, that is, the first distribution model, is f(x), and the probability density function of the shifted importance function, that is, the second distribution model, is f * (x). The likelihood ratio between the two can be defined as:
[0102]
[0103] In the formula, L(x) is the likelihood ratio, and the occurrence probability of the rare event A can be expressed as:
[0104]
[0105] In the formula, P(A) represents the occurrence probability of the rare event A, E f* represents the expectation, I A (x) is an indicator function for evaluating the performance of the simulation test system. I A (x) can be defined as:
[0106]
[0107] In the formula, x ∈ A means that the scenario data x belongs to the rare event A. When the rare event occurs, the indicator function is 1, and in other cases, the indicator function is 0; in addition, f * (x) needs to meet the following conditions:
[0108]
[0109] Equation 11 represents f * When f(x) is 0, f(x) is also 0.
[0110] Therefore, the probability estimation of rare event A based on importance sampling can be expressed as:
[0111]
[0112] In the formula, represents the probability of rare event A for importance sampling, n represents the number of tests, and x i represents the i-th scenario data, and I A (x i ) represents the result of the indicator function corresponding to the i-th scenario data, and L(x i ) represents the likelihood ratio corresponding to the i-th scenario data.
[0113] Step 104: Combine the scenario data in multiple sets of scenario data to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
[0114] In the embodiments of the present disclosure, there are also multiple sets of scenario data corresponding to multiple second distribution models. One scenario data can be selected from each set of scenario data to obtain multiple scenario data, and they are different types of scenario data.
[0115] Construct a virtual test scenario based on multiple scenario data. Since there are multiple sets of scenario data and the scenario data in each set of scenario data can also be multiple, multiple virtual test scenarios can be constructed.
[0116] The virtual test scenario constructed based on multiple different scenario data can be input into the autonomous driving system for testing. The autonomous driving system can output various parameter results, such as braking distance, deceleration during braking, and other parameters. Among them, the autonomous driving system can include a perception layer (mainly including sensors), a decision-making layer (mainly including processors), and an execution layer (mainly including a power system, a steering system, and a braking system). The autonomous driving system can collect data not in the real scenario, but can conveniently make decisions and output parameter results based on the scenario data corresponding to the virtual test scenario. Further, it can also control the vehicle operation based on these parameter results.
[0117] In summary, in the embodiments of the present disclosure, for the scenario data corresponding to the real driving scenario, distribution fitting is performed to obtain the first distribution model. The scenario data of different data types in different driving scenarios correspond to different first distribution models. For the first distribution model, offset is performed to update and obtain the second distribution model. Based on multiple second distribution models, sampling is respectively performed to obtain the scenario data set corresponding to each second distribution model. The scenario data in multiple scenario data sets are combined to construct a virtual test scenario. By offsetting the first distribution model of the original data and sampling based on the second distribution model obtained by offsetting, more dangerous scenarios can be sampled, effectively increasing the occurrence probability of the scenario data of dangerous scenarios, and thus being able to meet the scenario data requirements of virtual testing and improving the virtual testing efficiency.
[0118] Thereby, the following problems are also solved:
[0119] Insufficient data: The number of dangerous key scenarios in the actual driving data is very limited, making it difficult to cover all potential dangerous scenarios during the testing process, resulting in limitations in the comprehensiveness and accuracy of the test results; Low efficiency: Formulating rules to extract dangerous scenarios from the actual driving data cannot make full use of the limited natural driving data, especially the scarcity of dangerous key scenarios, resulting in low testing efficiency; Difficulty in generalization: The dangerous scenarios generated by the existing methods may be limited to specific conditions or parameter ranges and are difficult to generalize to a wider range of test scenarios, restricting the comprehensiveness of the test.
[0120] Reference Figure 3 , which shows the flowchart of the steps of a test scenario generation method provided by the embodiments of the present disclosure. The method includes:
[0121] Step 301, for the scenario data corresponding to the real driving scenario, perform distribution fitting to obtain the first distribution model; the scenario data of different data types in different driving scenarios correspond to different first distribution models;
[0122] Step 302, for the first distribution model, perform offset to update the first distribution model, and use the updated first distribution model as the second distribution model;
[0123] Step 303, based on multiple second distribution models, respectively perform sampling to obtain the scenario data set corresponding to each second distribution model; the data types of the scenario data within the scenario data set are the same; the data types corresponding to different scenario data sets are different;
[0124] Step 304, combine the scenario data in multiple scenario data sets to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
[0125] The above steps 301-304 can refer to the content of the above Figure 1 embodiment and will not be elaborated here.
[0126] Optionally, the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain the first distribution model includes:
[0127] Step 3011: Divide the scenario data corresponding to the real driving scenario according to the scenario type to obtain the scenario data corresponding to different scenario types respectively;
[0128] Step 3012: Divide the scenario data of each scenario type according to the data type to obtain the scenario data corresponding to different data types under different driving scenarios;
[0129] Step 3013: Perform distribution fitting on the scenario data corresponding to different data types respectively to obtain the first distribution model corresponding to each data type.
[0130] In the embodiments of the present disclosure, the virtual test scenario can be various scenarios. For example, it can be a following scenario, the host vehicle merging into other lanes, a vehicle in other lanes merging into the lane of the host vehicle, and so on. These scenarios can be scenarios where danger is likely to occur during driving, so simulation tests can be performed.
[0131] For the scenario data corresponding to the real driving scenario, it can be divided according to different scenario types, such as the following scenario, to determine the scenario data corresponding to each scenario type. For example, in the following scenario, there are scenario data such as the relative distance between the host vehicle and the leading vehicle, the initial speed of the host vehicle, the initial relative speed, and the maximum visible speed of the leading vehicle.
[0132] Furthermore, in the scenario data of one scenario type, there are also various data of different data types. For example, in the following scenario, there are the relative distance, the initial speed of the host vehicle, and the initial relative speed. The data type of each scenario data can be different. Therefore, for one scenario, it can be further distinguished according to the data type.
[0133] Finally, the scenario data of different data types in different scenario types can be obtained. For the scenario data of different data types in different scenario types, distribution fitting can be performed respectively to obtain different first distribution models.
[0134] Implementing the embodiments of the present disclosure, the scenario data corresponding to the real driving scenario is divided according to the scenario type to obtain the scenario data corresponding to different scenario types respectively; according to the data type, the scenario data of each scenario type is divided to obtain the scenario data corresponding to different data types under different driving scenarios. For the scenario data corresponding to different data types respectively, distribution fitting is performed to obtain the first distribution model corresponding to each data type. It is possible to distinguish the scenario data in detail based on the scenario type and the data type, and perform fitting separately, which is beneficial to analyzing different data for different scenarios separately, thereby improving the accuracy of the virtual test scenario.
[0135] Optionally, the step of performing an offset on the first distribution model to update the first distribution model includes:
[0136] Performing an exponential twist on the first distribution model based on a preset twist parameter to obtain a transformed distribution model; there is an offset between the first distribution model and the transformed distribution model;
[0137] Determining the theoretical distribution model corresponding to the first distribution model, and determining the difference degree between the theoretical distribution model and the transformed distribution model; there is an associated relationship between the difference degree and the offset value of the offset;
[0138] When the difference degree is the smallest, determining the corresponding target offset value, and updating the first distribution model according to the target offset value.
[0139] In the embodiments of the present disclosure, the exponential twist density function is defined as:
[0140] f θ (x) = c × exp(θx)f(x) (13)
[0141] Where f θ (x) is the exponential twist density function, c is the normalization constant, exp is the exponential function, θ represents the twist parameter, and f(x) is the first distribution model.
[0142] When the scenario data is expressed as X = {x 1 , x 2 ,..., x n}, if x 1 , x 2 , x 3 , …, x n follows the exponential family distribution F, the cumulant generating function can be expressed as:
[0143]
[0144] Among them, the cumulant is a characteristic quantity describing the probability distribution, exp is the exponential function, α represents the confidence level, the derivative of the cumulant generating function is related to the moment of the random variable, and F is the distribution of the scenario data.
[0145] Let F θ be the exponential distribution after the exponential twist of F. For any θ, it is required to satisfy θ ∈ R, where R is the set of real numbers, and k(θ) < ∞, and the probability density function of F θ is exp((θx - k(θ)), then:
[0146]
[0147] k(θ) is a function related to the twist parameter and the function value is finite. After simplification, we get:
[0148] k θ (α) = k(α + θ) - k(θ) (16)
[0149] For F θ find the mean and variance:
[0150]
[0151] F θ The mean and variance of can be expressed as:
[0152]
[0153] From the above formula, it can be seen that after the exponential transformation, the mean changes while the variance remains unchanged. Therefore, after the exponential transformation, let λ = θσ 2 , based on the first distribution model of the normal distribution, the obtained transformation distribution model is actually:
[0154]
[0155] Among them, the mean of the transformation distribution model g(x) is μ + λ, and λ is the mean shift, that is, the mean shift between the first distribution model and the transformation distribution model.
[0156] The specific value of λ can be determined by the cross - entropy algorithm. Among them, the cross - entropy algorithm is used to measure the differential information between two probability distributions. The basic idea of using the cross - entropy to solve the optimal shift value λ is to find an importance distribution function with the smallest KL divergence distance from the theoretical distribution model of the first distribution model through iteration. The optimal importance distribution function is obtained through adaptive iterative solution. For any distribution, there exists a theoretical optimal distribution that satisfies specific conditions, that is:
[0157]
[0158] Among them, f* (x) is the theoretical optimal distribution model of the first distribution model, i.e., the theoretical distribution model, I A (x) is an indicator function for evaluating the system performance, I A When (x) is 1, it indicates that a rare event has occurred. At this time, f * (x) is equal to the ratio of the first distribution model and the probability γ; I A When (x) is 0, it indicates that a rare event has not occurred. At this time, f * (x) is equal to 0.
[0159] Describing the difference based on the KL divergence can be expressed as:
[0160]
[0161] f KL [g(x), f * (x)] represents the difference between f * (x) and g(x). When the transformed distribution model is equal to the theoretical distribution model, f KL [g(x), f * (x)] = 0.
[0162] Iteratively find an importance distribution function with the smallest KL divergence distance from f * (x), that is:
[0163] λ = argmin f KL [g(x), f * (x)] (22)
[0164] Combining formulas 21 and 22, we can get:
[0165]
[0166] Substituting formula 19 and formula 20 into formula 23, we can obtain the iterative formula for the parameter λ:
[0167]
[0168] Among them, λ is the offset value, i is the number of iterations, and N is the summation upper limit. Then there is:
[0169]
[0170] From formula 24, we can obtain a function about λ:
[0171]
[0172] Ψ(λ) in formula 26 represents the difference degree between the theoretical distribution model f * (x) and the transformed distribution model g(x). Taking the derivative of formula 26, we can get:
[0173]
[0174] During iteration, the number of sampling times N should be large enough to satisfy always holds, which means that at least one rare event occurs in each iteration. Since L i (x)>0 always holds, so we have:
[0175]
[0176] When Ψ'(λ) = 0, according to the above two equations, we can get:
[0177]
[0178] Therefore, the monotonicity of the function at Ψ'(λ) = 0 is
[0179]
[0180] According to the above formula, it can be seen that there is a minimum value for the difference degree represented by Ψ(λ), and the λ corresponding to this minimum value is the optimal offset value of the importance distribution function when the KL divergence distance is the smallest, that is, the target offset value. During the iterative solution process, the mean value of g(x) will change continuously with the change of λ. Therefore, the iterative formula of λ can be expressed as:
[0181]
[0182] In the above formula, n is the index variable for summation, N represents the upper limit of summation, and i is the number of iterations. After obtaining the target offset value by iterating based on formula 31, the first distribution model can be offset based on the target offset value to obtain the second distribution model.
[0183] Implementing the embodiments of the present disclosure, based on a preset torsion parameter, performing exponential torsion on the first distribution model to obtain a transformed distribution model, determining the difference degree between the first distribution model and the transformed distribution model, determining the corresponding target offset value in the case of the smallest difference degree, and updating the first distribution model according to the target offset value. It is possible to determine a relatively accurate offset value, so that the distribution model after exponential transformation can be as close as possible to the optimal distribution model, thereby determining the second distribution model, and the subsequent data sampling process based on the second distribution model can be more accurate, improving the construction accuracy of the virtual test scenario.
[0184] Optionally, the step 304 of combining the scenario data in the multiple scenario data sets to construct a virtual test scenario includes:
[0185] Sub-step 3041: Based on the scenario data in each scenario data set, perform a complete permutation and combination to obtain virtual test scenarios including scenario data combinations;
[0186] Among them, any scenario data in any scenario data set has a combination relationship with any scenario data in other scenario data sets.
[0187] In the embodiments of the present disclosure, the scenario data in each scenario data set is data of the same type under the same scenario. For example, it is the initial relative distance in the following-the-vehicle scenario. Then the scenario data in one scenario data set can be multiple different initial relative distances, and other scenario data sets are similar.
[0188] The complete permutation and combination means that any scenario data in any scenario data set has a combination relationship with any scenario data in other scenario data sets.
[0189] For example, scenario data set A includes A1 and A2, scenario data set B includes B1 and B2, and scenario data set C includes C1 and C2. Then A1 needs to be combined with B1 and B2 respectively, and at the same time A1 needs to be combined with C1 and C2 respectively, and each combination obtained includes one scenario data from the three scenario data sets, and each virtual test scenario corresponds to one combination.
[0190] Implementing the embodiments of the present disclosure, by performing a complete permutation and combination based on the scenario data in each scenario data set, the scenario data for constructing virtual test scenarios is obtained. A large number of virtual test scenarios can be combined and constructed, and the large number of virtual test scenarios constructed can cover more test scenarios, thereby improving the efficiency and effectiveness of virtual testing.
[0191] Optionally, the method further includes:
[0192] Step 305: Determine the scenario data combination corresponding to each virtual test scenario and the scenario data in the scenario data combination;
[0193] Step 306: When there are the same preset number of scenario data in at least two scenario data combinations, delete at least one scenario data combination so that the number of scenario data combinations including the preset number of scenario data is one.
[0194] In the embodiments of the present disclosure, based on the scenario data of each scenario data set, complete permutations and combinations are performed, and the scenario data of the obtained virtual test scenarios are multiple. Then, the virtual test scenarios actually correspond to scenario data combinations, and there may be the same scenario data between different scenario data combinations, but the number of the same scenario data may be different. For example, there are three scenario data in the scenario data combination of each virtual test scenario, then there may be one or two same scenario data between two scenario data combinations.
[0195] In the case where the number of scenario data included in the scenario data combination is different, the specific value of the preset number may also be different. For example, if there are three scenario data in the scenario data combination, the preset number may be two.
[0196] Based on this, the scenario data in the scenario data combination of each virtual test scenario is determined. The same scenario data between the scenario data combinations can be 0, 1, 2, and so on. If there are two or more virtual test scenarios corresponding to the scenario data combinations in which there are the preset number of same scenario data at the same time, then at least one virtual test scenario corresponding to the scenario data combination can be deleted so that the number of scenario data combinations having the preset number of scenario data is one.
[0197] Figure 4 It is a schematic diagram of combining and deleting scenario data provided by the embodiments of the present disclosure; Figure 4 The input part 401 in represents taking the scenario data set A, the scenario data set B, and the scenario data set C as the inputs to be combined. The value range of the scenario data set A is represented by A1 and A2, indicating that it includes two scenario data, A1 and A2. The scenario data set B and the scenario data set C are similar. The combination part 402 is the scenario data combination obtained through complete permutations and combinations. Each scenario data combination is different from each other, but there are the same scenario data. The output part 403 is the scenario data combination after deletion. For example, the scenario data combination A1B1C2 has been deleted because there are two same scenario data between it and the scenario data combination A1B1C1. Other deleted scenario data combinations are similar.
[0198] Implementing the embodiments of the present disclosure, by determining the scenario data combination corresponding to each virtual test scenario and the scenario data used to construct the virtual test scenario in the scenario data combination, when there are the same preset number of scenario data in at least two scenario data combinations, deleting the scenario data combination corresponding to at least one virtual test scenario, so that the number of scenario data combinations including the preset number of scenario data is one. It is possible to, in the case of generating a large number of virtual test scenarios through complete permutation and combination, based on whether there are a preset number of identical scenario data, delete some scenario data combinations, reduce the number of test scenarios, and on the basis of having a high test coverage rate, reduce the test workload.
[0199] Optionally, each scenario data carries a scenario identifier; the method further includes:
[0200] Based on the virtual test scenario to be tested, determining the target scenario identifier of the virtual test scenario;
[0201] Based on the target scenario identifier, in the scenario data corresponding to the real driving scenario, selecting the scenario data with the target scenario identifier, and entering the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain the first distribution model.
[0202] In the embodiments of the present disclosure, even in different driving scenarios, there may be some scenario data of the same data type, such as common data such as the speed of the host vehicle and the speed of the preceding vehicle. Therefore, for these scenario data, when collecting scenario data, it is possible to identify the current driving scenario, and then when collecting the corresponding scenario data, a scenario identifier can be added to the scenario data.
[0203] When performing simulation testing, it may also be only necessary to test specific scenarios, so it is necessary to screen the scenario data. The target scenario identifier can be determined based on the virtual test scenario to be tested.
[0204] Then, based on the target scenario identifier, screen among a number of scenario data carrying the scenario identifier, select the scenario data with the target scenario identifier, and then perform distribution fitting on these scenario data.
[0205] Implementing the embodiments of the present disclosure, when the scenario data carries a scenario identifier, the target scenario identifier can be determined based on the virtual test scenario to be tested, and based on the target scenario identifier, select the scenario data with the target scenario identifier in the scenario data corresponding to the real driving scenario, which can screen out the key data that needs to be used, reduce the amount of data to be processed subsequently, perform fitting specifically, and thus improve the fitting efficiency.
[0206] Figure 5It is a schematic diagram of the generalization generation of a virtual test scenario provided by an embodiment of the present disclosure;
[0207] Step 501, obtain scenario data;
[0208] Step 502, fit the scenario data;
[0209] Step 503, obtain a probability distribution model, i.e., the first distribution model;
[0210] Step 504, perform importance sampling;
[0211] Step 505, solve the mean shift through cross-entropy;
[0212] Step 506, obtain an importance distribution model, i.e., the second distribution model;
[0213] Step 507, perform scenario data sampling based on the second distribution model;
[0214] Step 508, combine the data to generalize the scenario to obtain a virtual test scenario.
[0215] In view of the problem that the exposure rate of scenario data in actual data is low, resulting in low test efficiency, the present application proposes the generalization generation of dangerous scenarios based on importance probability sampling and combinatorial testing. By solving the shift of the importance function through the cross-entropy algorithm, the probability of sampling dangerous scenarios based on the importance probability distribution model (the second distribution model) is increased, improving the test efficiency. At the same time, combined with the combinatorial testing method, the sampled scenario data are combined pairwise to generate more dangerous scenarios for vehicle testing while ensuring the test coverage. Thus, it mainly has the following effects:
[0216] Significantly improve the test efficiency: Through the principle of importance sampling, more dangerous critical scenarios are generated targeted, greatly shortening the test time and facilitating the rapid iteration and update of the autonomous driving algorithm;
[0217] Enhance the test coverage: More comprehensive dangerous test scenarios can be generated, helping to discover potential safety hazards in the autonomous driving system;
[0218] Reduce the test cost: There is no need to rely on a large number of real vehicle tests, and the scenario test can be completed through virtual simulation, greatly reducing the test cost;
[0219] Enhance the safety: More comprehensive testing helps to discover potential safety hazards, providing a guarantee for the ultimate realization of safe and reliable autonomous driving vehicles.
[0220] Figure 6 It is a test scenario generation device provided by an embodiment of the present disclosure. The device 60 includes:
[0221] A distribution fitting module 601, which is used to perform distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model; the scenario data of different data types in different driving scenarios correspond to different first distribution models;
[0222] A model offset module 602, which is used to offset the first distribution model to update the first distribution model, and use the updated first distribution model as the second distribution model;
[0223] A data sampling module 603, which is used to perform sampling based on multiple second distribution models respectively to obtain a scenario data set corresponding to each second distribution model; the data types of the scenario data in the scenario data set are the same; the data types corresponding to different scenario data sets are different;
[0224] A scenario construction module 604, which is used to combine the scenario data in multiple scenario data sets to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
[0225] Optionally, the distribution fitting module includes:
[0226] A scenario division sub-module, which is used to divide the scenario data corresponding to the real driving scenario according to the scenario type to obtain the scenario data corresponding to different scenario types respectively;
[0227] A data division sub-module, which is used to divide the scenario data of each scenario type according to the data type to obtain the scenario data corresponding to different data types in different driving scenarios respectively;
[0228] A separate fitting sub-module, which is used to perform distribution fitting on the scenario data corresponding to different data types respectively to obtain a first distribution model corresponding to each data type.
[0229] Optionally, the model offset module includes:
[0230] An exponential torsion sub-module, which is used to perform exponential torsion on the first distribution model based on a preset torsion parameter to obtain a transformed distribution model; there is an offset between the first distribution model and the transformed distribution model;
[0231] A difference determination sub-module, which is used to determine the theoretical distribution model corresponding to the first distribution model, and determine the difference degree between the theoretical distribution model and the transformed distribution model; there is an associated relationship between the difference degree and the offset value of the offset;
[0232] A target offset sub-module, which is used to determine the corresponding target offset value when the difference degree is the smallest, and update the first distribution model according to the target offset value.
[0233] Optionally, the scenario construction module includes:
[0234] A permutation and combination sub-module, configured to perform a complete permutation and combination based on the scenario data in each scenario data set to obtain a virtual test scenario including a combination of scenario data;
[0235] Wherein, any scenario data in any scenario data set has a combination relationship with any scenario data in other scenario data sets.
[0236] Optionally, the apparatus further includes:
[0237] A data content module, configured to determine the scenario data combination corresponding to each virtual test scenario and the scenario data in the scenario data combination;
[0238] A scenario deletion module, configured to delete at least one scenario data combination when there are the same preset number of scenario data in at least two scenario data combinations, so that the number of scenario data combinations including the preset number of scenario data is one.
[0239] Optionally, each scenario data carries a scenario identifier; the apparatus further includes:
[0240] A target identifier module, configured to determine the target scenario identifier of the virtual test scenario based on the virtual test scenario to be measured;
[0241] A data screening module, configured to select the scenario data with the target scenario identifier from the scenario data corresponding to the real driving scenario based on the target scenario identifier, and enter the step of performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model.
[0242] In summary, in the embodiments of the present disclosure, by performing distribution fitting on the scenario data corresponding to the real driving scenario to obtain a first distribution model, the scenario data of different data types in different driving scenarios correspond to different first distribution models. For the first distribution model, an offset is performed to update and obtain a second distribution model. Based on multiple second distribution models, sampling is respectively performed to obtain a scenario data set corresponding to each second distribution model, and the scenario data in multiple scenario data sets are combined to construct a virtual test scenario. By offsetting the first distribution model of the original data and sampling based on the second distribution model obtained by the offset, more dangerous scenarios can be sampled, effectively increasing the occurrence probability of the scenario data of the dangerous scenarios, and further being able to meet the scenario data requirements of virtual testing and improving the virtual testing efficiency.
[0243] An embodiment of the present application further provides a test system, as Figure 7As shown, the test system 70 includes: a scenario generation subsystem 701 and a vehicle test subsystem 702;
[0244] The scenario generation subsystem 701 is used to execute the steps of the test scenario generation method in the above embodiments to construct a virtual test scenario;
[0245] The vehicle test subsystem 702 is used to perform a simulation test of the vehicle according to the virtual test scenario constructed by the scenario generation subsystem 701.
[0246] An embodiment of the present application also provides an electronic device, as Figure 8 shown, including a processor 1001, a communication interface 1002, a memory 1003, and a communication bus 1004. Among them, the processor 1001, the communication interface 1002, and the memory 1003 complete communication with each other through the communication bus 1004.
[0247] The memory 1003 is used to store a computer program.
[0248] When the processor 1001 is used to execute the program stored on the memory 1003, the steps in the above test scenario generation method are implemented, which will not be elaborated here.
[0249] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0250] The communication interface is used for communication between the above electronic device and other devices.
[0251] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0252] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU for short), a Network Processor (NP for short), etc.; it can also be a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuit (ASIC for short), a Field-Programmable Gate Array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0253] In another embodiment provided by the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and when the program is executed by a processor, the test scenario generation method described in the above embodiment is implemented.
[0254] In another embodiment provided by the present application, a computer program product containing instructions is further provided, and when it runs on a computer, the computer is caused to execute the test scenario generation method described in the above embodiment.
[0255] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server, data center, etc. that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).
[0256] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0257] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. For embodiments of a device, an electronic device, a computer-readable storage medium, and a computer program product including instructions, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.
[0258] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A test scenario generation method, characterized in that: The method comprises: For the scene data corresponding to the real driving scene, distribution fitting is performed to obtain a first distribution model; scene data of different data types in different driving scenes correspond to different first distribution models; For the first distribution model, offset is performed to update the first distribution model, and the updated first distribution model is used as the second distribution model; Based on the multiple second distribution models, sampling is performed respectively to obtain a scene data set corresponding to each second distribution model; the data types of the scene data in the scene data set are the same; and the data types corresponding to different scene data sets are different; The scene data in a plurality of scene data sets are combined to construct a virtual test scene; the virtual test scene is composed of different types of scene data; and the virtual test scene is used for vehicle testing.
2. The method according to claim 1, characterized in that The step of performing distribution fitting on the scene data corresponding to the real driving scene to obtain a first distribution model includes: According to the scene type, the scene data corresponding to the real driving scene is divided to obtain the scene data corresponding to different scene types; According to the data type, the scene data of each scene type is divided to obtain the scene data corresponding to different data types in different driving scenarios; Distribution fitting is performed on the scene data corresponding to different data types to obtain a first distribution model corresponding to each data type.
3. The method according to claim 1, characterized in that The step of performing an offset on the first distribution model to update the first distribution model comprises: Based on a preset twist parameter, exponentially twist the first distribution model to obtain a transformed distribution model; there is an offset between the first distribution model and the transformed distribution model; Determine a theoretical distribution model corresponding to the first distribution model, and determine the difference between the theoretical distribution model and the transformed distribution model; there is a correlation between the difference and the offset value of the offset; When the difference is minimal, a corresponding target offset value is determined, and the first distribution model is updated according to the target offset value.
4. The method according to claim 1, characterized in that: The step of combining the scene data in the plurality of scene data sets to construct a virtual test scene comprises: Based on the scene data in each scene data set, a complete permutation and combination is performed to obtain a virtual test scene including the scene data combination; Among them, any scene data in any scene data set has a combination relationship with any scene data in other scene data sets.
5. The method according to claim 4, characterized in that The method further comprises: Determine a scene data combination corresponding to each virtual test scene, and scene data in the scene data combination; In the case that the same preset number of scene data exists in at least two scene data combinations, at least one scene data combination is deleted so that the number of scene data combinations including the preset number of scene data is one.
6. The method according to claim 1, characterized in that Each scene data carries a scene identifier; the method further includes: Based on the virtual test scene to be tested, determining a target scene identifier of the virtual test scene; Based on the target scene identifier, the scene data having the target scene identifier is selected from the scene data corresponding to the real driving scene, and the step of performing distribution fitting on the scene data corresponding to the real driving scene to obtain a first distribution model is performed.
7. A test scenario generating device, characterized in that: The device comprises: A distribution fitting module, used for performing distribution fitting on scene data corresponding to a real driving scene to obtain a first distribution model; scene data of different data types in different driving scenes correspond to different first distribution models; A model shift module, configured to shift the first distribution model to update the first distribution model, and use the updated first distribution model as the second distribution model; A data sampling module, used for sampling respectively based on a plurality of second distribution models to obtain a scene data set corresponding to each second distribution model; the data types of the scene data in the scene data set are the same; and the data types corresponding to different scene data sets are different; The scenario construction module is used to combine scenario data in multiple scenario data sets to construct a virtual test scenario; the virtual test scenario is composed of different types of scenario data; the virtual test scenario is used for vehicle testing.
8. A testing system, characterized in that: The system comprises: Scenario generation subsystem, vehicle testing subsystem; The scenario generation subsystem is used to execute the steps in the test scenario generation method according to any one of claims 1 to 6 above to construct a virtual test scenario; The vehicle testing subsystem is used to perform a simulation test of a vehicle according to the virtual testing scenario constructed by the scenario generating subsystem.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the steps in the test scenario generation method as described in any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the test scenario generation method according to any one of claims 1 to 6 are implemented.