Configuration method and device of control local area network database (DBC) file and vehicle
By extracting and identifying CAN message information and routing information, the problem of DBC file configuration errors is solved, the configuration accuracy and efficiency are improved, and the normal update of PDU routing files and DBC files is ensured.
Patent Information
- Application Number
- CN202310722385.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2024-12-17
AI Technical Summary
In the prior art, when PDU routing files and DBC routing files are abnormal, DBC file configuration errors will occur, and configuration accuracy and efficiency will be low.
By obtaining DBC files and PDU routing files, extracting CAN message information and CAN routing information, identifying whether the information complies with the preset rules, and if it meets, configure it to generate updated DBC files to avoid updating files in abnormal situations and improve configuration Accuracy and efficiency.
It realizes accurate configuration of DBC files, avoids configuration errors, improves configuration efficiency, and ensures normal update of PDU routing files and DBC files.
Smart Images

Figure CN119155175A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of control area network (CAN), and in particular to a configuration method, device, electronic device, storage medium and vehicle for a control area network database (DBC) file. Background Art
[0002] At present, CAN (Controller Area Network) is a serial data communication protocol widely used in vehicles. In order to facilitate the design and maintenance of the whole vehicle, DBC (Database Controller Area Network) files are usually used to manage CAN data. In related technologies, most PDU routing files are used to configure DBC files. However, when the PDU routing files and DBC routing files are abnormal, the DBC file configuration will be wrong, and the configuration accuracy and efficiency of the DBC file are low. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the above-mentioned technologies at least to some extent.
[0004] To this end, the first objective of the present disclosure is to provide a configuration method for a control local area network database DBC file.
[0005] The second objective of the present disclosure is to provide a configuration device for controlling a local area network database DBC file.
[0006] A third objective of the present disclosure is to provide an electronic device.
[0007] A fourth objective of the present disclosure is to provide a computer-readable storage medium.
[0008] A fifth object of the present disclosure is to provide a vehicle.
[0009] The first aspect of the present disclosure proposes a configuration method for a control area network database DBC file, including: obtaining a first DBC file and a protocol data unit PDU routing file; extracting information from the first DBC file to obtain control area network CAN message information; extracting information from the PDU routing file to obtain CAN routing information; identifying whether the CAN message information complies with a first preset rule, and if the CAN message information does not comply with the first preset rule, determining that an abnormality occurs in the first DBC file; identifying whether the CAN routing information complies with a second preset rule, and if the CAN routing information does not comply with the second preset rule, determining that an abnormality occurs in the PDU routing file; if the CAN message information complies with the first preset rule and the CAN routing information complies with the second preset rule, configuring the CAN message information according to the CAN routing information to obtain a second DBC file after the first DBC file is updated.
[0010] In addition, the configuration method of the control local area network database DBC file proposed in the above embodiment of the present disclosure may also have the following additional technical features.
[0011] In one embodiment of the present disclosure, the identifying whether the CAN message information complies with a first preset rule includes: if the number of the CAN message information is greater than or equal to a first set threshold, and / or the CAN message information includes a first set character, and / or the format of the CAN message information is a first preset format, and / or the second field name of the CAN message information includes a second preset field name, determining that the CAN message information complies with the first preset rule; wherein the first set character is used to indicate that the CAN message information has integrity.
[0012] In one embodiment of the present disclosure, the identifying whether the CAN routing information complies with a second preset rule includes: if the amount of the CAN routing information is greater than or equal to a second set threshold, and / or the CAN routing information includes a second set character, the format of the CAN routing information is a second preset format, and / or the first field name of the CAN routing information includes a first preset field name, determining that the CAN routing information complies with the second preset rule; wherein the second set character is used to indicate that the CAN routing information has integrity.
[0013] In one embodiment of the present disclosure, configuring the CAN message information according to the CAN routing information includes: matching the first field name of the CAN routing information and the second field name of the CAN message information; and configuring the CAN message information according to the CAN routing information when the first field name and the second field name match.
[0014] In one embodiment of the present disclosure, after obtaining the second DBC file updated from the first DBC file, the method further includes: importing the second DBC file into a conversion plug-in, and converting the second DBC file by the conversion plug-in to obtain a first CAN configuration file.
[0015] In one embodiment of the present disclosure, after obtaining the first CAN configuration file, the method further includes: extracting information from the first CAN configuration file to obtain CAN configuration information; configuring the CAN configuration information according to the CAN routing information to obtain a second CAN configuration file after the first CAN configuration file is updated.
[0016] In one embodiment of the present disclosure, configuring the CAN configuration information according to the CAN routing information includes: matching the first field name of the CAN routing information and the third field name of the CAN configuration information; and configuring the CAN configuration information according to the CAN routing information when the first field name and the third field name match.
[0017] In one embodiment of the present disclosure, after obtaining the second CAN configuration file updated from the first CAN configuration file, it further includes: importing the second CAN configuration file into a conversion plug-in, and the conversion plug-in converts the second CAN configuration file to obtain a CAN code file.
[0018] In one embodiment of the present disclosure, after obtaining the second CAN configuration file that is updated from the first CAN configuration file, the method further includes: storing the second CAN configuration file in a set storage space.
[0019] In one embodiment of the present disclosure, after determining that the first DBC file is abnormal, it also includes: generating alarm information for reminding that the first DBC file is abnormal; after determining that the PDU routing file is abnormal, it also includes: generating alarm information for reminding that the PDU routing file is abnormal.
[0020] The second aspect of the present disclosure proposes a configuration device for a control area network database DBC file, including: an acquisition module, used to acquire a first DBC file and a protocol data unit PDU routing file; an extraction module, used to extract information from the first DBC file to obtain control area network CAN message information; the extraction module is also used to extract information from the PDU routing file to obtain CAN routing information; an identification module, used to identify whether the CAN message information complies with a first preset rule, and if the CAN message information does not comply with the first preset rule, determine that the first DBC file is abnormal; the identification module is also used to identify whether the CAN routing information complies with a second preset rule, and if the CAN routing information does not comply with the second preset rule, determine that the PDU routing file is abnormal; a configuration module, used to configure the CAN message information according to the CAN routing information if the CAN message information complies with the first preset rule and the CAN routing information complies with the second preset rule, and obtain a second DBC file updated from the first DBC file.
[0021] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the configuration method of the control local area network database DBC file as described in the first aspect embodiment of the present disclosure is implemented.
[0022] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the configuration method of the control local area network database DBC file as described in the first aspect of the present disclosure is implemented.
[0023] The fifth aspect embodiment of the present application proposes a vehicle, comprising a configuration device for controlling a local area network database DBC file as described in the second aspect embodiment of the present disclosure; or an electronic device as described in the third aspect embodiment of the present disclosure; or a computer-readable storage medium as described in the fourth aspect embodiment of the present disclosure.
[0024] The technical solution provided by the embodiment of the present disclosure brings at least the following beneficial effects: information can be extracted from the first DBC file and the PDU routing file respectively to obtain CAN message information and CAN routing information, and based on the CAN message information and the first preset rule, it is automatically determined whether the first DBC file is abnormal, and based on the PDU routing information and the second preset rule, it is automatically determined whether the PDU routing file is abnormal, and after both the first DBC file and the PDU routing file are normal, the first DBC file is updated according to the CAN routing information, which can avoid updating the first DBC file when the first DBC file and the PDU routing file are abnormal, resulting in DBC file configuration errors, and helps to improve the configuration accuracy and efficiency of the DBC file.
[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0027] Figure 1 A flowchart of a method for configuring a DBC file in a control local area network database according to an embodiment of the present disclosure;
[0028] Figure 2 A schematic diagram of a flow chart after obtaining a second DBC file in a method for configuring a DBC file of a control local area network database according to an embodiment of the present disclosure;
[0029] Figure 3 A schematic diagram of the structure of a device for controlling configuration of a local area network database DBC file according to an embodiment of the present disclosure;
[0030] Figure 4 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0032] The following describes the configuration method, device, vehicle, electronic device and storage medium of the control local area network database DBC file according to the embodiments of the present disclosure in conjunction with the accompanying drawings.
[0033] Figure 1The present invention is a flowchart of a method for configuring a DBC file in a control local area network database according to an embodiment of the present invention.
[0034] like Figure 1 As shown, the configuration method of the control local area network database DBC file of the embodiment of the present disclosure includes:
[0035] S101, obtaining a first DBC file and a PDU routing file.
[0036] S102: extract information from the first DBC file to obtain CAN message information.
[0037] S103, extract information from the PDU routing file to obtain CAN routing information.
[0038] It should be noted that the execution subject of the configuration method of the control local area network database DBC file of the embodiment of the present disclosure is an electronic device, and the electronic device includes a mobile phone, a notebook, a desktop computer, a vehicle terminal, a smart home appliance, etc. The configuration method of the control local area network database DBC file of the embodiment of the present disclosure can be executed by the configuration device of the control local area network database DBC file of the embodiment of the present disclosure, and the configuration device of the control local area network database DBC file of the embodiment of the present disclosure can be configured in any electronic device to execute the configuration method of the control local area network database DBC file of the embodiment of the present disclosure.
[0039] It should be noted that there are no excessive restrictions on the first DBC (Database Controller Area Network) file and the PDU (Protocol Data Unit) routing file, for example, they may include tables, key-value pairs, etc. The first DBC file and the PDU routing file can be set by developers and users according to actual conditions and pre-set in the storage space.
[0040] In the embodiment of the present disclosure, the first DBC file includes CAN (Controller Area Network) message information, and the PDU routing file includes CAN routing information. There are no excessive restrictions on CAN message information and CAN routing information. For example, CAN message information includes message identification, message category, signal identification, signal category, signal parameters, CAN node, etc. CAN routing information includes signal identification, signal category, CAN node, network, etc.
[0041] It should be noted that information extraction can be implemented by using any information extraction method in the relevant technology, and no further limitation is given here. For example, a row-by-row extraction method or a column-by-column extraction method can be used.
[0042] S104, identifying whether the CAN message information complies with a first preset rule.
[0043] If yes, that is, the CAN message information complies with the first preset rule, step S105 is executed; if no, that is, the CAN message information does not comply with the first preset rule, step S107 is executed.
[0044] It should be noted that there are no excessive restrictions on the first preset rule, and the first preset rule can be preset by the user according to actual conditions.
[0045] In one embodiment, identifying whether CAN message information complies with a first preset rule includes if the amount of CAN message information is greater than or equal to a first set threshold, and / or the CAN message information includes a first set character, and / or the format of the CAN message information is a first preset format, and / or the second field name of the CAN message information includes a second preset field name, determining that the CAN message information complies with the first preset rule.
[0046] The first set threshold refers to the lower limit of the number of preset CAN message information. If the number of CAN message information is greater than or equal to the first set threshold, it indicates that the number of CAN message information is large and the CAN message information is not missing, that is, the CAN message information has integrity. On the contrary, if the number of CAN message information is less than the first set threshold, it indicates that the number of CAN message information is small and the CAN message information is missing, that is, the CAN message information is not complete. The first set threshold is not too limited, for example, it can be 100.
[0047] The first setting character is used to indicate that the CAN message information has integrity. There are no excessive restrictions on the first setting character, for example, the first setting character can be "#", "&", "xxx", etc.
[0048] The first preset format refers to the preset format specification of the CAN message information. If the format of the CAN message information is the first preset format, it indicates that the CAN message information complies with the preset format specification, that is, the CAN message information is legal. On the contrary, if the format of the CAN message information is not the first preset format, it indicates that the CAN message information does not comply with the preset format specification, that is, the CAN message information is not legal. There are no excessive restrictions on the first preset format, for example, it may include a standard format, an extended format, etc.
[0049] Among them, the second preset field name refers to the field name of the preset CAN message information. If the second field name of the CAN message information includes the second preset field name, it indicates that the CAN message information is not missing, that is, the CAN message information has integrity. On the contrary, if the second field name of the CAN message information does not include the second preset field name, it indicates that the CAN message information is missing, that is, the CAN message information is not complete. There are no excessive restrictions on the second preset field name. For example, it can include message name, message identifier, message identifier format, message DLC (Data Length Code, data length code), message sending type, message cycle time, message sender, etc.
[0050] S105, identifying whether the CAN routing information complies with a second preset rule.
[0051] If yes, that is, the CAN routing information complies with the second preset rule, step S106 is executed; if no, that is, the CAN routing information does not comply with the second preset rule, step S108 is executed.
[0052] It should be noted that there are no excessive restrictions on the second preset rule, and the second preset rule can be preset by the user according to actual conditions.
[0053] In one embodiment, identifying whether CAN routing information complies with a second preset rule includes if the amount of CAN routing information is greater than or equal to a second set threshold, and / or the CAN routing information includes a second set character, the format of the CAN routing information is a second preset format, and / or the first field name of the CAN routing information includes a first preset field name, determining that the CAN routing information complies with the second preset rule.
[0054] The second set threshold refers to the lower limit of the number of preset CAN routing information. If the number of CAN routing information is greater than or equal to the second set threshold, it indicates that the number of CAN routing information is large and the CAN routing information is not missing, that is, the CAN routing information is complete. On the contrary, if the number of CAN routing information is less than the second set threshold, it indicates that the number of CAN routing information is small and the CAN routing information is missing, that is, the CAN routing information is not complete. The second set threshold is not too limited, for example, it can be 100.
[0055] The second setting character is used to indicate that the CAN routing information has integrity. There are no excessive restrictions on the second setting character, for example, the second setting character can be "#", "&", "xxx", etc.
[0056] The second preset format refers to the preset format specification of the CAN routing information. If the format of the CAN routing information is the second preset format, it indicates that the CAN routing information complies with the preset format specification, that is, the CAN routing information is legal. On the contrary, if the format of the CAN routing information is not the second preset format, it indicates that the CAN routing information does not comply with the preset format specification, that is, the CAN routing information is not legal. There is no excessive limitation on the second preset format.
[0057] The first preset field name refers to the field name of the preset CAN routing information. If the first field name of the CAN routing information includes the first preset field name, it indicates that the CAN routing information is not missing, that is, the CAN routing information is complete. On the contrary, if the first field name of the CAN routing information does not include the first preset field name, it indicates that the CAN routing information is missing, that is, the CAN routing information is not complete. There are no excessive restrictions on the first preset field name, for example, it can include a message name, a message identifier, a message routing category, a message sender, a message receiver, etc.
[0058] S106, configuring the CAN message information according to the CAN routing information, and obtaining a second DBC file after the first DBC file is updated.
[0059] In the embodiment of the present disclosure, the CAN message information is configured according to the CAN routing information to obtain the second DBC file after the first DBC file is updated. The following possible implementation methods can be adopted:
[0060] Method 1: Match the first field name of the CAN routing information and the second field name of the CAN message information. When the first field name and the second field name match, configure the CAN message information according to the CAN routing information.
[0061] It should be noted that there are no excessive restrictions on the first field name and the second field name. For example, the first field name may include the message name, message identifier, message identifier format, message DLC, message sending type, message cycle time, message sender, etc. The second field name may include the message name, message identifier, message routing category, message sender, message receiver, etc.
[0062] It should be noted that, when the first field name and the second field name match, the first field name and the second field name may be the same or different, and one first field name may match multiple second field names.
[0063] In one embodiment, the first field name of the CAN routing information and the second field name of the CAN message information are matched, including identifying that there is a mapping relationship between the first field name and the second field name, and determining that the first field name and the second field name match, or identifying that there is no mapping relationship between the first field name and the second field name, and determining that the first field name and the second field name do not match.
[0064] For example, it can be identified that there is a mapping relationship between the first field name message name and the second field name message name, and it is determined that the first field name message name and the second field name message name match; it can be identified that there is no mapping relationship between the first field name message name and the second field name message receiver, and it is determined that the first field name message name and the second field name message receiver do not match.
[0065] In one embodiment, the first field name of the CAN routing information and the second field name of the CAN message information are matched, including identifying that the first field name and the second field name are consistent, determining that the first field name and the second field name match, or identifying that the first field name and the second field name are inconsistent, determining that the first field name and the second field name do not match.
[0066] For example, it can be identified that the message name of the first field name and the message name of the second field name are consistent, and it can be determined that the message name of the first field name and the message name of the second field name match, and it can be identified that the message name of the first field name and the message receiver of the second field name are inconsistent, and it can be determined that the message name of the first field name and the message receiver of the second field name do not match.
[0067] In one embodiment, the CAN message information is configured according to the CAN routing information, including configuring the CAN message information as CAN routing information, that is, configuring the field value corresponding to the second field name as the field value corresponding to the first field name, and / or determining the configuration content based on the CAN routing information, and configuring the CAN message information according to the configuration content.
[0068] For example, if the CAN routing information includes CAN nodes x and y, and the first field name of CAN nodes x and y is CAN node, and if the CAN message information includes CAN node y, and the second field name of CAN node y is CAN node, then it can be identified that the first field name and the second field name are consistent. Once it is determined that the first field name and the second field name match, the CAN node y in the CAN message information can be modified to CAN nodes x and y.
[0069] Method 2: Match the first field name of the CAN routing information and the second field name of the CAN message information. If there is no second field name matching the first field name, generate CAN new message information according to the CAN routing information.
[0070] In one implementation, generating CAN new message information according to CAN routing information includes configuring the CAN new message information as CAN routing information, and / or determining configuration content based on the CAN routing information, and generating CAN new message information according to the configuration content.
[0071] In one implementation, the third field name of the CAN newly added message information is consistent with the first field name.
[0072] For example, if the CAN routing information includes CAN nodes x and y, the first field name of CAN nodes x and y is CAN node. If there is no second field name matching the CAN node, then according to CAN nodes x and y, CAN new message information of CAN nodes x and y can be generated, and the third field name of the CAN new message information is CAN node.
[0073] S107, determining that an abnormality occurs in the first DBC file.
[0074] S108, determining that an abnormality occurs in the PDU routing file.
[0075] In one embodiment, after determining that the first DBC file is abnormal, it also includes generating alarm information for reminding the user that the first DBC file is abnormal, so as to promptly remind the user that the first DBC file is abnormal. It should be noted that there are no excessive restrictions on the alarm information for reminding the user that the first DBC file is abnormal, for example, it may include the identifier of the first DBC file, DBC message information, the identifier of the DBC message information, etc.
[0076] In one embodiment, after determining that the PDU routing file is abnormal, it also includes generating an alarm message for reminding that the PDU routing file is abnormal, so as to promptly remind the user that the PDU routing file is abnormal. It should be noted that there is no excessive limitation on the alarm message for reminding that the PDU routing file is abnormal, for example, it may include the identifier of the PDU routing file, the PDU routing information, the identifier of the PDU routing information, etc.
[0077] In summary, according to the configuration method of the control local area network database DBC file of the embodiment of the present invention, information can be extracted from the first DBC file and the PDU routing file respectively to obtain CAN message information and CAN routing information, and based on the CAN message information and the first preset rule, it is automatically determined whether the first DBC file is abnormal, and based on the PDU routing information and the second preset rule, it is automatically determined whether the PDU routing file is abnormal, and after both the first DBC file and the PDU routing file are normal, the first DBC file is updated according to the CAN routing information, which can avoid updating the first DBC file when the first DBC file and the PDU routing file are abnormal, resulting in the problem of DBC file configuration errors, and helps to improve the configuration accuracy and efficiency of the DBC file.
[0078] Based on any of the above embodiments, after obtaining the second DBC file updated from the first DBC file in step S106, the method further includes importing the second DBC file into a conversion plug-in, and the conversion plug-in converts the second DBC file to obtain a first CAN configuration file.
[0079] It should be noted that the CAN configuration file refers to the description file used to generate the CAN code file. There is no excessive limitation on the CAN configuration file. For example, it may include the configuration files of Canif (Controller Area Network Interface Module) and PDUR (Protocol Data Unit Router Module). For example, the CAN configuration file may include ARXML (Automotive Open System Architecture Extensible Markup Language) files.
[0080] It should be noted that the conversion plug-in can be implemented using any software tool in the relevant technology, for example, it can include a Vector tool.
[0081] Therefore, in the method, the second DBC file can be converted by the conversion plug-in to obtain the first CAN configuration file, which can realize the automatic generation of the CAN configuration file and improve the generation efficiency of the CAN configuration file.
[0082] Based on any of the above embodiments, Figure 2 After obtaining the second DBC file updated from the first DBC file in step S106, the method further includes:
[0083] S201, importing the second DBC file into the conversion plug-in, and the conversion plug-in converts the second DBC file to obtain a first CAN configuration file.
[0084] For the relevant contents of step S201, please refer to the above embodiment, which will not be described again here.
[0085] S202: extract information from the first CAN configuration file to obtain CAN configuration information.
[0086] S203, configuring the CAN configuration information according to the CAN routing information, and obtaining a second CAN configuration file after the first CAN configuration file is updated.
[0087] It should be noted that the relevant content of step S207 can refer to the relevant content of step S104, which will not be repeated here.
[0088] It should be noted that there are no excessive restrictions on the third field name. For example, the third field name may include message name, message identifier, message identifier format, message DLC, message sending type, message cycle time, message sender, etc.
[0089] In one implementation, the CAN configuration information is configured according to the CAN routing information, including matching the first field name of the CAN routing information and the third field name of the CAN configuration information, and when the first field name and the third field name match, the CAN configuration information is configured according to the CAN routing information. It should be noted that the relevant content of matching the first field name and the third field name can refer to the relevant content of matching the first field name and the second field name in the above embodiment, which will not be repeated here.
[0090] In one embodiment, after obtaining the second CAN configuration file updated from the first CAN configuration file, the method further includes importing the second CAN configuration file into a conversion plug-in, and converting the second CAN configuration file by the conversion plug-in to obtain a CAN code file. Thus, in the method, the second CAN configuration file can be converted by the conversion plug-in to obtain a CAN code file, and the automatic generation of the CAN code file can be realized, thereby improving the generation efficiency of the CAN configuration file.
[0091] In one implementation, after obtaining the second CAN configuration file that is updated from the first CAN configuration file, the method further includes storing the second CAN configuration file in a set storage space to implement storage of the second CAN configuration file.
[0092] Therefore, in the method, the second DBC file is imported into the conversion plug-in, and the conversion plug-in converts the second DBC file to obtain the first CAN configuration file, extracts information from the first CAN configuration file to obtain CAN configuration information, and configures the CAN configuration information according to the CAN routing information to obtain the second CAN configuration file after the first CAN configuration file is updated. Therefore, the information of the first CAN configuration file can be extracted to obtain the CAN configuration information, and the CAN configuration information can be configured according to the CAN routing information to update the first CAN configuration file, and the automatic configuration of the CAN configuration file can be realized according to the PDU routing file, thereby improving the configuration efficiency of the CAN configuration file.
[0093] In order to implement the above embodiment, the present disclosure also proposes a configuration device for controlling a local area network database DBC file.
[0094] Figure 3 The present invention is a schematic diagram of the structure of a device for configuring a DBC file in a control local area network database according to an embodiment of the present disclosure.
[0095] like Figure 3 As shown, the configuration device 100 of the control local area network database DBC file according to the embodiment of the present disclosure includes: an acquisition module 110 , an extraction module 120 , an identification module 130 and a configuration module 140 .
[0096] The acquisition module 110 is used to acquire a first DBC file and a protocol data unit PDU routing file;
[0097] The extraction module 120 is used to extract information from the first DBC file to obtain the control area network CAN message information;
[0098] The extraction module 120 is also used to extract information from the PDU routing file to obtain CAN routing information;
[0099] The identification module 130 is used to identify whether the CAN message information conforms to a first preset rule, and if the CAN message information does not conform to the first preset rule, determine that the first DBC file is abnormal;
[0100] The identification module 130 is further used to identify whether the CAN routing information complies with a second preset rule, and if the CAN routing information does not comply with the second preset rule, determine that an abnormality occurs in the PDU routing file;
[0101] The configuration module 140 is used to configure the CAN message information according to the CAN routing information if the CAN message information conforms to the first preset rule and the CAN routing information conforms to the second preset rule, so as to obtain a second DBC file after the first DBC file is updated.
[0102] In one embodiment of the present disclosure, the identification module 130 is also used to: if the number of the CAN message information is greater than or equal to a first set threshold, and / or the CAN message information includes a first set character, and / or the format of the CAN message information is a first preset format, and / or the second field name of the CAN message information includes a second preset field name, determine that the CAN message information complies with the first preset rule; wherein the first set character is used to indicate that the CAN message information has integrity.
[0103] In one embodiment of the present disclosure, the identification module 130 is also used to: if the amount of the CAN routing information is greater than or equal to a second set threshold, and / or the CAN routing information includes a second set character, the format of the CAN routing information is a second preset format, and / or the first field name of the CAN routing information includes a first preset field name, determine that the CAN routing information complies with the second preset rule; wherein the second set character is used to indicate that the CAN routing information has integrity.
[0104] In one embodiment of the present disclosure, the configuration module 140 is also used to: match the first field name of the CAN routing information and the second field name of the CAN message information; and when the first field name and the second field name match, configure the CAN message information according to the CAN routing information.
[0105] In one embodiment of the present disclosure, it also includes: a processing module, after obtaining the second DBC file updated by the first DBC file, the processing module is used to: import the second DBC file into a conversion plug-in, and the conversion plug-in converts the second DBC file to obtain a first CAN configuration file.
[0106] In one embodiment of the present disclosure, after obtaining the first CAN configuration file, the processing module is further used to: extract information from the first CAN configuration file to obtain CAN configuration information; configure the CAN configuration information according to the CAN routing information to obtain a second CAN configuration file after the first CAN configuration file is updated.
[0107] In one embodiment of the present disclosure, the processing module is also used to: match the first field name of the CAN routing information and the third field name of the CAN configuration information; and when the first field name and the third field name match, configure the CAN configuration information according to the CAN routing information.
[0108] In one embodiment of the present disclosure, the processing module is further used to: import the second CAN configuration file into a conversion plug-in, and the conversion plug-in converts the second CAN configuration file to obtain a CAN code file.
[0109] In one embodiment of the present disclosure, the processing module is further used to: store the second CAN configuration file in a set storage space.
[0110] In one embodiment of the present disclosure, after determining that an abnormality occurs in the first DBC file, the identification module 130 is further used to: generate an alarm message for reminding that the first DBC file is abnormal; after determining that an abnormality occurs in the PDU routing file, the identification module 130 is further used to: generate an alarm message for reminding that the PDU routing file is abnormal.
[0111] It should be noted that for details not disclosed in the configuration device of the control local area network database DBC file in the embodiment of the present disclosure, please refer to the details disclosed in the configuration method of the control local area network database DBC file in the embodiment of the present disclosure, which will not be repeated here.
[0112] In summary, the configuration device of the control local area network database DBC file of the embodiment of the present invention can extract information from the first DBC file and the PDU routing file respectively to obtain CAN message information and CAN routing information, and automatically determine whether the first DBC file is abnormal based on the CAN message information and the first preset rule, and automatically determine whether the PDU routing file is abnormal based on the PDU routing information and the second preset rule, and update the first DBC file according to the CAN routing information after both the first DBC file and the PDU routing file are normal. This can avoid updating the first DBC file when the first DBC file and the PDU routing file are abnormal, which leads to the problem of DBC file configuration errors, and helps to improve the configuration accuracy and efficiency of the DBC file.
[0113] In order to implement the above embodiment, Figure 4 As shown, an embodiment of the present disclosure proposes an electronic device 200, including: a memory 210, a processor 220, and a computer program stored in the memory 210 and executable on the processor 220. When the processor 220 executes the program, the above-mentioned method for configuring the control local area network database DBC file is implemented.
[0114] The electronic device of the disclosed embodiment can extract information from the first DBC file and the PDU routing file respectively through the processor executing the computer program stored in the memory to obtain CAN message information and CAN routing information, and automatically judge whether the first DBC file is abnormal based on the CAN message information and the first preset rule, and automatically judge whether the PDU routing file is abnormal based on the PDU routing information and the second preset rule, and update the first DBC file according to the CAN routing information only after both the first DBC file and the PDU routing file are normal, so as to avoid the problem of DBC file configuration error caused by updating the first DBC file when the first DBC file and the PDU routing file are abnormal, and help to improve the configuration accuracy and efficiency of the DBC file.
[0115] In order to implement the above embodiment, the embodiment of the present disclosure proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above method for configuring a DBC file of a control local area network is implemented.
[0116] The computer-readable storage medium of the embodiment of the present disclosure can extract information from the first DBC file and the PDU routing file respectively by storing a computer program and being executed by a processor to obtain CAN message information and CAN routing information, and automatically determine whether the first DBC file is abnormal based on the CAN message information and the first preset rule, and automatically determine whether the PDU routing file is abnormal based on the PDU routing information and the second preset rule, and update the first DBC file according to the CAN routing information only after both the first DBC file and the PDU routing file are normal, so as to avoid updating the first DBC file when the first DBC file and the PDU routing file are abnormal, resulting in the problem of DBC file configuration errors, and help to improve the configuration accuracy and configuration efficiency of the DBC file.
[0117] In order to implement the above embodiment, the embodiment of the present disclosure proposes a vehicle, including the above-mentioned configuration device of the control local area network database DBC file; or the above-mentioned electronic device; or the above-mentioned computer-readable storage medium.
[0118] The vehicle of the embodiment of the present disclosure can extract information from the first DBC file and the PDU routing file respectively to obtain CAN message information and CAN routing information, and automatically determine whether the first DBC file is abnormal based on the CAN message information and the first preset rule, and automatically determine whether the PDU routing file is abnormal based on the PDU routing information and the second preset rule, and update the first DBC file according to the CAN routing information after both the first DBC file and the PDU routing file are normal. This can avoid updating the first DBC file when the first DBC file and the PDU routing file are abnormal, which leads to the problem of DBC file configuration errors, and helps to improve the configuration accuracy and efficiency of the DBC file.
[0119] In the description of the present disclosure, it needs to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0120] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0121] In the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0122] In the present disclosure, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0123] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0124] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A method for configuring a DBC file in a control local area network database, characterized in that: include: Obtaining a first DBC file and a protocol data unit (PDU) routing file; Extracting information from the first DBC file to obtain control area network (CAN) message information; Extracting information from the PDU routing file to obtain CAN routing information; Identifying whether the CAN message information complies with a first preset rule, and if the CAN message information does not comply with the first preset rule, determining that an abnormality occurs in the first DBC file; Identifying whether the CAN routing information complies with a second preset rule, and if the CAN routing information does not comply with the second preset rule, determining that an abnormality occurs in the PDU routing file; If the CAN message information complies with the first preset rule and the CAN routing information complies with the second preset rule, the CAN message information is configured according to the CAN routing information to obtain a second DBC file that is updated from the first DBC file.
2. The method according to claim 1, characterized in that The identifying whether the CAN message information complies with a first preset rule includes: If the number of the CAN message information is greater than or equal to a first set threshold, and / or the CAN message information includes a first set character, and / or the format of the CAN message information is a first preset format, and / or the second field name of the CAN message information includes a second preset field name, it is determined that the CAN message information complies with the first preset rule; wherein, the first set character is used to indicate that the CAN message information has integrity.
3. The method according to claim 1, characterized in that The identifying whether the CAN routing information complies with a second preset rule includes: If the amount of the CAN routing information is greater than or equal to a second set threshold, and / or the CAN routing information includes a second set character, the format of the CAN routing information is a second preset format, and / or the first field name of the CAN routing information includes a first preset field name, it is determined that the CAN routing information complies with the second preset rule; wherein the second set character is used to indicate that the CAN routing information has integrity.
4. The method according to claim 1, wherein The configuring the CAN message information according to the CAN routing information includes: Matching the first field name of the CAN routing information and the second field name of the CAN message information; When the first field name and the second field name match, the CAN message information is configured according to the CAN routing information.
5. The method according to claim 1, wherein After obtaining the second DBC file updated from the first DBC file, the method further includes: The second DBC file is imported into a conversion plug-in, and the conversion plug-in converts the second DBC file to obtain a first CAN configuration file.
6. The method according to claim 5, characterized in that After obtaining the first CAN configuration file, the method further includes: Extracting information from the first CAN configuration file to obtain CAN configuration information; The CAN configuration information is configured according to the CAN routing information to obtain a second CAN configuration file that is updated after the first CAN configuration file is updated.
7. The method according to claim 6, characterized in that Configuring the CAN configuration information according to the CAN routing information includes: Matching the first field name of the CAN routing information and the third field name of the CAN configuration information; When the first field name and the third field name match, the CAN configuration information is configured according to the CAN routing information.
8. The method according to claim 6, characterized in that After obtaining the second CAN configuration file that is updated from the first CAN configuration file, the method further includes: The second CAN configuration file is imported into the conversion plug-in, and the conversion plug-in converts the second CAN configuration file to obtain a CAN code file.
9. The method according to claim 6, characterized in that After obtaining the second CAN configuration file that is updated from the first CAN configuration file, the method further includes: The second CAN configuration file is stored in the set storage space.
10. The method according to any one of claims 1 to 9, characterized in that After determining that the first DBC file is abnormal, the method further includes: generating an alarm message for notifying that the first DBC file is abnormal; After determining that the PDU routing file is abnormal, the method further includes: Generate an alarm message for reminding that the PDU routing file is abnormal.
11. A device for controlling the configuration of a local area network database DBC file, characterized in that: include: An acquisition module, configured to acquire a first DBC file and a protocol data unit (PDU) routing file; An extraction module, configured to extract information from the first DBC file to obtain CAN message information of a control area network; The extraction module is further used to extract information from the PDU routing file to obtain CAN routing information; an identification module, configured to identify whether the CAN message information complies with a first preset rule, and if the CAN message information does not comply with the first preset rule, determine that an abnormality occurs in the first DBC file; The identification module is further configured to identify whether the CAN routing information complies with a second preset rule, and if the CAN routing information does not comply with the second preset rule, determine that an abnormality occurs in the PDU routing file; A configuration module is used to configure the CAN message information according to the CAN routing information if the CAN message information complies with the first preset rule and the CAN routing information complies with the second preset rule, so as to obtain a second DBC file after the first DBC file is updated.
12. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for configuring a DBC file of a control local area network database according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for configuring a control local area network database DBC file according to any one of claims 1 to 10 is implemented.
14. A vehicle, characterized in that: include: The device for controlling configuration of a local area network database DBC file according to claim 11; or the electronic device according to claim 12; Or the computer-readable storage medium of claim 13.
Citation Information
Cited By
Bidirectional conversion method and system for vehicle network DBC database and spreadsheet
CN121981079A
