A sensor attack detection method, device, medium and product in vehicle networking
By using a generative adversarial network based on an adaptive self-attention mechanism in the intelligent vehicle system to generate high-fidelity anomaly data, the problems of data imbalance and scarcity in sensor attack detection are solved, efficient and accurate attack detection is achieved, and the security of the system is improved.
Patent Information
- Application Number
- CN202510065394.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-01-16
AI Technical Summary
Sensor attack detection in intelligent vehicle systems is difficult to accurately identify attack behaviors, and due to data imbalance and scarcity of samples, traditional methods are prone to high false alarm rates or missed alarm rates, affecting vehicle safety.
Generative adversarial network (GAN) based on an adaptive self-attention mechanism, including anomaly data generation model and discriminant model, is used to generate high-fidelity anomaly data, and combine the adaptive and feedback mechanism to dynamically adjust the model parameters to adapt to changes in sensor data and attack mode.
It realizes efficient and accurate Internet of Vehicle attack detection in small sample scenarios, reduces the false alarm rate, improves the ability to identify multiple attack behaviors, and enhances the robustness and security of the system.
Smart Images

Figure CN119484167B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent vehicles, and in particular to a sensor attack detection method, device, medium and product in a connected vehicle. Background Art
[0002] With the development of intelligent driving technology, intelligent driving vehicles are becoming more and more intelligent. Among them, intelligent lighting systems, assisted driving systems, etc. rely on multiple sensors such as optical sensors, ambient light sensors, radars, LiDAR (Light Detection and Ranging), and infrared sensors to provide important information about the vehicle's surrounding environment. This information is transmitted through vehicle networks and inter-vehicle networks. Compared with vehicle networks, inter-vehicle networks realize multi-party real-time two-way communication between vehicles (V2V) and vehicles and roadbed facilities (V2I). Although this communication method can provide rich information data, it also brings a large amount of redundant information that is irrelevant to the attack detection task, resulting in distortion of environmental data perceived by sensors, which in turn affects the vehicle's decision-making system. These redundant data not only interfere with the attack detection model to extract effective information from the original data, but also aggravate the imbalance problem in the sample data, further increasing the complexity of detection. At the same time, although there are millions of malicious attacks every year, due to security and privacy reasons, the public sample data sets are very limited, especially samples that can cover multiple attack methods and attack points are scarce. The random nature of sensor attacks makes it difficult for traditional deterministic detection methods to accurately identify attack behaviors, often accompanied by a high false alarm rate. Faced with threats such as denial of service attacks, replay attacks, and message tampering, these attacks may lead to data tampering or signal interference, causing the autonomous driving system to make wrong decisions, directly endangering the safety of the vehicle and passengers.
[0003] In practical applications, the datasets of intelligent vehicle systems often face significant imbalance problems. Normal data accounts for the majority, while abnormal / attack data is relatively scarce, which poses a huge challenge to the detection system based on supervised learning. Data imbalance makes it difficult for the model to effectively identify a small amount of abnormal data, significantly reducing the detection capability and increasing the vulnerability of the system. Traditional detection methods based on nonlinear dynamic models face significant challenges in dealing with sensor attacks and in-vehicle network attacks, while detection methods based on deep learning and reinforcement learning are limited by scarce attack data and unbalanced datasets.
[0004] In addition, traditional deterministic detection methods perform poorly in dealing with these attacks, and are prone to high false positives or missed positives. Data imbalance and sample scarcity also exacerbate the difficulty of attack detection, and existing supervised learning methods cannot effectively address these challenges. Therefore, there is an urgent need for a more accurate and efficient attack detection technology to improve the safety and robustness of smart lighting systems and intelligent driving assistance systems. Summary of the invention
[0005] The purpose of this application is to provide a sensor attack detection method, equipment, medium and product in the Internet of Vehicles, which can realize accurate, efficient and real-time optimized Internet of Vehicles data analysis and network attack detection, thereby ensuring the safe operation of intelligent driving vehicles.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a sensor attack detection method in a connected vehicle network, the sensor attack detection method in the connected vehicle network comprising:
[0008] Acquire data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data;
[0009] Preprocess the data of real vehicles;
[0010] According to the preprocessed data, a new generative adversarial network is used to obtain generated data; the new generative adversarial network includes: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism;
[0011] Attack detection is performed on sample data consisting of generated data and preprocessed data and preprocessed data to obtain corresponding detection results; based on the detection results corresponding to the sample data consisting of generated data and preprocessed data and preprocessed data, a dynamic adjustment module based on an adaptive feedback mechanism is used to update the new generative adversarial network;
[0012] The updated new generative adversarial network is used to generate abnormal data, and sensor attack detection is performed based on the generated abnormal data.
[0013] Optionally, the preprocessing of the real vehicle data specifically includes:
[0014] Use normalization technology to map the real vehicle data to a uniform scale;
[0015] The normalized network data is subjected to key performance indicators and routing information; the key performance indicators include: number of data packets, data packet transmission delay and number of discarded data packets; the routing information includes: lifetime, payload size, source and destination MAC addresses, IP addresses and port numbers;
[0016] Embedded coding is used to convert routing information into continuous feature vectors.
[0017] Optionally, the abnormal data generation model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, a sample scaling layer, an upsampling layer, a convolution layer, a self-attention module based on an adaptive mechanism, a convolution layer, an activation function and an output layer connected in sequence.
[0018] Optionally, the abnormal data discrimination model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, an average pooling layer, a convolution layer, a self-attention module based on an adaptive mechanism, an average pooling layer, a convolution layer, an activation function and an output layer connected in sequence.
[0019] Optionally, the training objective of the novel generative adversarial network is a minimax optimization problem, specifically including the following formula:
[0020] ;
[0021] in, is the discriminant model, To generate the model, and They are the loss weights at time t, and the function , is the real data after preprocessing. To determine the predicted output probability of the model for the preprocessed real data, is the expected value, is the probability distribution of the random noise vector z, is the output data of the model generated based on the probability distribution of the noise, To discriminate the predicted output probability of the model for the generated data, To predict the expected value of the output data; is the time series consistency loss function, , and The generative models are Moment and Output data at each moment; is the attack class balancing loss function, , Indicates The number of attack data. Indicates the total number of attack categories.
[0022] Optionally, the updated loss weight of the new generative adversarial network specifically includes:
[0023] ;
[0024] ;
[0025] in, and are the updated loss weights, and It is a hyperparameter for adjusting the rate, which is used to control the speed of loss weight adjustment. is a constant used to avoid division by zero errors, and Respectively expressed in Moment and time series consistency loss function and attack category balance loss function The associated feedback error, and To represent respectively Moment and time series consistency loss function and attack category balance loss function Related feedback errors.
[0026] In a second aspect, the present application provides a sensor attack detection device in a connected vehicle network, the sensor attack detection device in the connected vehicle network comprising:
[0027] A data acquisition unit, used to acquire data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data;
[0028] A preprocessing unit, used for preprocessing the data of the real vehicle;
[0029] A data generation unit, configured to obtain generated data by using a novel generative adversarial network according to the preprocessed data; the novel generative adversarial network comprises: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism;
[0030] A model updating unit is used to perform attack detection according to sample data composed of generated data and preprocessed data and preprocessed data, respectively, to obtain corresponding detection results; according to the detection results corresponding to the sample data composed of generated data and preprocessed data and preprocessed data, a dynamic adjustment module based on an adaptive feedback mechanism is used to update the new generative adversarial network;
[0031] The detection unit is used to generate abnormal data by using the updated new generative adversarial network; and perform sensor attack detection based on the generated abnormal data.
[0032] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the sensor attack detection method in the Internet of Vehicles.
[0033] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the sensor attack detection method in the Internet of Vehicles.
[0034] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the sensor attack detection method in the Internet of Vehicles.
[0035] According to the specific embodiments provided in this application, this application has the following technical effects:
[0036] The present application provides a sensor attack detection method, device, medium and product in the Internet of Vehicles, and provides a sensor attack detection method based on a generative adversarial network (GAN) with a fusion mechanism, which can realize Internet of Vehicles attack detection suitable for small sample scenarios. The present application combines an adaptive mechanism, a feedback mechanism, a self-attention mechanism and a generative adversarial network to reduce the impact of small sample data and generate highly realistic abnormal data to solve the problem of scarce abnormal samples. The new generative adversarial network includes: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism, which can simulate a variety of sensor attack scenarios and generate realistic abnormal data. The self-attention mechanism plays a key role in the auxiliary discrimination model, captures the global dependencies in the sensor data, and significantly improves the detection capability of attack features. Introducing the adaptive mechanism into GAN can dynamically adjust the model parameters to adapt to the changes in sensor data and attack patterns, and improve the flexibility and accuracy of detection. The feedback mechanism optimizes the adversarial process between the generation model and the discrimination model through real-time feedback, and continuously improves the detection performance and robustness of the model. This combination enables the system to more accurately distinguish normal data from attack data in complex situations, effectively reducing the false alarm rate. This application can solve the problem of data imbalance, so that when faced with a large amount of normal data and a small amount of abnormal data, it can still maintain a strong attack identification capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 This is a flow chart of a sensor attack detection method in a connected vehicle network in one embodiment of the present application;
[0039] Figure 2 This is a schematic diagram of the principle of a new generative adversarial network;
[0040] Figure 3 Schematic diagram of the abnormal data generation model structure based on the adaptive self-attention mechanism;
[0041] Figure 4 Schematic diagram of the abnormal data discrimination model structure based on the adaptive self-attention mechanism. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0044] In an exemplary embodiment, Figure 1 and Figure 2 As shown, a sensor attack detection method in a connected vehicle network is provided, the method comprising the following S101 to S105. Among them:
[0045] S101, obtaining data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data;
[0046] Among them, sensor data includes: temperature, acceleration, pressure, etc.; network data includes: network nodes, latency, HTTP requests, etc.; log data includes: access control records, process status, etc.;
[0047] S102, preprocessing the data of the real vehicle;
[0048] S102 specifically includes:
[0049] S21, using normalization technology, maps the real vehicle data to a unified scale, eliminating the dimensional differences between different data types, laying a solid foundation for subsequent network training;
[0050] The normalized formula is usually:
[0051] ;
[0052] in, is the original data, and are the minimum and maximum values in the data set, respectively. The normalization technique can eliminate the magnitude differences between different data sources, thereby avoiding weight bias during model training.
[0053] S22, performing key performance indicators and routing information on the normalized network data; the key performance indicators include: number of data packets, data packet transmission delay, and number of discarded data packets; the routing information includes: time to live (TTL), payload size, source and destination MAC addresses, IP addresses, and port numbers;
[0054] Key performance indicators are used to describe the operating status and possible abnormal behavior of the system;
[0055] Packet transmission delay Calculated by the following formula:
[0056] ;
[0057] in, is the total number of packets, and They are The arrival time and sending time of the data packets, the packet loss rate It can be defined as:
[0058] ;
[0059] in, The number of packets dropped.
[0060] The above key performance indicators are input into the generative adversarial network to expand the intelligent vehicle light sensor anomaly database.
[0061] S23, uses embedded coding to convert the routing information into a continuous feature vector.
[0062] Assuming source IP address After embedding the matrix The conversion of embedded coding can be expressed as:
[0063] ;
[0064] in, is the index representation of discrete data, embedded in the matrix The dimension is ,in is the number of categories of discrete values, is the embedding dimension. is a length A continuous feature vector of , used as model input.
[0065] In the data preprocessing stage, data from different sources are processed uniformly to ensure that the input data of the generative adversarial network is consistent and of high quality.
[0066] S103, according to the preprocessed data, using a new generative adversarial network to obtain generated data; the new generative adversarial network includes: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism;
[0067] The abnormal data generation model based on the adaptive self-attention mechanism is a part of the generative adversarial network. Its main task is to generate samples with similar distribution to normal data but containing abnormal behaviors for expanding the training data set. The introduction of the self-attention mechanism can effectively improve the accuracy of the generation model. Figure 3 As shown, the abnormal data generation model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, a sample scaling layer, an upsampling layer, a convolution layer, a self-attention module based on an adaptive mechanism, a convolution layer, an activation function and an output layer connected in sequence.
[0068] In the abnormal data generation model, first, the real data is the preprocessed data, which will be used as a reference for the discriminant model. The input of the abnormal data generation model is a random noise vector , by generating a model Abnormal data generated , Generate trainable parameters for the model for abnormal data, whose task is to generate data similar to the real data Samples with similar distribution but containing abnormal behaviors make it difficult for the abnormal data discrimination model to distinguish whether these data are generated or from real abnormal data.
[0069] The self-attention mechanism in the abnormal data generation model can capture global context information during the generation process and optimize the data generation process by modeling the correlation between different parts of the generated samples. The abnormal data generation model with the self-attention mechanism calculates the dependency between each position in the generated data and other positions. Assume that the generated data vector is (query vector), (key vector), (value vector), whose self-attention The calculation formula is:
[0070] ;
[0071] in, is the dimension of the key vector, According to the vehicle system status A dynamically generated adjustment matrix, usually related to the vehicle system state of interest, such as the state of the specified vehicle for , then the dynamic adjustment matrix for:
[0072] ;
[0073] in, for A weight matrix for mapping the state vector to the dimensional space of the query-key similarity matrix; is the offset. The query vector and the key vector are correlated by dot product to obtain a specific attention score, which, together with the dynamic adjustment matrix obtained according to the vehicle state, measures the mutual influence between the features in the generated data. Finally, the result is multiplied by the value vector to obtain the final output vector. This process is equivalent to recombining features according to the correlation between different positions, and adaptively adjusting the data features of interest according to the vehicle state, and finally generating a feature map with global dependencies. After the feature map is passed to the abnormal data generation model, the abnormal data generation model can dynamically adjust the weights of different features in the generation process, thereby generating high-quality data containing complex abnormal behaviors.
[0074] The abnormal data discrimination model based on the adaptive self-attention mechanism focuses on improving the model's ability to distinguish between real data and generated data by capturing global feature dependencies, such as Figure 4 As shown, the abnormal data discrimination model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, an average pooling layer, a convolution layer, a self-attention module based on an adaptive mechanism, an average pooling layer, a convolution layer, an activation function and an output layer connected in sequence.
[0075] The abnormal data discrimination model receives two types of inputs, one of which is the real data after preprocessing. , and the other is abnormal data generated by the generative model The task of the abnormal data discrimination model is to analyze these two types of data and determine the authenticity of the input data by calculating their feature distribution. The self-attention mechanism plays a vital role in the abnormal data discrimination model.
[0076] First, the input data is processed by the fully connected layer and the average pooling layer, and then by the convolution layer to extract local features and convert them into a tensor containing a multi-channel feature map. Based on the feature map, the abnormal data discrimination model introduces a self-attention mechanism to expand the model's perception of global features. The self-attention mechanism first maps the feature map to a query vector through a linear transformation. , key vector Sum value vector , the above vectors represent the features of different positions in the input data. The self-attention mechanism calculates the query vector through cosine similarity and key vector The similarity of is used to obtain the attention weight matrix. The matrix represents the correlation between each position in the input data and other positions. The specific calculation formula is as follows:
[0077] ;
[0078] in, Representation data and data Through cosine similarity, the abnormal data discrimination model can better capture the directionality and relative relationship in the data, rather than simply the numerical value. To ensure that the attention weights can be reasonably distributed, the similarity scores are normalized by the softmax function and the global feature vector is obtained by weighting. :
[0079] ;
[0080] The abnormal data discrimination model can combine the local features of the data with the global features through the self-attention mechanism to better understand the long-range dependencies between the data. For example, when analyzing network attack data, the abnormal data discrimination model can identify the interactions between multiple data packets through the attention mechanism, rather than relying solely on the local information of a single data packet. The abnormal data discrimination model can identify complex attack patterns and abnormal behaviors, and improve the ability to distinguish generated data from real data.
[0081] Finally, the global features processed by the self-attention mechanism are passed to the convolutional layer or the fully connected layer, also called the classification layer, through the sigmoid function Output the probability value of the real data:
[0082] ;
[0083] in, is the weight matrix of the classification layer, is a dynamic adjustment matrix obtained according to the vehicle system status. Indicates that the weighted feature map is flattened into a vector for the final classification prediction. The abnormal data discrimination model uses the probability value representing the authenticity of the input data and optimizes the model through the following loss function, so that the abnormal data discrimination model can gradually improve the accuracy of distinguishing real data from generated data:
[0084] ;
[0085] In the formula, the last term is a regularization term used to prevent the weight matrix of the classification layer from focusing too much on vehicle features and causing imbalanced data generation. The above loss function uses cross entropy loss to measure the classification accuracy of the model, which is used to optimize the performance of the abnormal data discrimination model.
[0086] The adaptive mechanism enables the abnormal data discrimination model to dynamically adjust its focus on different data features, thereby achieving more accurate classification. The adaptive mechanism prevents the classification layer weight matrix in the abnormal data discrimination model from focusing too much on certain specific vehicle features, such as position, speed, etc., by dynamically adjusting the interactions between features, thereby causing imbalance in the data generation process. Through adaptive weight adjustment, the abnormal data discrimination model can ensure balanced attention to all input features.
[0087] The abnormal data discrimination model obtains global feature information by calculating the similarity between vectors, rather than relying solely on the local information of a single data packet. The self-attention mechanism enables the discrimination model to better detect and classify complex attack patterns and abnormal behaviors. The abnormal data discrimination model outputs the probability value of the data authenticity and is optimized using a cross-entropy-based loss function (10). The abnormal data discrimination model can continuously adjust its classification strategy to improve the detection accuracy of abnormal data and the accuracy of real data.
[0088] Through adaptive mechanisms and self-attention mechanisms, the abnormal data discrimination model can better extract global feature information and capture complex dependencies between data, thereby improving its ability to identify a variety of attack behaviors. It can ensure the robustness and accuracy of the abnormal data discrimination model when facing complex sensor data and diverse attack scenarios, effectively improving the performance of the overall detection system;
[0089] When training the new generative adversarial network, the abnormal data generation model receives a random noise vector , and transform it into high-dimensional generated data through a series of nonlinear transformations . These transformations usually include multiple layers of convolution, deconvolution or fully connected layers, and the generated data is expected to be close to the distribution of real data. The abnormal data discrimination model receives both generated data and real data, and classifies them by capturing global features through the self-attention mechanism. The self-attention mechanism calculates the dependencies between different positions of the input data through the mapping operations of query, key and value, and performs weighted summation of the data based on these relationship weights, so that the discrimination model can better extract global features to judge the authenticity of the input data.
[0090] The training of the abnormal data generation model and the abnormal data discrimination model is performed alternately. If the loss function of the generation model is set for:
[0091] ;
[0092] in, is a random noise distribution, is the output data of the generative model, is the predicted output probability of the abnormal data discrimination model for the generated data. In each round, the abnormal data generation model attempts to minimize its loss function so that the generated false abnormal data cannot be detected by the discrimination model. At the same time, the abnormal data discrimination model maximizes the classification accuracy of the real data and minimizes the classification error of the generated data by optimizing its own loss function (10). The abnormal data generation model hopes that its output will be mistaken for real data by the discrimination model, while the abnormal data discrimination model continuously improves its ability to distinguish between generated data and real data.
[0093] The training objective of the new generative adversarial network is a minimax optimization problem, which includes the following formula:
[0094] ;
[0095] in, is the discriminant model, To generate the model, and They are the loss weights at time t, and the function , is the real data after preprocessing. To determine the predicted output probability of the model for the preprocessed real data, For its expected value, is the probability distribution of the random noise vector z, is the output data of the model generated based on the probability distribution of the noise, To discriminate the predicted output probability of the model for the generated data, The expected value of the output data for this prediction; It is a time series consistency loss function, which ensures that the generated data has reasonable continuity in the time series and prevents the abnormal data generation model from generating too much data change between adjacent time steps, thereby meeting the data requirements of the time series of the intelligent headlight system sensor design. , and The generative models are Moment and Output data at each moment; To balance the loss function for attack categories, since different types of attacks may have different distributions in actual data, the generated data needs to cover multiple types of attack modes. Ensure that the distribution of different types of attack data output by the abnormal data generation model is more balanced, and avoid the abnormal data generation model being overly biased towards certain attack types and ignoring other attack types during training. , Indicates The number of attack data. Indicates the total number of attack categories.
[0096] The entire training process of the new generative adversarial network repeatedly adjusts the parameters of the abnormal data generation model and the abnormal data discrimination model, making the generated data more and more realistic and the discrimination ability of the abnormal data discrimination model more and more enhanced. Ultimately, the abnormal data generation model will generate high-quality abnormal data, while the abnormal data discrimination model can more accurately identify real and false patterns in complex data through the self-attention mechanism and global feature analysis. In this process, the abnormal data generation model and the abnormal data discrimination model of GAN compete with each other, promoting the improvement of the overall performance of the model.
[0097] To further improve the accuracy of the detection system, the attack detection and result feedback mechanism is used to dynamically expand the database and obtain the detection results in a timely manner to update the new generative adversarial network to ensure the continuous improvement of the new generative adversarial network. All detection results are fed back to the database. In particular, for misjudged normal samples or unrecognized attack samples, these abnormal data will be marked through error analysis, and data resampling or additional attack samples will be introduced to enrich the training data set. By retraining the new generative adversarial network, the loss weights of the new generative adversarial network can be dynamically adjusted to improve the recognition ability of different types of attacks and ensure continuous optimization in the face of different attack modes and environmental changes. The feedback mechanism allows the database to be continuously expanded and optimized to cover a more diverse range of attack types and changes, thereby significantly improving the robustness and generalization ability of the model.
[0098] That is, the above feedback mechanism can be a dynamic adjustment module of the adaptive feedback mechanism, so that the detection can adjust itself according to the feedback attack detection error result changes. Represents the detection error calculated by the mean square error of the new generative adversarial network in the current iteration:
[0099] ;
[0100] in, is the sample size; and They are The true output value and system detection value of each sample;
[0101] The updated loss weights of the new generative adversarial network include:
[0102] ;
[0103] ;
[0104] in, and are the updated loss weights, and It is a hyperparameter for adjusting the rate, which is used to control the speed of loss weight adjustment. is a constant used to avoid division by zero errors, and Respectively expressed in Moment and time series consistency loss function and attack category balance loss function The associated feedback error, and To represent respectively -1 moment and time series consistency loss function and attack category balance loss function Related feedback errors.
[0105] By adaptively adjusting the loss function of the new generative adversarial network, we can better cope with detection errors caused by changes in the environment and attack patterns, thereby significantly improving the effectiveness and accuracy of attack detection.
[0106] S104, performing attack detection on sample data consisting of the generated data and the preprocessed data and the preprocessed data, respectively, to obtain corresponding detection results; and updating the new generative adversarial network using a dynamic adjustment module based on an adaptive feedback mechanism according to the detection results corresponding to the sample data consisting of the generated data and the preprocessed data and the preprocessed data;
[0107] S105, using the updated new generative adversarial network to generate abnormal data; and performing sensor attack detection based on the generated abnormal data.
[0108] Implement S101-S105, introduce generative adversarial networks, solve the problem of scarcity of abnormal data, and generate models that can simulate a variety of high-fidelity attack data, greatly improving the model's adaptability to diverse attack scenarios. Secondly, the integrated application of self-attention mechanism, feedback mechanism, and adaptive mechanism enables the global dependencies of abnormal data to be captured in complex and changing environments, enhancing the sensitivity to attack features, especially in complex network environments, the model can still maintain efficient and accurate detection capabilities. In addition, traditional attack detection systems are often limited by high false alarm rates and missed alarm rates, while this application greatly reduces the possibility of false alarms by generating diverse abnormal data and combining global feature analysis, thereby improving the reliability and stability of the overall detection. This application not only improves flexibility and scalability, but also ensures that it can be easily integrated in different smart car lighting systems and Internet of Vehicles environments to meet complex and changing application requirements.
[0109] This application has broad application prospects, especially in the fields of autonomous driving and vehicle networking. With the continuous advancement of intelligent transportation technology, communication between vehicles and environmental perception have become more complex, and the role of vehicle-mounted sensor systems in nighttime driving safety has become increasingly prominent. Sensor attack detection technology based on the generation of adversarial networks based on fusion mechanisms can effectively improve the ability of vehicle-mounted systems to identify potential threats and provide higher security for autonomous driving vehicles. In addition, this application is not only applicable to intelligent vehicles, but can also be extended to other systems or network environments that rely on multiple sensors, such as intelligent infrastructure monitoring. With the popularization of vehicle networking technology, this application is expected to become a key component of future intelligent transportation systems, providing important guarantees for reducing the risk of cyber attacks, improving driving safety and traffic efficiency. At the same time, with the further development and optimization of technology, this application can find application scenarios in a wider range of industrial Internet of Things and smart city projects, helping to build future smart cities and intelligent transportation systems.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a sensor attack detection device in a connected vehicle network for implementing the sensor attack detection method in a connected vehicle network involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the sensor attack detection device in a connected vehicle network provided below can refer to the limitations of the sensor attack detection method in a connected vehicle network above, and will not be repeated here.
[0111] In an exemplary embodiment, a sensor attack detection device in a connected vehicle network is provided, comprising:
[0112] A data acquisition unit, used to acquire data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data;
[0113] A preprocessing unit, used for preprocessing the data of the real vehicle;
[0114] A data generation unit, configured to obtain generated data by using a novel generative adversarial network according to the preprocessed data; the novel generative adversarial network comprises: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism;
[0115] A model updating unit is used to perform attack detection according to sample data composed of generated data and preprocessed data and preprocessed data, respectively, to obtain corresponding detection results; according to the detection results corresponding to the sample data composed of generated data and preprocessed data and preprocessed data, a dynamic adjustment module based on an adaptive feedback mechanism is used to update the new generative adversarial network;
[0116] The detection unit is used to generate abnormal data by using the updated new generative adversarial network; and perform sensor attack detection based on the generated abnormal data.
[0117] The sensor attack detection device based on the fusion mechanism to generate adversarial networks is not only applicable to sensor security issues in intelligent driving vehicles, but can also be applied to various systems containing sensors. For example, sensor networks of drones, industrial sensors in smart factories, environmental monitoring systems in smart cities, etc. In addition, the application scenarios of the present application are not limited to the field of transportation, but can also be widely used in various places, such as intelligent traffic management systems, security monitoring systems, energy management systems, etc. The present invention is also applicable to the application of intelligent driving vehicles under various road conditions. For example, the present application can be used in multiple road conditions scenarios such as highways, urban roads, rural roads or complex environments, and can monitor and resist possible sensor attacks in real time to ensure the safe driving of the vehicle. At the same time, the present application can adapt to the operation of intelligent driving vehicles under various weather conditions, traffic conditions and various emergencies, thereby providing all-round safety protection.
[0118] In an exemplary embodiment, a computer device is provided, which may be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a sensor attack detection method in a vehicle network is implemented.
[0119] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0120] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0123] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0124] In this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A sensor attack detection method in a vehicle network, characterized in that: The sensor attack detection method in the Internet of Vehicles includes: Acquire data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data; Preprocess the data of real vehicles; According to the preprocessed data, a generative adversarial network is used to obtain generated data; the generative adversarial network includes: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism; Perform attack detection on sample data consisting of generated data and preprocessed data and preprocessed data to obtain corresponding detection results; update the generative adversarial network using a dynamic adjustment module based on an adaptive feedback mechanism according to the detection results corresponding to the sample data consisting of generated data and preprocessed data and preprocessed data; The updated generative adversarial network is used to generate abnormal data; and sensor attack detection is performed based on the generated abnormal data; The abnormal data generation model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, a sample scaling layer, an upsampling layer, a convolution layer, a self-attention module based on an adaptive mechanism, a convolution layer, an activation function and an output layer connected in sequence; The abnormal data discrimination model based on the adaptive self-attention mechanism includes: an input layer, a fully connected layer, an average pooling layer, a convolution layer, a self-attention module based on an adaptive mechanism, an average pooling layer, a convolution layer, an activation function and an output layer connected in sequence.
2. The sensor attack detection method in the Internet of Vehicles according to claim 1 is characterized in that: The preprocessing of the real vehicle data specifically includes: Use normalization technology to map the real vehicle data to a uniform scale; Extracting key performance indicators and routing information from the normalized network data; the key performance indicators include: number of data packets, data packet transmission delay, and number of discarded data packets; the routing information includes: lifetime, payload size, source and destination MAC addresses, IP addresses, and port numbers; Embedded coding is used to convert routing information into continuous feature vectors.
3. The sensor attack detection method in the Internet of Vehicles according to claim 1 is characterized in that: The training objective of the generative adversarial network is a minimax optimization problem, which includes the following formula: ; in, is the discriminant model, To generate the model, and They are the loss weights at time t, and the function , is the real data after preprocessing. To determine the predicted output probability of the model for the preprocessed real data, is the expected value, is the probability distribution of the random noise vector z, is the output data of the model generated based on the probability distribution of the noise, To discriminate the predicted output probability of the model for the generated data, To predict the expected value of the output data; is the time series consistency loss function, , and The generative models are Moment and Output data at each moment; is the attack class balancing loss function, , Indicates The number of attack data. Indicates the total number of attack categories.
4. The sensor attack detection method in the Internet of Vehicles according to claim 3 is characterized in that: The updated loss weights of the generative adversarial network include: ; ; in, and are the updated loss weights, and It is a hyperparameter for adjusting the rate, which is used to control the speed of loss weight adjustment. is a constant used to avoid division by zero errors, and Respectively expressed in Moment and time series consistency loss function and attack category balance loss function The associated feedback error, and To represent respectively Moment and time series consistency loss function and attack category balance loss function Related feedback errors.
5. A sensor attack detection device in an Internet of Vehicles, used to implement the sensor attack detection method in an Internet of Vehicles according to any one of claims 1 to 4, characterized in that: The sensor attack detection device in the Internet of Vehicles includes: A data acquisition unit, used to acquire data of real vehicles in the Internet of Vehicles; the data includes: sensor data, network data and log data; A preprocessing unit, used for preprocessing the data of the real vehicle; A data generation unit, configured to obtain generated data by using a generative adversarial network according to the preprocessed data; the generative adversarial network comprises: an abnormal data generation model based on an adaptive self-attention mechanism and an abnormal data discrimination model based on an adaptive self-attention mechanism; A model updating unit is used to perform attack detection according to sample data composed of the generated data and the preprocessed data and the preprocessed data, respectively, to obtain corresponding detection results; according to the detection results corresponding to the sample data composed of the generated data and the preprocessed data and the preprocessed data, a dynamic adjustment module based on an adaptive feedback mechanism is used to update the generative adversarial network; The detection unit is used to generate abnormal data using the updated generative adversarial network; and perform sensor attack detection based on the generated abnormal data.
6. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the sensor attack detection method in the Internet of Vehicles according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the sensor attack detection method in the connected vehicle network described in any one of claims 1 to 4 is implemented.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the sensor attack detection method in the connected vehicle network described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Electric power Internet of Things attack behavior detection method, system and device and medium
CN118174918A
Safety protection method and device for intelligent networked automobile
CN119299215A