DBC file parsing and message analyzing method based on regular expression
A technology of message analysis and file parsing, which is applied in the field of CAN bus of new energy vehicles, can solve the problems of increased operation difficulty, waste of manpower and time costs, complexity and difficulty, etc., to reduce the probability of definition errors and quickly transplant Use and expandable effects
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2018-09-28
Smart Images

Figure 1
Abstract
Description
technical field
[0001] The invention relates to a DBC file analysis and message analysis method based on regular expressions, and belongs to the technical field of CAN bus of new energy vehicles. Background technique
[0002] At present, with the development of new energy vehicle technology, the functions of the vehicle are becoming more and more complex, and the safety requirements are getting higher and higher, so more and more controllers are applied to the vehicle. In order to realize real-time communication between different controllers, CAN bus is also widely used. Through the CAN network, the data of different controllers are sent to the CAN bus with ID as the distinction, and the controller quickly finds the required data from the bus. The CAN bus has the functions of arbitration and inspection, which can ensure the accuracy of the data. Reliable and stable fieldbus. However, because the message IDs and bus data between controllers are different, the amount of data...
Examples
Embodiment Construction
[0077] Embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. Such as figure 1 Shown, method of the present invention comprises the following steps:
[0078] Step 1. Analyze the DBC file, read the DBC file in the form of text, and then use regular expressions to match, find the corresponding CAN network message block in the DBC file, and extract the corresponding CAN message ID and node name , message name, and then search down the content contained in the CAN network, extract the corresponding data type, start bit, bit length, offset, proportional coefficient, and analysis type, and store them in the structure array.
[0079] The CAN network message block in the DBC file is that a message will immediately follow a multi-line signal until another message is parsed, indicating that a CAN network message block ends, and when all lines are parsed, all CAN network message blocks are is parsed. It is ignored w...