Configuration table-based diagnostic mode implementation method, storage medium, and computer program

By adopting a configuration table-based diagnostic mode in automotive diagnostics, the problem of DID modification needs to be compiled is solved, flexible management and efficient maintenance are achieved, development efficiency and system stability are improved, and DID functions are modified in the unchanged compilation environment. .

CN114416529BActive Publication Date: 2024-11-05HUIZHOU DESAY SV AUTOMOTIVE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111573831.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-21
Publication Date
2024-11-05
Estimated Expiration
2041-12-21

AI Technical Summary

Technical Problem

In automotive diagnostics, when adding or modifying DID, the source file needs to be modified and recompiled, resulting in difficulty in maintaining new functions.

Method used

Using the diagnostic mode based on configuration tables, DID query and write by presetting four configuration tables (diagnostic DID table, diagnostic SubDID table, SubDID configuration mapping table and system configuration table) is realized to realize data type conversion and configuration item management , avoid direct modification of programming methods.

Benefits of technology

It realizes flexible data management and maintenance, improves development efficiency and system stability, allows the DID function to be modified while the compilation environment remains unchanged, and only needs to change the configuration table, which enhances the reusability and inheritance of the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416529B_ABST
    Figure CN114416529B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for implementing a diagnostic mode based on a configuration table, a storage medium and a computer program, the method comprising: presetting 4 configuration tables; DID query: traversing the subdid list of the configuration table, reading configuration data, completing data type conversion and DID result assembly; DID write: traversing the subdid list of the configuration table, locating configuration items, and modifying configuration data; configuration item query: calling the configuration interface, passing module and item parameters, reading configuration data; configuration item write: calling the configuration interface, passing module and item parameters, locating configuration items and modifying configuration data. The present invention has great inheritance and can be reused on different series of projects of the same product through the 4 configuration tables set up, thereby improving development efficiency. At the same time, the configuration table data is loaded into the memory when the process is initialized, and the execution efficiency is high. When the compilation environment remains unchanged, the DID function changes without changing the code, and only the 4 configuration tables need to be changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automobile diagnosis, and in particular to a configuration table-based diagnosis mode implementation method, storage medium and computer program. Background Art

[0002] In car diagnosis, basic data exists in the form of DID. DID (Data Identifier) ​​is the diagnostic item. The data information related to DID can be read and written through the standard UDS (Unified Diagnostic Services) diagnostic protocol $22 and $2E services. Each DID contains one or more SubDIDs. SubDID is the smallest data unit and represents a calibration item.

[0003] Traditional application development defines DID as a data object or other data structure through programming, implements data operation interface through coding, and implements inter-process communication through shared memory. When adding or modifying DID, the source file needs to be modified and recompiled, and the maintenance of new functions is difficult. However, DID data has many common characteristics and has not been extracted for unified processing. Summary of the invention

[0004] The present invention is to overcome the problem in the above-mentioned prior art that when adding or modifying DID during automobile diagnosis, the source file needs to be modified and recompiled, and the maintenance of the new functions is difficult. A diagnostic mode implementation method based on a configuration table, a storage medium and a computer program are provided.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A method for implementing a diagnostic mode based on a configuration table comprises the following steps:

[0007] Four preset configuration tables: diagnostic DID table, diagnostic SubDID table, SubDID configuration mapping table and system configuration table;

[0008] DID query: traverse the subdid list of the configuration table, read the configuration data, complete data type conversion and DID result assembly;

[0009] DID write: traverse the subdid list of the configuration table, locate the configuration item, and modify the configuration data;

[0010] Configuration item query: call the configuration interface, pass module and item parameters, and read the configuration data;

[0011] Configuration item writing: call the configuration interface, pass module and item parameters, locate the configuration item and modify the configuration data.

[0012] Furthermore, as a preferred technical solution, it also includes:

[0013] Configuration item subscription: The application mode subscribes to the configuration item, the diagnostic module modifies the configuration data, the diagnostic module publishes data change notifications to the application mode, and the application module executes related logic processing after receiving the data change notification.

[0014] Furthermore, as a preferred technical solution, the diagnostic DID table is used to define all DIDs supported by the system and store the DID name, ID, byte length and MCU synchronization flag corresponding to each DID.

[0015] Further, as a preferred technical solution, the diagnostic SubDID table is used to define all subdid sub-items contained in each DID, and store the subdid name, bit length, starting byte, starting bit, data type, and attribute type corresponding to each DID.

[0016] Further, as a preferred technical solution, the SubDID configuration mapping table is used to store the mapping relationship between subdid and systemConfig, and the module and item names associated with subdid are queried through the SubDID configuration mapping table.

[0017] Furthermore, as a preferred technical solution, the system configuration table is used to store all configuration items, and each configuration item includes: module, item, value, readlist, writelist and updateFlag flags.

[0018] Furthermore, as a preferred technical solution, DID query specifically includes:

[0019] When reading a DID, first query the diagnostic DID table to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table.

[0020] Traverse the subdid list and query the module and item names by subdid number;

[0021] Query the system configuration table, read the configuration data through module and item, and complete data type conversion and DID result assembly;

[0022] After all subdid lists are queried successfully, the DID result is returned.

[0023] Furthermore, as a preferred technical solution, DID writing specifically includes:

[0024] When writing a DID, first query the diagnostic DID table to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table.

[0025] Traverse the subdid list and query the module and item names by subdid number;

[0026] Query the system configuration table, locate configuration items through module and item, and modify configuration data;

[0027] After all subdid lists are set successfully, the operation results are returned.

[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a method for implementing a diagnostic mode based on a configuration table.

[0029] A computer program, when executed by a main control device, is used to implement the steps of a method for implementing a diagnostic mode based on a configuration table.

[0030] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0031] 1. The data of the present invention is managed by configuration, which is flexible, easy to expand and maintain.

[0032] 2. The four configuration tables of the present invention only require minor changes in different series of projects of the same product, and thus have great inheritance and can be reused, thereby improving development efficiency.

[0033] 3. The present invention loads the configuration table data into the memory when the process is initialized, and the execution efficiency is high.

[0034] 4. The data of the present invention is centrally developed and managed, which improves development efficiency and system stability.

[0035] 5. In the present invention, when the compilation environment remains unchanged, the DID function changes without changing the code, and only 4 configuration tables need to be changed. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a schematic diagram of the method flow of Example 1 of the present invention.

[0037] Figure 2 This is a schematic diagram of the DID query process in Example 1 of the present invention.

[0038] Figure 3 This is a schematic diagram of modifying the DID process according to Embodiment 1 of the present invention.

[0039] Figure 4Schematic diagram of configuration item query process in embodiment 1 of the present invention

[0040] Figure 5 Schematic diagram of the configuration item modification process in embodiment 1 of the present invention

[0041] Figure 6 Schematic diagram of the subscription configuration item flow in embodiment 1 of the present invention

[0042] The drawings are only used for illustrative purposes and should not be construed as limitations on this patent. In order to better illustrate this embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted. The same or similar numbers correspond to the same or similar parts. The terms describing the positional relationship in the drawings are only used for illustrative purposes and should not be construed as limitations on this patent. DETAILED DESCRIPTION

[0043] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer definition of the protection scope of the present invention.

[0044] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limitations on this patent.

[0045] In addition, if there are terms such as "first" and "second", they are only used for descriptive purposes, mainly to distinguish different devices, elements or components (the specific types and structures may be the same or different), and are not used to indicate or imply the relative importance and quantity of the indicated devices, elements or components, and cannot be understood as indicating or implying relative importance.

[0046] Example 1

[0047] This embodiment discloses a method for implementing a diagnostic mode based on a configuration table, such as Figure 1 As shown: the following steps are included:

[0048] S10. Four configuration tables are preset: a diagnostic DID table, a diagnostic SubDID table, a SubDID configuration mapping table, and a system configuration table.

[0049] In this embodiment, the diagnosis mode is based on four configuration tables, which are also four database tables, including: a diagnosis DID table, namely t_DID table, a diagnosis SubDID table, namely t_SubDID table, a SubDID configuration mapping table, namely t_SubDID_Config_Relation and a system configuration table, namely systemConfig table.

[0050] In this embodiment, the diagnostic DID table (t_DID table) is used to define all DIDs supported by the system. The t_DID table stores the DID name, ID, byte length, and MCU synchronization flag corresponding to each DID.

[0051] Among them, the byte length indicates that the did data length may be 1 byte or multiple bytes; the mcu synchronization flag indicates that if the synchronization flag is 1, the soc will synchronize this data to the mcu after it starts.

[0052] The diagnostic SubDID table (t_SubDID table) is used to define all subdid items contained in each DID, and each DID consists of one or more subdids. The t_SubDID table stores the subdid name, bit length, starting byte, starting bit, data type, and attribute type corresponding to each DID.

[0053] Among them, the bit length indicates the subdid data length, including 1 bit or multiple bits; the data type includes HEX, ASCII, BOOL, INT, BCD and other data types. Type conversion will be performed when reading and writing data from the configuration table; the attribute type indicates that the attribute definition in the configuration table is config type.

[0054] The SubDID configuration mapping table (t_SubDID_Config_Relation) is used to establish a mapping relationship between each subdid and a configuration item (systemConfig), and the name of the relevant configuration item can be queried through the subdid number. That is, t_SubDID_Config_Relation stores the mapping relationship between subdid and systemConfig, and the module and item names associated with the subdid are queried through the SubDID configuration mapping table.

[0055] The system configuration table (systemConfig table) is used to define all configuration data of the system. The configuration data can be read and written through the configuration item name. That is, the systemConfig table stores all configuration items, and each configuration item contains: module, item, value, readlist, writelist and updateFlag flags.

[0056] Among them, module indicates the functional module type of the configuration item; item indicates the name of the configuration item. Module and item uniquely identify a configuration item. The application module reads and writes the configuration item through module and item; value is used to store did data; readlist is used to define the read permission module list. When reading the configuration item, only the modules in the read permission module list can read the data normally; writelist is used to define the write permission module list. When writing the configuration item, only the modules in the write permission module list can write the data normally; the updateFlag flag indicates that when the system starts, the diagnostic module decides whether to update the configuration item according to the updateFlag flag to realize the upgrade of the configuration table.

[0057] S20.DID query: traverse the subdid list of the configuration table, read the configuration data, complete the data type conversion and DID result assembly.

[0058] For this step, see Figure 2 , including:

[0059] S201. When querying or reading DID, first query the diagnostic DID table (t_DID) to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table (t_SubDID table) according to the did number.

[0060] S202. Traverse the subdid list and query the module and item names by subdid number;

[0061] S203. Query the system configuration table (systemConfig table), read the configuration data through module and item, and complete the data type conversion and DID result assembly.

[0062] S204. When all subdid lists are queried successfully, the DID result is returned.

[0063] S30.DID write: traverse the subdid list of the configuration table, locate the configuration item, and modify the configuration data.

[0064] For this step, see Figure 3 , including:

[0065] S301. When writing DID, first query the diagnostic DID table (t_DID table) to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table (t_SubDID table) according to the did number.

[0066] S302. Traverse the subdid list and query the module and item names by subdid number.

[0067] S303. Query the system configuration table (systemConfig table), locate the configuration item through module and item, and modify the configuration data.

[0068] S304. When all subdid lists are set successfully, the operation result is returned.

[0069] S40. Configuration item query: call the configuration interface, pass module and item parameters, and read the configuration data.

[0070] For this step, see Figure 4 In this step, since module and item uniquely identify a configuration item, in actual development, when querying configuration items, the application process calls the configuration interface and passes the module and item parameters to quickly and efficiently read the configuration data. That is, the application process calls the configuration interface and passes the module and item parameters, and the configuration management module returns the value according to the module and item.

[0071] S50. Configuration item writing: call the configuration interface, pass module and item parameters, locate the configuration item and modify the configuration data.

[0072] For this step, see Figure 5 In this step, since module and item uniquely identify a configuration item, in actual development, when a configuration item is written, the application process calls the configuration interface and passes the module and item parameters, that is, locates the configuration item and modifies its data. That is, the application process calls the configuration interface and passes the module and item parameters, and the configuration management module modifies the configuration data according to the module and item.

[0073] S60. Configuration item subscription: The application mode subscribes to the configuration item, the diagnosis module modifies the configuration data, the diagnosis module publishes the data change notification to the application mode, and the application module executes the related logic processing after receiving the data change notification.

[0074] For this step, see Figure 6 ,In automobile diagnosis, the diagnostic process is responsible for the management and maintenance of DID data, and other ,application modules can subscribe to the configuration items of their interest. Therefore, ,when the configuration data changes, the diagnostic module will issue a notification, and ,the application module will perform the relevant logic processing after receiving the notification.

[0075] The data of this embodiment is managed by configuration, which is flexible, easy to expand and maintain. The four configuration tables of this embodiment only require a small number of changes in different series of projects of the same product, and have great inheritance, so they can be reused, which improves development efficiency. At the same time, in this embodiment, when the compilation environment remains unchanged, the DID function changes without changing the code, and only the four configuration tables need to be changed.

[0076] Example 2

[0077] Based on the same concept, this embodiment also provides a computer-readable storage medium, which stores a computer program. The computer program includes at least one code segment, which can be executed by a main control device to control the main control device to implement the steps of the method for implementing the configuration table-based diagnostic mode for automobile diagnosis as described in the above-mentioned embodiment 1.

[0078] Examples include:

[0079] The four configuration tables described in the preset embodiment 1 are: a diagnostic DID table, namely, a t_DID table, a diagnostic SubDID table, namely, a t_SubDID table, a SubDID configuration mapping table, namely, a t_SubDID_Config_Relation, and a system configuration table, namely, a systemConfig table.

[0080] Query DID: traverse the subdid list of the configuration table, read the configuration data, complete the data type conversion and DID result assembly. For the specific query process of DID, please refer to Example 1.

[0081] Write DID, or modify DID: traverse the subdid list of the configuration table, locate the configuration item, and modify the configuration data. For the specific process of writing or modifying DID, see Example 1.

[0082] Query configuration items: call the configuration interface, pass module and item parameters, and read configuration data. For the specific query process of configuration items, see Example 1.

[0083] Write or modify configuration items: call the configuration interface, pass module and item parameters, locate the configuration item and modify the configuration data. For the specific writing or modifying process of the configuration item, see Example 1.

[0084] Subscription configuration item: The application mode subscribes to the configuration item, the diagnosis module modifies the configuration data, the diagnosis module publishes a data change notification to the application mode, and the application module executes the relevant logic processing after receiving the data change notification. For the specific implementation process of the application mode subscription configuration item, see Example 1.

[0085] Example 3

[0086] The embodiment of the present invention further provides a computer program, which, when executed by a main control device, is used to implement the steps of the method for implementing the configuration table-based diagnostic mode for automobile diagnosis described in Embodiment 1.

[0087] Examples include:

[0088] The four configuration tables described in the preset embodiment 1 are: a diagnostic DID table, namely, a t_DID table, a diagnostic SubDID table, namely, a t_SubDID table, a SubDID configuration mapping table, namely, a t_SubDID_Config_Relation, and a system configuration table, namely, a systemConfig table.

[0089] Query DID: traverse the subdid list of the configuration table, read the configuration data, complete the data type conversion and DID result assembly. For the specific query process of DID, please refer to Example 1.

[0090] Write DID, or modify DID: traverse the subdid list of the configuration table, locate the configuration item, and modify the configuration data. For the specific process of writing or modifying DID, see Example 1.

[0091] Query configuration items: call the configuration interface, pass module and item parameters, and read configuration data. For the specific query process of configuration items, see Example 1.

[0092] Write or modify configuration items: call the configuration interface, pass module and item parameters, locate the configuration item and modify the configuration data. For the specific process of writing or modifying the configuration item, see Example 1.

[0093] Subscription configuration item: The application mode subscribes to the configuration item, the diagnosis module modifies the configuration data, the diagnosis module publishes a data change notification to the application mode, and the application module executes the relevant logic processing after receiving the data change notification. For the specific implementation process of the application mode subscription configuration item, see Example 1.

[0094] In this embodiment, the program may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor.

[0095] Example 4

[0096] Based on the same technical concept, this embodiment further provides a processor, which is used to implement the steps of the method for implementing the configuration table-based diagnostic mode for automobile diagnosis described in Embodiment 1. The processor may be a chip.

[0097] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for implementing a diagnostic mode based on a configuration table, characterized in that: The following steps are involved: Four preset configuration tables: diagnostic DID table, diagnostic SubDID table, SubDID configuration mapping table and system configuration table; DID query: traverse the subdid list of the configuration table, read the configuration data, complete data type conversion and DID result assembly; DID write: traverse the subdid list of the configuration table, locate the configuration item, and modify the configuration data; Configuration item query: call the configuration interface, pass module and item parameters, and read the configuration data; Configuration item writing: call the configuration interface, pass module and item parameters, locate the configuration item and modify the configuration data; The diagnostic DID table is used to define all DIDs supported by the system and store the DID name, ID, byte length and MCU synchronization flag corresponding to each DID; The diagnostic SubDID table is used to define all subdid sub-items contained in each DID, and store the subdid name, bit length, starting byte, starting bit, data type, and attribute type corresponding to each DID; The SubDID configuration mapping table is used to store the mapping relationship between subdid and systemConfig, and query the module and item names associated with subdid through the SubDID configuration mapping table; The system configuration table is used to store all configuration items, each of which contains: module, item, value, readlist, writelist and updateFlag flags; DID queries specifically include: When reading a DID, first query the diagnostic DID table to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table. Traverse the subdid list and query the module and item names by subdid number; Query the system configuration table, read the configuration data through module and item, and complete data type conversion and DID result assembly; After all subdid lists are queried successfully, the DID result is returned.

2. The method for implementing a diagnostic mode based on a configuration table according to claim 1, characterized in that: Also includes: Configuration item subscription: The application mode subscribes to the configuration item, the diagnostic module modifies the configuration data, the diagnostic module publishes data change notifications to the application mode, and the application module executes related logic processing after receiving the data change notification.

3. The method for implementing a diagnostic mode based on a configuration table according to claim 1, characterized in that: DID writing specifically includes: When writing a DID, first query the diagnostic DID table to check whether the current DID is supported. If not, return failure. If supported, obtain the subdid list from the diagnostic SubDID table. Query the system configuration table, locate configuration items through module and item, and modify configuration data; After all subdid lists are set successfully, the operation results are returned.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for implementing a diagnostic mode based on a configuration table as described in any one of claims 1 to 3 are implemented.

5. A computer program, characterized in that When the computer program is executed by the main control device, it is used to implement the steps of the method for implementing a diagnostic mode based on a configuration table as described in any one of claims 1 to 3.