A processing method and device of a service interface
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- IMOTION AUTOMOTIVE TECH (SUZHOU) CO LTD
- Filing Date
- 2023-08-24
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]本发明的目的是提供一种服务接口的处理方法、装置,以解决诊断通信接口创建的可靠性低、效率低的技术问题
[0042] The service interface processing method provided by this invention includes: obtaining data identifier configuration information and routine identifier configuration information pre-stored in a diagnostic communication configuration table through a first script; converting the configuration information into an arxml file and opening the arxml file to compile and generate a service interface; obtaining the function body to be implemented corresponding to the service interface through a second script, and using the function body to implement the function corresponding to the service interface. In this method, the first script directly reads the configuration information to complete the service interface configuration, eliminating the need for diagnostic software development engineers to spend a significant amount of time writing software code to configure the information; the second script directly calls the function body to be implemented corresponding to the service interface, automatically updating the service interface, reducing human interference and greatly improving the reliability and efficiency of service interface configuration and function implementation; when the function corresponding to the service interface needs to be implemented, there is no need to focus too much on the service interface itself, only the corresponding function body to be implemented needs to be modified, making the creation of the diagnostic communication interface more reliable, convenient, and efficient, thereby ensuring the accuracy and reliability of domain controller diagnosis, while also significantly reducing the workload of service interface configuration and function implementation.
Smart Images

Figure CN117112015B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of diagnostic communication management technology, and in particular to a method and apparatus for processing service interfaces. Background Technology
[0002] In the Diagnostic Communication Manager (DCM) module, configuring and implementing the service interfaces for Data Identifiers (DIDs) and Routine Identifiers (RIDs) is a crucial and demanding task. Since each project contains hundreds of DIDs and RIDs with varying configurations, and some require adjustments based on customer needs, diagnostic software development engineers must dedicate significant time to writing software code. This process is also prone to errors and oversights, making management and maintenance difficult.
[0003] Therefore, how to make the creation of diagnostic communication interfaces more reliable, convenient and efficient is a technical problem that urgently needs to be solved by those in this field. Summary of the Invention
[0004] The purpose of this invention is to provide a method and apparatus for processing service interfaces to solve the technical problems of low reliability and low efficiency in diagnosing communication interface creation.
[0005] To address the aforementioned technical problems, this invention provides a method for processing service interfaces, comprising:
[0006] The configuration information is obtained from the diagnostic communication configuration table by the first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information.
[0007] The configuration information is converted into an arxml file, and the arxml file is opened to compile and generate the service interface;
[0008] The second script obtains the function body to be implemented corresponding to the service interface, and uses the function body to implement the function corresponding to the service interface.
[0009] Preferably, establishing the diagnostic communication configuration information table includes:
[0010] Retrieve the user-created diagnostic communication configuration table template;
[0011] Based on the user's diagnostic questionnaire and diagnostic specifications, the configuration information is written into the corresponding position in the diagnostic communication configuration table template to establish the diagnostic communication configuration information table.
[0012] Preferably, the diagnostic communication configuration table template includes: a first data identifier configuration table template, a second data identifier configuration table template, a first routine identifier configuration table template, and a second routine identifier configuration table template.
[0013] Preferably, after writing the configuration information into the corresponding position in the diagnostic communication configuration table template according to the user's diagnostic questionnaire and diagnostic specifications, and before obtaining the configuration information pre-stored in the diagnostic communication configuration table through the first script, the method further includes:
[0014] The diagnostic communication configuration information table is traversed using the first script;
[0015] Based on the number of each data identifier and the number of each routine identifier, obtain the configuration data item corresponding to each data identifier and the configuration data item corresponding to each routine identifier;
[0016] The configuration data items corresponding to each data identifier are sorted according to their respective data identifier numbers, and the configuration data items corresponding to each routine identifier are sorted in the same way according to their respective routine identifier numbers.
[0017] Preferably, before sorting the configuration data items corresponding to each data identifier according to their numbers, the method further includes:
[0018] The configuration data items corresponding to each data identifier are classified according to the storage type of the data identifier;
[0019] Based on the classification results, the configuration data items corresponding to each data identifier are stored in the corresponding type items;
[0020] Correspondingly, the sorting process for the configuration data items corresponding to each data identifier based on their numbers includes:
[0021] In each of the aforementioned type items, the configuration data items corresponding to each data identifier are sorted according to the number of each data identifier.
[0022] Preferably, the function body to be implemented includes the function body to be implemented corresponding to the service interface of the data identifier and the function body to be implemented corresponding to the service interface of the routine identifier.
[0023] The function body to be implemented for establishing the service interface corresponding to the data identifier includes:
[0024] Retrieve the first template of the storage partition according to the data identifier function;
[0025] Fill the configuration data items corresponding to each categorized data identifier into the corresponding positions in the first template;
[0026] Based on the configuration data items corresponding to each data identifier in the first template, establish the function body to be implemented for the service interface corresponding to the data identifier;
[0027] Correspondingly, the function body to be implemented for the service interface corresponding to the routine identifier includes:
[0028] Get the second template;
[0029] Fill the configuration data items corresponding to each routine identifier into the corresponding positions in the second template;
[0030] Based on the configuration data items corresponding to each routine identifier in the second template, establish the function body to be implemented for the service interface corresponding to the routine identifier.
[0031] Preferably, obtaining the function body to be implemented corresponding to the service interface through the second script includes:
[0032] The service name corresponding to the service interface is obtained through the second script;
[0033] The interface type is determined based on the service name and the configuration information;
[0034] Obtain the function body to be implemented for the function corresponding to the service interface based on the interface type.
[0035] Preferably, determining the interface type based on the service name and the configuration information includes:
[0036] If the service name is detected to be the service name corresponding to the data identifier, the interface type pre-defined in the configuration information is obtained according to the service name;
[0037] If the service name is detected as the service name corresponding to the process identifier, the length of the current input data and the length of the current output data are obtained from the configuration information according to the service name; the required interface type is determined according to the pre-established correspondence table between the length of the input data, the length of the output data and the interface type.
[0038] To address the aforementioned technical problems, the present invention also provides a service interface processing apparatus, comprising:
[0039] The first acquisition module is used to acquire configuration information pre-stored in the diagnostic communication configuration table through a first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information;
[0040] The conversion and compilation module is used to convert the configuration information into an arxml file and open the arxml file to compile and generate the service interface;
[0041] The second acquisition module is used to acquire the function body to be implemented corresponding to the service interface through the second script, so as to implement the function corresponding to the service interface using the function body to be implemented.
[0042] The service interface processing method provided by this invention includes: obtaining data identifier configuration information and routine identifier configuration information pre-stored in a diagnostic communication configuration table through a first script; converting the configuration information into an arxml file and opening the arxml file to compile and generate a service interface; obtaining the function body to be implemented corresponding to the service interface through a second script, and using the function body to implement the function corresponding to the service interface. In this method, the first script directly reads the configuration information to complete the service interface configuration, eliminating the need for diagnostic software development engineers to spend a significant amount of time writing software code to configure the information; the second script directly calls the function body to be implemented corresponding to the service interface, automatically updating the service interface, reducing human interference and greatly improving the reliability and efficiency of service interface configuration and function implementation; when the function corresponding to the service interface needs to be implemented, there is no need to focus too much on the service interface itself, only the corresponding function body to be implemented needs to be modified, making the creation of the diagnostic communication interface more reliable, convenient, and efficient, thereby ensuring the accuracy and reliability of domain controller diagnosis, while also significantly reducing the workload of service interface configuration and function implementation. Attached Figure Description
[0043] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 A flowchart illustrating a service interface processing method provided in an embodiment of the present invention;
[0045] Figure 2 A structural diagram of a service interface processing apparatus provided according to an embodiment of the present invention;
[0046] Figure 3 A flowchart illustrating a method for generating code for a diagnostic management module, as provided in an embodiment of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0048] The core of this invention is to provide a service interface processing method and apparatus to solve the technical problems of low reliability and low efficiency in diagnosing communication interface creation.
[0049] In the DCM module, configuring and implementing the DID and RID service interfaces is a crucial and demanding task. Since each project contains hundreds of DIDs and RIDs with varying configurations, and some require adjustments based on customer needs, diagnostic software engineers must dedicate significant time to writing code, which is prone to errors and oversights, making management and maintenance difficult. Therefore, this embodiment of the invention automatically generates service and functional interfaces via scripts. When adding or modifying diagnostic communication interfaces, software engineers no longer need to manually write code; they only need to click on the script execution file. This makes the creation of diagnostic communication interfaces more reliable, convenient, and efficient, thereby ensuring the accuracy and reliability of domain controller diagnostics and significantly reducing the workload.
[0050] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 A flowchart illustrating a service interface processing method provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes:
[0051] S10: Obtain the configuration information pre-stored in the diagnostic communication configuration table through the first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information;
[0052] S11: Convert the configuration information into an arxml file and open the arxml file to compile and generate the service interface;
[0053] S12: Obtain the function body to be implemented corresponding to the service interface through the second script, and use the function body to implement the function corresponding to the service interface.
[0054] In the DCM module, configuring and implementing the DID and RID service interfaces is a crucial and demanding task. Therefore, this embodiment of the invention configures both DID and RID, including DID and RID configuration information. In related configuration methods, manual configuration step-by-step using DaVinci Resolve software leads to low reliability and efficiency. Therefore, this embodiment establishes a first script, such as a Python script, to retrieve configuration information pre-stored in the diagnostic communication configuration table. The method for establishing the diagnostic communication configuration table is not limited, as long as it contains configuration information.
[0055] Write a Python script to obtain information from the diagnostic communication configuration table, and write the DID and RID configuration information into the arxml file of DaVinci. When you open the project with the DaVinci configuration tool, you can see the specific DID and RID configuration changes. The service interface dia.c can be generated by executing the DaVinci compilation operation.
[0056] To enable a service interface to perform its corresponding functions, it is necessary to call an Application Programming Interface (API) to execute the function, i.e., the function body to be implemented. To obtain the function body corresponding to the service interface, this embodiment of the invention uses a second script, such as a Python script, to retrieve it. It should be noted that while the second script can directly obtain the function body, since the function body is usually complex, in practice, to simplify the code architecture, the second script can be used to obtain the name of the function to be implemented, and then the service interface and the function body can be connected using that name. After obtaining the function body, the functionality corresponding to the service interface can be implemented using it. When implementing the functionality of a service interface, there is no need to focus too much on the service interface itself; the diagnostic communication software engineer only needs to develop within the function body. Additionally, it should be noted that, for example, in order to detect vehicle speed, the function body for the vehicle speed needs to be combined with the configuration information table to find the corresponding byte length of the vehicle speed, such as two bytes, so that the output vehicle speed is two bytes.
[0057] The service interface processing method provided in this embodiment of the invention includes: obtaining data identifier configuration information and routine identifier configuration information pre-stored in a diagnostic communication configuration table through a first script; converting the configuration information into an arxml file and opening the arxml file to compile and generate a service interface; obtaining the function body to be implemented corresponding to the service interface through a second script; and using the function body to be implemented to control the service interface to implement the corresponding function. In this method, the first script directly reads the configuration information to complete the service interface configuration, eliminating the need for diagnostic software development engineers to spend a significant amount of time writing software code to configure the information; the second script directly calls the function body to be implemented corresponding to the service interface, automatically updating the service interface, reducing human interference and greatly improving the reliability and efficiency of service interface configuration and function implementation; when the function corresponding to the service interface needs to be implemented, there is no need to focus too much on the service interface itself, only the corresponding function body to be implemented needs to be modified, making the creation of the diagnostic communication interface more reliable, convenient, and efficient, thereby ensuring the accuracy and reliability of domain controller diagnosis, while also greatly reducing the workload of service interface configuration and function implementation.
[0058] In practice, to establish a diagnostic communication configuration information table, a preferred implementation method includes establishing the diagnostic communication configuration information table as follows:
[0059] Retrieve the user-created diagnostic communication configuration table template;
[0060] Based on the user's diagnostic questionnaire and diagnostic specifications, the configuration information is written into the corresponding position in the diagnostic communication configuration table template to establish a diagnostic communication configuration information table.
[0061] Meanwhile, considering that some data can only be modified by the supplier and not by the customer, such as production serial numbers and manufacturing numbers, while some data can be modified by the customer, such as the software version, the diagnostic communication configuration table template set in this embodiment of the invention includes a supplier (internal) configuration table template and a customer configuration table template. Specifically, the diagnostic communication configuration table template includes: a first data identifier configuration table template, a second data identifier configuration table template, a first routine identifier configuration table template, and a second routine identifier configuration table template. It should be noted that the first data identifier configuration table template and the second data identifier configuration table template are respectively configured for the supplier (internal) and the customer (external); similarly, the first routine identifier configuration table template and the second routine identifier configuration table template are respectively configured for the supplier (internal) and the customer (external).
[0062] Create a diagnostic communication configuration table template, which can be divided into internal DID sub-tables, customer DID sub-tables, internal RID sub-tables, and customer RID sub-tables. The configuration information for the sub-tables is shown below:
[0063] The DID sub-table contains the following columns: Serial Number, English Name, DID Number, Length, Storage Type, Mapping Relationship, Whether Read is Supported, Read Security Level, Read Supported Sessions, Read Interface Type, Whether Write is Supported, Write Security Level, Write Supported Sessions, Write Interface Type, Data Type, Default Value, and Remarks.
[0064] The RID sub-table contains the following columns: Serial Number, English Name, RID Number, Security Level, Supported Sessions, Input Data Length for Start Routine, Output Data Length for Start Routine, Input Data Length for Stop Routine, Output Data Length for Stop Routine, Input Data Length for Requested Result, Output Data Length for Requested Result, and Remarks.
[0065] After creating the diagnostic communication configuration table template, fill in the DID and RID related configuration information into the corresponding positions in the diagnostic communication configuration table template according to the customer's diagnostic questionnaire and specifications.
[0066] In the method provided in this embodiment, the established diagnostic communication configuration information table distinguishes between internal DID sub-tables, customer DID sub-tables, internal RID sub-tables, and customer RID sub-tables. Compared with methods that do not distinguish between internal diagnostic communication configuration information tables, customer diagnostic communication configuration information tables, DID configuration information tables, and RID configuration information tables, the method provided in this embodiment makes the diagnostic communication configuration information table clearer and facilitates its subsequent use.
[0067] The above embodiments establish a diagnostic communication configuration information table. To facilitate the retrieval of configuration information from the diagnostic communication configuration information table, a preferred implementation method includes, after writing the configuration information into the corresponding position in the diagnostic communication configuration table template according to the user's diagnostic questionnaire and diagnostic specifications, and before retrieving the configuration information pre-stored in the diagnostic communication configuration table through the first script, the following steps are also included:
[0068] The diagnostic communication configuration information table is traversed using the first script;
[0069] Based on the number of each data identifier and the number of each routine identifier, obtain the configuration data item corresponding to each data identifier and the configuration data item corresponding to each routine identifier;
[0070] The configuration data items corresponding to each data identifier are sorted according to their numbers, and the same sorting process is performed on the configuration data items corresponding to each routine identifier according to their numbers.
[0071] It should be noted that the sorting process here can be either ascending or descending order; there is no limitation on this.
[0072] To improve the readability, cleanliness, and clear functional partitioning of the code architecture, DIDs are categorized according to storage type and stored in different type items during implementation. DIDs are categorized by storage type into Random Access Memory (RAM), Application Bootloader Calibration Memory (ABCM), Non-volatile Memory (NvM), and Read Only Memory (ROM), and the grouped DIDs are sorted according to their DID numbers. Specifically, before sorting the configuration data items corresponding to each data identifier according to their numbers, the following steps are also included:
[0073] The configuration data items corresponding to each data identifier are classified according to the storage type of the data identifier;
[0074] Based on the classification results, the configuration data items corresponding to each data identifier are stored in the corresponding type items;
[0075] Correspondingly, the sorting process for the configuration data items corresponding to each data identifier based on their identifier numbers includes:
[0076] Within each type of item, the configuration data items corresponding to each data identifier are sorted according to their respective identifier numbers.
[0077] In the method provided in this embodiment, a Python script is written to traverse the DID list and RID list of the diagnostic communication configuration table, read the configuration data, and form a configuration data item for each DID and each RID. In addition, the DIDs are classified according to their storage type and stored in different type items. The grouped DIDs are sorted according to their DID numbers. Only the RIDs need to be sorted, which improves the readability, cleanliness and functional partitioning of the code.
[0078] In implementation, DID service interfaces can be broadly categorized into two main types: read and write. Table 1 shows the classification of DID service interfaces, which can be further subdivided according to actual needs:
[0079] Table 1 Classification of DID Service Interfaces
[0080] Write DID RAM write ABCM NvM under electrical writing NvM Write Now /
[0081] In practice, since RAM does not retain data when power is off, real-time vehicle speed can be directly retrieved from RAM without needing to retain it after power loss. Because NVM retains data even when power is off, if it's necessary to obtain the number of times an abnormal temperature is detected in the Electronic Control Unit (ECU), this data needs to be stored in NVM and retained even after power loss. Since ROM can store fixed data, software version numbers can be stored in the ROM's service interface type. Data involving applications (APP) and Boot that require reading or writing and whose data changes are stored in the ABCM type, such as records of the cumulative number of ECU refreshes and fingerprint information updates during refreshes, is stored in the ABCM type.
[0082] RID service interfaces are broadly categorized into three main types: start, end, and request result. Table 2 shows the classification of RID service interfaces, further subdivided as follows:
[0083] Table 2 Classification of RID Service Interfaces
[0084]
[0085] In the embodiments described above, the dia.c service interface was not differentiated according to storage type and routine control method. The code architecture appears unclear and easily confused. To improve readability, cleanliness, and clear functional differentiation, DID and RID need to be categorized. Specifically, the function bodies to be implemented include the function bodies to be implemented corresponding to the service interfaces of data identifiers and the function bodies to be implemented corresponding to the service interfaces of routine identifiers.
[0086] The function body to be implemented for the service interface that establishes data identifiers includes:
[0087] Retrieve the first template of the storage partition according to the data identifier function;
[0088] Fill the configuration data items corresponding to each categorized data identifier into the corresponding positions in the first template;
[0089] Based on the configuration data items corresponding to each data identifier in the first template, establish the function body to be implemented for the service interface corresponding to the data identifier;
[0090] Correspondingly, the function body to be implemented for the service interface that establishes the routine identifier includes:
[0091] Get the second template;
[0092] Fill the configuration data items corresponding to each routine identifier into the corresponding positions in the second template;
[0093] Based on the configuration data items corresponding to each routine identifier in the second template, establish the function body to be implemented for the service interface corresponding to the routine identifier.
[0094] For DIDs, a .cpp.h template (the first template) for `ReadWriteDidCfg` is written, which stores data according to DID functionality. A script is then written to read the `ReadWriteDidCfg` template, fill the categorized DID data into the corresponding positions, and distinguish between internal and client DIDs, such as macro definitions, storage mappings, and structure arrays. This generates the corresponding .cpp.h file and the function bodies for the functions to be implemented. Diagnostic communication software engineers then develop the software within these function bodies.
[0095] For RID, a .cpp.h template for RoutineControlCfg is written, which is the second template. The RoutineControlCfg template is read, and the RID data information is filled into the second template. RID does not require storage type classification, but for a clear architecture and high readability, the RID's .cpp.h class file and the function bodies to be implemented can be created using inheritance. The class is then instantiated, and finally, it is called using a peptide approach. The above process can be implemented by writing a Python script.
[0096] In the method provided in this embodiment, the DID and RID are classified and processed to make the code architecture clearer and less prone to confusion.
[0097] Based on Tables 1 and 2 above, given the large number of DID interface types (9 types) and RID interface types (18 types), the total number of read, write, and mileage control service interfaces reaches several hundred. Manually implementing each service interface call would be tedious, error-prone, and difficult to troubleshoot, and would also hinder subsequent maintenance. Therefore, in practice, the preferred implementation method is to obtain the function bodies corresponding to the service interfaces through a second script, including:
[0098] The service name corresponding to the service interface is obtained through the second script;
[0099] Determine the interface type based on the service name and configuration information;
[0100] Retrieve the function body to be implemented for the service interface corresponding to the interface type.
[0101] Specifically, determining the interface type based on the service name and configuration information includes:
[0102] If the service name is detected to be the same as the service name corresponding to the data identifier, the interface type pre-defined in the configuration information is obtained based on the service name;
[0103] If the service name is detected as the service name corresponding to the program identifier, the length of the current input data and the length of the current output data are obtained from the configuration information based on the service name; the required interface type is determined based on the pre-established correspondence table between the length of the input data, the length of the output data and the interface type.
[0104] For the corresponding RID, if the length of the current input data and the length of the current output data are both equal to 0, the interface type corresponding to the RID is determined to be RoutineControl_Start_NoInput_NoOutput, which means there is no data input and no data output.
[0105] The script first reads the DID and RID service names from the dia.c file using a Python script. It then distinguishes between services based on the DID number, Read, and Write attributes. Next, it queries the DID diagnostic configuration sub-table to call the interface type specified in the configuration table. Similarly, for RID services, it searches for the RID number, Start, Stop, and RequestResult to distinguish between them. It then queries the RID diagnostic configuration sub-table to call the interface type specified in the configuration table. Finally, it replaces the default state of the service interface (return RTE_E_OK;) and calls the service interface functions differentiated by function. The script automatically updates the dia.c module.
[0106] Through the above operations, all the functionally distinct service interfaces and functional interfaces of DID and RID have been completed. Diagnostic communication software engineers do not need to pay too much attention to the service interface issues, but only need to develop specific functions in the function bodies with clear architecture to be implemented.
[0107] In the method provided in this embodiment, the name of the function to be implemented corresponding to the service interface is obtained through the second script, and the service interface and the function body to be implemented are connected through the function name to be implemented. Compared with the method of directly obtaining the function body to be implemented corresponding to the service interface, a more readable code architecture can be obtained.
[0108] In the above embodiments, the processing method of the service interface has been described in detail. The present invention also provides embodiments of the processing device for the service interface.
[0109] Figure 2 This is a structural diagram of a service interface processing apparatus provided according to an embodiment of the present invention. This embodiment, based on functional modules, includes:
[0110] The first acquisition module 10 is used to acquire configuration information pre-stored in the diagnostic communication configuration table through a first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information;
[0111] The conversion and compilation module 11 is used to convert configuration information into an arxml file and open the arxml file to compile and generate service interfaces;
[0112] The second acquisition module 12 is used to acquire the function body to be implemented corresponding to the service interface through the second script, so as to implement the function corresponding to the service interface using the function body to be implemented.
[0113] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, and will not be repeated here. Furthermore, it has the same beneficial effects as the service interface processing method mentioned above. To enable those skilled in the art to better understand the present invention, the following description is in conjunction with the appendix. Figure 3 The present invention will be further described in detail below with reference to specific embodiments. Figure 3 A flowchart illustrating a method for generating code for a diagnostic management module provided in an embodiment of the present invention is shown below. Figure 3 As shown, the method includes:
[0114] S13: Create a diagnostic communication configuration table template (DID sub-table, RID sub-table);
[0115] S14: Fill in the DID and RID configurations into the template table according to customer requirements;
[0116] S15: Write the first script to traverse the diagnostic connectivity configuration table and generate DID and RID configuration information items;
[0117] S16: The configuration information items of DID are classified according to the DID storage method, and then sorted in ascending order according to the DID number (RID only needs to be sorted in ascending order).
[0118] S17: Using the first script, convert the completed diagnostic communication configuration form into a da Vinci arxml file;
[0119] S18: Generate the service interface dia.c through compilation using the DaVinci configuration tool;
[0120] S19: Write a second script to replace the default state call in dia.c with the type service interface.
[0121] The process of generating the function bodies to be implemented for the corresponding functionalities of the typed service interfaces is as follows:
[0122] The creation process of the function body to be implemented for the DID functionality is as follows:
[0123] S20: Design the .cpp.h template for DID;
[0124] S21: The second script reads the ReadWriteDidCfg template, fills in the DID data information according to the storage type, and creates a function body for the function to be implemented; the diagnostic communication software engineer develops the function body for the function to be implemented.
[0125] The process of creating the function body to form the RID functionality is as follows:
[0126] S22: Design the .cpp.h template for RID;
[0127] S23: The second script reads the RoutineControlCfg template, fills in the RID data information, and creates class files and function bodies for each RID in an inheritance manner; the diagnostic communication software engineer develops in the function bodies for the functions to be implemented.
[0128] The solution for automatically generating diagnostic communication service and function interface code provided in this embodiment of the invention eliminates the need for software engineers to manually write code when it is necessary to add or modify the diagnostic communication interface. Instead, the software engineers can simply click on the script execution file. This makes the creation of the diagnostic communication interface more reliable, convenient, and efficient, thereby ensuring the accuracy and reliability of the domain controller diagnosis and greatly reducing the workload.
[0129] The above provides a detailed description of a service interface processing method and apparatus provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0130] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for processing a service interface, characterized in that, include: The configuration information is obtained from the diagnostic communication configuration table by the first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information. The configuration information is converted into an arxml file, and the arxml file is opened to compile and generate the service interface; The second script obtains the function body to be implemented corresponding to the service interface, and uses the function body to implement the function corresponding to the service interface. The function body to be implemented includes the function body to be implemented corresponding to the service interface of the data identifier and the function body to be implemented corresponding to the service interface of the routine identifier. The function body to be implemented for establishing the service interface corresponding to the data identifier includes: Retrieve the first template of the storage partition according to the data identifier function; Fill the configuration data items corresponding to each categorized data identifier into the corresponding positions in the first template; Based on the configuration data items corresponding to each data identifier in the first template, establish the function body to be implemented for the service interface corresponding to the data identifier; Correspondingly, the function body to be implemented for the service interface corresponding to the routine identifier includes: Get the second template; Fill the configuration data items corresponding to each routine identifier into the corresponding positions in the second template; Based on the configuration data items corresponding to each routine identifier in the second template, establish the function body to be implemented for the service interface corresponding to the routine identifier; The step of obtaining the function body to be implemented corresponding to the service interface through the second script includes: The service name corresponding to the service interface is obtained through the second script; The interface type is determined based on the service name and the configuration information; Obtain the function body to be implemented for the function corresponding to the service interface based on the interface type.
2. The service interface processing method according to claim 1, characterized in that, Establishing the diagnostic communication configuration table includes: Retrieve the user-created diagnostic communication configuration table template; The configuration information is written into the corresponding position in the diagnostic communication configuration table template according to the user's diagnostic questionnaire and diagnostic specifications to establish the diagnostic communication configuration table.
3. The service interface processing method according to claim 2, characterized in that, The diagnostic communication configuration table template includes: a first data identifier configuration table template, a second data identifier configuration table template, a first routine identifier configuration table template, and a second routine identifier configuration table template.
4. The service interface processing method according to claim 3, characterized in that, After writing the configuration information into the corresponding position in the diagnostic communication configuration table template according to the user's diagnostic questionnaire and diagnostic specifications, and before obtaining the configuration information pre-stored in the diagnostic communication configuration table through the first script, the method further includes: The diagnostic communication configuration table is traversed using the first script; Based on the number of each data identifier and the number of each routine identifier, obtain the configuration data item corresponding to each data identifier and the configuration data item corresponding to each routine identifier; The configuration data items corresponding to each data identifier are sorted according to their respective data identifier numbers, and the configuration data items corresponding to each routine identifier are sorted in the same way according to their respective routine identifier numbers.
5. The service interface processing method according to claim 4, characterized in that, Before sorting the configuration data items corresponding to each data identifier according to their numbers, the method further includes: The configuration data items corresponding to each data identifier are classified according to the storage type of the data identifier; Based on the classification results, the configuration data items corresponding to each data identifier are stored in the corresponding type items; Correspondingly, the sorting process for the configuration data items corresponding to each data identifier based on their numbers includes: In each of the aforementioned type items, the configuration data items corresponding to each data identifier are sorted according to the number of each data identifier.
6. The method for processing a service interface according to any one of claims 1 to 5, characterized in that, Determining the interface type based on the service name and the configuration information includes: If the service name is detected to be the service name corresponding to the data identifier, the interface type pre-defined in the configuration information is obtained according to the service name; If the service name is detected as the service name corresponding to the process identifier, the length of the current input data and the length of the current output data are obtained from the configuration information according to the service name; the required interface type is determined according to the pre-established correspondence table between the length of the input data, the length of the output data and the interface type.
7. A service interface processing apparatus, characterized in that, include: The first acquisition module is used to acquire configuration information pre-stored in the diagnostic communication configuration table through a first script; wherein, the configuration information includes data identifier configuration information and routine identifier configuration information; The conversion and compilation module is used to convert the configuration information into an arxml file and open the arxml file to compile and generate the service interface; The second acquisition module is used to acquire the function body to be implemented corresponding to the service interface through the second script, so as to implement the function corresponding to the service interface using the function body to be implemented. The function body to be implemented includes the function body to be implemented corresponding to the service interface of the data identifier and the function body to be implemented corresponding to the service interface of the routine identifier. The function body to be implemented for establishing the service interface corresponding to the data identifier includes: Retrieve the first template of the storage partition according to the data identifier function; Fill the configuration data items corresponding to each categorized data identifier into the corresponding positions in the first template; Based on the configuration data items corresponding to each data identifier in the first template, establish the function body to be implemented for the service interface corresponding to the data identifier; Correspondingly, the function body to be implemented for the service interface corresponding to the routine identifier includes: Get the second template; Fill the configuration data items corresponding to each routine identifier into the corresponding positions in the second template; Based on the configuration data items corresponding to each routine identifier in the second template, establish the function body to be implemented for the service interface corresponding to the routine identifier; The second acquisition module is specifically used for: The service name corresponding to the service interface is obtained through the second script; The interface type is determined based on the service name and the configuration information; Obtain the function body to be implemented for the function corresponding to the service interface based on the interface type.
Citation Information
Patent Citations
Software integration method and device and server
CN115373695A
Fault diagnosis DID read-write service processing method and device
CN116521143A