Automatic diagnosis test method and device, electronic equipment, storage medium and program product

Through automated testing methods, test cases in table data are read and parsed, and test commands are executed by using the test system to solve the problems of low code reuse and high maintenance costs in the existing UDS test methods, and efficient and accurate automated testing is achieved.

CN119597633APending Publication Date: 2025-03-11CONTINENTAL SMART CORE TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410636485.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing UDS testing methods have large workload, low code reuse rate, high maintenance costs due to manual code writing, and different test specifications of different vehicle manufacturers, resulting in poor code reuse.

Method used

By reading the table data of storing test cases, parsing and saving them to a preset array, the test system uses the test system to execute multiple diagnostic test command information of the test cases in sequence to achieve automated testing.

Benefits of technology

It improves the reuse rate of code, reduces maintenance costs, improves testing efficiency, reduces misjudgment of manual judgments, and improves the correctness of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597633A_ABST
    Figure CN119597633A_ABST
Patent Text Reader

Abstract

The invention provides an automatic diagnosis test method and device, electronic equipment, a storage medium and a program product. The automatic diagnosis test method comprises the steps that table data used for storing at least one group of test cases is read, each group of test cases comprises multiple pieces of diagnosis test command information, and the diagnosis test command information comprises addressing modes and test steps; analyzing a group of test cases in the table data, and storing the test cases in a preset array; and sequentially executing the multiple pieces of diagnosis test command information of the group of test cases by utilizing the test system and based on the preset array in which the group of test cases are stored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of diagnostic testing technology, and in particular to an automatic diagnostic testing method, device, electronic device, storage medium and program product. Background Art

[0002] Unified Diagnostic Services (UDS) allows diagnostic tools to communicate with a vehicle's electronic control unit (ECU) to diagnose and resolve faults.

[0003] Different vehicle manufacturers usually have their own test specifications, and automotive parts suppliers need to complete the test according to the specific steps of each vehicle manufacturer. However, if UDS testing is implemented by manually writing code, the workload is particularly large, and because different vehicle manufacturers have different test specifications, the reuse rate of handwritten code is particularly low, and the maintenance of the code is high. Summary of the invention

[0004] The present disclosure is completed to solve the above-mentioned problems, and its purpose is to provide an automatic diagnostic test method, device, electronic device, storage medium and program product, which can improve code reuse rate, reduce maintenance cost and improve test efficiency.

[0005] According to one aspect of the present disclosure, there is provided an automatic diagnostic test method, comprising: reading table data for storing at least one group of test cases, each group of test cases comprising a plurality of diagnostic test command information, the diagnostic test command information comprising an addressing mode and a test step; parsing a group of test cases in the table data and saving them to a preset array; and sequentially executing the plurality of diagnostic test command information of the group of test cases using a test system and based on the preset array storing a group of test cases.

[0006] Preferably, the test steps include two types: diagnostic commands and specific test actions.

[0007] Preferably, the diagnostic test order information also includes expected results.

[0008] Preferably, the test system is used to sequentially execute multiple diagnostic test command information of a group of test cases based on the preset array that stores a group of test cases. If a test step in a diagnostic test command information is a specific test action, the corresponding command is triggered to execute the specific test action.

[0009] Preferably, a test system is used to sequentially execute multiple diagnostic test command information of a group of test cases based on the preset array that stores a group of test cases. If the test step in a diagnostic test command information is a diagnostic command, it further includes: generating a diagnostic command message based on the addressing mode and test steps in the diagnostic test command information, and sending the diagnostic command message; receiving a diagnostic command reply message; parsing the diagnostic command reply message to determine whether the diagnostic command reply is consistent with the expected result in the diagnostic test command information; and if they are consistent, writing the result of passing the test into the test report, and if they are inconsistent, writing the result of failing the test into the test report.

[0010] Preferably, each group of test cases is provided with a test case ID, a group of test cases in the table data is parsed and saved in a preset array, and a group of test cases is selected based on the test column ID.

[0011] Preferably, before using the test system and sequentially executing multiple diagnostic test command information of a group of test cases based on the preset array that stores a group of test cases, it further includes: setting preset parameters for determining whether the diagnostic test is UDS on CAN or UDS on DoIP, generating a diagnostic command message based on the addressing mode and test steps in the diagnostic test command information, and sending the diagnostic command message, applying different framing protocols according to the preset parameters, and adding an Ethernet header to the diagnostic command message when it is determined that the diagnostic test is UDS on DoIP according to the preset parameters, and parsing the diagnostic command reply message, when it is determined that the diagnostic test is UDS on DoIP according to the preset parameters, first removing the Ethernet header and then parsing.

[0012] Preferably, the table data includes at least one of EXCEL table data, database table data and WPS table data.

[0013] According to another aspect of the present disclosure, an automatic diagnostic test device is provided, comprising: a reading unit, which reads table data for storing at least one group of test cases, each group of test cases containing multiple diagnostic test command information, and the diagnostic test command information includes an addressing mode and a test step; a parsing unit, which parses a group of test cases in the table data and saves them to a preset array; and a testing unit, which uses a testing system and sequentially executes multiple diagnostic test command information of the group of test cases based on the preset array storing a group of test cases.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method described in the above aspect.

[0015] According to another aspect of the present disclosure, a computer storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or the at least one program is loaded by a processor and executes the method according to the above aspect of claim 1.

[0016] According to another aspect of the present disclosure, a computer program product is provided, comprising at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded by a processor and executes the method according to the above aspect of claim 1 . BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a flowchart of the automatic diagnosis test method provided by the embodiment of the present disclosure.

[0018] Figure 2 It is an example of the table data provided by the embodiment of the present disclosure.

[0019] Figure 3 It is a structural block diagram of the automatic diagnosis and testing device provided by an embodiment of the present disclosure.

[0020] Figure 4 It is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0022] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0023] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0024] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0025] The present disclosure provides an automatic diagnosis test method, device, electronic device, storage medium and program product, which can improve code reuse rate, reduce maintenance cost and improve test efficiency.

[0026] Figure 1 It is a flowchart of the automatic diagnostic test method provided by the embodiment of the present disclosure. This specification provides method operation steps such as the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or server product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).

[0027] S101: Reading table data for storing at least one group of test cases, each group of test cases including a plurality of diagnostic test command information, wherein the diagnostic test command information includes an addressing mode and a test step.

[0028] The table data stores at least one group of test cases, and each group of test cases contains multiple diagnostic test command information, and the diagnostic test command information includes at least an addressing mode and a test step. Among them, the test steps include two types: diagnostic commands and specific test actions, and for the case where the test step is a diagnostic command, an addressing mode for UDS is set. In the case where the test step is a specific test action, there is no need to set the addressing mode. In addition, the diagnostic test command information may also include an expected result for comparison with the reply message of the diagnostic command to automatically determine the diagnostic test result. In the case where the test step is a specific test action, there is no need to set the expected result.

[0029] Each group of test cases may be provided with a test case ID, and the test case ID may correspond one-to-one to each vehicle manufacturer, for example, so that the test case specific to the corresponding vehicle manufacturer may be read through the test case ID.

[0030] In addition, the table data includes at least one of EXCEL table data, database table data and WPS table data.

[0031] Figure 2 This is an example of the table data provided by the embodiment of the present disclosure. This embodiment uses an EXCEL file to carry test case data, and the EXCEL file stores test cases that have been pre-edited and debugged. This example includes a group of test cases E, and the test case ID of this group of test cases is the OEM_ID recorded in the first column and the first row. The second column of the table is the addressing mode, the third column is the test steps, and the fourth column is the expected result.

[0032] like Figure 2 As shown, the test case ID can be set only in the first cell of a group of test cases, thereby indicating that the group of test cases is the test case of a corresponding vehicle manufacturer.

[0033] Figure 2 In the third column of the table data example, the test steps in the second and third rows represent diagnostic commands, which are 22 01 and 22 02 respectively. There will be a diagnostic command reply after the diagnostic command is sent. Therefore, the expected result of the test is also preset in the fourth column of expected result. Figure 2 The third column and the fourth to eighth rows of the table data example represent specific test actions. When the test steps are specific test actions, the addressing mode and expected results may not be set.

[0034] S102: Parse a group of test cases in the table data and save them into an initialized preset array.

[0035] In the case where test case IDs are set for various test cases in the table data, when a group of test cases in the table data is parsed, a group of test cases can be selected based on the test column ID. For example, when performing diagnostic tests automatically using software, the test case ID can be specified in advance, so that in step S102, only a group of test cases whose test case ID is the specified test case ID is selected. After parsing the selected group of test cases, they are saved to a preset array, which is set according to the format of the table data, and can save multiple diagnostic test command information of a group of test cases line by line, and ensure that any group of test cases in the table data can be accommodated. Of course, before each test case is saved, the preset array is initialized.

[0036] S103: Utilizing the test system and based on a preset array storing a group of test cases, sequentially execute multiple diagnostic test command information of the group of test cases.

[0037] The multiple pieces of diagnostic test command information of a group of test cases are stored line by line in a preset array, so the test system can execute the multiple pieces of diagnostic test command information of the group of test cases in sequence based on the preset array.

[0038] As mentioned above, the test steps include two types: diagnostic commands and specific test actions. If the test step in a diagnostic test command message is a specific test action, the corresponding command is triggered to execute the specific test action. For example, if the test step in a diagnostic test command message is "Power Off", the power-off action is executed. If the test step in a diagnostic test command message is a diagnostic command, it further includes the following sub-steps:

[0039] (1) Generate a diagnostic command message based on the addressing mode and test steps in the diagnostic test command information, and send the diagnostic command message.

[0040] (2) Receive the diagnostic command reply message.

[0041] (3) Parsing the diagnostic command reply message to determine whether the diagnostic command reply is consistent with the expected result in the diagnostic test command information. Parsing the diagnostic command reply message may be to extract the portion of the diagnostic command reply message related to the reply result, parse it into the format shown by the expected result in the diagnostic test command information, and then compare it with the expected result to determine whether the two are consistent.

[0042] (4) If they are consistent, the result of passing the test will be written into the test report; if they are inconsistent, the result of failing the test will be written into the test report.

[0043] In the automatic diagnostic test method of this embodiment, a preset parameter can be set to determine whether the diagnostic test is UDS on CAN or UDS on DoIP. Among them, UDS on CAN refers to UDS based on the controller area network bus (CAN, Controller Area Network), and UDS on DoIP refers to UDS based on Ethernet. The automatic diagnostic test method of this embodiment further includes a step of setting a preset parameter for determining whether the diagnostic test is UDS on CAN or UDS on DoIP, which step can be performed before step S103.

[0044] When the preset parameters are set, in sub-step (1) of step S103, different frame transmission protocols are applied according to the preset parameters, and when the preset parameters indicate that the diagnostic test is UDS on DoIP, an Ethernet header needs to be added to the diagnostic command message.

[0045] In addition, when the preset parameters are set, in sub-step (3) of step S103, when the preset parameters indicate that the diagnostic test is UDS on DoIP, the Ethernet header is first removed and then parsed.

[0046] According to the present disclosure, only the table data needs to be maintained, and the rest of the code can be fixed without modification, thereby increasing the code reuse rate and reducing maintenance costs. In addition, by having a machine determine whether the diagnostic command reply is consistent with the expected result, it can reduce the misjudgment of manual judgment and improve the accuracy, and undoubtedly improve the test efficiency.

[0047] Figure 3 FIG. 2 shows a structural block diagram of an automatic diagnostic test device provided by an embodiment of the present disclosure. Figure 3 As shown, the automatic diagnosis and testing device 200 includes: a reading unit 201 , a parsing unit 202 and a testing unit 203 .

[0048] The reading unit 201 reads table data for storing at least one group of test cases, each group of test cases includes multiple diagnostic test command information, and the diagnostic test command information includes addressing mode and test steps. The parsing unit 202 parses a group of test cases in the table data and saves them to a preset array. The testing unit 203 uses the test system and sequentially executes multiple diagnostic test command information of the group of test cases based on the preset array storing the group of test cases.

[0049] Figure 4 is a structural block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 4 As shown, the present disclosure also provides an electronic device 300, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method described in the above embodiment.

[0050] The present disclosure also provides a computer storage medium, in which at least one instruction or at least one program is stored. The at least one instruction or at least one program is loaded by a processor to execute the method described in the above embodiment.

[0051] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0052] The present disclosure also provides a computer program product, including at least one instruction or at least one program segment, characterized in that the at least one instruction or the at least one program segment is loaded by a processor and executes the method described in the above embodiment.

[0053] Those skilled in the art should be able to appreciate that the modules, units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0054] Although the present disclosure has been described with reference to the current specific embodiments, those skilled in the art should recognize that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features disclosed in the present disclosure (but not limited to) with similar functions.

Claims

1. An automatic diagnostic test method, characterized in that: include: Reading table data for storing at least one group of test cases, each group of test cases comprising a plurality of diagnostic test command information, wherein the diagnostic test command information comprises an addressing mode and a test step; Parsing a set of test cases in the table data and saving them to a preset array; as well as The test system is used to sequentially execute multiple diagnostic test command information of a group of test cases based on the preset array storing a group of test cases.

2. The automatic diagnostic test method according to claim 1, characterized in that: The test steps include two types: diagnostic commands and specific test actions.

3. The automatic diagnostic test method according to claim 2, characterized in that: The diagnostic test order information also includes an expected result.

4. The automatic diagnostic test method according to claim 3, characterized in that: Using the test system and based on the preset array storing a group of test cases, the plurality of diagnostic test command information of the group of test cases are sequentially executed, If the test step in a diagnostic test command message is a specific test action, a corresponding command is triggered to execute the specific test action.

5. The automatic diagnostic test method according to claim 3, characterized in that: Using the test system and based on the preset array storing a group of test cases, the plurality of diagnostic test command information of the group of test cases are sequentially executed, If the test step in a diagnostic test command message is a diagnostic command, it further includes: Generate a diagnostic command message based on the addressing mode and test steps in the diagnostic test command information, and send the diagnostic command message; Receive diagnostic command reply message; Parsing the diagnostic command reply message to determine whether the diagnostic command reply is consistent with the expected result in the diagnostic test command information; and If they are consistent, the result of passing the test will be written into the test report; if they are inconsistent, the result of failing the test will be written into the test report.

6. The automatic diagnostic test method according to any one of claims 1 to 5, characterized in that: Each group of test cases is provided with a test case ID. A group of test cases in the table data is parsed and saved into a preset array, and a group of test cases is selected based on the test column ID.

7. The automatic diagnostic test method according to claim 5, characterized in that: Before using the test system and sequentially executing multiple diagnostic test command information of the group of test cases based on the preset array storing the group of test cases, the method further includes: setting a preset parameter for determining whether the diagnostic test is UDS on CAN or UDS on DoIP, Generate a diagnostic command message based on the addressing mode and test steps in the diagnostic test command information, and in sending the diagnostic command message, apply different frame transmission protocols according to preset parameters, and add an Ethernet header to the diagnostic command message when it is determined according to the preset parameters that the diagnostic test is UDS on DoIP. In parsing the diagnostic command reply message, when it is determined according to preset parameters that the diagnostic test is UDS on DoIP, the Ethernet header is first removed and then parsed.

8. The automatic diagnostic test method according to any one of claims 1 to 5, characterized in that: The table data includes at least one of EXCEL table data, database table data and WPS table data.

9. An automatic diagnostic test device, characterized in that: include: A reading unit, the reading unit reading table data for storing at least one group of test cases, each group of test cases including a plurality of diagnostic test command information, the diagnostic test command information including an addressing mode and a test step; A parsing unit, which parses a set of test cases in the table data and saves them into a preset array; as well as A test unit utilizes a test system and sequentially executes multiple diagnostic test command information of a group of test cases based on the preset array storing a group of test cases.

10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the method according to any one of claims 1 to 8.

11. A computer storage medium, characterized in that: The storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by a processor and executes the method according to any one of claims 1 to 8.

12. A computer program product, comprising at least one instruction or at least one program, characterized in that: The at least one instruction or the at least one program is loaded by a processor and executes the method according to any one of claims 1 to 8.