Hierarchical clustering-based bit-level CAN (Controller Area Network) data load reversing method and device

By processing CAN message data using hierarchical clustering, automotive signals can be identified and parsed, eliminating the reliance on dedicated equipment and manufacturer databases in existing technologies. This enables high-precision automated reverse parsing of signals, adapting to different vehicle models and message structures.

CN121531048APending Publication Date: 2026-02-13BEIJING INFORMATION SCI & TECH UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511591263.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing CAN reverse engineering methods rely on external devices and vendor-owned databases, making it difficult to achieve high-precision bit-level signal identification and classification in unknown environments. Furthermore, they have low automation and poor versatility.

Method used

A hierarchical clustering-based approach is adopted. The raw CAN message data is acquired through a CAN data acquisition tool, and processed using frequency matrix, probability matrix, and bit flip rate. The hierarchical clustering method is combined with signal feature analysis to identify fixed value, counter, checksum, physical value, binary state, and multi-state signals. Inverse analysis is then performed in conjunction with the types of signals of the vehicle itself.

Benefits of technology

It enables high-precision automated reverse engineering of signals without the need for DBC files or external hardware devices, improving the accuracy and automation of CAN message parsing and adapting to different vehicle models and message structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121531048A_ABST
    Figure CN121531048A_ABST
Patent Text Reader

Abstract

The invention discloses a bit-level CAN (Controller Area Network) data load reversing method and device based on hierarchical clustering. The method comprises the following steps: acquiring original CAN message data in a vehicle running process through a CAN data acquisition tool, and processing the CAN message data by utilizing a frequency matrix, a probability matrix, a bit flipping rate and a hierarchical clustering method to obtain CAN message signal characteristics; performing reverse analysis on the CAN message signal by analyzing the characteristics of the CAN message signal and combining the signal type of the automobile to obtain a reverse analysis result; and controlling the functions of the automobile based on the reverse analysis result. According to the method and the device, the problem of dependence on special equipment and a database (DBC file) private by a manufacturer in the prior art is solved, and the technical problem of more accurate and finer-grained signal automatic reverse analysis is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of automotive electronics and vehicle communication technology, in particular to a bit-level CAN data payload reverse method and device based on hierarchical clustering. BACKGROUND

[0002] CAN (Controller Area Network) bus, as the main communication method between vehicle electronic control units (ECUs), is widely used in automotive power systems, chassis control, body electronics and infotainment systems. During vehicle operation, a large amount of data generated by various sensors and actuators is transmitted through the CAN bus, forming CAN messages containing vehicle operating status and control instructions.

[0003] However, automobile manufacturers usually strictly keep the DBC (DATAbase CAN) file of the CAN message confidential, and external researchers or third-party enterprises cannot directly obtain the DBC file, so they cannot analyze the specific signal meaning in the CAN message. This brings great challenges to the research of vehicle state monitoring, vehicle function testing, network security analysis, etc.

[0004] Existing CAN reverse methods mostly rely on external devices (such as IMU, GPS, etc. sensors) or known prior knowledge to infer signals, which has the following shortcomings: strong dependence: excessive dependence on external hardware devices or prior information provided by manufacturers, making it difficult to complete independent analysis in unknown environments; insufficient accuracy: traditional methods are mostly based on byte-level or statistical features for analysis, making it difficult to achieve bit-level signal boundary recognition accuracy; high complexity: some methods require a lot of manual intervention or computing resources, with low automation level; poor universality: different vehicle models and message structures have insufficient adaptability, making it difficult to promote.

[0005] Therefore, there is an urgent need for a CAN message reverse method that does not rely on DBC files and additional hardware devices, and can achieve high-precision signal recognition and classification at the bit level, to improve the automation level and universality of vehicle signal analysis. SUMMARY

[0006] The embodiments of the present application provide a bit-level CAN data payload reverse method and device based on hierarchical clustering, to at least solve the problem of dependence on special equipment and manufacturer's private database (DBC file) in the prior art, and achieve more accurate and finer-grained signal automated reverse analysis.

[0007] According to an aspect of the embodiment of the present application, there is provided a hierarchical clustering-based bit-level CAN data payload reverse method and device, comprising: collecting original CAN message data in a vehicle running process by a CAN data collection tool, and processing the CAN message data by using a frequency matrix, a probability matrix, a bit flip rate and a hierarchical clustering method to obtain CAN message signal features; analyzing the CAN message signal features, combining with signal types possessed by the vehicle itself, and performing reverse analysis on the CAN message signal to obtain a reverse analysis result, wherein the reverse analysis result comprises at least one of the following: a fixed value signal, a counter signal, a checksum signal, a physical value signal, a binary state signal and a multi-element state signal; and controlling functions of the vehicle based on the reverse analysis result.

[0008] According to another aspect of the embodiment of the present application, there is also provided a hierarchical clustering-based bit-level CAN data payload reverse device, comprising: a processing module configured to collect original CAN message data in a vehicle running process by a CAN data collection tool, and process the CAN message data by using a frequency matrix, a bit flip rate and a hierarchical clustering method to obtain CAN message signal features; a reverse module configured to analyze the CAN message signal features, combine with signal types possessed by the vehicle itself, and perform reverse analysis on the CAN message signal to obtain a reverse analysis result, wherein the reverse analysis result comprises at least one of the following: a fixed value signal, a counter signal, a checksum signal, a physical value signal, a binary state signal and a multi-element state signal; and a control module configured to control functions of the vehicle based on the reverse analysis result.

[0009] In the embodiment of the present application, original CAN message data in a vehicle running process is collected by a CAN data collection tool, and the CAN message data is processed by using a frequency matrix, a probability matrix, a bit flip rate and a hierarchical clustering method to obtain CAN message signal features; the CAN message signal features are analyzed, combined with signal types possessed by the vehicle itself, and reverse analysis is performed on the CAN message signal to obtain a reverse analysis result, wherein the reverse analysis result comprises at least one of the following: a fixed value signal, a counter signal, a checksum signal, a physical value signal, a binary state signal and a multi-element state signal; and functions of the vehicle are controlled based on the reverse analysis result. Through the above scheme, the dependence on special equipment and a database (DBC file) private to a manufacturer in the prior art is solved, and the technical problem of more accurate and more fine-grained signal automatic reverse analysis is solved. BRIEF DESCRIPTION OF DRAWINGS

[0010] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0011] Figure 1 is a flow chart of a bit-level CAN data payload reverse method based on hierarchical clustering according to an embodiment of the application;

[0012] Figure 2 is a schematic diagram of a CAN bus standard frame format according to an embodiment of the application;

[0013] Figure 3 is a schematic diagram of original CAN message data converted into an 8*8 bit matrix according to an embodiment of the application;

[0014] Figure 4 is a schematic diagram of bit representation under different endianness according to an embodiment of the application;

[0015] Figure 5 is a schematic diagram of a 64*2 bit position frequency matrix according to an embodiment of the application;

[0016] Figure 6 is an example diagram of real data collected according to an embodiment of the application;

[0017] Figure 7 is a schematic diagram of a checksum signal distribution according to an embodiment of the application;

[0018] Figure 8 is a schematic diagram of a physical value signal identification result according to an embodiment of the application;

[0019] Figure 9 is a schematic diagram of an improved hierarchical clustering tree structure according to an embodiment of the application;

[0020] Figure 10 is a schematic diagram of a binary state signal flip rate feature according to an embodiment of the application;

[0021] Figure 11 is a multi-element state signal value mode scatter plot according to an embodiment of the application;

[0022] Figure 12 is a schematic diagram of host computer software according to an embodiment of the application;

[0023] Figure 13 is an algorithm analysis result diagram according to an embodiment of the application;

[0024] Figure 14is a schematic diagram of 48V BSG motor speed according to an embodiment of the application;

[0025] Figure 15 is a schematic diagram of 48V BSG motor power generation voltage according to an embodiment of the application;

[0026] Figure 16 is a flow chart of another bit-level CAN data payload reverse method based on hierarchical clustering according to an embodiment of the application;

[0027] Figure 17 is a structural schematic diagram of a bit-level CAN data payload reverse device based on hierarchical clustering according to an embodiment of the application;

[0028] Figure 18 A structural schematic diagram of a computer device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] According to an embodiment of the present application, a method embodiment of a bit-level CAN data payload reverse method based on hierarchical clustering is provided. It should be noted that the steps shown in the flow chart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flow chart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0032] Figure 1This is a flowchart illustrating a bit-level CAN data payload reverse engineering method based on hierarchical clustering, according to an embodiment of this application. Figure 1 As shown, the method includes the following steps:

[0033] Step S102: Use a CAN data acquisition tool to collect raw CAN message data, and use frequency matrix, bit flip rate and hierarchical clustering method to obtain CAN message signal features.

[0034] First, use a CAN data acquisition tool to collect raw CAN message data during vehicle operation, such as... Figure 2 As shown, the structure of a standard CAN message frame includes a frame start, identifier, arbitration field, reserved bits, data segment length code, data, check field, acknowledgment field, and frame end. The acquired messages are grouped by ID, and the DATA field is converted byte-by-byte into an 8x8 raw bit matrix. The converted structure is shown below. Figure 3 As shown, where bit represents a bit and byte represents a byte.

[0035] To eliminate endianness, such as Figure 4 As shown, end-to-end determination and normalization are employed: First, the bit inversion rate sequence is calculated for each ID's sub-data stream. (by position number) Arrange the bits from low to high (and count the flip frequency of that bit in adjacent frames) to obtain a feature sequence that varies with bit order. Then, construct two types of bit order indices:

[0036] Little-endian (Intel): The starting bit index of the byte corresponding to the least significant bit (LSB).

[0037] Big-endian (Motorola): The starting bit index of the byte corresponding to the most significant bit (MSB).

[0038] Under the two end-order assumptions, respectively Reorder according to the corresponding position index and calculate the Pearson correlation coefficient between the index and the position index. (To measure the strength of the linear correlation between "order-flip rate")

[0039]

[0040] The mean of the positional index. Let be the mean of the flip rate sequence, and i be the bit index, used to indicate the position of the bit in the byte (from low to high or from high to low), that is, the position of which bit in the bit sequence. Let the correlation coefficients calculated under the little-endian and big-endian assumptions be denoted as follows: With , define the association strength Assoc as:

[0041]

[0042] When , it is determined that the true end sequence of the ID is little-endian; otherwise, it is determined to be big-endian. According to the determined true end sequence, each 8*8 original bit matrix of each frame is standardized and reconstructed in bit sequence, and then enters the subsequent frequency, probability matrix and flip rate matrix statistical processing.

[0043] After the end sequence is unified, the sub-data stream of each ID is statistically processed in the time dimension, and the 64*2 frequency, probability matrix (statistical frequency and probability of each bit taking 0, 1, used for static distribution characteristics) and bit flip rate matrix (statistical frequency of adjacent frame bit flip, used for dynamic change characteristics) are constructed for feature representation. Thus, the CAN message signal feature set for subsequent analysis is obtained.

[0044] 1) Construct the bit position frequency matrix.

[0045] The bit position frequency matrix is constructed according to the definition of the original CAN data form. Manufacturers define the protocol at the bit level when defining the protocol, so a 64*2 bit position frequency matrix is constructed, 64 represents 64 bit positions (bit 0~63), 2 represents two binary conditions (0 or 1), according to the bit position frequency matrix, the 0, 1 distribution of the signal at a certain bit position can be directly observed, and the static distribution of the bit is revealed. The calculation is as follows.

[0046]

[0047]

[0048] Among them, represents the number of times that the DATA segment of the collection sequence is at the position, represents the length of the collection, represents each message in the collection, is an indicator function, and K is the frame number.

[0049] 2) Construct the bit position probability matrix.

[0050] Based on the bit position frequency matrix constructed above, a bit position probability matrix is established for each set, which mainly performs static feature statistics of data. For each position of the DATA segment, the frequency of each value appearing at the position is calculated, and the calculation method is as shown below:

[0051]

[0052] represents the frequency of the value of the DATA segment in the set sequence .

[0053] 3) Construct a bit flip rate matrix.

[0054] For 64 bit positions, the values of adjacent two frames in the continuous time sequence are compared, the proportion between the number of times that the value of a bit position of the ID changes from 0 to 1 or from 1 to 0 and the total number of times of flip (frame number minus 1) is calculated, which is used to perform time dynamic feature statistics of data. The adjacent bit comparison flip is recorded as True, and the non-flip is recorded as False. The proportion between the total number of True and the total number of times (frame number minus 1) is the bit flip rate, and the specific mathematical formula is shown as follows:

[0055]

[0056] represents the bit value (0 or 1) of the frame; represents an indicator function (1 if the condition is true, otherwise 0); represents the total number of adjacent frame comparisons (the total number of frames is ).

[0057] 4) Hierarchical clustering

[0058] Hierarchical clustering is an unsupervised machine learning method based on the similarity (or distance) between samples. By recursively aggregating or splitting data points, a hierarchical tree structure (i.e., a dendrogram) is constructed, which realizes data category division at different granularities. Compared with the standard hierarchical clustering method, the clustering algorithm provided in the present application is improved through three major improvements of feature representation optimization, mixed similarity measurement, and domain post-processing module, which significantly improves the accuracy and interpretability of signal boundary grouping and is the basis for subsequent signal recognition.

[0059] ​Traditional hierarchical clustering uses static numerical attributes (such as mean and variance) as input features, which makes it difficult to capture the temporal behavior characteristics of bits in CAN signals. This application proposes using the dynamic flip sequence of bits as clustering features: firstly, for each bit... Constructing temporal binary sequences ,in Indicates the first The value of this bit in the frame. Before clustering, fixed signals and counter signals are preferentially excluded to reduce interference from invalid calculations. The method provided in this application can reduce the complexity of the algorithm from... Down to And improve real-time performance.

[0060] The hybrid similarity function provided in this embodiment can simultaneously capture both linear correlations (such as physical quantity encoding patterns) and nonlinear correlations (such as state synchronization flips) between bits, thereby avoiding the failure problem that occurs when a single measurement method is used to deal with complex CAN signals. Specifically, the function uses normalized mutual information to measure nonlinear dependencies, Pearson correlation coefficient to measure linear dependencies, and adaptively fuses them using weighting factors. The specific formula is shown below:

[0061]

[0062] in, It is the absolute value of the Pearson coefficient, used to detect linear correlation and avoid the cancellation of positive and negative correlations; This is a weighting factor used to balance the contributions of both metrics. Through this design, compared to traditional methods that rely solely on a single similarity metric, this embodiment can more comprehensively and accurately characterize the correlation between bits, effectively improving the robustness and accuracy of hierarchical clustering in signal boundary identification, avoiding misjudgments or omissions, and thus improving the reliability and automation level of CAN message signal reverse analysis.

[0063] Normalized mutual information ( This is used to measure the statistical independence of bit sequences, and the calculation formula is shown below:

[0064]

[0065] In the formula For mutual information, The Shannon entropy is used to effectively identify nonlinear synchronization modes.

[0066] To improve the practicality of the algorithm in CAN signal analysis, this application incorporates a domain knowledge-driven post-processing module, defining the full link distance as the distance between the farthest samples of two clusters, calculated as follows:

[0067]

[0068] wherein, transforming the similarity into a distance metric, and are the clusters to be merged. In the merging process, always choose the pair of clusters with the smallest distance to iterate the merging until the number of clusters converges.

[0069] To avoid underfitting or overfitting, the silhouette coefficient is used as the clustering stopping criterion. For a candidate cluster , the silhouette coefficient is defined as follows:

[0070]

[0071] wherein, denotes the average distance to other bits within the cluster, denotes the average distance to the nearest neighboring cluster. When the average silhouette coefficient decreases with the number of clusters , the merging is terminated to maximize the intra-group similarity and inter-group difference.

[0072] Step S104, the CAN message signal is reversed by analyzing the signal characteristics of the CAN message and combining the signal types of the vehicle itself.

[0073] Based on the matrix constructed by the above method, the signals in the DATA segment corresponding to the ID are extracted by analyzing the numerical values at each position in the matrix, and the bit segments are classified and identified and the boundaries are determined by combining the common signal types and coding rules of the vehicle, to complete the reverse analysis. Specifically, it includes:

[0074] 1) Fixed value signal: indicates a signal that is always the same value. The identification of this signal is achieved by extracting the frequency matrix of the ID and observing the 0 and 1 frequencies of each bit position. If all 0 or all 1 occurs, this bit position is defined as a fixed value signal.

[0075] 2) Counter signal: In the vehicle CAN message signal, this signal is generally represented as a 16-bit cycle playing from 0 to f, and the byte is played from 0x00 to 0x0f in a cycle. The ideal bit flip rate corresponding to this is 1, 0.5, 0.25, 0.125. In the data acquisition process, this step will have acquisition errors. In the case of not wrapping around in a single cycle, the integer increases from , where 0≤s<e≤15. Thus, a single cycle interval will produce Sub-step 2: Calculate the maximum error value by formula, set threshold value as 0.05.

[0076]

[0077] wherein represents the flipping rate of the th bit, represents the ideal flipping rate of the th bit.

[0078] Through the above method, the embodiment can effectively suppress the interference caused by the acquisition error, ensure that the identification of the counter signal has robustness and high precision, thereby improving the reliability of subsequent signal reverse analysis. For binary, the embodiment takes the judgment of bit flipping rate as condition 1, and takes the monotonicity on the continuous time sequence as condition 2, and the conditions 1 and 2 are satisfied at the same time, which is the counter signal.

[0079] 3) Checksum signal: Checksum is a signal used to detect in CAN data payload, so for the same data payload, it should always be the same value. By using a key-value data structure (i.e. map, dictionary or hash) to see if the checksum is used in the data payload.

[0080] 4) Physical value signal identification: represents the state signal with numerical value in the vehicle, such as vehicle speed, steering wheel angle, etc. The signal identification follows a hierarchical progressive analysis framework, and the specific process design is as follows: first, a dynamic flipping rate sequence is constructed by a sliding window, as shown in Figure 5 , which shows the total bit flipping rate from ID 0x113 and the bit flipping rate on the th bit, on this basis, a ternary compound similarity is constructed, the normalized mutual information measures the state synchronization, the Pearson coefficient measures the linear correlation, and the power-law correction term strengthens the frequency coupling, and is fused linearly according to the weight to generate a compound similarity matrix ; take the distance as input, use complete-linkage agglomerative hierarchical clustering, and automatically determine the optimal cluster number by the average silhouette coefficient; at the same time, introduce adjacent bit adjacency constraint, ensure that the bits in the same cluster maintain local continuity in physical position; finally, the discrete clustering clusters are split and verified for effectiveness, and the continuous bit segments that meet the minimum effective length ≥2 are selected as physical quantity carriers. Through the three-step progression of “sliding window dynamic correlation analysis→ clustering granularity adaptive optimization→ continuous segment effectiveness verification”, the framework not only retains the multi-dimensional correlation characteristics of the CAN frame physical quantity, but also takes into account the discontinuity of the signal block distribution.

[0081] 5) Binary signal: indicates the signal with two states in the vehicle, such as the opening and closing of the door, etc. The discrimination of the signal adopts a four-level filtering mechanism of "hierarchical analysis". First, the remaining bit is screened according to the bit flip rate: when the frame number is , the candidate bit needs to meet the flip rate of not more than 5%, and in the scene of , it is relaxed to "the number of flips in the whole sequence is not more than 10 times"; the second level requires the dominant state probability to be above 0.75 (i.e. ), to ensure that the bit is in a stable state most of the time; the third level introduces the time domain continuity constraint, and the longest homomorphism duration of the whole sequence is calculated by the sliding comparison method , and the requirement is not less than frames, to eliminate the pseudo binary bit which is globally stable but still "shakes back and forth"; finally, the Shannon entropy is used as the information quantity filtering, and only when the entropy value is <0.85, the bit is finally accepted. Only when the above four conditions are met at the same time, the bit is marked as a real binary state value signal. The scheme can dynamically adjust the threshold value even under different collection conditions, so as to maintain consistent detection confidence and robustness. The binary state value signal is discriminated from the global static features and the local dynamic time domain, which greatly improves the accuracy and reliability.

[0082] 6) Multi-state value signal recognition: indicates the multiple state values of the signal, such as the danger warning light and the window lifting, etc. For the recognition of the signal, the application selects the signals with contact through hierarchical clustering, collects the codes appearing in all frames in this section as a set, checks the logic category of the set, and if there are only a few logic cases, it is considered as a multi-bit state value signal. For example, if a 3-bit segment only appears 000, 001, and 100, this kind of signal is regarded as a multi-bit state value signal. If there are many combination cases, such as 000~111 almost all appear, it means continuous numerical value. Algorithm 1 is the pseudo code of the application for recognizing the counter, checksum, physical state value, binary state value, and multi-state value signal.

[0083] For the above six signals, first, the fixed value signal is recognized based on the frequency and probability matrix; the counter signal is recognized based on the regularity of the bit flip rate (such as 1, 1, 2, 1, 4…etc. features) and the correlation of adjacent bits; the checksum signal is recognized by consistency and coverage detection in the candidate area.

[0084] Then, the remaining bits are identified by the improved hierarchical clustering method. Specifically, a hybrid similarity measure is constructed based on the normalized mutual information, Pearson correlation coefficient and power-law correction function. In the clustering process, the continuity constraint of adjacent bits is introduced, and the boundary merging and refinement of the clustering results are optimized by post-processing, so as to determine the continuous bit segment corresponding to the physical value signal. For the remaining discrete bits, the binary state signal is determined by combining the flip rate threshold, dominant state probability, timing continuity and information entropy constraint; and the multi-state signal is screened and confirmed based on the limited value mode and logic combination characteristics.

[0085] After the above identification is completed, the signal category, bit boundary and end sequence of each ID are output, so as to complete the reverse analysis of the CAN message.

[0086] Step S106, based on the determined CAN message signal, to control the function of the automobile.

[0087] In one embodiment, the present application carries out reverse and verification on all IDs under the actual static and driving conditions of 3 different vehicles (as shown in Figure 6 The specific contents include the following:

[0088] 1) Test and collection.

[0089] The CAN data collection tool is connected with the OBD interface, and the host computer performs data collection, data saving, data analysis and drawing. The original message is grouped according to the ID, and the 8*8 bit conversion, end sequence determination and standardization are completed according to the method of step S102; then the 64*2 frequency, probability matrix and bit flip rate matrix are constructed as the identification input.

[0090] 2) Fixed value signal identification result.

[0091] Table 1 shows part of the CAN ID list and the fixed value signal boundary used in the evaluation of the present application, and the fixed value "0 / 1" is the dominant value of the corresponding bit in a long time window; the bit number is represented by bit0-63, which is the standardized sequence number of the low to high bit of the DATA field.

[0092] Table 1 Identification result of fixed value signal

[0093]

[0094] 3) Counter signal identification result.

[0095] The counter signal is identified by the ideal bit rate and monotonicity in the data set, and Table 2 shows part of the CAN ID list and the boundary of the counter signal used in the experimental vehicle.

[0096] Table 2. Results of identifying the counter signal

[0097]

[0098] 4) Checksum signal identification results

[0099] The present application uses the idea of hash mapping and consistency verification to quickly screen suspected check segments. It is found in practice that the checksum is usually located after the counter or at the end of the payload (see Figure 7 Therefore, the above-mentioned area is used as a priority test area to reduce the amount of calculation; after completing the priority area verification, it is extended to other candidate bit segments. Table 3 shows the identification boundaries of the checksum of some IDs, which are consistent with the true bit results.

[0100] Table 3. Results of identifying the checksum signal

[0101]

[0102] 5) Physical value signal identification and clustering examples

[0103] For physical value signals, the present application uses features such as flip rate timing, adjacent bit correlation, and normalized mutual information for identification and boundary determination. Figure 8 The example is the flip rate timing (left) and adjacent bit flip rate scatter plot (right) of CAN ID 0x85 bit 0-7 under 18000 consecutive frame samples. As can be seen, the column number increases exponentially from low to high, the curves are in phase, the peak values increase exponentially, and the adjacent bit correlation coefficient is >0.91 (more than 0.99 in multiple places), showing the typical little-end continuous numerical value rule. Accordingly, it is determined that bits 0-7 constitute an 8-bit little-end continuous physical value field.

[0104] The corresponding hierarchical clustering tree is shown in Figure 9 , which shows a two-level structure of "low bit cluster (bit 3-7) / high bit cluster (bit 0-2)", which is consistent with the statistical rule of little-end continuous physical value.

[0105] 6) Binary / multistate signal identification examples.

[0106] Binary state: As shown in Figure 10 , the flip rates of CAN ID 0x285 bit 35 and bit 37 are 0 most of the time, and only appear as narrow pulses during the event reporting window, which meets the characteristics of "long-time residence + instantaneous switching" of binary state.

[0107] Multistate: As shown in Figure 11As shown, bit 29-31 of CAN ID 0x1f2 constitute a 3 bit multi-state section, three curves keep limited stable combination for a long time, and switch synchronously at a certain time period; the right side scatter diagram falls on the diagonal line, and the flip rate is completely synchronous, which shows a typical multi-state mode.

[0108] In another embodiment, the application reverses the function of the 48V BSG motor, specifically including the following:

[0109] 1) Test and collection

[0110] Through the connection of the CAN data collection tool and the OBD interface, the host computer executes data collection, data saving, data analysis and drawing, as shown in Figure 12 The host computer software is divided into three columns, the left side receives data in real time and groups them according to ID, the middle column performs data sending function, and the sending frequency, interval and sending times can be adjusted. The right column displays data analysis results and drawing function.

[0111] 2) 48V BSG motor starting function display

[0112] Through the above analysis method, the 48V BSG motor starting ID and message are reversed, and the analysis result is as shown in Figure 13 The data frame format is constructed, and the reversed message is sent back to see that the motor starts normally and maintains stable speed, and the speed diagram is as shown in 14.

[0113] 3) 48V BSG motor power generation function display

[0114] Through the above analysis method, the 48V BSG motor power generation ID and message are reversed, and the analysis result is as shown in Figure 13 The data frame format is constructed, and the reversed message is sent back to see that the motor generates power normally and maintains stable power generation state, and the power generation diagram is as shown in 15.

[0115] Through the above scheme, the application realizes the bit level automatic reverse analysis of CAN message without DBC file and external sensor, can accurately determine the signal boundary and type, and directly supports vehicle function control and scene verification.

[0116] Figure 16 Another bit level CAN data payload reverse method based on hierarchical clustering according to an embodiment of the application is shown in Figure 16 The method includes the following steps:

[0117] In step S1602, the original CAN message data in the vehicle operation process is collected by the CAN data collection tool, and the CAN message data is processed by using the frequency matrix, the probability matrix, the bit flip rate and the hierarchical clustering method to obtain the CAN message signal characteristics.

[0118] Firstly, the CAN message data is uniformly parsed according to the big-endian sequence to generate a bit sequence, and the bit sequence is arranged into an original bit matrix of a first preset size.

[0119] Then, based on the original bit matrix, the correlation of the original bit matrix based on the big-endian sequence assumption and the small-endian sequence assumption is calculated by the Pearson correlation coefficient respectively, the real end sequence is determined based on the correlation, and the original bit matrix of the first preset size is reconstructed based on the real end sequence to obtain a processed bit matrix.

[0120] Finally, the processed bit matrix is processed by using the frequency matrix, the probability matrix, the bit flip rate and the hierarchical clustering method to obtain the CAN message signal characteristics. For example, based on the value distribution of each bit in the processed bit matrix in the time sequence, the frequency matrix and the probability matrix of a second preset size are constructed, the occurrence number of each bit value is counted based on the frequency matrix and the probability matrix, and the fixed value signal is identified according to the occurrence number; the bit flip rate matrix is generated by taking the bit set output by the frequency matrix as the input, calculating the flip number of the bit in the bit set in the time sequence, and identifying the counter signal and the binary state signal by analyzing the flip rule of each bit in the bit flip rate matrix; based on the remaining bits after excluding the fixed value signal and the counter signal, the remaining bits are clustered and identified by using the hybrid similarity measure, the normalized mutual information, the Pearson correlation coefficient and the power law correction function to obtain the signal segment after clustering and identification; the signal segment after clustering and identification is compared with the dynamic feature result of the bit flip rate matrix, the candidate area of the comparison result is verified in combination with the checksum consistency feature to obtain the identification result, and the CAN message signal characteristics are formed based on all the identification results.

[0121] In step S1604, the CAN message signal is inversely analyzed by analyzing the CAN message signal characteristics and combining the signal types possessed by the automobile to obtain an inverse analysis result, wherein the inverse analysis result includes at least one of the following: fixed value signal, counter signal, checksum signal, physical value signal, binary state signal and multi-state signal.

[0122] Firstly, based on the CAN message signal characteristics, the statistical characteristics and timing characteristics of each bit of the CAN message signal characteristics are jointly analyzed to determine the value mode and change rule of each bit segment.

[0123] Then, based on the value mode and change rule of each bit segment, the CAN message signal is reversely analyzed to obtain the reverse analysis result. For example, according to the value mode, the bit always maintaining a single value is identified as a fixed value signal, and the bit segment having a periodic monotonic flip rule is identified as a counter signal; based on the bit flip rate, value range distribution and adjacent bit correlation, a physical value signal having a numerical continuous change characteristic is identified; for the remaining bit, based on the flip frequency, dominant state probability, information entropy threshold and time domain continuity constraint, a binary state signal having a binary state switching characteristic is identified; the bit combination obtained by hierarchical clustering identification is subjected to logical combination analysis, and if the value set thereof only contains a limited stable mode, it is determined as a multi-state signal; based on key value mapping and consistency check, the candidate region of the bit combination is subjected to consistency verification, and a checksum signal is identified.

[0124] Step S1606, based on the reverse analysis result, the function of the automobile is controlled.

[0125] By reconstructing the CAN message obtained by the reverse analysis into a transmittable control message, the function test or response verification of the execution component of the vehicle is performed; after controlling the function of the automobile, the accuracy of the reverse analysis result is evaluated according to the feedback signal of the execution component, and the analysis model is updated and corrected based on the evaluation result.

[0126] The application also provides a bit-level CAN data load reverse device based on hierarchical clustering, as shown in Figure 17 The processing module 1702 is configured to collect original CAN message data in the vehicle operation process through a CAN data acquisition tool, and process the CAN message data by using a frequency matrix, a bit flip rate and a hierarchical clustering method to obtain CAN message signal characteristics; the reverse module 1704 is configured to analyze the CAN message signal characteristics, and combine the signal types possessed by the automobile itself to reversely analyze the CAN message signal to obtain a reverse analysis result, wherein the reverse analysis result includes at least one of the following: a fixed value signal, a counter signal, a checksum signal, a physical value signal, a binary state signal and a multi-state signal; the control module 1706 is configured to control the function of the automobile based on the reverse analysis result.

[0127] It should be noted that the above embodiment provides a bit-level CAN data payload reverse device based on hierarchical clustering, and only the division of the above functional modules is exemplified, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the bit-level CAN data payload reverse device based on hierarchical clustering provided by the above embodiment and the bit-level CAN data payload reverse method based on hierarchical clustering embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0128] Figure 18 The structural schematic diagram of a computer device suitable for implementing the embodiments of the present disclosure is shown. It should be noted that, Figure 18 The computer device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.

[0129] As Figure 18 shown, the computer device includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage portion 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0130] The following components are connected to the I / O interface 1005: an input portion 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 1008 including a hard disk, and the like; and a communication portion 1009 including a network interface card such as a LAN card, a modem, and the like. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as necessary. A removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 1010 as necessary, so that a computer program read therefrom is installed in the storage portion 1008 as necessary.

[0131] The above is only the preferred embodiment of the present application, and it should be noted that those skilled in the art can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A hierarchical clustering based bit-level CAN data payload reverse method, characterized in that, The method comprises the steps of: Collecting original CAN message data during vehicle operation through a CAN data acquisition tool, and processing the CAN message data by using a frequency matrix, a probability matrix, a bit flip rate, and a hierarchical clustering method to obtain CAN message signal characteristics; By analyzing the CAN message signal characteristics and combining the signal types possessed by the automobile itself, the CAN message signal is inversely analyzed to obtain an inverse analysis result, wherein the inverse analysis result includes at least one of the following: fixed value signal, counter signal, checksum signal, physical value signal, binary state signal, and multi-element state signal; Based on the inverse analysis result, the function of the automobile is controlled.

2. The method of claim 1, wherein, Processing the CAN message data by using a frequency matrix, a probability matrix, a bit flip rate, and a hierarchical clustering method to obtain CAN message signal characteristics, comprising: The CAN message data is uniformly parsed according to the big-endian sequence to generate a bit sequence, and the bit sequence is arranged into an original bit matrix of a first preset size; Based on the original bit matrix, the correlation of the original bit matrix based on the big-endian sequence assumption and the small-endian sequence assumption is calculated by the Pearson correlation coefficient, the real end sequence is determined based on the correlation, and the original bit matrix of the first preset size is reconstructed based on the real end sequence to obtain a processed bit matrix; The frequency matrix, the probability matrix, the bit flip rate, and the hierarchical clustering method are used to process the processed bit matrix to obtain the CAN message signal characteristics.

3. The method of claim 2, wherein, Processing the processed bit matrix by using the frequency matrix, the probability matrix, the bit flip rate, and the hierarchical clustering method to obtain the CAN message signal characteristics, comprising: Based on the value distribution of each bit in the processed bit matrix in the time sequence, the frequency matrix and the probability matrix of a second preset size are constructed, the occurrence times of each bit value are counted based on the frequency matrix and the probability matrix, and the fixed value signal is identified according to the occurrence times; Taking the bit set output by the frequency matrix as input, the number of times of bit flip of the bits in the bit set in the time sequence is calculated, a bit flip rate matrix is generated, and the counter signal and the binary state signal are identified by analyzing the bit flip law of each bit in the bit flip rate matrix; Based on the remaining bits excluding the fixed value signal and the counter signal, the remaining bits are clustered and identified by using hybrid similarity measure, normalized mutual information, Pearson correlation coefficient, and power law correction function to obtain signal segments after clustering and identification; The signal segments after clustering and identification are compared with the dynamic characteristic results of the bit flip rate matrix, the candidate area of the comparison result is verified in combination with the checksum consistency feature to obtain an identification result, and the CAN message signal characteristics are formed based on all identification results.

4. The method of claim 1, wherein, By analyzing the CAN message signal characteristics and combining the signal types possessed by the automobile itself, the CAN message signal is inversely analyzed to obtain an inverse analysis result, comprising: based on the CAN message signal characteristics, the statistical characteristics and the timing characteristics of each bit of the CAN message signal characteristics are jointly analyzed to determine the value mode and the change law of each bit segment; based on the value mode and the change law of each bit segment, the CAN message signal is reversely analyzed to obtain the reverse analysis result.

5. The method of claim 4, wherein, based on the value mode and the change law of each bit segment, the CAN message signal is reversely analyzed to obtain the reverse analysis result, including at least one of the following: According to the value mode, the bit position always maintaining a single value is identified as a fixed value signal, and the bit segment having a periodic monotonic flip law is identified as a counter signal; based on the bit flip rate, the value range distribution and the adjacent bit correlation, a physical value signal having a numerical continuous change characteristic is identified; for the remaining bit positions, based on the flip frequency, the dominant state probability, the information entropy threshold and the time domain continuity constraint, a binary state signal having a binary state switching characteristic is identified; for the bit combination identified by hierarchical clustering, if the value set thereof only contains a limited stable mode, it is determined as a multi-state signal; based on the key value mapping and the consistency check, the consistency of the candidate region of the bit combination is verified, and a checksum signal is identified.

6. The method of claim 1, wherein based on the reverse analysis result, the function of the automobile is controlled, including: by reconstructing the CAN message obtained by the reverse analysis into a controllable message, the function of the vehicle execution component is tested or verified; after controlling the function of the automobile, the method further comprises: according to the feedback signal of the execution component, the accuracy of the reverse analysis result is evaluated, and the analysis model is updated and corrected based on the result of the evaluation.

7. A hierarchical clustering based bit-level CAN data payload reverse device, characterized in that, including: a processing module configured to collect original CAN message data during vehicle operation through a CAN data collection tool, and process the CAN message data by using a frequency matrix, a bit flip rate and a hierarchical clustering method to obtain CAN message signal characteristics; a reverse module configured to analyze the CAN message signal characteristics and combine the signal types possessed by the automobile itself to reversely analyze the CAN message signal to obtain a reverse analysis result, wherein the reverse analysis result includes at least one of the following: a fixed value signal, a counter signal, a checksum signal, a physical value signal, a binary state signal and a multi-state signal; a control module configured to control the function of the automobile based on the reverse analysis result.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein when the program runs, the device where the computer readable storage medium is located executes the method of any one of claims 1-6.

9. A computer device, comprising: including: a memory and a processor, the memory stores a computer program; the processor is configured to execute the computer program stored in the memory, and the computer program runs to make the processor execute the method of any one of claims 1-6.

10. A computer program product comprising a computer program, characterized in that, The computer program, which when executed by the processor, implements the steps of the method of any one of claims 1 to 6.