Vehicle data analysis method and apparatus, computer device, storage medium and vehicle
By simplifying the generation of CAN configuration files for DBC files and dynamically parsing CAN frames, the problem of needing to modify the parsing code after the DBC file is updated is solved, and a rapid and simplified vehicle data analysis process is realized, which significantly shortens the process time after the update.
Patent Information
- Application Number
- PCT/CN2024/094453
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-30
- Filing Date
- 2024-05-21
- Publication Date
- 2025-06-05
AI Technical Summary
The prior art requires modifying the parsing code after the DBC file is updated, resulting in complex and time-consuming processes, making it difficult to achieve fast vehicle data parsing.
By simplifying the DBC file to generate CAN configuration files in advance, the CAN configuration files are used to dynamically parse the target CAN frames, avoiding modification of the parsing code, and achieving a fast updated vehicle data parsing process.
Shorten the complex process after the DBC file update to several minutes, significantly reducing the time spent on the entire process after the update, from the day level to the minute level.
Smart Images

Figure CN2024094453_05062025_PF_FP_ABST
Abstract
Description
Vehicle data analysis method, device, computer equipment, storage medium and vehicle
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application number 202311631135.3, filed on November 30, 2023, entitled “Vehicle Data Analysis Method, Device, Computer Equipment, Storage Medium and Vehicle,” the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of vehicle technology, and in particular to a vehicle data analysis method, apparatus, computer equipment, storage medium, and vehicle. Background Art
[0004] With the development of automotive technology, the Controller Area Network (CAN) bus has become widely used. A Controller Area Network Database (DBC) file is a database file that describes the data communication between communication nodes in a CAN network. The DBC file defines the entire vehicle communication network, and communication nodes use the DBC file to constrain data formats.
[0005] In the prior art, updating a DBC file requires modifying the parsing code for the relevant communication nodes. This code modification requires a series of development activities, including version updates and releases, before the updated DBC file can be used to parse vehicle data. This entire process is complex and can take several days. Therefore, a new vehicle data parsing method is needed to simplify the prior art process.
[0006] Summary of the Invention
[0007] The present application provides a vehicle data analysis method, apparatus, computer equipment, storage medium and vehicle, which can simplify the complex process after the DBC file is updated.
[0008] The present application provides a vehicle data parsing method, which includes: obtaining a target CAN frame and a CAN configuration file; wherein the CAN configuration file is obtained by simplifying a DBC file; reading message configuration information corresponding to the target CAN frame from the CAN configuration file; and parsing the target CAN frame based on the message configuration information to obtain vehicle signal data.
[0009] In this application, the acquired CAN frames are parsed by using a CAN configuration file obtained by pre-simplifying the DBC file, which not only realizes the dynamic parsing of CAN frames in a new way, but also because the CAN configuration file is used to dynamically parse the CAN frames, when the DBC file is updated, there is no need to modify the parsing code. Instead, the updated DBC file is quickly simplified and the new CAN configuration file can be obtained in time, thereby transforming a complex process that takes several days into a simplified process of several minutes, shortening the time spent on the day to the minute level, and significantly shortening the time spent on the entire process after the DBC file is updated.
[0010] In one embodiment, the acquiring the target CAN frame includes: acquiring an initial CAN frame; and performing cleaning and filtering based on the initial CAN frame to obtain the target CAN frame.
[0011] In an embodiment of the present application, by cleaning and filtering the initial CAN frame to obtain the target CAN frame, the system load caused by parsing the data can be reduced; further, the data volume of the target CAN frame is more suitable for deployment on the vehicle side, meeting the real-time business needs of the vehicle side.
[0012] In one embodiment, the cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: screening CAN frames matching a preset configuration CAN identifier in the initial CAN frame to obtain the target CAN frame.
[0013] In the embodiment of the present application, the target CAN frame is obtained by screening the initial CAN frames for CAN frames that match the preset CAN identifier, thereby reducing the system load caused by parsing the data. Furthermore, by reducing the system load caused by parsing the data, the limited vehicle-side computing power resources are more suitable for running the vehicle data parsing method on the vehicle side.
[0014] In one embodiment, the screening of CAN frames that match a preset configuration CAN identifier in the initial CAN frame includes: dynamically matching a pre-configured CAN identifier with a CAN identifier of the initial CAN frame, and screening CAN frames corresponding to the pre-configured CAN identifier; wherein the pre-configured CAN identifier is determined based on a business application; and / or dynamically matching a pre-configured CAN channel with a CAN channel of the initial CAN frame, and screening CAN frames corresponding to the pre-configured CAN channel; wherein the pre-configured CAN channel is determined based on a business application.
[0015] In an embodiment of the present application, by cleaning the initial CAN frame according to the pre-configured CAN identifier and the pre-configured CAN channel, the amount of data irrelevant to the business application (for example, 10% to 30%) can be removed, thereby reducing the system load.
[0016] In one embodiment, the initial CAN frame includes a first CAN frame and a second CAN frame; the cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: if the identifier of the first CAN frame is the same as the identifier of the second CAN frame, and the message data of the first CAN frame is the same as the message data of the second CAN frame, discarding one of the first CAN frame and the second CAN frame, retaining the other, to obtain the target CAN frame.
[0017] In the embodiment of the present application, the system load is reduced by identifying repeated CAN frames in the initial CAN frame and removing the repeated CAN frames.
[0018] In one embodiment, the performing cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: performing cleaning and filtering based on the initial CAN frame to obtain an intermediate CAN frame; and determining the target CAN frame based on the intermediate CAN frame.
[0019] In an embodiment of the present application, by cleaning and filtering the initial CAN frame to obtain the intermediate CAN frame, and determining the target CAN frame based on the intermediate CAN frame, the system load caused by parsing the data can be reduced; further, the data volume of the target CAN frame is more suitable for deployment on the vehicle side, meeting the real-time business needs of the vehicle side.
[0020] In one embodiment, determining the target CAN frame based on the intermediate CAN frame includes: if a new CAN frame is received, cleaning the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0021] In an embodiment of the present application, taking into account the characteristics of CAN signal data remaining unchanged in some time periods and the acquisition cycle of CAN frames, the received new CAN frames and intermediate CAN frames are cleaned to further reduce the system load and avoid the computing power resources occupied by parsing duplicate CAN frames. It is more suitable for the computing power resources on the vehicle side and improves the stability and accuracy of vehicle data analysis.
[0022] In one embodiment, there is a CAN frame to be compared that is continuous with the new CAN frame in the intermediate CAN frame; the cleaning of the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame includes: if the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, comparing the message data of the new CAN frame with the message data of the CAN frame to be compared; if the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, discarding the new CAN frame.
[0023] In this embodiment, considering that a new CAN frame that is consecutive to an initial CAN frame may be a duplicate of the initial CAN frame, the CAN identifiers of the two frames are first compared, followed by the message data of the two frames. This reduces the system load without missing any CAN signal data that needs to be parsed. If a large number of duplicate frames exist in the system, this embodiment removes the duplicate frames, eliminating the computing power resources required for the duplicate frames and reducing the system load.
[0024] In one embodiment, the CAN configuration file is obtained by: analyzing the DBC file to extract content data required for parsing CAN frames from the DBC file; and generating the CAN configuration file based on the extracted content data.
[0025] In the embodiments of the present application, a CAN configuration file is derived by pre-simplifying a complex DBC file. This allows the corresponding message parsing rules to be directly retrieved from the CAN configuration file when parsing CAN signal data. When a DBC file is modified, the new message parsing rules are quickly read from the CAN configuration file corresponding to the modified DBC file, eliminating the need to modify the parsing program. This eliminates the need for subsequent compilation, testing, and release processes, shortening the overall process time after the DBC file is updated.
[0026] In one embodiment, the CAN configuration file adopts a preset storage format; the reading of the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: reading the message configuration information using a data structure corresponding to the preset storage format from the CAN configuration file.
[0027] In an embodiment of the present application, the content data required for CAN parsing is read from the DBC file in a preset storage format and stored in the CAN configuration file, so that the message configuration information of the data structure corresponding to the preset storage format can be efficiently read from the configuration file, thereby realizing real-time dynamic parsing of CAN signal data.
[0028] In one embodiment, reading the message configuration information using the data structure corresponding to the preset storage format from the CAN configuration file includes:
[0029] If the CAN configuration file adopts JSON format, read the message configuration information in JSON format corresponding to the target CAN frame from the CAN configuration file; or
[0030] If the CAN configuration file adopts XML format, the message configuration information adopting markup language format corresponding to the target CAN frame is read from the CAN configuration file.
[0031] In an embodiment of the present application, the content data required for CAN parsing is read from the DBC file and a CAN configuration file in JSON format is generated accordingly, so that the message configuration information in JSON format can be efficiently read from the CAN configuration file, thereby realizing real-time dynamic parsing of CAN signal data.
[0032] In one embodiment, obtaining the CAN configuration file includes: obtaining the CAN configuration file from a vehicle-side file system.
[0033] In this embodiment of the present application, a CAN configuration file is stored in the vehicle-side file system. When CAN signal data is acquired, the CAN configuration file is retrieved from the vehicle-side file system and used to parse the CAN signal data. This parsing method is adapted to the computing power and resources of the vehicle-side, enabling on-vehicle parsing of CAN signal data. Furthermore, the CAN configuration file is a simplified version of the DBC file, which can save on-vehicle storage space.
[0034] In one embodiment, the target CAN frame carries a target CAN identifier; and the reading of the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: reading the message configuration information corresponding to the target CAN frame from the CAN configuration file according to the target CAN identifier.
[0035] In an embodiment of the present application, by reading the message configuration information corresponding to the target CAN frame from the CAN configuration file based on the target CAN identifier of the target CAN frame, and using the read message configuration information to parse the target CAN frame, real-time dynamic analysis of CAN signal data is achieved, providing a data basis for subsequent business needs.
[0036] In one embodiment, the message configuration information includes a target variable, a signal data position, an offset, and a proportional coefficient; parsing the target CAN frame based on the message configuration information to obtain vehicle signal data includes: obtaining an initial value of the target variable from the target CAN frame according to the signal data position; and calculating the initial value based on the offset and the proportional coefficient to obtain the signal data of the target variable.
[0037] In an embodiment of the present application, the target CAN frame is parsed through the target variable, signal data position, offset, and proportional coefficient in the message configuration information to obtain the signal data of the target variable. Accurate signal data can be parsed from the target CAN, which is convenient for meeting the data requirements of subsequent services.
[0038] In one embodiment, obtaining the initial CAN frame includes: obtaining the initial CAN frame through Ethernet forwarding; and / or obtaining the initial CAN frame through a CAN interface; and / or obtaining the initial CAN frame through inter-core communication.
[0039] In an embodiment of the present application, the vehicle side obtains the initial CAN frame through multiple channels, such as at least one of Ethernet forwarding, CAN interface, inter-core communication (IPCF), etc., so as to obtain the CAN signal data more comprehensively.
[0040] In one embodiment, the method further includes: receiving a new CAN configuration file when the DBC file is changed; wherein the new CAN configuration file is obtained by simplifying the changed DBC file.
[0041] In the embodiment of the present application, there is no need to modify the parsing code corresponding to the DBC file. Instead, the changed DBC file is simplified again to obtain a new CAN configuration file, and the DBC file is quickly and automatically converted to the CAN configuration file, which greatly reduces the development workload and can reduce the time consumption of the entire process to minutes.
[0042] The present application provides a vehicle data parsing device, which includes: an acquisition module for acquiring a target CAN frame and a CAN configuration file; wherein the CAN configuration file is obtained by simplifying a DBC file; a reading module for reading message configuration information corresponding to the target CAN frame from the CAN configuration file; and a parsing module for parsing the target CAN frame based on the message configuration information to obtain vehicle signal data.
[0043] The present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods described in the above embodiments when executing the computer program.
[0044] The present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method according to any one of the above embodiments is implemented.
[0045] The present application provides a vehicle, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods described above when executing the computer program.
[0046] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference numerals are used throughout the drawings to represent the same components. In the drawings:
[0048] FIG1a is an application environment diagram of the vehicle data parsing method provided in a scenario example of this specification;
[0049] FIG1b is a schematic diagram of the structure of a vehicle provided in an example scenario of this specification;
[0050] FIG2 is a flow chart of a vehicle data analysis method provided in one embodiment of this specification;
[0051] FIG3 is a flowchart of obtaining a target CAN frame provided in one embodiment of this specification;
[0052] FIG4 is a flowchart of obtaining a target CAN frame provided in another embodiment of this specification;
[0053] FIG5 is a flowchart of generating a CAN configuration file provided in one embodiment of this specification;
[0054] FIG6 is a flowchart of a vehicle data analysis method provided in another embodiment of this specification;
[0055] FIG7 a is a flowchart of acquiring a target CAN frame provided in another embodiment of this specification;
[0056] FIG7 b is a flow chart of a new CAN frame processing method provided in one embodiment of this specification;
[0057] FIG8 is a flow chart of a vehicle data parsing method provided in another embodiment of this specification;
[0058] FIG9 is a schematic diagram of a framework of a vehicle data analysis device provided in one embodiment of this specification;
[0059] FIG10 is a block diagram of a computer device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0060] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.
[0062] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.
[0063] References to "embodiments" or "implementations" herein mean that a particular feature, structure, or characteristic described in conjunction with the embodiments or implementations may be included in at least one embodiment of the present application. The appearance of such phrases in various locations in the specification does not necessarily refer to the same embodiment, nor do they constitute independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0064] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0065] In some related automotive electronic software systems, the CAN bus is a common method of communication interaction. The CAN protocol itself is unformatted, and the format definition of the data it carries is determined by the communicating parties. The DBC file defines the entire vehicle communication network. Communication nodes on the vehicle can use a unified DBC file to constrain data format, and the parsing code uses this format to parse the relevant CAN signal frames. When the DBC file is updated, the parsing code needs to be updated for the relevant communication nodes to implement the parsing of the updated DBC file. The entire process requires a series of development activities such as modifying the parsing code, using the tool chain, compiling, regression testing, and integration testing. In addition, due to modifications to the parsing code, version updates and releases are required.
[0066] In related technologies, a software program is generated offline for each DBC file to parse CAN signal data. If a DBC file is modified, the corresponding software program must also be updated. This software modification process includes code modification, compilation and integration, testing, and release. This makes the entire modification process lengthy and complex.
[0067] To simplify and shorten this change process, the present application provides a vehicle data parsing method. A complex DBC file is pre-processed to simplify the process to obtain a CAN configuration file. If the vehicle data parsing method is executed on the vehicle side, the CAN configuration file obtained by pre-processing the simplified DBC file can be stored on the vehicle side. When the vehicle side obtains a CAN frame that needs to be parsed, the message configuration information corresponding to the CAN frame is read from the CAN configuration file. The CAN frame is parsed based on the message configuration information corresponding to the CAN frame to obtain the vehicle signal data. Since the complex DBC file is pre-processed to generate a CAN configuration file, the CAN configuration file can be directly used for parsing when the CAN frame needs to be parsed. Furthermore, if the DBC file is updated, there is no need to modify the parsing code. The updated DBC file can be directly converted to a new CAN configuration file and stored on the vehicle side, so that the received CAN frames can be parsed using the new CAN configuration file. As can be seen, the present application simplifies the complex process after the DBC file is updated in the related art, and without modifying the parsing code, the simplified CAN configuration file can be used to achieve real-time dynamic parsing of CAN frames.
[0068] Please refer to Figure 1a, which is a schematic diagram of the application environment of the vehicle data parsing method provided in the scenario example of this application, including a vehicle 1000 and a PC (Personal Computer). The vehicle data parsing method can be applied to the vehicle 1000, or to other devices with the function of controlling the vehicle. The method for simplifying the DBC file can be applied to a PC or other electronic devices. Since DBC is relatively complex, it includes a large amount of network configuration information, such as channels, nodes, CAN cycles and other information. However, this information is related to the network but has nothing to do with CAN frame parsing, so the DBC file is simplified to filter out configuration information that is not related to CAN frame parsing. Specifically, the PC can analyze and process the complex information in the DBC file, extract the content data required to parse the CAN frame from the DBC file, and generate a CAN configuration file based on the extracted content data. The PC can send the CAN configuration file to the vehicle-side file system of the vehicle 1000.
[0069] Please refer to Figure 1b, which is a schematic diagram of the structure of vehicle 1000 provided in this scenario example. Vehicle 1000 can be a fuel vehicle, a gas vehicle, or a new energy vehicle. The new energy vehicle can be a pure electric vehicle, a hybrid vehicle, or an extended-range vehicle, etc. A battery 100 is installed inside vehicle 1000. Battery 100 can be installed at the bottom, head, or tail of vehicle 1000. Battery 100 can be used to power vehicle 1000. For example, battery 100 can serve as an operating power source for vehicle 1000. Vehicle 1000 may also include a controller 200 and a motor 300. Controller 200 is used to control battery 100 to power motor 300, for example, to meet the power requirements of vehicle 1000 during startup, navigation, and driving. In this scenario example, battery 100 can not only serve as the operating power source for vehicle 1000, but also as the driving power source for vehicle 1000, replacing or partially replacing fuel or natural gas to provide driving power for vehicle 1000.
[0070] In this scenario example, a CAN configuration file is pre-stored in the vehicle-side file system of vehicle 1000. The CAN configuration file is obtained by simplifying the DBC file. When vehicle 1000 receives the initial CAN frame, in order to reduce the system load caused by parsing the data, the initial CAN frame can be cleaned for the first round and the second round to obtain the target CAN frame. Specifically, the initial CAN frame is cleaned for the first round to obtain the intermediate CAN frame. The second round of cleaning is performed based on the intermediate CAN frame to obtain the target CAN frame. For example, a certain business application has a pre-configured CAN identifier and a pre-configured CAN channel. The data corresponding to the pre-configured CAN identifier and the pre-configured CAN channel are the signal data required by the business application.
[0071] In the first round of cleaning process in this example, the pre-configured CAN channel is dynamically matched with the CAN channel of the initial CAN frame, the pre-configured CAN identifier is dynamically matched with the CAN identifier of the initial CAN frame, the CAN frame corresponding to the pre-configured CAN identifier is retained, and the intermediate CAN frame is obtained.
[0072] During the second round of scrubbing in this example, after the intermediate CAN frame is buffered, if a new CAN frame is received, the identifier of the new CAN frame is compared with the identifier of the intermediate CAN frame. If the identifier of the new CAN frame is the same as the identifier of the intermediate CAN frame, the message data of the new CAN frame is compared with the message data of the intermediate CAN frame. If the message data of the new CAN frame is the same as the message data of the intermediate CAN frame, it indicates that the duplicate CAN frame identical to the new CAN frame has been parsed before, so it is no longer necessary to expend computing power to parse the new CAN frame. The vehicle parsed data of the duplicate CAN frame identical to the new CAN frame can be output as the vehicle parsed data of the new CAN frame.
[0073] In this scenario example, after data cleaning, the target CAN frame is obtained, and the target CAN frame corresponds to a CAN identifier. The CAN identifier includes a CAN channel (such as CANCHANNEL) and a CAN identifier (CANID). According to the CANCHANNEL value and CANID value of the target CAN frame, the message configuration information (CANData) corresponding to the target CAN frame is read from the CAN configuration file. The message configuration information can be understood as the definition information of the CAN signal, including the target variable (DataName), signal data position (Position_left, Position_right), offset (Offset), scale factor (Factor), and signal byte order (MotoOrlntel).
[0074] In this scenario, the vehicle data parsing method can be applied to embedded system SOC (System on Chip) chips, such as ARM A core designs. In the A core, JSON pairs can be used to record CAN information, and the CAN configuration file can be in JSON file format. An example CAN configuration file is shown below:
[0075] In this scenario example, the target variable can be understood as the signal name (DATAName). For example, the target variable can be the current current of the battery pack (PackCurrent) or the current internal voltage of the battery pack (PackInternalVoltage). The signal data position can include a start bit (Position_left) and an end bit (Position_right). The offset (Offset) can be understood as the conversion offset of the signal. The proportional coefficient (Factor) can be understood as the conversion coefficient of the signal. The byte order (Byte Order) of the signal can be Motorola (Big Endian) or Intel (Little Endian).
[0076] In this scenario, the target CAN frame is truncated based on the start and end bits to obtain the initial value of the target variable. The initial value is then calculated based on the offset and scale factor to obtain the signal data of the target variable, such as the current current value and the current internal voltage value of the battery pack.
[0077] In the above scenario example, the acquired CAN frames are parsed by using the CAN configuration file obtained by pre-simplifying the DBC file. This not only realizes the real-time dynamic parsing of the CAN frames in a new way, but also because the CAN configuration file is used to perform real-time dynamic parsing of the CAN frames, when the DBC file is updated, there is no need to modify the parsing code. Instead, the updated DBC file is quickly simplified and the new CAN configuration file can be obtained in time, thereby transforming a complex process that takes several days into a simplified process of several minutes. From days to minutes, the time spent on the entire process after the DBC file is updated can be significantly shortened.
[0078] Referring to FIG. 2 , some embodiments of the present application provide a vehicle data parsing method, which may include the following steps:
[0079] S210 , obtaining a target CAN frame and a CAN configuration file, wherein the CAN configuration file is obtained by simplifying the DBC file.
[0080] Among them, CAN frames can be data frames transmitted on the CAN network, and these data frames are used to communicate between various electronic control units (ECUs) of the vehicle, thereby realizing the coordinated operation of functions such as engine control, braking system, air conditioning system, etc. CAN frames usually include fields such as identifier, data length code, data, and check bits to ensure that information can be reliably transmitted in the network inside the vehicle. DBC (Database Can, controller area network database) files can be database files that describe data communication between communication nodes in the CAN network. The CAN configuration file can be generated based on data related to CAN signal data parsing in the DBC file, and is used to store the parsing rules of CAN signal data. The CAN configuration file is a reference for parsing CAN signal data.
[0081] Specifically, since DBC files include information such as node configuration, network configuration, CAN frame configuration, and signal attributes, parsing CAN signal data does not require all of the information in the DBC file. Therefore, the DBC file is simplified, removing information irrelevant to CAN signal data parsing while retaining the relevant information. A CAN configuration file is then generated based on this retained information.
[0082] In some embodiments, since the CAN signal data on a vehicle is diverse, the received CAN signal data can be filtered based on actual business needs to obtain a target CAN frame. For example, the required CAN frame can be pre-configured for a certain application A, so the target CAN frame can be obtained from the CAN signal data based on the pre-configured information of application A. In other embodiments, since the acquisition cycle of CAN signal data is very short, and some CAN signal data does not change within the time period corresponding to multiple consecutive acquisition cycles, a large amount of duplicate data exists in the collected CAN signal data. Therefore, the duplicate data can be cleaned from the CAN signal data to obtain the target CAN frame. Furthermore, after obtaining the target CAN frame, a pre-prepared CAN configuration file is obtained to parse the target CAN frame.
[0083] S220. Read message configuration information corresponding to the target CAN frame from the CAN configuration file.
[0084] The CAN configuration file stores message configuration information corresponding to different CAN frames. The message configuration information may include the CAN frames to be parsed and their message parsing rules. The message configuration information is used to parse the target CAN frames to provide vehicle signal data for specific business use.
[0085] Specifically, since the CAN configuration file stores message configuration information corresponding to multiple CAN frames, the message configuration information corresponding to the target CAN frame is read from the CAN configuration file. For example, the CAN configuration file can store CAN frames and message configuration information in a key-value pair format, and the corresponding key value can be searched in the CAN configuration file according to the key corresponding to the target CAN frame to obtain the message configuration information corresponding to the target CAN frame.
[0086] S230: Parse the target CAN frame based on the message configuration information to obtain vehicle signal data.
[0087] The target CAN frame can carry at least one variable. The message configuration information includes message parsing rules (or variable data information) for each variable. Specifically, since the message configuration information includes the CAN frame to be parsed and its message parsing rules, the message parsing rules included in the message configuration information are used to read the initial signal value from the target CAN frame and calculate the read initial signal value to parse the vehicle signal data corresponding to the target CAN frame. Exemplarily, the initial signal value of each variable is read from the target CAN frame and calculated according to the message parsing rules for each variable to obtain the signal value corresponding to each variable. For example, the target CAN frame includes two variables: battery pack current I and battery pack voltage U. The message configuration information includes message parsing rule A for battery pack current I and message parsing rule B for battery pack voltage U. The battery pack current I is parsed according to message parsing rule A to obtain the current value of the battery pack current I. The battery pack voltage U is parsed according to message parsing rule B to obtain the voltage value of the battery pack voltage U.
[0088] In the above embodiment, the acquired CAN frames are parsed using a CAN configuration file obtained by pre-simplifying the DBC file. This not only realizes dynamic parsing of CAN frames in a new way, but also, because the CAN configuration file is used to dynamically parse the CAN frames, when the DBC file is updated, there is no need to modify the parsing code. Instead, the updated DBC file is quickly simplified, and the new CAN configuration file can be obtained in a timely manner. This transforms a complex process that takes several days into a simplified process that takes only a few minutes, shortening the time taken from days to minutes, and significantly shortening the time taken for the entire process after the DBC file is updated. It can be understood that if this method is run on the vehicle side, it can meet the real-time business needs with high time sensitivity requirements.
[0089] In some implementations, in order to reduce the system load caused by parsing CAN signal data, it is necessary to clean the collected initial CAN frame to reduce the amount of data parsing. Specifically, referring to FIG3 , obtaining the target CAN frame includes:
[0090] S310: Acquire an initial CAN frame.
[0091] S320 , performing cleaning and filtering based on the initial CAN frame to obtain a target CAN frame.
[0092] The initial CAN frames are cleaned and filtered (one, two, or more rounds) to remove non-essential information to obtain target CAN frames. Specifically, CAN signal data can be obtained through various channels, and the CAN signal data includes several initial CAN frames. The initial CAN frames contain some redundant data and data that does not need to be parsed. Therefore, the initial CAN frames can be cleaned and filtered according to business needs to obtain the target CAN frames required by the business needs. In other embodiments, the initial CAN frames can be cleaned and filtered to remove non-essential information to obtain intermediate CAN frames. By analyzing the actual situation of the CAN signal data, it is found that the intermediate CAN frames still contain data that does not need to be parsed. Therefore, in order to further reduce the data parsing work, the intermediate CAN frames can be further cleaned and filtered to obtain the target CAN frames. It is understandable that if the initial CAN frames are cleaned and filtered for more than two rounds, the cleaning method used in each round can be different.
[0093] In the above implementation, by cleaning and filtering the initial CAN frame to obtain the target CAN frame, the system load caused by parsing the data can be reduced; further, the data volume of the target CAN frame is more suitable for deployment on the vehicle side, meeting the real-time business needs of the vehicle side.
[0094] In some implementations, performing cleaning and filtering based on the initial CAN frame to obtain the target CAN frame may include: screening the initial CAN frame for a CAN frame that matches a preset configuration CAN identifier to obtain the target CAN frame.
[0095] A preset CAN identifier can be determined based on the business application. CAN frames matching the preset CAN identifier are retained in the initial CAN frames, while CAN frames that do not match the preset CAN identifier are removed. Specifically, when the initial CAN frame is acquired, the preset CAN identifier can be used to determine the CAN identifier information of the CAN signal data required by the business application. A CAN frame corresponding to the CAN identifier information is selected from the initial CAN frames to obtain a target CAN frame.
[0096] For example, different business applications require different CAN signal data for support, and the CAN signal data required for each business application can be configured offline. The CAN signal data corresponds to a CAN identifier, so the application identifier correspondence between the business application and the CAN identifier can be configured. The application identifier correspondence is used to describe the correspondence between the application identifier of the business application and the CAN identifier. When the initial CAN frame is obtained, the application identifier of the business application APP can be used to search in the pre-configured application identifier correspondence to obtain the CAN identifier corresponding to the business application APP. The CAN frame corresponding to the found CAN identifier in the initial CAN frame is retained to obtain the target CAN frame.
[0097] In the above implementation, the target CAN frame is obtained by filtering the initial CAN frames for CAN frames that match the preset CAN identifier, thereby reducing the system load caused by parsing the data. Furthermore, by reducing the system load caused by parsing the data, the vehicle data parsing method is more suitable for the limited vehicle-side computing resources.
[0098] In some embodiments, screening the CAN frames that match the preset configuration CAN identifier in the initial CAN frame may include: using the pre-configured CAN identifier to dynamically match the CAN identifier of the initial CAN frame, and screening the CAN frames corresponding to the pre-configured CAN identifier; wherein the pre-configured CAN identifier is determined according to the business application.
[0099] Among them, the pre-configured CAN identifier is determined according to the business application. For example, the CAN signal data required by the business application can be configured offline. The CAN signal data corresponds to a CAN identifier (CANID). Different business applications require signal data with different CANIDs to support them, so the CANID can be pre-configured for different business applications. Therefore, for any business application, the initial CAN frame can be cleaned according to the pre-configured CAN identifier. Specifically, the pre-configured CAN identifier is dynamically matched with the CAN identifier of the initial CAN frame, and the initial CAN frames that are inconsistent with the pre-configured CAN identifier (such as CAN frames that are not related to the current business application or the current node) are removed, and the initial CAN frames that are consistent with the pre-configured CAN identifier are retained, that is, the CAN frames corresponding to the pre-configured CAN identifier.
[0100] In some embodiments, retaining CAN frames that match a preset configured CAN identifier in the initial CAN frame includes: dynamically matching a pre-configured CAN channel with a CAN channel of the initial CAN frame, and screening CAN frames corresponding to the pre-configured CAN channel; wherein the pre-configured CAN channel is determined based on a business application.
[0101] Among them, the pre-configured CAN channel is determined according to the business application. For example, the CAN signal data required by the business application can be configured offline. The CAN signal data corresponds to a CAN channel (CANCHANNEL). Different business applications require signal data from different CAN channels to support them. Therefore, the CAN channel can be pre-configured for different business applications. Therefore, for any business application, the initial CAN frame can be cleaned according to the pre-configured CAN channel. Specifically, the pre-configured CAN channel is used to dynamically match the CAN channel of the initial CAN frame, remove the initial CAN frame that is inconsistent with the pre-configured CAN channel (such as CAN frames that are not related to the current business application or the current node), and retain the initial CAN frame that is consistent with the pre-configured CAN channel, that is, the CAN frame corresponding to the pre-configured CAN channel.
[0102] In the above implementation, by cleaning the initial CAN frame according to the preconfigured CAN identifier and the preconfigured CAN channel, a portion of data irrelevant to the business application (eg, 10% to 30%) can be removed, thereby reducing the system load.
[0103] In some embodiments, the initial CAN frame includes a first CAN frame and a second CAN frame; performing cleaning and filtering based on the initial CAN frame to obtain a target CAN frame may include: if the identifier of the first CAN frame and the identifier of the second CAN frame are the same, and the message data of the first CAN frame and the message data of the second CAN frame are the same, discarding one of the first CAN frame and the second CAN frame to obtain the target CAN frame.
[0104] In some cases, the initial CAN frame is obtained through multiple channels, such as duplicate information received through forwarding. This can result in duplicate CAN frames in the initial CAN frame, which need to be removed. Duplicate CAN frames are CAN frames with the same CAN identifier and message data. The CAN identifier can be a CAN identifier (CANID) or a CAN channel (CANCHANNEL).
[0105] Specifically, the initial CAN frame includes a first CAN frame and a second CAN frame. The identifier of the first CAN frame and the identifier of the second CAN frame are compared. If the identifiers of the first CAN frame and the second CAN frame are the same, the message data of the first CAN frame and the message data of the second CAN frame are compared. If the message data of the first CAN frame and the message data of the second CAN frame are the same, it indicates that the first CAN frame or the second CAN frame is a duplicate CAN frame. To reduce the computing resources occupied by parsing, either the first CAN frame or the second CAN frame can be discarded, and the other can be retained to obtain the target CAN frame. It should be noted that after receiving some CAN frames, these CAN frames can also be temporarily stored while parsing these CAN frames. These CAN frames may include the first CAN frame. When the second CAN frame is received, the temporarily stored CAN frame is treated together with the second CAN frame as the initial CAN frame.
[0106] In this implementation, duplicate CAN frames within the initial CAN frame are identified and removed, thereby reducing system load. It should be noted that, compared to the computing resources required for parsing CAN frames, comparing the message data of the first CAN frame with the message data of the second CAN frame requires very little computing resources. To determine whether the message data of the first and second CAN frames are identical, simply comparing the two binary codes is sufficient, thus easily determining whether the two binary codes are identical. This reduces system load.
[0107] In some embodiments, the identifier of a first CAN frame is compared with the identifier of a second CAN frame. If the identifiers of the first CAN frame and the second CAN frame are the same, the message data of the first CAN frame and the message data of the second CAN frame are compared. If the message data of the first CAN frame and the message data of the second CAN frame are the same, it indicates that the first CAN frame or the second CAN frame is a duplicate CAN frame. Alternatively, the CAN channel of the first CAN frame and the CAN channel of the second CAN frame are compared. If the CAN channel of the first CAN frame and the CAN channel of the second CAN frame are the same, the message data of the first CAN frame and the message data of the second CAN frame are compared. If the message data of the first CAN frame and the message data of the second CAN frame are the same, it indicates that the first CAN frame or the second CAN frame is a duplicate CAN frame.
[0108] In other embodiments, the CAN channel of the first CAN frame and the CAN channel of the second CAN frame, as well as the identifier of the first CAN frame and the identifier of the second CAN frame, are compared. If the CAN channel of the first CAN frame and the CAN channel of the second CAN frame are the same and the identifier of the first CAN frame and the identifier of the second CAN frame are the same, the message data of the first CAN frame and the message data of the second CAN frame are compared. If the message data of the first CAN frame and the message data of the second CAN frame are the same, it indicates that the first CAN frame or the second CAN frame is a duplicate CAN frame.
[0109] In some implementations, cleaning and filtering are performed based on the initial CAN frame to obtain a target CAN frame, including: if a new CAN frame is received, cleaning the new CAN frame and the initial CAN frame according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0110] In some cases, if some of the vehicle's signal data remains unchanged for a period of time, the collected CAN frame message data is repeated. For example, the battery temperature remains unchanged for a period of several hundred milliseconds, and the CAN signal acquisition period can be 5 milliseconds or 10 milliseconds. In this case, the CAN frame message data acquired within this period of several hundred milliseconds may be identical. Since parsing duplicate CAN frames consumes a certain amount of computing power and resources and is unnecessary, it is necessary to clean the new CAN frames and intermediate CAN frames. Comparing the message data of CAN frames is relatively simple. For example, it is only necessary to compare two strings of binary code to easily determine whether the two strings of binary code are the same, thereby reducing the system load.
[0111] Specifically, after receiving the initial CAN frame, it is stored. Subsequently, when a new CAN frame is received, the CAN identifier of the new CAN frame is determined. The CAN identifier of the new CAN frame is compared with the identifier of the stored initial CAN frame. If the two differ, no processing is performed. If they are the same, further confirmation is required to determine whether the message data of the two is identical. Therefore, the new CAN frame and the initial CAN frame are cleaned based on the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0112] If there is a CAN frame to be compared that is continuous with the new CAN frame in the initial CAN frame, refer to Figure 4, and clean the new CAN frame and the initial CAN frame according to the CAN identifier and message data of the new CAN frame, which may include:
[0113] S410 : If the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, compare the message data of the new CAN frame with the message data of the CAN frame to be compared.
[0114] S420: If the message data of the new CAN frame is identical to the message data of the CAN frame to be compared, discard the new CAN frame.
[0115] The initial CAN frame is received and stored. Subsequently, new CAN frames are received that are temporally continuous with some of the CAN frames in the initial CAN frame. Therefore, the initial CAN frame contains CAN frames that are continuous with the new CAN frame and are to be compared. As previously mentioned, since the message data of the collected CAN frames may be duplicated and parsing of duplicate CAN frames is unnecessary, the new CAN frames and intermediate CAN frames are cleaned based on their CAN identifiers and message data.
[0116] Specifically, the CAN identifier of the CAN frame to be compared is first compared with the CAN identifier of the new CAN frame. If the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, it indicates that the new CAN frame may be a duplicate of the CAN frame to be compared in the initial CAN frame. Next, the message data of the new CAN frame is compared with the message data of the CAN frame to be compared. If the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, it indicates that the new CAN frame is a duplicate of the CAN frame to be compared in the initial CAN frame. There is no need to expend computing resources to parse the new CAN frame again, so the new CAN frame is discarded. It is understandable that although the new CAN frame is discarded, the parsing result of the CAN frame to be compared can be used as the parsing result of the new CAN frame in the subsequent parsing process.
[0117] In one example, the identifier of the CAN frame to be compared is compared with the identifier of the new CAN frame. If the identifiers are identical, the message data of the CAN frame to be compared is compared with the message data of the new CAN frame. If the message data are identical, the CAN frame to be compared and the new CAN frame are duplicate CAN frames. Alternatively, the CAN channel of the CAN frame to be compared is compared with the CAN channel of the new CAN frame. If the CAN channels are identical, the message data of the CAN frame to be compared and the message data of the new CAN frame are compared. If the message data are identical, the CAN frame to be compared and the new CAN frame are duplicate CAN frames.
[0118] In another example, the CAN channel of the CAN frame to be compared and the CAN channel of the new CAN frame, as well as the identifier of the CAN frame to be compared and the identifier of the new CAN frame are compared. If the channels and identifiers of the two are the same, the message data of the two are compared. If the message data of the two are the same, it indicates that the CAN frame to be compared and the new CAN frame are duplicate CAN frames.
[0119] It should be noted that if the message data of the new CAN frame is different from the message data of the CAN frame to be compared, it indicates that the new CAN frame is to be parsed, and the new CAN frame is retained.
[0120] In the above implementation, considering that a new CAN frame that is consecutive to an initial CAN frame may be a duplicate of the initial CAN frame, the CAN identifiers of the two frames are first compared, followed by the message data. This reduces the system load without missing any CAN signal data that needs to be parsed. If a large number of duplicate frames exist in the system, this implementation removes the duplicate frames, eliminating the computational resources required to parse the duplicate frames and thus reducing the system load.
[0121] In some implementations, to shorten the time required for the entire process after a DBC file update, the collected CAN signal data is parsed using a CAN configuration file. If the DBC file changes, the DBC file can be quickly simplified into a CAN configuration file without modifying the parsing program. Specifically, referring to Figure 5, the CAN configuration file is obtained as follows:
[0122] S510: Analyze the DBC file to extract content data required for parsing the CAN frame from the DBC file.
[0123] S520: Generate a CAN configuration file based on the extracted content data.
[0124] DBC files contain a large amount of information, including node configuration, network configuration, CAN frame configuration, and signal attributes. For CAN signal data parsing, node configuration and network configuration are irrelevant, while CAN frame configuration and signal attributes are relevant. Therefore, it is necessary to remove information such as node configuration and network configuration, while retaining information such as CAN frame configuration and signal attributes. This information is then used to generate a CAN configuration file.
[0125] Specifically, since the DBC file includes a large amount of configuration information, the configuration information included in the DBC file is disassembled and analyzed one by one, and the content data required for parsing the CAN frame (such as CAN frame configuration, signal attributes, etc.) is extracted therefrom. The extracted content data is stored according to a preset configuration file format, and a CAN configuration file is generated, so that the CAN signal data can be dynamically parsed in real time in a flexible manner through the CAN configuration file. For example, Python can be used to write a script code, and the encoded script code can be used to analyze and disassemble all the configuration information in the DBC file, extract the content data required for parsing the CAN information, and generate a corresponding JSON configuration file. For example, please refer to Table 1, which shows the content data extracted from the DBC file.
[0126] Table 1
[0127] It can be seen that the content data extracted from the DBC file includes the CAN identifier (CANID), CAN channel (CANCHANNEL), number of data bytes (CANLEN), target variable (DataName), data position (Position Info), scale factor (Factor), offset (Offset), and signal byte order (MotorOrIntel).
[0128] In the above implementation, by pre-simplifying a complex DBC file to obtain a CAN configuration file, the corresponding message parsing rules can be directly retrieved from the CAN configuration file when parsing CAN signal data. When the DBC file changes, the new message parsing rules are quickly read from the CAN configuration file corresponding to the changed DBC file, eliminating the need to modify the parsing program. This eliminates the need for subsequent compilation, testing, and release processes, shortening the overall process time required after the DBC file is updated.
[0129] In some implementations, the CAN configuration file uses a preset storage format. Reading the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: reading the message configuration information using a data structure corresponding to the preset storage format from the CAN configuration file.
[0130] The preset configuration file format can be any of JSON, XML, and ini. Specifically, the content data required for CAN parsing is extracted from the DBC file and stored in a preset storage format to obtain a CAN configuration file. The preset storage format corresponds to a preset data structure. When a target CAN frame is acquired, message configuration information using the preset data structure is read from the CAN configuration file based on the identification information of the target CAN frame to parse the target CAN frame.
[0131] In the above embodiment, the content data required for CAN parsing is read from the DBC file in a preset storage format and stored in the CAN configuration file, so that the message configuration information of the data structure corresponding to the preset storage format can be efficiently read from the configuration file, thereby realizing real-time dynamic parsing of CAN signal data.
[0132] In some embodiments, message configuration information using a data structure corresponding to a preset storage format is read from a CAN configuration file, including: if the CAN configuration file uses a JSON format, reading message configuration information using a JSON format corresponding to a target CAN frame from the CAN configuration file; or, if the CAN configuration file uses an XML format, reading message configuration information using a markup language format corresponding to the target CAN frame from the CAN configuration file.
[0133] Among them, JSON (JavaScript Object Notation) is a lightweight data exchange format, commonly used to transmit and store data between different applications. If the CAN configuration file adopts the JSON format, the data in the CAN configuration file exists in the JSON pair format. XML stands for Extensible Markup Language, which is a markup language used to describe and transmit data. XML can be used to mark the structure of data. The basic grammatical structure of XML consists of a start tag, an end tag, and the content between them. If the CAN configuration file adopts the XML format, the data in the CAN configuration file exists in the markup language format. Specifically, if the CAN configuration file adopts the JSON format, the message configuration information in the JSON pair format is read from the CAN configuration file according to the identification information of the target CAN frame for parsing the target CAN frame. If the CAN configuration file adopts the XML format, the message configuration information in the markup language format is read from the CAN configuration file according to the identification information of the target CAN frame for parsing the target CAN frame.
[0134] In the above implementation, the content data required for CAN parsing is read from the DBC file and a CAN configuration file in JSON format is generated accordingly, so that the message configuration information in JSON format can be efficiently read from the CAN configuration file, thereby realizing real-time dynamic parsing of CAN signal data.
[0135] In some implementations, obtaining the CAN configuration file includes: obtaining the CAN configuration file from a vehicle-side file system.
[0136] In some cases, a communication connection is established between the vehicle and a cloud server to transmit vehicle-side information such as vehicle status, location, and driving data to the cloud server, enabling the cloud server to provide corresponding information services. Because transmitting vehicle-collected data to the cloud server incurs a latency of seconds, some real-time services require local vehicle data to be parsed and processed in real time on the vehicle rather than transmitted to the cloud server for analysis and processing. Therefore, real-time dynamic analysis of vehicle data is also necessary in vehicle-side software development.
[0137] Furthermore, cloud servers have sufficient computing power and resources to perform vehicle data analysis tasks, but vehicles have very limited computing power and resources. Therefore, the vehicle data analysis methods implemented on cloud servers in related technologies are no longer applicable to vehicle-side software, so a new vehicle data analysis method specifically for the vehicle side is needed.
[0138] Specifically, the DBC file is simplified to obtain a CAN configuration file, which is pre-stored in the vehicle's on-board file system. After obtaining the target CAN frame, the pre-stored CAN configuration file is read from the on-board file system, and the message configuration information corresponding to the target CAN frame is read from the CAN configuration file. The target CAN frame is then parsed using the message configuration information to obtain vehicle signal data.
[0139] In the above implementation, the CAN configuration file is stored in the vehicle-side file system. When CAN signal data is acquired, the CAN configuration file is retrieved from the vehicle-side file system and used to parse the CAN signal data. This parsing method is adapted to the vehicle-side computing power and resources, enabling on-vehicle parsing of CAN signal data. Furthermore, the CAN configuration file is a simplified version of the DBC file, which can save on-vehicle storage space.
[0140] This example illustrates that the vehicle data parsing method implemented on the cloud server is no longer applicable to the vehicle-side software. In the related art, a CAN data acquisition requirement file is formulated according to the business data requirements, which indicates the information of the CAN signal required for business acquisition. The CAN data acquisition requirement file is usually in Excel format, and the CAN data acquisition requirement file in Excel format is uploaded to the CAN parsing configuration management platform. If the vehicle data parsing method is executed on the vehicle side, the parsing code that implements the vehicle data parsing method needs to be deployed in a chip with extremely limited computing power, such as an embedded SOC chip, which can be designed with an ARM A core. It is understandable that the CAN data acquisition requirement file in Excel format in the related art is not applicable to vehicle-side chips (such as embedded SOC chips). Therefore, according to the type of vehicle-side chip running the vehicle data parsing method, the preset storage format of the CAN configuration file (such as JSON or XML) is determined, the content data required for CAN parsing is extracted from the DBC file, the extracted content data is stored, and a CAN configuration file in JSON format or XML format is obtained.
[0141] In some implementations, the target CAN frame carries a target CAN identifier. Reading the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: reading the message configuration information corresponding to the target CAN frame from the CAN configuration file according to the target CAN identifier.
[0142] The CAN frame has a CAN identifier, which can be a CAN identifier (CANID) or a CAN channel (CANCHANNEL). The target CAN frame carries a target CAN identifier, which can be a CANCHANNEL value of the target CAN frame or a CANID value of the target CAN frame.
[0143] Specifically, in some embodiments, the CAN configuration file may store a correspondence between the CANID and the message configuration information. The message configuration information (CANData) corresponding to the target CAN frame may be obtained by searching the CAN configuration file according to the CANID value of the target CAN frame.
[0144] In some other embodiments, the CAN configuration file may store the correspondence between the CAN channel and the message configuration information. The message configuration information corresponding to the target CAN frame may be obtained by searching the CAN configuration file according to the CANCHANNEL value of the target CAN frame.
[0145] In other embodiments, the CAN configuration file may store the correspondence between the CAN channel, the CAN identifier, and the message configuration information. The message configuration information corresponding to the target CAN frame may be obtained by searching the CAN configuration file based on the CANCHANNEL value and / or CANID value of the target CAN frame.
[0146] In the above implementation, by reading the message configuration information corresponding to the target CAN frame from the CAN configuration file according to the target CAN identifier of the target CAN frame, and using the read message configuration information to parse the target CAN frame, real-time dynamic analysis of CAN signal data is achieved, providing a data basis for subsequent business needs.
[0147] In some embodiments, the message configuration information includes a target variable, a signal data location, an offset, and a scale factor. Referring to FIG6 , the target CAN frame is parsed based on the message configuration information to obtain vehicle signal data, including:
[0148] S610 . Obtain an initial value of a target variable from a target CAN frame according to the signal data position.
[0149] S620: Calculate the initial value based on the offset and the proportional coefficient to obtain signal data of the target variable.
[0150] Specifically, when the target CAN frame needs to be parsed, the message configuration information corresponding to the target CAN frame is read from the CAN configuration file according to the target CAN identifier of the target CAN frame. Because the message configuration information contains the target variable, signal data position, offset, and proportional coefficient, the initial data of the target variable is first truncated from the target CAN frame according to the signal data position to obtain the initial value of the target variable. The initial value is then calculated using the offset and proportional coefficient to obtain the actual physical value of the target variable, that is, the signal data of the target variable. Exemplarily, the actual physical value V of the target variable can be calculated using the following formula: V = V0*Factor+Offset
[0151] Among them, V0 is the initial value of the target variable, Factor is the proportional coefficient, and Offset is the offset.
[0152] In the above implementation, the target CAN frame is parsed through the target variable, signal data position, offset, and proportional coefficient in the message configuration information to obtain the signal data of the target variable. Accurate signal data can be parsed from the target CAN, which is convenient for meeting the data requirements of subsequent services.
[0153] In some implementations, in order to reduce the system load caused by parsing CAN signal data, it is necessary to clean the initial CAN frame to reduce the amount of data parsing. Specifically, referring to FIG. 7 a , the target CAN frame is obtained by:
[0154] S710a: Acquire an initial CAN frame.
[0155] S720a: Clean and filter the initial CAN frame to obtain an intermediate CAN frame.
[0156] S730a: Determine the target CAN frame based on the intermediate CAN frame.
[0157] Specifically, CAN signal data can be acquired through various channels, including several initial CAN frames. These initial CAN frames contain some redundant data and data that does not require parsing. Therefore, these initial CAN frames can be cleaned and filtered based on business requirements to obtain the required intermediate CAN frames. Analysis of the actual CAN signal data reveals that the cleaned and filtered intermediate CAN frames still contain data that does not require parsing. Therefore, to further reduce data parsing work, these intermediate CAN frames can be further cleaned and filtered to obtain the target CAN frames.
[0158] Exemplarily, after the initial CAN frame is cleaned and filtered for the first time using the CAN identification information, an intermediate CAN frame is obtained and stored. The intermediate CAN frame can be cleaned and filtered for the second time to obtain the target CAN frame. For example, when a new CAN frame is received, the CAN identifier of the new CAN frame is determined. The CAN identifier of the new CAN frame is compared with the identifier of the stored intermediate CAN frame. If the two are different, no processing is performed; if the two are the same, it is necessary to further confirm whether the message data of the two are the same. Therefore, the new CAN frame and the intermediate CAN frame are cleaned according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame. It should be noted that if the vehicle data parsing method in this embodiment is run on the vehicle side, the computing power and resources of the vehicle side are limited, and it is even more necessary to reduce the system load caused by parsing the data. Therefore, the initial CAN frame is cleaned and filtered (once or twice) to obtain the target CAN frame.
[0159] In the above implementation, by cleaning and filtering the initial CAN frame to obtain the intermediate CAN frame, the amount of data irrelevant to the business application (eg, 10% to 30%) can be removed, thereby reducing the system load.
[0160] In some embodiments, determining the target CAN frame based on the intermediate CAN frame includes: if a new CAN frame is received, cleaning the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0161] Specifically, the initial CAN frame is cleaned and filtered to obtain and store intermediate CAN frames. Subsequently, when a new CAN frame is received, its CAN identifier is determined. The CAN identifier of the new CAN frame is compared with the identifier of the stored intermediate CAN frame. If the two are different, no processing is performed. If they are the same, further verification is required to confirm the identity of the message data. Therefore, the new CAN frame and the intermediate CAN frame are cleaned based on the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0162] In the above implementation, taking into account the characteristics of CAN signal data remaining unchanged in some time periods and the acquisition cycle of CAN frames, the received new CAN frames and intermediate CAN frames are cleaned to further reduce the system load and release the computing power resources occupied by parsing repeated CAN frames. It is more suitable for the computing power resources on the vehicle side and improves the stability and accuracy of vehicle data analysis.
[0163] In some embodiments, there are CAN frames to be compared that are continuous with the new CAN frame in the intermediate CAN frame. Referring to FIG. 7 b , cleaning the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame may include:
[0164] S710b: If the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, compare the message data of the new CAN frame with the message data of the CAN frame to be compared.
[0165] S720b: If the message data of the new CAN frame is identical to the message data of the CAN frame to be compared, the new CAN frame is discarded.
[0166] The initial CAN frame is cleaned and filtered to obtain and store intermediate CAN frames. New CAN frames received subsequently are temporally continuous with some of the intermediate CAN frames. Therefore, the intermediate CAN frames contain CAN frames that are continuous with the new CAN frame and need to be compared. As previously mentioned, since the message data of the collected CAN frames may be duplicated and parsing of duplicate CAN frames is unnecessary, the new CAN frames and intermediate CAN frames are cleaned based on their CAN identifiers.
[0167] Specifically, the CAN identifier of the CAN frame to be compared is first compared with the CAN identifier of the new CAN frame. If the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, it indicates that the new CAN frame may be a duplicate of the CAN frame to be compared in the intermediate CAN frame. Next, the message data of the new CAN frame is compared with the message data of the CAN frame to be compared. If the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, it indicates that the new CAN frame is a duplicate of the CAN frame to be compared in the intermediate CAN frame. There is no need to expend computing resources to parse the new CAN frame again, so the new CAN frame is discarded. It should be noted that if the message data of the new CAN frame is different from the message data of the CAN frame to be compared, it indicates that the new CAN frame needs to be parsed and the new CAN frame is retained.
[0168] It should be noted that compared with the computing resources occupied by parsing the CAN frame, the computing resources occupied by comparing the message data of the CAN frame to be compared with the message data of the new CAN frame are very small. To compare whether the message data of the CAN frame to be compared and the message data of the new CAN frame are the same, it is only necessary to compare the two strings of binary codes. It can be very easy to determine whether the two strings of binary codes are the same, thereby reducing the system load.
[0169] In the above implementation, considering that a new CAN frame that is consecutive to an intermediate CAN frame may be a duplicate of an intermediate CAN frame, the CAN identifiers of the two frames are first compared, followed by the message data. This reduces system load without missing any CAN signal data that needs to be parsed. If a large number of duplicate frames exist in the system, this implementation removes them, eliminating the computational resources required to process duplicate frames and reducing system load.
[0170] In some embodiments, obtaining the initial CAN frame includes: obtaining the initial CAN frame through Ethernet forwarding; and / or obtaining the initial CAN frame through a CAN interface; and / or obtaining the initial CAN frame through inter-core communication.
[0171] In the above embodiment, the vehicle side obtains the initial CAN frame through multiple channels, such as at least one of Ethernet forwarding, CAN interface, inter-core communication (IPCF), etc., to receive the initial CAN frame, so as to obtain CAN signal data more comprehensively.
[0172] In some embodiments, the method may further include: receiving a new CAN configuration file when the DBC file is changed, wherein the new CAN configuration file is obtained by simplifying the changed DBC file.
[0173] Specifically, if the DBC file is changed, in order to accurately parse the CAN signal data, the corresponding CAN configuration file needs to be updated in a timely manner. Therefore, the changed DBC file is simplified again to obtain a new CAN configuration file.
[0174] In some implementations, a new CAN configuration file can be sent to the vehicle, which receives the new CAN configuration file and stores it in the vehicle's file system. Subsequently, when receiving CAN signal data, the new CAN configuration file is retrieved from the vehicle's file system and parsed using the new CAN configuration file.
[0175] In related technologies, changes to DBC files require modifying the corresponding parsing code and going through the compilation, testing, and release processes. However, this implementation eliminates the need to modify the corresponding parsing code. Instead, the modified DBC file is simplified and reprocessed to generate a new CAN configuration file, quickly and automatically converting the DBC file to a CAN configuration file. Consequently, the subsequent compilation, testing, and release processes are no longer necessary, significantly reducing development workload and reducing the overall process time to minutes.
[0176] The embodiment of this specification provides a vehicle data analysis method, which is applied to the vehicle side. Referring to Figure 8, the vehicle data analysis method includes the following steps:
[0177] S802, obtaining an initial CAN frame;
[0178] Specifically, the initial CAN frame is obtained by Ethernet forwarding; and / or, the initial CAN frame is obtained through a CAN interface; and / or, the initial CAN frame is obtained through inter-core communication.
[0179] S804: Clean and filter the initial CAN frame to obtain and store the intermediate CAN frame;
[0180] Specifically, a pre-configured CAN identifier is dynamically matched with a CAN identifier of an initial CAN frame to obtain an intermediate CAN frame corresponding to the pre-configured CAN identifier; wherein the pre-configured CAN identifier is determined according to a business application; and / or a pre-configured CAN channel is dynamically matched with a CAN channel of an initial CAN frame to obtain an intermediate CAN frame corresponding to the pre-configured CAN channel; wherein the pre-configured CAN channel is determined according to a business application; and / or CAN frames with the same CAN identifier are removed from the initial CAN frame to obtain the intermediate CAN frames.
[0181] S806: If a new CAN frame is received, clean the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame to obtain a target CAN frame.
[0182] Specifically, there is a CAN frame to be compared that is continuous with the new CAN frame in the intermediate CAN frame; if the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, compare the message data of the new CAN frame with the message data of the CAN frame to be compared; if the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, discard the new CAN frame.
[0183] S808. Obtain a CAN configuration file from the vehicle-side file system.
[0184] The CAN configuration file is obtained by simplifying the DBC file and is in JSON format. Specifically, the DBC file is analyzed to extract the content data required for parsing the CAN frame; based on the extracted content data, the CAN configuration file in JSON format is generated.
[0185] S810. Read message configuration information corresponding to the target CAN frame from the CAN configuration file.
[0186] Wherein, the CAN configuration file adopts JSON format, and the message configuration information in the CAN configuration file adopts JSON pair format. Specifically, since the target CAN frame has a target CAN identifier, the message configuration information in JSON pair format corresponding to the target CAN frame is read from the CAN configuration file according to the target CAN identifier of the target CAN frame.
[0187] S812: Parse the target CAN frame based on the message configuration information to obtain vehicle signal data.
[0188] The message configuration information includes the target variable, signal data location, offset, and scaling factor. Specifically, the initial value of the target variable is obtained from the target CAN frame based on the signal data location. The initial value is calculated based on the offset and scaling factor to obtain the signal data of the target variable.
[0189] S814. When the DBC file is changed, a new CAN configuration file is received and stored in the vehicle-side file system.
[0190] The new CAN configuration file is obtained by simplifying the changed DBC file. Specifically, after the DBC file is changed, if a new target CAN frame is received, the new CAN configuration file is used to parse the new target CAN frame to obtain the corresponding vehicle signal data.
[0191] In the above implementation, on the one hand, the initial CAN frame is cleaned for the first time to obtain the intermediate CAN frame, which can reduce the system load by about 10% to 30%. If a new CAN frame is received, the new CAN frame and the intermediate CAN frame are cleaned for the second time according to the CAN identifier and message data of the new CAN frame, which can reduce the system load by about 40%. On the other hand, the complex DBC file is analyzed to generate the CAN configuration file required for CAN frame parsing, and it is pre-stored in the vehicle-side file system. The above two aspects realize real-time dynamic parsing of vehicle-side CAN data.
[0192] The embodiment of this specification provides a vehicle data analysis device. Please refer to FIG. 9 . The vehicle data analysis device 900 includes: an acquisition module 910 , a reading module 920 , and a analysis module 930 .
[0193] The acquisition module 910 is used to acquire a target CAN frame and a CAN configuration file; wherein the CAN configuration file is obtained by simplifying the DBC file;
[0194] A reading module 920 is configured to read message configuration information corresponding to the target CAN frame from the CAN configuration file;
[0195] The parsing module 930 is configured to parse the target CAN frame based on the message configuration information to obtain vehicle signal data.
[0196] In some implementations, the acquisition module 910 is further configured to acquire an initial CAN frame; and perform cleaning and filtering based on the initial CAN frame to obtain the target CAN frame.
[0197] In some implementations, the acquisition module 910 is further configured to filter the initial CAN frames for CAN frames that match a preset configuration CAN identifier to obtain the target CAN frame.
[0198] In some embodiments, the acquisition module 910 is further used to dynamically match a pre-configured CAN identifier with the CAN identifier of the initial CAN frame, and filter the CAN frame corresponding to the pre-configured CAN identifier; wherein the pre-configured CAN identifier is determined based on the business application; and / or, dynamically match a pre-configured CAN channel with the CAN channel of the initial CAN frame, and filter the CAN frame corresponding to the pre-configured CAN channel; wherein the pre-configured CAN channel is determined based on the business application.
[0199] In some embodiments, the initial CAN frame includes a first CAN frame and a second CAN frame; the acquisition module 910 is also used to discard one of the first CAN frame and the second CAN frame and retain the other if the identifier of the first CAN frame is the same as the identifier of the second CAN frame, and the message data of the first CAN frame is the same as the message data of the second CAN frame, to obtain the target CAN frame.
[0200] In some implementations, the acquisition module 910 is further configured to, if a new CAN frame is received, clean the new CAN frame and the initial CAN frame according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0201] In some embodiments, there is a CAN frame to be compared that is continuous with the new CAN frame in the initial CAN frame; the acquisition module 910 is also used to compare the message data of the new CAN frame with the message data of the CAN frame to be compared if the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame; if the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, discard the new CAN frame.
[0202] In some implementations, the acquisition module 910 is further configured to perform cleaning and filtering based on the initial CAN frame to obtain an intermediate CAN frame; and determine the target CAN frame based on the intermediate CAN frame.
[0203] In some implementations, the acquisition module 910 is further configured to, if a new CAN frame is received, clean the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame.
[0204] In some embodiments, there is a CAN frame to be compared that is continuous with the new CAN frame in the intermediate CAN frame; the acquisition module 910 is also used to compare the message data of the new CAN frame with the message data of the CAN frame to be compared if the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame; if the message data of the new CAN frame is the same as the message data of the CAN frame to be compared, discard the new CAN frame.
[0205] In some implementations, the CAN configuration file is obtained by: analyzing the DBC file to extract content data required for parsing CAN frames from the DBC file; and generating the CAN configuration file based on the extracted content data.
[0206] In some implementations, the CAN configuration file adopts a preset storage format; the reading module 920 is further configured to read message configuration information in a data structure corresponding to the preset storage format from the CAN configuration file.
[0207] In some embodiments, the reading module 920 is further used to read the message configuration information in the JSON format corresponding to the target CAN frame from the CAN configuration file if the CAN configuration file adopts the JSON format; or, if the CAN configuration file adopts the XML format, read the message configuration information in the markup language format corresponding to the target CAN frame from the CAN configuration file.
[0208] In some implementations, the acquisition module 910 is further configured to acquire the CAN configuration file from a vehicle-side file system.
[0209] In some implementations, the target CAN frame carries a target CAN identifier; the reading module 920 is further configured to read the message configuration information corresponding to the target CAN frame from the CAN configuration file according to the target CAN identifier.
[0210] In some embodiments, the message configuration information includes a target variable, a signal data position, an offset, and a proportional coefficient; the parsing module 930 is further used to obtain an initial value of the target variable from the target CAN frame based on the signal data position; and calculate the initial value based on the offset and the proportional coefficient to obtain the signal data of the target variable.
[0211] In some embodiments, the acquisition module 910 is further configured to acquire the initial CAN frame via Ethernet forwarding; and / or, acquire the initial CAN frame via a CAN interface; and / or, acquire the initial CAN frame via inter-core communication.
[0212] In some embodiments, the vehicle data analysis device 900 further includes a configuration file receiving module for receiving a new CAN configuration file and storing it in the vehicle-side file system when the DBC file changes; wherein the new CAN configuration file is obtained by simplifying the changed DBC file.
[0213] It should be noted that, for the description of the vehicle data analysis device in the implementation manner of this specification, please refer to the description of the vehicle data analysis method in this specification, and the details will not be repeated here.
[0214] An embodiment of this specification provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the method described in any of the above embodiments is implemented.
[0215] In some embodiments, a computer device is provided, and its internal structure diagram can be shown in Figure 10. The electronic device includes a processor, a memory, and a communication interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores a computer program. The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the method in any of the above embodiments is implemented.
[0216] Those skilled in the art will understand that the structure shown in Figure 10 is merely a block diagram of a partial structure related to the solution disclosed in this specification, and does not constitute a limitation on the electronic device to which the solution disclosed in this specification is applied. Specifically, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0217] An embodiment of this specification provides an electronic device, including: a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the method described in any of the above embodiments is implemented.
[0218] The embodiments of this specification also provide a computer program product, which includes instructions. The instructions can be executed by a processor of an electronic device to implement the method steps in the above embodiments.
[0219] It should be noted that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0220] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0221] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. A vehicle data analysis method, wherein: The method comprises: Obtain a target CAN frame and a CAN configuration file; wherein the CAN configuration file is obtained by simplifying the DBC file; Reading message configuration information corresponding to the target CAN frame from the CAN configuration file; The target CAN frame is parsed based on the message configuration information to obtain vehicle signal data.
2. The method according to claim 1, wherein: The step of acquiring the target CAN frame comprises: Get the initial CAN frame; Cleaning and filtering are performed based on the initial CAN frame to obtain the target CAN frame.
3. The method according to claim 2, wherein: The cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: The CAN frames matching the preset configuration CAN identifier are screened in the initial CAN frames to obtain the target CAN frames.
4. The method according to claim 3, wherein: The screening of CAN frames matching the preset configuration CAN identifier in the initial CAN frame includes: Dynamically matching a preconfigured CAN identifier with the CAN identifier of the initial CAN frame to screen a CAN frame corresponding to the preconfigured CAN identifier; wherein the preconfigured CAN identifier is determined according to a business application; and / or The pre-configured CAN channel is dynamically matched with the CAN channel of the initial CAN frame to filter the CAN frame corresponding to the pre-configured CAN channel; wherein the pre-configured CAN channel is determined according to the business application.
5. The method according to claim 2, wherein: The initial CAN frame includes a first CAN frame and a second CAN frame; The cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: If the identifier of the first CAN frame is the same as the identifier of the second CAN frame, and the message data of the first CAN frame is the same as the message data of the second CAN frame, one of the first CAN frame and the second CAN frame is discarded and the other is retained to obtain the target CAN frame; preferably, the identifier is a CAN identifier or a CAN channel.
6. The method according to claim 2, wherein: The cleaning and filtering based on the initial CAN frame to obtain the target CAN frame includes: Perform cleaning and filtering based on the initial CAN frame to obtain an intermediate CAN frame; The target CAN frame is determined based on the intermediate CAN frame.
7. The method according to claim 6, wherein: The determining the target CAN frame based on the intermediate CAN frame comprises: If a new CAN frame is received, the new CAN frame and the intermediate CAN frame are cleaned according to the CAN identifier and message data of the new CAN frame to obtain the target CAN frame; preferably, the identifier is a CAN identifier or a CAN channel.
8. The method according to claim 7, wherein: There is a CAN frame to be compared that is continuous with the new CAN frame in the intermediate CAN frame; The cleaning of the new CAN frame and the intermediate CAN frame according to the CAN identifier and message data of the new CAN frame includes: If the CAN identifier of the CAN frame to be compared is the same as the CAN identifier of the new CAN frame, comparing the message data of the new CAN frame with the message data of the CAN frame to be compared; If the message data of the new CAN frame is identical to the message data of the CAN frame to be compared, the new CAN frame is discarded.
9. The method according to any one of claims 1 to 8, wherein: The CAN configuration file is obtained in the following way: Analyzing the DBC file to extract content data required for parsing the CAN frame from the DBC file; The CAN configuration file is generated based on the extracted content data.
10. The method according to any one of claims 1 to 9, wherein: The CAN configuration file adopts a preset storage format; the reading of the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: Message configuration information using a data structure corresponding to the preset storage format is read from the CAN configuration file.
11. The method according to claim 10, wherein: Reading message configuration information using a data structure corresponding to the preset storage format from the CAN configuration file includes: If the CAN configuration file adopts the JSON format, read the message configuration information in the JSON format corresponding to the target CAN frame from the CAN configuration file; or If the CAN configuration file adopts XML format, the message configuration information in markup language format corresponding to the target CAN frame is read from the CAN configuration file.
12. The method according to any one of claims 1 to 11, wherein: Obtaining a CAN configuration file includes: obtaining the CAN configuration file from a vehicle-side file system.
13. The method according to any one of claims 1 to 9, wherein: The target CAN frame carries a target CAN identifier; The step of reading the message configuration information corresponding to the target CAN frame from the CAN configuration file includes: According to the target CAN identifier, the message configuration information corresponding to the target CAN frame is read from the CAN configuration file.
14. The method according to any one of claims 2 to 8, wherein: Get the initial CAN frame, including: Acquire the initial CAN frame by forwarding through Ethernet; and / or Acquire the initial CAN frame via a CAN interface; and / or The initial CAN frame is obtained by means of inter-core communication.
15. The method according to any one of claims 1 to 14, wherein: The method further comprises: When the DBC file is changed, a new CAN configuration file is received; wherein the new CAN configuration file is obtained by simplifying the changed DBC file.
16. A vehicle data analysis device, wherein: The device comprises: An acquisition module is used to acquire a target CAN frame and a CAN configuration file; wherein the CAN configuration file is obtained by simplifying the DBC file; A reading module, used for reading the message configuration information corresponding to the target CAN frame from the CAN configuration file; The parsing module is used to parse the target CAN frame based on the message configuration information to obtain vehicle signal data.
17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 15 is implemented.
18. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
19. A vehicle comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 15 is implemented.
Citation Information
Patent Citations
Automobile CAN data automatic analysis method and system, computer readable storage medium and electronic equipment
CN114979314A
Vehicle data acquisition method based on data distribution service
CN115277886A
Vehicle data analysis method and device, computer equipment, storage medium and vehicle
CN117812171A
Driverless vehicle control method, apparatus and system
US20170344005A1