A DID automatic testing method, system and storage medium

By writing diagnostic framework scripts and generating CDD configuration files through CAPL, the problem that existing technologies cannot be universally applied to various projects and are inefficient is solved, and the automation and high efficiency of DID testing are achieved, which is universal.

CN115168179BActive Publication Date: 2025-09-12FORYOU GENERAL ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210552575.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-09-12
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

Existing diagnostic testing technologies cannot be applied to all projects and have low testing efficiency.

Method used

Use CAPL to write diagnostic framework scripts, generate CDD configuration files, traverse the DID configuration information of the ECU, and realize the automation of DID diagnostic tests.

Benefits of technology

It improves test efficiency, realizes automatic reading and testing of DID test scripts, has high versatility, and can be ported to other projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168179B_ABST
    Figure CN115168179B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of automobile testing technology, and provides a diagnostic DID automatic testing method, system and storage medium. CAPL is used to write a new CDD file based on a CDDT template file, and a diagnostic general framework is obtained to write a diagnostic framework script. After receiving a diagnostic request, the corresponding ECU to be debugged is set, and each DID configuration information in the diagnostic framework script is traversed and written into the ECU to be debugged for DID diagnostic testing. The automatic reading and testing of the DID test script is realized, and the test efficiency can be improved. Based on the general test framework, it can also be transplanted to other projects for continued use, and has high versatility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile testing technology, and in particular to a diagnostic DID automatic testing method, system and storage medium. Background Art

[0002] Currently, the diagnostic testing of the Unified Diagnostic Services (UDS) of vehicle controllers is mainly divided into two aspects: diagnostic protocol layer testing and diagnostic functional testing. Diagnostic functional testing is usually performed using a diagnostic instrument, while diagnostic protocol layer testing is performed using CAN bus development tools.

[0003] There are two main ways to execute diagnostic commands:

[0004] 1. Manual execution: The most basic way to execute diagnostic commands is manual execution. In this method, each command must be executed manually, which is not only complicated but also inefficient.

[0005] 2. Call the CDD (CANdela Diagnostic Descriptions) service. CAPL (CAN Access Programming Language) directly calls the relevant diagnostic services in CDD to automatically execute diagnostic commands. However, this method can only be used on a single project and cannot be universally applied to all projects. Summary of the Invention

[0006] The present invention provides a diagnostic DID automatic testing method, system and storage medium, which solves the technical problems that the existing diagnostic testing technology cannot be universally applied to various projects and has low testing efficiency.

[0007] To solve the above technical problems, the present invention provides a method for automatically testing a DID, comprising the steps of:

[0008] S1. Use CAPL to write the diagnostic framework script according to the target test items;

[0009] S2. Issue a diagnostic request and set the ECU to be debugged;

[0010] S3. Call the diagnostic framework script and obtain all corresponding DID configuration information from it;

[0011] S4. Traverse each DID configuration information and control the ECU to be debugged to perform a DID diagnostic test.

[0012] In a further embodiment, in step S1, the diagnostic framework script includes at least diagnostic data, diagnostic procedures, and diagnostic algorithms;

[0013] The compilation of the diagnostic data includes:

[0014] A. Generate CDD configuration file;

[0015] B. Reading a CDD configuration file and obtaining raw diagnostic data from the CDD configuration file;

[0016] C. extracting diagnostic data from the raw diagnostic data, converting the diagnostic data into a byte array, and determining its byte length;

[0017] D. Set the diagnostic request size and addressing mode according to the byte length.

[0018] In a further embodiment, step A comprises the steps of:

[0019] A1. Create a new CDD file based on the CDDT template file, and determine the target class of the CDD file according to the target test items and CAPL;

[0020] A2. Edit the corresponding DID name, service type, and corresponding data resolution relationship in the DID library of the CDD file;

[0021] A3. Edit the DID data type to obtain the DID configuration information.

[0022] In a further embodiment, the data type of the DID includes integer data Raw Value, enumeration data Text Table, and linear data Linear.

[0023] In a further embodiment, in step A1: the target class includes a read-write type and a read-only type.

[0024] In a further embodiment, step S4 comprises:

[0025] S41, traverse each DID configuration information and determine whether it is of read-write type. If so, proceed to step S42; if not, proceed to step S43;

[0026] S42, writing the diagnostic data into the ECU to be debugged, performing a DID diagnostic test, reading response data output by the ECU to be debugged, comparing the diagnostic data with the response data to obtain a test result and saving the result;

[0027] S43: Read the diagnostic data in the DID configuration information, compare the diagnostic data with the expected data, obtain the test results, and save them.

[0028] This basic solution uses CAPL to write a new CDD file based on the CDDT template file, obtains the diagnostic general framework to write the diagnostic framework script, sets the corresponding ECU to be debugged after receiving the diagnostic request, traverses each DID configuration information in the diagnostic framework script, and writes it into the ECU to be debugged for DID diagnostic testing, realizing automatic reading and testing of the DID test script, which can improve test efficiency; based on the general test framework, it can also be transplanted to other projects for continued use, with high versatility.

[0029] The present invention also provides a diagnostic DID automatic test system for implementing the diagnostic DID automatic test method described above, comprising a test framework module, a framework call module, a DID traversal module, a test module, a data reading and writing module connected in sequence, a diagnostic request module connected to the framework call module, an ECU setting module connected to the test module, wherein the diagnostic request module is connected to the ECU setting module;

[0030] The test framework module is used to write a diagnostic framework script using CAPL according to the target test items;

[0031] The diagnosis request module is used to send a diagnosis request;

[0032] The framework calling module is used to call the diagnosis framework script when receiving the diagnosis request;

[0033] The ECU setting module is used to set the ECU to be debugged when receiving the diagnosis request;

[0034] The DID traversal module is used to sequentially traverse each DID configuration information from the diagnosis framework script and send it to the test module;

[0035] The test module is used to control the ECU to be debugged to perform a DID diagnostic test according to the DID configuration information;

[0036] The data reading and writing module is used to write the diagnostic data into the ECU to be debugged and read the response data, or read the diagnostic data and expected data in the DID configuration information.

[0037] The present invention also provides a storage medium having a computer program stored thereon, the computer program being loaded by the above-mentioned diagnostic DID automatic test system to implement the above-mentioned diagnostic DID automatic test method. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a workflow diagram of a DID automatic testing method provided by an embodiment of the present invention;

[0039] Figure 2 This is a system framework diagram of a DID automatic test system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following describes the embodiments of the present invention in detail with reference to the accompanying drawings. The embodiments are provided for illustrative purposes only and are not to be construed as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of protection of the present invention. Many changes may be made to the present invention without departing from the spirit and scope of the present invention.

[0041] Example 1

[0042] An embodiment of the present invention provides a method for automatically testing a DID. Figure 1 As shown, in this embodiment, steps S1 to S4 are included:

[0043] S1. Use CAPL to write the diagnostic framework script according to the target test items;

[0044] In this embodiment, the diagnostic framework script includes at least diagnostic data, a diagnostic process, and a diagnostic algorithm. Specifically, the diagnostic data, diagnostic process, and diagnostic algorithm in the diagnostic framework script are written using CAPL based on the target test items to be performed. The diagnostic process and diagnostic algorithm are conventionally written using CAPL and are therefore not further described in this embodiment.

[0045] CAPL stands for CAN Access Programming Language, an event-based modeling language that supports bus events, attribute events, and time events. DID stands for Data ID, or Data Identifier.

[0046] In this embodiment, the compilation of diagnostic data includes steps A to D:

[0047] A. Generate CDD configuration file, including steps A1 to A3:

[0048] A1. Create a new CDD file based on the CDDT template file and determine the target class of the CDD file according to the target test items and CAPL;

[0049] The target class includes read-write support and read-only support. CDD stands for CANdela Diagnostic Descriptions.

[0050] A2. Edit the corresponding DID name, service type, and corresponding data resolution relationship in the DID library of the CDD file;

[0051] A3. Edit the DID data type to obtain the DID configuration information.

[0052] DID data types include integer data Raw Value, enumeration data Text Table, and linear data Linear.

[0053] B. Read the CDD configuration file and obtain the original diagnostic data from the CDD configuration file;

[0054] Specifically, the original diagnostic data is obtained through the CAPL diagGetPrimitiveData function.

[0055] C. Extract diagnostic data from the original diagnostic data, convert the diagnostic data into a byte array, and determine its byte length;

[0056] Specifically, the diagnostic string (i.e., the string of diagnostic data) is converted into a byte array through the Arrays.toString() conversion function.

[0057] D. Set the diagnostic request size and addressing mode according to the byte length.

[0058] Specifically, the diagResize() function is used to set the diagnostic request size. The addressing method can be selected as required, such as physical addressing.

[0059] S2. Send a diagnostic request through the diagSendRequest() function and set the ECU to be debugged through the diagSetTarget() function;

[0060] S3. Call the diagnostic framework script and obtain all corresponding DID configuration information from it;

[0061] S4. Traverse each DID configuration information and control the ECU to be debugged to perform DID diagnostic test, including steps S41 to S43:

[0062] S41. Traverse each DID configuration information and determine whether it is of read-write type. If so, proceed to step S42; if not, proceed to step S43.

[0063] S42: Write the diagnostic data to the ECU to be debugged, perform the DID diagnostic test, wait for a preset time (the specific time is set according to the actual test process), read the response data output by the ECU to be debugged, compare the diagnostic data with the response data, obtain the test result, and save it;

[0064] In this embodiment, when the DID configuration information is identified as read-write type, two tests will be performed: prediction and actual measurement. Therefore, for each read-write type DID configuration information, two different data will be written into the ECU to be debugged: prediction data and actual measurement data.

[0065] S43. Read the diagnostic data in the DID configuration information, compare the diagnostic data with the expected data, obtain the test results and save them.

[0066] The embodiment of the present invention adopts CAPL to write a new CDD file based on the CDDT template file, obtains a general diagnostic framework to write a diagnostic framework script, sets the corresponding ECU to be debugged after receiving a diagnostic request, traverses each DID configuration information in the diagnostic framework script, and writes it into the ECU to be debugged to perform a DID diagnostic test, thereby realizing automatic reading and testing of the DID test script, and improving test efficiency; based on the general test framework, it can also be transplanted to other projects for continued use, and has high versatility.

[0067] Example 2

[0068] The reference numerals in the accompanying drawings of this embodiment include: test framework module 1, framework calling module 2, DID traversal module 3, test module 4, data reading and writing module 5, diagnosis request module 6, and ECU setting module 7.

[0069] The embodiment of the present invention also provides a diagnostic DID automatic test system for implementing the diagnostic DID automatic test method as described above, see Figure 2 : It includes a test framework module 1, a framework calling module 2, a traversal DID module 3, a test module 4, a data reading and writing module 5, which are connected in sequence, as well as a diagnostic request module 6 connected to the framework calling module 2, and an ECU setting module 7 connected to the test module 4. The diagnostic request module 6 is connected to the ECU setting module 7;

[0070] The test framework module 1 is used to write the diagnostic framework script using CAPL according to the target test items;

[0071] The diagnosis request module 6 is used to send a diagnosis request;

[0072] The framework calling module 2 is used to call the diagnosis framework script when receiving a diagnosis request;

[0073] The ECU setting module 7 is used to set the ECU to be debugged when receiving a diagnosis request;

[0074] The DID traversal module 3 is used to sequentially traverse each DID configuration information from the diagnostic framework script and send it to the test module 4;

[0075] The test module 4 is used to control the ECU to be debugged to perform DID diagnostic tests according to the DID configuration information;

[0076] The data reading and writing module 5 is used to write the diagnostic data into the ECU to be debugged and read the response data, or read the diagnostic data and expected data in the DID configuration information.

[0077] The test system provided in this embodiment uses various modules to implement various steps in the test method, providing a hardware foundation for the test method and facilitating the implementation of the method.

[0078] Example 3

[0079] An embodiment of the present invention further provides a storage medium having a computer program stored thereon, which is configured to be loaded by the diagnostic DID automatic test system of the above-mentioned embodiment 2 to implement the diagnostic DID automatic test method of the above-mentioned embodiment 1. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0080] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A diagnostic DID automatic testing method, characterized in that: Including steps: S1. Use CAPL to write the diagnostic framework script according to the target test items; S2. Issue a diagnostic request and set the ECU to be debugged; S3. Call the diagnostic framework script and obtain all corresponding DID configuration information from it; S4, traversing each of the DID configuration information, and controlling the ECU to be debugged to perform a DID diagnostic test; In the step S1, the diagnostic framework script includes at least diagnostic data, diagnostic procedures and diagnostic algorithms; The compilation of the diagnostic data includes: A. Generate CDD configuration file; B. Reading a CDD configuration file and obtaining raw diagnostic data from the CDD configuration file; C. extracting diagnostic data from the raw diagnostic data, converting the diagnostic data into a byte array, and determining its byte length; D. Set the diagnostic request size and addressing mode according to the byte length.

2. A DID automatic testing method according to claim 1, characterized in that: The step A comprises the steps of: A1. Create a new CDD file based on the CDDT template file, and determine the target class of the CDD file according to the target test items and CAPL; A2. Edit the corresponding DID name, service type, and corresponding data resolution relationship in the DID library of the CDD file; A3. Edit the DID data type to obtain the DID configuration information.

3. The automatic DID diagnostic test method according to claim 2, wherein: The data types of the DID include integer data Raw Value, enumeration data Text Table, and linear data Linear.

4. A DID automatic testing method as claimed in claim 2, characterized in that In the step A1: the target class includes a read-write support type and a read-only support type.

5. A DID automatic testing method according to claim 4, characterized in that: The step S4 comprises: S41, traverse each DID configuration information and determine whether it is of read-write type. If so, proceed to step S42; if not, proceed to step S43; S42, writing the diagnostic data into the ECU to be debugged, performing a DID diagnostic test, reading response data output by the ECU to be debugged, comparing the diagnostic data with the response data to obtain a test result and saving the result; S43: Read the diagnostic data in the DID configuration information, compare the diagnostic data with the expected data, obtain the test results, and save them.

6. A diagnostic DID automatic test system, configured to implement the diagnostic DID automatic test method according to any one of claims 1 to 5, characterized in that: It includes a test framework module, a framework calling module, a traversal DID module, a test module, a data reading and writing module connected in sequence, a diagnostic request module connected to the framework calling module, and an ECU setting module connected to the test module, wherein the diagnostic request module is connected to the ECU setting module; The test framework module is used to write a diagnostic framework script using CAPL according to the target test items; The diagnosis request module is used to send a diagnosis request; The framework calling module is used to call the diagnosis framework script when receiving the diagnosis request; The ECU setting module is used to set the ECU to be debugged when receiving the diagnosis request; The DID traversal module is used to obtain all corresponding DID configuration information from the diagnostic framework script, traverse each DID configuration information in sequence, and send it to the test module; The test module is used to control the ECU to be debugged to perform a DID diagnostic test according to the DID configuration information; The data reading and writing module is used to write the diagnostic data into the ECU to be debugged and read the response data, or read the diagnostic data and expected data in the DID configuration information.

7. A storage medium having a computer program stored thereon, characterized in that: The computer program is used to be loaded by a diagnostic DID automatic test system according to claim 6 to implement a diagnostic DID automatic test method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Diagnosis method, vehicle, system and storage medium

    CN112652089A