Vehicle information safety detection method and automobile
By setting up a lightweight attack detection model in intelligent connected vehicles, and utilizing graph neural networks, long short-term memory networks, and attention mechanism layers, combined with multi-dimensional feature extraction, the problem of low response efficiency in the identification of complex attacks in intelligent connected vehicles is solved, and efficient vehicle information security protection is achieved.
Patent Information
- Application Number
- CN202511507308.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies cannot effectively identify complex cross-dimensional attack types in intelligent connected vehicles, and their response efficiency is low, making it difficult to meet real-time security requirements.
A lightweight attack detection model is set up on the vehicle-mounted terminal. By using graph neural networks, long short-term memory networks and attention mechanism layers, combined with time, space and communication content features, multi-source heterogeneous data features are extracted to identify complex attack types.
It improves the response speed and accuracy of vehicle information security detection, can identify complex attacks across time and space dimensions, enhances the ability to identify unfamiliar attack types, and meets real-time and low power consumption requirements.
Smart Images

Figure CN121567355A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of automotive information security technology, and in particular to a vehicle information security detection method and an automobile. Background Technology
[0002] Currently, intelligent connected vehicles face a variety of attack types, such as CAN injection, OTA vulnerability attacks, V2X communication hijacking, and remote vehicle control by stealing permissions. To counter attacks targeting vehicles, relevant technologies have been implemented in automotive security operation platforms that utilize static rules or single-mode detection and protection.
[0003] In related technologies, automotive safety operation platforms mainly adopt two solutions: one is an intrusion detection system based on static rules, and the other is identification based on a single machine learning or deep learning algorithm. However, these technologies have the following drawbacks: insufficient ability to identify temporal features, making it impossible to identify complex attack types across dimensions; low response efficiency, with the detection model set on the platform side, requiring high computing resources and making it difficult to meet the needs of real-time security response. Summary of the Invention
[0004] To address at least one of the aforementioned technical problems, this disclosure proposes a vehicle information security detection method and a vehicle.
[0005] According to some embodiments of this disclosure, a vehicle information security detection method is provided, comprising: acquiring vehicle bus communication data for a target time period; extracting communication data features, time features, and graph structure features based on the vehicle bus communication data, and integrating them into a tensor set, wherein the communication data features characterize the transmission and reception communication data of each electronic control unit of the vehicle at each time node in the target time period, the time features characterize the time nodes at which each electronic control unit transmits and receives communication data, and the graph structure features include nodes and edges between nodes, with each node corresponding one-to-one with each electronic control unit; inputting the tensor set into a lightweight detection model on the vehicle end to obtain a node attack prediction result, wherein the node attack prediction result characterizes the predicted situation of the electronic control unit corresponding to the target node being attacked within the target time period; wherein the lightweight detection model is obtained by lightweight processing of a pre-trained attack detection model on the server side, and the attack detection model includes a graph neural network layer, a long short-term memory network layer, and an attention mechanism layer.
[0006] Based on the above solution, the attack detection model, which is pre-trained on the server side and then lightweighted, is set on the vehicle terminal. This reduces the computational resource requirements of the lightweight detection model while improving the response speed of information security detection on the vehicle terminal. Furthermore, the model includes graph neural network layers, long short-term memory network layers, and attention mechanism layers, enabling it to detect attacks from multiple dimensions such as graph structure, time, and communication content. It can identify complex attack types that span time and space dimensions and enhance the ability to identify unfamiliar attack types, thereby improving vehicle information security protection.
[0007] In some possible implementations, the step of inputting the tensor set into a lightweight detection model on the vehicle side to obtain a node attack prediction result includes: inputting the tensor set into the lightweight detection model on the vehicle side, extracting a first target feature in the graph neural network layer of the lightweight detection model, the first target feature indicating whether each electronic control unit has experienced traffic anomalies; inputting the tensor set into the long short-term memory network layer, determining traffic anomaly time features in the long short-term memory network layer of the lightweight detection model; determining target temporal features associated with the traffic anomaly time features in the attention mechanism layer of the lightweight detection model, and extracting a second target feature associated with the target temporal features from the tensor set, the second target feature indicating whether each node has experienced temporal anomalies; and determining the attack category and attack probability corresponding to the target feature vector as the node attack prediction result based on the target feature vector obtained by integrating the first target feature and the second target feature, the target feature vector representing whether each electronic control unit has experienced anomalies.
[0008] Based on the above scheme, the spatial features of traffic anomalies are determined by using graph neural network layers, the temporal features of traffic anomalies are determined by using long short-term memory network layers and attention mechanism layers, and then the probability of each electronic control unit being attacked and the corresponding attack type are determined based on the spatial features of traffic anomalies determined by each layer, which can realize complex multimodal attack detection.
[0009] In some possible implementations, the communication data features include timing features, content features, and association structure features of the communication data sent and received by each electronic control unit (ECU). The timing features characterize the order in which the ECUs send and receive communication data. The content features include the traffic characteristics of each ECU at each time point and the text features of the communication data sent and received by each ECU. The association structure features characterize the communication flow between the ECUs. The step of inputting the tensor set into the lightweight detection model of the vehicle terminal and extracting the first target feature in the graph neural network layer of the lightweight detection model includes: obtaining the first target feature based on the content features, the association structure features, and the graph structure features. The step of inputting the tensor set into the long short-term memory (LSTM) network layer and determining the traffic anomaly time feature in the LSM network layer of the lightweight detection model includes: obtaining the traffic anomaly time feature based on the timing features, the content features, and the time features. The step of determining the target timing feature associated with the traffic anomaly time feature in the attention mechanism layer of the lightweight detection model includes: obtaining the target timing feature based on the timing features and the traffic anomaly time feature.
[0010] Based on the above scheme, communication data features are extracted from three perspectives: time, space, and actual content. These features include temporal features, content features, and relational structure features. Temporal features correspond to time features to help determine the time of traffic anomalies, and relational structure features correspond to graph structure features to help determine the nodes of traffic anomalies. Detecting attacks from both temporal and spatial dimensions helps improve the sensitivity of identifying hidden attacks and new types of attacks.
[0011] In some possible implementations, extracting the first target feature from the graph neural network layer of the lightweight detection model includes: determining first graph structure data and second graph structure data based on the graph structure features, the content features, and the association structure features, wherein the first graph structure data represents the actual traffic and actual edge information between each node, and the second graph structure data represents the theoretical traffic level and theoretical edge information of each node; based on the comparison result between the first graph structure data and the second graph structure data, identifying nodes whose actual traffic exceeds the theoretical traffic and nodes whose actual number of edges is greater than the theoretical number of edges as traffic anomaly nodes; and determining the features of the electronic control unit corresponding to the traffic anomaly node as the first target feature.
[0012] Based on the above scheme, graph structure data is generated by utilizing communication data features and graph structure features respectively. This can identify edges that do not exist in normal communication graphs, thereby detecting attacked nodes.
[0013] In some possible implementations, determining nodes whose actual traffic exceeds theoretical traffic and nodes whose actual number of edges is greater than the theoretical number of edges, based on the comparison results of the first graph structure data and the second graph structure data, as the traffic abnormal nodes includes: determining the attention coefficient of any node to other nodes using a graph attention mechanism based on the first graph structure data and the second graph structure data, to obtain an attention coefficient set; and determining nodes whose attention coefficient is greater than a preset coefficient value as the traffic abnormal nodes based on the attention coefficient set.
[0014] Based on the above scheme, the attention coefficient is calculated using the graph attention mechanism, and abnormal node pairs are discovered based on the attention coefficient. This can accurately detect nodes with abnormally concentrated traffic, thus facilitating the identification of attacks.
[0015] In some possible implementations, determining the target temporal feature associated with the traffic anomaly time in the attention mechanism layer of the lightweight detection model includes: determining first temporal data based on the traffic anomaly time, determining second temporal data based on the temporal feature, wherein the first temporal data represents the anomaly attack reference temporal information, and the second temporal data represents the temporal information of each node in the target time period; using a multi-head attention mechanism to compare the second temporal data with the first temporal data, and determining the temporal feature whose temporal information is the same as the anomaly attack reference temporal information as the target temporal feature.
[0016] Based on the above scheme, by using the attention mechanism layer to establish long-distance dependencies on time series data, and by globally associating and capturing time series data within all target time periods, hidden attacks can be identified.
[0017] In some possible implementations, the method further includes the attack detection model training method, which includes: acquiring a preset machine learning model; the preset machine learning model includes an initial graph neural network layer, an initial long short-term memory network layer, an initial attention mechanism layer, and an initial fully connected output layer; acquiring attack sample data; the attack sample data includes communication data features, time features, graph structure features corresponding to historical bus communication data, and labeled attack data corresponding to each electronic control unit of the vehicle; and training the preset machine learning model based on the attack sample data to obtain the attack detection model.
[0018] Based on the above scheme, the preset machine learning model includes an initial graph neural network layer, an initial long short-term memory network layer, an initial attention mechanism layer, and an initial fully connected output layer. It can identify attack data from the time and space dimensions. Then, by training the preset machine learning model with communication data features, time features, graph structure features, and labeled attack data, the attack detection model can extract nonlinear correlation features and improve the ability to identify coordinated attacks by different electronic control units.
[0019] In some possible implementations, the method further includes the lightweight detection model generation method, which includes: obtaining a preset lightweight model corresponding to the attack detection model; determining the attack detection model as a teacher model and the preset lightweight model as a student model; performing knowledge distillation based on the teacher model and the student model to obtain a distillation loss; and determining the student model as the lightweight detection model if the distillation loss is less than or equal to a loss threshold.
[0020] Based on the above scheme, the lightweight detection model obtained by training the student model using knowledge distillation significantly compresses the model parameters while maintaining the original detection accuracy, reducing the resource consumption and inference time during on-board edge computing, and meeting the real-time and low power consumption requirements of intelligent connected vehicles.
[0021] In some possible implementations, after inputting the tensor set into the lightweight detection model for the vehicle to obtain the node attack prediction result, the method further includes: determining that the lightweight detection model needs to be updated if the entropy value of the node attack prediction result is greater than a preset entropy value, or if the similarity between the tensor set and the attack sample data is less than a preset similarity value; acquiring attack annotation data, generating a new sample set based on the tensor set and the attack annotation data, and incrementally training the attack detection model using the new sample set.
[0022] Based on the above scheme, by using two indicators, prediction uncertainty and data distribution difference, to determine whether the model needs to be updated, the model can be updated in a timely manner when new attacks, new features, and model anomalies are detected, ensuring that the model can maintain the accuracy of attack identification.
[0023] According to some embodiments of this disclosure, an automobile is also provided, including a controller for performing the vehicle information security detection method described in any of the above embodiments.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.
[0025] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0026] To more clearly illustrate the technical solutions and advantages in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A flowchart illustrating a vehicle information security detection method according to an embodiment of the present disclosure is shown; Figure 2 A flowchart illustrating the node attack prediction results obtained by the lightweight detection model according to an embodiment of the present disclosure is shown. Figure 3 A flowchart illustrating an attack detection model training method according to an embodiment of the present disclosure is shown. Figure 4 A flowchart illustrating a lightweight detection model generation method according to an embodiment of the present disclosure is shown. Figure 5 A flowchart illustrating a model update method according to an embodiment of this disclosure is shown; Figure 6 A structural diagram of an electronic device according to an embodiment of the present disclosure is shown; Figure 7 A model structure diagram according to an embodiment of the present disclosure is shown; Figure 8 A structural diagram of a fully connected layer of a model according to an embodiment of the present disclosure is shown. Detailed Implementation
[0028] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0030] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0031] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0032] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0033] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0034] Currently, intelligent connected vehicles are subject to a variety of attacks. Attacks targeting the vehicle's onboard bus (CAN / LIN / Ethernet) require real-time monitoring of the onboard bus data to promptly identify potential information security risks and prevent more serious accidents.
[0035] In related technologies, a vehicle security operation platform is set up to realize the security detection and intrusion warning of vehicle bus data. However, the vehicle security operation platform is located on the platform side and needs to communicate with the equipment on the vehicle side to complete the detection and judgment. The real-time performance of attack identification is not high. Moreover, the vehicle security operation platform mainly adopts two schemes: one is an intrusion detection system based on static rules, and the other is identification based on a single machine learning or deep learning algorithm. Neither of these schemes can effectively extract features of multi-source heterogeneous data. They are not capable of identifying complex attacks such as spatiotemporal correlation attacks or new types of attacks, and they lack dynamic update capabilities, requiring manual intervention to analyze and update the identification rules.
[0036] To address at least one of the aforementioned problems, this invention provides a vehicle information security detection method. This method sets up a lightweight model on the vehicle-mounted terminal. The lightweight model is obtained by lightweighting a multi-dimensional model. The lightweight model can identify multi-source heterogeneous data features extracted from multiple dimensions such as time, space, and communication content. Based on the multi-source heterogeneous data features, it identifies the probability of each electronic control unit of the vehicle being attacked by various types of attacks. Compared with traditional solutions using static rules or single-dimensional models, it has a higher detection accuracy for cross-electronic control unit collaborative attacks.
[0037] Please refer to Figure 1 Vehicle information security testing methods include: Step S101: Obtain vehicle bus communication data for the target time period.
[0038] In this embodiment, the vehicle bus includes a CAN / LIN bus and an Ethernet bus. In practical applications, the acquisition hardware can employ an onboard Ethernet controller and a CAN / LIN bus interface to acquire multiple bus signals, for example, acquiring 20 bus signals, including 16 CAN signals and 4 LIN signals. The acquisition target can be all data on the bus or specific data on the bus. In addition, it can also include statistical data of bus communication data. In a specific implementation, the target data acquired includes raw CAN / LIN data (CAN ID), transmission direction (send / receive), error frame flag, bus load rate, and ECU address (ECU, i.e., electronic control unit). The acquired target data forms a multi-dimensional data matrix.
[0039] In this embodiment, the acquisition of vehicle bus communication data is achieved through a dynamic sliding window, meaning the target time period is a fixed-length time window. This embodiment does not limit the length of the time window or the acquisition frequency; the acquisition frequency and time window length can be determined based on the vehicle bus data transmission frequency or the vehicle's attack surface. In one specific implementation, the time window length is T=5s, and the acquisition time interval is 50ms, meaning 100 sample data points are acquired within the target time period. Based on the aforementioned frequency and time window length, it can be ensured that the data acquisition range covers the attack surface of most mainstream vehicle models.
[0040] Step S102: Based on the vehicle bus communication data, extract the communication data features, time features, and graph structure features, and integrate them into a tensor set.
[0041] In this embodiment, the communication data feature represents the communication data sent and received by each electronic control unit of the vehicle at each time node in the target time period, the time feature represents the time node when each electronic control unit sends and receives communication data, and the graph structure feature includes nodes and edges between nodes. Each node corresponds one-to-one with each electronic control unit, and the edges between node pairs indicate that there is a communication connection between the corresponding two electronic control units.
[0042] Specifically, the time features correspond to the target time period, meaning they include each sampling time node within that period. For example, the time features might include 100 sampling time nodes (T1~T100), or 100 time steps. The purpose of extracting time features in this embodiment is to analyze and identify attacks from a time dimension. For instance, it can compare the transmitted and received communication data content of the same or different electronic control units at different time nodes, or it can identify different electronic control units with similar transmitted and received communication data content at the same time node. The graph structure features correspond to the communication structure graph of the electronic control units. For example, if a vehicle includes 10 electronic control units (ECU1~ECU10), the graph structure features include ten nodes, and the communication connections between the electronic control units are expressed as edges between nodes. The purpose of extracting graph structure features in this embodiment is to analyze and identify attacks from a spatial dimension, determining the correlation between the attack and actual communication. The communication data features correspond to the specific content of the communication data. Communication data features can consist of multiple sub-features, which can further include time-related features, spatial-related features, and content-related features.
[0043] This embodiment extracts these three features and integrates them into a set of time-space graph tensors, which enables the extraction of features from multi-source heterogeneous data. Compared with single-dimensional features, time-space tensors can provide hidden correlation information between time series, communication graphs, and communication data content, so as to identify complex attacks (such as composite attacks), hidden attacks, and new types of attacks.
[0044] In one specific implementation, the integrated set of time-space graph tensors can be expressed as: In the formula, N: the total number of samples in the tensor set; T: time step 100, i.e. time feature; V: ECU node set; |V|: number of ECUs; E: ECU communication edge set, (V, E) is graph structure feature; F: communication data feature.
[0045] In some embodiments, the aforementioned communication data features include timing features, content features, and relational structure features of the communication data sent and received by each electronic control unit (ECU). The timing features characterize the sequential order in which each ECU sends and receives communication data; the content features include the traffic characteristics of each ECU at each time point and the text features of the communication data sent and received by each ECU; and the relational structure features characterize the communication flow between the ECUs. Based on the above scheme, communication data features are extracted from three perspectives: time, space, and actual content. These include timing features, content features, and relational structure features. The timing features correspond to the time features to facilitate the identification of abnormal traffic moments, and the relational structure features correspond to the graph structure features to facilitate the identification of abnormal traffic nodes. Detecting attacks from both temporal and spatial dimensions helps improve the sensitivity of identifying hidden attacks and novel attacks.
[0046] In one specific implementation, the timing characteristics are as follows: ,in, This is the bus message interval, which can capture timing anomalies caused by DoS attacks; ID frequency characteristics are used to detect frequency fluctuation type attacks; The time-interval entropy quantifies the degree of message disorder and is used to identify fuzzy attacks. Content characteristics include: ,in For field values in the data frame, For variance, For the rate of change, The repetition rate is used to detect data injection attacks (abnormally large variance) and replay attacks (high repetition rate). The associated structural features are... Graph neural networks (GNNs) are used to extract the structural embedding relationships of the ECU communication graph to capture communication patterns between nodes, achieving multi-dimensional detection capabilities. This indicates the degree of relationship between the source signal node and the target node. Used to quantify traffic distribution and identify new types of denial-of-service attacks. This is the ECU communication graph extracted by a graph neural network (GNN). Based on the above features, the communication data features can be further expressed as: .
[0047] In some embodiments, the data may also undergo preprocessing, including outlier handling. Outlier handling may employ a normal distribution. The principle is to detect outliers in the data, and the corresponding outlier handling formula is as follows:
[0048]
[0049] in, The data value at time t The data repair value at time t. The data value at time t-1 The data value at time t+1 The mean of the data within the target time period. This represents the standard deviation of the data within the target time period. When handling outliers, mild outliers can be repaired using a linear interpolation algorithm based on the above outlier handling formula, while severe outliers are marked as missing values to ensure data quality.
[0050] In some embodiments, the eigenvalues are also normalized, which may be done using Z-score normalization. , (( ) Original eigenvalues; : Mean of training set features (dynamically updated); Current time; Previous time; A sliding window with a step size of 100; : Standard deviation of training set features (dynamically updated); : Normalized eigenvalues. This design uses a sliding window to dynamically calculate the mean and standard deviation, standardizing the eigenvalues to a distribution with a mean of 0 and a standard deviation of 1, thereby enhancing the model's robustness to data from different time periods.
[0051] Step S103: Input the tensor set into the lightweight detection model of the vehicle terminal to obtain the node attack prediction result. The node attack prediction result represents the prediction of the electronic control unit corresponding to the target node being attacked within the target time period.
[0052] In this embodiment, the lightweight detection model is obtained by lightweighting the pre-trained attack detection model on the server side. The attack detection model includes a graph neural network layer, a long short-term memory network layer, and an attention mechanism layer. That is, both the attack detection model and the lightweight detection model belong to the GNN-LSTM-AM three-dimensional model. The graph neural network layer is used to extract multi-dimensional spatial features to identify and analyze spatially related attacks, while the long short-term memory network layer is used to extract temporally dependent features to identify and analyze temporally / temporally related attacks. The attention mechanism layer is used to detect other features associated with the extracted features to identify hidden related attacks. By fusing these three layers in the attack detection model, the model can further extract spatiotemporal features related to the attack from the multi-source heterogeneous features extracted from vehicle bus communication data, and identify the predicted attack situation of each electronic control unit within the target time period based on the spatiotemporal features.
[0053] In this embodiment, the node attack prediction results are for each electronic control unit corresponding to the vehicle bus communication data. The node attack prediction results include attack type and attack probability. The lightweight detection model performs classification prediction from the dimensions of time, space and communication data content based on the multi-source heterogeneous data features extracted in the above steps, determines the probability of each electronic control unit being attacked by each attack type, and determines the node attack prediction result corresponding to the electronic control unit based on the attack probability corresponding to each attack type.
[0054] Based on the above steps S101 to S103, the attack detection model pre-trained on the server side is lightweighted and then set on the vehicle terminal. This reduces the computational resource requirements of the lightweight detection model while improving the response speed of information security detection on the vehicle terminal. Furthermore, the model is equipped with a graph neural network layer, a long short-term memory network layer, and an attention mechanism layer, which can detect attacks from multiple dimensions such as space, time, and communication content. It can identify complex attack types that span time and space dimensions and enhance the ability to identify unfamiliar attack types, thereby improving vehicle information security protection.
[0055] In some embodiments, please refer to Figure 2 and Figure 7 The tensor set is input into the lightweight detection model on the vehicle side to obtain node attack prediction results, including: Step S201: Input the tensor set into the lightweight detection model of the vehicle terminal, and extract the first target feature in the graph neural network layer of the lightweight detection model. The first target feature indicates whether each electronic control unit has an abnormal flow.
[0056] In this embodiment, the graph neural network layer is used to analyze graph structure features and communication data features. The functions of the graph neural network layer include attack path discovery and structural feature extraction. Attack path discovery uses a graph attention mechanism to identify edges that do not exist in the normal communication graph (such as a forged link accessed by a hacker through an OBD interface). Structural feature extraction refers to calculating indicators such as node degree and betweenness centrality to detect nodes with abnormally concentrated traffic (such as the target node of a DoS attack). In some specific implementations, the graph neural network layer obtains the first target feature based on content features, association structure features, and graph structure features.
[0057] For further details, please refer to Figure 2 The methods for extracting the first target feature mentioned above include: Step S2011: Based on graph structure features, content features, and association structure features, determine the first graph structure data and the second graph structure data. The first graph structure data represents the actual flow and actual edge information between each node, and the second graph structure data represents the theoretical flow level and theoretical edge information of each node.
[0058] Step S2012: Based on the comparison results between the first graph structure data and the second graph structure data, nodes whose actual flow exceeds the theoretical flow and nodes whose actual number of edges is greater than the theoretical number of edges are identified as flow abnormal nodes.
[0059] In some embodiments, the method for determining abnormal traffic nodes is implemented through an attention mechanism. Specifically, step S2012 includes: based on the first graph structure data and the second graph structure data, using a graph attention mechanism to determine the attention coefficient of any node to other nodes, obtaining a set of attention coefficients; and based on the set of attention coefficients, identifying nodes with attention coefficients greater than a preset value as abnormal traffic nodes. Calculating attention coefficients using a graph attention mechanism and discovering abnormal node pairs based on these coefficients allows for accurate detection of nodes with concentrated abnormal traffic, facilitating attack identification.
[0060] Specifically, this embodiment models the dependencies between nodes in graph structure data using a graph attention mechanism, and generates attention weights through node features and adjacency matrices, thereby capturing the local topological features of nodes with abnormal traffic. The attention coefficient of any node to other nodes using the graph attention mechanism can be expressed by the following formula: / , In the formula, :node eigenvectors; ECU physical topology; Training the weight matrix; Attention mechanism parameters; : Represents a node For nodes The attention coefficient; the higher the value, the more important the node. right The greater the impact of the current state, the more the graph neural network layers calculate the attention coefficients between nodes. This allows for the discovery of abnormal node pairs, thereby identifying nodes with abnormal traffic.
[0061] Step S2013: Determine the characteristics of the electronic control unit corresponding to the abnormal traffic node as the first target characteristic.
[0062] Based on the above steps S2011~S2013, graph structure data is generated by utilizing communication data features and graph structure features respectively. This can identify edges that do not exist in the normal communication graph, thereby detecting attacked nodes, realizing the functions of attack path discovery and abnormal traffic node detection, and enhancing the sensitivity of attack detection and identification.
[0063] Step S202: Input the tensor set into the long short-term memory network layer to determine the characteristics of abnormal traffic moments in the long short-term memory network layer of the lightweight detection model.
[0064] In this embodiment, the Long Short-Term Memory (LSTM) network layer is used to analyze time-series data. The functions of the LSM network layer include time-series pattern learning and attack phase identification. Time-series pattern learning refers to capturing the periodicity of normal signals (such as the stable fluctuation of engine speed signals) and outputting high reconstruction errors for abnormal time sequences (such as random jumps in fuzzy attacks). Attack phase identification refers to distinguishing the pre-attack warm-up phase (such as the slow increase of traffic) from normal fluctuations through hidden state propagation analysis.
[0065] In some embodiments, the Long Short-Term Memory (LSTM) network layer can identify temporal correlation features in attacks (such as the periodic fluctuations in traffic surges during a DoS attack). Attacks can be identified through the forgetting gate mechanism within the LTM network layer. Specifically, normal traffic patterns exhibit minimal fluctuations, while attacks generate traffic fluctuations. During an attack, the forgetting gate suppresses the memory of normal traffic patterns, enhancing the response to abnormal high-frequency signals, thereby quickly identifying the attack's initiation point. The input to the LTM network layer is the temporal correlation features of each node. Specifically, the LTM network layer obtains the target temporal features based on the temporal features and the characteristics of abnormal traffic events.
[0066] Step S203: In the attention mechanism layer of the lightweight detection model, determine the target temporal features associated with the traffic anomaly time features, and extract the second target features associated with the target temporal features from the tensor set. The second target features indicate whether a temporal anomaly has occurred at each node.
[0067] In this embodiment, the attention mechanism layer obtains target temporal features based on temporal characteristics and traffic anomaly moment characteristics. Specifically, the attention mechanism layer of the lightweight detection model determines target temporal features associated with traffic anomaly moment characteristics, including: determining first temporal data based on traffic anomaly moments, and determining second temporal data based on temporal features. The first temporal data represents the reference temporal information for abnormal attacks, and the second temporal data represents the temporal information of each node in the target time period. A multi-head attention mechanism is used to compare the second temporal data with the first temporal data, and the temporal features whose temporal information is the same as the reference temporal information for abnormal attacks are determined as target temporal features. Based on the above scheme, by using the attention mechanism layer to establish correlation dependencies on temporal data, global correlation capture is performed on the temporal data within the entire target time period, which can identify hidden attacks.
[0068] In some specific implementations, the attention mechanism layer can use the multi-head attention mechanism (MHA) to model long-distance dependencies in time series data, capture global contextual relationships in the time series through the query-key-value mechanism, analyze the temporal characteristics of the vehicle bus communication data, and obtain temporal characteristics related to traffic anomalies.
[0069] Step S204: Based on the target feature vector obtained by integrating the first target feature and the second target feature, the attack category and attack probability corresponding to the target feature vector are determined as the node attack prediction result. The target feature vector represents the feature of whether each electronic control unit has an anomaly.
[0070] In this embodiment, the target feature vector contains information on whether the timing and traffic flow of each electronic control unit in the vehicle are abnormal. The attack detection model also includes a fully connected layer, which is used to integrate and classify the features extracted from the GNN-LSTM-AM architecture. Specifically, the target feature vector is input into the fully connected layer, which processes the feature vector corresponding to each electronic control unit and outputs the attack category with the highest attack probability for each electronic control unit.
[0071] In some specific embodiments, please refer to Figure 8 A fully connected layer can employ a three-layer fully connected architecture. Each neuron in a layer is connected to all neurons in the previous layer, and the number of neurons decreases progressively within each layer. For example, the first layer might have 128 neurons, the second 64 neurons, and the third 32 neurons. The output formula for a fully connected layer is:
[0072]
[0073]
[0074]
[0075]
[0076] Note the target feature vector (128 dimensions) output by the mechanism layer. : Number of attack categories (e.g., DoS / Replay / Blur / Normal, ( =4)); Output layer weights and biases; : A probability vector of dimension, where each element represents the probability between [0,1] of belonging to a certain type of attack (or normal). : Final predicted category, through The function selects the category index with the highest probability.
[0077] Each neuron in a layer is connected to all neurons in the previous layer. The feature dimensions are progressively compressed from 128 to 64 to 32, removing redundant information, while a non-linear activation function is used. Learn the complex relationships between features.
[0078] This dimensionality reduction design aims to remove noise and filter out irrelevant or repetitive features (such as sensor signals unrelated to attacks in vehicular networks); focus on key features and retain the most useful information for classification (such as abnormal communication frequencies and abnormal fields in data packets); reduce the number of parameters, thereby reducing the computational load on vehicular devices (embedded systems), making it suitable for real-time detection scenarios; and make it easier to learn the essential patterns of data in a low-dimensional feature space, avoiding the model fitting noise in a high-dimensional space.
[0079] Based on the above steps S201 to S204, the spatial characteristics of traffic anomalies are determined by the graph neural network layer, the temporal characteristics of traffic anomalies are determined by the long short-term memory network layer and the attention mechanism layer, and then the probability of each electronic control unit being attacked and the corresponding attack type are determined according to the spatial characteristics of traffic anomalies determined by each layer. This can realize the detection of complex multimodal attacks and ensure the strength of vehicle information security protection.
[0080] In some embodiments, a vehicle information security detection method of the present invention generates alarms based on the model output and distinguishes alarm levels using confidence levels. High-confidence alarms include: when and When a normal message is received, the corresponding emergency alarm message will be triggered as follows:
[0081]
[0082]
[0083] Low confidence level review: when When a sample is identified as suspicious, multi-model cross-validation is triggered.
[0084] In some embodiments, the vehicle information security detection method of the present invention further includes an attack detection model training method, please refer to... Figure 3 The training method for this attack detection model includes: Step S301: Obtain the preset machine learning model; the preset machine learning model includes the initial graph neural network layer, the initial long short-term memory network layer, the initial attention mechanism layer, and the initial fully connected output layer.
[0085] Step S302: Obtain attack sample data; attack sample data includes communication data characteristics, time characteristics, graph structure characteristics corresponding to historical bus communication data, and labeled attack data corresponding to each electronic control unit of the vehicle.
[0086] In some specific implementations, attack sample data can be divided into normal data and attack data. Attack data can be unknown attack simulation data generated by adversarial neural networks (GANs). The two types of data are divided into training set and validation set in an 8:2 ratio to train the model.
[0087] Furthermore, the Focal Loss function can be used to address the problem of scarce attack samples. The Focal Loss function is as follows: , In the formula, : Class balance factor (set to 0.25 to reduce the loss weight of normal samples); : Focus parameter (set to 2 to increase the loss weight of hard-to-classify samples); : Predicted probability values for normal data and attack data from the model.
[0088] Step S303: Train the preset machine learning model based on the attack sample data to obtain the attack detection model.
[0089] In this embodiment, an overfitting prevention strategy is implemented during model training. Specifically, the Dropout mechanism is used to randomly discard some edges in the graph neural network layer (simulating temporary communication interruptions in the vehicular network) to enhance the model's robustness to link fluctuations. In addition, an early stopping strategy is adopted during model training. When the detection rate (loss) of a certain type of attack on the validation set no longer improves for 5 consecutive epochs, training is automatically terminated to avoid overfitting to a specific attack type.
[0090] In some specific implementations, after the model is trained, a static evaluation is performed to ensure that the model has high reliability in detecting vehicular network attacks. The following metrics are used: Accuracy: Overall prediction accuracy
[0091] Precision: The proportion of samples predicted as attacks that are actually attacks.
[0092] Recall rate: The percentage of attacks that are correctly detected in actual attacks.
[0093] Wherein, the confusion matrix parameters are: (Real example): The number of attack samples that were correctly detected (such as accurately identifying abnormal ECU communications); (True negative examples): The number of samples that are correctly identified as normal (such as normal sensor signals that are not falsely reported); (False positives): The number of normal samples that are mistakenly identified as attacks (such as legitimate communications that are falsely reported due to network fluctuations). (False negatives): The number of attack samples that were not detected (such as new variant attacks that went unreported).
[0094] The evaluation does not involve updating model parameters; it is only used to determine whether the trained model is "qualified." For example, the "unqualified" standard is an accuracy of 95% or higher. If the standard is not met, the model needs to be retrained to ensure high performance.
[0095] Based on the above steps S301 to S303, the preset machine learning model includes an initial graph neural network layer, an initial long short-term memory network layer, an initial attention mechanism layer, and an initial fully connected output layer. It can identify attack data from the time and space dimensions. Then, by training the preset machine learning model with communication data features, time features, graph structure features, and labeled attack data, the attack detection model can extract nonlinear correlation features and improve the ability to identify coordinated attacks and time-series attacks by different electronic control units.
[0096] In some embodiments, the vehicle information security detection method of the present invention further includes a lightweight detection model generation method, please refer to... Figure 4 The lightweight detection model generation method: Step S401: Obtain the preset lightweight model corresponding to the attack detection model.
[0097] Step S402: Determine the attack detection model as the teacher model and the preset lightweight model as the student model.
[0098] Step S403: Perform knowledge distillation based on the teacher model and student model to obtain distillation loss.
[0099] Step S404: If the distillation loss is less than or equal to the loss threshold, the student model is determined as the lightweight detection model.
[0100] Based on the above steps S401 to S404, the lightweight detection model obtained by training the student model using knowledge distillation significantly compresses model parameters while maintaining the original detection accuracy, reducing resource consumption and inference time during vehicle edge computing, and meeting the real-time and low-power requirements of intelligent connected vehicles.
[0101] In some embodiments, the vehicle information security detection method of the present invention further includes a model update method, specifically, please refer to Figure 5 After step S103, the method further includes: Step S104: If the entropy value of the node attack prediction result is greater than the preset entropy value, or if the similarity between the tensor set and the attack sample data is less than the preset similarity, it is determined that the lightweight detection model needs to be updated.
[0102] In this embodiment, the conditions for model updates include two aspects: prediction uncertainty and data distribution differences. By using dual indicators to determine whether the model needs to be updated, the adaptability of the model can be enhanced.
[0103] The entropy value of the output probability of the model is calculated to measure the uncertainty of the predicted value.
[0104] in, Output probabilities for the model. When the entropy value... When this occurs, it indicates that the model's judgment on the current sample category is ambiguous, which may be a new type of attack or an anomaly.
[0105] Mahalanobis distance is used to measure the difference in distribution between the training set and the sample data. Mahalanobis distance:
[0106] in, This is the mean vector of the training set corresponding to the attack sample data. Let be the covariance matrix. When... When this occurs, it indicates that the new sample deviates from the normal data distribution, and the model needs to learn new features.
[0107] Step S105: Obtain attack annotation data, generate a new sample set based on the tensor set and attack annotation data, and incrementally train the attack detection model using the new sample set.
[0108] Based on the above scheme, by using two indicators, prediction uncertainty and data distribution difference, to determine whether the model needs to be updated, the model can be updated in a timely manner when new attacks, new features, and model anomalies are detected, ensuring that the model can maintain the accuracy of attack identification.
[0109] It should be understood that this embodiment can also directly utilize the incremental training of a new sample set to train a lightweight detection model.
[0110] The above embodiments have described in detail a vehicle information security detection method of the present invention, which has the following beneficial effects: 1. Significantly improved detection capabilities: The GNN-LSTM-MHA model structure can better extract features of nonlinear correlations, significantly improving the ability to identify coordinated attacks by different ECUs, especially the ability to detect new and covert attacks, particularly V2X communication hijacking, which is difficult to identify in traditional solutions.
[0111] 2. Optimization of computational efficiency and energy consumption: By using model knowledge distillation and lightweighting techniques, the model parameters are significantly compressed while maintaining the original detection accuracy, reducing the resource consumption and inference time of on-board edge computing, and meeting the real-time and low power consumption requirements of intelligent connected vehicles.
[0112] 3. Reduce security operation costs: Through automated feature learning and dynamic update mechanisms, the frequency of manual analysis of security events and model updates is reduced, effectively alleviating the manpower and time costs of security operation and maintenance personnel, and improving the economy and sustainability of information security protection for car companies.
[0113] This invention also provides a vehicle, which includes a controller for executing the vehicle information security detection method described in any of the above embodiments.
[0114] This invention also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program. The processor loads and executes the at least one instruction or at least one program to implement the vehicle information security detection method described above.
[0115] Memory is used to store software programs and modules. The processor executes these stored software programs and modules to perform various functional applications and data processing. Memory can primarily consist of a program storage area and a data storage area. The program storage area stores the operating system, application programs required for functionality, etc.; the data storage area stores data created based on device usage, etc. Furthermore, memory can include high-speed random access memory (RAM) and non-volatile memory, such as at least one hard disk drive, flash memory, or other volatile solid-state storage devices. Correspondingly, memory can also include a memory controller to provide the processor with access to the memory.
[0116] The methods and embodiments provided in this application can be executed in electronic devices such as mobile terminals, computer terminals, servers, or similar computing devices. Figure 6 This is the electronic device provided in the embodiments of this application. For example... Figure 6 As shown, the electronic device 900 can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 910 (CPUs 910 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 930 for storing data, and one or more storage media 920 (e.g., one or more mass storage devices) for storing application programs 923 or data 922. The memory 930 and storage media 920 may be temporary or persistent storage. The program stored in the storage media 920 may include one or more modules, each module may include a series of instruction operations on the electronic device. Furthermore, the CPU 910 may be configured to communicate with the storage media 920 and execute the series of instruction operations in the storage media 920 on the electronic device 900. Electronic device 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input / output interfaces 940, and / or one or more operating systems 921, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0117] The input / output interface 940 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 900. In one example, the input / output interface 940 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 940 may be a radio frequency (RF) module used for wireless communication with the Internet.
[0118] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 900 may also include... Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.
[0119] Embodiments of this application also provide a storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the vehicle information security detection method as described above.
[0120] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for detecting vehicle information security, characterized in that, include: Acquire vehicle bus communication data for the target time period; Based on the vehicle bus communication data, communication data features, time features, and graph structure features are extracted and integrated into a tensor set. The communication data features represent the communication data sent and received by each electronic control unit of the vehicle at each time node in the target time period. The time features represent the time nodes when each electronic control unit sends and receives communication data. The graph structure features include nodes and edges between nodes, with each node corresponding one-to-one with each electronic control unit. The tensor set is input into the lightweight detection model of the vehicle terminal to obtain the node attack prediction result, which represents the prediction of the electronic control unit corresponding to the target node being attacked within the target time period. The lightweight detection model is obtained by lightweighting a pre-trained attack detection model on the server side. The attack detection model includes a graph neural network layer, a long short-term memory network layer, and an attention mechanism layer.
2. The method according to claim 1, characterized in that, The step of inputting the tensor set into the lightweight detection model of the vehicle-mounted terminal to obtain the node attack prediction result includes: The tensor set is input into the lightweight detection model of the vehicle terminal, and a first target feature is extracted in the graph neural network layer of the lightweight detection model. The first target feature indicates whether each electronic control unit has an abnormal flow. The tensor set is input into the long short-term memory network layer to determine the characteristics of abnormal traffic moments in the long short-term memory network layer of the lightweight detection model. In the attention mechanism layer of the lightweight detection model, a target temporal feature associated with the traffic anomaly moment feature is determined, and a second target feature associated with the target temporal feature is extracted from the tensor set. The second target feature indicates whether a temporal anomaly occurs at each node. Based on the target feature vector obtained by integrating the first target feature and the second target feature, the attack category and attack probability corresponding to the target feature vector are determined as the node attack prediction result. The target feature vector represents the feature of whether each electronic control unit has an anomaly.
3. The method according to claim 2, characterized in that, The communication data features include the timing features, content features, and association structure features of the communication data sent and received by each electronic control unit. The timing features represent the order in which the communication data is sent and received by each electronic control unit. The content features include the flow characteristics of each electronic control unit at each time node and the text features of the communication data sent and received by each electronic control unit. The association structure features represent the communication flow direction between the various electronic control units. The step of inputting the tensor set into the lightweight detection model of the vehicle terminal and extracting the first target feature in the graph neural network layer of the lightweight detection model includes: obtaining the first target feature based on the content feature, the association structure feature and the graph structure feature; The step of inputting the tensor set into the long short-term memory network layer and determining the traffic anomaly moment features in the long short-term memory network layer of the lightweight detection model includes: obtaining the traffic anomaly moment features based on the temporal features, the content features, and the time features; The step of determining the target temporal feature associated with the traffic anomaly moment feature in the attention mechanism layer of the lightweight detection model includes: obtaining the target temporal feature based on the temporal feature and the traffic anomaly moment feature.
4. The method according to claim 3, characterized in that, Extracting the first target feature from the graph neural network layer of the lightweight detection model includes: Based on the graph structure features, the content features, and the association structure features, first graph structure data and second graph structure data are determined. The first graph structure data represents the actual traffic situation and actual edge information between each node, and the second graph structure data represents the theoretical traffic level and theoretical edge information of each node. Based on the comparison results between the first graph structure data and the second graph structure data, nodes whose actual traffic exceeds the theoretical traffic and nodes whose actual number of edges is greater than the theoretical number of edges are identified as traffic abnormal nodes. The characteristics of the electronic control unit corresponding to the abnormal traffic node are determined as the first target characteristic.
5. The method according to claim 4, characterized in that, Based on the comparison results between the first graph structure data and the second graph structure data, nodes whose actual traffic exceeds the theoretical traffic and nodes whose actual number of edges is greater than the theoretical number of edges are identified as traffic anomaly nodes, including: Based on the first graph structure data and the second graph structure data, the attention coefficients of any node to other nodes are determined using a graph attention mechanism, resulting in a set of attention coefficients. Based on the set of attention coefficients, nodes with attention coefficients greater than a preset coefficient value are identified as abnormal traffic nodes.
6. The method according to claim 3, characterized in that, The step of determining the target temporal features associated with the traffic anomaly time in the attention mechanism layer of the lightweight detection model includes: First time-series data is determined based on the time of the traffic anomaly, and second time-series data is determined based on the time-series characteristics. The first time-series data represents the time-series information of the anomaly attack reference, and the second time-series data represents the time-series information of each node in the target time period. The second time series data is compared with the first time series data using a multi-head attention mechanism, and the time series feature whose time series information is the same as the time series information referenced by the abnormal attack is determined as the target time series feature.
7. The method according to any one of claims 1-6, characterized in that, The method further includes the attack detection model training method, which includes: Obtain a preset machine learning model; the preset machine learning model includes an initial graph neural network layer, an initial long short-term memory network layer, an initial attention mechanism layer, and an initial fully connected output layer; Acquire attack sample data; the attack sample data includes communication data characteristics, time characteristics, graph structure characteristics corresponding to historical bus communication data, and labeled attack data corresponding to each electronic control unit of the vehicle; The attack detection model is obtained by training the preset machine learning model based on attack sample data.
8. The method according to claim 7, characterized in that, The method further includes the lightweight detection model generation method, wherein the lightweight detection model generation method is as follows: Obtain a preset lightweight model corresponding to the attack detection model; The attack detection model is determined as the teacher model, and the preset lightweight model is determined as the student model; Based on the teacher model and the student model, knowledge distillation is performed to obtain distillation loss. If the distillation loss is less than or equal to the loss threshold, the student model is determined as the lightweight detection model.
9. The method according to claim 7, characterized in that, After inputting the tensor set into the vehicle-mounted lightweight detection model to obtain the node attack prediction result, the method further includes: If the entropy value of the node attack prediction result is greater than the preset entropy value, or if the similarity between the tensor set and the attack sample data is less than the preset similarity, it is determined that the lightweight detection model needs to be updated. Acquire attack annotation data, generate a new sample set based on the tensor set and the attack annotation data, and incrementally train the attack detection model using the new sample set.
10. A car, characterized in that, Includes a controller for performing the vehicle information security detection method according to any one of claims 1-9.