Vehicle-mounted cabin test case generation method and device, electronic equipment and medium
Through natural language processing model and test case template engine, the vehicle cockpit knowledge graph is built and test cases are generated, which solves the problem of low efficiency and accuracy of test case generation in the existing technology, and achieves faster and more accurate test case generation.
Patent Information
- Application Number
- CN202411920962.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-15
AI Technical Summary
During the writing of existing vehicle-mounted cockpit test cases, the generation efficiency and accuracy are low, rely on manual experience, time-consuming and error-prone.
The natural language processing model is used to identify the named entity of the requirement document, build a knowledge graph of the on-board cockpit, and use the test case template engine to extract information and fill templates to generate test cases.
Improve the generation speed and accuracy of test cases, reduce the dependence of manual writing, and avoid the problems of use case writing errors and slow generation.
Smart Images

Figure CN119829449A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and medium for generating vehicle-mounted cockpit test cases. Background Art
[0002] With the rapid development of automotive information technology, the in-vehicle smart cockpit, as the center of automotive entertainment, information and function control, undertakes multiple tasks. Due to the differences in functions, signals and control logic of in-vehicle smart cockpits in different projects, testers need to manually write a large number of test cases, which consumes a lot of human resources and time. With the accelerated replacement of automobiles, the development cycle is constantly shortening, which makes it more and more arduous to write test cases for each model, and testers face tremendous pressure.
[0003] At present, vehicle cockpit test cases are usually written manually. However, manual writing relies on human experience and knowledge, and is time-consuming, which can easily lead to problems with test case accuracy and low generation efficiency. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a method, device, electronic device and medium for generating vehicle cockpit test cases, so as to solve the problem of low test case generation efficiency and accuracy in the existing test case writing process.
[0005] In a first aspect, an embodiment of the present application provides a method for generating a vehicle cockpit test case, comprising:
[0006] Use the natural language processing model to perform named entity recognition on the vehicle cockpit requirement document to obtain the key entity information corresponding to the vehicle cockpit test case;
[0007] Build a vehicle cockpit knowledge graph based on key entity information;
[0008] The test case template engine is used to extract information and fill in templates on the vehicle cockpit knowledge graph to generate vehicle cockpit test cases.
[0009] Optionally, the key entity information includes functional modules, control signals and control logic. Based on the key entity information, a vehicle cockpit knowledge graph is constructed, including: taking functional modules and control signals as nodes, and connecting different nodes according to the control logic to construct a vehicle cockpit knowledge graph.
[0010] Optionally, the nodes include different types of nodes, and the different types of nodes include signal nodes and functional nodes.
[0011] Optionally, a test case template engine is used to extract information and fill in templates on the vehicle cockpit knowledge graph, including: using the test case template engine to extract test case information in the vehicle cockpit knowledge graph, filling the test case information into a preset case structure to generate a vehicle cockpit test case.
[0012] Optionally, the test case information includes target control signals and target control logic, and the test case information in the vehicle cockpit knowledge graph is extracted, and the test case information is filled into the preset use case structure, including: for the target function module, extracting the target control signal corresponding to the target function module and the target control logic corresponding to the target control signal from the vehicle cockpit knowledge graph; according to the target control logic, filling the target control signal and the target function module into multiple preset use case structures corresponding to different test scenarios.
[0013] Optionally, the method further includes: classifying and versioning the generated vehicle cockpit test cases to manage the generated vehicle cockpit test cases.
[0014] Optionally, the test case template engine includes a Jinja2 template engine, and the natural language processing model includes a BERT model.
[0015] In a second aspect, an embodiment of the present application further provides a vehicle-mounted cockpit test case generation device, the device comprising:
[0016] An entity recognition module is used to perform named entity recognition on the vehicle cockpit requirement document using a natural language processing model to obtain key entity information corresponding to the vehicle cockpit test case;
[0017] A graph construction module, which is used to construct a vehicle cockpit knowledge graph based on key entity information;
[0018] The use case generation module is used to use the test case template engine to extract information and fill in templates on the vehicle cockpit knowledge graph to generate vehicle cockpit test cases.
[0019] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned vehicle cabin test case generation method are performed.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned vehicle cockpit test case generation method are executed.
[0021] The embodiments of the present application bring the following beneficial effects:
[0022] The embodiment of the present application provides a method, device, electronic device and medium for generating vehicle cockpit test cases, which can use a natural language processing model to extract key entity information in the vehicle cockpit requirement document, and use the key entity information to construct a vehicle cockpit knowledge graph, without relying on human experience to obtain key entity information in the vehicle cockpit requirement document, thereby improving the accuracy and efficiency of information acquisition. At the same time, the test case template engine is used to extract the knowledge graph and fill in the template, which speeds up the generation speed and accuracy of the test cases, avoids the problems of case writing errors and slow case generation speed that may exist when manually generating test cases, and compared with the vehicle cockpit test case generation method in the prior art, it solves the problem of low test case generation efficiency and accuracy in the existing test case writing process.
[0023] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flow chart of a method for generating a vehicle cockpit test case provided in an embodiment of the present application is shown;
[0026] Figure 2 A schematic diagram showing the structure of a vehicle-mounted cockpit test case generation device provided in an embodiment of the present application is shown;
[0027] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0029] It is worth noting that before this application was filed, with the rapid development of automobile information technology, the in-vehicle smart cockpit, as the center of automobile entertainment, information and function control, undertook multiple tasks. Due to the differences in functions, signals and control logic of the in-vehicle smart cockpits of different projects, testers need to manually write a large number of test cases, which consumes a lot of human resources and time. Against the background of accelerated automobile updates and replacements, the development cycle continues to shorten, which makes it more and more arduous to write test cases for each model, and testers face tremendous pressure.
[0030] For example: During the development and testing of the car instrument cockpit, it is necessary to write test cases based on product requirements and signal specifications, and generate corresponding tests for the warning indicator light (TT), intelligent assisted driving (ADAS), pop-up warning (Warning), alarm sound (Chime), instrument panel (Gauge), fixed display (FixedDisplay), trip calculator (TripComputer) and other requirement specifications.
[0031] As market and customer demands continue to change, after the development of the car cockpit is completed, the requirements document still needs to be adjusted accordingly. Testers must also update and write new test cases in a timely manner according to these changes. At present, car cockpit test cases are usually written manually, but manual writing relies on human experience and knowledge, and it takes a long time to write, which can easily lead to problems with the accuracy of test cases and low generation efficiency.
[0032] Based on this, an embodiment of the present application provides a method for generating vehicle cockpit test cases to improve the efficiency and accuracy of test case generation.
[0033] See also Figure 1 , Figure 1 This is a flow chart of a method for generating a vehicle cockpit test case provided by an embodiment of the present application. Figure 1 As shown, the vehicle cockpit test case generation method provided in the embodiment of the present application includes:
[0034] Step S101, using a natural language processing model to perform named entity recognition on the vehicle cockpit requirement document to obtain key entity information corresponding to the vehicle cockpit test case;
[0035] Step S102, constructing a vehicle cockpit knowledge graph based on key entity information;
[0036] Step S103, using the test case template engine, extracting information and filling in templates on the vehicle cockpit knowledge graph to generate a vehicle cockpit test case.
[0037] The vehicle cockpit test case generation method provided in the embodiment of the present application can use the natural language processing model to extract key entity information in the vehicle cockpit requirement document, and use the key entity information to build a vehicle cockpit knowledge graph, without relying on human experience to obtain the key entity information in the vehicle cockpit requirement document, thereby improving the accuracy and efficiency of information acquisition. At the same time, the test case template engine is used to extract the knowledge graph and fill in the template, which speeds up the generation speed and accuracy of the test case, avoids the possible use case writing errors and slow use case generation speed when manually generating test cases, and solves the problem of low test case generation efficiency and accuracy in the existing test case writing process.
[0038] To facilitate understanding of this embodiment, each of the above exemplary steps provided in the embodiment of the present application is described below.
[0039] In step S101, a natural language processing model is used to perform named entity recognition on the vehicle cockpit requirement document to obtain key entity information corresponding to the vehicle cockpit test case.
[0040] In this step, the natural language processing model may refer to an NLP (Natural Language Processing, NLP) model. As an example, the natural language processing model may be RoBERTa, XLNet, or BERT.
[0041] In one example, the natural language processing model is a BERT model.
[0042] In the embodiment of the present application, the vehicle cockpit requirement document is first obtained, which records the controller information, functional requirements, signals, control logic, etc. The BERT model can understand the context information in the vehicle cockpit requirement document, so as to efficiently identify the entity information in the requirement document. In this way, BERT can be used to perform named entity recognition on the vehicle cockpit requirement document to obtain key entity information from the vehicle cockpit requirement document.
[0043] Key entity information includes functional modules, control signals and control logic. Among them, functional modules include but are not limited to: alarm sound module, alarm light module, intelligent assisted driving module, air conditioning control module; control signals include alarm sound signal, alarm light signal, intelligent assisted driving signal, air conditioning control signal; control logic includes but is not limited to: alarm sound signal controls the on / off and volume of alarm sound, and alarm light signal controls the on / off of alarm light.
[0044] In step S102, a vehicle cockpit knowledge graph is constructed based on key entity information.
[0045] In this step, the vehicle cockpit knowledge graph includes the relationship between the functional module brackets, signal flow and control logic. It is a relationship network used to reflect the key information in the vehicle cockpit requirement document.
[0046] In one example, when constructing a vehicle cockpit knowledge graph, the vehicle cockpit knowledge graph can be generated by constructing a relationship network between functional modules, control signals, and control logic. For example, functional modules and control signals can be used as nodes, and different nodes can be connected according to the control logic to construct a vehicle cockpit knowledge graph. Among them, functional modules and control signals are nodes of the vehicle cockpit knowledge graph, and control logic is a directed edge connecting nodes in the vehicle cockpit knowledge graph.
[0047] In one example, the nodes of the vehicle cockpit knowledge graph include different types of nodes, including signal nodes and function nodes. Different types of nodes are identified by different identifiers in the vehicle cockpit knowledge graph, for example, different colors or different shapes are used to represent different types of nodes.
[0048] In step S103, the test case template engine is used to extract information and fill in templates on the vehicle cockpit knowledge graph to generate a vehicle cockpit test case.
[0049] In this step, the test case template engine may refer to a tool or framework for generating test cases, and the test case template engine may combine static templates with dynamic data to generate test cases. As an example, the test case template may be a Jinja2 template engine.
[0050] When using the test case template engine to generate a vehicle cockpit test case, the basic structure of the test case can be defined through the Jinja2 template engine. The basic structure of the same functional module in different test scenarios is different. Then, using the test case template engine, extract the test case information in the vehicle cockpit knowledge graph and fill the test case information into the preset case structure to generate a vehicle cockpit test case. Among them, the test case information includes the target control signal and the target control logic.
[0051] Taking the generation of test cases for the target functional module as an example, for the target functional module, the target control signal corresponding to the target functional module and the target control logic corresponding to the target control signal are extracted from the vehicle cockpit knowledge graph; according to the target control logic, the target control signal and the target functional module are filled into multiple preset use case structures corresponding to different test scenarios.
[0052] In one example, in order to facilitate the management of test cases, after the vehicle cockpit test cases are generated, the generated vehicle cockpit test cases can also be centrally stored, classified and version controlled through the test case library to manage the generated vehicle cockpit test cases.
[0053] In addition, when the test requirements change or test feedback is received, the vehicle cockpit knowledge graph can be updated according to the new test requirements or test feedback, and the corresponding vehicle cockpit test cases can be regenerated through Jinja2 templates. Then, the updated vehicle cockpit test cases are stored again to keep the latest version of the test case library. At the same time, a test report is generated to record the test process, results and improvement suggestions.
[0054] Based on the same inventive concept, an embodiment of the present application also provides a vehicle-mounted cockpit test case generation device corresponding to the vehicle-mounted cockpit test case generation method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned vehicle-mounted cockpit test case generation method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0055] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a vehicle cockpit test case generation device provided in an embodiment of the present application. Figure 2 As shown in , the vehicle-mounted cockpit test case generating device 200 includes:
[0056] An entity recognition module 201 is used to perform named entity recognition on the vehicle cockpit requirement document using a natural language processing model to obtain key entity information corresponding to the vehicle cockpit test case;
[0057] A graph construction module 202, used to construct a vehicle cockpit knowledge graph based on key entity information;
[0058] The use case generation module 203 is used to use the test case template engine to extract information and fill in templates on the vehicle cockpit knowledge graph to generate a vehicle cockpit test case.
[0059] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 3As shown in , the electronic device 300 includes a processor 310 , a memory 320 and a bus 330 .
[0060] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 via the bus 330. When the machine-readable instructions are executed by the processor 310, the above-mentioned Figure 1 The steps of the vehicle cockpit test case generation method in the method embodiment shown in the embodiment and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0061] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the vehicle cockpit test case generation method in the method embodiment shown in the embodiment and the specific implementation method thereof can be referred to the method embodiment, which will not be described in detail here.
[0062] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0063] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0064] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0065] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0066] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0067] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for generating vehicle cockpit test cases, characterized in that: include: Use the natural language processing model to perform named entity recognition on the vehicle cockpit requirement document to obtain the key entity information corresponding to the vehicle cockpit test case; Based on the key entity information, construct a vehicle cockpit knowledge graph; The test case template engine is used to extract information and fill in templates on the vehicle cockpit knowledge graph to generate a vehicle cockpit test case.
2. The method according to claim 1, characterized in that: The key entity information includes functional modules, control signals and control logic. The vehicle cockpit knowledge graph is constructed based on the key entity information, including: The functional modules and the control signals are used as nodes, and different nodes are connected according to the control logic to construct a vehicle cockpit knowledge spectrum.
3. The method according to claim 2, characterized in that The nodes include different types of nodes, and the different types of nodes include signal nodes and functional nodes.
4. The method according to claim 1, characterized in that: The method of using the test case template engine to extract information and fill in templates on the vehicle cockpit knowledge graph includes: The test case template engine is used to extract test case information from the vehicle cockpit knowledge graph, and the test case information is filled into a preset case structure to generate a vehicle cockpit test case.
5. The method according to claim 4, characterized in that The test case information includes a target control signal and a target control logic, and the extracting the test case information in the vehicle cockpit knowledge graph and filling the test case information into a preset case structure includes: For a target functional module, extracting a target control signal corresponding to the target functional module and a target control logic corresponding to the target control signal from the vehicle-mounted cockpit knowledge graph; According to the target control logic, the target control signal and the target functional module are filled into a plurality of preset use case structures corresponding to different test scenarios.
6. The method according to claim 1, characterized in that The method further comprises: The generated vehicle cockpit test cases are classified and version controlled to manage the generated vehicle cockpit test cases.
7. The method according to claim 1, characterized in that The test case template engine includes a Jinja2 template engine, and the natural language processing model includes a BERT model.
8. A vehicle-mounted cockpit test case generation device, characterized in that: include: An entity recognition module is used to perform named entity recognition on the vehicle cockpit requirement document using a natural language processing model to obtain key entity information corresponding to the vehicle cockpit test case; A graph construction module, used to construct a vehicle cockpit knowledge graph based on the key entity information; The use case generation module is used to use the test case template engine to extract information and fill in the template on the vehicle cockpit knowledge graph to generate a vehicle cockpit test case.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the vehicle cockpit test case generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle cockpit test case generation method according to any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Test case generation method and device, computer equipment and storage medium
CN117194216A
Test case generation method and device, electronic equipment and medium
CN117472766A
Electricity consumption information acquisition terminal automatic test method and system based on graphic programming
CN118503132A
Cited By
Test method and device of intelligent cabin software, intelligent cabin and vehicle
CN120336200A
Intelligent cockpit software testing method, device, intelligent cockpit and vehicle
CN120336200B