Big data packet analysis method and device and storage medium
This invention uses a custom parsing method to parse the CAN message header and content, solving the problem of low efficiency in existing CAN message parsing methods. It enables access and parsing for multiple vehicle models, improves system compatibility, solves the technical problems of existing CAN message parsing methods, achieves universality and compatibility for multiple vehicle models, reduces system versatility and efficiency, and lowers system cost.
Patent Information
- Application Number
- CN202310587448.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-05-23
AI Technical Summary
Existing CAN message parsing methods are inefficient, prone to errors, and have poor versatility and compatibility, increasing system complexity and cost.
By obtaining the user-defined message header and message matrix configuration information, the big data message header and big data message content are parsed using the message header configuration values to obtain the big data message version number and frame identifier. The frame identifier is then used to match the message matrix configuration information table to determine the frame parsing configuration, thus enabling flexible parsing of CAN messages.
It enables access and parsing of multiple vehicle models, improves message parsing efficiency, reduces system compatibility issues, and lowers system costs.
Smart Images

Figure CN116634042B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of new energy vehicles, and in particular to a big data message analysis method and device and a storage medium. BACKGROUND
[0002] The Internet of Vehicles technology connects vehicles and networks to realize real-time monitoring and analysis of vehicle information, which is of great significance for improving driving safety, realizing intelligent transportation systems, and optimizing vehicle performance. The Internet of Vehicles system mainly reports sensor data to the cloud through the Controller Area Network (CAN) protocol, which includes but is not limited to vehicle speed, engine speed, charging and discharging status, total mileage, vehicle location, etc. CAN message is the carrier of such data transmission.
[0003] However, in the existing Internet of Vehicles system, the analysis of CAN messages is mainly based on predefined analysis protocols. Such protocols are often developed for specific CAN configurations of specific vehicle models, resulting in the need to redesign and develop analysis protocols when dealing with data from different vehicle models or different CAN configurations, which is inefficient and prone to errors. In addition, since the analysis of CAN messages requires specialized hardware and software support, and needs to be specially designed and developed for each vehicle model and CAN configuration, this undoubtedly increases the complexity and cost of the system. Therefore, the existing CAN message analysis method cannot meet the needs of the Internet of Vehicles system for high efficiency, flexibility and low cost. SUMMARY
[0004] Therefore, the embodiments of the present application provide a big data message analysis method, device and storage medium to solve the problems of low efficiency, easy to cause errors, poor universality and compatibility, low system efficiency and high cost of the existing CAN message analysis method.
[0005] The first aspect of the embodiments of the present application provides a big data message analysis method, comprising: obtaining message header information and message matrix information configured through a front end, and storing the message header information and the message matrix information in a message header configuration information table and a message matrix configuration information table, respectively; reading the message header configuration in the message header configuration information table, and using the value of the message header configuration to analyze the big data message header and the big data message content to obtain a big data message version number and a frame identifier corresponding to a big data message frame; using the big data message version number and the frame identifier to match the message matrix configuration in the message matrix configuration information table to determine a frame analysis configuration corresponding to the big data message frame; using the frame analysis configuration to analyze the big data message frame corresponding to the frame identifier to obtain an analysis signal value, and using the analysis signal value, the accuracy and the offset corresponding to the frame analysis configuration to calculate a final signal value.
[0006] In a second aspect, the embodiment of the present application provides a big data message analysis device, which comprises: an acquisition module configured to acquire message header information and message matrix information configured by a front end, and store the message header information and the message matrix information into a message header configuration information table and a message matrix configuration information table respectively; an analysis module configured to read message header configuration in the message header configuration information table, analyze a big data message header and a big data message content by using a value of the message header configuration, and obtain a big data message version number and a frame identifier corresponding to a big data message frame; a matching module configured to match message matrix configuration in the message matrix configuration information table by using the big data message version number and the frame identifier, and determine frame analysis configuration corresponding to the big data message frame; and a calculation module configured to analyze the big data message frame corresponding to the frame identifier by using the frame analysis configuration, obtain an analysis signal value, and calculate a final signal value by using the analysis signal value and accuracy and an offset corresponding to the frame analysis configuration.
[0007] In a third aspect, the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement steps of the above method.
[0008] The above at least one technical scheme adopted by the embodiment of the present application can achieve the following beneficial effects:
[0009] By acquiring message header information and message matrix information configured by a front end, and storing the message header information and the message matrix information into a message header configuration information table and a message matrix configuration information table respectively, reading message header configuration in the message header configuration information table, analyzing a big data message header and a big data message content by using a value of the message header configuration, obtaining a big data message version number and a frame identifier corresponding to a big data message frame, matching message matrix configuration in the message matrix configuration information table by using the big data message version number and the frame identifier, determining frame analysis configuration corresponding to the big data message frame, analyzing the big data message frame corresponding to the frame identifier by using the frame analysis configuration, obtaining an analysis signal value, and calculating a final signal value by using the analysis signal value and accuracy and an offset corresponding to the frame analysis configuration, the present application can realize access and analysis of multiple vehicle types, avoid differences in CAN configuration of various vehicle types, realize configurability of required analysis signals, and configure analysis signals based on a CAN version range, thereby improving message analysis efficiency, improving generality and compatibility of the system, improving efficiency of the system, and reducing cost. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0011] Figure 1 is a flow diagram of a large data packet analysis method provided by the embodiments of the present application;
[0012] Figure 2 is a CAN packet structure diagram that can support analysis provided by the embodiments of the present application;
[0013] Figure 3 is a structure diagram of a large data packet analysis device provided by the embodiments of the present application;
[0014] Figure 4 is a structure diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0015] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary details.
[0016] The existing CAN message analysis method cannot meet the needs of the vehicle networking system for high efficiency, flexibility and low cost. Therefore, in view of the problems existing in the prior art, the present application provides a new big data message analysis method. The present application obtains the configuration information of the message header and the message matrix in a user-defined manner, and stores these information in the message header configuration information table and the message matrix configuration information table respectively. The user can configure the rules for analyzing the big data message and the user-defined configuration file containing the CAN communication matrix on the web front-end page, realizing the configurability of message analysis, thereby avoiding the problem of repeated development for multiple vehicle models. The present application obtains the big data message version number and the frame identifier corresponding to the big data message frame by reading the configuration value in the message header configuration information table, analyzing the big data message header and the big data message content. A unified cloud CAN message analysis process is realized, and the analysis efficiency is improved. The present application defines the CAN signal matrix required for analysis by the CAN version range, realizes the rapid access and analysis of various vehicle models and CAN configurations, and improves the universality and compatibility of the system. Finally, the present application analyzes the big data message frame corresponding to the frame identifier according to the frame analysis configuration, obtains the analysis signal value, and then calculates the final signal value by using the analysis signal value and the accuracy and offset corresponding to the frame analysis configuration. Thus, the accuracy and efficiency of message analysis are further improved.
[0017] The technical solutions of the present application will be described in detail below in combination with the drawings and specific embodiments.
[0018] Figure 1 is a flowchart of the big data message analysis method provided by the embodiments of the present application. Figure 1 The big data message analysis method can be executed by the cloud. As shown in Figure 1 , the big data message analysis method can specifically include:
[0019] S101, obtaining the message header information and message matrix information configured through the front end, and storing the message header information and message matrix information into the message header configuration information table and the message matrix configuration information table respectively;
[0020] S102, reading the message header configuration in the message header configuration information table, and analyzing the big data message header and the big data message content by using the value of the message header configuration, to obtain the big data message version number and the frame identifier corresponding to the big data message frame;
[0021] S103, matching the message matrix configuration in the message matrix configuration information table by using the big data message version number and the frame identifier, to determine the frame analysis configuration corresponding to the big data message frame;
[0022] S104, parse the large data packet frame corresponding to the frame identifier by using the frame parsing configuration, to obtain a parsing signal value, and calculate a final signal value by using the parsing signal value and the precision and offset corresponding to the frame parsing configuration.
[0023] The Internet of Vehicles sensor data is sent to the cloud through CAN signals in a periodic collection and reporting manner. After receiving the CAN message data sent by the vehicle end, the cloud uses a custom CAN message data analysis method to analyze the CAN message data in real time, thereby obtaining signal data that can be used for analysis by background operation personnel. Therefore, the embodiment of the present application is applied to the cloud, and the original CAN message data is sequentially transmitted to the message queue by the message queue to the message real-time analysis service. The message real-time analysis service listens to and reads the message analysis configuration table (i.e., the message header configuration information table and the message matrix configuration information table) generated by the user through the front-end configuration. The original CAN message data is analyzed by using the read configuration, and the analyzed signal is transmitted to the message queue for analysis and processing.
[0024] It should be noted that the big data message analysis method provided by the embodiment of the present application will analyze the CAN message with a specific structure in real time. First, the content of the CAN message structure defined in the embodiment of the present application is explained. Figure 2 is a CAN message structure diagram that can be supported by the embodiment of the present application. As Figure 2 indicated, the CAN message structure can specifically include:
[0025] The CAN message structure of the present application is composed of five layers of structures. The first layer structure includes a large data message header and a large data message content. The second layer structure includes a snapshot data header and a snapshot data area. The CAN version, data area format, file type, and data length in the third layer structure form the snapshot data header in the second layer structure, and one or n periodic CAN message sequences in the third layer structure form the snapshot data area in the second layer structure. The fourth layer structure includes a start symbol, a periodic type, a timestamp, a data length, and a CAN frame sequence that form a periodic CAN message sequence. The fifth layer structure includes one or n CAN frames composed of a frame ID, a frame length, and a frame content.
[0026] The above embodiment briefly describes the basic composition of the CAN message structure. The specific content of each layer of the CAN message structure will be described in detail below in combination with the table, which can specifically include the following content:
[0027] The first layer structure data is composed of a large data message header and a large data message content, as shown in Table 1.
[0028] Table 1 Content of the first layer structure data
[0029]
[0030]
[0031] The second layer structure data is composed of snapshot data header and snapshot data area, as shown in Table 2.
[0032] Table 2: Content of second layer structure data
[0033]
[0034]
[0035] The third layer structure data is composed of periodic CAN message sequence, as shown in Table 3.
[0036] Table 3: Content of third layer structure data
[0037]
[0038]
[0039]
[0040] The fourth layer structure data is composed of CAN frame sequence, as shown in Table 4.
[0041] Table 4: Content of fourth layer structure data
[0042]
[0043] The fifth layer structure data is composed of one or n CAN frames, as shown in Table 5.
[0044] Table 5: Content of fifth layer structure data
[0045]
[0046] In some embodiments, the message header information configured through the front end is obtained, and the message header information is stored in a message header configuration information table, including:
[0047] The message header information configured by a user through a web front end page for analyzing large data messages is obtained, and the message header information is stored in a message header configuration information table.
[0048] The message header information includes a custom analysis rule configured for the large data messages.
[0049] Specifically, the embodiment of the present application supports user configuration of message header information for parsing large data messages (i.e., CAN messages) by developing a web front-end application. In actual applications, the message header information includes but is not limited to the following information: collection version number, message type, reissue identifier, timestamp, data body length, CAN version, data area format, file type, etc. After the cloud receives the user-configured message header information, the back-end program installed in the cloud stores the message header information into a message header configuration information table.
[0050] In one example, the data in the message header configuration information table can be composed of two parts, namely name (configuration item) and value (field value). The field value is also composed of two parts, the first part being the byte length (for example, mqtt_header_collect_version is 2, indicating that the data collection version number occupies 2 byte lengths), and the second part being the data type, L indicating integer and S indicating string. The two parts are concatenated by the separator “|” to form the field value of this configuration table.
[0051] In some embodiments, the message matrix information configured through the front end is obtained, and the message matrix information is stored into a message matrix configuration information table, including:
[0052] The user-configured custom configuration file containing the CAN communication matrix is obtained through the web front-end page, and the CAN version range adapted to the custom configuration file is set;
[0053] The content of the custom configuration file is parsed to obtain message matrix information, and the message matrix information is stored into a message matrix configuration information table;
[0054] The message matrix information contains message matrix configuration and custom parsing rules corresponding to the message matrix configuration.
[0055] Specifically, the web front-end application developed by the embodiment of the present application also supports user uploading of a DBC file (i.e., a custom configuration file) containing a CAN communication matrix. The DBC file can be considered as a file defined by the user when designing CAN messages, and the back-end program in the cloud is used to configure the CAN version range supported by the DBC file.
[0056] Further, the back-end program is used to perform a parsing operation on the uploaded DBC file to obtain fields for storage into a message matrix configuration information table. In actual applications, the fields in the message matrix configuration information table include but are not limited to the following fields: message identifier, signal name, signal description, arrangement format, starting byte, starting bit, signal length, data type, precision, offset, signal value description, etc. The above field information obtained by parsing the DBC file is stored into the message matrix configuration information table.
[0057] According to the technical scheme provided in the embodiments of the present application, the user-defined message header information and the fields in the custom configuration file are obtained and stored in the message header configuration information table and the message matrix configuration information table respectively. The custom parsing rules and custom parsing configurations for parsing large data messages are configured through the web front-end page, and the message parsing is configurable, thereby avoiding the problem of repeated development for multiple vehicle types.
[0058] In some embodiments, the message header configuration in the message header configuration information table is read, and the large data message header and the large data message content are parsed using the values of the message header configuration, including:
[0059] The collection version number configuration, the message type configuration, the reissue identification configuration, the timestamp configuration, and the data body length configuration in the message header configuration information table are read.
[0060] The large data message header is parsed using the values of the collection version number configuration, the message type configuration, the reissue identification configuration, the timestamp configuration, and the data body length configuration, to obtain the message content data.
[0061] Specifically, the backend program of the cloud end listens to the message header configuration information table and the message matrix configuration information table, and reads the message parsing configuration table (the message header configuration information table and the message matrix configuration information table) using the developed real-time data processing program, to obtain the configuration items in the message parsing configuration table and the values corresponding to the configuration items, and sequentially parse each layer of data in the data structure according to the data structure of the original CAN message using the values of the read configuration items.
[0062] In one example, first, mqtt_header_collect_version (collection version number configuration), mqtt_header_msg_type (message type configuration), mqtt_header_reissue_flag (reissue identification configuration), mqtt_header_timestamp (timestamp configuration), and mqtt_header_msg_length (data body length configuration) in the message header configuration information table are read. The configuration items in the message header configuration information table are stored in the form of fields, and each configuration item corresponds to a specific value.
[0063] The large data message header is parsed using the values of the above-mentioned configuration items to obtain the message content data. In the CAN message structure of the embodiments of the present application, the message content data includes the following contents: collection version number, message type, reissue flag, timestamp, and data body length. After obtaining the parsed message content data, the message content data can also be decompressed using GZIP.
[0064] In some embodiments, after obtaining the message content data, the method further comprises:
[0065] reading the CAN version configuration in the message header configuration information table, using the value of the CAN version configuration to parse the snapshot data header in the large data message content, to obtain the large data message version number;
[0066] reading the data area format configuration, the file type configuration, and the data length configuration in the message header configuration information table, using the value of the data area format configuration, the value of the file type configuration, and the value of the data length configuration to parse the large data message content, to obtain the snapshot data area.
[0067] Specifically, the backend program continues to read the CAN version configuration (snapshot_data_can_version) in the message header configuration information table. The value of this configuration item is used to parse the snapshot data header in the large data message content. Through parsing, the CAN version number of the large data message, and the data area format, file type, and data length of the snapshot data header can be obtained.
[0068] Further, the backend program continues to read other configuration items in the message header configuration information table, such as the data area format configuration (snapshot_data_format), the file type configuration (snapshot_data_file_type), and the data length configuration (snapshot_data_length). Using the values of these configuration items, the snapshot data area is further parsed to obtain the snapshot data area. In the CAN message structure of the embodiments of the present application, the snapshot data area includes a plurality of periodic CAN message sequences.
[0069] The above embodiments describe how to use the configuration items in the message header configuration information table to parse the large data message, so as to obtain more message content data. The advantage of this method is that the message header configuration information can be customized according to actual needs, so that various formats and types of large data messages can be flexibly processed.
[0070] In some embodiments, the method further comprises:
[0071] reading the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration, and the CAN message data length configuration in the message header configuration information table;
[0072] using the value of the CAN message start symbol configuration, the value of the CAN message periodic type configuration, the value of the CAN message timestamp configuration, and the value of the CAN message data length configuration to parse the periodic CAN message sequence in the snapshot data area, to obtain the CAN frame sequence.
[0073] Specifically, to parse the periodic CAN message sequence, several key configuration items in the message header configuration information table need to be read first. These configuration items include CAN message start character configuration (can_msg_start_char), CAN message cycle type configuration (can_msg_cycle_type), CAN message timestamp configuration (can_msg_timestamp), and CAN message data length configuration (can_msg_data_length). Each configuration item is stored in the message header configuration information table and corresponds to a specific CAN message data field.
[0074] In one example, the backend program first reads the values of these configuration items. Then, using these values, the periodic CAN message sequence in the snapshot data area is parsed. The parsing process is carried out according to the data structure of the CAN message, and each layer of data is parsed in turn using the values of the configuration items read earlier. Through this parsing process, the backend program can extract the CAN frame sequence from the periodic CAN message sequence. In practical applications, the CAN frame sequence may include a series of CAN frames, each containing one or more CAN data packets.
[0075] Through the pre-configured parsing rules, the periodic CAN message sequence can be efficiently parsed, avoiding uncertainty and complexity in the parsing process. At the same time, since these configuration items can be customized according to actual needs, the parsing method of the present application has high flexibility and scalability.
[0076] In some embodiments, after obtaining the CAN frame sequence, the method further comprises:
[0077] Reading the CAN frame identifier configuration and the CAN frame message length configuration in the message header configuration information table, and using the value of the CAN frame identifier configuration and the value of the CAN frame message length configuration to parse the CAN frame in the CAN frame sequence to obtain the frame identifier, frame length, and frame content corresponding to the CAN frame.
[0078] Specifically, after obtaining the CAN frame sequence, the CAN frame will be further parsed to obtain more detailed information. First, read the CAN frame identifier configuration (can_id) and the CAN frame message length configuration (can_length) from the message header configuration information table. These configuration items are also stored in the message header configuration information table, and each configuration item corresponds to a specific CAN frame field.
[0079] Further, the CAN frame in the CAN frame sequence is parsed using the read value of the CAN frame identifier configuration and the value of the CAN frame message length configuration. For example, the value of the read configuration item is used to parse each layer of data of the CAN frame in sequence. After this parsing process, the frame identifier (i.e., frame ID), frame length, and frame content of each CAN frame can be obtained. The frame identifier is a code uniquely identifying the CAN frame, the frame length indicates the length of the data in the CAN frame, and the frame content is the actual transmitted data in the CAN frame.
[0080] Further, in some embodiments, after the CAN version number (i.e., large data message version number) and the frame ID are obtained through the above parsing, the CAN version number and the frame ID are used to match the message matrix configuration in the message matrix configuration information table to obtain the frame parsing configuration corresponding to the CAN frame (i.e., large data message frame); then, the CAN frame corresponding to the frame ID is parsed using the frame parsing configuration to obtain a parsed signal value, and the final signal value is calculated using the parsed signal value, the precision, and the offset.
[0081] In one example, the application further optimizes the parsing process of the large data message. Specifically, by using the CAN version number and the frame ID to match the message matrix configuration in the message matrix configuration information table, the frame parsing configuration corresponding to the CAN frame can be obtained. The message matrix configuration information table contains various CAN frames and their corresponding parsing configuration information, and through the matching of the CAN version number and the frame ID, the frame parsing configuration corresponding to the current CAN frame can be accurately found.
[0082] Optionally, the CAN frame corresponding to the current frame ID is parsed using the found frame parsing configuration to obtain a parsed signal value. The parsed signal value is the original numerical value of a certain specific signal in the CAN frame, which needs to be further processed to obtain the actual signal value. That is, the final signal value is calculated using the parsed signal value, the precision, and the offset. The precision and the offset are pre-set parameters used to convert the parsed signal value into the actual signal value. The specific calculation method is: final signal value = parsed signal value * precision + offset.
[0083] According to the technical scheme provided by the embodiments of the application, through the pre-configured message matrix configuration information table, the parsing configuration corresponding to each CAN frame can be accurately found, greatly improving the efficiency and accuracy of the parsing. At the same time, through the calculation of the precision and the offset, the original parsed signal value can be converted into the actual signal value, thereby more accurately reflecting the data information in the CAN frame.
[0084] It should be noted that the configuration item in the message matrix configuration information table corresponds to the CAN version number, and the CAN version number corresponding to the configuration item is used to determine which versions of CAN messages the current configuration item supports, thereby realizing configuration and analysis of the signal based on the CAN version range.
[0085] In some embodiments, after analyzing the CAN frames in the CAN frame sequence to obtain the frame identifier, frame length and frame content corresponding to the CAN frames, the method comprises:
[0086] determining whether the CAN frame sequence contains an unanalyzed CAN frame, and when the CAN frame sequence contains an unanalyzed CAN frame, determining the frame analysis configuration corresponding to the unanalyzed CAN frame and analyzing the unanalyzed CAN frame using the frame analysis configuration;
[0087] When the CAN frame sequence does not contain an unanalyzed CAN frame, determining whether there is a next CAN frame sequence, and when there is a next CAN frame sequence, continuing to analyze the CAN frames in the next CAN frame sequence;
[0088] The final signal values are encapsulated according to a predetermined data structure, and the encapsulated data is sent to a message queue.
[0089] Specifically, after obtaining the frame identifier, frame length and frame content of the CAN frames in the CAN frame sequence, the embodiments of the present application will perform a series of judgment operations. First, it is determined whether the current CAN frame sequence still contains an unanalyzed CAN frame. If there are unanalyzed CAN frames, determine the frame analysis configuration corresponding to these unanalyzed CAN frames (the query method of the frame analysis configuration is described in the foregoing embodiments), and then analyze the unanalyzed CAN frames using the frame analysis configuration. In this way, it can be ensured that each CAN frame in the CAN frame sequence is correctly analyzed.
[0090] If the current CAN frame sequence does not contain an unanalyzed CAN frame, it is determined whether there is a next CAN frame sequence. If there is a next CAN frame sequence, enter the next CAN frame sequence and continue to analyze the CAN frames therein. In this way, the above-mentioned loop is continued until all the CAN frame sequences are analyzed.
[0091] After the analysis is completed, all the final signal values are encapsulated according to a predetermined data structure. These data structures may be different due to different application scenarios, but they can ensure the effective transmission and use of signal values. Finally, the encapsulated data is converted into a json format and sent to a message queue. The message queue is a commonly used data transmission method, which can ensure the order and integrity of the data.
[0092] Optionally, the application encapsulates the final signal value after CAN message analysis into the following data object, and the specific data structure is shown in Table 6.
[0093] Table 6 Object after CAN message analysis
[0094]
[0095] Through the above-mentioned loop judgment and analysis process, the application will be judged and analyzed multiple times to ensure that each CAN frame is correctly processed, and all the obtained final signal values are uniformly encapsulated and sent, thereby improving the availability and effectiveness of the data.
[0096] According to the technical scheme provided by the embodiment of the application, the application is aimed at the analysis of large data messages, including the analysis of message headers and message contents, especially for complex CAN messages. The application performs structured analysis on large data messages through the preset message header configuration information table and message matrix configuration information table, effectively extracts various key information in the message, such as CAN version number, message type, reissue identifier, timestamp, data length, frame identifier, etc. In the analysis process, the application reads the configuration information specifically, and analyzes the message header and message content layer by layer, thereby obtaining important information such as message content data, snapshot data header, snapshot data area, periodic CAN message sequence, CAN frame sequence, etc. Among them, the analysis of the CAN frame sequence uses frame analysis configuration, so that each CAN frame can be effectively analyzed, and the frame identifier, frame length and frame content are extracted. In addition, the application also includes the processing of unanalyzed CAN frames and the processing of multiple CAN frame sequences, ensuring that all message data can be effectively analyzed. The technical scheme of the application can effectively extract key information in large data messages, and has good expansibility and universality, which can meet various complex large data message analysis requirements, and significantly improves the efficiency and accuracy of message analysis.
[0097] The following is an embodiment of the device of the application, which can be used to execute the method embodiment of the application. For details not disclosed in the device embodiment of the application, please refer to the method embodiment of the application.
[0098] Figure 3 is a structural schematic diagram of the large data message analysis device provided by the embodiment of the application. As shown in Figure 3 , the large data message analysis device comprises:
[0099] The acquisition module 301 is configured to acquire the message header information and message matrix information configured through the front end, and store the message header information and message matrix information into the message header configuration information table and the message matrix configuration information table, respectively;
[0100] The analysis module 302 is configured to read the message header configuration information table, analyze the large data message header and the large data message content by using the value of the message header configuration, and obtain the large data message version number and the frame identifier corresponding to the large data message frame;
[0101] The matching module 303 is configured to match the message matrix configuration in the message matrix configuration information table by using the large data message version number and the frame identifier, and determine the frame analysis configuration corresponding to the large data message frame.
[0102] The calculation module 304 is configured to analyze the large data message frame corresponding to the frame identifier by using the frame analysis configuration, obtain an analysis signal value, and calculate a final signal value by using the analysis signal value, the accuracy corresponding to the frame analysis configuration, and the offset.
[0103] In some embodiments, Figure 3 The acquisition module 301 acquires the message header information configured by the user through the web front-end page for analyzing the large data message, and stores the message header information into the message header configuration information table; wherein the message header information contains the custom analysis rule configured for the large data message.
[0104] In some embodiments, Figure 3 The acquisition module 301 acquires the custom configuration file containing the CAN communication matrix configured by the user through the web front-end page, sets the CAN version range adapted to the custom configuration file, analyzes the content of the custom configuration file to acquire the message matrix information, and stores the message matrix information into the message matrix configuration information table; wherein the message matrix information contains the message matrix configuration and the custom analysis rule corresponding to the message matrix configuration.
[0105] In some embodiments, Figure 3 The analysis module 302 reads the collection version number configuration, the message type configuration, the retransmission identifier configuration, the timestamp configuration, and the data body length configuration in the message header configuration information table, analyzes the large data message header by using the value of the collection version number configuration, the value of the message type configuration, the value of the retransmission identifier configuration, the value of the timestamp configuration, and the value of the data body length configuration, and obtains the message content data.
[0106] In some embodiments, Figure 3The analysis module 302 reads the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration in the message header configuration information table, and uses the values of the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration to analyze the periodic CAN message sequence in the snapshot data area, to obtain the CAN frame sequence.
[0107] In some embodiments, Figure 3 The analysis module 302 reads the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration in the message header configuration information table, and uses the values of the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration to analyze the periodic CAN message sequence in the snapshot data area, to obtain the CAN frame sequence.
[0108] In some embodiments, Figure 3 The analysis module 302 reads the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration in the message header configuration information table, and uses the values of the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration to analyze the periodic CAN message sequence in the snapshot data area, to obtain the CAN frame sequence.
[0109] In some embodiments, Figure 3 The analysis module 302 reads the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration in the message header configuration information table, and uses the values of the CAN message start symbol configuration, the CAN message periodic type configuration, the CAN message timestamp configuration and the CAN message data length configuration to analyze the periodic CAN message sequence in the snapshot data area, to obtain the CAN frame sequence.
[0110] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0111] Figure 4 FIG. 4 is a structural schematic diagram of an electronic device 4 provided by the embodiments of the present application. As shown in FIG. 4, the electronic device 4 comprises a processor 401, a memory 402, a communication interface 403 and a bus 404. Figure 4As shown, the electronic device 4 of this embodiment includes a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. The processor 401 implements the steps in each of the above method embodiments when executing the computer program 403. Alternatively, the processor 401 implements the functions of each module / unit in each of the above apparatus embodiments when executing the computer program 403.
[0112] By way of example, the computer program 403 can be segmented into one or more modules / units, which are stored in the memory 402 and executed by the processor 401 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 403 in the electronic device 4.
[0113] The electronic device 4 can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The electronic device 4 can include but is not limited to the processor 401 and the memory 402. Those skilled in the art can understand that the electronic device 4 can include more or less components, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, and the like. Figure 4 The electronic device 4 is merely an example and does not constitute a limitation on the electronic device 4, which can include more or less components than those shown, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, and the like.
[0114] The processor 401 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0115] The memory 402 can be an internal storage unit of the electronic device 4, for example, a hard disk or a memory of the electronic device 4. The memory 402 can also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 402 can include both the internal storage unit and the external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device. The memory 402 can also be used to temporarily store data that has been output or will be output.
[0116] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be realized in the form of hardware or software function unit. In addition, the specific name of each functional unit and module is only for easy distinction, and does not limit the protection scope of the present application. The specific working process of the unit and module in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0117] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can refer to the relevant description of other embodiments.
[0118] Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0119] In the embodiments of the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other manners. For example, the described apparatus / computer device embodiments are merely schematic. For example, the division of the modules or units is merely logical function division. There can be another division manner for the actual implementation, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0120] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0121] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically as separate units, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware, or in the form of software functional units.
[0122] If the integrated module / unit is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the above-mentioned embodiment methods can be completed by computer programs, and the computer programs can be stored in a computer readable storage medium. When the processor executes the computer programs, the steps of the above-mentioned various method embodiments can be implemented. The computer program can include computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier wave signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer readable medium can include appropriate contents according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to the legislation and patent practice, the computer readable medium does not include electric carrier wave signal and telecommunication signal.
[0123] The above examples are only used to illustrate the technical solutions of the present application, but not limit the same; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for analyzing large data packets, the method comprising: The method comprises the following steps: obtaining message header information and message matrix information configured through a front end, and storing the message header information and the message matrix information into a message header configuration information table and a message matrix configuration information table respectively; reading message header configuration in the message header configuration information table, and using values of the message header configuration to parse a large data message header and a large data message content, to obtain a large data message version number and a frame identifier corresponding to a large data message frame; wherein, parsing the large data message content comprises: reading a CAN version configuration in the message header configuration information table, using values of the CAN version configuration to parse a snapshot data header in the large data message content, to obtain the large data message version number; reading a data area format configuration, a file type configuration and a data length configuration in the message header configuration information table, using values of the data area format configuration, the file type configuration and the data length configuration to parse the large data message content, to obtain a snapshot data area; matching message matrix configuration in the message matrix configuration information table using the large data message version number and the frame identifier, to determine frame parsing configuration corresponding to the large data message frame; using the frame parsing configuration to parse the large data message frame corresponding to the frame identifier, to obtain a parsing signal value, and using the parsing signal value and precision and offset corresponding to the frame parsing configuration to calculate a final signal value.
2. The method of claim 1, wherein, obtaining message header information configured through a front end, and storing the message header information into a message header configuration information table, comprising: obtaining the message header information configured by a user through a web front end page for parsing a large data message, and storing the message header information into the message header configuration information table; wherein, the message header information contains a custom parsing rule configured for the large data message.
3. The method of claim 1, wherein, obtaining message matrix information configured through a front end, and storing the message matrix information into a message matrix configuration information table, comprising: setting a CAN version range adapted to a custom configuration file containing a CAN communication matrix configured by a user through a web front end page; parsing content of the custom configuration file to obtain the message matrix information, and storing the message matrix information into the message matrix configuration information table; wherein, the message matrix information contains the message matrix configuration and a custom parsing rule corresponding to the message matrix configuration.
4. The method of claim 1, wherein, parsing the large data message header, comprising: reading a collection version number configuration, a message type configuration, a retransmission identifier configuration, a timestamp configuration and a data body length configuration in the message header configuration information table; using values of the collection version number configuration, the message type configuration, the retransmission identifier configuration, the timestamp configuration and the data body length configuration to parse the large data message header, to obtain message content data.
5. The method of claim 1, wherein, after obtaining the snapshot data area, the method further comprises: reading a CAN message start symbol configuration, a CAN message period type configuration, a CAN message timestamp configuration and a CAN message data length configuration in the message header configuration information table; parsing a period CAN message sequence in the snapshot data area by using a value of the CAN message start symbol configuration, a value of the CAN message period type configuration, a value of the CAN message timestamp configuration and a value of the CAN message data length configuration to obtain a CAN frame sequence.
6. The method of claim 5, wherein, After the CAN frame sequence is obtained, the method further comprises: reading a CAN frame identifier configuration and a CAN frame message length configuration in the message header configuration information table, and parsing a CAN frame in the CAN frame sequence by using a value of the CAN frame identifier configuration and a value of the CAN frame message length configuration to obtain a frame identifier, a frame length and frame content corresponding to the CAN frame.
7. The method of claim 6, wherein, After the CAN frame in the CAN frame sequence is parsed to obtain the frame identifier, the frame length and the frame content corresponding to the CAN frame, the method comprises: determining whether the CAN frame sequence contains an un-parsed CAN frame, and when the un-parsed CAN frame is contained, continuing to determine a frame parsing configuration corresponding to the un-parsed CAN frame and parsing the un-parsed CAN frame by using the frame parsing configuration; when the un-parsed CAN frame is not contained, determining whether there is a next CAN frame sequence, and when there is the next CAN frame sequence, continuing to parse a CAN frame in the next CAN frame sequence; encapsulating all the final signal values according to a predetermined data structure, and sending the encapsulated data to a message queue.
8. A large data packet analysis apparatus characterized by comprising: comprises: an acquisition module configured to acquire message header information and message matrix information configured through a front end, and store the message header information and the message matrix information into a message header configuration information table and a message matrix configuration information table respectively; a parsing module configured to read message header configuration in the message header configuration information table, and parse a big data message header and big data message content by using a value of the message header configuration to obtain a big data message version number and a frame identifier corresponding to a big data message frame; wherein parsing the big data message content comprises: reading a CAN version configuration in the message header configuration information table, and parsing a snapshot data header in the big data message content by using a value of the CAN version configuration to obtain the big data message version number; reading a data area format configuration, a file type configuration and a data length configuration in the message header configuration information table, and parsing the big data message content by using a value of the data area format configuration, a value of the file type configuration and a value of the data length configuration to obtain a snapshot data area; a matching module configured to match message matrix configuration in the message matrix configuration information table by using the big data message version number and the frame identifier, and determine a frame parsing configuration corresponding to the big data message frame; The computing module is configured to parse the large data packet frame corresponding to the frame identifier by using the frame parsing configuration, to obtain a parsing signal value, and to calculate a final signal value by using the parsing signal value and the precision and offset corresponding to the frame parsing configuration.
9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by a processor to implement the method in any one of claims 1 to 7.
Citation Information
Patent Citations
Message analysis method and device
CN115801927A