UDS diagnostic service test case generation method and related equipment
By automatically generating UDS diagnostic service test cases, the problems of complex generation process and insufficient efficiency in existing technologies are solved, and efficient test case generation and unified coverage are achieved.
Patent Information
- Application Number
- CN202510594284.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-10-03
AI Technical Summary
The existing UDS diagnostic service test case generation process is complex and tedious, and inefficient, resulting in insufficient coverage.
By obtaining the project information of the target diagnostic project, determining the target diagnostic service type, selecting a matching configuration table from the preset configuration table, and automatically generating target diagnostic service test cases based on the project information and test case template file.
It realizes the automatic generation of diagnostic service test cases, saves manual writing time, and improves test efficiency and coverage.
Smart Images

Figure CN120743744A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for generating a UDS diagnostic service test case and related equipment. Background Art
[0002] Vehicle diagnostics is the process of detecting and locating vehicle faults. It is a critical software function for ensuring vehicle safety and performance. The most commonly used vehicle diagnostic protocol is Unified Diagnostic Services (UDS), an application-layer protocol based on the ISO 14229 standard. It uses a "question-and-answer" model, where the diagnostic tool sends a diagnostic service request to the vehicle's Electronic Control Unit (ECU). The ECU responds accordingly and returns the response to the diagnostic tool, allowing for quick and accurate identification of vehicle faults and their causes, providing a reliable basis for development and maintenance.
[0003] Diagnostic services are both the most important and complex functions in vehicle software development. Currently, UDS diagnostic service test cases are manually written based on the diagnostic service support information provided in the diagnostic questionnaire and combined with test cases from previous projects. Due to the large number of diagnostic service service identifiers (SIDs), the testing workload is high, and the diagnostic service requirements vary from project to project. This often requires testers to spend a significant amount of time writing diagnostic service test cases, making it difficult to ensure adequate test coverage. Summary of the Invention
[0004] In order to solve the above technical problems, embodiments of the present application provide a method and device for generating a UDS diagnostic service test case, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] In order to solve the above technical problems, the present application provides a method for generating a UDS diagnostic service test case, comprising:
[0006] Obtain project information of target diagnostic project;
[0007] Determining the target diagnostic service type of the target diagnostic item;
[0008] Selecting a configuration table that matches the target diagnostic service type from the preset configuration tables as the initial configuration table;
[0009] Based on the project information and the initial configuration table, obtaining a target configuration table corresponding to the target diagnostic project;
[0010] Based on the target diagnosis service type, the target configuration table and a preset test case template file, a target diagnosis service test case matching the target diagnosis item is obtained.
[0011] The beneficial effects are:
[0012] In the technical solution provided in the embodiments of the present application, by obtaining the project information of the target diagnostic project; determining the target diagnostic service type of the target diagnostic project; selecting a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table; based on the project information and the initial configuration table, obtaining the target configuration table corresponding to the target diagnostic project; based on the target diagnostic service type, the target configuration table and the preset test case template file, obtaining the target diagnostic service test case that matches the target diagnostic project. In this way, the present application realizes the automatic generation of diagnostic service test cases, saving the time of manually writing test cases. It only needs to obtain the project information of the target diagnostic project to generate a diagnostic service test case that matches the current project, which greatly improves the test efficiency while ensuring the uniformity of the diagnostic service test and the coverage of the test cases.
[0013] In a second aspect, the present invention provides a device for generating a UDS diagnostic service test case, comprising an acquisition unit, a type unit, a configuration table selection unit, a processing unit, and a generation unit;
[0014] An acquisition unit, used to acquire project information of a target diagnostic project;
[0015] A type unit, configured to determine a target diagnostic service type of the target diagnostic item;
[0016] A configuration table selection unit, configured to select a configuration table that matches the target diagnostic service type from a preset configuration table as an initial configuration table;
[0017] a processing unit, configured to obtain a target configuration table corresponding to the target diagnostic item based on the item information and the initial configuration table;
[0018] A generating unit is used to obtain a target diagnosis service test case that matches the target diagnosis item based on the target diagnosis service type, the target configuration table and a preset test case template file.
[0019] In a third aspect, the present application also provides an electronic device comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the method for generating UDS diagnostic service test cases as described above.
[0020] In a fourth aspect, the present application also provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method for generating a UDS diagnostic service test case as described above.
[0021] In a fifth aspect, the present application further provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method for generating a UDS diagnostic service test case provided in the various optional embodiments described above.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, serving to explain the principles of the present application. It is obvious that the drawings described below are merely some embodiments of the present application, and a person of ordinary skill in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0024] Figure 1 This is a flowchart of a method for generating a UDS diagnostic service test case, shown in an exemplary embodiment of the present application;
[0025] Figure 2 is a schematic diagram of a basic service configuration table in an exemplary embodiment of the present application;
[0026] Figure 3 is a schematic diagram of a fixed service configuration table in an exemplary embodiment of the present application;
[0027] Figure 4 is a schematic diagram of a variable service configuration table in an exemplary embodiment of the present application;
[0028] Figure 5 is a schematic diagram of a data identifier configuration table in an exemplary embodiment of the present application;
[0029] Figure 6 This is a block diagram of a device for generating a UDS diagnostic service test case, as shown in an exemplary embodiment of the present application;
[0030] Figure 7 It is a structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0032] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0033] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0034] In this application, "plurality" refers to two or more. "And / or" describes the relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0035] In order to solve the problem that the existing diagnostic service test case generation process is complicated and cumbersome, and the lack of efficiency leads to insufficient coverage, the embodiments of the present application propose a UDS diagnostic service test case generation method and device, electronic device, and computer-readable storage medium, which mainly involve the UDS diagnostic service test case generation technology included in the data processing technology. These embodiments will be described in detail below.
[0036] First see Figure 1 , Figure 1 This is a flowchart of a method for generating a UDS diagnostic service test case, as illustrated by an exemplary embodiment of the present application. This method can be specifically executed by a server, which can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, without limitation.
[0037] like Figure 1 As shown, in an exemplary embodiment, the method for generating a UDS diagnostic service test case may include steps S101 to S105, which are described in detail as follows:
[0038] Step S101: Acquire project information of a target diagnostic project.
[0039] Step S102: determining a target diagnosis service type of a target diagnosis item.
[0040] Step S103 : Selecting a configuration table that matches the target diagnostic service type from the preset configuration tables as an initial configuration table.
[0041] Step S104: obtaining a target configuration table corresponding to the target diagnosis item based on the item information and the initial configuration table.
[0042] Step S105 : obtaining a target diagnosis service test case that matches the target diagnosis project based on the target diagnosis service type, the target configuration table, and the preset test case template file.
[0043] As can be seen from the above, in the method provided in this embodiment, by obtaining the project information of the target diagnostic project; determining the target diagnostic service type of the target diagnostic project; selecting a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table; based on the project information and the initial configuration table, obtaining the target configuration table corresponding to the target diagnostic project; based on the target diagnostic service type, the target configuration table and the preset test case template file, obtaining the target diagnostic service test case that matches the target diagnostic project. In this way, the application itself realizes the automatic generation of diagnostic service test cases, saving the time of manually writing test cases. It only needs to obtain the project information of the target diagnostic project to generate a diagnostic service test case that matches the current project, which greatly improves the test efficiency while ensuring the uniformity of the diagnostic service test and the coverage of the test cases.
[0044] It should also be noted that the project information of the target diagnostic project in this application can be generated and transmitted by relevant personnel, or it can be pulled through big data using the Internet, and there is no restriction here.
[0045] In an exemplary embodiment of the present application, the specific steps of determining the target diagnosis service type of the target diagnosis item may include:
[0046] Get the service identifier of the diagnostic service of the target diagnostic project;
[0047] The corresponding relationship between the preset service identifier and the diagnostic service type is obtained, and the target diagnostic service type of the target diagnostic item is determined based on the corresponding relationship and the service identifier. The target diagnostic service type is a basic service, a fixed service, or a variable service.
[0048] In this embodiment, the target diagnostic service type is divided into basic services, fixed services or variable services using the service identifier of the diagnostic service of the target diagnostic project. Basic services include diagnostic services represented by service identifiers such as 0x10 services and 0x27 services. These services are the prerequisites for the use of other services in UDS, and the basic services of different projects generally do not change much. Fixed services include diagnostic services represented by service identifiers such as 0x11 services, 0x28 services, 0x3E services, 0x85 services, and 0x14 services. This type of service is a commonly used service in UDS, and the fixed services of different projects generally do not change much. The main difference between fixed services and basic services is that the use of fixed services needs to rely on basic services. Variable services include diagnostic services represented by service identifiers such as 0x19 services, 0x22 services, 0x2E services, and 0x31 services. The variable service functions of different projects vary greatly.
[0049] In this way, through the above embodiments, the present application enables the UDS diagnostic service test case generation method provided by the present application to be applied to the test case generation of various target diagnostic projects, thereby improving the coverage of the generated test cases.
[0050] In an exemplary embodiment of the present application, the target diagnostic service type is a basic service, a fixed service, or a variable service. Therefore, the specific steps of selecting a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table may include:
[0051] When the target diagnostic service type is a basic service, a matching basic service configuration table is selected from the preset configuration table as the initial configuration table;
[0052] When the target diagnostic service type is a fixed service, a matching fixed service configuration table is selected from the preset configuration table as the initial configuration table;
[0053] When the target diagnosis service type is a variable service, multiple data identifiers included in the target diagnosis item are obtained;
[0054] A variable service configuration table that matches the target diagnostic service type and a data identifier configuration table that matches the data identifier are selected from the preset configuration table as the initial configuration table.
[0055] In this embodiment, corresponding initial configuration tables are preset for different target diagnostic service types, which are used to form target configuration tables with contents corresponding to their types. Figures 2 to 4, which are the initial configuration tables corresponding to basic services, fixed services and variable services respectively. Figure 2 is a schematic diagram of a basic service configuration table in an exemplary embodiment of the present application, Figure 3 is a schematic diagram of a fixed service configuration table in an exemplary embodiment of the present application. Figure 4 It is a schematic diagram of a variable service configuration table in an exemplary embodiment of the present application.
[0056] Different initial configuration tables list the information that needs to be entered from the project information for this target diagnostic service type, such as Figure 3 As shown, the fixed services need to clarify the following:
[0057] (1) Whether functional addressing or physical addressing is supported. In vehicle diagnostic services, functional addressing and physical addressing are two different addressing methods. Functional addressing broadcasts diagnostic service requests and waits for responses from all ECUs on the bus that support functional addressing. Physical addressing, on the other hand, sends diagnostic requests to a specific ECU and waits for a response from the specified ECU.
[0058] (2) Required security unlocking level. Some diagnostic services of the ECU may contain important information or sensitive operations. When requesting these diagnostic services, permission authentication is required. Only when the corresponding security level is correctly unlocked can further operations be performed. Otherwise, access is impossible.
[0059] (3) Whether the positive response suppression bit is supported. The positive response suppression bit allows the ECU to suppress the positive response to the diagnostic service request in certain circumstances. It can reduce the bus load or unnecessary communication as needed, and also provides a mechanism to optimize diagnostic communication.
[0060] (4) Supported session types. The UDS protocol defines three session modes: default session, programming session, and extended session. Different session modes can be switched between each other, but only one diagnostic session is always active. The ECU is usually in the default session, but many services need to be switched to the extended session mode or programming session mode to be executed.
[0061] This application targets variable services that include multiple data identifiers. In order to generate accurate target diagnostic service test cases, the content that needs to be configured for the variable service is further divided into data identifiers according to the preset data identifier types, and a data identifier configuration table corresponding to the data identifiers is configured. Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a data identifier configuration table in an exemplary embodiment of the present application. Figure 5As shown, the preset data identifier types include the DTC (Diagnostic Trouble Code) corresponding to the 0x19 service, the DID (Data Identifier) corresponding to the 0x22 and 0x2E services, and the RID (Routine Identifier) corresponding to the 0x31 service. The data identifier configuration table includes the DTC configuration table, the DID configuration table, and the RID configuration table. A DTC is a code generated by the vehicle's electronic control unit (ECU) when it detects a system fault. It uniquely identifies a specific fault condition in the vehicle, helping maintenance personnel quickly locate and troubleshoot the problem. A DID is a number used to identify a specific data object in the UDS protocol. The ECU stores various types of data. To ensure accurate access and transmission of this data, each data object is assigned a unique DID. An RID identifies a specific diagnostic routine in the UDS. A diagnostic routine is a series of predefined steps used to perform a specific diagnostic task, such as activating a sensor for self-testing or performing a functional test.
[0062] In this way, through the above embodiments, the present application presets corresponding initial configuration tables for different target diagnostic service types, which are used to form target configuration tables with contents corresponding to their types, so as to improve the accuracy of subsequently generated test cases.
[0063] In an exemplary embodiment of the present application, the target diagnostic service type is a basic service, a fixed service, or a variable service. Therefore, based on the target diagnostic service type, the target configuration table, and the preset test case template file, the specific steps of obtaining a target diagnostic service test case that matches the target diagnostic project may include:
[0064] When the target diagnostic service type is basic service or fixed service, read the configuration result of the target configuration table;
[0065] Obtaining the template content that matches the configuration result in the preset test case template file, and obtaining the target diagnosis service test case that matches the target diagnosis project based on the template content;
[0066] When the target diagnosis service type is a variable service, the configuration result of the target configuration table is read, and a target diagnosis service test case matching the target diagnosis item is generated based on the configuration result.
[0067] In this embodiment, by reading the configuration content in the target configuration table, copying the corresponding test case in the test case template file or directly generating the target diagnostic service test case according to the configuration result, the automatic generation of test case files for different projects is achieved. Preferably, for the test cases of basic services and fixed services, the corresponding test cases can be copied in the test case template file according to the configuration content supported in the target configuration table. For the test cases of variable services, the DTC configuration table, DID configuration table and RID configuration table corresponding to the variable service are read in the target configuration table to generate the corresponding target diagnostic service test case.
[0068] In another exemplary embodiment, when the target diagnostic service type is a basic service or a fixed service, the specific steps of obtaining a target diagnostic service test case that matches the target diagnostic item may include:
[0069] Obtaining a mapping relationship between a test case description and test case steps represented by a test case template in a preset test case template file;
[0070] Based on the target test case description and the mapping relationship of the configuration result, a test case step matching the target test case description is obtained as the target test case step;
[0071] Based on the target test case description and the target test case steps, a template content matching the configuration result is obtained, and the template content is used as a target diagnosis service test case matching the target diagnosis project.
[0072] In this embodiment, the test case template file is a .xlsx type file that stores a complete test case as a test case template for basic services and fixed service functions. Taking the sub-service 0x03 of the 0x11 service as an example, part of the content in its test case template file is shown in Table 1.
[0073] Table 1, part of the test case template file for 0x11 service 0x03 subservice:
[0074]
[0075]
[0076] The preset test case template file stores a test case template, which represents the mapping relationship between the test case description and the test case steps. This embodiment obtains the test case steps that match the target test case description based on the target test case description and the mapping relationship of the configuration results as the target test case steps; based on the target test case description and the target test case steps, the template content that matches the configuration results is obtained, and the template content is used as the target diagnostic service test case that matches the target diagnostic item.
[0077] In this way, through the above embodiments, the present application directly obtains the test cases that match the basic services and fixed services that do not change, and uses them as target diagnostic service test cases, thereby improving data processing efficiency while ensuring the accuracy of the results.
[0078] In another exemplary embodiment, when the target diagnostic service type is a variable service, the target configuration table includes a variable service configuration table and a data identifier configuration table; therefore, the specific steps of reading the configuration result of the target configuration table and generating a target diagnostic service test case matching the target diagnostic item based on the configuration result may include:
[0079] Reading a variable service configuration table and a data identifier configuration table to obtain a configuration result, wherein the data identifier configuration table is at least one of a DTC configuration table, a DID configuration table, and a RID configuration table;
[0080] Generate target diagnosis service test cases that match the target diagnosis project based on the configuration results.
[0081] In another exemplary embodiment, the specific steps of generating a target diagnosis service test case matching the target diagnosis project based on the configuration result may include:
[0082] Obtain the conversion relationship between the preset configuration result and the script variable, and convert the configuration result into the target script variable based on the conversion relationship;
[0083] Generate a field set corresponding to the configuration result based on the target script variable through conditional judgment;
[0084] The field collection is spliced to obtain a target diagnostic service test case that matches the target diagnostic project.
[0085] In this embodiment, for target diagnostic items of variable services, a target diagnostic service test case matching the target diagnostic item is generated based on the configuration results of the variable service configuration table and the data identifier configuration table. Taking the target diagnostic item with a 0x2E service and a corresponding data identifier of DID as an example, the 0x2E service configuration is read from the variable service configuration table, the DID configuration is read from the DID configuration table, and the read results are converted into target script variables. The corresponding relationships are shown in Tables 2 and 3.
[0086] Table 2, the correspondence between 0x2E service configuration and script variables:
[0087]
[0088]
[0089] Table 3. Correspondence between DID configuration and script variables
[0090]
[0091] According to the results read from the variable service configuration table and the DID configuration table, the corresponding field set is generated through conditional judgment. The meaning of each field is shown in Table 4.
[0092] Table 4, the meaning of each field:
[0093]
[0094]
[0095] All field sets are spliced together through a for loop to generate the Test Case Description and Test Step. The correspondence between some items of the test case and the code in the script is shown in Table 5.
[0096] Table 5, the correspondence between some items of the test case and the code in the script:
[0097]
[0098] Figure 6 FIG. 6 is a block diagram of a device 600 for generating a UDS diagnostic service test case according to an exemplary embodiment of the present application. Figure 6 As shown, the device includes:
[0099] An acquisition unit 601 is configured to acquire project information of a target diagnostic project;
[0100] Type unit 602, used to determine the target diagnosis service type of the target diagnosis item;
[0101] The configuration table selection unit 603 is used to select a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table;
[0102] The processing unit 604 is configured to obtain a target configuration table corresponding to the target diagnosis item based on the item information and the initial configuration table;
[0103] The generating unit 605 is configured to obtain a target diagnosis service test case that matches the target diagnosis project based on the target diagnosis service type, the target configuration table, and a preset test case template file.
[0104] The device applies the method for generating UDS diagnostic service test cases provided by this application, and obtains the project information of the target diagnostic project through the acquisition unit 601; the type unit 602 determines the target diagnostic service type of the target diagnostic project; the configuration table selection unit 603 selects a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table; the processing unit 604 obtains the target configuration table corresponding to the target diagnostic project based on the project information and the initial configuration table; the generation unit 605 obtains the target diagnostic service test case that matches the target diagnostic project based on the target diagnostic service type, the target configuration table and the preset test case template file. In this way, the application itself realizes the automatic generation of diagnostic service test cases, saves the time of manually writing test cases, and only needs to obtain the project information of the target diagnostic project to generate a diagnostic service test case that matches the current project, which greatly improves the test efficiency while ensuring the uniformity of the diagnostic service test and the coverage of the test cases.
[0105] In another exemplary embodiment, the type unit 602 is also used to obtain a service identifier of the diagnostic service of the target diagnostic item; obtain a correspondence between a preset service identifier and a diagnostic service type, and determine a target diagnostic service type of the target diagnostic item based on the correspondence and the service identifier, where the target diagnostic service type is a basic service, a fixed service, or a variable service.
[0106] In another exemplary embodiment, the target diagnostic service type is a basic service, a fixed service or a variable service; the configuration table selection unit 603 is also used to select a matching basic service configuration table from the preset configuration table as the initial configuration table when the target diagnostic service type is a basic service; select a matching fixed service configuration table from the preset configuration table as the initial configuration table when the target diagnostic service type is a fixed service; obtain multiple data identifiers included in the target diagnostic item when the target diagnostic service type is a variable service; select a variable service configuration table matching the target diagnostic service type and a data identifier configuration table matching the data identifier from the preset configuration table as the initial configuration table.
[0107] In another exemplary embodiment, the target diagnostic service type is a basic service, a fixed service, or a variable service; the generation unit 605 is also used to read the configuration result of the target configuration table when the target diagnostic service type is a basic service or a fixed service; obtain the template content that matches the configuration result in the preset test case template file, and obtain the target diagnostic service test case that matches the target diagnostic item based on the template content; when the target diagnostic service type is a variable service, read the configuration result of the target configuration table, and generate the target diagnostic service test case that matches the target diagnostic item based on the configuration result.
[0108] In another exemplary embodiment, the generation unit 605 is also used to obtain the mapping relationship between the test case description and the test case steps represented by the test case template in the preset test case template file; obtain the test case steps that match the target test case description based on the configuration result and the mapping relationship as the target test case steps; obtain the template content that matches the configuration result based on the target test case description and the target test case steps, and use the template content as the target diagnostic service test case that matches the target diagnostic item.
[0109] In another exemplary embodiment, when the target diagnostic service type is a variable service, the target configuration table includes a variable service configuration table and a data identifier configuration table; the generation unit 605 is also used to read the variable service configuration table and the data identifier configuration table to obtain a configuration result, and the data identifier configuration table is at least one of a DTC configuration table, a DID configuration table, and a RID configuration table; based on the configuration result, a target diagnostic service test case matching the target diagnostic item is generated.
[0110] In another exemplary embodiment, the generation unit 605 is also used to obtain the conversion relationship between the preset configuration result and the script variable, and convert the configuration result into the target script variable based on the conversion relationship; generate a field set corresponding to the configuration result based on the target script variable through conditional judgment; and splice the field set to obtain a target diagnostic service test case that matches the target diagnostic project.
[0111] It should be noted that the UDS diagnostic service test case generation device provided in the above embodiment and the UDS diagnostic service test case generation method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here. In actual application, the UDS diagnostic service test case generation device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0112] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by one or more processors, enables the electronic device to implement the method for generating UDS diagnostic service test cases provided in the above-mentioned embodiments.
[0113] Figure 7 The following is a schematic diagram showing the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application. Figure 7The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0114] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 into the random access memory (RAM) 703, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the RAM 703. The CPU 701, ROM 702 and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0115] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. Removable media 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.
[0116] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the various functions defined in the system of the present application are executed.
[0117] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0119] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0120] Another aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method for generating a UDS diagnostic service test case. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.
[0121] Another aspect of the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to execute the method for generating a UDS diagnostic service test case provided in each of the above embodiments.
[0122] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements or improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for generating a UDS diagnostic service test case, characterized in that: The method comprises: Obtain project information of target diagnostic project; Determining the target diagnostic service type of the target diagnostic item; Selecting a configuration table that matches the target diagnostic service type from the preset configuration tables as the initial configuration table; Based on the project information and the initial configuration table, obtaining a target configuration table corresponding to the target diagnostic project; Based on the target diagnosis service type, the target configuration table and a preset test case template file, a target diagnosis service test case matching the target diagnosis item is obtained.
2. The method according to claim 1, characterized in that Determining the target diagnostic service type of the target diagnostic item includes: Obtaining a service identifier of the diagnostic service of the target diagnostic project; A correspondence between a preset service identifier and a diagnostic service type is obtained, and a target diagnostic service type of the target diagnostic item is determined based on the correspondence and the service identifier, where the target diagnostic service type is a basic service, a fixed service, or a variable service.
3. The method according to claim 1, characterized in that The target diagnostic service type is a basic service, a fixed service, or a variable service; and selecting a configuration table that matches the target diagnostic service type from the preset configuration table as the initial configuration table includes: When the target diagnostic service type is a basic service, a matching basic service configuration table is selected from the preset configuration table as the initial configuration table; When the target diagnostic service type is a fixed service, a matching fixed service configuration table is selected from the preset configuration table as the initial configuration table; When the target diagnostic service type is a variable service, obtaining multiple data identifiers included in the target diagnostic item; A variable service configuration table that matches the target diagnostic service type and a data identifier configuration table that matches the data identifier are selected from the preset configuration tables as initial configuration tables.
4. The method according to claim 1, wherein The target diagnostic service type is a basic service, a fixed service, or a variable service; and obtaining a target diagnostic service test case that matches the target diagnostic item based on the target diagnostic service type, the target configuration table, and a preset test case template file includes: When the target diagnostic service type is a basic service or a fixed service, reading the configuration result of the target configuration table; Obtaining template content that matches the configuration result in a preset test case template file, and obtaining a target diagnostic service test case that matches the target diagnostic item based on the template content; When the target diagnosis service type is a variable service, the configuration result of the target configuration table is read, and a target diagnosis service test case matching the target diagnosis item is generated based on the configuration result.
5. The method according to claim 4, characterized in that The step of obtaining template content in a preset test case template file that matches the configuration result, and obtaining a target diagnostic service test case that matches the target diagnostic item based on the template content, includes: Obtaining a mapping relationship between a test case description and test case steps represented by a test case template in a preset test case template file; Obtaining a test case step that matches the target test case description based on the target test case description of the configuration result and the mapping relationship as the target test case step; A template content matching the configuration result is obtained based on the target test case description and the target test case steps, and the template content is used as a target diagnosis service test case matching the target diagnosis item.
6. The method according to claim 4, characterized in that When the target diagnostic service type is a variable service, the target configuration table includes a variable service configuration table and a data identifier configuration table; The step of reading the configuration result of the target configuration table and generating a target diagnosis service test case matching the target diagnosis item based on the configuration result includes: Reading the variable service configuration table and the data identifier configuration table to obtain a configuration result, wherein the data identifier configuration table is at least one of a DTC configuration table, a DID configuration table, and a RID configuration table; A target diagnosis service test case matching the target diagnosis item is generated based on the configuration result.
7. The method according to claim 4, characterized in that Generating a target diagnosis service test case matching the target diagnosis item based on the configuration result includes: Obtaining a conversion relationship between a preset configuration result and a script variable, and converting the configuration result into a target script variable based on the conversion relationship; Generate a field set corresponding to the configuration result based on the target script variable through conditional judgment; The field sets are spliced together to obtain a target diagnosis service test case that matches the target diagnosis item.
8. A device for generating UDS diagnostic service test cases, characterized in that: include: An acquisition unit, used to acquire project information of a target diagnostic project; A type unit, configured to determine a target diagnostic service type of the target diagnostic item; A configuration table selection unit, configured to select a configuration table that matches the target diagnostic service type from a preset configuration table as an initial configuration table; a processing unit, configured to obtain a target configuration table corresponding to the target diagnostic item based on the item information and the initial configuration table; A generating unit is used to obtain a target diagnosis service test case that matches the target diagnosis item based on the target diagnosis service type, the target configuration table and a preset test case template file.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method for generating a UDS diagnostic service test case as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method for generating a UDS diagnostic service test case according to any one of claims 1 to 7.