Vehicle diagnosis method, device and system and storage medium
By parsing the diagnostic questionnaire to generate a protocol stack and test framework for vehicle diagnostic service codes, the problem of low ECU diagnostic efficiency and high cost in the existing technology is solved, automatic updates and diagnostic service platforms are realized, and diagnostic efficiency and Save labor costs.
Patent Information
- Application Number
- CN202310214131.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, ECU diagnosis requires professional developers to re-edit the diagnostic code, resulting in low diagnostic efficiency and high cost, especially when diagnostic requirements change or cross-platform or cross-domain.
By parsing the diagnostic questionnaire to generate a protocol stack and test framework for the vehicle diagnostic service code, the diagnostic service code is automatically generated, realizing a diagnostic service platform and reducing dependence on professional developers.
It achieves automatic updates without the need for professional developers to edit the code when diagnostic requirements change, saving labor costs, improving the efficiency of the diagnostic process, and realizing a platform for diagnostic services.
Smart Images

Figure CN118567322A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle diagnostic services, and in particular to a vehicle diagnostic method, device, system and storage medium. Background Art
[0002] The vehicle ECU (Electronic Control Unit, also known as "on-board computer", "on-board computer", etc.) diagnostic service module is a basic service component that implements application requirements such as ECU flashing, self-diagnosis and calibration. In the prior art, when performing ECU diagnosis, it is necessary to diagnose the vehicle ECU through a diagnostic code that matches the ECU model. For diagnostic servers, in traditional diagnostic solutions, the diagnostic code that matches the ECU is embedded in the ECU in a hard-coded manner, so that the ECU has a self-diagnosis function. When the diagnostic requirements change or the diagnostic function is performed across platforms and domains, that is, when a newly emerging ECU needs to be diagnosed, the developer needs to re-edit the diagnostic code that matches the ECU and embed the diagnostic code that matches it in the ECU in a hard-coded manner.
[0003] It can be seen that in the prior art, when diagnosing newly emerging ECU diagnostic needs, professional developers are required to edit the corresponding diagnostic codes separately, and the processing efficiency is low. Therefore, it is urgent to provide a vehicle diagnostic method to save manpower costs in the vehicle diagnostic process. Summary of the invention
[0004] The present application provides a vehicle diagnosis method, device, system and storage medium for saving manpower costs during vehicle diagnosis.
[0005] The present application provides a vehicle diagnosis method, comprising:
[0006] Performing a first analysis on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe a vehicle ECU diagnostic service requirement, the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service, and the diagnostic service includes multiple diagnostic tasks;
[0007] Obtaining a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow;
[0008] Performing a second analysis on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the constructed test framework matches the diagnostic service process;
[0009] Adding the protocol stack and the interface information of the protocol stack to the test framework according to the diagnostic task execution order in the test framework to generate a vehicle diagnostic service code including the protocol stack and the test framework;
[0010] The vehicle diagnostic service is performed by executing the vehicle diagnostic service code.
[0011] The beneficial effects of the present application are: a protocol stack of a vehicle diagnostic service code is generated by first parsing a diagnostic questionnaire, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, and the protocol stack includes the execution code of each diagnostic task involved in the vehicle diagnostic service; a diagnostic sequence description file containing the interface information of the protocol stack and the diagnostic service processing flow is obtained to perform a second parsing of the diagnostic service flow in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, and the interface information of the protocol stack is added to the test framework according to the execution order of the diagnostic tasks in the test framework. Since the execution order of the diagnostic tasks in the constructed test framework matches the diagnostic service flow, and the interface information of the protocol stack is included in the constructed test framework, the protocol stack and the interface information of the protocol stack can be added to the test framework according to the execution order of the diagnostic tasks in the test framework to generate a vehicle diagnostic service code containing the protocol stack and the test framework, and then the vehicle diagnostic service can be completed by executing the vehicle diagnostic service code. In the present application, when the diagnostic requirements change or the diagnostic functions are performed across platforms and domains, the vehicle diagnostic service code can be automatically generated without the need for professional developers to edit the corresponding diagnostic code, thereby realizing the platformization of diagnostic services, saving labor costs and improving the efficiency of the diagnostic process.
[0012] The protocol stack for performing a first analysis on the diagnostic questionnaire to generate a vehicle diagnostic service code includes:
[0013] Acquire the ECU diagnostic service requirements and user-defined data in the diagnostic questionnaire, wherein the ECU diagnostic service requirements are the ECU diagnostic service requirements corresponding to the vehicle to be diagnosed, and the user-defined data includes identification information of the vehicle to be diagnosed;
[0014] A first analysis is performed on the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code including the ECU diagnostic service requirements and the user-defined data.
[0015] The first parsing of the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code containing the ECU diagnostic service requirements and the user-defined data comprises:
[0016] Configuring the diagnostic questionnaire into a CDD file including ECU diagnostic service requirements and user-defined data according to a preset CDD template;
[0017] Performing format conversion on the CDD file to convert the CDD file into an ODX file containing ECU diagnostic service requirements and user-defined data;
[0018] The ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes including ECU diagnostic service requirements and user-defined data.
[0019] A test framework for performing a second analysis on the diagnostic service process in the diagnostic sequence description file to generate a vehicle diagnostic service code includes:
[0020] Editing the diagnostic sequence description file into an OTX file by using an OTX editor;
[0021] The OTX file is parsed by an OTX parser to generate the test framework.
[0022] The vehicle diagnostic service is performed by executing the vehicle diagnostic service code, including:
[0023] Initializing a state machine executing the vehicle diagnostic service code in the order in which the interface information is added in the test framework;
[0024] Execute the interface corresponding to the vehicle diagnosis part in the vehicle diagnosis service code to realize the diagnosis of the vehicle;
[0025] Get vehicle diagnostic results;
[0026] The vehicle diagnosis result is fed back to a preset client.
[0027] The initializing operation of the state machine executing the vehicle diagnostic service code includes:
[0028] Check the legitimacy of at least one of the following preset parameters related to the service: service identification code, state machine subfunction, valid data length, addressing mode, DID support, session and security status;
[0029] When the legitimacy detection of all preset parameters passes, initializing the state machine executing the vehicle diagnostic service code;
[0030] When there are preset parameters whose validity fails to pass the test, the message of initialization failure is returned.
[0031] The obtaining of vehicle diagnosis results includes:
[0032] Obtain positive and negative responses to vehicle feedback;
[0033] Encapsulating the positive response and the negative response of the vehicle feedback;
[0034] The positive response and the negative response after packaging are determined to be the vehicle diagnosis results.
[0035] The present application also provides a vehicle diagnostic device, comprising:
[0036] a first parsing module, configured to perform a first parsing on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service, and the diagnostic service includes multiple diagnostic tasks;
[0037] An acquisition module, used for acquiring a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow;
[0038] a second parsing module, configured to perform a second parsing on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the test framework matches the diagnostic service process;
[0039] A generating module, used for adding the protocol stack and the interface information of the protocol stack to the test framework according to the diagnostic task execution order in the test framework, so as to generate a vehicle diagnostic service code including the protocol stack and the test framework;
[0040] The diagnostic module is used for performing diagnostic service of the vehicle by executing the vehicle diagnostic service code.
[0041] The first parsing module comprises:
[0042] A first acquisition submodule is used to acquire the ECU diagnostic service requirements and user-defined data in the diagnostic questionnaire, wherein the ECU diagnostic service requirements are the ECU diagnostic service requirements corresponding to the vehicle to be diagnosed, and the user-defined data includes identification information of the vehicle to be diagnosed;
[0043] The generating submodule is used to respectively perform a first analysis on the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code including the ECU diagnostic service requirements and the user-defined data.
[0044] The generating submodule is further used for:
[0045] Configuring the diagnostic questionnaire into a CDD file including ECU diagnostic service requirements and user-defined data according to a preset CDD template;
[0046] Performing format conversion on the CDD file to convert the CDD file into an ODX file containing ECU diagnostic service requirements and user-defined data;
[0047] The ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes including ECU diagnostic service requirements and user-defined data.
[0048] The second parsing module comprises:
[0049] An editing submodule, used for editing the diagnostic sequence description file into an OTX file through an OTX editor;
[0050] The parsing submodule is used to parse the OTX file through an OTX parser to generate the test framework.
[0051] The diagnostic module comprises:
[0052] An initialization submodule, used for performing an initialization operation on a state machine executing the vehicle diagnostic service code;
[0053] A diagnosis submodule, configured to execute the interfaces corresponding to the vehicle diagnosis part in the vehicle diagnosis service code in the order in which the interface information is added in the test framework, so as to implement vehicle diagnosis;
[0054] The second acquisition submodule is used to obtain vehicle diagnosis results;
[0055] The feedback submodule is used to feed back the vehicle diagnosis result to a preset client.
[0056] Initialize submodules, also used for:
[0057] Check the legitimacy of at least one of the following preset parameters related to the service: service identification code, state machine subfunction, valid data length, addressing mode, DID support, session and security status;
[0058] When the legitimacy detection of all preset parameters passes, initializing the state machine executing the vehicle diagnostic service code;
[0059] When there are preset parameters whose validity fails to pass the test, the message of initialization failure is returned.
[0060] The second acquisition submodule is further used for:
[0061] Obtain positive and negative responses to vehicle feedback;
[0062] Encapsulating the positive response and the negative response of the vehicle feedback;
[0063] The positive response and the negative response after packaging are determined to be the vehicle diagnosis results.
[0064] The present application also provides a vehicle diagnostic system, comprising:
[0065] at least one processor; and,
[0066] a memory communicatively connected to the at least one processor; wherein,
[0067] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the vehicle diagnosis method described in any of the above embodiments.
[0068] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the vehicle diagnostic system, the vehicle diagnostic system can implement the vehicle diagnostic method recorded in any of the above embodiments.
[0069] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0070] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0072] Figure 1 This is a flow chart of a vehicle diagnosis method in one embodiment of the present application;
[0073] Figure 2 This is a flow chart of a vehicle diagnosis method in one embodiment of the present application;
[0074] Figure 3 This is a control schematic diagram of a vehicle diagnosis method in one embodiment of the present application;
[0075] Figure 4 This is an execution process of a diagnostic service in an embodiment of the present application;
[0076] Figure 5This is a schematic diagram of the structure of a vehicle diagnostic device in one embodiment of the present application;
[0077] Figure 6 Schematic diagram of the hardware structure of a vehicle diagnostic system in one embodiment of the present application. DETAILED DESCRIPTION
[0078] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application.
[0079] Automobile fault diagnosis UDS (Unified Diagnostic Service) uses ECU to monitor the working conditions of each component of the control system, and automatically starts the fault recording and processing logic after a fault is found. The ECU diagnostic service module is a basic service component that realizes application requirements such as ECU flashing, self-diagnosis and calibration. In the prior art, for the diagnostic server, the diagnostic service code is written and changed according to specific needs to complete different functions. Therefore, when the diagnostic requirements change or the diagnostic functions are performed across platforms and domains, developers need to do a lot of hard coding work. In addition, due to the complexity of the diagnostic service standard protocol, developers need to be familiar with the protocol stack format and error handling methods of each layer of the UDS protocol, which has high requirements for developers and is difficult to develop. Therefore, the present application aims to provide a vehicle diagnostic method for automatically generating and updating diagnostic codes for the diagnostic server, so as to realize the platformization of diagnostic services, thereby saving manpower costs in the vehicle diagnosis process and improving the efficiency of vehicle diagnosis.
[0080] OTX (Open Test sequence eXchange) is an open test sequence standard based on XML language. It is used to describe the requirements from basic functional testing to the entire test application. It can meet the requirements for diagnostic sequences in various stages of development, production, and after-sales. It has a unified format and universal diagnostic data, and has been applied in diagnostic equipment.
[0081] ODX (Open diagnostic data exchange) is an open diagnostic database based on XML format. It covers all the data required for diagnosis and flashing involved in automobile production, ECU programming and after-sales process. Therefore, ODX database has a natural advantage as a data engine for building UDS diagnostic platform.
[0082] Therefore, the method provided in this application is to decouple the UDS protocol stack from the business processing flow, and automatically generate ECU diagnostic service code based on OTX files and ODX files, so that when the demand changes, only the OTX / ODX files need to be updated to complete the automatic update of the diagnostic code. There is no need for developers to re-encode using hard coding, truly realizing the platformization of diagnostic services and saving labor costs.
[0083] Figure 1 Flow chart of a vehicle diagnosis method in one embodiment of the present application, such as Figure 1 As shown, the method can be implemented as the following steps S101-S105:
[0084] In step S101, a first parsing is performed on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, and the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service, and the diagnostic service includes multiple diagnostic tasks;
[0085] The method provided in this application can be applied to the diagnostic server. By decoupling the protocol stack of the diagnostic service from the business processing flow, specific diagnostic services, such as fault code reading, ECU reset, flashing, etc., will be divided into specific diagnostic services according to the UDS protocol. These services are distinguished by IDs, such as service 27 provides a security protection mechanism, service 31 provides program control operations, etc. A protocol stack is built based on the diagnostic questionnaire and user-defined diagnostic data to generate an ODX diagnostic database and provide a complete diagnostic data processing interface.
[0086] Figure 2 Flow chart of a vehicle diagnosis method in one embodiment of the present application, such as Figure 2As shown, a protocol stack of a vehicle diagnostic service code is constructed according to a diagnostic questionnaire and user-defined diagnostic data, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, and the user-defined diagnostic data includes the vehicle information to be diagnosed, such as the vehicle's VIN code, and then the diagnostic questionnaire and the user-defined diagnostic data can be used to obtain the codes for all execution tasks required for vehicle diagnosis. In this embodiment, first, the diagnostic questionnaire is configured as a CDD file containing ECU diagnostic service requirements and user-defined data according to a preset CDD (CANdela Diagnostic Descriptions, diagnostic description) template. The diagnostic questionnaire is provided by the developer according to the specific ECU diagnostic service requirements, and contains a CDD file of ECU diagnostic service requirements and user-defined data. By configuring the diagnostic questionnaire as a CDD file, the diagnostic questionnaire can be released to obtain diagnostic questionnaire data containing ECU diagnostic service requirements and user-defined data. The template contains directories corresponding to various ECU diagnostic service requirement types and user-defined data types. The device can identify the directory and fill the ECU diagnostic service requirements and user-defined data into the corresponding directory, thereby realizing the template of the diagnostic questionnaire. After templateization, the diagnostic survey is easier to be recognized by the machine, which is convenient for subsequent format conversion and parsing. Afterwards, the CDD file is converted into an ODX file containing ECU diagnostic service requirements and user-defined data. In order to facilitate the interaction of diagnostic data, the CDD file is converted into an ODX file, thereby generating an ODX diagnostic database of the corresponding diagnostic requirements. Finally, the ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes containing ECU diagnostic service requirements and user-defined data.
[0087] It is understandable that in other embodiments of the present application, the ODX file containing the diagnostic requirements may also be directly obtained, for example, the developer directly provides the ODX file, and the protocol stack is generated based on the ODX file and user-defined diagnostic data.
[0088] In step S102, a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow is obtained;
[0089] The entire diagnostic service module only includes general processing procedures, shielding the impact of diagnostic services and diagnostic questionnaire information updates on the diagnostic procedures.
[0090] In this application, the diagnostic service protocol stack is decoupled from the diagnostic service processing flow, where the protocol stack provides a complete diagnostic data processing interface. In order to complete the diagnostic service according to the diagnostic service processing flow, it is also necessary to determine the diagnostic service processing flow and the interface information for calling the corresponding diagnostic task execution code from the protocol stack. Figure 2 As shown, a diagnostic sequence description file is obtained to obtain a diagnostic service processing flow and interface information of the protocol stack based on the diagnostic sequence description file.
[0091] In step S103, a second analysis is performed on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the constructed test framework matches the diagnostic service process;
[0092] In this application, a test framework for describing the diagnostic service processing flow is constructed based on the protocol stack and the diagnostic sequence description file, such as Figure 2 As shown:
[0093] First, an OTX file is generated according to the diagnosis sequence description file. Specifically, the diagnosis sequence description file is converted into the OTX file through an OTX editor.
[0094] Then, the test framework is generated according to the OTX file. Since the diagnostic sequence description file contains the interface information of the protocol stack and the diagnostic service processing flow, the converted OTX file also contains the interface information of the protocol stack and the diagnostic service processing flow, thereby obtaining an interface information test framework including the diagnostic service processing flow and the protocol stack.
[0095] In step S104, the protocol stack and the interface information of the protocol stack are added to the test framework according to the diagnostic task execution order in the test framework to generate a vehicle diagnostic service code including the protocol stack and the test framework;
[0096] Since the protocol stack is generated based on the diagnostic questionnaire and user-defined diagnostic data, it contains complete data diagnostic requirements and can provide a complete diagnostic data processing interface; the test framework contains all the main diagnostic service processing processes and the interface for calling the protocol stack. Therefore, according to the execution order of each diagnostic task, the protocol stack is added to the test framework accordingly, that is, based on the protocol stack and the test framework, a complete vehicle diagnostic service code can be automatically generated.
[0097] In step S105 , the vehicle diagnostic service is performed by executing the vehicle diagnostic service code.
[0098] After the vehicle diagnostic service code is generated, the built-in execution engine calls the test framework and the code automatically generated dynamically by the protocol stack to complete the entire diagnostic service.
[0099] First, the state machine that executes the vehicle diagnostic service code is initialized; specifically, the legitimacy of at least one of the following preset parameters related to the service can be checked: service identification code, state machine sub-function, valid data length, addressing mode, whether DID is supported, session and security status; when the legitimacy check of all preset parameters is passed, the state machine that executes the vehicle diagnostic service code is initialized; when there are preset parameters whose legitimacy fails the test, the information that initialization failed is returned.
[0100] Execute the interface corresponding to the vehicle diagnosis part in the vehicle diagnosis service code to realize the diagnosis of the vehicle.
[0101] After completing the initialization operation, the vehicle diagnostic service code automatically generated by the test framework and protocol stack is called by the execution engine, and then the interface corresponding to the vehicle diagnostic part is executed in the order in which the interface information is added in the test framework to diagnose the vehicle.
[0102] After diagnosing the vehicle, obtain the response data processed by the test framework, perform numerical conversion, unit conversion, effective value verification, serialization and other related operations, and obtain the positive response and negative response of the vehicle feedback; encapsulate the positive response and negative response of the vehicle feedback according to the UDS protocol stack format requirements; determine the encapsulated positive response and negative response as the vehicle diagnosis result.
[0103] Finally, the vehicle diagnosis result is fed back to a preset client, such as an external vehicle diagnosis APP.
[0104] Figure 3 Schematic diagram of a control method for vehicle diagnosis in one embodiment of the present application. Figure 3 As shown, in this embodiment, after parsing the ODX and OTX files and generating the test framework, protocol stack and diagnostic service code, the vehicle diagnostic service is mainly completed based on the test framework, protocol stack and execution engine. Among them, the protocol stack provides ODX protocol data management and ODX protocol data query services, the test framework provides OTX diagnostic service query services and dynamically generates diagnostic service codes, wherein the diagnostic service code includes UDS diagnostic interface code. The execution engine receives the diagnostic service command, completes the vehicle diagnostic service by calling the diagnostic service code, and returns the diagnostic service result. The functions and control flow of each part are introduced as follows:
[0105] 1. ODX protocol data query
[0106] According to the ISO standard, ODX diagnostic data includes seven types of data: ODX-CS / C, ODX-D, ODX-V, ODX-E, ODX-F, ODX-FD and ODX-M. For the data types involved in this application, two types of ODX data are used: ODX-CS / C communication parameter information and ODX-D diagnostic service data.
[0107] The main function of the ODX parser is to query the communication parameters and defined diagnostic service information supported by the current ODX database according to the diagnostic service query code. It mainly includes 4 parts: supported diagnostic service list, service request information, service positive / negative response and diagnostic service description (such as addressing method).
[0108] The ODX query service interface provides three types of services by calling the ODX parser: diagnostic parameter query service, service request information query (such as: sub function, DID, DTC, etc.) and service response data encapsulation interface.
[0109] 2. ODX protocol data management
[0110] In addition to querying data, the protocol stack also provides data management functions. That is, the response data processed by the test framework cannot generally be returned directly as a status parameter, and related operations such as numerical conversion, unit conversion, effective value verification, and serialization are required. ODX protocol data management provides this function.
[0111] 3. OTX diagnostic service query
[0112] The test framework can provide OTX diagnostic service query. OTX diagnostic service query mainly calls the OTX parser to provide diagnostic service sequence query and diagnostic service mapping interface for calling when the diagnostic service code is dynamically generated.
[0113] The diagnostic service sequence describes the execution sequence of the current query service. The diagnostic service mapping interface can automatically generate the corresponding service sequence to the specified location or structure in the form of callback.
[0114] 4. Dynamic generation of diagnostic service code
[0115] Specifically, the complete ECU diagnostic service code is automatically generated by parsing ODX and OTX files. The role of the dynamic code generation interface is to provide a proxy interface for code generation. The main process can generate code according to the specified file format by calling this interface. The bottom layer encapsulates the input and output interface I / O and the file output interface printer, and on this basis, encapsulates the generators of files, classes, structures and basic data types; finally, the code generation adapter interface uniformly encapsulates each generator and uniformly provides an external interface.
[0116] 5. Execution engine execution diagnostic service
[0117] As the runtime (memory management) of the entire diagnostic service, the execution engine mainly maintains the diagnostic service state machine. For each state, it deploys the processing flow and the caller that adapts to the dynamic code generation interface. The state machine mainly includes 6 states:
[0118] 1) Pre-processing: The initial state of the state machine checks the legality of service-related parameters. If the pre-processing succeeds, service processing is performed. If it fails, the state enters the post-processing state. Figure 4 This is an execution process of a diagnostic service in an embodiment of the present application. Figure 4 As shown, taking service 31 as an example, during the initialization operation, according to the service information generated by ODX, the service identification code (service id), the state machine sub-function (sub-function), the valid data length, the DID support, the addressing mode, the session and the security status are checked.
[0119] 2) Service processing: Perform service-related processing on service parameters, start calling dynamically generated interfaces for processing, and enter the business processing state after completion. Figure 4 As shown, taking service 31 as an example, in the service processing state, the corresponding processing function is found according to the DID. Specifically, the mapping relationship between the DID and the function address is determined according to the ODX information; and the valid parameters such as file name, length, etc. are parsed according to the OTX file, and the verification MD5 processing function is automatically generated; the main program completes the MD5 verification process by calling this function.
[0120] 3) Business processing: Processing specific services, such as session switching, querying DTC status, etc. If it fails, it will enter the post-processing stage; if it succeeds and the positive response suppression bit (SPRMIB) is not set, it will enter the parameter processing stage; if it succeeds and the positive response suppression bit (SPRMIB) is set, it will directly enter the completion state. Figure 4 As shown, taking service 31 as an example, in the business processing state, it monitors whether session switching and security state switching are required. Specifically, it determines whether switching is required by querying the data parsed by ODX. The switching process generates a corresponding processing function by OTX, which is called by the main program.
[0121] 4) Parameter processing: According to the UDS protocol stack format requirements, encapsulate the relevant parameters of the positive or negative response, and then enter the post-processing stage. Figure 4As shown, taking service 31 as an example, in the business processing state, according to the obtained MD5 verification result, the result is serialized according to the corresponding processing function generated by OTX, and the valid value is verified by calling the function automatically generated by ODX.
[0122] 5) Post-processing: Processing of positive and negative responses. If it is a positive response, no further processing is performed based on the positive response.
[0123] 6) Completion: The state machine ends, indicating that the current service processing is completed, the main process is exited, and the timer and related parameters are reset.
[0124] The beneficial effects of the present application are: a protocol stack of a vehicle diagnostic service code is generated by first parsing a diagnostic questionnaire, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, and the protocol stack includes the execution code of each diagnostic task involved in the vehicle diagnostic service; a diagnostic sequence description file containing the interface information of the protocol stack and the diagnostic service processing flow is obtained to perform a second parsing of the diagnostic service flow in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, and the interface information of the protocol stack is added to the test framework according to the execution order of the diagnostic tasks in the test framework. Since the execution order of the diagnostic tasks in the constructed test framework matches the diagnostic service flow, and the interface information of the protocol stack is included in the constructed test framework, the protocol stack and the interface information of the protocol stack can be added to the test framework according to the execution order of the diagnostic tasks in the test framework to generate a vehicle diagnostic service code containing the protocol stack and the test framework, and then the vehicle diagnostic service can be completed by executing the vehicle diagnostic service code. In the present application, when the diagnostic requirements change, the vehicle diagnostic service code can be automatically generated without the need for professional developers to edit the corresponding diagnostic code, thereby realizing the platformization of diagnostic services, saving labor costs and improving the efficiency of the diagnostic process.
[0125] In one embodiment, the above step S101 may be implemented as the following steps A1-A2:
[0126] In step A1, the ECU diagnostic service requirement and user-defined data in the diagnostic questionnaire are obtained, wherein the ECU diagnostic service requirement is the ECU diagnostic service requirement corresponding to the vehicle to be diagnosed, and the user-defined data includes identification information of the vehicle to be diagnosed;
[0127] In step A2, a first analysis is performed on the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code including the ECU diagnostic service requirements and the user-defined data.
[0128] In this embodiment, the protocol stack of the diagnostic service is decoupled from the business processing flow. Specific diagnostic services, such as fault code reading, ECU resetting, flashing, etc., will be divided into specific diagnostic services according to the UDS protocol. These services are distinguished by IDs. For example, service 27 provides a security protection mechanism, and service 31 provides program control operations.
[0129] The protocol stack is built based on the diagnostic questionnaire and user-defined diagnostic data to provide a complete processing interface for diagnostic data. In order to facilitate data interaction with the outside world, the user-defined diagnostic data includes the diagnosed vehicle information, such as the vehicle's VIN code.
[0130] In one embodiment, the above step A1 may be implemented as the following steps A11-A13:
[0131] In step A11, the diagnostic questionnaire is configured as a CDD file including ECU diagnostic service requirements and user-defined data according to a preset CDD template;
[0132] In step A12, the CDD file is formatted to be converted into an ODX file containing ECU diagnostic service requirements and user-defined data;
[0133] In step A13, the ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes including ECU diagnostic service requirements and user-defined data.
[0134] In this embodiment, the protocol stack of the diagnostic service is decoupled from the business processing flow, and the protocol stack is constructed based on the diagnostic questionnaire to generate an ODX diagnostic database and provide a complete diagnostic data processing interface.
[0135] like Figure 2 As shown, first, the diagnostic questionnaire is configured as a CDD file containing ECU diagnostic service requirements and user-defined data according to the preset CDD template. The diagnostic questionnaire is a CDD file containing ECU diagnostic service requirements and user-defined data provided by the developer according to the specific ECU diagnostic service requirements. By configuring the diagnostic questionnaire as a CDD file, the diagnostic questionnaire can be released to obtain diagnostic questionnaire data containing ECU diagnostic service requirements and user-defined data. The template contains directories corresponding to various ECU diagnostic service requirement types and user-defined data types. The device can identify the directory and fill in the ECU diagnostic service requirements and user-defined data into the corresponding directory, thereby realizing the template of the diagnostic questionnaire. After templateization, the diagnostic survey is easier to be recognized by the machine, which is convenient for subsequent format conversion and parsing.
[0136] Afterwards, the CDD file is formatted and converted into an ODX file containing ECU diagnostic service requirements and user-defined data. In order to facilitate the interaction of diagnostic data, the CDD file is generated into an ODX file, thereby generating an ODX diagnostic database corresponding to the diagnostic requirements.
[0137] Finally, the ODX file is parsed by the ODX parser to generate a protocol stack of vehicle diagnostic codes containing ECU diagnostic service requirements and user-defined data. Specifically, the generated ODX diagnostic database is loaded into the ODX parser in combination with user-defined diagnostic data such as vehicle information to automatically generate a protocol stack.
[0138] In one embodiment, the above step S102 may be implemented as the following steps B1-B2:
[0139] In step B1, the diagnostic sequence description file is edited into an OTX file by an OTX editor;
[0140] In step B2, the OTX file is parsed by an OTX parser to generate the test framework.
[0141] In this embodiment, after the protocol stack of the diagnostic service is decoupled from the diagnostic service processing flow, in order to complete the diagnostic service according to the diagnostic service processing flow, it is necessary to construct a test framework that specifies the diagnostic service processing flow.
[0142] First, an OTX file is generated according to the diagnostic sequence description file. Specifically, the diagnostic sequence description file is converted into the OTX file through an OTX editor;
[0143] Then, the test framework is generated according to the OTX file and the protocol stack. Since the diagnostic sequence description file contains the interface information of the protocol stack and the diagnostic service processing flow, the converted OTX file also contains the interface information of the protocol stack and the diagnostic service processing flow, thereby obtaining an interface information test framework including the diagnostic service processing flow and the protocol stack.
[0144] In one embodiment, the above step S104 may be implemented as the following steps C1-C4:
[0145] In step C1, the state machine of the vehicle diagnostic service code is executed to perform initialization operation in the order in which the interface information is added in the test framework;
[0146] In step C2, an interface corresponding to the vehicle diagnostic part in the vehicle diagnostic service code is executed to implement vehicle diagnosis;
[0147] In step C3, obtaining vehicle diagnosis results;
[0148] In step C4, the vehicle diagnosis result is fed back to a preset client.
[0149] In this embodiment, the state machine that executes the vehicle diagnostic service code is initialized. Specifically, the legitimacy of at least one of the following preset parameters related to the service can be checked: service identification code, state machine sub-function, valid data length, addressing mode, whether DID is supported, session and security status; when the legitimacy check of all preset parameters is passed, the state machine that executes the vehicle diagnostic service code is initialized; when there are preset parameters whose legitimacy fails the test, the information of initialization failure is returned.
[0150] The order in which the interface information is added in the test framework is used as the execution order, and the interfaces corresponding to the vehicle diagnostic part in the vehicle diagnostic service code are executed to realize the diagnosis of the vehicle. After the initialization operation is completed, the vehicle diagnostic service code automatically generated by the test framework and the protocol stack is called by the execution engine, and the interfaces corresponding to the vehicle diagnostic part are executed to diagnose the vehicle.
[0151] Obtain vehicle diagnostic results. After diagnosing the vehicle, obtain the response data processed by the test framework, perform numerical conversion, unit conversion, effective value verification, serialization and other related operations, and obtain the positive response and negative response of the vehicle feedback; encapsulate the positive response and negative response of the vehicle feedback, specifically encapsulating the relevant parameters of the positive or negative response according to the UDS protocol stack format requirements; determine the encapsulated positive response and negative response as the vehicle diagnostic result.
[0152] Finally, the vehicle diagnosis result is fed back to a preset client, such as an external vehicle diagnostic instrument.
[0153] The beneficial effect of this embodiment is that by providing a method for executing a diagnostic code, the diagnostic code can be executed without embedding the diagnostic code into the ECU through hard coding.
[0154] In one embodiment, the above step C1 can be implemented as follows:
[0155] Check the legitimacy of at least one of the following preset parameters related to the service:
[0156] Service identification code, state machine sub-function, valid data length, addressing mode, whether DID is supported, session and security status;
[0157] When the legitimacy detection of all preset parameters passes, initializing the state machine executing the vehicle diagnostic service code;
[0158] When there are preset parameters whose validity fails to pass the test, the message of initialization failure is returned.
[0159] The beneficial effect of this embodiment is that, because the legitimacy of various service-related parameters can be detected before the state machine is initialized, the validity of the diagnosis result is guaranteed.
[0160] In one embodiment, the above step C3 may be implemented as the following steps C31-C33:
[0161] In step C31, obtaining a positive response and a negative response of vehicle feedback;
[0162] In step C32, the positive response and negative response of the vehicle feedback are encapsulated;
[0163] In step C33, the packaged positive response and negative response are determined to be the vehicle diagnosis result.
[0164] In this embodiment, the positive response and negative response of the vehicle feedback are obtained. After the vehicle is diagnosed, the response data processed by the test framework is obtained, and related operations such as numerical conversion, unit conversion, effective value verification, and serialization are performed to obtain the positive response and negative response of the vehicle feedback;
[0165] Encapsulating the positive response and negative response fed back by the vehicle, specifically encapsulating relevant parameters of the positive or negative response according to the UDS protocol stack format requirements;
[0166] The positive response and the negative response after packaging are determined to be the vehicle diagnosis results.
[0167] Figure 5 FIG. 1 is a schematic diagram of the structure of a vehicle diagnostic device in one embodiment of the present application. Figure 5 As shown, the device comprises:
[0168] A first parsing module 501 is used to perform a first parsing on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, and the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service, and the diagnostic service includes multiple diagnostic tasks;
[0169] An acquisition module 502 is used to acquire a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow;
[0170] A second parsing module 503, configured to perform a second parsing on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the test framework matches the diagnostic service process;
[0171] A generating module 504, configured to add the protocol stack and the interface information of the protocol stack to the test framework according to the diagnostic task execution order in the test framework, so as to generate a vehicle diagnostic service code including the protocol stack and the test framework;
[0172] The diagnosis module 505 is used to perform vehicle diagnostic services by executing the vehicle diagnostic service code.
[0173] In one embodiment, the first parsing module includes:
[0174] A first acquisition submodule is used to acquire the ECU diagnostic service requirements and user-defined data in the diagnostic questionnaire, wherein the ECU diagnostic service requirements are the ECU diagnostic service requirements corresponding to the vehicle to be diagnosed, and the user-defined data includes identification information of the vehicle to be diagnosed;
[0175] The generating submodule is used to respectively perform a first analysis on the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code including the ECU diagnostic service requirements and the user-defined data.
[0176] In one embodiment, the generating submodule is further used for:
[0177] Configuring the diagnostic questionnaire into a CDD file including ECU diagnostic service requirements and user-defined data according to a preset CDD template;
[0178] Performing format conversion on the CDD file to convert the CDD file into an ODX file containing ECU diagnostic service requirements and user-defined data;
[0179] The ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes including ECU diagnostic service requirements and user-defined data.
[0180] In one embodiment, the second parsing module includes:
[0181] An editing submodule, used for editing the diagnostic sequence description file into an OTX file through an OTX editor;
[0182] The parsing submodule is used to parse the OTX file through an OTX parser to generate the test framework.
[0183] In one embodiment, the diagnostic module comprises:
[0184] An initialization submodule, used to execute the state machine of the vehicle diagnostic service code to perform initialization operations in the order in which the interface information is added in the test framework;
[0185] A diagnosis submodule, used to execute the interface corresponding to the vehicle diagnosis part in the vehicle diagnosis service code to realize the diagnosis of the vehicle;
[0186] The second acquisition submodule is used to obtain vehicle diagnosis results;
[0187] The feedback submodule is used to feed back the vehicle diagnosis result to a preset client.
[0188] In one embodiment, the initialization submodule is further used to:
[0189] Check the legitimacy of at least one of the following preset parameters related to the service:
[0190] Service identification code, state machine sub-function, valid data length, addressing mode, whether DID is supported, session and security status;
[0191] When the legitimacy detection of all preset parameters passes, initializing the state machine executing the vehicle diagnostic service code;
[0192] When there are preset parameters whose validity fails to pass the test, the message of initialization failure is returned.
[0193] In one embodiment, the second acquisition submodule is further used to:
[0194] Obtain positive and negative responses to vehicle feedback;
[0195] Encapsulating the positive response and the negative response of the vehicle feedback;
[0196] The positive response and the negative response after packaging are determined to be the vehicle diagnosis results.
[0197] Figure 6 FIG. 1 is a schematic diagram of the hardware structure of a vehicle diagnostic system in one embodiment of the present application. Figure 6 As shown, the vehicle diagnostic system includes:
[0198] at least one processor 620; and,
[0199] A memory 604 in communication with the at least one processor 620; wherein,
[0200] The memory 604 stores instructions that can be executed by the at least one processor 620, and the instructions are executed by the at least one processor 620 to implement the vehicle diagnosis method described in any one of the above embodiments.
[0201] Reference Figure 6 The vehicle diagnostic system 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0202] The processing component 602 generally controls the overall operation of the vehicle diagnostic system 600. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0203] The memory 604 is configured to store various types of data to support the operation of the vehicle diagnostic system 600. Examples of such data include instructions for any application or method operating on the vehicle diagnostic system 600, such as text, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0204] The power assembly 606 provides power to the various components of the vehicle diagnostic system 600. The power assembly 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the onboard control system 600.
[0205] The multimedia component 608 includes a screen that provides an output interface between the vehicle diagnostic system 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 may also include a front camera and / or a rear camera. When the vehicle diagnostic system 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0206] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the vehicle diagnostic system 600 is in an operation mode, such as an alarm mode, a recording mode, a voice recognition mode, and a voice output mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0207] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0208] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the vehicle diagnostic system 600. For example, the sensor assembly 614 may include a sound sensor. In addition, the sensor assembly 614 may detect the on / off state of the vehicle diagnostic system 600, the relative positioning of the components, such as the display and keypad of the vehicle diagnostic system 600, and the sensor assembly 614 may also detect the operating state of the vehicle diagnostic system 600 or a component of the vehicle diagnostic system 600, such as the operating state of the air distribution plate, the structural state, the operating state of the discharge scraper, etc., the orientation or acceleration / deceleration of the vehicle diagnostic system 600 and the temperature change of the vehicle diagnostic system 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, a material stack thickness sensor or a temperature sensor.
[0209] The communication component 616 is configured to enable the vehicle diagnostic system 600 to provide the ability to communicate with other devices and cloud platforms in a wired or wireless manner. The vehicle diagnostic system 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0210] In an exemplary embodiment, the vehicle diagnostic system 600 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the vehicle diagnostic method described in any of the above embodiments.
[0211] The present application also provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor corresponding to the vehicle diagnostic system, the vehicle diagnostic system can implement the vehicle diagnostic method recorded in any of the above embodiments.
[0212] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0213] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0214] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0215] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0216] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A vehicle diagnostic method, characterized in that: include: Performing a first analysis on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe a vehicle ECU diagnostic service requirement, and the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service; Obtaining a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow; Performing a second analysis on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the test framework matches the diagnostic service process; Adding the protocol stack and the interface information of the protocol stack to the test framework according to the diagnostic task execution order in the test framework to generate a vehicle diagnostic service code including the protocol stack and the test framework; The vehicle diagnostic service is performed by executing the vehicle diagnostic service code.
2. The method according to claim 1, characterized in that The protocol stack for performing a first analysis on the diagnostic questionnaire to generate a vehicle diagnostic service code includes: Acquire the ECU diagnostic service requirements and user-defined data in the diagnostic questionnaire, wherein the ECU diagnostic service requirements are the ECU diagnostic service requirements corresponding to the vehicle to be diagnosed, and the user-defined data includes identification information of the vehicle to be diagnosed; A first analysis is performed on the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code including the ECU diagnostic service requirements and the user-defined data.
3. The method according to claim 2, characterized in that The first parsing of the ECU diagnostic service requirements and the user-defined data in the diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic code containing the ECU diagnostic service requirements and the user-defined data comprises: Configuring the diagnostic questionnaire into a CDD file including ECU diagnostic service requirements and user-defined data according to a preset CDD template; Performing format conversion on the CDD file to convert the CDD file into an ODX file containing ECU diagnostic service requirements and user-defined data; The ODX file is parsed by an ODX parser to generate a protocol stack of vehicle diagnostic codes including ECU diagnostic service requirements and user-defined data.
4. The method according to claim 1, characterized in that A test framework for performing a second analysis on the diagnostic service process in the diagnostic sequence description file to generate a vehicle diagnostic service code includes: Editing the diagnostic sequence description file into an OTX file by using an OTX editor; The OTX file is parsed by an OTX parser to generate the test framework.
5. The method according to claim 1, characterized in that The vehicle diagnostic service is performed by executing the vehicle diagnostic service code, including: Initializing a state machine that executes the vehicle diagnostic service code; The interface information is added in the test framework in the order of execution, and the interface corresponding to the vehicle diagnosis part in the vehicle diagnosis service code is executed to realize the diagnosis of the vehicle; Get vehicle diagnostic results; The vehicle diagnosis result is fed back to a preset client.
6. The method according to claim 5, characterized in that The initializing operation of the state machine executing the vehicle diagnostic service code includes: Check the legitimacy of at least one of the following preset parameters related to the service: service identification code, state machine subfunction, valid data length, addressing mode, DID support, session and security status; When the legitimacy detection of all preset parameters passes, initializing the state machine executing the vehicle diagnostic service code; When there are preset parameters whose validity fails to pass the test, the message of initialization failure is returned.
7. The method according to claim 5, characterized in that The obtaining of vehicle diagnosis results includes: Obtain positive and negative responses to vehicle feedback; Encapsulating the positive response and the negative response of the vehicle feedback; The positive response and the negative response after packaging are determined to be the vehicle diagnosis results.
8. A vehicle diagnostic device, characterized in that: include: a first parsing module, configured to perform a first parsing on a diagnostic questionnaire to generate a protocol stack of a vehicle diagnostic service code, wherein the diagnostic questionnaire is used to describe the vehicle ECU diagnostic service requirements, the protocol stack includes execution codes of various diagnostic tasks involved in the vehicle diagnostic service, and the diagnostic service includes multiple diagnostic tasks; An acquisition module, used for acquiring a diagnostic sequence description file including interface information of the protocol stack and a diagnostic service processing flow; a second parsing module, configured to perform a second parsing on the diagnostic service process in the diagnostic sequence description file to generate a test framework of the vehicle diagnostic service code, wherein the execution order of the diagnostic tasks in the test framework matches the diagnostic service process; A generating module, used for adding the protocol stack and the interface information of the protocol stack to the test framework according to the diagnostic task execution order in the test framework, so as to generate a vehicle diagnostic service code including the protocol stack and the test framework; The diagnostic module is used for performing diagnostic service of the vehicle by executing the vehicle diagnostic service code.
9. A vehicle diagnostic system, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to implement the vehicle diagnosis method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor corresponding to the vehicle diagnostic system, the vehicle diagnostic system can implement the vehicle diagnostic method as described in any one of claims 1 to 7.
Citation Information
Cited By
Message processing method and device based on J1939 diagnostic message protocol
CN118968652A
