Scene generalization method, device and system for cockpit test cases
By training a scenario generalization model based on a cockpit testing knowledge graph, test cases for various scenarios are automatically generated, solving the problem of low automation in existing cockpit testing and achieving a comprehensive and efficient testing method.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-09
AI Technical Summary
In the current cockpit testing process, test cases need to be written manually, resulting in low automation and insufficient test coverage. This leads to numerous problems caused by rapid vehicle iterations and frequent version releases, resulting in a huge workload for testing and making it difficult to fully cover cockpit performance.
A generalized model for training scenarios based on a cockpit testing knowledge graph is used to generate multiple generalized test cases. Test cases for combined, boundary, exception, and simulated scenarios are automatically generated using a data-driven approach. The model is then optimized by combining supervised learning and reinforcement learning to improve coverage.
By adopting a data-driven scenario generalization approach, the coverage and efficiency of cockpit testing have been significantly improved. The coverage dimension has expanded from a single scenario to the entire scenario, the boundary coverage has shifted from experience-driven to data-driven, and version adaptation has gone from lagging to synchronous, thereby improving the quality of software delivery.
Smart Images

Figure CN122173403A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent driving technology, and in particular to a method, apparatus and system for generalizing cockpit test cases. Background Technology
[0002] Currently, throughout the entire cockpit testing cycle, test cases still require manual writing, manual labeling of test elements, and manual reference to interface documentation to write test scripts. During test execution, test management tools automatically execute test scripts in only 50% of cases and automatically record test results in only 70%. In the evaluation and analysis phase, test results are evaluated and analyzed semi-automatically, with a combination of manual and semi-automatic methods. Due to rapid vehicle iteration, short development cycles, and frequent version iterations, cockpit testing suffers from numerous problems, an explosive increase in test case scenario dimensions, insufficient test case samples, a massive testing workload, and difficulty in exposing cockpit performance issues. Summary of the Invention
[0003] The purpose of this application is to provide a method, device, and system for scenario generalization of cockpit test cases. It applies a scenario generalization model trained based on a cockpit test knowledge graph to generalize test cases to different scenarios, thereby increasing the test case sample library, comprehensively covering test dimensions, and improving software delivery quality.
[0004] Firstly, this application provides a scenario generalization method for cockpit test cases. The method includes: constructing a cockpit test knowledge graph based on basic data related to cockpit testing; training a scenario generalization model based on the cockpit test knowledge graph, and generating multiple generalized test cases under a specified scenario through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, simulated scenario, and abnormal scenario; performing preset verification on the multiple generalized test cases to determine multiple executable generalized test cases; executing the multiple executable generalized test cases, and updating the cockpit test knowledge graph or scenario generalization model based on the execution results and the steps of generating multiple generalized test cases under the specified scenario are continued until the preset indicator parameters meet the preset requirements.
[0005] Furthermore, the aforementioned basic data includes: functional documents, historical data, and user interaction logs; historical data includes historical cockpit test cases and fault data; functional documents include cockpit module interface definitions and business rule information; based on the basic data related to cockpit testing, the steps for constructing a cockpit testing knowledge graph include: standardizing the basic data related to cockpit testing to obtain structured data; wherein, the standardization process includes: data cleaning, data annotation, and data structuring; based on the structured data, entity extraction and relationship construction are performed to generate the cockpit testing knowledge graph.
[0006] Furthermore, the steps for training the scenario generalization model based on the cockpit test knowledge graph include: training the scenario generalization model using a combination of supervised learning and reinforcement learning based on the cockpit test knowledge graph.
[0007] Furthermore, the steps described above for generating multiple generalized test cases under a specified scenario through a scenario generalization model include: based on the cockpit test knowledge graph, performing the following steps: automatically generating generalized test cases under multi-module linkage scenarios through module interaction rule learning; automatically expanding the value range of input parameters through parameter boundary analysis to generate multiple generalized test cases under boundary scenarios; summarizing abnormal triggering patterns based on historical defect data through fault mode learning to generate multiple generalized test cases under abnormal scenarios; and generating multiple generalized test cases under simulated scenarios through user operation timing learning.
[0008] Furthermore, the aforementioned pre-defined verification includes logical verification and redundancy verification; pre-defined verification is performed on multiple generalized use cases to determine the steps of multiple executable generalized use cases, including: checking the feasibility of the corresponding steps of multiple generalized use cases based on the cockpit system interface specification to complete logical verification; and comparing multiple external generalized use cases with historical use cases through a use case similarity algorithm to eliminate highly similar use cases to complete redundancy verification.
[0009] Furthermore, the steps of executing multiple executable generalized use cases and statistically analyzing preset indicator parameters based on the execution results include: executing multiple executable generalized use cases in a simulation platform or a real vehicle, or using an automated script to execute multiple executable generalized use cases in batches, and determining the execution results corresponding to each of the multiple executable generalized use cases; statistically analyzing preset indicator parameters based on the execution results corresponding to each of the multiple executable generalized use cases; the preset indicator parameters include at least one of the following: function point coverage rate, scenario coverage rate.
[0010] Furthermore, the steps described above for updating the cockpit test knowledge graph or scenario generalization model based on the execution results include: if the generalized test case fails to execute and a new defect is discovered, the scenario corresponding to the generalized test case is marked as a valid coverage scenario and added to the cockpit test knowledge graph to enhance the model's ability to generalize to similar scenarios; if the generalized test case passes to execute and is a redundant verification item, the reward function of the scenario generalization model is adjusted to reduce the generation of similar scenarios.
[0011] Secondly, this application also provides a scenario generalization device for cockpit test cases. The device includes: a graph construction module for constructing a cockpit test knowledge graph based on basic data related to cockpit testing; a model training and test case generation module for training a scenario generalization model based on the cockpit test knowledge graph and generating multiple generalized test cases under a specified scenario through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, simulated scenario, and abnormal scenario; a test case verification module for performing preset verification on multiple generalized test cases to determine multiple executable generalized test cases; and a test case execution and feedback module for executing multiple executable generalized test cases, and updating the cockpit test knowledge graph or scenario generalization model based on the execution results, and continuing to execute the step of generating multiple generalized test cases under the specified scenario until the preset indicator parameters meet the preset requirements.
[0012] Thirdly, this application also provides a scenario generalization system for cockpit test cases. The system includes a server, a test terminal, a data acquisition device, and a storage device. The data acquisition device is used to collect user interaction and environmental data. The storage device is used to store logs, training data, and model files. The test terminal is used to execute test cases. The server is used to execute the method described in the first aspect.
[0013] Fourthly, this application also provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in the first aspect above.
[0014] The cockpit test case scenario generalization method, apparatus, and system provided in this application first construct a cockpit test knowledge graph based on basic data related to cockpit testing; then, based on the cockpit test knowledge graph, a scenario generalization model is trained, and multiple generalized test cases under specified scenarios are generated through the scenario generalization model; the specified scenarios include at least one of the following: combined scenarios, boundary scenarios, simulated scenarios, and abnormal scenarios; further, multiple generalized test cases are pre-verified to determine multiple executable generalized test cases; finally, multiple executable generalized test cases are executed, and based on the execution results, pre-defined indicator parameters are statistically analyzed to update the cockpit test knowledge graph or scenario generalization model, and the steps of generating multiple generalized test cases under specified scenarios are continued until the pre-defined indicator parameters meet the pre-defined requirements. This application, through a closed-loop processing procedure of "graph construction - model training - test case generation - test case verification - result feedback," can generalize test cases to different scenarios through a scenario generalization model trained based on the cockpit test knowledge graph, expand the test case sample library, comprehensively cover test dimensions, and improve software delivery quality. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a scenario generalization method for cockpit test cases provided in an embodiment of this application; Figure 2 A flowchart illustrating another scenario generalization method for cockpit test cases provided in this application embodiment; Figure 3 A structural block diagram of a scenario generalization device for cockpit test cases provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a scenario generalization system for cockpit test cases provided in an embodiment of this application. Detailed Implementation
[0017] The technical solutions of this application will be clearly and completely described below with reference to 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.
[0018] To address the issues of a large number of existing cockpit testing problems, insufficient test cases, inadequate test coverage, and incomplete test dimensions, this application provides a method, apparatus, and system for scenario generalization of cockpit test cases. It applies a scenario generalization model trained based on a cockpit testing knowledge graph to generalize test cases to different scenarios, thereby increasing the test case sample library, comprehensively covering test dimensions, and improving software delivery quality.
[0019] To facilitate understanding of this embodiment, a scenario generalization method for cockpit test cases disclosed in this application embodiment will first be described in detail.
[0020] Figure 1 A flowchart illustrating a scenario generalization method for cockpit test cases provided in this application embodiment is included, specifically comprising the following steps: Step S102: Based on the basic data related to cockpit testing, construct a cockpit testing knowledge graph; The aforementioned basic data includes: functional documents, historical data, and user interaction logs; historical data includes historical cockpit test cases and fault data; functional documents include cockpit module interface definitions and business rule information; This step first requires transforming the cockpit testing requirements document, historical test cases, fault data, and system interface specifications into structured knowledge that AI can understand. This core process includes three types of data: functional logic data, historical test data, and environmental and user data. Functional logic data includes the input-output mapping relationships between cockpit modules and the dependencies between modules; historical test data includes test cases and defect data from previous versions, labeled with the types of scenarios covered; and environmental and user data includes environmental data from real vehicles and user behavior data, to build a real-world scenario feature library.
[0021] By linking the above data using knowledge graph technology, a cockpit testing knowledge graph for AI generalization is formed, providing a logical basis for subsequent scenario generalization.
[0022] Step S104: Based on the cockpit test knowledge graph, train the scenario generalization model, and generate multiple generalized test cases under the specified scenario through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, and abnormal scenario. The above-mentioned scenario generalization model is an AI model. The core of AI generalization is to enable the model to learn the functional logic, interaction rules, and abnormal patterns of the cockpit system from known test scenarios, and automatically generate new scenarios that are not covered, such as boundary scenarios, combined scenarios, abnormal scenarios, and simulated scenarios. In essence, it breaks through the limitations of human experience through data-driven induction and deduction.
[0023] In this step, a scene generalization model can be trained based on knowledge graph data using a combination of supervised learning and reinforcement learning. The core objective is to enable the model to have four capabilities: combined scene generation, boundary scene generation, abnormal scene generation, and simulated scene generation.
[0024] The above-mentioned scenario generalization models can include different models for different scenarios, which will be detailed later. For example, a Transformer-based sequence generation model can generate structured test case steps; a reinforcement learning model, with improved test case coverage and defect detection rate as reward functions, can continuously optimize the direction of scenario generation and avoid generating redundant test cases.
[0025] Step S106: Perform pre-defined verification on multiple generalized use cases to determine multiple executable generalized use cases; The generalized scenario test cases generated by AI need to be converted into executable test cases. In this embodiment, invalid test cases can be excluded through two layers of verification: logical verification and redundancy verification.
[0026] Step S108: Execute multiple executable generalized test cases, and based on the execution results, statistically analyze the preset indicator parameters, update the cockpit test knowledge graph or scenario generalization model, and continue to execute the steps of generating multiple generalized test cases under the specified scenario until the preset indicator parameters meet the preset requirements.
[0027] The execution results of the generalized test cases, such as pass / fail or whether new defects were found, are fed back to the model, forming a closed loop of "test case graph construction - model training - test case generation - test case validation - result feedback". While statistically analyzing the performance metrics based on the execution results, the test case graph or model is optimized, and the steps of generating test cases, validating test cases, executing test cases, and statistically analyzing execution results continue until the preset performance metrics meet the preset requirements. These preset performance metrics include at least one of the following: functional coverage and scenario coverage. If the coverage exceeds a preset threshold, the above-mentioned cyclical scenario generalization process can be stopped. The final result is the scenario-generalized cockpit test case set.
[0028] The scenario generalization method for cockpit test cases provided in this application is data-driven and forms a closed-loop processing process of "knowledge accumulation → model training → test case generation → verification execution → feedback optimization". This effectively improves the scenario / functional coverage of cockpit test cases, expands the cockpit test case sample set, and thus improves the accuracy and efficiency of cockpit performance testing.
[0029] This application also provides another method for scenario generalization of cockpit test cases. Figure 2 The closed-loop processing flow of this method is illustrated. Through the closed-loop process of "knowledge accumulation → model training → test case generation → verification execution → feedback optimization", dynamic improvement of test case coverage is ultimately achieved. This method is implemented based on the above embodiments, and this embodiment illustrates the specific implementation process of the above steps with specific examples.
[0030] Step S102 above involves constructing a cockpit testing knowledge graph based on fundamental data related to cockpit testing. This process includes the following steps: (1) Standardize the basic data related to cockpit testing to obtain structured data; the standardization process includes: data cleaning, data labeling and data structuring. The aforementioned basic data includes functional documentation, historical data, and user interaction logs; The functional documentation includes: cockpit module interface definitions and business rule information. Cockpit module interface definitions include, for example, voice API parameters and touch response thresholds; business rule information includes, for example, disabling video when the vehicle speed is >60km / h.
[0031] User interaction logs include: real user voice command text, touch operation sequences, and environmental parameters. Voice command text includes commands in standard Mandarin, as well as commands with dialects or ambiguous expressions. Touch operation sequences, such as a series of clicks based on coordinates, each with a timestamp. Environmental parameters include noise levels (decibels), temperature, and vehicle speed.
[0032] Historical data includes: historical test cases and fault records; for example: speech recognition failure scenarios and function conflict logs.
[0033] The data preprocessing process is as follows: Cleaning: Remove duplicate logs and correct formatting errors. For example, correct operation sequences with missing timestamps to operation sequences with added timestamps.
[0034] Labeling: Label the intent of voice commands and the temporal relationship of operation sequences. For example, you can label the intent of navigation or air conditioning control; or label the temporal relationship as voice first, then touch control.
[0035] Structured processing: Transforming unstructured data into a format that the model can input; for example, converting voice commands into text vectors, or operation sequences into JSON arrays.
[0036] The final structured data primarily comprises the following three types of data: ① Functional logic data: Organize the input-output mapping relationship and inter-module dependency relationship of each module in the cockpit; for example, the input-output mapping relationship of modules such as navigation, air conditioning, voice, HUD, and seat control; another example is "voice input 'turn on air conditioning 24℃' → air conditioning controller outputs 24℃ command + screen displays temperature"; inter-module dependency relationship, such as: navigation route planning needs to call positioning module data.
[0037] ②Historical test data: Collect test cases and defect data from previous versions, and label the types of scenarios covered; the test cases mentioned above are test cases that include steps and expected results; the defect data mentioned above includes defect scenarios, triggering conditions and causes, etc.; the types of scenarios covered above include: single-module functional scenarios, multi-module linkage scenarios, and abnormal scenarios.
[0038] ③ Environmental and User Data: Import environmental data and user behavior data from real vehicles to build a real-world feature library. The environmental data includes temperature, humidity, altitude, and network signal strength; the user behavior data includes operation logs and voice command recordings.
[0039] (2) Based on structured data, entity extraction and relationship construction are performed to generate a cockpit test knowledge graph.
[0040] For example, using tools like Neo4j and Protégé to build a cockpit domain knowledge graph, the extracted entities include: functional modules (such as navigation and air conditioning), interaction methods (such as voice and touch), parameters (such as temperature 16-30℃ and volume 0-100), and states (such as parking / driving). Extracted relationships include, for example, "voice command → call navigation module" and "driving state → restrict video playback."
[0041] By using knowledge graph technology (such as entity extraction and relationship construction), the above data is linked together, such as "user voice command → trigger voice module → call air conditioning module → ambient temperature affects air conditioning response speed", forming a knowledge graph for AI generalization of cabin testing, providing a logical basis for subsequent scenario generalization.
[0042] Step S104 above, the step of training the scenario generalization model based on the cockpit testing knowledge graph, includes: training the scenario generalization model based on the cockpit testing knowledge graph using a combination of supervised learning and reinforcement learning, so that the scenario generalization model has four functions; the four functions include: (1) Through learning the interaction rules of modules, generalized use cases in multi-module linkage scenarios are automatically generated; for example, after the model learns from historical use cases that voice control of air conditioning and navigation route modification are independent scenarios, it can generate a combined scenario of adjusting the air conditioning temperature at the same time when the voice module and the navigation module are modified based on the interface dependency between the voice module and the navigation module. (2) Through parameter boundary analysis, the range of input parameters is automatically expanded to generate generalized use cases in boundary scenarios; for example, for the seat adjustment function, the model learns the parameter logic from the adjustment range of 0-100% in historical use cases, and then generates boundary scenarios with parameters -5% (negative boundary), parameters 105% (positive boundary), and parameters that are not numerical (such as 'ABC', abnormal input); (3) Through fault mode learning, the abnormal triggering rules are summarized based on historical defect data to generate generalized use cases in abnormal scenarios; for example, when the network signal strength is <1 bar, navigation loading fails, and then network signal fluctuation (1 bar → 0 bar → 1 bar), sensor data mutation (such as HUD brightness suddenly jumping from 50% to 100%) and other uncovered abnormal scenarios are generated.
[0043] (4) Generate generalized use cases in simulated scenarios through user operation timing learning. For example: 1. Start the cockpit system; 2. Use voice input to turn on navigation and adjust the air conditioning to 26℃; 3. Observe the navigation loading status and air conditioning temperature display.
[0044] In this embodiment of the application, the generalization algorithm and model used are as follows: Parameter mutation: Use Python to generate numerical parameters based on Gaussian / uniform distribution, and combine with NLP models (such as BERT fine-tuning) to generate text instruction variants (such as dialects and colloquial expressions).
[0045] Scene combination: Use graph neural networks (GNN) to model the relationship between functional modules, and combine them with genetic algorithms to generate cross-module operation sequences (such as "voice control of air conditioning + touch control of navigation + ambient noise").
[0046] User behavior simulation: Use the Transformer model to train user operation time sequence data to generate "human-like" operation chains (such as "during navigation → adjust volume → ask the weather").
[0047] Edge scene mining: Isolation Forest is used to identify abnormal operations (such as 10 consecutive misrecognitions of speech) from logs, and combined with risk assessment models (such as XGBoost) for scoring and ranking.
[0048] The generated generalized test cases are output in the following format (including test case ID, scenario description, operation steps, and expected results), for example: json { "case_id": "C001", "scene": "High-speed driving + 60 decibels of noise", "steps": [ {"action": "voice command", "content": "lower the air conditioner temperature by two degrees", "timestamp": 1000}, {"action": "touch operation", "target": "navigation destination input box", "timestamp":2000} ], "expected": "Air conditioning temperature dropped by 2℃, navigation input box activated normally"}.
[0049] Furthermore, the aforementioned pre-defined verification includes logical verification and redundancy verification; step S106 involves performing pre-defined verification on multiple generalized use cases to determine multiple executable generalized use cases, including: (1) Based on the cockpit system interface specification, check the feasibility of the steps corresponding to multiple generalized use cases to complete the logic verification; for example, whether there is a hardware interface that supports simultaneous adjustment of seat heating and steering wheel heating, and filter out invalid scenario use cases that the system cannot implement. (2) By using a use case similarity algorithm, multiple generalized use cases are compared with historical use cases, and highly similar use cases are eliminated to complete the redundancy check. The use case similarity algorithm may include cosine similarity based on the step sequence; by eliminating duplicate or highly similar use cases, the coverage statistics are not overstated.
[0050] After successful verification, structured test cases are automatically generated, including test case ID, test module, test steps, expected results, and priority. These can be directly imported into test management tools (such as JIRA and TestRail).
[0051] Furthermore, step S108 above, which involves executing multiple executable generalized use cases and statistically analyzing preset indicator parameters based on the execution results, includes: (1) Execute multiple executable generalized test cases in a simulation platform (such as Prescan, dSPACE cockpit simulation environment) or in a real vehicle, or use automated scripts (such as Python+ADB to control the vehicle system) to execute multiple executable generalized test cases in batches and determine the execution results corresponding to the multiple executable generalized test cases respectively; for example, voice command recognition success / failure.
[0052] It should be noted that the above batch execution can be used for test cases in simple scenarios. For test cases in complex scenarios, manual verification can be combined.
[0053] (2) Based on the execution results corresponding to multiple executable generalized use cases, calculate the preset indicator parameters; the preset indicator parameters shall include at least one of the following: function point coverage rate, scenario coverage rate. For example, the coverage ratio of voice command type, the coverage ratio of environmental parameter combination.
[0054] If the coverage rate is not met, i.e., the corresponding threshold is not exceeded, the cockpit test knowledge graph or scenario generalization model can be further updated based on the execution results so that the steps of generating test cases can be continued again through the updated graph or model until the coverage rate meets the requirements.
[0055] Step S108 above, updating the cockpit test knowledge graph or scenario generalization model based on the execution results, includes: If the generalized test case fails to execute and a new defect is discovered, the scenario corresponding to the generalized test case is marked as a valid coverage scenario and added to the cockpit test knowledge graph to enhance the model's ability to generalize to similar scenarios. If the generalized test case passes to execute and is a redundant verification item, the reward function of the scenario generalization model is adjusted to reduce the generation of similar scenarios.
[0056] Use AI to analyze uncovered gaps (such as untested dialect commands), adjust model parameters in reverse (such as increasing the weight of training data for that dialect), and iteratively optimize the test case generation logic.
[0057] The hardware required for the embodiments of this application is shown in Table 1 below: Table 1
[0058] The software environment required for this application embodiment is as follows: Operating system: The server uses Ubuntu 20.04 (adapted to the AI framework), and the test terminal uses an in-vehicle system (such as Android Automotive OS).
[0059] AI framework: Model training: TensorFlow / PyTorch (for models such as BERT, Transformer, and GNN).
[0060] Algorithm implementation: Scikit-learn (anomaly detection, clustering), DEAP (genetic algorithm).
[0061] Data processing tools: Structured data: Pandas, SQL (MySQL / PostgreSQL for storing logs).
[0062] Unstructured data: NLTK / SpaCy (text processing), OpenCV (image-based interactive data, such as gesture recognition).
[0063] Knowledge graph tools: Neo4j (stores entities and relationships), Apache Jena (rule-based reasoning).
[0064] Simulation and testing tools: Cockpit simulation: dSPACE Automotive Simulation Models (ASM), Prescan.
[0065] Automated execution: Selenium (touch operation), Python + speech synthesis library (such as pyttsx3 to generate test speech).
[0066] Version control: Git (code and test case version management), DVC (data version control).
[0067] Compared to traditional manually generated test cases, the scenario generalization method for cockpit test cases provided in this application has three irreplaceable advantages in improving coverage: 1. Coverage scope expands from single to full-scene applications. Functional coverage: Through multi-module combination and generalization, it covers cross-module linkage scenarios that are difficult to enumerate manually in the traditional way. For example, when the HUD displays navigation information, it triggers an active braking alarm and then broadcasts the alarm message in a multi-module collaborative scenario. Environmental coverage: By combining real-world environmental data, we generate composite environmental scenarios involving extreme temperatures, weak networks, and electromagnetic interference, overcoming the limitation of traditional use cases that only cover normal temperatures and conditions. User coverage: Based on user behavior data generalization, it covers user scenarios of different age groups and operating habits, such as long-tail scenarios such as elderly people repeatedly issuing voice commands and children accidentally touching the central control button.
[0068] Practice has shown that after adopting AI generalization, the scenario coverage of cockpit test cases has increased by 300%, with the coverage of multi-module linkage scenarios increasing from the traditional 35% to 92%.
[0069] 2. Boundary coverage shifts from experience-driven to data-driven. Traditional boundary test cases rely on the experience and judgment of testers, while AI can accurately locate uncovered boundaries by analyzing the distribution of input parameters and system anomaly logs. For example, in testing cockpit touchscreens, AI discovered from historical data that there were many test cases with touch pressure of 0.1N-0.5N, but there were no scenarios with less than 0.1N (light touch) or greater than 0.5N (heavy pressure), and then automatically generated test cases for these boundaries. In one case, the boundary use case of AI generalization discovered a defect: "the touch screen response delay exceeds 1.5 seconds in a cabin at a low temperature of -25°C," a scenario that has never been covered in traditional testing.
[0070] Practice has shown that AI generalization can increase the coverage of boundary scenarios in cockpit testing from 40% to over 85%, and improve the detection rate of abnormal defects by 60%.
[0071] 3. Version adaptation went from lagging to synchronous. AI generalization models can quickly adapt to version iterations of cockpit software: Before the new version is released, only the logical data of the new function needs to be added, such as the new "seat massage and ambient light linkage" function. The model can generate generalized use cases for the new function within 1-2 hours without manual rewriting. At the same time, the model will automatically verify the compatibility between old use cases and new logic, and mark conflicting use cases, such as "the step of turning off the air conditioner in the old use case conflicts with the new function of air conditioner-linked ambient light", to ensure the timeliness and accuracy of use case coverage.
[0072] Practice shows that after adopting AI generalization, the time for generating new feature use cases in version iterations has been shortened from the traditional 3 days to 2 hours, and the use case coverage lag rate has been reduced from 50% to below 5%.
[0073] Based on the above method embodiments, this application also provides a scenario generalization device for cockpit test cases, see [link to relevant documentation]. Figure 3As shown, the device includes: a knowledge graph construction module 32, used to construct a cockpit testing knowledge graph based on basic data related to cockpit testing; a model training and test case generation module 34, used to train a scenario generalization model based on the cockpit testing knowledge graph, and generate multiple generalized test cases under a specified scenario through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, simulated scenario, and abnormal scenario; a test case verification module 36, used to perform preset verification on multiple generalized test cases to determine multiple executable generalized test cases; and a test case execution and feedback module 38, used to execute multiple executable generalized test cases, and based on the execution results, statistically analyze preset indicator parameters, update the cockpit testing knowledge graph or scenario generalization model, and continue to execute the step of generating multiple generalized test cases under the specified scenario until the preset indicator parameters meet the preset requirements.
[0074] Furthermore, the aforementioned basic data includes: functional documents, historical data, and user interaction logs; historical data includes historical cockpit test cases and fault data; functional documents include cockpit module interface definitions and business rule information; the knowledge graph construction module 32 is used to standardize the basic data related to cockpit testing to obtain structured data; the standardization process includes: data cleaning, data annotation, and data structuring; based on the structured data, entity extraction and relationship construction are performed to generate a cockpit test knowledge graph.
[0075] Furthermore, the aforementioned model training and test case generation module 34 is used to train the scenario generalization model based on the cockpit test knowledge graph, using a combination of supervised learning and reinforcement learning.
[0076] Furthermore, the aforementioned model training and test case generation module 34 is used to perform the following steps based on the cockpit test knowledge graph: automatically generating generalized test cases in multi-module linkage scenarios through module interaction rule learning; automatically expanding the value range of input parameters through parameter boundary analysis to generate multiple generalized test cases in boundary scenarios; summarizing abnormal triggering patterns based on historical defect data through fault mode learning to generate multiple generalized test cases in abnormal scenarios; and generating multiple generalized test cases in simulated scenarios through user operation timing learning.
[0077] Furthermore, the aforementioned preset verification includes logical verification and redundancy verification; the use case verification module 36 is used to check the feasibility of the steps corresponding to multiple generalized use cases based on the cockpit system interface specification to complete logical verification; and to compare multiple external generalized use cases with historical use cases through a use case similarity algorithm, and to eliminate highly similar use cases to complete redundancy verification.
[0078] Furthermore, the aforementioned use case execution and feedback module 38 is used to execute multiple executable generalized use cases in a simulation platform or a real vehicle, or to use an automated script to execute multiple executable generalized use cases in batches, and to determine the execution results corresponding to the multiple executable generalized use cases respectively; based on the execution results corresponding to the multiple executable generalized use cases respectively, to statistically analyze preset indicator parameters; the preset indicator parameters include at least one of the following: function point coverage rate, scenario coverage rate.
[0079] Furthermore, the aforementioned test case execution and feedback module 38 is used to mark the scenario corresponding to the generalized test case as a valid coverage scenario and add it to the cockpit test knowledge graph if the generalized test case execution fails and a new defect is discovered, so as to enhance the model's generalization ability to similar scenarios; if the generalized test case execution passes and belongs to redundant verification items, the reward function of the scenario generalization model is adjusted to reduce the generation of similar scenarios.
[0080] The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts of the device embodiment not mentioned can be referred to the corresponding content in the aforementioned method embodiment.
[0081] Based on the above method embodiments, this application also provides a scenario generalization system for cockpit test cases, see [link to relevant documentation]. Figure 4 As shown, the system includes a server 42, a test terminal 44, a data acquisition device 46, and a storage device 48; the data acquisition device 46 is used to collect user interaction and environmental data; the storage device 48 is used to store logs, training data, and model files; the test terminal 44 is used to execute test cases; and the server 42 is used to execute the methods described in the preceding method embodiments.
[0082] The system provided in this application embodiment has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0083] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-described method. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.
[0084] The computer program products of the methods, apparatus, and electronic devices provided in the embodiments of this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementations, please refer to the method embodiments, which will not be repeated here.
[0085] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application.
[0086] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, 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 portion 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 described in 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.
[0087] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0088] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, 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, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A scenario generalization method for cockpit test cases, characterized in that, The method includes: Based on basic data related to cockpit testing, a cockpit testing knowledge graph is constructed. Based on the cockpit test knowledge graph, a scenario generalization model is trained, and multiple generalized test cases under a specified scenario are generated through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, simulated scenario, and abnormal scenario; Multiple generalized use cases are subjected to preset verification to determine multiple executable generalized use cases; Execute multiple executable generalized test cases, and based on the execution results, statistically analyze preset indicator parameters, update the cockpit test knowledge graph or the scenario generalization model, and continue to execute the step of generating multiple generalized test cases under the specified scenario until the preset indicator parameters meet the preset requirements.
2. The method according to claim 1, characterized in that, The basic data includes: functional documents, historical data, and user interaction logs; the historical data includes historical cockpit test cases and fault data; the functional documents include cockpit module interface definitions and business rule information; the steps for constructing a cockpit test knowledge graph based on the basic data related to cockpit testing include: The basic data related to the cockpit test are standardized to obtain structured data; wherein, the standardization process includes: data cleaning, data annotation and data structuring. Based on the structured data, entity extraction and relationship construction are performed to generate a cockpit test knowledge graph.
3. The method according to claim 1, characterized in that, The steps for training a scenario generalization model based on the cockpit testing knowledge graph include: Based on the cockpit test knowledge graph, a scenario generalization model is trained using a combination of supervised learning and reinforcement learning.
4. The method according to claim 1, characterized in that, The steps for generating multiple generalized use cases for a specified scenario using the scenario generalization model include: Based on the cockpit testing knowledge graph, the following steps are performed: By learning module interaction rules, generalized test cases are automatically generated in multi-module linkage scenarios; Through parameter boundary analysis, the range of values for input parameters is automatically expanded to generate multiple generalized use cases under boundary scenarios; By learning failure modes, the system summarizes the patterns of anomaly triggering based on historical defect data, in order to generate multiple generalized use cases under abnormal scenarios. By learning the timing of user actions, multiple generalized use cases are generated in simulated scenarios.
5. The method according to claim 1, characterized in that, The preset verification includes logical verification and redundancy verification; the step of performing preset verification on multiple generalized use cases to determine multiple executable generalized use cases includes: Based on the cockpit system interface specification, the feasibility of the steps corresponding to multiple generalized use cases is checked to complete the logic verification; By using a use case similarity algorithm, the generalized use cases described above are compared with historical use cases, and highly similar use cases are eliminated to complete the redundancy check.
6. The method according to claim 1, characterized in that, The steps of executing multiple executable generalized use cases and statistically analyzing preset indicator parameters based on the execution results include: Execute multiple executable generalized test cases in a simulation platform or a real vehicle, or use an automated script to execute multiple executable generalized test cases in batches, and determine the execution results corresponding to each of the multiple executable generalized test cases; Based on the execution results corresponding to the various executable generalized use cases, preset indicator parameters are statistically analyzed; the preset indicator parameters include at least one of the following: function point coverage rate, scenario coverage rate.
7. The method according to claim 1, characterized in that, The steps of updating the cockpit test knowledge graph or the scenario generalization model based on the execution results include: If the generalized test case fails to execute and a new defect is discovered, the scenario corresponding to the generalized test case is marked as a valid coverage scenario and added to the cockpit test knowledge graph to enhance the model's ability to generalize to similar scenarios. If the generalized use case passes the test and is a redundant check item, adjust the reward function of the scenario generalization model to reduce the generation of similar scenarios.
8. A scenario generalization device for cockpit test cases, characterized in that, The device includes: The knowledge graph construction module is used to build a knowledge graph of cockpit testing based on basic data related to cockpit testing. The model training and test case generation module is used to train a scenario generalization model based on the cockpit test knowledge graph, and generate multiple generalized test cases under a specified scenario through the scenario generalization model; the specified scenario includes at least one of the following: combined scenario, boundary scenario, simulated scenario, and abnormal scenario; The test case verification module is used to perform preset verification on multiple generalized test cases to determine multiple executable generalized test cases; The test case execution and feedback module is used to execute multiple executable generalized test cases, and based on the execution results, statistically analyze preset indicator parameters, update the cockpit test knowledge graph or the scenario generalization model, and continue to execute the step of generating multiple generalized test cases under the specified scenario until the preset indicator parameters reach the preset requirements.
9. A scenario generalization system for cockpit test cases, characterized in that, The system includes a server, a test terminal, a data acquisition device, and a storage device; the data acquisition device is used to collect user interaction and environmental data; the storage device is used to store logs, training data, and model files; the test terminal is used to execute test cases; and the server is used to execute the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.