Vehicle diagnosis service code generation method and device and vehicle-mounted terminal

By searching diagnostic service information in the ODX database and generating decoupled diagnostic interface code and business code, the inefficiency problem caused by the coupling of the UDS protocol stack and diagnostic services is solved, and the efficiency and portability of vehicle diagnostic services are improved.

CN118534865APending Publication Date: 2024-08-23BEIJING CHJ AUTOMOTIVE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310161799.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, the UDS protocol stack and the UDS diagnostic service are coupled together, resulting in low diagnostic efficiency and poor portability of the vehicle diagnostic service.

Method used

By obtaining the diagnostic instructions triggered by the user, the diagnostic service information is searched in the ODX database based on the diagnostic service query code, the preset code template is updated, the diagnostic interface code is generated, and the diagnostic service code is generated according to the diagnostic service parameters and the preset processing flow, and the diagnostic service code is generated. The combination of interface code and diagnostic service code realizes the decoupling of UDS protocol stack and diagnostic service.

Benefits of technology

It improves the diagnostic efficiency of the vehicle diagnostic service, enhances the portability and robustness of the code, and simplifies the generation and update process of the diagnostic interface code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118534865A
    Figure CN118534865A
Patent Text Reader

Abstract

The invention provides a vehicle diagnosis service code generation method and device and a vehicle-mounted terminal, and relates to the technical field of vehicle safety, and the method comprises the steps: obtaining a diagnosis instruction triggered by a user, and the diagnosis instruction comprises a diagnosis service query code and a diagnosis service parameter; searching in an ODX database based on the diagnosis service query code to obtain diagnosis service information, updating a preset code template according to the diagnosis service information to generate a diagnosis interface code, the diagnosis interface code comprising a unified diagnosis service UDS protocol stack and customized information of a diagnosis questionnaire; determining a diagnosis service code corresponding to the diagnosis instruction according to the diagnosis service parameter and a preset processing flow; and combining the diagnosis interface code and the diagnosis service code to generate a diagnosis service code. The problem that the diagnosis efficiency of vehicle diagnosis service is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle safety technology, and in particular to a method and device for generating a vehicle diagnostic service code and a vehicle-mounted terminal. Background Art

[0002] Open Diagnostic Data Exchange (ODX), as an open diagnostic database based on XML format, covers all the data required for diagnosis and flashing involved in automobile production, Electronic Control Unit (ECU) programming and after-sales process.

[0003] In the related technology, the ECU diagnostic service module is the basic service component for realizing application requirements such as ECU flashing, self-diagnosis and calibration. The core of the ECU diagnostic service module includes the Unified Diagnostic Services (UDS) Server test framework and the application service module. In the traditional method, the UDS Server test framework and the application service module are coupled through a hard-coded method, that is, the UDS protocol stack in the UDS Server test framework is coupled with the UDS diagnostic service, which makes the diagnostic efficiency of executing vehicle diagnostic services low. Summary of the invention

[0004] In order to solve the problem in the related art that the UDS protocol stack and the UDS diagnostic service are coupled together, resulting in low diagnostic efficiency of the vehicle diagnostic service, the embodiments of the present application provide a method, device, vehicle-mounted terminal, and computer-readable storage medium for generating a vehicle diagnostic service code.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a vehicle diagnostic service code, comprising:

[0006] Acquire a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter;

[0007] Based on the diagnostic service query code, the ODX database is searched to obtain diagnostic service information, and a preset code template is updated according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the unified diagnostic service UDS protocol stack and the custom information of the diagnostic questionnaire;

[0008] Determining the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameter and the preset processing flow;

[0009] The diagnostic interface code and the diagnostic service code are combined to generate a diagnostic service code.

[0010] As an optional implementation of the embodiment of the present application, the searching in the ODX database based on the diagnostic service query code to obtain the diagnostic service information includes:

[0011] Acquiring a corresponding relationship, wherein the corresponding relationship includes a corresponding relationship between a diagnostic service query code and diagnostic service information;

[0012] Searching the ODX database according to the diagnostic service query code and the corresponding relationship to obtain diagnostic service information, the diagnostic service information including diagnostic parameters, service request and service response data;

[0013] The diagnostic interface code is generated according to the diagnostic service information and a preset code template.

[0014] As an optional implementation of the embodiment of the present application, searching the ODX database according to the diagnostic service query code to obtain diagnostic service information includes:

[0015] Based on the query service interface of the ODX database, calling the ODX parser;

[0016] Based on the ODX parser, the diagnostic service information corresponding to the diagnostic service query code is searched from the ODX database.

[0017] As an optional implementation of the embodiment of the present application, the updating of the preset code template according to the parameters in the diagnostic service information to generate the diagnostic interface code includes:

[0018] Call the dynamic code generation interface;

[0019] The diagnostic parameter, the service request and the service response data are acquired through a generator in the dynamic code generation interface, and the preset code template is updated to generate the diagnostic interface code.

[0020] As an optional implementation manner of an embodiment of the present application, the preset processing flow includes: pre-processing, service processing, business processing, parameter processing, post-processing and completion, the pre-processing is used to determine the legitimacy of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate parameters related to the service response data in accordance with the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate that the processing is completed.

[0021] As an optional implementation of the embodiment of the present application, the preset processing flow also includes: if the pre-processing fails, jump to the post-processing; if the pre-processing is successful, jump to the service processing; if the service processing is completed, jump to the business processing; if the business processing is successful and the suppression bit is reset, jump to the parameter processing stage; if the business processing is successful and the suppression bit is set, jump to the completion; if the business processing fails, jump to the post-processing; if the parameter processing is completed, jump to the post-processing; if the post-processing is completed, jump to the completion.

[0022] In a second aspect, an embodiment of the present application provides a device for generating a vehicle diagnostic service code, comprising:

[0023] An acquisition module, used to acquire a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter;

[0024] A generation module is used to search in the ODX database based on the diagnostic service query code to obtain diagnostic service information, and update a preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the unified diagnostic service UDS protocol stack and the custom information of the diagnostic questionnaire; determine the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameters and the preset processing flow; and combine the diagnostic interface code and the diagnostic service code to generate a diagnostic service code.

[0025] As an optional implementation of the embodiment of the present application, the generating module is specifically used to: obtain a corresponding relationship, wherein the corresponding relationship includes a corresponding relationship between a diagnostic service query code and diagnostic service information;

[0026] A search is performed in the ODX database according to the diagnostic service query code and the corresponding relationship to obtain diagnostic service information, wherein the diagnostic service information includes diagnostic parameters, service request and service response data; and the diagnostic interface code is generated according to the diagnostic service information and a preset code template.

[0027] As an optional implementation of the embodiment of the present application, the generation module is specifically used to: call the ODX parser based on the query service interface of the ODX database; and search the ODX database for diagnostic service information corresponding to the diagnostic service query code based on the ODX parser.

[0028] As an optional implementation of an embodiment of the present application, the generation module is specifically used to: call a dynamic code generation interface; based on a generator in the dynamic code generation interface, obtain the diagnostic parameters, the service request and the service response data through the generator in the dynamic code generation interface, and update the preset code template to generate the diagnostic interface code.

[0029] As an optional implementation manner of an embodiment of the present application, the preset processing flow includes: pre-processing, service processing, business processing, parameter processing, post-processing and completion, the pre-processing is used to determine the legitimacy of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate parameters related to the service response data in accordance with the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate that the processing is completed.

[0030] As an optional implementation of the embodiment of the present application, the preset processing flow also includes: if the pre-processing fails, jump to the post-processing; if the pre-processing is successful, jump to the service processing; if the service processing is completed, jump to the business processing; if the business processing is successful and the suppression bit is reset, jump to the parameter processing stage; if the business processing is successful and the suppression bit is set, jump to the completion; if the business processing fails, jump to the post-processing; if the parameter processing is completed, jump to the post-processing; if the post-processing is completed, jump to the completion.

[0031] In a third aspect, an embodiment of the present application provides a vehicle diagnostic service system, including: a client, configured to receive a diagnostic operation triggered by a user; generating a diagnostic instruction according to the diagnostic operation, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter;

[0032] The diagnostic server is used to receive the diagnostic instruction; generate a diagnostic interface code according to the diagnostic service query code and the ODX database, wherein the diagnostic interface code includes the unified diagnostic service UDS protocol stack and the custom information of the diagnostic questionnaire; generate a diagnostic service code according to the diagnostic service parameters and the preset processing flow; combine the diagnostic interface code and the diagnostic service code to generate a diagnostic service code;

[0033] The electronic control unit is used to receive the vehicle diagnostic service code and execute the vehicle diagnostic service code to obtain diagnostic result data information.

[0034] In a fourth aspect, an embodiment of the present application provides a vehicle-mounted terminal, comprising: a memory and a processor, the memory being used to store a computer program, the processor being used to execute the method for generating a vehicle diagnostic service code described in the first aspect or any optional implementation of the first aspect when calling the computer program.

[0035] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a vehicle diagnostic service code described in the first aspect or any optional implementation of the first aspect is implemented.

[0036] Compared with the prior art, the technical solution provided by the embodiments of the present application has the following advantages:

[0037] The embodiment of the present application provides a method, device, vehicle terminal and computer-readable storage medium for generating vehicle diagnostic service codes, wherein the method comprises: obtaining a diagnostic instruction triggered by a user, wherein the diagnostic instruction comprises a diagnostic service query code and a diagnostic service parameter; searching in an ODX database based on the diagnostic service query code to obtain diagnostic service information, and updating a preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code comprises the custom information of a unified diagnostic service UDS protocol stack and a diagnostic questionnaire; generating a diagnostic service code according to the diagnostic service parameters and the preset processing flow; combining the diagnostic interface code and the diagnostic service code to generate a diagnostic service code. In the method for generating vehicle diagnostic service codes provided in the embodiment of the present application, a diagnostic interface code is generated by generating diagnostic service information based on the diagnostic service query code, and the diagnostic service code corresponding to the diagnostic instruction is determined according to the diagnostic service parameters and the preset processing flow, thereby realizing the decoupling of the diagnostic interface code from the diagnostic service code, and then realizing the decoupling of the UDS protocol stack and the diagnostic service code included in the diagnostic interface code, that is, realizing the decoupling of the UDS protocol stack and the processing flow of the diagnostic service, thereby improving the UDS diagnostic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0040] Figure 1A flowchart of a method for generating a vehicle diagnostic service code according to an embodiment of the present application;

[0041] Figure 2 A flowchart of a method for generating a vehicle diagnostic service code according to another embodiment of the present application;

[0042] Figure 3 A schematic diagram of obtaining diagnostic service information based on an ODX parser according to an embodiment of the present application;

[0043] Figure 4 A schematic diagram of generating a dynamic code generation interface according to an embodiment of the present application;

[0044] Figure 5 A schematic diagram of a preset processing flow in one embodiment of the present application;

[0045] Figure 6 A structural block diagram of a device for generating a vehicle diagnostic service code provided by one embodiment of the present application;

[0046] Figure 7 The internal structure diagram of the vehicle terminal provided according to one or more embodiments of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0048] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete implementation method separately. It should be noted that the brief description of the terms in this application is only for the convenience of understanding the implementation methods described below, and is not intended to limit the implementation methods of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0049] First, the application scenario of the embodiment of the present application is described. The vehicle diagnostic service is a way of information interaction between the diagnostic equipment and the ECU. The Unified Diagnostic Services (UDS) diagnostic protocol is a requirement specification for diagnostic communication in the automotive industry. The ECU diagnostic service module is a basic service component that implements application requirements such as ECU flashing, self-diagnosis and calibration. However, the relevant ISO and enterprise standards involved in the ECU diagnostic service module are relatively complex, and its functional architecture design is relatively complex. In addition, the hard-coded method is used for encoding so that the protocol is closely integrated with the specific business process. When the protocol changes, a new corresponding coding process is required, and the code has poor versatility. In other words, the protocol stack of the ECU diagnostic service module and the specific process of the diagnostic service are coupled together, which makes the vehicle diagnostic service less efficient and less portable.

[0050] Based on this, ODX is an open diagnostic database based on XML format. The embodiment of the present application provides a method for generating a vehicle diagnostic service code. The diagnostic service information is obtained by searching in the ODX database based on the diagnostic service query code, and a preset code template is updated according to the diagnostic service information to generate a diagnostic interface code. In addition, the diagnostic service code corresponding to the diagnostic instruction is determined according to the diagnostic service parameters and the preset processing flow. The diagnostic interface code and the diagnostic service code are independent of each other, so that the protocol stack included in the diagnostic interface code and the diagnostic service code for processing the diagnostic service are decoupled, thereby improving the efficiency of this segment of the vehicle service.

[0051] The vehicle control signal processing method provided in the embodiment of the present application can be applied to the vehicle diagnostic service system provided in the embodiment of the present application, and can also be executed through the vehicle-mounted terminal provided in the embodiment of the present application. The vehicle-mounted terminal provided in the embodiment of the present application can be but is not limited to an on-board computer (ECU), an on-board infotainment product, etc.

[0052] The following is a detailed description of the method for generating the vehicle diagnostic service code provided in the embodiments of the present application through several specific embodiments.

[0053] Figure 1 A flowchart of a method for generating a vehicle diagnostic service code provided by an embodiment of the present application, referring to Figure 1 As shown, the method for generating a vehicle diagnostic service code provided in this embodiment includes the following steps:

[0054] S110: Obtain a diagnosis instruction triggered by a user.

[0055] The diagnostic instruction includes a diagnostic service query code and diagnostic service parameters. A corresponding diagnostic instruction is generated based on the user's diagnostic request. The diagnostic request may include vehicle information of the vehicle to be diagnosed. The diagnostic instruction is used to instruct the vehicle information to be collected for the vehicle to be diagnosed. The diagnostic service query code is used to uniquely identify the vehicle diagnostic service. The diagnostic service parameters can be understood as parameters to be diagnosed, including working process parameters, accompanying process parameters and geometric dimension parameters. Working process parameters can be engine power, automobile fuel consumption, braking distance or braking force, etc., and accompanying process parameters can be but are not limited to vibration, noise, abnormal sound, temperature, etc.; geometric dimension parameters can be free travel, roundness, cylindricity, etc.

[0056] S120 , searching in the ODX database based on the diagnostic service query code to obtain diagnostic service information, and updating a preset code template according to the diagnostic service information to generate a diagnostic interface code.

[0057] Wherein, the ODX database includes the custom information of the UDS protocol stack and the diagnostic questionnaire, and the generated diagnostic interface code includes the custom information of the UDS protocol stack and the diagnostic questionnaire. The ODX database is an open diagnostic database based on the XML format, and the diagnostic questionnaire is a diagnostic service list output in response to a diagnostic instruction triggered by the user, which may include a variety of diagnostic service items for the user to select and configure to implement the corresponding vehicle diagnostic service. The diagnostic interface code can be understood as a dynamic code, and a diagnostic interface code that fails can be generated according to different diagnostic instructions. The diagnostic interface code is used to obtain the communication protocol data of the diagnostic function to be executed. For example, based on the diagnostic interface code, an interface can be obtained to implement the search and acquisition of diagnostic data of the diagnostic protocol file of OTX, etc.

[0058] Exemplarily, when a user-triggered diagnostic instruction is received, a diagnostic questionnaire is loaded into the ODX database based on the diagnostic service query code included in the diagnostic instruction, and a corresponding diagnostic interface code is generated based on the diagnostic service parameters in the diagnostic questionnaire.

[0059] The embodiment of the present application provides a method for automatically generating diagnostic interface codes by loading a diagnostic questionnaire in the ODX database based on the diagnostic service query code included in the diagnostic instruction when a user-triggered diagnostic instruction is received, and generating corresponding diagnostic interface codes based on the diagnostic service parameters in the diagnostic questionnaire. This eliminates the need for software engineers to manually write diagnostic interface codes when the diagnostic interface codes need to be rebuilt or updated, thereby improving efficiency.

[0060] S130: Determine a diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameters and a preset processing flow.

[0061] Among them, the diagnostic service code is a static logic code. When a diagnostic instruction is received, it only needs to be determined according to the diagnostic service parameters and the preset processing flow under the storage directory.

[0062] Exemplarily, the preset processing flow may be one or more of pre-processing, service processing, business processing, parameter processing, post-processing and completion. The pre-processing is used to determine the legality of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate the parameters related to the service response data according to the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate the completion of the processing. The diagnostic business code is used to execute the diagnostic process corresponding to the vehicle diagnostic service.

[0063] S140: Combine the diagnostic interface code and the diagnostic service code to generate a vehicle diagnostic service code.

[0064] Optionally, after the vehicle diagnostic service code is generated, relevant diagnostic operations can be performed by executing the vehicle diagnostic service code to obtain diagnostic result data information to respond to the diagnostic instruction, and the diagnostic result can be displayed.

[0065] The embodiment of the present application provides a method for generating a vehicle diagnostic service code, including: obtaining a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter; searching in an ODX database based on the diagnostic service query code to obtain diagnostic service information, and updating a preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the custom information of a unified diagnostic service UDS protocol stack and a diagnostic questionnaire; generating a diagnostic service code according to the diagnostic service parameters and a preset processing flow; combining the diagnostic interface code and the diagnostic service code to generate a diagnostic service code. In the method for generating a vehicle diagnostic service code provided in the embodiment of the present application, a diagnostic interface code is generated by generating a diagnostic service information based on the diagnostic service query code, and the diagnostic service code corresponding to the diagnostic instruction is determined according to the diagnostic service parameters and a preset processing flow, thereby realizing the decoupling of the diagnostic interface code from the diagnostic service code, and then realizing the decoupling of the UDS protocol stack included in the diagnostic interface code from the diagnostic service code, that is, realizing the decoupling of the UDS protocol stack from the processing flow of the diagnostic service, thereby improving the UDS diagnostic efficiency.

[0066] exist Figure 1 Based on the embodiment shown, step S120) may include the following steps S210-S230, referring to Figure 2 As shown, this embodiment no longer Figure 1The same or similar steps in the embodiments shown are specifically described and illustrated. For details, please refer to Figure 1 The embodiments shown are illustrated and described.

[0067] S210 , obtaining a corresponding relationship, searching the ODX database according to the diagnostic service query code and the corresponding relationship, and obtaining diagnostic service information.

[0068] The diagnostic service information includes diagnostic parameters, service request and service response data; the corresponding relationship includes the corresponding relationship between the diagnostic service query code and the diagnostic service information. Different diagnostic instructions have different diagnostic service query codes. According to the diagnostic service query code and the corresponding relationship, the diagnostic service information corresponding to the diagnostic instruction is obtained by searching in the ODX database.

[0069] The above steps may be implemented in the following manner: based on the ODX query service interface of the ODX database, calling the ODX parser; based on the ODX parser, searching the ODX database for diagnostic service information corresponding to the diagnostic service query code.

[0070] Among them, the diagnostic data in the ODX database includes seven types of data, namely, ODX-CS / C, ODX-D, ODX-V, ODX-E, ODX-F, ODX-FD and ODX-M. The diagnostic data in the embodiment of the present application involves two types of data, ODX-CS / C and ODX-D. ODX-CS / C is data representing communication parameter information, and ODX-D is data describing vehicle diagnostic data and services.

[0071] Specifically, the ODX query service interface calls the ODX parser, and the ODX parser queries the ODX database according to the diagnostic service query code in the diagnostic instruction to obtain the diagnostic service list, service request, service response and service description, wherein the service response includes a positive response and a negative response, and the diagnostic service description can be a session, addressing mode, etc. Then, the ODX query service interface processes the diagnostic service list, service request information, service response and diagnostic service description obtained by calling the ODX parser to obtain diagnostic service information such as diagnostic parameters, service request and service response data. The specific process can be referred to Figure 3 shown.

[0072] S220: Call the dynamic code generation interface.

[0073] S230, obtaining the diagnostic parameters, the service request and the service response data through the generator in the dynamic code generation interface, and updating the preset code template to generate the diagnostic interface code.

[0074] The dynamic code generation interface is used to provide a proxy interface for code generation, and by calling this interface, code can be generated according to a specified file format. Figure 4 As shown, by encapsulating the IO and file output interface printer at the bottom layer, the file generator, class generator and data generator are encapsulated on this basis, and finally the generators are uniformly encapsulated through the code generation adapter interface to obtain the dynamic code generation interface. Furthermore, by calling the dynamic code generation interface, based on one or more generators in the dynamic code generation interface, according to the diagnostic service information and the preset code template, the diagnostic interface code can be generated.

[0075] The diagnostic interface code generated by the dynamic code generation interface dynamically shields the impact of changes in the diagnostic questionnaire or CDD information on the diagnostic business logic. The diagnostic business code is only related to ISO / enterprise standards, so the processing logic of the diagnostic business is relatively fixed. By combining the diagnostic interface code with the diagnostic business code to generate a complete vehicle diagnostic service code, the architectural design of the vehicle diagnostic service program has strong robustness and portability.

[0076] Based on any of the above embodiments, in step S130 (generating a diagnostic service code according to the diagnostic service parameters and the preset processing flow), the preset processing flow includes: pre-processing, service processing, business processing, parameter processing, post-processing and completion, the pre-processing is used to determine the legality of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate parameters related to the service response data according to the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate that the processing is completed.

[0077] Optional, see Figure 5 As shown, the preset processing flow also includes: if the pre-processing fails, jump to the post-processing; if the pre-processing succeeds, jump to the service processing; if the service processing is completed, jump to the business processing; if the business processing is successful and the suppression bit is reset, jump to the parameter processing stage; if the business processing is successful and the suppression bit is set, jump to the completion; if the business processing fails, jump to the post-processing; if the parameter processing is completed, jump to the post-processing; if the post-processing is completed, jump to the completion. Among them, * indicates unconditional entry.

[0078] Exemplarily, the service processing is used to call the code dynamic generation interface for processing, and enters the business processing state after the processing is completed; the business processing is used to process the specific business of the vehicle diagnostic service, such as session switching, querying DTC status, etc. If the processing fails, it will enter the post-processing stage; if the processing is successful and the positive response suppression bit (SPRMIB) is not set, it will enter the parameter processing stage; if the processing is successful and the positive response suppression bit (SPRMIB) is set, it will directly enter the completion state. The parameter processing encapsulation of parameters related to the service response data includes the encapsulation of positive response data and the encapsulation of negative response data.

[0079] Diagnostic business code can be generated by calling the static service interface. The static service interface is mainly used to maintain the diagnostic service state machine. For each state in the diagnostic service state machine, the corresponding processing flow and the calling program adapted to the dynamic code generation interface are deployed.

[0080] In one embodiment of the present application, a diagnostic instruction triggered by a user is obtained, a diagnostic questionnaire is returned to the user, a corresponding ODX file is exported based on the CDD file corresponding to the diagnostic questionnaire, a diagnostic interface code is generated based on the ODX file by calling the ODX parser, and a UDS service test framework is formed. The UDS service test framework and an application service module based on static code (diagnostic service code) form an ECU diagnostic service module for providing vehicle diagnostic services. For different diagnostic service items, the diagnostic service code can be universal, and the update of the diagnostic questionnaire or CDD file will only change the diagnostic interface code, and will not affect the diagnostic service code, thereby improving the efficiency of responding to vehicle diagnostic services.

[0081] Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application also provides a device for generating the vehicle diagnostic service code provided by the above embodiment. The device embodiment corresponds to the above method embodiment. For ease of reading, the device embodiment will no longer repeat the details of the above method embodiment one by one, but it should be clear that the terminal device in this embodiment can correspond to all the contents of the above method embodiment.

[0082] Figure 6 A schematic diagram of a device for generating a vehicle diagnostic service code according to an embodiment of the present application is shown in FIG. Figure 6 As shown, the vehicle diagnostic service code generation device 600 provided in this embodiment includes:

[0083] An acquisition module 610 is used to acquire a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter;

[0084] The generation module 620 is used to search in the ODX database based on the diagnostic service query code to obtain diagnostic service information, and update the preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the custom information of the unified diagnostic service UDS protocol stack and the diagnostic questionnaire; determine the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameters and the preset processing flow; and combine the diagnostic interface code and the diagnostic service code to generate a diagnostic service code.

[0085] As an optional implementation of an embodiment of the present application, the generation module 620 is specifically used to: obtain a corresponding relationship, the corresponding relationship including the corresponding relationship between the diagnostic service query code and the diagnostic service information, search the ODX database according to the diagnostic service query code and the corresponding relationship to obtain the diagnostic service information, the diagnostic service information including diagnostic parameters, service request and service response data; generate the diagnostic interface code according to the diagnostic service information and a preset code template.

[0086] As an optional implementation of the embodiment of the present application, the generation module 620 is specifically used to: call the ODX parser based on the query service interface of the ODX database; and search the diagnostic service information corresponding to the diagnostic service query code from the ODX database based on the ODX parser.

[0087] As an optional implementation of the embodiment of the present application, the generation module 620 is specifically used to: call the dynamic code generation interface; obtain the diagnostic parameters, the service request and the service response data through the generator in the dynamic code generation interface, and update the preset code template to generate the diagnostic interface code.

[0088] As an optional implementation manner of an embodiment of the present application, the preset processing flow includes: pre-processing, service processing, business processing, parameter processing, post-processing and completion, the pre-processing is used to determine the legitimacy of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate parameters related to the service response data in accordance with the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate that the processing is completed.

[0089] As an optional implementation of the embodiment of the present application, the preset processing flow also includes: if the pre-processing fails, jump to the post-processing; if the pre-processing is successful, jump to the service processing; if the service processing is completed, jump to the business processing; if the business processing is successful and the suppression bit is reset, jump to the parameter processing stage; if the business processing is successful and the suppression bit is set, jump to the completion; if the business processing fails, jump to the post-processing; if the parameter processing is completed, jump to the post-processing; if the post-processing is completed, jump to the completion.

[0090] In one embodiment, a vehicle-mounted terminal is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the vehicle diagnostic service code methods described in the above method embodiments when executing the computer program.

[0091] For example, Figure 7 This is a schematic diagram of the structure of the vehicle terminal provided in the embodiment of the present application. Figure 7 As shown, the vehicle terminal provided in this embodiment includes: a memory 71 and a processor 72, the memory 71 is used to store computer programs; the processor 72 is used to execute the steps in the method for generating vehicle diagnostic service codes provided in the above method embodiment when calling the computer program, and its implementation principle and technical effect are similar, which will not be repeated here. Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the vehicle-mounted terminal to which the scheme of the present application is applied. The specific vehicle-mounted terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0092] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the vehicle diagnostic service code generation methods described in the above method embodiments are implemented.

[0093] In one embodiment, a vehicle diagnostic service system is provided, comprising: a client, a diagnostic server and an electronic control unit; wherein the client is used to receive a diagnostic operation triggered by a user; according to the diagnostic operation, a diagnostic instruction is generated, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter; the diagnostic server is used to receive the diagnostic instruction; according to the diagnostic service query code and an ODX database, a diagnostic interface code is generated, wherein the diagnostic interface code includes a unified diagnostic service UDS protocol stack and custom information of a diagnostic questionnaire; according to the diagnostic service parameters and a preset processing flow, a diagnostic service code is generated; the diagnostic interface code and the diagnostic service code are combined to generate a diagnostic service code; the electronic control unit is used to receive the vehicle diagnostic service code, and execute the vehicle diagnostic service code to obtain diagnostic result data information.

[0094] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).

[0095] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0096] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above discussion in some embodiments is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

Claims

1. A method for generating a vehicle diagnostic service code, characterized in that: include: Acquire a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter; Based on the diagnostic service query code, the ODX database is searched to obtain diagnostic service information, and a preset code template is updated according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the unified diagnostic service UDS protocol stack and the custom information of the diagnostic questionnaire; Determining the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameter and the preset processing flow; The diagnostic interface code and the diagnostic service code are combined to generate a diagnostic service code.

2. The method according to claim 1, characterized in that: The searching in the ODX database based on the diagnostic service query code to obtain diagnostic service information includes: Acquire a corresponding relationship, wherein the corresponding relationship includes a corresponding relationship between a diagnostic service query code and diagnostic service information; search the ODX database according to the diagnostic service query code and the corresponding relationship to obtain diagnostic service information, wherein the diagnostic service information includes diagnostic parameters, service request and service response data.

3. The method according to claim 2, characterized in that: The step of searching the ODX database according to the diagnostic service query code to obtain diagnostic service information includes: Based on the query service interface of the ODX database, calling the ODX parser; Based on the ODX parser, the diagnostic service information corresponding to the diagnostic service query code is searched from the ODX database.

4. The method according to claim 2, characterized in that: The updating of the preset code template according to the parameters in the diagnostic service information to generate the diagnostic interface code includes: Call the dynamic code generation interface; The diagnostic parameter, the service request and the service response data are acquired through a generator in the dynamic code generation interface, and the preset code template is updated to generate the diagnostic interface code.

5. The method according to any one of claims 2 to 4, characterized in that: The preset processing flow includes: pre-processing, service processing, business processing, parameter processing, post-processing and completion. The pre-processing is used to determine the legality of the diagnostic service parameters; the service processing is used to perform service-related processing according to the diagnostic service parameters; the business processing is used to process the business of the diagnostic service; the parameter processing is used to encapsulate parameters related to the service response data according to the format requirements of the UDS protocol stack; the post-processing is used to process the service response; and the completion is used to indicate the completion of the processing.

6. The method according to claim 5, characterized in that: The preset processing flow also includes: if the pre-processing fails, jump to the post-processing; if the pre-processing is successful, jump to the service processing; if the service processing is completed, jump to the business processing; if the business processing is successful and the suppression bit is reset, jump to the parameter processing stage; if the business processing is successful and the suppression bit is set, jump to the completion; if the business processing fails, jump to the post-processing; if the parameter processing is completed, jump to the post-processing; if the post-processing is completed, jump to the completion.

7. A device for generating a vehicle diagnostic service code, characterized in that: include: An acquisition module, used to acquire a diagnostic instruction triggered by a user, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter; A generation module is used to search in the ODX database based on the diagnostic service query code to obtain diagnostic service information, and update a preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the user-defined information of the unified diagnostic service UDS protocol stack and the diagnostic questionnaire; determine the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameters and the preset processing flow; and combine the diagnostic interface code and the diagnostic service code to generate a diagnostic service code.

8. A vehicle-mounted terminal, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method for generating a vehicle diagnostic service code according to any one of claims 1 to 6 is implemented.

9. A vehicle diagnostic service system, characterized in that: include: The client is used to receive a diagnostic operation triggered by a user; generate a diagnostic instruction according to the diagnostic operation, wherein the diagnostic instruction includes a diagnostic service query code and a diagnostic service parameter; The diagnostic server is used to receive the diagnostic instruction; search in the ODX database based on the diagnostic service query code to obtain diagnostic service information, and update the preset code template according to the diagnostic service information to generate a diagnostic interface code, wherein the diagnostic interface code includes the unified diagnostic service UDS protocol stack and the custom information of the diagnostic questionnaire; determine the diagnostic service code corresponding to the diagnostic instruction according to the diagnostic service parameters and the preset processing flow; combine the diagnostic interface code and the diagnostic service code to generate a diagnostic service code; The electronic control unit is used to receive the vehicle diagnostic service code and execute the vehicle diagnostic service code to obtain diagnostic result data information.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a vehicle diagnostic service code according to any one of claims 1 to 6 is implemented.