Test script generation method and device, electronic equipment and readable storage medium

By generating test cases and target mapping relationships, test scripts are automatically generated, solving the problem of low efficiency in vehicle functional testing and realizing an efficient and flexible test script generation process.

CN116302933BActive Publication Date: 2025-11-28BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211711403.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2025-11-28
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

In existing technologies, the generation efficiency of vehicle functional test cases and test scripts is too low, especially in hardware-in-the-loop testing, where manual writing is insufficient to meet the testing requirements of multi-functional vehicles.

Method used

By utilizing vehicle function information and a preset signal matrix table to generate test cases, a target mapping relationship between simulation information and the preset signal matrix table is established, and a target test script in a first preset text format is automatically generated, achieving full-process automation.

Benefits of technology

It improves the efficiency of test script generation, saves a lot of manpower, ensures the flexibility and loose coupling of the test script generation process, and facilitates testers to check and adjust in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302933B_ABST
    Figure CN116302933B_ABST
Patent Text Reader

Abstract

The application discloses a test script generation method and device, electronic equipment and a readable storage medium. The test script generation method comprises the following steps: generating a test case by using vehicle function information to be tested and a preset signal matrix table, wherein the vehicle function information comprises at least one vehicle function identifier, and the test case comprises an input signal and / or an output signal corresponding to each vehicle function identifier; generating a simulation information in a preset simulation model by using the vehicle function information to be tested, wherein the vehicle function information comprises at least one vehicle function identifier, the simulation information comprises at least one simulation parameter identifier, and a target mapping relationship information between the simulation information and the preset signal matrix table is established. A first target test script in a first preset text format is generated according to the test case and the target mapping relationship information. According to the embodiment of the application, the generation efficiency of the test script can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of hardware testing technology, and in particular relates to a test script generation method, apparatus, electronic device and readable storage medium. Background Technology

[0002] With the development of vehicle automatic control technology, vehicles are increasingly featuring comfort, safety, and connectivity functions. To ensure the safety and reliability of vehicles during their use after leaving the production line, testing is necessary before they are put into operation. Currently, to improve testing efficiency, methods such as Hardware-in-the-Loop (HIL) testing are often used, which employs HIL models to perform tests on behalf of actual vehicles.

[0003] However, in HIL-based testing, testers typically begin by manually writing test cases for vehicle functions and then building execution scripts based on these test cases. As the number of vehicle functions requiring testing increases, manually writing test cases and generating test scripts is becoming increasingly inefficient. Summary of the Invention

[0004] This application provides a test script generation method, apparatus, electronic device, and readable storage medium, which can effectively improve the generation efficiency of test scripts.

[0005] In a first aspect, embodiments of this application provide a test script generation method, including:

[0006] Test cases are generated using the vehicle function information to be tested and a preset signal matrix table. The vehicle function information includes at least one vehicle function identifier, and the test cases include the input signal and / or output signal corresponding to each vehicle function identifier.

[0007] The test utilizes the vehicle's functional information and simulation information from a pre-set simulation model. The vehicle functional information includes at least one vehicle functional identifier, and the simulation information includes at least one simulation parameter identifier.

[0008] Establish a target mapping relationship between simulation information and a preset signal matrix table. This target mapping relationship information includes simulation parameters associated with each simulation parameter identifier.

[0009] Based on the test cases and target mapping information, generate the first target test script in the first preset text format.

[0010] In some possible implementations of the first aspect, test cases are generated based on the vehicle's functional information to be tested and a preset signal matrix table, including:

[0011] Obtain the preset signal matrix table in the second preset text format and the vehicle function information in the second preset text format.

[0012] According to the preset data reading tool, the tool searches for a first identifier that matches each vehicle function identifier in a preset signal matrix table in a second preset text format, and reads the input signal and / or output signal corresponding to each first identifier. Each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal.

[0013] In the vehicle function information in the second preset text format, for each vehicle function identifier, add the input signal and / or output signal corresponding to the first identifier to obtain test cases.

[0014] Among the possible implementations of the first aspect, establishing the target mapping relationship between simulation information and a preset signal matrix table includes:

[0015] Obtain the preset signal matrix table in the second preset text format and the simulation information in the second preset text format.

[0016] The preset data mapping tool searches for a second identifier that matches each simulation parameter identifier in a preset signal matrix table in a second preset text format, and establishes a mapping between the simulation parameter identifier and the matching second identifier to obtain the target mapping relationship information.

[0017] In this context, each second identifier in the preset signal matrix table is associated with preset simulation parameters.

[0018] In some possible implementations of the first aspect, after generating a first target test script in a first preset text format based on test case and target mapping relationship information, the method further includes:

[0019] Based on the first target test script in the first preset text format, the preset simulation model is tested, and a test report of the preset simulation model is generated.

[0020] The test report includes the test results corresponding to each vehicle function identifier.

[0021] In some possible implementations of the first aspect, a preset simulation model is tested according to a first target test script in a first preset text format, and a test report of the preset simulation model is generated, including:

[0022] Locate the third identifier in the first target test script with the first preset text format that does not match each vehicle function identifier and does not match each simulation parameter identifier.

[0023] Delete the third identifier and its associated information from the first target test script in the first preset text format to obtain the second target test script in the first preset text format.

[0024] Based on the second target test script in the first preset text format, the preset simulation model is tested, and a test report of the preset simulation model is generated.

[0025] Secondly, embodiments of this application provide a test script generation apparatus, comprising:

[0026] The processing module is used to generate test cases using the vehicle function information to be tested and a preset signal matrix table. The vehicle function information includes at least one vehicle function identifier, and the test cases include the input signal and / or output signal corresponding to each vehicle function identifier.

[0027] The processing module is also used to utilize the vehicle function information to be tested and the simulation information in the preset simulation model, wherein the vehicle function information includes at least one vehicle function identifier, and the simulation information includes at least one simulation parameter identifier.

[0028] The relationship establishment module is used to establish target mapping relationship information between simulation information and a preset signal matrix table. This target mapping relationship information includes simulation parameters associated with each simulation parameter identifier.

[0029] The processing module is also used to generate a first target test script in a first preset text format based on the test case and target mapping relationship information.

[0030] In some possible implementations of the second aspect, the acquisition module is further configured to acquire a preset signal matrix table in a second preset text format and vehicle function information in a second preset text format.

[0031] The processing module is further configured to search for a first identifier matching each vehicle function identifier in a preset signal matrix table in a second preset text format according to a preset data reading tool, and to read the input signal and / or output signal corresponding to each first identifier, wherein each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal.

[0032] The processing module is also used to add the input signal and / or output signal corresponding to the first identifier to the vehicle function information in the second preset text format, corresponding to each vehicle function identifier, to obtain test cases.

[0033] In some possible implementations of the second aspect, the acquisition module is further configured to acquire a preset signal matrix table in a second preset text format and simulation information in a second preset text format.

[0034] The processing module is also used to find the second identifier that matches each simulation parameter identifier from a preset signal matrix table in a second preset text format according to a preset data mapping tool, and to establish a mapping between the simulation parameter identifier and the matching second identifier to obtain the target mapping relationship information.

[0035] In this context, each second identifier in the preset signal matrix table is associated with preset simulation parameters.

[0036] Thirdly, this application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the test script generation method of the first aspect or any implementable method of the first aspect.

[0037] Fourthly, this application provides a readable storage medium storing computer program instructions, which, when executed by a processor, implement the test script generation method described in the first aspect or any implementable mode of the first aspect.

[0038] This application discloses a test script generation method, apparatus, device, and readable storage medium. It can automatically search for input signals and / or output signals corresponding to vehicle function identifiers in a preset signal matrix table, thereby generating test cases using the vehicle function information to be tested and the preset signal matrix table. Next, using the vehicle function information to be tested and simulation information in a preset simulation model, it automatically establishes a target mapping relationship between the simulation information and the preset signal matrix table. Then, based on the test cases and the target mapping relationship, it can automatically generate a first target test script in a first preset text format. The entire test script generation process is fully automated, saving significant manpower and effectively improving test script generation efficiency. Furthermore, there is no strong correlation between the various steps in generating the test script, and all interfaces are loosely coupled, allowing testers to monitor the test script generation process in real time, providing high flexibility. Attached Figure Description

[0039] 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. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart illustrating a test script generation method provided in an embodiment of this application;

[0041] Figure 2 This is a schematic diagram of another process for generating test scripts provided in an embodiment of this application;

[0042] Figure 3This is a schematic diagram of the structure of a test script generation device provided in an embodiment of this application;

[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0045] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0046] With the development of vehicle automatic control technology, vehicles are increasingly featuring comfort, safety, and connectivity functions. To ensure the safety and reliability of vehicles during their use after leaving the production line, testing is necessary before they are put into operation. Currently, to improve testing efficiency, methods such as Hardware-in-the-Loop (HIL) testing are often used, which employs HIL models to perform tests on behalf of actual vehicles.

[0047] However, in HIL-based testing, testers typically begin by manually writing test cases for vehicle functions and then building execution scripts based on these test cases. As the number of vehicle functions requiring testing increases, manually writing test cases and generating test scripts is becoming increasingly inefficient.

[0048] In view of this, embodiments of this application provide a test script generation method, apparatus, device, and readable storage medium, which can effectively improve the generation efficiency of test scripts.

[0049] The test script generation method provided in the embodiments of this application is described below with reference to the accompanying drawings.

[0050] Figure 1 A flowchart illustrating a test script generation method according to an embodiment of this application is shown. Figure 1 As shown, the method may include steps 110 to 140.

[0051] Step 110: Generate test cases using the vehicle function information to be tested and the preset signal matrix table.

[0052] The vehicle function information includes at least one vehicle function identifier, and the test cases include the input signal and / or output signal corresponding to each vehicle function identifier.

[0053] Step 120: Utilize the functional information of the vehicle to be tested and the simulation information in the preset simulation model.

[0054] The vehicle function information includes at least one vehicle function identifier, and the test cases include the input signal and / or output signal corresponding to each vehicle function identifier.

[0055] Step 130: Establish the target mapping relationship information between simulation information and preset signal matrix table.

[0056] The target mapping relationship information includes the simulation parameters associated with each simulation parameter identifier.

[0057] Step 140: Generate the first target test script in the first preset text format based on the test case and target mapping relationship information.

[0058] In some embodiments, vehicle functions include the operational functions of a processor and controller within the vehicle, the detection functions of sensors within the vehicle, and so on. For example, the operational functions of a controller may include gear shifting, braking, speed control, and so on, which will not be listed here. When testing each vehicle function, a control signal needs to be sent to the object under test. By analyzing the test values ​​generated when the object under test executes the corresponding function according to the control signal, the test results can be obtained.

[0059] Optionally, the vehicle function information to be tested can be an approved electronic control unit (ECU) function signal file, such as the "Automotive VCU Function Specification".

[0060] In some embodiments, the preset signal matrix table may include signal identification information and corresponding signal values ​​involved in the vehicle function testing process. Since a preset signal matrix table may contain tens of thousands of signals, but not all of these signals will be used in the test, in order to improve data processing speed and save test case generation time, the preset signal matrix table may only retain signal identification information related to vehicle function information and corresponding signal values, and may also retain the signal value corresponding to each simulation parameter identifier.

[0061] During each test case generation process, the input and / or output signals corresponding to the vehicle function identifiers can be found from a pre-defined signal matrix table. Optionally, the vehicle function identifier can be information such as signal name and signal sequence number.

[0062] Regarding step 110 above, test cases are generated based on the vehicle function information to be tested and the preset signal matrix table. Specifically, this may include: obtaining the preset signal matrix table in a second preset text format and the vehicle function information in a second preset text format; using a preset data reading tool to find the first identifier matching each vehicle function identifier in the preset signal matrix table in the second preset text format, and reading the input signal and / or output signal corresponding to each first identifier, wherein each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal; and in the vehicle function information in the second preset text format, adding the input signal and / or output signal corresponding to each vehicle function identifier to obtain the test cases.

[0063] Specifically, the second preset text format can be Excel format. The preset signal matrix can be saved directly in Excel format. When generating test cases, the preset data reading tool can be used to easily read out the vehicle function identification and the corresponding input and / or output signals in the preset signal matrix.

[0064] For example, the second preset format is a file format that the preset data reading tool can recognize. Taking a Python tool as an example, the preset data reading tool can be the table reading function of the xlrd and xlrt libraries in Python, which can find the first identifier that matches each vehicle function identifier from the preset signal matrix table. The preset data reading tool can use enumeration, boundary value analysis when combining symbols such as ">", "<", "≥", and "≤", etc., to find the first identifier that matches each vehicle function identifier.

[0065] Using a preset data reading tool, the input signal and / or output signal corresponding to each first identifier are read, and for each vehicle function identifier, the input signal and / or output signal corresponding to the first identifier are added to the vehicle function information in a second preset text format, thereby obtaining test cases.

[0066] Optionally, in the second preset text format of vehicle function information, signal identification information and step description information can be added to each line to facilitate testers to view and understand the test cases.

[0067] According to the embodiments of this application, test cases for automatically generating vehicle function information are implemented.

[0068] In some embodiments, step 130 above, establishing the target mapping relationship information between the simulation information and the preset signal matrix table, may specifically include: obtaining a preset signal matrix table in a second preset text format and simulation information in a second preset text format; searching for a second identifier matching each simulation parameter identifier in the preset signal matrix table in the second preset text format according to a preset data mapping tool; and establishing a mapping between the simulation parameter identifier and the matching second identifier to obtain the target mapping relationship information, wherein each second identifier in the preset signal matrix table is associated with a preset simulation parameter.

[0069] Specifically, during the testing of hardware in a vehicle, a preset simulation model can be used to replace the actual vehicle; for example, the preset simulation model could be a HIL model.

[0070] To enable automated testing, simulation information in a second preset text format can be directly exported from the HIL model. This simulation information includes at least one simulation parameter identifier, allowing us to understand the simulation parameters required by the HIL model. Next, a preset data mapping tool can be used to find a second identifier matching each simulation parameter identifier in a preset signal matrix table in the second preset text format. For example, a preset data mapping tool could be a fuzzy string matching toolkit (fuzzywuzzy). Using the fuzzy string matching toolkit, the second identifier matching each simulation parameter identifier in the preset signal matrix table in the second preset text format can be automatically mapped to the simulation parameter identifier, obtaining the target mapping relationship information.

[0071] The preset signal matrix table can include signal identifiers and corresponding signal parameters involved in the vehicle function testing process. Therefore, according to the preset data mapping tool, a second identifier matching each simulation parameter identifier can be automatically found from the preset signal matrix table in a second preset text format.

[0072] By establishing a mapping between the simulation parameter identifiers in the preset simulation model and the second identifier in the preset signal matrix table, the target mapping relationship can be obtained. Based on this, when testing based on the preset simulation model, for example, the signal parameters corresponding to the simulation parameter identifiers can be quickly found according to the target mapping relationship, i.e., the parameters that need to be used during the operation of the preset simulation model.

[0073] In this embodiment of the application, involving step 140 above, a first target test script in a first preset text format can be directly generated based on the test case and target mapping relationship information.

[0074] For example, the first preset format is a file format that the testing software can directly recognize and parse. For instance, testing software built using Python can directly recognize and parse .txt files. The first preset text format can be a .txt text file.

[0075] According to the embodiments of this application, the entire test script generation process is fully automated, which can save a lot of manpower and effectively improve the efficiency of test script generation. Furthermore, there is no strong correlation between the various steps in generating the test script, and all interfaces are loosely coupled, allowing testers to monitor the test script generation process in real time, resulting in high flexibility.

[0076] In some embodiments, after obtaining the first target test script in the first preset text format, the method further includes: testing the preset simulation model according to the first target test script in the first preset text format, and generating a test report of the preset simulation model, wherein the test report includes the test results corresponding to each vehicle function identifier.

[0077] Optionally, the test report can be in PDF format. Based on this, the PyPDF2 library in Python can be used to analyze the report, derive a list of functional defects, and provide preliminary improvement suggestions.

[0078] It is understandable that the specific conditions for the vehicle function corresponding to the first signal identification information to pass the test can be set according to the test standards of each vehicle function, and will not be listed one by one here.

[0079] In some embodiments, testing a preset simulation model based on a first target test script in a first preset text format and generating a test report for the preset simulation model may further include: identifying third identifiers in the first target test script in the first preset text format that do not match each vehicle function identifier and each simulation parameter identifier; deleting the third identifiers and their associated information from the first target test script in the first preset text format to obtain a second target test script in the first preset text format; and testing the preset simulation model based on the second target test script in the first preset text format and generating a test report for the preset simulation model.

[0080] According to the embodiments of this application, by deleting the third identifier that does not match each simulation parameter identifier, the signal import time can be shortened, and only signals related to vehicle function information and simulation information can be retained, thereby improving the generation efficiency of test scripts.

[0081] To illustrate the embodiments of this application more clearly, the following examples are provided. Figure 2 This is a schematic diagram of another process for generating test scripts provided in an embodiment of this application, combined with... Figure 2 As shown.

[0082] First, import the vehicle function information in the second preset text format and the preset signal matrix table in the second preset text format into the preset data reading tool to generate test cases.

[0083] The second preset text format can be Excel format, the vehicle function information includes at least one vehicle function identifier, and the preset data reading tool is, for example, the Python-based xlrd and xlwt tools.

[0084] Next, the simulation information in the second preset text format and the preset signal matrix table in the second preset text format are imported into the preset data mapping tool.

[0085] The simulation information comes from a preset simulation model and includes at least one simulation parameter identifier. A preset data mapping tool can automatically establish a target mapping relationship between the simulation information and the preset signal matrix table; that is, the simulation parameters associated with each simulation parameter identifier within the target mapping relationship.

[0086] Then, based on the test cases and target mapping information, the first target test script in the first preset text format is generated.

[0087] Optionally, the testing software built on Python can directly recognize and parse the txt file format, and correspondingly, the first preset text format can be the txt text format.

[0088] Optionally, after generating the first target test script, when the vehicle function information to be tested changes, the changed vehicle function information and the preset signal matrix table can be re-imported into the preset data reading tool to iteratively update the first target test script.

[0089] In this embodiment of the application, after generating the first target test script, the preset simulation model can be tested according to the first target test script, and a test report of the preset simulation model can be generated.

[0090] The test report may include the test results corresponding to each vehicle function identifier. Optionally, the test report may be in PDF format.

[0091] According to the embodiments of this application, the PyPDF2 library for reading and writing PDF files in Python can be used to perform report analysis, obtain a list of functional defects and preliminary improvement suggestions.

[0092] According to the embodiments of this application, test scripts are automatically generated, thereby saving a significant amount of manpower and ensuring the consistency of test cases across different test projects. Furthermore, since the processes of generating and using test scripts are loosely coupled, testers can manually modify them at any step, greatly improving flexibility.

[0093] Based on the same inventive concept, this application also provides a test script generation apparatus 300 corresponding to the above-described test script generation method. Specifically, in conjunction with... Figure 3 Please provide a detailed explanation.

[0094] Figure 3 This is a schematic diagram of the structure of a test script generation device provided in an embodiment of this application, as shown below. Figure 3 As shown, the test script generation device 300 may include a processing module 310 and a relationship establishment module 320.

[0095] Processing module 310 is used to generate test cases using the vehicle function information to be tested and a preset signal matrix table. The vehicle function information includes at least one vehicle function identifier, and the test cases include input signals and / or output signals corresponding to each vehicle function identifier.

[0096] The processing module 310 is further configured to utilize the vehicle function information to be tested and the simulation information in the preset simulation model, wherein the vehicle function information includes at least one vehicle function identifier, and the simulation information includes at least one simulation parameter identifier.

[0097] The relationship establishment module 320 is used to establish target mapping relationship information between simulation information and a preset signal matrix table. This target mapping relationship information includes simulation parameters associated with each simulation parameter identifier.

[0098] The processing module 310 is also used to generate a first target test script in a first preset text format based on the test case and target mapping relationship information.

[0099] In some embodiments, the apparatus further includes:

[0100] The acquisition module is also used to acquire a preset signal matrix table in a second preset text format and vehicle function information in a second preset text format.

[0101] Processing module 310 is further configured to use a preset data reading tool to search for a first identifier that matches each vehicle function identifier in a preset signal matrix table in a second preset text format, and to read the input signal and / or output signal corresponding to each first identifier, wherein each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal.

[0102] The processing module 310 is also used to add the input signal and / or output signal corresponding to the first identifier to the vehicle function information in the second preset text format, corresponding to each vehicle function identifier, to obtain test cases.

[0103] In some embodiments, the acquisition module is further configured to acquire a preset signal matrix table in a second preset text format and simulation information in a second preset text format.

[0104] Processing module 310 is further configured to search for a second identifier matching each simulation parameter identifier in a preset signal matrix table in a second preset text format according to a preset data mapping tool, and establish a mapping between the simulation parameter identifier and the matching second identifier to obtain target mapping relationship information.

[0105] In this context, each second identifier in the preset signal matrix table is associated with preset simulation parameters.

[0106] In some embodiments, a preset simulation model is tested according to a first target test script in a first preset text format, and a test report of the preset simulation model is generated.

[0107] The test report includes the test results corresponding to each vehicle function identifier.

[0108] In some embodiments, the processing module 310 is further configured to search for a third identifier in the first target test script of a first preset text format that does not match each vehicle function identifier and does not match each simulation parameter identifier.

[0109] Processing module 310 is further configured to delete the third identifier and the information associated with the third identifier in the first target test script of the first preset text format, thereby obtaining the second target test script of the first preset text format.

[0110] The processing module 310 is also used to test the preset simulation model according to the second target test script in the first preset text format and generate a test report of the preset simulation model.

[0111] It is understood that the test script generation device 300 in this application embodiment can correspond to the execution subject of the test script generation method provided in this application embodiment. The specific details of the operation and / or function of each module / unit of the test script generation device 300 can be found in the description of the corresponding part in the test script generation method of this application embodiment above. For the sake of brevity, it will not be repeated here.

[0112] The test script generation device of this application embodiment can automatically search for input signals and / or output signals corresponding to vehicle function identifiers from a preset signal matrix table. It then uses the vehicle function information to be tested and the preset signal matrix table to generate test cases. Next, using the vehicle function information to be tested and simulation information in a preset simulation model, it automatically establishes a target mapping relationship between the simulation information and the preset signal matrix table. Based on the test cases and the target mapping relationship, it can automatically generate a first target test script in a first preset text format. The entire test script generation process is fully automated, saving significant manpower and effectively improving test script generation efficiency. Furthermore, there is no strong correlation between the various steps in generating the test script, and all interfaces are loosely coupled. Therefore, testers can monitor the test script generation process in real time, offering high flexibility.

[0113] Figure 4 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Figure 4 As shown, the device may include a processor 401 and a memory 402 storing computer program instructions.

[0114] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0115] Memory 402 may include mass storage for information or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one instance, memory 402 may include removable or non-removable (or fixed) media, or memory 402 may be a non-volatile solid-state memory. Memory 402 may be internal or external to an electronic device.

[0116] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0117] The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement the method described in the embodiments of this application and achieve the corresponding technical effects achieved by executing the method in the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0118] In one example, the electronic device may also include a communication interface 403 and a bus 410. Wherein, as... Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.

[0119] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0120] Bus 410 includes hardware, software, or both, that couples components of an online information flow metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0121] The electronic device can execute the test script generation method in the embodiments of this application, thereby achieving the corresponding technical effects of the test script generation method described in the embodiments of this application.

[0122] Furthermore, in conjunction with the test script generation method in the above embodiments, this application embodiment can provide a readable storage medium for implementation. This readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the test script generation methods in the above embodiments. Examples of readable storage media can be non-transitory machine-readable media, such as electronic circuits, semiconductor memory devices, read-only memory (ROM), floppy disks, compact disc read-only memory (CD-ROM), optical discs, hard disks, etc.

[0123] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0124] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0125] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0126] This application also provides a readable storage medium storing computer program instructions; when executed by a processor, the computer program instructions implement the test script generation method provided in this application.

[0127] Furthermore, by combining the test script generation method, apparatus, and readable storage medium described in the above embodiments, this application embodiment can provide a computer program product for implementation. When the instructions in the computer program product are executed by the processor of an electronic device, the electronic device causes the electronic device to execute any of the test script generation methods described in the above embodiments.

[0128] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0129] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for generating test scripts, characterized in that, The method includes: Test cases are generated using the vehicle function information to be tested and a preset signal matrix table. The vehicle function information includes at least one vehicle function identifier, the test cases include input signals and / or output signals corresponding to each vehicle function identifier, and the preset signal matrix table includes signal identifier information related to the vehicle function information and signal values ​​corresponding to the signal identifier information. The method utilizes the vehicle's functional information to be tested and simulation information from a preset simulation model, wherein the vehicle functional information includes at least one vehicle functional identifier, and the simulation information includes at least one simulation parameter identifier. Establish a target mapping relationship between the simulation information and the preset signal matrix table, wherein the target mapping relationship information includes simulation parameters associated with each simulation parameter identifier. Based on the test cases and the target mapping relationship information, a first target test script in a first preset text format is generated.

2. The method according to claim 1, characterized in that, Based on the vehicle function information to be tested and the preset signal matrix table, test cases are generated, including: Obtain a preset signal matrix table in a second preset text format and vehicle function information in the second preset text format. Using a preset data reading tool, a first identifier matching each vehicle function identifier is searched in a preset signal matrix table in the second preset text format, and the input signal and / or output signal corresponding to each first identifier is read. Each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal. In the vehicle function information in the second preset text format, for each vehicle function identifier, add the input signal and / or output signal corresponding to the first identifier to obtain the test case.

3. The method according to claim 1, characterized in that, Establishing the target mapping relationship between the simulation information and the preset signal matrix table includes: Obtain the preset signal matrix table in the second preset text format and the simulation information in the second preset text format. According to the preset data mapping tool, a second identifier matching each simulation parameter identifier is found in the preset signal matrix table of the second preset text format, and a mapping is established between the simulation parameter identifier and the matching second identifier to obtain the target mapping relationship information. In the preset signal matrix table, each of the second identifiers is associated with the preset simulation parameters.

4. The method according to claim 1, characterized in that, After generating a first target test script in a first preset text format based on the test cases and the target mapping relationship information, the method further includes: Based on the first target test script in the first preset text format, the preset simulation model is tested, and a test report of the preset simulation model is generated. The test report includes the test results corresponding to each of the vehicle function identifiers.

5. The method according to claim 4, characterized in that, Based on the first target test script in the first preset text format, the preset simulation model is tested, and a test report of the preset simulation model is generated, including: Locate the third identifier in the first target test script of the first preset text format that does not match each of the vehicle function identifiers and each of the simulation parameter identifiers. Delete the third identifier and the information associated with the third identifier from the first target test script in the first preset text format to obtain the second target test script in the first preset text format. The preset simulation model is tested according to the second target test script in the first preset text format, and a test report of the preset simulation model is generated.

6. A test script generation device, characterized in that, The device includes: The processing module is used to generate test cases using the vehicle function information to be tested and a preset signal matrix table. The vehicle function information includes at least one vehicle function identifier, the test cases include input signals and / or output signals corresponding to each vehicle function identifier, and the preset signal matrix table includes signal identifier information related to the vehicle function information and signal values ​​corresponding to the signal identifier information. The processing module is further configured to utilize the vehicle function information to be tested and the simulation information in the preset simulation model, wherein the vehicle function information includes at least one vehicle function identifier, and the simulation information includes at least one simulation parameter identifier. The relationship establishment module is used to establish target mapping relationship information between the simulation information and the preset signal matrix table, wherein the target mapping relationship information includes simulation parameters associated with each simulation parameter identifier. The processing module is further configured to generate a first target test script in a first preset text format based on the test cases and the target mapping relationship information.

7. The apparatus according to claim 6, characterized in that, The device further includes: The acquisition module is also used to acquire a preset signal matrix table in a second preset text format and vehicle function information in the second preset text format. The processing module is further configured to use a preset data reading tool to search for a first identifier that matches each of the vehicle function identifiers in a preset signal matrix table in the second preset text format, and to read the input signal and / or output signal corresponding to each first identifier, wherein each first identifier in the preset signal matrix table corresponds to a preset input signal and / or output signal. The processing module is further configured to add the input signal and / or output signal corresponding to the first identifier to the vehicle function information in the second preset text format, corresponding to each vehicle function identifier, to obtain the test case.

8. The apparatus according to claim 6, characterized in that, The acquisition module is also used to acquire a preset signal matrix table in a second preset text format and the simulation information in the second preset text format. The processing module is further configured to use a preset data mapping tool to find a second identifier that matches each of the simulation parameter identifiers from a preset signal matrix table in the second preset text format, and to establish a mapping between the simulation parameter identifiers and the matching second identifiers to obtain the target mapping relationship information. In the preset signal matrix table, each of the second identifiers is associated with the preset simulation parameters.

9. An electronic device, characterized in that, The device includes: a processor, and a memory storing computer program instructions. The processor reads and executes the computer program instructions to implement the test script generation method as described in any one of claims 1-5.

10. A readable storage medium, characterized in that, The readable storage medium stores computer program instructions, which, when executed by a processor, implement the test script generation method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • ECU automatic test method and system, storage medium and device

    CN112068530A