Vehicle-mounted instrument fault code testing method and device and storage medium

By setting test cases of fault codes, including automatically obtaining the fault code to be tested and standard, and configuring comparison rules, the problem of difficult to automatically batch test on-board instrument failure codes in the existing technology is solved, and efficient and automatic testing is achieved process to adapt to the needs of changes in fault codes.

CN119459324APending Publication Date: 2025-02-18DONGFENG ELECTRONICS TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411461026.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art is difficult to automatically and batchally test the correctness of the on-board instrument fault code, especially how to efficiently integrate it into the original test system when the fault code changes.

Method used

By setting test cases for fault codes, including automatically obtaining the fault code to be tested and standard fault codes, and configuring comparison rules, an automated test process is formed. This process includes importing the fault code to be tested in the fault code database, extracting the standard fault code generated during the fault alarm, and automatically comparing according to the comparison rules.

Benefits of technology

Automatic and batch fault code testing is realized, basically no manual intervention is required, and the test efficiency and accuracy are high. When the fault code changes, you only need to modify the database, and the generation and operation methods of the test cases do not need to be modified. It is very practical and has a good user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119459324A_ABST
    Figure CN119459324A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted instrument fault code testing method and device and a storage medium, and relates to the field of information comparison. The method comprises the following steps: setting a test case of a fault code, wherein the test case comprises an acquisition mode and a comparison rule of a to-be-tested fault code and a standard fault code; and comparing the to-be-tested fault code with the standard fault code template by running the test case to obtain a test result. According to the method, an acquisition mode for automatically acquiring the to-be-tested fault code and the standard fault code is set, and a comparison mode is configured, so that when the test case formed on the basis runs, the fault codes can be automatically tested in batches, manual intervention is basically not needed, and the test efficiency and precision are relatively high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information comparison, and in particular to a method, a device and a storage medium for testing a vehicle-mounted instrument fault code. Background Art

[0002] The instrument function fault code function has many nodes, such as ECU, DCU, AMT, EPB, ABS, ECAS, EHPS, etc., and there may be thousands of fault codes for these nodes. Testing whether the fault code is correct has always been a "must-have" technology in the industry, although it is basic, but the workload is large, especially when the fault code changes (mainly modification and addition), how to integrate the changed fault code into the original fault code correct test system in an efficient way. Summary of the invention

[0003] In view of the defects existing in the prior art, the technical problem solved by the present invention is: how to automatically and batch-wise test the correctness of fault codes.

[0004] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a method for testing a vehicle instrument fault code, the method comprising the following steps: setting a test case for the fault code, the test case including an acquisition method and a comparison rule for a fault code to be tested and a standard fault code; and obtaining a test result by running the test case to compare the fault code to be tested with a standard fault code template;

[0005] The method of obtaining the fault code to be tested is as follows: creating a script for importing and sending the fault code to be tested in the fault code database;

[0006] The method of obtaining the standard fault code is as follows: according to the format of the fault code recognition template, the standard fault code generated during the fault alarm is extracted to form a standard fault code template;

[0007] The comparison rules include test results corresponding to whether the specified conditions are met.

[0008] In conjunction with the first aspect, in one implementation, the process of the method includes:

[0009] Importing the fault code to be tested into the fault code database, and setting a method for obtaining the fault code to be tested;

[0010] Setting a method for obtaining the standard fault code;

[0011] Set the comparison rules between the fault code to be tested and the standard fault code;

[0012] After generating and executing the test case according to the set acquisition method and the comparison rule, the test result is obtained.

[0013] In combination with the first aspect, in one implementation, the process of setting the method for obtaining the fault code to be tested includes: creating corresponding system variables according to the fault code to be tested in the fault code database, and creating a script for sending the code to be tested according to the system variables.

[0014] In combination with the first aspect, in one implementation, setting the execution process of the method for obtaining the fault code to be tested includes: creating corresponding system variables according to the fault code to be tested in the fault code database, and creating a script for sending the code to be tested according to the system variables.

[0015] In combination with the first aspect, in one implementation, the process of setting the method for obtaining the standard fault code includes: creating a fault code recognition template, obtaining the standard fault code generated during a fault alarm, and matching it with the format of the fault code recognition template.

[0016] In combination with the first aspect, in one implementation, the execution process of setting the method for obtaining the standard fault code includes:

[0017] Add an image processing module control for calling the camera in Labview, and add an OCR recognition script formed according to the fault code recognition template through the image processing module control;

[0018] Write a test case file in vTESTstudio to call the fault code to be tested to trigger the alarm;

[0019] Import the test case file into Canoe and run it. Use Labview to obtain the alarm pop-up window information generated when the test case file is running. Use the OCR recognition script to identify and extract the standard fault code in the alarm pop-up window.

[0020] In combination with the first aspect, in one embodiment, the process of setting the comparison rules between the fault code to be tested and the standard fault code includes: setting a similarity threshold between the fault code to be tested and the standard fault code, defining the comparison rules as: above the similarity threshold represents a test pass, and less than the similarity threshold represents a test fail; setting a process for comparing the fault code to be tested and the standard fault code according to the comparison rules.

[0021] In conjunction with the first aspect, in one implementation, the execution process of setting the comparison rule between the fault code to be tested and the standard fault code includes: creating a shared variable for outputting the test result in Labview;

[0022] Shared variable output result: Create a share variable control in Labview and associate it with the shared variable.

[0023] In a second aspect, an embodiment of the present application provides a system for testing a vehicle instrument fault code, characterized in that the system is used to implement the steps of the method provided in the first aspect.

[0024] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that a test program for a vehicle-mounted instrument fault code is stored on the computer-readable storage medium, wherein when the test program for the vehicle-mounted instrument fault code is executed, the steps of the method provided in the first aspect are implemented.

[0025] Compared with the prior art, the advantages of the present invention are:

[0026] The present invention provides a method for automatically acquiring the fault code to be tested (imported through a database) and the standard fault code (extracted when an alarm is triggered) and configures a comparison method. When the test case formed on this basis is run, the fault codes can be tested automatically and in batches, basically without the need for human intervention, and the test efficiency and accuracy are both high.

[0027] At the same time, when the fault code changes, the present invention only needs to modify the database accordingly, and the generation and operation methods of the test cases do not need to be modified. This is very practical and provides a good user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 The figure is a flow chart of a method for testing a vehicle instrument fault code according to an embodiment of the present invention;

[0030] Figure 2 A schematic diagram of a use environment in an embodiment of the present invention;

[0031] Figure 3 The figure is a schematic diagram of the hardware structure of the vehicle instrument fault code testing equipment involved in the embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0033] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0034] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0035] In a first aspect, an embodiment of the present application provides a method for testing a vehicle instrument fault code, the method comprising: setting a test case for the fault code, the test case including a method for obtaining a fault code to be tested and a standard fault code template, and a comparison rule between the fault code to be tested and the standard fault code; and obtaining a test result by running the test case to compare the fault code to be tested and the standard fault code template.

[0036] The method of obtaining the fault code to be tested is as follows: creating a script for importing and sending the fault code to be tested in the fault code database;

[0037] The standard fault code template is obtained by: extracting the standard fault code generated during the fault alarm according to the format of the fault code identification template to form a standard fault code template;

[0038] The comparison rules include test results corresponding to whether the specified conditions are met.

[0039] It can be seen from this that the present invention sets up a method for automatically acquiring the fault code to be tested (imported through a database) and the standard fault code (extracted when an alarm is triggered) and configures a comparison method. When the test case formed on this basis is run, the fault code can be tested automatically and in batches, basically without the need for human intervention, and the test efficiency and accuracy are both high.

[0040] At the same time, when the fault code changes, the present invention only needs to modify the database accordingly, and the generation and operation methods of the test cases do not need to be modified. This is very practical and provides a good user experience.

[0041] See also Figure 1 As shown, the timing flow of the above method includes:

[0042] S1: Import the fault code to be tested into the fault code database; create a script for importing and sending the fault code to be tested into the fault code database;

[0043] S2: according to the format of the fault code recognition template, obtain the standard fault code generated during the fault alarm to form a standard fault code template;

[0044] S3: Setting comparison rules between the fault code to be tested and the standard fault code, the comparison rules including whether the test result corresponding to the specified condition is met;

[0045] S4: Generate test cases based on S1 to S3;

[0046] S5: Execute the test case and output the test results.

[0047] In one embodiment, the process of S1 includes: creating corresponding system variables according to the fault code to be tested in the fault code database, and creating a script for sending the code to be tested according to the system variables. Taking the fault to be tested as dm1 fault code (automobile engine fault code) as an example, the execution method in actual use can be:

[0048] Establish the Canoe (system-level bus network development and testing tool) project: import key files such as DBC (CAN Database) and CDD (Controller Description Document) for ECU communication configuration and signal definition in Canoe, create system variables associated with DM1, and write a CAPL script for sending DM1 fault codes.

[0049] In one embodiment, the process of S2 includes: creating a fault code recognition template, calling the camera to obtain the standard fault code generated when the fault alarm is generated and matching it with the format of the fault code recognition template. The actual execution method in use can be:

[0050] Add an image processing module control (visionassistant, which is used to call the camera) in the back panel of Labview (graphic programming software), double-click vision assistant to add an OCR recognition script formed according to the fault code recognition template, and the script is completed by selecting the control.

[0051] Import the above Canoe project into vTESTstudio (a tool for writing scripts and generating test cases), and write a test case file (in the .vtuexe format) in vTESTstudio to call the system variables corresponding to the fault code to be tested to trigger the dm1 alarm.

[0052] Import the test case file into Canoe and run it. Use Labview to obtain the alarm pop-up window text information generated when the test case file is running (run Labview while the code trigger script is running, and stop running Labview when the dm1 pop-up window alarm appears to obtain it). Use the OCR recognition script to identify and extract the standard fault code in the alarm pop-up window (that is, match the standard fault code in the alarm pop-up window with the fault code recognition template).

[0053] In one embodiment, the process of S3 includes: setting a similarity threshold between the fault code to be tested and the standard fault code, defining a comparison rule as follows: above the similarity threshold means the test has passed, and below the similarity threshold means the test has failed; setting a process for comparing the fault code to be tested and the standard fault code according to the comparison rule. The actual execution method in use may be:

[0054] Create shared variables: Create shared variables in the Labview project file, and establish the same system variables on the front panel. After adding the shared variable in Labview, check the variable in the Labview configuration under the Canoe environment variable. The shared variable can output the test results of the test case and can be called by Canoe.

[0055] Shared variable output results: Create a new shared variable control on the Labview back panel and associate it with the above shared variable. At this time, you can compare the standard fault code template obtained above with the actual fault code to be tested and output the test results.

[0056] In one embodiment, the process of S4 and S5 includes:

[0057] Test case generation: Create a new test unit under the vTESTstudio project, create a new testcase under the test unit, write a script to set Labview to start executing the block diagram, calibrate the engine type, send a CAN button signal to automatically switch to the instrument's DM1 fault code display interface, initialize the fault code, and send DM1 fault codes in batches at fixed intervals. Output the execution results through shared variables. After the script is written, generate the testcase.vtuexe file.

[0058] Execute test cases and analyze test results: Import the vtuexe script file in the Test congfiguration of the Canoe tool, then execute the test cases, generate test reports, and analyze test results.

[0059] The above method is described below through a specific embodiment.

[0060] In this embodiment, the hardware environment includes a programmable power supply, an OBD-DB9 connector, a VT System (VT7001-1, VT2004-1, VT2516-1, VT2848-1, etc.), a camera, etc.; the software environment requires the use of Canoe, NI Labview, vTESTstudio, and CANDelaStudio special test software tools.

[0061] See also Figure 2 As shown, the usage environment of the above hardware and software is:

[0062] The programmable power supply is mainly connected to the board VT system and supplies power to the VT board, and supplies power to the ECU under test through VT7001.

[0063] VT system can provide I / O signals, resistance signals, and fault injection signals to the instrument.

[0064] The camera is connected to the industrial computer and the camera function is called through Labview software to capture instrument pictures or pop-up text information, color, etc., and compared with the created standard modules including pictures, text information and color.

[0065] Industrial control computers are installed with special testing tool software such as Canoe, Labview, vTESTstudio, CANDelaStudio, etc.

[0066] The workflow of this embodiment includes:

[0067] Step A, Canoe imports dbc, cdd, etc., generates a test panel, creates dm1-related system variables, and writes a CAPL script to implement dm1 sending, which will be used for vTESTstudio to send dm1 fault calls later.

[0068] Step B: Add shared variables in Labview, create a string recognition module, add the vision assistant module, and double-click the vision assistant control to add the OCR recognition script.

[0069] Step C: Write a test case for sending DM1 fault in vTESTstudio to generate the testcase.vtuexe file, import the file in Canoe and execute it, run Labview and stop running after the DM1 pop-up window appears, train the pop-up window string through the OCR script, and save it after training for comparison with the text information of the actual DM1 pop-up window.

[0070] Step D: After the string recognition module is created, a system variable is created on the Labview back panel. The system variable is associated with the shared variable added to Labview before. The trained string is compared with the actual string popped up by dm1, and the execution result is output.

[0071] Step E: Create a new testcase in vTESTstudio. The steps include setting up the flowchart of Labview to perform string recognition, sending the can key signal to automatically jump to the instrument fault code interface, initializing the DM1 fault code, sending the DM1 fault code in batches at fixed intervals, and judging whether the actual DM1 fault code pop-up information is consistent with the trained characters, and generating the testcase.vtuexe script file (attached Figure 3 ).

[0072] Step F: Import testcase.vtuexe into the Test configuration of the Canoe tool, execute the test case, output the test report, and analyze the test results.

[0073] In a second aspect, an embodiment of the present application further provides a system for testing a vehicle instrument fault code, which is used to implement the steps of the method provided in the first aspect.

[0074] In a third aspect, an embodiment of the present application provides a vehicle instrument fault code testing device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0075] Reference Figure 3 , Figure 3 The hardware structure diagram of the vehicle instrument fault code test device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the vehicle instrument fault code test device may include a processor, a memory, a communication interface and a communication bus.

[0076] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0077] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to interconnect the devices inside the test equipment for vehicle instrument fault code, and the interface used to interconnect the test equipment for vehicle instrument fault code with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0078] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0079] The processor may be a general-purpose processor, and the general-purpose processor may call the test program of the vehicle instrument fault code stored in the memory, and execute the test method of the vehicle instrument fault code provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). Among them, the method executed when the test program of the vehicle instrument fault code is called may refer to the various embodiments of the test method of the vehicle instrument fault code of the present application, which will not be repeated here.

[0080] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0081] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0082] The computer-readable storage medium of the present application stores a test program for an on-board instrument fault code, wherein when the test program for the on-board instrument fault code is executed by a processor, the steps of the on-board instrument fault code test method as described above are implemented.

[0083] Among them, the method implemented when the test program of the vehicle instrument fault code is executed can refer to the various embodiments of the test method of the vehicle instrument fault code of the present application, and will not be repeated here.

[0084] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0086] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0087] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0088] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0089] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0091] The above are only specific implementations of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and these modifications or replacements should be included in the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for testing a vehicle instrument fault code, characterized in that: The method comprises the following steps: setting a test case of a fault code, wherein the test case includes an acquisition method and a comparison rule of a fault code to be tested and a standard fault code; and obtaining a test result by running the test case to compare the fault code to be tested with a standard fault code template; The method of obtaining the fault code to be tested is as follows: creating a script for importing and sending the fault code to be tested in the fault code database; The method of obtaining the standard fault code is as follows: according to the format of the fault code recognition template, the standard fault code generated during the fault alarm is extracted to form a standard fault code template; The comparison rules include test results corresponding to whether the specified conditions are met.

2. The method for testing the fault code of the vehicle instrument as claimed in claim 1, characterized in that: The process of this method includes: Importing the fault code to be tested into the fault code database, and setting a method for obtaining the fault code to be tested; Setting a method for obtaining the standard fault code; Set the comparison rules between the fault code to be tested and the standard fault code; After generating and executing the test case according to the set acquisition method and the comparison rule, the test result is obtained.

3. The method for testing the fault code of the vehicle instrument as claimed in claim 2, characterized in that: The process of setting the acquisition method of the to-be-tested fault code includes: creating corresponding system variables according to the to-be-tested fault codes in the fault code database, and creating a to-be-tested code sending script according to the system variables.

4. The method for testing the fault code of the vehicle instrument as claimed in claim 3, characterized in that: The execution process of setting the acquisition method of the to-be-tested fault code includes: creating corresponding system variables according to the to-be-tested fault codes in the fault code database, and creating a to-be-tested code sending script according to the system variables.

5. The method for testing the fault code of the vehicle instrument as claimed in claim 2, characterized in that: The process of setting the method for obtaining the standard fault code includes: creating a fault code recognition template, obtaining the standard fault code generated during the fault alarm, and matching it with the format of the fault code recognition template.

6. The method for testing the fault code of the vehicle instrument as claimed in claim 5, characterized in that: The execution process of setting the method for obtaining the standard fault code includes: Add an image processing module control for calling the camera in Labview, and add an OCR recognition script formed according to the fault code recognition template through the image processing module control; Write a test case file in vTESTstudio to call the fault code to be tested to trigger the alarm; Import the test case file into Canoe and run it. Use Labview to obtain the alarm pop-up window information generated when the test case file is running. Use the OCR recognition script to identify and extract the standard fault code in the alarm pop-up window.

7. The method for testing the fault code of the vehicle instrument as claimed in claim 2, characterized in that: The process of setting the comparison rules between the fault code to be tested and the standard fault code includes: setting a similarity threshold between the fault code to be tested and the standard fault code, defining the comparison rule as follows: above the similarity threshold represents a test pass, and below the similarity threshold represents a test fail; setting a process for comparing the fault code to be tested and the standard fault code according to the comparison rule.

8. The method for testing the fault code of the vehicle instrument as claimed in claim 7, characterized in that: The execution process of setting the comparison rule between the fault code to be tested and the standard fault code includes: creating a shared variable for outputting the test result in Labview; Shared variable output result: Create a share variable control in Labview and associate it with the shared variable.

9. A vehicle instrument fault code testing system, characterized in that: The system is used to implement the steps of the method described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a test program for an on-board instrument fault code, wherein when the test program for the on-board instrument fault code is executed, the steps of the on-board instrument fault code test method according to any one of claims 1 to 8 are implemented.