Communication data hijacking monitoring method, storage medium, and electronic device

By building a knowledge base and sliding window method to calculate the time difference in the CAN network, the problem of efficiency and accuracy of communication data hijacking monitoring in the CAN network is solved, rapid detection and monitoring of any vehicle model and platform is achieved, and the compatibility of the system is improved. performance and resource utilization.

CN115664788BActive Publication Date: 2024-10-18HUIZHOU DESAY SV INTELLIGENT TRANSPORTATION TECH INST CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202211299679.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2024-10-18
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

In the CAN network, external attacks may cause the ECU to be hijacked, send illegal messages, and thereby illegally control the car. It is difficult to effectively monitor and detect this communication data hijacking with existing technology.

Method used

By building a knowledge base, collecting CAN messages or tracking logs, calculating the average and critical value of the time difference of frame data, conducting data hijacking testing and monitoring, the sliding window method is used to optimize data processing and improve monitoring efficiency and accuracy.

Benefits of technology

It realizes fast and efficient monitoring of CAN communication data, can effectively detect abnormal information, improves system compatibility and computing power, is suitable for any vehicle model and target platform, and saves resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115664788B_ABST
    Figure CN115664788B_ABST
Patent Text Reader

Abstract

The present invention provides a communication data hijacking monitoring method and system, a storage medium, and an electronic device. The method calculates the average value P of the time difference of each frame of data and the first critical value L of the average value P for CAN messages or CAN tracking logs within a continuous time T through a sliding window method, completes knowledge base training after N iterations, and then performs communication data hijacking monitoring on the collected real-time data. Whether it is a learning and training process or a monitoring process, only the average value of the data needs to be calculated, which is faster and more resource-saving than existing machine or deep learning algorithms, and further expands resource utilization. The present invention only needs a timestamp and an ID to complete monitoring, and can be applied to any vehicle model and target platform / MCU or SoC of an ECU, effectively improving the compatibility and computing power of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a communication data hijacking monitoring method and system, a storage medium, and an electronic device. Background Art

[0002] In recent years, the system configuration in the car has a large number of devices called electronic control units (ECU: Electronic Control Unit, also marked as "ECU" below). The communication network connecting these ECUs is called the vehicle network. There are a large number of communication standards for vehicle networks. One of the most mainstream vehicle network standards is the controller area network (Controller Area Network, hereinafter referred to as "CAN"), and the CAN bus is crucial for the connection of key areas such as infotainment, chassis control, body electronics, and powertrain.

[0003] In a network based on the CAN standard (hereinafter also referred to as a "CAN network"), the communication path (bus) is composed of two cables, and the ECU connected to the bus is also called a node. Each node connected to the bus sends and receives data in units called frames or messages. In addition, in CAN, identifiers indicating the destination or source of data are not used. The node that sends the frame attaches an ID called a message ID to each message to indicate the type of message and sends it, that is, sends a signal to the bus. The node that receives the message only receives messages containing a predetermined message ID, that is, reads the signal from the bus. Messages with the same ID are sent at a predetermined period.

[0004] As mentioned above, a large number of ECUs configured in the system of the car are connected to the CAN network respectively, and work while exchanging various messages with each other. Here, the ECU having the communication function with the outside of the CAN network may be hijacked by external attacks, etc., and may cause illegal messages to be sent to the CAN network. Such hijacked ECUs may illegally control the car by, for example, disguising themselves as other ECUs and sending attack messages. Summary of the invention

[0005] In response to the above technical problems, the present invention proposes a communication data hijacking monitoring method and system, a storage medium, and an electronic device. A knowledge base is constructed to construct a communication data hijacking monitoring standard, and the knowledge base is used to perform data testing on a test module to obtain a communication data hijacking result.

[0006] Specifically, the communication data hijacking monitoring method described in the present invention comprises the following steps:

[0007] S1: Collect CAN messages or CAN tracking logs within a continuous time T, divide the collected data into multiple data packets according to a time interval t, and calculate the average value P of the time difference of each frame of data in each data packet;

[0008] S2: Calculate a first critical value L according to the average value P; send the average value P and the first critical value L to a knowledge base to complete data training;

[0009] S3: Collect current CAN communication data, use the knowledge base to perform data hijacking test, and complete data monitoring.

[0010] Each frame of data includes at least a frame ID and a timestamp corresponding to each frame ID. The time difference between adjacent timestamps is calculated through each frame ID and its timestamp, and then the average value P is calculated.

[0011] Through the simple calculation in the above method, it is possible to determine whether the time of adjacent timestamps is abnormal. In the process of checking a large amount of data, the efficiency of data supervision can be effectively improved, and the supervision work can be completed without very large computing power. The verified data can be further updated to the knowledge base, continuously optimizing the data in the knowledge base, and further completing the data supervision mechanism and the accuracy of data judgment.

[0012] Preferably, the collected data is divided into multiple data packets at a time interval, and a sliding window method can be used for data collection. According to the sliding window method, a data set N is obtained, where N is the number of sliding windows, and the data set N is divided into i data groups according to the timestamp size, where data set N = data group n1, data group n2, ..., data group ni; the average value P of the time difference of the data group ni is calculated.

[0013] The first critical point L=MAX (average value P-average value Q of time differences of all frame data within time T).

[0014] Preferably, the S2 further comprises: iteratively calculating the above steps S1 and S2 to calculate the maximum critical point L' in the knowledge base, wherein the maximum critical point L'=MAX first critical point L.

[0015] The S3 also includes: calculating the time difference between the current frame and the next frame data, and calculating the average value P' of the time difference after each accumulated time t; calculating the second critical point L'=MAX (average value P'-average value Q' of the time difference of all frame data within the current time T); judging whether the second critical point L' is greater than the maximum critical point L' in the knowledge base, if so, abnormal information is detected; otherwise, the CAN communication data is normal.

[0016] As another preferred embodiment, the present invention also proposes a communication data hijacking monitoring system, which at least includes the following:

[0017] A training module, comprising a first acquisition unit, a data division unit, a data processing unit and a knowledge base;

[0018] The first collection unit is used to collect CAN messages or CAN tracking logs;

[0019] The data division unit divides the data collected by the data collection unit into a data set N according to a sliding window method, and divides the data set N into i data packets at a time interval t;

[0020] The data processing unit is used to calculate an average value P of the time difference of each frame of data in each data packet, calculate a first critical value L according to the average value P; and send the average value P and the first critical value L to a knowledge base;

[0021] The knowledge base calculates a maximum critical point L' according to the first critical value L;

[0022] A testing module, comprising a second acquisition module, a calculation unit and a detection unit;

[0023] The second acquisition module is used to acquire current CAN communication data;

[0024] The calculation unit is used to calculate the time difference between the current frame and the next frame data, and calculate the average value P' of the time difference and the second critical point L' after accumulating t time.

[0025] The detection unit compares the second critical point L' with the knowledge base to monitor the current CAN communication data hijacking.

[0026] It can be seen that the communication data hijacking monitoring system described in the present invention can be applied to MCU or SoC of any vehicle model and target platform / ECU, effectively improving the compatibility and computing power of the system.

[0027] The data processing unit specifically includes the following calculation process:

[0028] The first critical point L=MAX (average value P-average value Q of time differences of all frame data within time T).

[0029] The maximum critical point L'=MAX first critical point L.

[0030] The second critical point L'=MAX (average value P'-average value Q' of the time difference of all frame data within the current time T).

[0031] Preferably, the average value P' and the calculated second critical point L' are updated to the knowledge base as the knowledge base for the next test.

[0032] As another preferred embodiment, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication data hijacking monitoring method as described above.

[0033] As another preferred embodiment, the present invention also proposes an electronic device, comprising: a computer-readable storage medium as described above; and one or more processors, for executing a program in the computer-readable storage medium to implement communication data hijacking monitoring, wherein the electronic device is installed at least on any vehicle end, or the MCU or SoC end of the ECU, for performing CAN communication data hijacking monitoring.

[0034] In summary, the present invention provides a communication data hijacking monitoring method and system, a storage medium, and an electronic device. The sliding window method is used to calculate the average value P of the time difference of each frame of data and the first critical value L of the average value P for CAN messages or CAN tracking logs within a continuous time T. After N iterations, the knowledge base training is completed, and then the collected real-time data is monitored for communication data hijacking. Whether it is a learning and training process or a monitoring process, only the average value of the data needs to be calculated, which is faster and more resource-saving than existing machine or deep learning algorithms, and further expands resource utilization. The present invention only needs a timestamp and an ID to complete monitoring, and can be applied to any vehicle model and target platform / ECU MCU or SoC, effectively improving the compatibility and computing power of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 The present invention is a flowchart of a communication data hijacking monitoring method.

[0036] Figure 2 A schematic diagram of a communication data hijacking monitoring system according to the present invention. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] like Figure 1As shown, the present invention proposes a communication data hijacking monitoring method, which monitors the real-time collected data based on the pre-conducted knowledge base training. Before the knowledge base training, the learning data used is the historical data of the system, such as CAN messages or CAN tracking logs collected by the system within a certain period of time. For training data, the more the better, and the amount of training data is increased according to actual needs.

[0039] Specifically, the method comprises the following steps:

[0040] S1: Collect CAN messages or CAN tracking logs within a continuous time T, divide the collected data into multiple data packets according to a time interval t, and calculate the average value P of the time difference of each frame data in each data packet; wherein each frame data includes at least a frame ID and a timestamp corresponding to each frame ID.

[0041] The step of dividing the collected data into a plurality of data packets at a time interval also includes: using a sliding window method to collect data.

[0042] S2: Calculate a first critical value L according to the average value P; send the average value P and the first critical value L to a knowledge base to complete data training;

[0043] The first critical point L=MAX (average value P-average value Q of time differences of all frame data within time T).

[0044] The steps S1 and S2 are iteratively calculated to calculate the maximum critical point L' in the knowledge base.

[0045] Wherein, the maximum critical point L'=MAX first critical point L.

[0046] S3: Collect current CAN communication data, use the knowledge base to perform data hijacking test, and complete data monitoring.

[0047] Preferably, the currently collected data is processed first to calculate the average value P' and the second critical point L'. Specifically:

[0048] Calculate the time difference between the current frame and the next frame data, and calculate the average value P' of the time difference after accumulating t time.

[0049] Calculate the second critical point L'=MAX (average value P'-average value Q' of the time difference of all frame data within the current time T).

[0050] It is determined whether the second critical point L' is greater than the maximum critical point L' in the knowledge base. If so, abnormal information is detected; otherwise, the CAN communication data is normal.

[0051] Among them, data hijacking is specifically manifested as the attacker continuously sending CAN data packets at very small time intervals, with the purpose of invalidating the CAN bus or trying to obtain the highest priority. For this reason, when the attacker sends a message with a high priority ID, or a higher frequency of CAN messages with a higher priority, or sends a CAN message with a high data length, it will occupy a longer CAN bus time, and the final average value P will become larger. Therefore, the present invention calculates the average value P of the time difference of each frame of data, and then calculates the first critical value L of the average value P. It can be judged that there is abnormal information by the increase of the first critical value L, otherwise it is normal. Whether it is a learning and training process or a monitoring process, it only needs to calculate the average value of the data, which is faster and more resource-saving than existing machine or deep learning algorithms, and also further expands resource utilization.

[0052] Furthermore, the use of the sliding window method to process the collected data and complete the construction of the knowledge base is specifically as follows:

[0053] Collect CAN messages or CAN tracking logs, which may be CAN historical data information or loaded from the cloud, obtain data set N according to the sliding window method, N is the number of sliding windows, and divide the data set N into i data groups according to the timestamp size, where data set N = data group n1, data group n2, ..., data group ni; wherein each array contains multiple timestamp data.

[0054] Calculate the average value Pi of the time difference of the data group ni, specifically:

[0055]

[0056] Calculate the second critical point Li'=MAX (current average time difference Pi-average time difference Q' of data set N) and save it to the knowledge base;

[0057] Among them, the average time difference Q' of data set N is specifically:

[0058]

[0059] Iterate the calculation steps S31 to S33, and set the maximum critical point L'=MAX first critical point L.

[0060] As a preferred example, Figure 2 As shown, the present invention also proposes a communication data hijacking monitoring system, which at least includes the following:

[0061] A training module, comprising a first acquisition unit, a data division unit, a data processing unit and a knowledge base;

[0062] The first collection unit is used to collect CAN messages or CAN tracking logs;

[0063] The data division unit divides the data collected by the data collection unit into a data set N according to a sliding window method, and divides the data set N into i data packets at a time interval t;

[0064] The data processing unit is used to calculate an average value P of the time difference of each frame of data in each data packet, calculate a first critical value L according to the average value P; and send the average value P and the first critical value L to a knowledge base;

[0065] The knowledge base calculates a maximum critical point L' according to the first critical value L;

[0066] A testing module, comprising a second acquisition module, a calculation unit and a detection unit;

[0067] The second acquisition module is used to acquire current CAN communication data;

[0068] The calculation unit is used to calculate the time difference between the current frame and the next frame data, and calculate the average value P' of the time difference and the second critical point L' after accumulating t time each time;

[0069] The detection unit compares the second critical point L' with the knowledge base to monitor the current CAN communication data hijacking.

[0070] Furthermore, the system is connected to the vehicle-mounted central control display screen or a third-party terminal. When the detection unit finds an abnormality, it is sent to the display screen or the third-party terminal through the output port and an abnormal prompt or alarm is initiated.

[0071] It can be seen that the communication data hijacking monitoring system of the present invention can be applied to MCU or SoC of any vehicle model and target platform / ECU, effectively improving the compatibility and computing power of the system.

[0072] The data processing unit specifically includes the following calculation process:

[0073] The first critical point L=MAX (average value P-average value Q of time differences of all frame data within time T).

[0074] The maximum critical point L'=MAX first critical point L.

[0075] The second critical point L'=MAX (average value P'-average value Q' of the time difference of all frame data within the current time T).

[0076] Preferably, the average value P' and the calculated second critical point L' are updated to the knowledge base as the knowledge base for the next test.

[0077] As another preferred embodiment, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication data hijacking monitoring method as described above.

[0078] As another preferred embodiment, the present invention also proposes an electronic device, comprising: a computer-readable storage medium as described above; and one or more processors, for executing a program in the computer-readable storage medium to implement communication data hijacking monitoring, wherein the electronic device is installed at least on any vehicle end, or the MCU or SoC end of the ECU, for performing CAN communication data hijacking monitoring.

[0079] Preferably, in addition to calculating the average time difference, the present invention may optionally calculate the variance / standard deviation, but is not limited thereto. The advantage of this algorithm is that it can detect whether a DoS attack occurs in a very short time, and reacts more promptly than common machine learning algorithms. The algorithm of the present invention requires less memory and can be applied to various types of target platforms or MCUs or SoCs of ECUs to monitor data security in real time.

[0080] Preferably, the present invention further proposes a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0081] As another preferred embodiment, the present invention also proposes an electronic device, comprising: the computer-readable storage medium as described above; and one or more processors for executing the program in the computer-readable storage medium, the electronic device being installed at least on any vehicle end, or the MCU or SoC end of the ECU, for performing CAN communication data hijacking monitoring.

[0082] In summary, the present invention provides a communication data hijacking monitoring method and system, a storage medium, and an electronic device. The sliding window method is used to calculate the average value P of the time difference of each frame of data and the first critical value L of the average value P for CAN messages or CAN tracking logs within a continuous time T. After N iterations, the knowledge base training is completed, and then the collected real-time data is monitored for communication data hijacking. Whether it is a learning and training process or a monitoring process, only the average value of the data needs to be calculated, which is faster and more resource-saving than existing machine or deep learning algorithms, and further expands resource utilization. The present invention only needs a timestamp and an ID to complete monitoring, and can be applied to any vehicle model and target platform / ECU MCU or SoC.

[0083] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0084] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0085] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0086] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0087] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A communication data hijacking monitoring method, It is characterized in that The following steps are involved: S1: Collect CAN messages or CAN tracking logs within a continuous time T, divide the collected data into multiple data packets according to a time interval t, and calculate the average value P of the time difference of each frame of data in each data packet; S2: Calculate the first critical point L according to the average value P; send the average value P and the first critical point L to the knowledge base to complete data training; Wherein, the first critical point L=MAX(average value P-average value Q of time difference values ​​of all frame data within time T); Iterate the steps S1 and S2 to calculate the maximum critical point L' in the knowledge base, where the maximum critical point L'=MAX(first critical point L); S3: Collect current CAN communication data, use the knowledge base to perform data hijacking test, and complete data monitoring; Among them, S3 also includes: Calculate the time difference between the current frame and the next frame data, and calculate the average value P' of the time difference every accumulated time t; calculate the second critical point L'=MAX (average value P'-average value Q' of the time difference of all frame data within the current time T), and determine whether the second critical point L' is greater than the maximum critical point L' in the knowledge base. If so, abnormal information is detected; otherwise, the CAN communication data is normal.

2. A communication data hijacking monitoring method according to claim 1, It is characterized in that Each frame of data includes at least a frame ID and a timestamp corresponding to each frame ID.

3. A communication data hijacking monitoring method according to claim 2, It is characterized in that The method of dividing the collected data into a plurality of data packets at a time interval t also includes: using a sliding window method to collect data.

4. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the communication data hijacking monitoring method described in any one of claims 1 to 3 are implemented.

5. An electronic device, It is characterized in that include: The computer readable storage medium as claimed in claim 4; And one or more processors, used to execute the program in the computer-readable storage medium to realize communication data hijacking monitoring, the electronic device is installed at least on any vehicle end, or the MCU or SoC end of the ECU, for performing CAN communication data hijacking monitoring.

Citation Information

Patent Citations

  • Vehicle-mounted CAN bus self-adaptive intrusion detection method based on message periodic characteristics

    CN110691104A

  • Video monitoring equipment fault detection system

    CN111818286A

  • Fraud-detection method, fraud-detection electronic control unit and fraud-detection system

    CN112261026A

  • Vehicle-mounted network anomaly detection method and system based on correlation analysis

    CN112787984A

  • CAN bus anomaly detection method and system and storage medium

    CN113625681A