Test case generation method and device

By analyzing the feature contribution of the sound insulation prediction model and selecting key features for targeted sampling, the problem of many invalid test cases in vehicle sound insulation testing is solved, and the testing efficiency and accuracy are improved.

CN121577347APending Publication Date: 2026-02-27CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511572899.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing technologies, vehicle sound insulation testing requires the generation of a large number of test cases, which leads to an increase in invalid test cases and affects testing efficiency.

Method used

The contribution of each feature to the prediction result is determined by the trained sound insulation prediction model. Key features are selected and targeted sampling is performed within their sampling intervals, while non-key features are randomly sampled to generate test cases.

Benefits of technology

Reduce the generation of invalid test cases, improve the efficiency of vehicle sound insulation testing, and accurately identify potential sound insulation defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121577347A_ABST
    Figure CN121577347A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle testing, and provides a test case generation method and device. The method comprises the following steps: according to a trained sound insulation prediction model, determining the contribution degree of each feature forming a training sample to a prediction result of the sound insulation prediction model; according to the contribution degree of each feature, determining at least one key feature from each feature; determining a sampling interval corresponding to the key feature according to a selected test scene; and sampling the key features in the sampling interval, and randomly sampling each non-key feature to obtain a test case of the test scene. According to the test case generation method provided by the embodiment of the invention, invalid test cases can be reduced, and the test efficiency of a vehicle sound insulation test is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle testing technology, specifically to a test case generation method and apparatus. Background Technology

[0002] In-vehicle sound insulation performance is one of the key indicators for measuring vehicle ride comfort, directly affecting the driving and riding experience of passengers. Therefore, sound insulation testing is usually required for vehicles.

[0003] In related technologies, vehicle sound insulation testing is conducted by collecting feature parameters of various characteristics that may affect the vehicle's sound insulation performance to form test cases. These test cases are then used to test the vehicle's sound insulation performance under a specific test scenario. However, this method requires generating a large number of test cases, some of which are invalid and fail to reflect the vehicle's sound insulation performance, thus affecting the efficiency of vehicle sound insulation testing. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in related technologies. To this end, this application proposes a test case generation method that can reduce invalid test cases and improve the testing efficiency of vehicle sound insulation testing.

[0005] The test case generation method according to the first aspect of this application includes: Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model. Based on the contribution of each of the stated features, at least one key feature is determined from the stated features; Based on the selected test scenario, determine the sampling interval corresponding to the key feature; The key features are sampled in the sampling interval, and the non-key features are randomly sampled to obtain the test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0006] By using a trained sound insulation prediction model, the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model is determined. Based on the contribution of each feature, at least one key feature is identified. Then, according to the selected test scenario, the sampling interval corresponding to the key feature is determined. The key feature is sampled within the sampling interval, while non-key features are randomly sampled to obtain test cases for the test scenario. This approach introduces contribution analysis to accurately locate key features and perform targeted sampling within their important sampling intervals. For non-key features with low contribution, more efficient random sampling is used, avoiding the blind generation of test cases. This allows for more efficient discovery of potential sound insulation defects with fewer test cases, effectively reducing the generation of invalid test cases and improving the overall efficiency of vehicle sound insulation testing.

[0007] According to one embodiment of this application, based on a trained sound insulation prediction model, the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model is determined, including: Based on the loss function of the sound insulation prediction model and the value distribution of any of the features in each of the training samples, the contribution of the feature to the prediction result of the sound insulation prediction model is determined.

[0008] According to one embodiment of this application, the contribution includes: ; in, Let f represent the data value of feature f in the i-th training sample, and L represent the loss function.

[0009] According to one embodiment of this application, the key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain test cases for the test scenario, including: The key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain a multi-dimensional vector representing each feature; Based on the multidimensional vector and the simulated defect parameters, test cases for the test scenario are obtained; The simulated defect parameters are determined based on the simulated sound insulation defects of the vehicle.

[0010] According to one embodiment of this application, it also includes: The maximum predicted probability of each test case in the test scenario is obtained through the sound insulation prediction model. The test priority of each test case is determined based on the maximum predicted probability of each test case. The maximum predicted probability of a test case is positively correlated with the test priority of the test case.

[0011] According to one embodiment of this application, it also includes: Based on the test priority of each of the test cases, at least one optional test case is determined from each of the test cases to perform the sound insulation test of the vehicle.

[0012] According to one embodiment of this application, it also includes: Obtain the feature values ​​representing vehicle characteristics in the test cases; Based on the aforementioned feature values, the target vehicle for executing the test cases is determined.

[0013] According to one embodiment of this application, determining the target vehicle for executing the test case based on each of the stated feature values ​​includes: Based on each of the aforementioned feature values, the vehicle model feature vector corresponding to the test case is obtained; Based on the similarity between the vehicle model feature vector corresponding to the test case and the actual vehicle model feature vector of any vehicle, the test matching degree between the test case and the vehicle is determined. Once the test matching degree is determined to reach a preset matching degree, the vehicle is identified as the target vehicle for executing the test case. The actual vehicle model feature vector is determined based on the feature values ​​of each vehicle model.

[0014] The test case generation apparatus according to the second aspect of this application includes: The prediction contribution analysis module is used to determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model based on the trained sound insulation prediction model. A key feature determination module is used to determine at least one key feature from the features based on the contribution of each of the features; The sampling interval determination module is used to determine the sampling interval corresponding to the key feature based on the selected test scenario; The test case generation module is used to sample the key features in the sampling interval and randomly sample each non-key feature to obtain test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0015] An electronic device according to a third aspect of this application includes a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the test case generation method described in any of the above embodiments.

[0016] A computer-readable storage medium according to a fourth aspect of this application stores a computer program thereon, which, when executed by a processor, implements the test case generation method described in any of the above embodiments.

[0017] A computer program product according to a fifth aspect of this application has a computer program stored thereon, which, when executed by a processor, implements the test case generation method as described in any of the above embodiments. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a first flowchart illustrating the test case generation method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the test case generation device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The test case generation method and apparatus provided in this application will be described in detail and explained below through several specific embodiments.

[0022] In-vehicle sound insulation performance is one of the key indicators for measuring vehicle ride comfort, directly affecting the driving and riding experience. Good sound insulation performance can effectively reduce the amount of external noise entering the vehicle, creating a quiet and comfortable in-vehicle environment, reducing driver fatigue, and improving driving safety. Therefore, sound insulation testing is usually required for vehicles to facilitate targeted improvements to their sound insulation performance.

[0023] In related technologies, vehicle sound insulation testing is conducted by collecting characteristic parameters that may affect the vehicle's sound insulation performance, such as environmental parameters, vehicle speed, and engine speed, to form test cases. These test cases are then used to test the vehicle's sound insulation performance under a specific test scenario. However, this method requires generating a large number of test cases, some of which are invalid and fail to reflect the vehicle's sound insulation performance, thus affecting the efficiency of vehicle sound insulation testing.

[0024] To address the aforementioned technical issues, this application's embodiments determine the contribution of each feature constituting the training sample to the prediction results of the sound insulation prediction model based on a trained sound insulation prediction model. Based on the contribution of each feature, at least one key feature is identified. Then, according to the selected test scenario, the sampling interval corresponding to the key feature is determined. The key feature is sampled within the sampling interval, while non-key features are randomly sampled to obtain test cases for the test scenario. This approach introduces contribution analysis to accurately locate key features and performs targeted sampling within their important sampling intervals. For non-key features with low contribution, more efficient random sampling is used, avoiding the blind generation of test cases. This allows for more efficient discovery of potential sound insulation defects with fewer test cases, effectively reducing the generation of invalid test cases and improving the overall efficiency of vehicle sound insulation testing.

[0025] According to some embodiments of this application, this application provides a test case generation method. This method can be applied to a terminal device to generate test cases for the sound insulation performance of a test vehicle. The terminal device may include an in-vehicle terminal, a desktop terminal, a mobile terminal, or a server. The server can be a standalone server or a server cluster composed of multiple servers. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence sampling point devices.

[0026] like Figure 1 As shown, the test case generation method provided in this embodiment includes: S101, Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model. S102, Based on the contribution of each of the said features, determine at least one key feature from the said features; S103, Based on the selected test scenario, determine the sampling interval corresponding to the key feature; S104, the key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain test cases for the test scenario; The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0027] In some embodiments, the features constituting the training samples may include environmental features, vehicle model features, and state features. Environmental features may include temperature and humidity, vehicle model features may include vehicle type, material, and structure, and state features may include sound pressure level (SPL), frequency response curve, vehicle speed, and engine speed. Collecting the data values ​​of each feature constitutes the training samples. Each training sample has the same number and type of features; for example, any training sample consists of data values ​​for temperature, humidity, vehicle model, material, structure, sound pressure level, frequency response curve, vehicle speed, and engine speed.

[0028] Since the features include both numerical and non-numerical features—such as temperature, humidity, sound pressure level, frequency response curve, vehicle speed, and engine speed being numerical features, and vehicle type, material, and structure being non-numerical features—to facilitate the processing of training samples, numerical features can be normalized to a range between [0, 1]. That is:

[0029] Where x represents the original sampled data of a certain data type feature, i.e., the original data that needs to be normalized. It is the minimum value in the dataset sampled for this data type feature. The maximum value in the dataset sampled for this data type feature. The normalized data values ​​of the original sampled data for this data type feature are mapped to the range of [0,1].

[0030] For non-numerical features, such as vehicle type, material, and structure, one-hot encoding can be used to transform the sampling of non-numerical features into a form that is easier for machine learning algorithms to process. For example, vehicle types include categories such as "sedan," "SUV," "truck," and "MPV," and materials include categories such as "rubber," "plastic," and "metal." A new binary feature is created for each category. For instance, for the vehicle type feature, if there are three categories, three new features will be created, such as "vehicle type_sedan," "vehicle type_SUV," and "vehicle type_truck." Then, for each category, i.e., each sampled data point of the non-numerical feature, a corresponding binary code is created to obtain the data value corresponding to each sampled data point of the non-numerical feature.

[0031] After sampling each feature, the samples of numerical features are normalized, and the samples of non-numerical features are one-hot encoded to obtain the data values ​​of each feature, which can then form training samples. For example, the training samples could be {temperature: x1; humidity: x2; vehicle type: x3; material: x4; structure: x5; sound pressure level: x6; frequency response curve: x7; vehicle speed: x8; engine speed: x9; ...}.

[0032] For each training sample, the sound insulation effect under different training samples can be pre-determined through numerous experiments, and the corresponding sound insulation effect can be labeled for each training sample. The training samples are then annotated to determine the true label for each sample. For example, if there are four levels of sound insulation effect: excellent, good, average, and poor, then if the sound insulation effect of a training sample is excellent, it is labeled as 1; good as 2; average as 3; and poor as 4. This allows the sound insulation prediction model to be trained using training samples with different levels of sound insulation effect.

[0033] In some embodiments, the sound insulation prediction model can choose BERT (Bidirectional Encoder Representations from Transformers) as the base model, and add a fully connected layer for sound insulation effect prediction on top of BERT. The role of the fully connected layer is to map the features output by BERT to the output space required for the sound insulation effect prediction task.

[0034] In some embodiments, the sound insulation prediction model can be trained using a cross-entropy loss function. The cross-entropy loss function is:

[0035] Where N represents the number of training samples; C represents the number of sound insulation levels. If the sound insulation level includes four levels: excellent, good, average, and poor, then C=4. This represents the true label of the i-th sample. Let c represent the predicted probability of the sound insulation effect of the i-th training sample as grade c.

[0036] The Adam optimization algorithm is used to update the model parameters:

[0037] Where η is the learning rate. and These are the estimated values ​​for momentum and variance, respectively.

[0038] During the training of the sound insulation prediction model using input training samples, the model calculates the prediction probability based on the input training samples and then calculates the error between the prediction result and the true label using a loss function. Next, an optimization algorithm is used to adjust the parameters of the sound insulation prediction model based on the error, including some parameters of the BERT model and the parameters of the newly added fully connected layer, to minimize the loss function value. Through continuous iteration of this process, the sound insulation prediction model gradually learns the mapping relationship from training samples to predicted sound insulation effects, until the predicted probability obtained from each input training sample and the true label of that training sample, i.e., the actual sound insulation effect, meet preset conditions. For example, if the maximum predicted probability obtained from the input training sample corresponds to the true label of the training sample, and the maximum predicted probability is greater than a preset probability, such as 80%, then the sound insulation prediction model is complete, and the trained sound insulation prediction model is obtained.

[0039] For a well-trained sound insulation prediction model, it can be used to analyze each training sample in order to calculate the contribution of each feature of the training sample to the prediction result of the sound insulation prediction model.

[0040] The contribution of each feature to the prediction results of the sound insulation prediction model can be calculated using methods such as SHAP (SHapley Additive exPlanations) or LIME (Local Interpretable Model-agnostic Explanations).

[0041] For each feature in the training samples, features with a contribution greater than a preset contribution can be identified as key features; alternatively, the feature with the highest contribution among all features can be identified as a key feature. Meanwhile, all other features besides key features are identified as non-key features.

[0042] In some embodiments, sampling intervals for different features in different test scenarios can be preset for each feature when it is designated as a key feature. For example, when vehicle speed is preset as a key feature, the sampling intervals for vehicle speed in two different test scenarios—high-speed cruising and urban congestion—are as follows: High-speed cruising: vehicle speed > 100 km / h; Urban congestion: vehicle speed < 50 km / h.

[0043] When it is necessary to generate test cases for a certain test scenario, after determining the key features, the sampling interval corresponding to the key features can be determined according to the selected test scenario.

[0044] After determining the sampling intervals corresponding to each key feature, sampling can be performed on the key feature within its corresponding sampling interval. For example, Latin hypercube sampling can be used for key features within their corresponding sampling intervals. Simultaneously, random sampling can be performed on non-key features, such as using Latin hypercube sampling or natural sampling. The sampled values ​​of different features are then randomly combined to generate N different parameter combinations, resulting in N sets of multidimensional vectors. These N sets of vectors can then be used as N test cases for the test scenario. For example:

[0045] X represents a multidimensional vector, x d This represents the sampled value of the d-th feature.

[0046] By using a trained sound insulation prediction model, the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model is determined. Based on the contribution of each feature, at least one key feature is identified. Then, according to the selected test scenario, the sampling interval corresponding to the key feature is determined. The key feature is sampled within the sampling interval, while non-key features are randomly sampled to obtain test cases for the test scenario. This approach introduces contribution analysis to accurately locate key features and perform targeted sampling within their important sampling intervals. For non-key features with low contribution, more efficient random sampling is used, avoiding the blind generation of test cases. This allows for more efficient discovery of potential sound insulation defects with fewer test cases, effectively reducing the generation of invalid test cases and improving the overall efficiency of vehicle sound insulation testing.

[0047] To more accurately determine the contribution of each feature to the prediction result, in some embodiments, based on the trained sound insulation prediction model, the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model is determined, including: Based on the loss function of the sound insulation prediction model and the value distribution of any of the features in each of the training samples, the contribution of the feature to the prediction result of the sound insulation prediction model is determined.

[0048] In some embodiments, the loss function of the sound insulation prediction model and the value distribution of any feature in each training sample can be obtained, that is, the data value of any feature in each training sample. The loss function and the data value of any feature in each training sample are then used to perform contribution analysis using SHAP to determine the contribution of any feature to the prediction result of the sound insulation prediction model.

[0049] Alternatively, in some embodiments, the contribution includes: ; in, Let f represent the data value of feature f in the i-th training sample, and L represent the loss function of the sound insulation prediction model.

[0050] By substituting the loss function L of the sound insulation prediction model and the data value of any feature f in each training sample into the above formula, the contribution of feature f can be obtained. Based on the contribution of each feature, key features and non-key features can be determined.

[0051] Considering that vehicles may have certain sound insulation defects in practical applications, such as poor sealing or material aging, in order to enable the generated test cases to test the sound insulation effect of vehicles under certain sound insulation defects, in some embodiments, the key features are sampled in the sampling interval, and non-key features are randomly sampled to obtain test cases for the test scenario, including: The key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain a multi-dimensional vector representing each feature; Based on the multidimensional vector and the simulated defect parameters, test cases for the test scenario are obtained; The simulated defect parameters are determined based on the simulated sound insulation defects of the vehicle.

[0052] In some embodiments, for different sound insulation defects in a vehicle, corresponding simulated defect parameters can be pre-configured. For example, to simulate a poor seal, the parameters related to sealing can be pre-adjusted to set the simulated defect parameter δ corresponding to this poor seal sound insulation defect.

[0053] In the process of sampling various features to generate test cases, key features can be sampled within the sampling interval, while non-key features can be randomly sampled to obtain a multi-dimensional vector representing each feature:

[0054] For the obtained multidimensional vector, a defect parameter vector can be generated by introducing the simulated defect parameter δ. Based on the defect parameter vector, test cases for the test scenario are determined. For example, the defect parameter vector is used as the test cases for the test scenario. By introducing simulated defect parameters corresponding to the vehicle's sound insulation defects, test cases simulating sound insulation defects are generated. These generated test cases can be used to test the sound insulation effect of the vehicle under certain sound insulation defects, making the vehicle's sound insulation testing more targeted and further improving the efficiency of vehicle sound insulation testing.

[0055] Considering that different test instances may have different testing priorities, in order to better determine the testing priorities of test instances, prioritize testing of test instances that require more attention, and improve the testing efficiency of sound insulation testing, in some embodiments, the method further includes: The maximum predicted probability of each test case in the test scenario is obtained through the sound insulation prediction model. The test priority of each test case is determined based on the maximum predicted probability of each test case. The maximum predicted probability of a test case is positively correlated with the test priority of the test case.

[0056] In some embodiments, for any test case, it can be input into the sound insulation prediction model to obtain multiple prediction probabilities p corresponding to that test case. i,c For example, predict the probabilities of sound insulation effects of excellent, good, average, and poor for the test case, and use p test =max(p i,c From the multiple predicted probabilities corresponding to the test case, determine the maximum predicted probability of the test case. This allows us to obtain the maximum predicted probability for each test case.

[0057] Based on the maximum predicted probability of each test case, each test case can be sorted from highest to lowest according to its maximum predicted probability, resulting in a priority ranking for each test case. The higher the maximum predicted probability of a test case, the higher its priority ranking, indicating that the sound insulation prediction model considers it more worthy of attention or more likely to cause problems, thus assigning it a higher test priority. This allows for better determination of test instance priority, prioritizing the testing of more critical instances and improving the efficiency of sound insulation testing.

[0058] To further improve testing efficiency, in some embodiments, the method further includes: Based on the test priority of each of the test cases, at least one optional test case is determined from each of the test cases to perform the sound insulation test of the vehicle.

[0059] In some embodiments, after determining the test priority of each test case, test cases with a test priority higher than a preset test priority can be extracted from the test cases and determined as optional test cases for performing vehicle sound insulation tests. The preset test priority can be set according to actual conditions, or the top N test cases in terms of test priority can be extracted from the test cases and determined as optional test cases for performing vehicle sound insulation tests. For example, the top 10 test cases in terms of test priority can be extracted as optional test cases for performing vehicle sound insulation tests. This allows the vehicle sound insulation test to focus more on test cases that have a high probability of reflecting sound insulation performance, further reducing invalid tests and thus further improving test efficiency.

[0060] Considering that different vehicle models may have different testing requirements, in order to further improve testing efficiency, in some embodiments the method further includes: Also includes: Obtain the feature values ​​representing vehicle characteristics in the test cases; Based on the aforementioned feature values, the target vehicle for executing the test cases is determined.

[0061] In some embodiments, for any test case, the feature values ​​used to characterize the vehicle model characteristics in that test case can be obtained. These vehicle model characteristics may include the vehicle's model number, size, material, and structure, etc.

[0062] Meanwhile, for different types of vehicles, such as SUVs, sedans, MPVs, and trucks, the characteristic values ​​of each vehicle type can be obtained in advance, such as the vehicle model, size, material, and structure. Vehicles with the same characteristic values ​​are grouped into the same category, and the characteristic values ​​of each vehicle type in that category are recorded to obtain a record table containing the characteristic values ​​of each vehicle type for each category.

[0063] After obtaining the feature values ​​used to characterize vehicle features in the test cases, the record table can be traversed using these feature values ​​to identify vehicles of a certain category whose feature values ​​match those of the vehicle models. These vehicles are then designated as the target vehicles for executing the test cases. This makes the sound insulation testing more targeted and improves testing efficiency.

[0064] In some embodiments, determining the target vehicle for executing the test case based on each of the aforementioned feature values ​​may also include: Based on each of the aforementioned feature values, the vehicle model feature vector corresponding to the test case is obtained; Based on the similarity between the vehicle model feature vector corresponding to the test case and the actual vehicle model feature vector of any vehicle, the test matching degree between the test case and the vehicle is determined. Once the test matching degree is determined to reach a preset matching degree, the vehicle is identified as the target vehicle for executing the test case. The actual vehicle model feature vector is determined based on the feature values ​​of each vehicle model. For example, for any test case, the feature values ​​representing vehicle model characteristics can be obtained, and these feature values ​​can be combined and represented as a vector to obtain the vehicle model feature vector corresponding to the test case. If the feature values ​​representing vehicle model characteristics are x3, x4, and x5, then the vehicle model feature vector corresponding to the test case can be x'=[x3,x4,x5]. Similarly, for the vehicle model feature values ​​of a certain category of vehicles, they can be combined and represented as a vector to obtain the actual vehicle model feature vector y for that category of measurement.

[0065] After obtaining the vehicle model feature vector x' corresponding to the test case and the actual vehicle model feature vector of any vehicle, the cosine similarity formula can be used. The similarity between the vehicle model feature vector x' corresponding to the test case and the actual vehicle model feature vector is calculated. This similarity is then used to determine the test case's matching degree with the vehicle. If the matching degree reaches a preset matching degree, such as 80% or other preset matching degrees set according to actual conditions, it indicates that the test case is specifically designed for this type of vehicle for sound insulation testing and is more likely to reflect the sound insulation effect of this type of vehicle in actual use. In this case, the vehicle can be identified as the target vehicle for executing the test case. This makes the sound insulation test more targeted and improves testing efficiency.

[0066] The test case generation apparatus provided in this application is described below. The test case generation apparatus described below and the test case generation method described above can be referred to in correspondence.

[0067] In one embodiment, such as Figure 2 As shown, a test case generation device is provided, comprising: The prediction contribution analysis module 210 is used to determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model based on the trained sound insulation prediction model. The key feature determination module 220 is used to determine at least one key feature from the features based on the contribution of each feature; The sampling interval determination module 230 is used to determine the sampling interval corresponding to the key feature based on the selected test scenario; The test case generation module 240 is used to sample the key features in the sampling interval and randomly sample each non-key feature to obtain test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0068] By using a trained sound insulation prediction model, the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model is determined. Based on the contribution of each feature, at least one key feature is identified. Then, according to the selected test scenario, the sampling interval corresponding to the key feature is determined. The key feature is sampled within the sampling interval, while non-key features are randomly sampled to obtain test cases for the test scenario. This approach introduces contribution analysis to accurately locate key features and perform targeted sampling within their important sampling intervals. For non-key features with low contribution, more efficient random sampling is used, avoiding the blind generation of test cases. This allows for more efficient discovery of potential sound insulation defects with fewer test cases, effectively reducing the generation of invalid test cases and improving the overall efficiency of vehicle sound insulation testing.

[0069] In one embodiment, the prediction contribution analysis module 210 is specifically used for: Based on the loss function of the sound insulation prediction model and the value distribution of any of the features in each of the training samples, the contribution of the feature to the prediction result of the sound insulation prediction model is determined.

[0070] In one embodiment, the contribution includes: ; in, Let f represent the data value of feature f in the i-th training sample, and L represent the loss function.

[0071] In one embodiment, the test case generation module 240 is specifically used for: The key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain a multi-dimensional vector representing each feature; Based on the multidimensional vector and the simulated defect parameters, test cases for the test scenario are obtained; The simulated defect parameters are determined based on the simulated sound insulation defects of the vehicle.

[0072] In one embodiment, the test case generation module 240 is further configured to: The maximum predicted probability of each test case in the test scenario is obtained through the sound insulation prediction model. The test priority of each test case is determined based on the maximum predicted probability of each test case. The maximum predicted probability of a test case is positively correlated with the test priority of the test case.

[0073] In one embodiment, the test case generation module 240 is further configured to: Based on the test priority of each of the test cases, at least one optional test case is determined from each of the test cases to perform the sound insulation test of the vehicle.

[0074] In one embodiment, the test case generation module 240 is further configured to: Obtain the feature values ​​representing vehicle characteristics in the test cases; Based on the aforementioned feature values, the target vehicle for executing the test cases is determined.

[0075] In one embodiment, the test case generation module 240 is specifically used for: Based on each of the aforementioned feature values, the vehicle model feature vector corresponding to the test case is obtained; Based on the similarity between the vehicle model feature vector corresponding to the test case and the actual vehicle model feature vector of any vehicle, the test matching degree between the test case and the vehicle is determined. Once the test matching degree is determined to reach a preset matching degree, the vehicle is identified as the target vehicle for executing the test case. The actual vehicle model feature vector is determined based on the feature values ​​of each vehicle model.

[0076] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call a computer program in the memory 830 to execute a test case generation method, such as including: Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model. Based on the contribution of each of the stated features, at least one key feature is determined from the stated features; Based on the selected test scenario, determine the sampling interval corresponding to the key feature; The key features are sampled in the sampling interval, and the non-key features are randomly sampled to obtain the test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0077] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] On the other hand, embodiments of this application also provide a storage medium, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the test case generation methods provided in the above embodiments, such as including: Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model. Based on the contribution of each of the stated features, at least one key feature is determined from the stated features; Based on the selected test scenario, determine the sampling interval corresponding to the key feature; The key features are sampled in the sampling interval, and the non-key features are randomly sampled to obtain the test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A test case generation method, characterized in that, include: Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model. Based on the contribution of each of the stated features, at least one key feature is determined from the stated features; Based on the selected test scenario, determine the sampling interval corresponding to the key feature; The key features are sampled in the sampling interval, and the non-key features are randomly sampled to obtain the test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

2. The test case generation method according to claim 1, characterized in that, Based on the trained sound insulation prediction model, determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model, including: Based on the loss function of the sound insulation prediction model and the value distribution of any of the features in each of the training samples, the contribution of the feature to the prediction result of the sound insulation prediction model is determined.

3. The test case generation method according to claim 2, characterized in that, The contributions include: ; in, Let f represent the data value of feature f in the i-th training sample, and L represent the loss function.

4. The test case generation method according to claim 1, characterized in that, The key features are sampled within the sampling interval, and non-key features are randomly sampled to obtain test cases for the test scenario, including: The key features are sampled in the sampling interval, and each non-key feature is randomly sampled to obtain a multi-dimensional vector representing each feature; Based on the multidimensional vector and the simulated defect parameters, test cases for the test scenario are obtained; The simulated defect parameters are determined based on the simulated sound insulation defects of the vehicle.

5. The test case generation method according to any one of claims 1-4, characterized in that, Also includes: The maximum predicted probability of each test case in the test scenario is obtained through the sound insulation prediction model. The test priority of each test case is determined based on the maximum predicted probability of each test case. The maximum predicted probability of a test case is positively correlated with the test priority of the test case.

6. The test case generation method according to claim 5, characterized in that, Also includes: Based on the test priority of each of the test cases, at least one optional test case is determined from each of the test cases to perform the sound insulation test of the vehicle.

7. The test case generation method according to any one of claims 1-4, characterized in that, Also includes: Obtain the feature values ​​representing vehicle characteristics in the test cases; Based on the aforementioned feature values, the target vehicle for executing the test cases is determined.

8. The test case generation method according to claim 7, characterized in that, Based on the aforementioned feature values, the target vehicle for executing the test cases is determined, including: Based on each of the aforementioned feature values, the vehicle model feature vector corresponding to the test case is obtained; Based on the similarity between the vehicle model feature vector corresponding to the test case and the actual vehicle model feature vector of any vehicle, the test matching degree between the test case and the vehicle is determined. Once the test matching degree is determined to reach a preset matching degree, the vehicle is identified as the target vehicle for executing the test case. The actual vehicle model feature vector is determined based on the feature values ​​of each vehicle model.

9. A test case generation device, characterized in that, include: The prediction contribution analysis module is used to determine the contribution of each feature constituting the training sample to the prediction result of the sound insulation prediction model based on the trained sound insulation prediction model. A key feature determination module is used to determine at least one key feature from the features based on the contribution of each of the features; The sampling interval determination module is used to determine the sampling interval corresponding to the key feature based on the selected test scenario; The test case generation module is used to sample the key features in the sampling interval and randomly sample each non-key feature to obtain test cases for the test scenario. The sound insulation prediction model is obtained by training each of the training samples, and the non-key features are the features other than the key features among the features.

10. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the test case generation method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.

12. A computer program product, characterized in that, It stores a computer program thereon, which, when executed by a processor, implements the method described in any one of claims 1 to 8.