Network attack detection method applied to vehicle, vehicle and storage medium

By collecting voltage and message information in the vehicle communication network and identifying multiple attack modes in combination with machine learning algorithms, the problem of difficulty in detecting complex network attacks in the prior art is solved, and high-precision and fast-responsive network security detection is achieved.

CN120433950APending Publication Date: 2025-08-05BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411707949.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and detect complex network attacks in vehicle communication networks, especially CAN networks, which leads to insufficient security and is difficult to prevent interference to the core control module.

Method used

By collecting voltage information and message information from the physical layer for network attack detection, it is difficult to forge the physical signal of voltage information to identify and disguise attacks, combining message information identification and playback and denial of service attacks, machine learning algorithms are used for feature extraction and classification, and cloud-edge collaboration is used for model training and update.

Benefits of technology

It improves the detection accuracy and identification range of vehicle communication network attacks, reduces the risks of missed detection and missed detection, achieves rapid response and real-time updates, and enhances network security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120433950A_ABST
    Figure CN120433950A_ABST
Patent Text Reader

Abstract

The invention discloses a network attack detection method applied to a vehicle, the vehicle and a storage medium. When the message transmitted by the vehicle communication network is received, whether the vehicle communication network is attacked or not is detected by acquiring the voltage information of the vehicle communication network and the message information of the message. According to the application, the voltage information is acquired from the physical layer, the disguised attack aiming at the vehicle communication network can be effectively identified by utilizing the characteristic that the physical signal is not easy to counterfeit, the message information is acquired from the data link layer and the application layer, and the network attacks such as replay attack and denial of service attack can be identified by utilizing the verification information carried by the message. In this way, multiple attack modes for the vehicle communication network can be effectively recognized by combining the mixed features of the two dimensions, and the precision of detecting the attack of the vehicle communication network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle detection technology, and in particular to a network attack detection method applied to a vehicle, a vehicle, and a storage medium. Background Art

[0002] With the rapid development of electrification and internet technology, intelligent networked vehicles have emerged. In the future, more and more vehicles will be equipped with network control systems. However, the resulting vehicle network security issues are becoming increasingly serious. Take the communication transmission of the Controller Area Network (CAN) as an example. CAN communication is the most widely used vehicle electronic control unit (ECU) bus network. However, the CAN network uses a broadcast transmission mechanism, and due to bandwidth and transmission rate limitations, it is generally difficult to deploy firewalls, information encryption, and device authentication strategies, which means that it is impossible to detect the sender of the information. Attackers can access the CAN bus network and interfere with the vehicle's core control modules, such as the engine control module and electronic brake control module, indirectly threatening the personal safety of passengers. However, because attacks on vehicle communication networks often occur in various forms, detecting more complex attacks on vehicle communication networks is more difficult. Summary of the Invention

[0003] The present application provides a network attack detection method, a vehicle, and a storage medium applied to a vehicle, which improves the detection accuracy of the vehicle communication network to at least partially solve the above-mentioned technical problems.

[0004] To achieve the above objectives, according to a first aspect of the present application, a network attack detection method for a vehicle is provided, comprising:

[0005] Upon receiving a message transmitted by the vehicle communication network, obtaining voltage information of the vehicle communication network and message information of the message;

[0006] Based on voltage information and message information, detect whether the vehicle communication network is under cyber attack.

[0007] Optionally, the vehicle includes a control unit that accesses a vehicle communication network to receive messages, and detects whether the vehicle communication network is under a network attack based on voltage information and message information, including:

[0008] Performing feature extraction on the voltage information and the message information respectively to obtain first feature information of the voltage information and second feature information of the message information;

[0009] predicting a predicted control parameter of the control unit based on the first feature information and the second feature information;

[0010] Based on the predicted control parameters and the set control parameters, it is detected whether the vehicle communication network is under cyber attack.

[0011] Optionally, detecting whether the vehicle communication network is subject to a network attack based on the predicted control parameter and the set control parameter includes:

[0012] Determine the error rate of the predicted control parameters based on the predicted control parameters and the set control parameters;

[0013] If the error rate is greater than the set error rate threshold, it is determined that the vehicle communication network is under a network attack.

[0014] Optionally, predicting a predicted control parameter of the control unit according to the first feature information and the second feature information includes:

[0015] The first feature information and the second feature information are input into a target classifier to obtain the predicted control parameters.

[0016] Optionally, the network attack detection method further includes a step of training the classification model to obtain a target classifier, which includes:

[0017] Obtaining a sample training set, the sample training set including a plurality of training samples, the training samples including sample features and calibration parameters corresponding to the sample features, the sample features including a first sample feature corresponding to the sample voltage information and a second sample feature corresponding to the sample message information;

[0018] Input the training samples into the classification model to be trained to obtain the prediction parameters;

[0019] The classification model to be trained is iteratively updated according to the prediction parameters and calibration parameters until the convergence condition of the model training is reached to obtain the target classifier.

[0020] Optionally, the vehicle communicates with a cloud server, and the step of training the classification model to obtain a target classifier is performed by the cloud server. The network attack detection method further includes:

[0021] Obtain the target classifier from the cloud server and store the target classifier in the vehicle's memory.

[0022] Optionally, the step of training the classification model to obtain a target classifier further includes:

[0023] In response to receiving the newly input first feature information and second feature information, iteratively training the target classifier through incremental learning to obtain iterated model parameters of the target classifier;

[0024] The model parameters of the target classifier stored in the vehicle are updated based on the iterated model parameters to iteratively update the target classifier.

[0025] Optionally, the network attack detection method further includes:

[0026] When it is determined that the vehicle communication network is under a network attack, the vehicle is triggered to send an alarm message.

[0027] Optionally, the network attack detection method further includes:

[0028] In response to feedback information regarding the alarm information, obtaining a response strategy for the network attack included in the feedback information;

[0029] Perform cybersecurity control on vehicles based on response strategies.

[0030] According to a second aspect of the present application, there is provided a vehicle comprising:

[0031] a memory configured to store instructions; and

[0032] The processor is configured to call instructions from the memory and implement the above-mentioned network attack detection method applied to the vehicle when executing the instructions.

[0033] According to a third aspect of the present application, a computer-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned network attack detection method applied to a vehicle.

[0034] In summary, when receiving a message transmitted by a vehicle communication network, this application detects whether the vehicle communication network is under a network attack by obtaining the voltage information of the vehicle communication network and the message information of the message. This application collects voltage information from the physical layer and uses the characteristic that physical signals are not easily forged to effectively identify disguised attacks against the vehicle communication network. It also collects message information from the data link layer and application layer and uses the verification information carried by the message to identify network attacks such as replay attacks and denial of service attacks. In this way, combining the hybrid features of the two dimensions can effectively identify various attack modes against the vehicle communication network, improving the accuracy of detecting vehicle communication network attacks.

[0035] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.

[0037] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same drawing numbers represent the same parts in the following description.

[0038] Figure 1 A schematic diagram of an application environment of a network attack detection method applied to a vehicle provided in an embodiment of the present application;

[0039] Figure 2 This is a schematic diagram of the structure of a network attack detection system applied to a vehicle provided in an example of this application;

[0040] Figure 3 A schematic diagram of a CAN transceiver circuit provided in an embodiment of the present application;

[0041] Figure 4 A schematic flow chart of a network attack detection method applied to a vehicle provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of a target classifier training process provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of a Softmax function structure provided in an embodiment of the present application;

[0044] Figure 7 This is a structural block diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0046] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the described features. In the description of this application, "plurality" means two or more, unless otherwise specifically qualified. In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is provided to enable anyone skilled in the art to implement and use the present application. In the following description, details are listed for illustrative purposes. It should be understood that one of ordinary skill in the art will recognize that the present application can be implemented without these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.

[0047] The vehicle communication network is a network system for connecting and transmitting data. The vehicle communication network enables communication and data exchange between various ECUs of the vehicle. In the embodiment of the present application, the vehicle communication network is taken as CAN as an example. CAN is one of the commonly used communication networks in vehicles. However, CAN adopts a broadcast transmission mechanism and is limited by bandwidth and transmission rate. It is difficult to deploy firewalls, information encryption and device authentication strategies. It is unable to identify and detect senders and is vulnerable to network attacks. In related technologies, gateways are usually used as detection devices to identify network attacks, and network attack detection is usually based on a single dimension of message information. However, the computing power of the gateway is limited, which can easily cause failures in the entire vehicle communication network. In addition, network attacks usually include replay attacks, denial of service attacks and spoofing attacks. If detection is performed from a single dimension of message information, it is difficult to identify complex spoofing attacks.

[0048] Based on this, an embodiment of the present application provides a method for detecting network attacks on a vehicle communication network from two dimensions: physical voltage information and message information. Among them, voltage information refers to the voltage level of the differential signal of the communication bus in the vehicle communication network, which is used to represent the logical state of the data. Message information refers to data transmitted through the communication bus, and may include, for example, a message identifier (ID), data, and other control information. In this way, the characteristics of message information such as the message frame interval and the message ID in the message information can be used to identify network attacks such as replay attacks and denial of service attacks. At the same time, the characteristic that physical signals are not easy to forge can be used to identify disguised attacks through the characteristics of voltage information. Combining the hybrid features of the two dimensions can increase the scope of identifying network attacks and improve the accuracy of identifying network attacks.

[0049] In the related art, network attacks are usually detected based on traditional methods such as table lookup and manual analysis. This method has a low degree of automation and intelligence, and there is a risk of missed detection and false detection. It also has poor flexibility and is difficult to update. Based on this, the embodiment of the present application can introduce a machine learning algorithm to identify whether the message information is legitimate message information, thereby improving the automation and intelligence of network attack detection. Compared with traditional detection methods, the machine learning algorithm can identify attack patterns more quickly and respond faster. At the same time, the recognition accuracy of this method is high, and it can discover complex attack features that are difficult to detect manually. It can also adapt to new attack patterns through continuous learning and updating, reducing the risk of missed detection and false detection.

[0050] Because the edge devices on vehicles used for edge computing have limited computing resources when performing attack identification, the algorithm complexity and training speed are easily restricted, and model updates and upgrades cannot be performed frequently, resulting in low computational accuracy. Therefore, as an example, a cloud-edge collaborative network attack detection method for vehicles can be provided. This method utilizes cloud servers for model training to improve the performance of machine learning models, and only lightweight computing tasks such as data preprocessing and model execution are assigned to the vehicle's edge devices to reduce the pressure on the cloud servers. This cloud-edge collaboration approach allows the complexity and training speed of machine learning algorithms to be unrestricted, and models can be updated in real time. The vehicle's edge devices can be units with certain computing capabilities, such as the vehicle control unit (VCU) and onboard computer. While these devices cannot meet the requirements of large-scale machine learning model training, they are fully capable of handling some simple data processing tasks and have the ability to execute models. In addition, executing the model close to the source of the vehicle control unit can reduce the delay caused by data transmission, improve response speed, and achieve online real-time network attack identification.

[0051] The following uses the application scenario of cloud-edge collaborative network attack detection as an example to illustrate the application environment of the network attack detection method in the embodiment of the present application. Figure 1 As shown, Figure 1 This is a schematic diagram of an application environment of a network attack detection method applied to a vehicle provided in an embodiment of the present application. The application environment may include a communication network 1, an information acquisition device 2, an edge device 3 and a cloud server 4. Among them, the communication network 1 is used to connect the ECU and the edge device 3 of the vehicle. The information acquisition device 2 is used to collect voltage information of the communication network 1 and message information of the message. In an example, the voltage information can be collected by an oscilloscope, and the message information can be collected by an information acquisition device such as USBCAN-IIPRO. The edge device 3 is used to process some lightweight computing tasks, reduce the computing pressure of the cloud server and improve the real-time fast data processing capabilities. At the same time, the edge device 3 can also communicate with the cloud server 4. The cloud server 4 is used to regularly train the machine learning model and send the trained machine learning model to the edge device 3.

[0052] like Figure 2 As shown, based on the above application environment, an embodiment of the present application provides a network attack detection system for a vehicle. In this network attack detection system, communication network 1 is a CAN communication network, and information collection device 2 is a CAN information collector. Edge device 3 includes a CAN transceiver module 31, an identification module 32, and a communication module 33. The CAN information collector connects the CAN communication network to the CAN transceiver module 31.

[0053] The CAN transceiver module 31 is used to send and receive CAN message information of the vehicle CAN communication network. In order to improve the reliability and security of the vehicle communication network, the CAN transceiver module 31 can be composed of two CAN channels and an isolated power supply. Figure 3 Schematic diagram of a CAN transceiver circuit provided in an embodiment of the present application. Figure 3As shown, the circuit diagrams for CAN1 and CAN2 are identical and are collectively referred to as CAN. CAN_RX is the CAN receiver, and CAN_TX is the CAN transmitter. CAN_P is the positive terminal of the CAN bus, and CAN_N is the negative terminal of the CAN bus. CAN_P and CAN_N are the differential signal line pair of the CAN bus. CAN_TX and CAN_RX are connected to CAN_P and CAN_N via receiver chip U1. Resistors R1 and R2 are used to disconnect the circuit during debugging, and L1 is an inductor. Inductor L1, along with resistors R3, R4, capacitors C1, C2, and C3, form a filter circuit. Resistors R3 and R4 serve as the CAN terminal load. Capacitors C4 and C5 are used for power supply filtering, and diode D1 protects the circuit from reverse voltage and high voltage. This allows the transmitter and receiver to receive message signals from the CAN communication network, and the differential signal line pair to receive voltage signals from the CAN communication network, achieving two-dimensional data transmission.

[0054] The identification module 32 may include a data processing unit, a feature selection unit, an online attack identification unit, an incremental learning unit, etc. The identification module 32 may be implemented by a microcontroller unit (MCU), for example, a high-computing chip such as the IMX series.

[0055] The communication module 33 may be a 4G communication module, etc. In addition, the edge device 3 may also be powered by a power supply device of the vehicle (not shown in the figure). The cloud is a remote server.

[0056] The cloud server 4 may include a feature extraction unit and a model training unit, wherein the model training unit may include a lightweight model training subunit and a complex model training subunit. The cloud server 4 may use historical data for feature extraction or may collect data from the edge device 3 in real time for feature extraction.

[0057] It should be noted that the above-mentioned cyber-attack detection system for vehicles is merely an example. Based on this example, the following describes a cyber-attack detection method for vehicles. It should be noted that the order in which the following embodiments are described does not limit the preferred order of the embodiments. Although the flowcharts illustrate a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying figures.

[0058] Figure 4 Schematic diagram of a flow chart of a network attack detection method applied to a vehicle provided in an embodiment of the present application. Figure 4 As shown, the network attack detection method may include steps 401-402, which are described in detail below.

[0059] Step 401: When receiving a message transmitted by a vehicle communication network, obtain voltage information of the vehicle communication network and message information of the message.

[0060] In this application, voltage information refers to the voltage level of the vehicle's communication network. Each ECU has unique voltage response characteristics, and voltage signals are physical signals that are difficult to forge. Therefore, using physical characteristics as features can effectively identify network attacks similar to spoofing attacks.

[0061] In the implementation of this application, message information typically includes a message ID and ECU parameters. The message ID may include the ID of the sending ECU and the ID of the receiving ECU. Each ECU has its own unique identifier, which serves as proof of identity, allowing the sending end to determine the ECU to which it is sending, and the receiving end to determine the source of the message. As an example, the message information can be initially filtered based on the message ID, and the physical voltage signal can be de-noised using signal processing techniques.

[0062] Step 402: Detect whether the vehicle communication network is under a network attack based on the voltage information and the message information.

[0063] In an embodiment of the present application, feature extraction can be performed on the voltage information and the message information respectively to obtain first feature information of the voltage information and second feature information of the message information. The first feature information is the feature information of the voltage information, and the second feature information is the feature information of the message information. Then, based on the extracted first feature information and the second feature information, a machine learning algorithm is used to detect whether the vehicle network is under a network attack. Specifically, the edge device can perform feature extraction based on the processed data to obtain feature information of the voltage information and the message information. Feature extraction refers to the process of selecting a set of related feature subsets in order to build a machine learning model. There are three main purposes of using feature selection technology: to simplify the model, to shorten the training time, and to improve generalization ability by reducing overfitting. Feature extraction usually focuses on selecting the most influential features from the raw data.

[0064] As an example, a timestamp mechanism can be used to collect the inter-frame time interval of transmitted messages from the vehicle communication network bus. Simultaneously, an oscilloscope can be used to collect voltage information and time parameters from the vehicle communication network's frame differential signal, performing analog-to-digital data processing to obtain edge times and voltage modes. Therefore, first characteristic information may include, but is not limited to, rising / falling edge waveforms, maximum / minimum voltage values, response gap voltage, rising edge duration, rising edge bit time, and edge oscillation waveforms. Second characteristic information may include, but is not limited to, message IDs and inter-frame time intervals.

[0065] To achieve lightweight detection, reduce computing resource consumption, and improve model training efficiency, the most influential and relatively simple physical information should be selected. The rising / falling edge waveforms and the response gap voltage should be excluded. Instead, the dominant bit time of the voltage information and the voltage mode, as well as the frame time interval characteristics of the message information, should be selected to construct feature information. This feature information can be used as an ECU fingerprint. The ECU fingerprint refers to the unique and difficult-to-forge feature of each ECU that can identify each ECU.

[0066] Then, the predicted control parameters of the control unit are predicted based on the first feature information and the second feature information. Based on the predicted control parameters and the set control parameters, it is detected whether the vehicle communication network is under a network attack. In an embodiment of the present application, the control parameters refer to the parameter information in the vehicle communication network transmission message predicted based on the ECU fingerprint. For example, the message format, message ID, data content, security, etc. included in the message related to the ECU. Therefore, the predicted control parameters are control parameters predicted by a machine learning algorithm. The set predicted control parameters are pre-configured control parameters that can be correctly transmitted, that is, legal control parameters. As an example, a machine learning algorithm can be performed based on the ECU fingerprint to obtain the predicted control parameters of the ECU. By comparing the predicted control parameters with the set predicted control parameters, it can be determined whether the vehicle communication network is under attack. The machine learning algorithm can quickly detect network attacks.

[0067] In summary, the embodiments of the present application collect voltage information from the physical layer, leveraging the inherent difficulty of forging physical signals to effectively identify spoofing attacks against vehicle communication networks. Furthermore, they collect message information from the data link layer and application layer, utilizing the verification information carried in the messages to identify network attacks such as replay attacks and denial of service attacks. In this way, combining these two dimensions of hybrid features can effectively identify various attack patterns against vehicle communication networks, improving the accuracy of detecting attacks on vehicle communication networks.

[0068] Since network attackers may send malicious data packets or try to interfere with normal communication processes, network attacks usually lead to an increase in the error rate in the vehicle communication network. However, an increase in the error rate does not necessarily mean that a network attack has occurred. For example, it may be due to interference from other factors such as network congestion, hardware failure, and transmission noise. Only error rates exceeding a certain threshold can serve as an alarm indicating a possible network attack. Based on this, in step 402, the error rate of the predicted control parameters can be determined based on the predicted control parameters and the set control parameters. If the error rate is greater than the set error rate threshold, it is determined that the vehicle communication network is under a network attack. Among them, the error rate threshold refers to the threshold for determining that the vehicle communication network is under a network attack. In actual applications, it can be determined by combining the specific network environment and analyzing historical data.

[0069] In one example, the error rate of the predicted control parameters can be determined by a confusion matrix. Specifically, the rows of the confusion matrix are used as set control parameters, and the columns are used as predicted control parameters. When the predicted control parameters match the set control parameters, the prediction is considered correct, otherwise, the prediction is considered wrong. Based on the confusion matrix, the overall prediction accuracy and the recognition accuracy of each ECU unit can be calculated. Among them, the matching of the predicted control parameters and the set control parameters means that the similarity between the predicted control parameters and the set control parameters is greater than the set similarity threshold. Among them, the similarity threshold is used to determine whether the predicted control parameters and the set control parameters match. For example, weights can be assigned to multiple parameters in the control parameters, and a similarity can be obtained through weighted calculation. The similarity can be used as the matching degree between the predicted control parameters and the set control parameters. The error rate threshold is used to determine whether the vehicle network is under cyber attack, thereby improving the accuracy of cyber attack identification and reducing false alarms.

[0070] As an example, the machine learning model in the embodiments of the present application may be a classifier model. Therefore, the predicted control parameters corresponding to the message information may be predicted using a trained target classifier. The target classifier is a classifier model for predicting the control parameters of the message information based on the first feature information and the second feature information.

[0071] Specifically, the first feature information and the second feature information are input into a target classifier to obtain the predicted control parameters. The target classifier classifies the first feature information and the second feature information into the same number of categories as the number of ECUs. This allows the target classifier to predict the control parameters for each ECU.

[0072] In one example, a target classifier can be regularly trained by a cloud server and distributed to edge devices. The in-vehicle edge device inputs the first and second feature information extracted in real time into the target classifier trained by the cloud server. The target classifier predicts the most likely ECU category for this unlabeled data, identifies the ECU control parameters actually transmitted in the message, determines their similarity to legitimate ECUs transmitting the same data, and calculates the target classifier's recognition accuracy. If the error rate between the predicted control parameters and the set control parameters reaches a set error rate threshold, an attack is identified.

[0073] In the embodiment of the present application, the target classification model can be trained in advance. Therefore, the network attack detection method can also include the step of training the classification model to obtain a target classifier.

[0074] Specifically, a sample training set is first obtained. The sample training set may include multiple training samples. The multiple training samples may be obtained based on historical data and real-time collected data. The training samples may include sample features and calibration parameters corresponding to the sample features. The sample features may include a first sample feature corresponding to the sample voltage information and a second sample feature corresponding to the sample message information. The calibration parameters are the actual control parameters corresponding to the first sample feature and the second sample feature. Next, the training samples are input into the classification model to be trained to obtain prediction parameters. Finally, the classification model to be trained is iteratively updated according to the prediction parameters and calibration parameters until the convergence conditions of the model training are reached, thereby obtaining the target classifier.

[0075] Figure 5 This is a schematic diagram of a target classifier training process provided in an embodiment of the present application. Figure 5 As shown, in one example, the target classifier training process can include data acquisition, data processing, feature extraction, and parameter training. Specifically, a labeled sample training set can be used to create a classification model that includes multiple ECU categories. A mixed feature dataset consisting of first and second sample features is collected, and samples in the training set are labeled using message IDs. The message IDs can correspond to identifiers assigned to ECUs for arbitration decisions. Each category, through the control parameters constructed by the model, represents a specific ECU fingerprint, helping to identify attack behaviors. During offline training, historical data can be filtered and denoised. Sample feature data segments are then extracted. For example, the dominant bit time and voltage mode can be extracted from the physical voltage signal of the CAN bus, along with the CAN frame time interval feature. Due to the high computing power of cloud servers, advanced algorithms such as forward feature selection and principal component analysis can be used for feature extraction. During online training, sample feature data can be directly obtained from edge devices.

[0076] The classifier model can be a complex classifier model such as a supervised learning algorithm (Support Vector Machine, SVM) or random forest, which requires a longer training cycle, or a lightweight classifier model such as Softmax. Lightweight classifier models require a shorter training cycle and can be trained in scenarios where real-time model updates are required to improve training speed. At the same time, large-scale in-depth training of complex models can be performed, and model upgrades can be performed regularly over a longer period of time to improve model recognition accuracy.

[0077] Figure 6 This is a schematic diagram of a Softmax function structure provided in an embodiment of the present application. Figure 6 As shown below, the lightweight classifier model with Softmax function structure is taken as an example. iTo determine the score belonging to category i, we use the exponentiation. This exponentiation is used to amplify the difference between scores of different categories. First, we use the labeled sample training set to create a multi-class classifier model. The sample training set is shuffled and divided into two parts: 80% as the training set and 20% as the test set. The dataset is imported into the classification model to be trained. Given data V, where Vi represents the i-th element, the Softmax value of Vi is:

[0078]

[0079] Where S i is the probability value of category i calculated by the Softmax function, that is, the probability that the input data belongs to each category, ∑ j e j To determine the score that belongs to category i, we take the index.

[0080] During the model training process, the objective function is to maximize the maximum likelihood estimation of the model parameters, and the logarithmic function is introduced to average the training parameters:

[0081]

[0082] Among them, m is the number of samples for maximum likelihood estimation, y (i) is the category, i and j represent the i-th sample and the j-th sample, θ j is the parameter to be estimated, χ is the observed value, J θ The goal of maximum likelihood estimation is to find a parameter θ that maximizes the probability of the observed data given the parameters.

[0083] At this point, the gradient of the objective function is:

[0084]

[0085] Among them, φ n is the parameter to be estimated, x (i) is the i-th observation data. Find the gradient of the maximum likelihood estimate.

[0086] In order to make the objective function a strictly convex function and have a unique minimum, a weight decay term is added to prevent the model from overfitting. At this time, the objective function and its gradient change are:

[0087]

[0088] Where λ is the weight decay factor

[0089] Next, the training set is imported into the classification model to be trained. The predicted parameters for each ECU in the test set are derived based on the Softmax output probability distribution. The predicted parameters are then compared with the calibrated parameters. If they match, the prediction is considered correct; otherwise, it is considered incorrect. The overall prediction accuracy and the individual recognition accuracy for each ECU are calculated. The classification model to be trained is iteratively updated based on the accuracy of the predicted and calibrated parameters until the model training converges. For example, when the accuracy exceeds a certain value or the number of iterations reaches a certain value, the training is considered complete, resulting in a trained target classifier.

[0090] Due to the limited computing resources on the vehicle side, the complexity and training speed of the machine learning algorithm are easily limited, and the model cannot be updated and upgraded frequently. This can easily lead to a decrease in the accuracy of network attack detection. Based on this, a cloud server that communicates with the vehicle is introduced, and the step of training the classification model to obtain the target classifier can be performed by the cloud server. In this way, the trained target classifier can be obtained from the cloud server and stored in the vehicle's memory. In one example, the target classifier can be obtained from the cloud server at a set time. In another example, the target classifier trained in the cloud server can be obtained based on the update completion instruction issued by the cloud server. Among them, the update completion instruction can be an instruction generated after the cloud server trains the target classifier.

[0091] In an embodiment of the present application, if network attack detection is performed based on the physical characteristics of the message, the detection results are easily affected by environmental factors such as equipment aging, temperature, and humidity, resulting in false detection and missed detection. At the same time, the interaction between the vehicle side and the cloud server requires a lot of data interaction and takes a certain amount of time. In order to reduce the burden on the cloud server and improve the accuracy of detection, for small batches of data updates, incremental learning can be performed on the vehicle side to update the target classifier stored in the vehicle section. Specifically, in response to receiving the newly input first feature information and second feature information, the target classifier can be iteratively trained through incremental learning to obtain the iterated model parameters of the target classifier. Then, the model parameters of the target classifier stored in the vehicle are updated based on the iterated model parameters to iteratively update the target classifier.

[0092] In one example, data acquisition can begin with small batches. Data is not provided all at once, but arrives in small batches (or continuously streamed). This can be done online or offline to periodically update the target classifier. The newly received first and second feature information is then preprocessed. For example, cleansing and preprocessing can be performed to ensure they are acceptable to the target classifier model. Next, incremental learning can be performed. This allows the vehicle's edge device to update the target classifier as new data is received, eliminating the need to retrain the target classifier from scratch. This allows for better adaptation to signal changes in dynamic environments. Incremental learning can utilize online learning algorithms, such as online gradient descent, or memory mechanisms, such as elastic weight consolidation (EWC), to retain previous knowledge. Furthermore, the parameters of the target classifier are only fine-tuned based on the new data, without requiring a full reset, to reduce the risk of overfitting the model to the old data. After each update, the model's performance is evaluated using a portion of the new data or a retained validation set to monitor learning effectiveness. Based on the evaluation results, the learning rate, model architecture, or a different learning strategy may be adjusted to optimize overall performance.

[0093] The embodiments of this application use incremental learning to detect network attacks within a short period of time, making it resilient to environmental factors and ensuring stability and robustness under changing conditions. Furthermore, incremental learning eliminates the need to retrain the entire model and utilizes small batch updates, which requires less memory and computing resources. This can be performed in the vehicle's edge devices, reducing pressure on cloud servers and enabling real-time updates and rapid response.

[0094] In an embodiment of the present application, when it is determined that the vehicle communication network is under cyber attack, the vehicle can be triggered to issue an alarm message. The alarm message may include, but is not limited to, an audible alarm, a text alarm, an image alarm, and the like. Furthermore, the alarm message can be sent to a terminal device via remote communication.

[0095] For example, after receiving an alarm, a user can send feedback about the alarm. The vehicle's edge device, in response to the feedback, can retrieve the response strategy for cyberattacks included in the feedback. It can then perform cybersecurity control on the vehicle based on the response strategy.

[0096] For example, when a user receives an alarm, the vehicle's display terminal will display a pop-up window offering options for resetting the network, restarting communications equipment, or filtering current messages. Users can select these options based on their needs, and the vehicle will then execute the corresponding network security controls, such as resetting the network, restarting communications equipment, or filtering current messages.

[0097] Figure 7 FIG. 7 is a structural block diagram of a vehicle 700 provided in an embodiment of the present application. Figure 7 As shown, the vehicle 700 may include a memory 701 and a processor 702. The memory 701 is configured to store instructions. The processor 702 is configured to call instructions from the memory 701 and implement the above-mentioned network attack detection method applied to the vehicle when executing the instructions.

[0098] The vehicle in the embodiments of the present application may be a fuel vehicle, a plug-in hybrid vehicle, a new energy vehicle, etc., and the present application does not make any specific limitations on this.

[0099] An embodiment of the present application also provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned network attack detection method applied to a vehicle.

[0100] Since the instructions stored in the vehicle and the computer-readable storage medium can execute the steps of any one of the network attack detection methods applied to a vehicle provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the network attack detection methods applied to a vehicle provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0101] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0102] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0103] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0105] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0106] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0107] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated communication signals and carrier waves.

[0108] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0109] The above are merely preferred embodiments of the present application and do not constitute any form of limitation to the present application. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.

Claims

1. A network attack detection method applied to a vehicle, characterized in that: include: Upon receiving a message transmitted by a vehicle communication network, obtaining voltage information of the vehicle communication network and message information of the message; Whether the vehicle communication network is under a network attack is detected according to the voltage information and the message information.

2. The network attack detection method according to claim 1, characterized in that: The vehicle includes a control unit connected to the vehicle communication network to receive the message, and detecting whether the vehicle communication network is under a network attack based on the voltage information and the message information includes: performing feature extraction on the voltage information and the message information respectively to obtain first feature information of the voltage information and second feature information of the message information; predicting a predicted control parameter of the control unit according to the first feature information and the second feature information; Based on the predicted control parameter and the set control parameter, it is detected whether the vehicle communication network is subject to a network attack.

3. The network attack detection method according to claim 2, characterized in that: The detecting whether the vehicle communication network is under a network attack based on the predicted control parameter and the set control parameter includes: determining an error rate of the predicted control parameter based on the predicted control parameter and the set control parameter; If the error rate is greater than a set error rate threshold, it is determined that the vehicle communication network is under a network attack.

4. The network attack detection method according to claim 2, wherein: The predicting of the predicted control parameter of the control unit according to the first feature information and the second feature information includes: The first feature information and the second feature information are input into a target classifier to obtain the prediction control parameters.

5. The network attack detection method according to claim 4, characterized in that: The network attack detection method further includes a step of training a classification model to obtain the target classifier, which step includes: Acquire a sample training set, the sample training set including a plurality of training samples, the training samples including sample features and calibration parameters corresponding to the sample features, the sample features including a first sample feature corresponding to sample voltage information and a second sample feature corresponding to sample message information; Inputting the training samples into the classification model to be trained to obtain prediction parameters; The classification model to be trained is iteratively updated according to the prediction parameters and the calibration parameters until the convergence condition of the model training is reached, thereby obtaining the target classifier.

6. The network attack detection method according to claim 5, characterized in that: The vehicle communicates with a cloud server, the step of training the classification model to obtain the target classifier is performed by the cloud server, and the network attack detection method further includes: The target classifier is obtained from the cloud server and stored in a memory of the vehicle.

7. The network attack detection method according to claim 5, characterized in that: The step of training the classification model to obtain the target classifier further includes: In response to receiving the newly input first feature information and second feature information, iteratively training the target classifier through incremental learning to obtain model parameters of the target classifier after iteration; The model parameters of the target classifier stored in the vehicle are updated based on the iterated model parameters to iteratively update the target classifier.

8. The network attack detection method according to claim 1, wherein: Also includes: When it is determined that the vehicle communication network is under a network attack, the vehicle is triggered to send out an alarm message.

9. The network attack detection method according to claim 8, characterized in that: Also includes: In response to feedback information regarding the alarm information, obtaining a response strategy for the network attack included in the feedback information; The vehicle is subjected to network security control according to the response strategy.

10. A vehicle, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the network attack detection method applied to a vehicle according to any one of claims 1 to 9 when executing the instructions.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, which, when executed by a processor, enable the processor to be configured to execute the network attack detection method applied to a vehicle according to any one of claims 1 to 9.