A spatiotemporal-based intrusion detection method for autonomous vehicles

By combining time series and spatial distribution analysis and using graph attention mechanism and Mahalanobis distance for multi-dimensional intrusion detection, the problem of inaccurate abnormal positioning caused by only considering spatial relationships in existing methods is solved, and efficient and real-time autonomous driving vehicle safety detection is achieved.

CN118677669BActive Publication Date: 2025-09-23JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410804253.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-09-23
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

Existing intrusion detection methods based on vehicle sensors only consider the relationship of data in the spatial dimension, ignoring the physical characteristics of the data itself, resulting in inaccurate anomaly positioning and limitations.

Method used

A multi-dimensional analysis method is adopted, combined with time series analysis and spatial distribution analysis, and graph attention mechanism and Mahalanobis distance are used for intrusion detection. By preprocessing vehicle status data, building graph structure, learning data relationships, calculating anomaly scores and Mahalanobis distance, anomaly situations are comprehensively judged.

Benefits of technology

It achieves more accurate and efficient intrusion detection, can timely discover potential security threats, provide real-time security protection, improves the accuracy and real-time performance of anomaly detection, and can locate abnormal data sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677669B_ABST
    Figure CN118677669B_ABST
Patent Text Reader

Abstract

The present invention relates to a time-space-based autonomous driving vehicle intrusion detection method, which belongs to the field of vehicle-mounted network communication security. The vehicle status data value is obtained, and multivariate vehicle status data is obtained after preprocessing. The sliding window is divided, and the abnormal score of each vehicle status data is calculated in the spatial model. The abnormal score is compared with the threshold to obtain the intrusion detection result of the spatial model. In the time model, for the data in a sliding window, the cumulative sum of the Mahalanobis distance between two adjacent timestamps is calculated and compared with the threshold. The results of the time model and the space model are combined to obtain the final abnormality detection result. The advantage of the present invention is that by performing multi-dimensional analysis on the vehicle-mounted sensor data, abnormal patterns are identified, potential security threats are discovered and responded to in a timely manner, and intrusion detection can be performed more accurately and efficiently while meeting the real-time requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle network communication security, and in particular to a time-space based intrusion detection method for autonomous driving vehicles. Background Art

[0002] With the rapid development of artificial intelligence and sensor technology, autonomous driving has made significant progress and has been widely used and researched worldwide due to its convenience, efficiency, and safety. A vehicle's onboard network architecture includes numerous sensors, electronic control units (ECUs), controllers, and gateways. These components are interconnected via the Controller Area Network (CAN) protocol, enabling diverse functions and exchanging information. However, the CAN bus lacks essential security mechanisms, making connected vehicles increasingly vulnerable to malicious attacks.

[0003] To address these security threats while meeting both accuracy and real-time requirements, intrusion detection-based methods have been proposed. These methods are lightweight security approaches that efficiently detect anomalies in vehicle networks without modifying existing vehicle systems. CAN bus-based intrusion detection techniques can be divided into two categories: one is based on transmission features, which apply predefined rules within a fixed sliding window and identify anomalies when feature changes exceed a threshold; the other is based on data, which utilizes the data and information carried by CAN messages to detect intrusions.

[0004] In addition, intrusion detection methods based on vehicle sensor correlation perform intrusion detection by studying the relationships between on-board sensors that share the same physical phenomena. Kim et al. proposed a switching algorithm that uses homogeneous sensor information to detect anomalies. Ganesan et al. used cluster analysis of the pairwise correlations between key variables of on-board sensors to detect anomalies. Sagong et al. proposed a method that uses the CUSUM algorithm to detect the correlation between vehicle motion information. While existing intrusion detection methods based on vehicle sensors can detect anomalies by leveraging correlations between data, they only consider the relationships between data in the spatial dimension, ignoring the physical properties of the data itself, and also have certain limitations in locating anomalies. Summary of the Invention

[0005] This invention provides a spatiotemporal intrusion detection method for autonomous vehicles. It addresses the problem that existing methods only consider data relationships in spatial dimensions, ignoring the physical properties of the data itself, and failing to effectively detect anomalies. This method analyzes onboard sensor data in multiple dimensions to identify abnormal patterns, allowing for the timely detection and response to potential security threats. This method achieves more accurate and efficient intrusion detection while maintaining real-time performance.

[0006] The technical solution adopted by the present invention comprises the following steps:

[0007] S1: Obtain several vehicle status data values ​​from sensors of the autonomous vehicle network system;

[0008] S2: resample the acquired raw data, process missing values, and then perform data standardization to obtain preprocessed multivariate vehicle status data;

[0009] S3: Divide the sliding windows for temporal and spatial models;

[0010] S4: In the spatial model, we use the graph attention mechanism for intrusion detection: First, we build a graph structure to learn the relationship between each vehicle status data. Then, we use the graph attention mechanism to predict the value of each vehicle status data at each moment. Finally, we calculate the anomaly score of each vehicle status data based on the prediction result, compare the anomaly score with the threshold, and obtain the intrusion detection result of the spatial model.

[0011] S5: In the time model, Mahalanobis distance is used for intrusion detection: for the data in a sliding window, the sum of the Mahalanobis distances between two adjacent timestamps is calculated. If it is greater than the threshold, it is considered an anomaly.

[0012] S6: For the vehicle status data within each sliding window, the results of the time model and the spatial model are integrated to obtain the final anomaly detection result.

[0013] The specific process of preprocessing the data in step S2 of the present invention is as follows:

[0014] Resampling operation: Since the original sampling rate of the data is different, the data is resampled using the same sampling frequency;

[0015] Missing value processing: a deletion strategy is adopted for data at a certain moment with missing values ​​after resampling;

[0016] Data normalization: Each vehicle status data is normalized using the maximum and minimum normalization method;

[0017] The specific operation of dividing the sliding window for the model in step S3 of the present invention is as follows:

[0018] In the data set, there are N vehicle status data corresponding to M timestamps, which are represented as: C = {c1, c2, ... c t …,c M}, M represents the total M-dimensional data in time; c t ={c t,1 ,…,c t,i …,c t,N}, C t,i Represents the status data of the i-th vehicle at time t. The sliding window method is used to intercept the vehicle status data in real time. The size of the sliding window is set to w, the step size is set to 1, and the data in a sliding window is expressed as:

[0019]

[0020] The specific steps of using the graph attention mechanism to perform intrusion detection in step S4 of the present invention are as follows:

[0021] (1) Directed graph construction

[0022] For the vehicle status data of the input space model, we first introduce an embedding vector for each vehicle status data, and then build a graph structure based on the relationship between them;

[0023] The embedding vector introduced for each vehicle state data is represented as:

[0024]

[0025] where v i represents the embedding vector of the i-th vehicle state data, and d indicates that the vehicle state data has d-dimensional features;

[0026] Construct a directed graph A to represent the relationship between each vehicle status data. The graph is a complete graph. Each vehicle status data is regarded as a node in the directed graph, and its embedding vector is v i , the edge between nodes represents the dependency relationship between each vehicle status data, and the weight on the edge is the degree of dependency between two vehicle status data, expressed as e ji express:

[0027]

[0028] v i and v j Represent the embedding vectors of vehicle status data i and j respectively, j represents all vehicle status data except i, that is, any neighbor node of node i, e ji The calculation is v i and v j The cosine similarity between them is used to indicate the degree of dependence between the two vehicle status data;

[0029] (2) Aggregation based on graph attention mechanism

[0030] Take time t as an example: using the graph attention mechanism based on the data x in a sliding window (t) And graph structure A, predict the N vehicle status data at time t:

[0031] The graph attention mechanism is used to learn the relationship between the nodes in the graph from the spatial dimension, and the characteristics of each node are Update, for each node according to the attention coefficient α i,j Aggregate features of adjacent nodes, α i,j The calculation formula is:

[0032]

[0033] Among them, α i,j represents the attention coefficient from node j to node i, j represents the neighbor node of node i, which is used to measure the importance of node j to node i; v i and v j Represent the embedding vectors of vehicle state data i and j respectively; W is a trainable weight parameter matrix used to perform linear transformation on each node; and Represent the input features of node i and node j respectively; represents the transposition of the learning coefficient vector of the attention mechanism; Represents the connection symbol; LeakyReLU is used as the nonlinear activation function, and the softmax function is used to normalize the attention coefficient;

[0034] The aggregation results of each node at time t are expressed as For node i, not only the influence of its neighbor nodes on its features should be considered, but also the contribution of its own features to its features should be considered. The aggregation result It can be expressed as:

[0035]

[0036] in, represents the updated features of node i at time t; L is the set of all neighbor nodes of node i, j represents any neighbor node; α i,j represents the attention coefficient from node j to node i, indicating the importance of node j to node i, α i,i is the attention coefficient of node i itself, which indicates the contribution of node i’s own features to its updated features; and Represent the input features of node i and node j respectively; W is a trainable weight parameter matrix that performs a linear transformation on each node; ReLU is an activation function that performs a nonlinear transformation on the weighted feature sum of node i;

[0037] (3) Output prediction results

[0038] Multiply the aggregation result of each node by its corresponding embedding vector to obtain the prediction result of each vehicle status data at time t

[0039]

[0040] f θ Represents a function with parameters θ that maps input features to prediction results;

[0041] The loss function of the spatial model is as follows:

[0042] Based on the predicted results and the true values, the mean square error is used as the minimization loss function, and the model with the minimum loss function result is used as the optimal network model, which is the model used in the anomaly detection stage. The loss function Loss is expressed as:

[0043]

[0044] in is the prediction result of the model at time t, c t is the true value, M is the total number of timestamps in the training set, and w is the size of a sliding window, which is used in the above formula to represent the number of initial time steps that are ignored during the training process;

[0045] (4) Calculate the anomaly score

[0046] Based on the prediction results and the true value c t Calculate the anomaly score of each vehicle status data at time t, and normalize the residuals to make the residuals of different scales comparable. The calculation process of the anomaly score is:

[0047]

[0048] In the formula, c t,i represents the true value of vehicle status data i at time t, represents the predicted value of vehicle state data i at time t, represents the difference between the true value and the predicted value of the i-th vehicle state data at time t, is the mean value, is the standard deviation, which is used to standardize the residuals;

[0049] (5) Compare with the threshold

[0050] The vehicle status data with the largest anomaly score at time t is taken as the anomaly object at that moment and compared with the threshold T1. If it is greater than the threshold, the vehicle is abnormal at that moment and may be attacked. If it is less than the threshold T1, the sliding window moves one step and continues to predict the value of the vehicle status data at the next moment.

[0051] Based on the spatial model, if an anomaly is detected at a certain moment, first check which vehicle status data has the largest anomaly score at that moment. After locating the vehicle status data, then check the dependence degree e of the vehicle status data in (1). ji For the few vehicle status data with the highest scores, perform anomaly handling work such as cause screening.

[0052] In step S5 of the present invention, the specific steps of using Mahalanobis distance for intrusion detection are as follows:

[0053] In the time model, for the data x within a sliding window (t) =[c t-w ,c t-w+1 ,…,c t-1 , calculate the Mahalanobis distance D between two adjacent timestamps. The calculation process is as follows:

[0054]

[0055] Among them, c t+1 ,c t represent the multi-dimensional vehicle status data of two adjacent timestamps, and S is the covariance matrix of c:

[0056]

[0057] Among them, w represents the size of the sliding window, c i represents the i-th sample row in the dataset, is the mean vector; the integration of all Mahalanobis distances within this sliding window is expressed as:

[0058] K={D 1 ,D 2 ,…,D m-1}

[0059] Perform a difference operation pairwise on all the Mahalanobis distances within a sliding window, and then sum them:

[0060] [[ID=PO=51]]

[0061] Compare its sum with the threshold T2. If H>T2, there is an anomaly within this sliding window. If H<T2, the data within this sliding window is normal, and continue to detect the next sliding window.

[0062] In step S / 6 of the present invention, the specific steps of comprehensively analyzing the intrusion detection results are as follows:

[0063] In the spatial model, after accumulating and predicting data of a sliding window size, the results are summarized as the prediction results of a sliding window. If there is an anomaly at a certain moment in the sliding window, it is determined that there is an anomaly in the sliding window. In the temporal model, if the sum of the accumulated Mahalanobis distances in a sliding window is greater than the threshold, an anomaly exists.

[0064] For the vehicle status data within each sliding window, the intrusion detection results of the time model and the space model are integrated: an OR operation is used. Only when both the time model and the space model are judged to be normal will the sliding window be considered normal.

[0065] Compared with the existing technology, the present invention has the following advantages:

[0066] First: The present invention combines time series analysis and spatial distribution analysis to perform anomaly detection on vehicle status data from both time and space dimensions, which can more comprehensively monitor and detect abnormal behaviors and potential intrusion activities of autonomous driving vehicles, thereby providing strong protection for the safe operation of autonomous driving vehicles.

[0067] Second: The present invention spatially adopts the graph attention mechanism to aggregate the values ​​of its own node and neighboring nodes. Taking into account the characteristics of the data itself, the embedded features of each vehicle data itself are integrated into the prediction results, reducing the error between the predicted value and the true value, which is conducive to improving the accuracy of anomaly detection.

[0068] Third: This invention uses a graph neural network to spatially learn the degree of correlation between vehicle status data, quantifying the dependencies between data points. When an anomaly occurs, the source of the abnormal data collection can be located based on the anomaly score and the correlation between data points, which facilitates subsequent anomaly handling.

[0069] Fourth: The present invention has high real-time performance and can be used for real-time abnormality detection of vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 This is a flow chart of an implementation of a time-space-based autonomous driving vehicle intrusion detection method provided by an example of the present invention;

[0071] Figure 2 This is a structural framework diagram of a spatiotemporal-based autonomous vehicle intrusion detection method provided by an example of the present invention;

[0072] Figure 3 This is a comparison chart of the predicted results and the actual results based on the graph attention mechanism of the present invention;

[0073] Figure 4 This is a visualization diagram of intrusion detection based on Mahalanobis distance in the present invention. DETAILED DESCRIPTION

[0074] In order to better illustrate the examples of the present invention, the specific simulation experiments of the present invention are described more clearly below with reference to the accompanying drawings.

[0075] Figure 1 This is a flow chart of a specific implementation of the spatiotemporal-based autonomous driving vehicle intrusion detection method of the present invention, and the specific steps include:

[0076] 1. Get vehicle status data value

[0077] The simulation used an open-source 223GB driving data dataset. The data in the dataset was screened and, based on the law of physical invariance, some sensor data was obtained to simulate vehicle states. The Pearson correlation coefficient was used to calculate the correlation between any two sensor data points. Sensor data with a Pearson correlation coefficient greater than 0.5 or less than -0.5 were selected for the experiment, and intrusion detection of autonomous vehicles was performed.

[0078] 2. Perform data preprocessing on the acquired raw data

[0079] Data resampling: Since the original sampling rates of the data are different, the data are resampled using the same sampling frequency (10 Hz);

[0080] Missing value processing: a deletion strategy is adopted for data at a certain moment with missing values ​​after resampling;

[0081] Data normalization: Each vehicle status data is normalized using the maximum and minimum normalization method. The normalization formula is as follows:

[0082]

[0083] Among them, x i is a value in the original data, x′ i is the normalized value, x max is the maximum value in the eigenvector, that is, x max =max(x),x min is the minimum value in the eigenvector, that is, x min =min(x);

[0084] Dataset division: The processed data is divided into a training set and a test set. The training set is used for model training and threshold selection, and the test set is used to simulate the intrusion detection process to obtain the performance indicator data of the model.

[0085] 3. Divide sliding windows for temporal and spatial models

[0086] In the data set, there are N vehicle status data corresponding to M timestamps, which are represented as: C = {c1, c2, ... c t …,c M}, M represents the total M-dimensional data in time; c t ={c t,1 ,…,c t,i …,c t,N}, C t,i Represents the status data of the i-th vehicle at time t. The sliding window method is used to intercept the vehicle status data in real time. The size of the sliding window is set to w, the step size is set to 1, and the data in a sliding window is expressed as:

[0087]

[0088] The data x in a sliding window (t) The spatial model and temporal model are fed into the system for anomaly detection. For the spatial model, the state data of each vehicle at time t is predicted based on the data within the sliding window. For the temporal model, whether an anomaly occurs within the sliding window is directly determined.

[0089] 4. Spatial Intrusion Detection Based on Graph Attention Mechanism

[0090] Combine Figure 2 The spatial anomaly detection model in

[15] builds a graph structure to learn the relationship between each vehicle status data, uses the graph attention mechanism to predict the value of each vehicle status data at each moment, calculates the anomaly score of each vehicle status data based on the prediction result, compares the anomaly score with the threshold, and obtains the intrusion detection result of the spatial model. The specific steps are as follows:

[0091] 4.1 Directed Graph Construction

[0092] For the vehicle state matrix of the input space model, an embedding vector is first introduced for each vehicle state data, and then a graph structure is constructed based on the relationship between them;

[0093] The embedding vector introduced for each vehicle state data is represented as:

[0094]

[0095] where v i represents the embedding vector of the i-th vehicle state data, and d indicates that the vehicle state data has d-dimensional features;

[0096] Construct a directed graph A to represent the relationship between each vehicle status data. The graph is a complete graph. Each vehicle status data is regarded as a node in the directed graph, and its embedding vector is v i, the edge between nodes represents the dependency relationship between each vehicle status data, and the weight on the edge is the degree of dependency between two vehicle status data, expressed as e ji express:

[0097]

[0098] v i and v j Represent the embedding vectors of vehicle status data i and j respectively, j represents all vehicle status data except i, that is, any neighbor node of node i, e ji The calculation is v i and v j The cosine similarity between them is used to indicate the degree of dependence between the two vehicle status data;

[0099] 4.2 Aggregation based on graph attention mechanism

[0100] Take time t as an example: using the graph attention mechanism based on the data x in a sliding window (t) And graph structure A, predict the N vehicle status data at time t:

[0101] The graph attention mechanism is used to learn the relationship between the nodes in the graph from the spatial dimension, and the characteristics of each node are Update, for each node according to the attention coefficient α i,j Aggregate features of adjacent nodes, α i,j The calculation formula is:

[0102]

[0103] Among them, α i,j represents the attention coefficient from node j to node i, j represents the neighbor node of node i, which is used to measure the importance of node j to node i; v i and v j Represent the embedding vectors of vehicle state data i and j respectively; W is a trainable weight parameter matrix used to perform linear transformation on each node; and Represent the input features of node i and node j respectively; represents the transposition of the learning coefficient vector of the attention mechanism; Represents the connection symbol; LeakyReLU is used as the nonlinear activation function, and the softmax function is used to normalize the attention coefficient;

[0104] The aggregation results of each node at time t are expressed as For node i, not only the influence of its neighbor nodes on its features should be considered, but also the contribution of its own features to its features should be considered. The aggregation result It can be expressed as:

[0105]

[0106] in, represents the updated features of node i at time t; L is the set of all neighbor nodes of node i, j represents any neighbor node; α i,j represents the attention coefficient from node j to node i, indicating the importance of node j to node i, α i,i is the attention coefficient of node i itself, which indicates the contribution of node i’s own features to its updated features; and Represent the input features of node i and node j respectively; W is a trainable weight parameter matrix that performs a linear transformation on each node; ReLU is an activation function that performs a nonlinear transformation on the weighted feature sum of node i;

[0107] 4.3 Output prediction results

[0108] Figure 3 This is a comparison chart of the predicted results and actual results of vehicle speed based on the graph attention mechanism;

[0109] Multiply the aggregation result of each node by its corresponding embedding vector to obtain the prediction result of each vehicle status data at time t

[0110]

[0111] f θ Represents a function with parameters θ that maps input features to prediction results;

[0112] The loss function of the spatial model is as follows:

[0113] Based on the predicted results and the true values, the mean square error is used as the minimization loss function, and the model with the minimum loss function result is used as the optimal network model, which is the model used in the anomaly detection stage. The loss function is expressed as:

[0114]

[0115] in is the prediction result of the model at time t, c t is the true value, M is the total number of timestamps in the training set, and w is the size of a sliding window, which is used in the above formula to represent the number of initial time steps that are ignored during the training process;

[0116] 4.4 Calculating anomaly scores

[0117] Based on the prediction results and the true value c t Calculate the anomaly score of each vehicle status data at time t, normalize the residuals to make the residuals of different scales comparable, and the calculation process of the anomaly score is as follows:

[0118]

[0119] In the formula, c t,i represents the true value of vehicle status data i at time t, represents the predicted value of vehicle state data i at time t, represents the difference between the true value and the predicted value of the i-th vehicle state data at time t, is the mean value of is the standard deviation, which is used to standardize the residuals;

[0120] 4.5 Comparison with threshold

[0121] The vehicle status data with the largest anomaly score at time t is taken as the anomaly object at that moment and compared with the threshold T1. If it is greater than the threshold, the vehicle is abnormal at that moment and may be attacked. If it is less than the threshold T1, the sliding window moves one step and continues to predict the value of the vehicle status data at the next moment.

[0122] Output anomaly detection results based on spatial model;

[0123] 5. Temporal intrusion detection based on Mahalanobis distance

[0124] Combine Figure 2 In the temporal anomaly detection model, for data x in a sliding window, (t) =[c t-w ,c t-w+1 ,…,c t-1 ], calculate the Mahalanobis distance D between two adjacent timestamps,

[0125] Figure 4 The Mahalanobis distance visualization diagram between two adjacent timestamps during a period of time containing attacks. The calculation process of D is:

[0126]

[0127] Among them, c t+1 ,c t Represents the multidimensional vehicle state data of two adjacent timestamps, and S is the covariance matrix of c:

[0128]

[0129] Among them, w represents the size of the sliding window, ci represents the \(i\)-th sample row in the dataset, is the mean vector. The integrated Mahalanobis distances within this sliding window are expressed as:

[0130] K = {D 1 , D 2 , …, D m-1}

[0131] Perform pairwise difference operations on all the Mahalanobis distances within a sliding window, and then sum them:

[0132]

[0133] Compare its sum with the threshold \(T_2\). If \(H > T_2\), there is an anomaly within this sliding window; if \(H < T_2\), the data within this sliding window is normal, and continue to detect the next sliding window; ]>

[0134] 6. Comprehensive intrusion detection results

[0135] In the spatial model, after accumulating and predicting the data of one sliding window size, summarize its results into the prediction result of one sliding window. If there is an anomaly at a certain moment within the sliding window, it is determined that there is an anomaly within this sliding window. In the time model, if the sum of the cumulative Mahalanobis distances within a sliding window is greater than the threshold, there is an anomaly.

[0136] For the vehicle status data within each sliding window, comprehensively consider the intrusion detection results of the time model and the spatial model: use the or operation. Only when both the time model and the spatial model determine that there is no anomaly, this sliding window will be recognized as normal.

[0137] Next, the effect of the present invention will be further illustrated through simulation experiments and result analysis.

[0138] Simulation experiment: Conduct intrusion detection experiments by simulating four types of attacks in the test set. The four types of attacks are respectively:

[0139] Hijacking attack: The attacker hijacks the electronic control unit or sensor and reports error messages on the CAN bus. The attacker sends random CAN data frames or sends tampered messages.

[0140] Bias attack: For a period of time, the sensor information readings of the vehicle's physical state deviate slightly from the true values, which means that the sensor is under attack or is no longer accurate.

[0141] Message injection: The vehicle is suffering from a wireless message injection attack. Some injected sensor messages are randomly broadcast on the CAN bus, and the ECUs connected to the CAN bus will receive incorrect messages.

[0142] DOS attack: The purpose of a DOS attack is to make the expected functions or services of the vehicle system unavailable. Attackers can launch a DOS attack by flooding the vehicle network with high-frequency legitimate CAN messages, thereby exhausting system resources and causing functional failure.

[0143] The intrusion detection results based on the present invention are shown in Table 1. The model is evaluated with reference to several performance indicators such as accuracy, precision, and F1 score:

[0144] Table 1

[0145]

[0146] As can be seen from Table 1, the model performs well under different types of attacks, with high accuracy, precision, recall and F1 score, which verifies its effectiveness and reliability in intrusion detection.

[0147] Furthermore, the method demonstrates excellent real-time performance, with an average prediction and analysis time of 1 millisecond for a single piece of vehicle sensor data. This high real-time performance ensures the model can rapidly identify and respond to potential security threats, providing timely protective measures and effectively safeguarding the safety of autonomous vehicles.

[0148] To further investigate the performance of the proposed method, we compared it with a motion-based intrusion detection system (MIDS). MIDS detects whether a sensor is under attack by analyzing the relationship between the sensor and other related sensors. The results are shown in Table 2:

[0149] Table 2

[0150]

[0151] As shown in Table 2, the proposed method outperforms MIDS on all three evaluation criteria. This is primarily because MIDS only considers correlations between single pairs of sensors, while the proposed method not only considers the interrelationships between multiple pairs of sensors but also the characteristics of the sensors themselves, enabling a more comprehensive capture and analysis of complex relationships between data. The proposed method also performs multi-dimensional analysis of on-board sensor data, incorporating information from both temporal and spatial dimensions, making the model more accurate in anomaly detection and localization.

Claims

1. A spatiotemporal-based autonomous driving vehicle intrusion detection method, characterized in that: The following steps are involved: S1: Obtain several vehicle status data values ​​from sensors of the autonomous vehicle network system; S2: resample the acquired raw data, process missing values, and then perform data standardization to obtain preprocessed multivariate vehicle status data; S3: Divide the sliding windows for temporal and spatial models; S4: In the spatial model, use the graph attention mechanism for intrusion detection: First, build a graph structure to learn the relationship between each vehicle status data. Then use the graph attention mechanism to predict the value of each vehicle status data at each moment. Finally, calculate the anomaly score of each vehicle status data based on the prediction result, compare the anomaly score with the threshold, and obtain the intrusion detection result of the spatial model. The specific steps are as follows: (1) Directed graph construction For the vehicle status data of the input space model, we first introduce an embedding vector for each vehicle status data, and then build a graph structure based on the relationship between them; The embedding vector introduced for each vehicle state data is represented as: ; in represents the embedding vector of the i-th vehicle state data, and d indicates that the vehicle state data has d-dimensional features; Constructing a directed graph To represent the relationship between each vehicle status data, the graph is a complete graph, each vehicle status data is regarded as a node in the directed graph, and its embedding vector is , the edge between nodes represents the dependency between each vehicle status data, and the weight on the edge is the degree of dependency between two vehicle status data. express: ; and Represent the embedding vectors of vehicle status data i and j respectively, j represents all vehicle status data except i, that is, any neighbor node of node i, The calculation is and The cosine similarity between them is used to indicate the degree of dependence between the two vehicle status data; (2) Aggregation based on graph attention mechanism by Moment as an example: Using the graph attention mechanism based on data within a sliding window And graph structure ,right The N vehicle status data at the moment are predicted: The graph attention mechanism is used to learn the relationship between the nodes in the graph from the spatial dimension, and the characteristics of each node are Update, for each node according to the attention coefficient Aggregate features of adjacent nodes, The calculation formula is: ; in, represents the attention coefficient from node j to node i, j represents the neighbor node of node i, which is used to measure the importance of node j to node i; and Represent the embedding vectors of vehicle state data i and j respectively; It is a trainable weight parameter matrix used to perform linear transformation on each node; and Represent the input features of node i and node j respectively; Indicates the transposition of the learning coefficient vector of the attention mechanism; Indicates a connection symbol; use As a nonlinear activation function, and the softmax function is used to normalize the attention coefficient; The aggregation results of each node at time t are expressed as For node i, not only the influence of its neighbor nodes on its features should be considered, but also the contribution of its own features to its features. The aggregation result It can be expressed as: ; in, represents the updated features of node i at time t; L is the set of all neighbor nodes of node i, and j represents any neighbor node; represents the attention coefficient from node j to node i, indicating the importance of node j to node i, is the attention coefficient of node i itself, which indicates the contribution of node i’s own features to its updated features; and Represent the input features of node i and node j respectively; It is a trainable weight parameter matrix that performs a linear transformation on each node; ReLU is an activation function that performs a nonlinear transformation on the weighted feature sum of node i; (3) Output prediction results Multiply the aggregation result of each node by its corresponding embedding vector to obtain the prediction result of each vehicle status data at time t : ; represents a function with parameter 𝜃, which is used to map input features to prediction results; The loss function of the spatial model is as follows: Based on the predicted results and the true value, the mean square error is used as the minimization loss function, and the model with the smallest loss function result is used as the optimal network model, which is the model used in the anomaly detection stage. The loss function Expressed as: ; in is the prediction result of the model at time t, is the true value, M is the total number of timestamps in the training set, is the size of a sliding window, which is used in the above formula to represent the number of initial time steps that are ignored during training; (4) Calculate the anomaly score Based on the prediction results and the true value Calculate the abnormal score of each vehicle status data at time t, normalize the residuals so that the residuals of different scales are comparable, and the abnormal score The calculation process is: ; in the formula represents the true value of vehicle status data i at time t, represents the predicted value of vehicle state data i at time t, represents the difference between the true value and the predicted value of the i-th vehicle state data at time t, is the mean value of is the standard deviation, which is used to standardize the residuals; (5) Compare with the threshold Take the vehicle status data with the largest anomaly score at time t as the anomaly object at that moment, and compare it with the threshold Compare, if it is greater than the threshold, then the vehicle is abnormal at that moment and may be attacked; if it is less than the threshold , the sliding window moves one step and continues to predict the value of the vehicle status data at the next moment; Based on the spatial model, if an anomaly is found at a certain moment, first check which vehicle status data has the largest anomaly score at that moment, and then check the dependency degree of the vehicle status data in (1) after locating the vehicle status data. The highest vehicle status data is used to conduct abnormality processing such as cause screening; S5: In the time model, Mahalanobis distance is used for intrusion detection: for the data in a sliding window, the sum of the Mahalanobis distances between two adjacent timestamps is calculated. If it is greater than the threshold, it is considered an anomaly. S6: For the vehicle status data within each sliding window, the results of the time model and the spatial model are integrated to obtain the final anomaly detection result.

2. The spatiotemporal-based intrusion detection method for autonomous driving vehicles according to claim 1, characterized in that: The specific process of pre-processing the data in step S2 is as follows: Resampling operation: Since the original sampling rate of the data is different, the data is resampled using the same sampling frequency; Missing value processing: a deletion strategy is adopted for data at a certain moment with missing values ​​after resampling; Data normalization: Each vehicle status data is normalized separately using the maximum and minimum normalization method.

3. The spatiotemporal-based intrusion detection method for autonomous driving vehicles according to claim 1, characterized in that: The specific operation of dividing the sliding window for the model in step S3 is as follows: In the dataset, there are N vehicle status data corresponding to M timestamps represented as: , M means there are M-dimensional data in time; , Represents the status data of the i-th vehicle at time t. The sliding window method is used to intercept the vehicle status data in real time. The size of the sliding window is set to w, the step size is set to 1, and the data in a sliding window is expressed as: 。 4. The spatiotemporal-based intrusion detection method for autonomous driving vehicles according to claim 1, characterized in that: In step S5, the specific steps of using Mahalanobis distance to perform intrusion detection are as follows: In the time model, for data within a sliding window , calculate the Mahalanobis distance between two adjacent timestamps , and its calculation process is: ; in, Represents multi-dimensional vehicle status data of two adjacent timestamps, is the covariance matrix of c: ; in, represents the size of the sliding window, represents the i-th sample row in the dataset, is the mean vector; The integrated Mahalanobis distance of all the sliding windows is expressed as: ; Perform the difference operation on all Mahalanobis distances in a sliding window and then sum them up: ; and the threshold For comparison, if , there is an anomaly in the sliding window, if ,The data in this sliding window is normal, and the detection of the next sliding window will be continued.

5. The spatiotemporal-based intrusion detection method for autonomous driving vehicles according to claim 1, characterized in that: In step S6, the specific steps of synthesizing the intrusion detection results are as follows: In the spatial model, after accumulating and predicting data of a sliding window size, the results are summarized as the prediction results of a sliding window. If there is an anomaly at a certain moment in the sliding window, it is determined that there is an anomaly in the sliding window. In the temporal model, if the sum of the accumulated Mahalanobis distances in a sliding window is greater than the threshold, an anomaly exists. For the vehicle status data within each sliding window, the intrusion detection results of the time model and the space model are integrated: an OR operation is used. Only when both the time model and the space model are judged to be normal will the sliding window be considered normal.