CN-121985062-A - Vehicle controller local area network matrix analysis method, device, terminal and storage medium
Abstract
The application relates to the technical field of automobile electronics and discloses a vehicle controller area network matrix analysis method, a device, a terminal and a storage medium, wherein the method comprises the steps of extracting vehicle type identification information from a periodic broadcast message obtained by monitoring a vehicle controller area network CAN bus to determine a target vehicle type; when the operating system of the electronic control unit operates, a first dynamic link library corresponding to a target vehicle type is loaded, a second dynamic link library of the original vehicle type which is loaded currently is unloaded, the first dynamic link library and the second dynamic link library both adopt the same set of standardized application programming interfaces, the application programming interfaces comprise initializing interfaces, the initializing interfaces of the first dynamic link library are called to complete initialization, and all subsequent controller local area network signal analysis and message packaging requests initiated by the standardized application programming interfaces are routed to the first dynamic link library for execution so as to realize seamless switching of the controller local area network communication matrix.
Inventors
- ZHANG JINGDA
- REN GUANGMING
- JIANG SHUHONG
Assignees
- 北斗智联科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260409
Claims (10)
- 1. A vehicle controller area network matrix parsing method, comprising: extracting vehicle type identification information from a periodic broadcast message obtained by monitoring a vehicle Controller Area Network (CAN) bus to determine a target vehicle type; When an operating system of the electronic control unit operates, loading a first dynamic link library corresponding to the target vehicle type, and unloading a second dynamic link library of the currently loaded original vehicle type, wherein the first dynamic link library and the second dynamic link library both adopt the same set of standardized application programming interfaces, and the application programming interfaces comprise initializing interfaces; And calling the initialization interface of the first dynamic link library to complete initialization, and routing all subsequent controller area network signal analysis and message encapsulation requests initiated by the standardized application programming interface to the first dynamic link library for execution so as to realize the switching of the controller area network communication matrix.
- 2. The vehicle controller area network matrix parsing method according to claim 1, wherein extracting the model identification information from the periodic broadcast message obtained from the listening vehicle controller area network CAN bus to determine the target model comprises: monitoring the periodic broadcast message corresponding to at least one preset message identifier on the CAN bus of the vehicle controller area network; extracting the vehicle type identification information from the periodical broadcast message, and executing multi-level arbitration processing on the vehicle type identification information to determine the target vehicle type based on an arbitration processing result; The multi-level arbitration processing comprises secure communication verification, counter replay prevention verification, cyclic redundancy verification, transmission source electronic control unit priority arbitration and continuous multi-frame consistency confirmation.
- 3. The method according to claim 2, wherein the multi-level arbitration process is sequentially performed in a preset priority order, and when any arbitration link check fails, the subsequent arbitration of the current vehicle type identification information is terminated; the preset priority order is secure communication check, counter replay prevention check, cyclic redundancy check, transmission source electronic control unit priority arbitration and continuous multi-frame consistency confirmation.
- 4. The method for analyzing the matrix of the local area network of the vehicle controller according to claim 2, wherein the preset message identifier is a message identifier periodically broadcasted by a gateway electronic control unit or a vehicle body control module.
- 5. The vehicle controller area network matrix parsing method of claim 1, wherein the standardized application programming interface further comprises a signal value change callback registration interface and a message encapsulation interface; The initialization interface is used for receiving a signal value change callback function pointer and an original data buffer area address of the controller area network, and after initialization is completed, configuring the first dynamic link library to push a signal value to the callback function according to a preset reporting strategy, wherein the preset reporting strategy comprises periodical reporting and event triggering reporting; The signal value change callback registration interface is used for establishing a binding relation between a callback function appointed by an upper application program and a controller local area network signal identifier to be monitored; The message packaging interface is used for receiving the message type identifier, the controller local area network signal data to be packaged and the target message identifier as parameters, and executing data packaging operation according to the signal value conversion parameters embedded in the first dynamic link library, wherein the signal value conversion parameters comprise bit offset, byte order, scaling coefficient and value offset.
- 6. The vehicle controller area network matrix parsing method of claim 5, wherein the first dynamic link library is generated by an automated code generation tool, the generating of the first dynamic link library comprising: Receiving a controller local area network database file corresponding to the target vehicle type; analyzing signal semantic description information and message period attributes in the controller area network database file, generating codes of the standardized application programming interface, compiling the codes to form the first dynamic link library, wherein the signal semantic description information comprises signal definition, bit offset, byte order, scaling coefficient and numerical offset.
- 7. The vehicle controller area network matrix parsing method of claim 2, further comprising: Loading and running a pre-stored default vehicle type analysis dynamic link library after the electronic control unit is electrified and started, but before any effective periodical broadcast message is received, wherein the default vehicle type analysis dynamic link library supports analysis and reporting of basic safety related signals, and the supported signal range is smaller than the signal range supported by a first dynamic link library corresponding to any target vehicle type; And triggering to unload the default vehicle type analysis dynamic link library and loading the first dynamic link library of the corresponding target vehicle type after receiving the effective vehicle type identification information meeting the multi-level arbitration processing condition.
- 8. A vehicle controller area network matrix parsing apparatus, comprising: the target vehicle type determining module is used for extracting vehicle type identification information from a periodic broadcast message obtained by a CAN bus of a monitoring vehicle controller area network so as to determine a target vehicle type; The dynamic link library loading module is used for loading a first dynamic link library corresponding to the target vehicle type and unloading a second dynamic link library of the current loaded original vehicle type when an operating system of the electronic control unit runs; And the calling module is used for calling the initialization interface of the first dynamic link library to complete initialization, and routing all subsequent controller local area network signal analysis and message encapsulation requests initiated by the standardized application programming interface to the first dynamic link library for execution so as to realize the switching of the controller local area network communication matrix.
- 9. A terminal device, characterized in that it comprises a processor and a memory, the memory storing a computer program, the processor being adapted to execute the computer program to implement the vehicle controller area network matrix parsing method according to any of claims 1-7.
- 10. A computer readable storage medium, characterized in that it stores a computer program which, when executed on a processor, implements the vehicle controller area network matrix parsing method according to any one of claims 1-7.
Description
Vehicle controller local area network matrix analysis method, device, terminal and storage medium Technical Field The present application relates to the field of automotive electronics, and in particular, to a method, an apparatus, a terminal, and a storage medium for analyzing a matrix of a local area network of a vehicle controller. Background In the development of an automobile electronic system, with the deep advancement of platformization and modularization strategies, an Electronic Control Unit (ECU) of the same hardware platform needs to be adapted to various automobile types. Different vehicle types share a hardware architecture, but there are significant differences in the communication layer of a Controller Area Network (CAN), including a message identifier (CAN ID), a Protocol Data Unit (PDU) structure, a signal definition, a bit offset position, a Data Length Code (DLC), a transmission period, engineering conversion parameters (such as a scaling coefficient and a numerical offset), and the like. The traditional technical scheme mainly relies on precompiled macros to compile different vehicle types, so that a software baseline grows exponentially along with the number of the vehicle types, firmware versions are seriously fragmented, test and verification cost is high, and configuration cannot be dynamically adjusted after delivery of the vehicle. In addition, the scheme adopts a plug-in configuration file (such as XML, JSON or customized binary format), while the problem of compiling bifurcation is relieved, additional storage overhead, complex configuration loading and analysis logic and system reliability risks caused by mismatch, damage or tampering of configuration file versions are introduced. Part of schemes try to switch vehicle type configuration through whole-vehicle OTA whole-package upgrading, however, the mode is long in time consumption, large in occupied bandwidth and high in failure rate, and once upgrading is interrupted, ECU function abnormality and even brick change are easy to cause, so that the requirements of vehicle-rule level instantaneity and usability are difficult to meet. In addition, the existing analysis mechanism generally lacks self-adaptive capability to dynamic DLC scenes, when the same CAN ID corresponds to different data lengths in different vehicle types, short frame zero padding or long frame cut-off logic is inconsistent, signal analysis dislocation is extremely easy to be caused, and abnormal conditions such as vehicle speed jump, electric quantity false alarm and the like are caused, so that ASIL-B/C level function safety alarm is triggered. In addition, most schemes only rely on single-point IO level reading or non-verified CAN message analysis, and are easily influenced by bus electromagnetic interference, transient noise or malicious attack, so that the vehicle type is misjudged, and further the mismatching of a bottom layer communication matrix and the upper layer functional disorder are caused. Disclosure of Invention In view of this, the embodiment of the application provides a vehicle controller local area network matrix analysis method, a device, a terminal and a storage medium, which CAN realize vehicle type self-adaptive switching without external configuration files, whole package OTA upgrading and ECU restarting, and CAN enable the same basic firmware to be compatible with a multi-vehicle type CAN communication matrix, thereby obviously reducing software version fragmentation, test cost and whole vehicle factory OTA bandwidth consumption. In a first aspect, an embodiment of the present application provides a method for parsing a matrix of a vehicle controller lan, including: extracting vehicle type identification information from a periodic broadcast message obtained by monitoring a vehicle Controller Area Network (CAN) bus to determine a target vehicle type; When an operating system of the electronic control unit operates, loading a first dynamic link library corresponding to the target vehicle type, and unloading a second dynamic link library of the currently loaded original vehicle type, wherein the first dynamic link library and the second dynamic link library both adopt the same set of standardized application programming interfaces, and the application programming interfaces comprise initializing interfaces; And calling the initialization interface of the first dynamic link library to complete initialization, and routing all subsequent controller area network signal analysis and message encapsulation requests initiated by the standardized application programming interface to the first dynamic link library for execution so as to realize the switching of the controller area network communication matrix. In an optional embodiment, the extracting the vehicle type identification information from the periodic broadcast message obtained from the monitoring vehicle controller area network CAN bus to determine the target vehicle type includes: moni