A multi-stage deep learning-based automobile ethernet intrusion detection method and system
By using feature decomposition and decision fusion within a multi-stage deep learning framework, the problems of insufficient computing power and high false alarm rate in in-vehicle Ethernet intrusion detection models are solved, enabling efficient and real-time intrusion detection for intelligent connected vehicles.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JILIN UNIVERSITY
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-10
AI Technical Summary
Existing vehicle-mounted Ethernet intrusion detection models suffer from excessive computational overhead leading to insufficient real-time interception, inefficient allocation of computational resources, high false alarm rates, and difficulty in compatibility with the differences in payload structures of various heterogeneous communication protocols, thus failing to effectively defend against complex network attacks.
A multi-stage deep learning framework is adopted, which divides network traffic into statistical aggregated feature vectors and network traffic imaging feature matrices through feature extractors. A random forest classifier is used for preliminary anomaly detection, and a pruned convolutional neural network is introduced when necessary for fine attack classification. Combined with decision fusion and dynamic update mechanisms, rapid initial screening and high-precision classification are achieved.
It significantly shortens detection time, reduces false alarm rate, is compatible with multi-source heterogeneous network data, meets the real-time safety monitoring needs of intelligent connected vehicles, and can provide online protection under high bandwidth transmission conditions.
Smart Images

Figure CN122372289A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive Ethernet technology, and in particular to an automotive Ethernet intrusion detection method and system based on multi-stage deep learning. Background Technology
[0002] With the development of intelligent connected vehicle technology, in-vehicle network architecture is gradually evolving towards a centralized and cross-domain integrated electronic and electrical architecture. Vehicle Ethernet, with its high bandwidth and low transmission latency, has become the backbone communication link carrying audio and video transmission protocols, generalized precise time protocols, and massive amounts of sensor data. Currently, vehicle communication systems generally exhibit a heterogeneous network topology where Ethernet and traditional controller area networks coexist. These heterogeneous networks lack native security authentication mechanisms and message encryption methods. Malicious nodes can exploit vulnerabilities in this network protocol to launch cross-media replay attacks or malicious data frame injection attacks.
[0003] To address the aforementioned threats to vehicle network security, existing technologies are gradually being incorporated into vehicle intrusion detection systems for perimeter defense. Early defense methods primarily relied on deep packet inspection (DPI) techniques based on signature-based methods. However, with the increasing sophistication of attack packets, existing technologies have generally shifted towards data-driven anomaly detection schemes based on deep learning. For example, the paper "A Review of Vehicle Network Intrusion Detection Technologies" (Journal of Automotive Engineering, 2022, Vol. 12, No. 5, pp. 557-566) discloses the use of neural networks to extract temporal features of the hidden structure of high-dimensional network traffic. This data-driven approach aims to improve the system's ability to generalize and identify undefined variant attacks.
[0004] However, the aforementioned detection schemes based on deep learning models face stringent computational constraints when deployed in a vehicle. Existing heavy-duty neural network models have a huge number of parameters and high inference computation overhead. In-vehicle computing platforms experience significant detection latency when handling high-concurrency bandwidth services. This latency can prevent the system from intercepting maliciously tampered messages before they cause substantial physical damage to the chassis drive-by-wire nodes.
[0005] Furthermore, single-dimensional anomaly detection models struggle to accommodate the varying payload structures of diverse communication protocols. The system is prone to misclassifying legitimate retransmission bursts caused by network congestion as attacks, and lacks the ability to accurately trace specific attack vectors. Simultaneously, existing detection frameworks lack a feature-based hierarchical filtering mechanism. All underlying data streams are directly fed into deep learning models for feature inference. A large amount of low-risk, legitimate traffic inefficiently consumes limited onboard memory and computing resources, significantly reducing the overall vehicle intrusion protection efficiency. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for automotive Ethernet intrusion detection based on multi-stage deep learning. This invention solves the problems in existing technologies where the computational overhead of intrusion detection models in concurrent scenarios of heterogeneous in-vehicle networks is too high, resulting in insufficient real-time interception, inefficient allocation of computational resources, and a high false alarm rate in classification.
[0007] To achieve the above objectives, the present invention provides the following solution: A multi-stage deep learning-based automotive Ethernet intrusion detection method includes: Bypass listening and collecting multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and using the generalized precise time protocol to perform unified time synchronization operation on the multi-protocol network traffic to obtain the original packet sequence. Set a sliding time window, and perform time window aggregation and grouping operations on the original message sequence based on the sliding time window to truncate and generate a windowed message sequence; The windowed message sequence is split using a feature extractor to obtain two parallel feature data streams. The first feature data stream is a statistical aggregation feature vector, and the second feature data stream is a network traffic imaging feature matrix. The statistical aggregated feature vector is input into the first-stage attack detector, and the first-stage attack detector is used to perform a rapid abnormal traffic detection on the statistical aggregated feature vector to obtain a preliminary abnormal warning result and the corresponding first-stage confidence level. When the preliminary anomaly warning result indicates the presence of a suspicious network event, the network traffic imaging feature matrix is input into the second-stage attack classifier to obtain a refined attack classification result; Based on the preliminary anomaly warning result and the fine attack classification result, a decision fusion operation is performed to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.
[0008] A multi-stage deep learning-based automotive Ethernet intrusion detection system includes: The traffic acquisition and timing synchronization module is used to bypass and listen to multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and to perform a unified timing synchronization operation on the multi-protocol network traffic using the generalized precise time protocol to obtain the original packet sequence. The message aggregation and grouping module is used to set a sliding time window, perform time window aggregation and grouping operations on the original message sequence based on the sliding time window, and truncate to generate a windowed message sequence. The feature extraction and splitting module is used to split the windowed message sequence using a feature extractor to obtain two parallel feature data, wherein the first feature data is a statistical aggregation feature vector and the second feature data is a network traffic imaging feature matrix. The first-stage anomaly detection module is used to input the statistical aggregated feature vector into the first-stage attack detector, and use the first-stage attack detector to perform anomaly traffic detection on the statistical aggregated feature vector to obtain preliminary anomaly warning results and corresponding first-stage confidence levels. The second-stage attack classification module is used to input the network traffic imaging feature matrix into the second-stage attack classifier when the preliminary anomaly warning result indicates the existence of a suspicious network event, so as to obtain a refined attack classification result. The decision fusion and dynamic update module is used to perform a decision fusion operation based on the preliminary anomaly warning result and the fine attack classification result to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.
[0009] The present invention discloses the following technical effects: This invention provides a method and system for automotive Ethernet intrusion detection based on multi-stage deep learning. The invention constructs a multi-stage deep learning framework of "two-stage detection and divide-and-conquer identification." The first stage, a random forest classifier, achieves millisecond-level rapid initial screening and early interception of suspicious traffic. The second stage introduces a pruned convolutional neural network, which significantly reduces the false alarm rate and achieves refined classification of network attack types while considering the limited computational overhead of the entire vehicle. Compared to the most advanced existing baseline intrusion detection methods, this scheme significantly shortens the detection time while maintaining a comparable detection rate. It is not only compatible with processing multi-source heterogeneous vehicle network data such as audio and video transmission protocols, generalized precise time protocols, and controller area network traffic carried over Ethernet, but also meets the application requirements of intelligent connected vehicles for online real-time security monitoring and intrusion protection under multi-domain control and high-bandwidth sensor data transmission conditions. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1A flowchart of an automotive Ethernet intrusion detection method based on multi-stage deep learning, provided for an embodiment of the present invention; Figure 2 A schematic diagram of the in-vehicle network architecture, including protocols, components, and damaged nodes, provided in an embodiment of the present invention. Figure 3 A schematic diagram illustrating replay and injection attacks on any in-vehicle network provided in an embodiment of the present invention; Figure 4 A schematic diagram of the processing steps and the logical structure of the dual-channel feature output of the feature extractor provided in the embodiments of the present invention; Figure 5 This is a block diagram of the main components of the IDS provided in an embodiment of the present invention. Detailed Implementation
[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0014] like Figure 1 As shown, this invention provides a method for automotive Ethernet intrusion detection based on multi-stage deep learning, including: Step 100: Bypass and monitor multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and use the generalized precise time protocol to perform a unified time synchronization operation on the multi-protocol network traffic to obtain the original packet sequence. Step 200: Set a sliding time window, and perform time window aggregation and grouping operations on the original message sequence based on the sliding time window to truncate and generate a windowed message sequence; Step 300: Use a feature extractor to split the windowed message sequence to obtain two parallel feature data, wherein the first feature data is a statistical aggregation feature vector and the second feature data is a network traffic imaging feature matrix. Step 400: Input the statistical aggregated feature vector into the first-stage attack detector, and use the first-stage attack detector to perform a rapid abnormal traffic detection on the statistical aggregated feature vector to obtain a preliminary abnormal warning result and the corresponding first-stage confidence level. Step 500: When the preliminary anomaly warning result indicates the presence of a suspicious network event, the network traffic imaging feature matrix is input into the second-stage attack classifier to obtain a refined attack classification result; Step 600: Based on the preliminary anomaly warning result and the fine attack classification result, perform a decision fusion operation to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.
[0015] Furthermore, the specific implementation process of step 100 is as follows: The "Generalized Precision Time Protocol" described in this application is the "gPTP" protocol used in actual engineering applications; the "Audio / Video Transmission Protocol Transmitter" corresponds to the "AVTP Talker" entity in the vehicle network architecture; the "Video Stream Data Packet" is the "AVTP Frame"; and the "Controller Area Network" is the traditional "CAN (Controller Area Network)" bus.
[0016] like Figure 2 As shown, this illustrates a typical in-vehicle heterogeneous network architecture for which the present invention is applied. In this architecture, the AVTP Talker sends video streams (AVTP frames) to the AVB Listener via an automotive Ethernet switch. After decoding the stream, the receiver sends control information to the core ECU nodes on the Controller Area Network (CAN) bus, such as those for braking, power, and steering, via a gateway. Based on this physical layout, this embodiment deploys the intrusion detection system in a bypass manner on the mirror port side of the switch. Through this bypass deployment, this embodiment can fully acquire cross-protocol traffic samples without changing the original business data forwarding link or increasing communication latency. Utilizing the gPTP protocol and the synchronization mechanism of a common reference clock, this embodiment ensures that Ethernet packets and CAN bus packets in heterogeneous clock domains have a unified time base before entering the detection process, thereby providing high-precision time series support for subsequent identification of cross-protocol coordinated attacks.
[0017] Furthermore, in a heterogeneous in-vehicle network architecture, the audio / video transmission protocol sender typically transmits video stream data packets to the receiver (AVB Listener) via an automotive Ethernet switch. After decoding the stream, the receiver also converts relevant control information via a gateway and sends it to the controller area network (e.g., connecting to braking, power, and steering ECUs). For this complex concurrent scenario, the process of "using a generalized precise time protocol to perform unified timing synchronization of the multi-protocol network traffic" specifically includes the following detailed sub-steps: First, the system analyzes and filters the collected multi-protocol network traffic to identify and extract video stream data packets from the audio / video transmission protocol sender, as well as controller LAN data packets originating from the gateway bridge. This operation defines the core business data that the IDS needs to monitor and collect evidence for uniformly.
[0018] Secondly, since malicious attackers can sniff and replay or inject malicious data frames at any access point in the vehicular network, the system needs to obtain a common reference clock signal on the vehicular network transmission link in order to accurately restore the order of each protocol message in the real physical environment. In actual operation, the communicating parties synchronize with this common reference clock through a generalized precise time protocol.
[0019] Subsequently, based on the acquired common reference clock signal, the system adds a unified global timestamp to the video stream data packets originating from the audio / video transmission protocol sender and the controller LAN data packets originating from the gateway bridge. This operation effectively eliminates local clock deviations caused by differences in protocol stacks and hardware gateway forwarding delays.
[0020] Finally, the system utilizes the global timestamp to perform strict time-series alignment on the data packets of the aforementioned heterogeneous protocol categories. Through time-series alignment, the originally chaotic and parallel multi-source traffic is organized into a continuous and time-consistent sequence of original packets. This step fundamentally ensures the time-series consistency of the collected data, comprehensively covering the multi-protocol communication status within the vehicle and accurately capturing and recording micro-temporal anomalies in potentially compromised nodes.
[0021] Furthermore, the specific implementation process of step 200 is as follows: like Figure 3As shown, this depicts the packet distribution of an arbitrary vehicular network under replay attacks and malicious frame injection attacks. The figure reveals that attack packets typically manifest as abnormally high-density pulses appearing within a very short time or as disturbances to normal periodic characteristics. Based on these attack characteristics, this embodiment, by setting a sliding time window, can lock these instantaneous attack mutations into a specific windowed packet sequence. The logical depth of this sliding window-based grouping mechanism lies in its ability to simultaneously capture two abnormal patterns in the network: first, capturing local features of short-term mutations such as injection attacks; and second, capturing periodic deviations with a certain time span, such as replay attacks. This is achieved by transforming the original continuous stream into... Figure 3 The discretized statistical intervals shown in this embodiment effectively reduce the dimensionality of complex network dynamic evolution to stable observation features that can be processed by deep learning models.
[0022] The system monitors and traverses the original message sequence after time alignment in real time. When the first periodic message in the original message sequence is detected and intercepted, the system uses this as a trigger event to immediately start the internal aggregation timer.
[0023] Simultaneously, the system encapsulates the currently received periodic message with a Protocol Data Unit Header (PDUHeader) tag. This tag is used to record traceability metadata such as the original protocol type, payload length, and local timestamp of the underlying message. After processing, the message is stored in the system's preset buffer for temporary storage.
[0024] Next, the window aggregation period begins. Before the aggregation timer expires, the system continuously monitors the network data stream. If, during this aggregation window, the system continuously receives new event-type messages (such as CANFD1 event frames triggered by sudden braking) or other periodic messages (such as CAN2 and LIN1 messages), the system will monitor and determine in real time whether the current remaining storage capacity of the buffer meets the preset safety threshold to prevent memory overflow and packet loss. When the capacity check meets the preset condition, the system adds the protocol data unit header tag to each of these subsequently arriving messages according to their received sequence, and continuously appends them to the buffer. Through this time window aggregation mechanism, the system can effectively capture short-term sudden traffic changes caused by hacker injection or replay attacks in the network, while completely preserving the longer-term communication patterns of business data.
[0025] When the aggregation timer reaches the set sliding time window span, i.e., after the timer expires, the system triggers a truncation mechanism, immediately closing the write channel of the current buffer. Subsequently, the system extracts all cached heterogeneous packets in the buffer, all of which have the protocol data unit header tag added, and encapsulates them into a single fixed-length Ethernet data packet. This is achieved through the repeated cycle of timed truncation and aggregation encapsulation operations.
[0026] Furthermore, the specific implementation process of step 300 is as follows: The “statistical aggregated feature vector” described in this application corresponds to the “sum-aggregated features” in the accompanying drawings; the “network traffic imaging feature matrix” corresponds to the “traffic imaging features” in the accompanying drawings.
[0027] like Figure 4 As shown, the execution logic and output structure of the feature extractor proposed in this embodiment are illustrated in detail. This feature extractor possesses a significant "dual-output" characteristic: on the one hand, it produces the network traffic imaging feature matrix that will be fed into the Pruned Convolutional Neural Network (PCNN) model; on the other hand, it produces the statistical aggregation feature vector that will be fed into the Random Forest (RF) model. From a logical tightness analysis, Figure 4 The splitting operation shown is not a simple data segmentation, but a dual encoding of "time sequence + payload" for vehicular Ethernet packets. Statistical aggregation features are responsible for characterizing the energy distribution of traffic within the window from a macroscopic perspective, while network traffic imaging features, through byte differentiation and nibbles, reconstruct the structural differences in packet payloads from a microscopic perspective. This dual-path design decouples detection accuracy from computational cost in engineering implementation, ensuring that the subsequent two-stage models can each perform their respective functions and jointly lock onto the attack vector from different dimensions.
[0028] Specifically, the system performs data alignment and standardization preprocessing. The feature extractor extracts bytes of a preset length sequentially from each original data packet in the windowed message sequence, starting from the header, to obtain a basic feature sequence. In this embodiment, the preset length is optimized to 58 bytes (i.e., n_bytes=58), which effectively covers the core header and critical payload areas of automotive Ethernet and underlying control protocols. After extraction, the system strictly determines whether the actual byte length of each basic feature sequence reaches 58 bytes. When encountering short frames or data packets with small payloads, resulting in the actual byte length of the basic feature sequence being less than 58 bytes, the system forces a zero-padding operation on the tail of the basic feature sequence. Through the above truncation and padding operations, the system eliminates the length differences of multi-protocol mixed messages, obtaining a standard byte sequence with fully aligned dimensions, ensuring the consistency of dimensions within the model input batch.
[0029] Secondly, based on the aligned standard byte sequence, the feature extractor calculates two sets of features in parallel. To generate the first set of feature data, the feature extractor performs a row-wise summation operation on multiple rows of the standard byte sequence. This operation, by vertically accumulating data bits within a specific time window, macroscopically captures the distribution patterns and statistical abrupt changes in the data stream. The resulting sum-aggregated features have extremely low dimensionality and computational overhead, and are specifically channeled to the subsequent first-stage random forest fast detection model.
[0030] Finally, to generate the second feature data, the feature extractor introduces a deep encoding mechanism for temporal and structural information. The system first performs a byte difference modulo operation on temporally adjacent sampled data packets in the standard byte sequence. This operation greatly enhances the system's sensitivity to short-term anomalies, yielding differential feature data. Subsequently, the system further segments each byte (8 bits) of the differential feature data into nibbles consisting of a high 4-bit and a low 4-bit structure. This nibble segmentation operation, without increasing additional information entropy, multiplies the depth dimension of the feature matrix, resulting in the Traffic Imaging Features matrix containing rich structural and temporal correlation information. This imaging matrix is then specifically directed to the subsequent second-stage pruned convolutional neural network for fine-grained classification and discrimination.
[0031] Furthermore, the specific implementation process of step 400 is as follows: The statistically aggregated feature vector is input into the first-stage attack detector, and the first-stage attack detector is used to perform rapid anomaly traffic detection on the statistically aggregated feature vector to obtain preliminary anomaly warning results and corresponding first-stage confidence scores. As a terminology declaration, the first-stage attack detector described in the claims of this application is essentially a random forest initial screening classification model using statistically aggregated features as input. This embodiment uses the random forest algorithm to construct the detection engine. Its core engineering goal is to address the pain point of limited computing resources on the vehicle network side. By processing extremely low-dimensional row-sum statistical vectors, it achieves millisecond-level low-latency determination of suspicious events in the vehicle network with extremely low computational overhead.
[0032] Regarding the specific execution logic of abnormal traffic fast detection, this embodiment inputs the statistical aggregated feature vector in parallel into multiple random forest decision trees contained within the first-stage attack detector for synchronous feature inference and evaluation calculation. To ensure the feasibility of the technical solution by disclosing in detail the acquisition method of core parameters, it is important to emphasize that the model hyperparameters used in constructing the first-stage attack detector, such as the total number of decision trees, the maximum depth of the trees, and the number of features required for node splitting, were all pre-determined through hierarchical 5-fold cross-validation evaluation based on real public automotive Ethernet datasets. The core optimization constraint is to maximize the compression of the inference time of a single detection while maintaining a comparable attack detection rate. Each baseline random forest decision tree independently outputs a single local judgment state for the input statistical aggregated feature vector. Subsequently, this embodiment aggregates and statistically analyzes the full classification judgment results output by the multiple random forest decision trees to accurately calculate the global average anomaly probability value.
[0033] After calculating the average anomaly probability value, this embodiment enters the judgment triggering stage, where the average anomaly probability value is rigorously compared with the judgment threshold currently set by the first-stage attack detector. When the comparison result confirms that the average anomaly probability value is greater than the judgment threshold of the first-stage attack detector, this embodiment can determine that the current underlying network communication flow deviates from the normal service baseline distribution, thereby activating an alarm and obtaining the preliminary anomaly warning result to intercept high-risk traffic. Simultaneously, this embodiment directly maps and determines the corresponding first-stage confidence level based on the absolute magnitude of the calculated average anomaly probability value. This first-stage confidence level not only quantitatively characterizes the statistical certainty of the rapid detection interception conclusion but also serves as a key underlying closed-loop feedback parameter passed downstream, providing a reliable data-driven foundation for the two-stage decision fusion and adaptive dynamic adjustment of the judgment threshold in subsequent complex steps.
[0034] Furthermore, the specific implementation process of step 500 is as follows: The network traffic imaging feature matrix is input into the second-stage attack classifier to obtain refined attack classification results. It should be clarified that the second-stage attack classifier in this embodiment relies on a pruned convolutional neural network pre-deployed in the read-only memory of the vehicle edge computing node at the physical entity level. Due to the extremely limited computing power and storage space of the physical microprocessor chips in vehicle gateways and multi-domain controllers, existing heavy-duty deep learning models cannot meet the extremely low latency inference requirements of vehicle online security protection. Therefore, this embodiment uses network pruning and quantization techniques to perform physical-level sparsity compression processing on the standard convolutional neural network, removing redundant neuron connections while retaining key parameter mapping paths, thereby instantiating a low-power and low-false-positive-rate attack classification computing engine on a computing-constrained physical hardware platform.
[0035] In the specific network inference computation process, this embodiment first utilizes the lightweight convolutional layer contained within the pruned convolutional neural network to perform deep spatial feature extraction and parameter dimensionality reduction operations on the high-dimensional network traffic imaging feature matrix. Specifically, the lightweight convolutional layer, through a customized local receptive field, performs multiplication and addition physical operations on a data matrix containing a half-byte temporal difference structure, automatically capturing microscopic spatial anomaly patterns left on the underlying Ethernet packet payload structure by malicious injection or replay attacks. Through this targeted nonlinear convolutional mapping and downsampling computation, this embodiment compresses and abstracts the original high-dimensional network traffic imaging feature matrix into a hidden layer feature map with minimal physical memory footprint. This computation process completely removes redundant feature noise from normal vehicle service background traffic, achieving efficient dimensionality reduction extraction of core security representations and ensuring high-speed flow and zero-latency throughput of high-dimensional security data within the processor cache.
[0036] After completing the feature dimensionality reduction and information condensation in the spatial dimension, this embodiment further inputs the hidden layer feature map generated above directly into the fully connected layer at the tail of the pruned convolutional neural network for network attack type mapping processing. The fully connected layer, relying on the classification weight matrix pre-embedded in the hardware, projects the abstract hidden layer feature map onto a discrete attack category probability space, calculates and outputs the refined attack classification result with the highest classification activation value. This refined attack classification result can not only qualitatively confirm network anomalies at the physical link level, but also accurately indicate the specific network attack type. The specific network attack types covered in this embodiment include: Media Access Control address flooding attacks, Precise Time Protocol (MTCP) synchronization spoofing attacks, denial-of-service attacks, and replay attacks. Through this refined classification mapping from feature flow to a clear threat vector, this embodiment breaks through the limitations of traditional boundary anomaly detection, which can only vaguely report faults and cannot qualitatively trace the source, providing a high-granularity and deterministic entity decision-making basis for downstream security response actions to issue targeted hardware port isolation and rate limiting commands.
[0037] More specifically, this embodiment details the offline construction and training process of the pruned convolutional neural network at the bottom layer of the second-stage attack classifier. In the initial stage of model construction, this embodiment first establishes a high-dimensional offline training dataset for heterogeneous vehicular networks. This offline training dataset not only includes baseline service traffic from normal audio and video transmission protocols, generalized precise time protocols, and gateway-bridged controller LANs collected from real physical test benches, but also proportionally injects various types of malicious network traffic samples with precise attack category labels. This embodiment uniformly performs the aforementioned feature engineering steps on the above offline training dataset to generate an offline network traffic imaging feature matrix set with category ground truth labels, which serves as the prior physical data foundation for driving the network model weight updates.
[0038] Based on the offline feature dataset constructed above, this embodiment employs a supervised learning paradigm to iteratively train an initial convolutional neural network with a standard structure. Specifically, this embodiment inputs the offline network traffic imaging feature matrix set into the initial convolutional neural network in batches, and calculates the predicted classification probability distribution output by the fully connected layer through forward propagation. Subsequently, this embodiment introduces a cross-entropy loss function to calculate the classification error between the predicted classification probability distribution and the actual attack category label, and uses an adaptive moment estimation optimization algorithm to calculate the network loss gradient. Relying on the backpropagation mechanism of the error, this embodiment updates the weight parameters and bias terms of each layer in the initial convolutional neural network layer by layer until the cross-entropy loss value converges to a preset error tolerance lower bound, thereby obtaining a pre-trained convolutional neural network with high-precision feature extraction and high-dimensional mapping capabilities.
[0039] To completely overcome the physical computing power gap faced by pre-trained convolutional neural networks (CNNs) when deployed on automotive edge computing nodes, this embodiment further performs fine-grained feature pruning and parameter fine-tuning operations on the pre-trained CNN after training convergence. This embodiment employs a weight magnitude-based pruning strategy, globally evaluating the absolute value of the connection weights of neurons in each layer of the pre-trained CNN, and forcibly setting redundant connection weights with absolute values below a preset dynamic pruning threshold to zero, thereby achieving sparsity blocking of network connections at the physical topology level. After completing a single round of connection blocking, this embodiment again uses the offline network traffic imaging feature matrix set to fine-tune and retrain the sparsified network with frozen non-zero weights to compensate for the accuracy degradation caused by the pruning operation. The above blocking and fine-tuning processes are executed alternately and iteratively until the compression ratio of the total network parameters reaches the upper limit of the physical constraints of the automotive hardware computing platform and the classification accuracy remains above the baseline standard, finally solidifying and generating the pruned CNN deployed in the online defense process of this embodiment.
[0040] Furthermore, the specific implementation process of step 600 is as follows: Based on the preliminary anomaly warning result and the refined attack classification result, a decision fusion operation is performed to obtain a comprehensive judgment result. During the specific execution of the decision fusion operation, this embodiment performs consistency logic verification on the judgment conclusions of the two stages mentioned above. When the preliminary anomaly warning result and the refined attack classification result are consistent, this embodiment directly uses this conclusion as the final comprehensive judgment result for network-wide notification. However, given that the complex electromagnetic environment of the vehicle and sudden high-concurrency business traffic can easily lead to blurred front-end statistical features and cause model misjudgments, when there is a discrepancy between the preliminary anomaly warning result and the refined attack classification result, this embodiment assigns absolute priority decision weight to the deep classifier at the algorithm control level. That is, the comprehensive judgment result is forced to adopt the refined attack classification result, thereby relying on the high-precision feature space mapping capability of the pruned convolutional neural network to minimize the overall false alarm rate in the vehicle intrusion detection process.
[0041] In business scenarios where the aforementioned judgment results differ, it indicates that the static fast detection limit of the Phase 1 attack detector can no longer perfectly adapt to the dynamically changing baseline of the vehicular physical network. Therefore, this embodiment, while forcibly accepting the Phase 2 judgment conclusion, simultaneously activates a closed-loop adaptive feedback mechanism in the underlying data link, that is, synchronously updates the judgment threshold of the Phase 1 attack detector using the Phase 1 confidence level.
[0042] Specifically, this embodiment first uses log backtracking and parameter snapshot mechanisms to accurately extract the first-stage confidence level recorded at the moment when the preliminary anomaly warning result and the refined attack classification result diverge. This confidence level objectively and quantitatively reflects the statistical probability boundary of the front-end random forest fast detection model when it generates false interceptions or oversensitive alarms, and is the core driving parameter that drives the front-end model to dynamically evolve towards real physical conditions.
[0043] After successfully extracting the first-stage confidence level under the divergent state, this embodiment immediately performs a quantitative threshold correction calculation. This embodiment calculates the error difference between the first-stage confidence level and the judgment threshold of the first-stage attack detector, and then calculates the deviation compensation value used to quantify the degree of deviation in the current model judgment. Subsequently, based on the obtained deviation compensation value, this embodiment further calculates the update step size for a single adjustment in conjunction with a preset feedback smoothing factor, and strictly uses the update step size to adjust the judgment threshold of the first-stage attack detector at fixed points, thereby completing the dynamic feedback update of the first-stage attack detector. Through the deep coupling and closed-loop linkage of the above-mentioned feature parameters and judgment thresholds, this embodiment endows the static network defense architecture with self-healing and adaptive iteration capabilities under real road driving conditions, significantly enhancing the long-term robustness of the vehicle network security protection barrier.
[0044] like Figure 5 As shown, under this architecture, the decision fusion operation performed in this embodiment is not only the endpoint of the result, but also the feedback origin for the system's adaptive evolution. Figure 5 As revealed by the feedback path, when the judgment result of the random forest detector, which serves as the core of the initial screening, differs from the conclusion of the pruned CNN classifier, which serves as the core of the fine-tuning, this embodiment strictly utilizes the extracted first-stage confidence to drive the optimization of the judgment threshold in reverse. This architecture design, which transmits data back from the pruned CNN classifier to the random forest detector, essentially establishes a closed-loop mechanism for online supervision and dynamic calibration of the "lightweight initial screening model" based on a "heavy expert model." This ensures that the system can adaptively evolve its detection performance in the face of real-world heterogeneous automotive network environments, adapting to changes in hardware computing power scheduling and driving conditions.
[0045] Furthermore, after generating the aforementioned comprehensive judgment result, in order to form a complete proactive defense closed loop from anomaly detection to physical blocking, this embodiment further triggers the underlying hardware-level security response mechanism. This embodiment first performs in-depth packet disassembly and structured analysis on the comprehensive judgment result to accurately extract the attacked protocol identifier and malicious source node characteristics hidden behind the alarm information. Specifically, this embodiment identifies the specific network medium target currently under attack by reading the feature tracing tags output by the classifier, i.e., obtaining the attacked protocol identifier; simultaneously, this embodiment reverse-tracks the physical packet header of the abnormal traffic to lock the media access control address, logical port number, or virtual LAN tag that initiated the attack, thereby establishing the malicious source node characteristics. This parsing and extraction operation, in engineering terms, concretizes the macroscopic algorithmic security alarm into physical communication parameters that can be directly matched by the underlying network routing devices, providing a clear data target for subsequent precise interception.
[0046] After successfully extracting the aforementioned physical communication parameters, this embodiment immediately enters the intelligent adjudication phase of the dynamic defense strategy. This embodiment pre-builds and maintains a security response strategy library in the non-volatile memory of the vehicle security domain controller. This strategy library statically maps the fault tolerance levels and corresponding blocking penalty mechanisms of various network protocols in the vehicle. Based on the acquired attacked protocol identifier, this embodiment performs rapid index retrieval and logical comparison in the pre-set security response strategy library to accurately match the network degradation rules corresponding to the currently damaged service. This engineering design based on protocol identifier differentiation ensures that this embodiment, while curbing the spread of network threats, can execute tiered defense according to the security integrity levels of different vehicle services, maximizing the availability of undamaged vehicle functional modules and avoiding a one-size-fits-all paralysis of the entire vehicle network due to the damage of a single node.
[0047] After completing the matching of security response strategies, this embodiment enters the final hardware blocking execution stage. This embodiment retrieves the network degradation rules obtained from the matching and the malicious source node characteristics extracted earlier, and directly sends them to the vehicle Ethernet switch in the physical topology via the internal security control bus. Upon receiving the defense command, the vehicle Ethernet switch, relying on its internal hardware access control list engine, performs line-rate feature filtering on network packets flowing through the switching matrix, and directly performs physical port isolation operations on subsequent packets matching the malicious source node characteristics. By implementing hardware-level interception at the forefront of vehicle network data forwarding, this embodiment completely cuts off the attacker's intrusion path at the physical medium level, thereby successfully blocking malicious traffic from penetrating across gateways to the controller area network side. It achieves hard-core blocking before malicious tampering commands reach core physical actuators such as chassis braking and power steering, greatly improving the inherent safety level of intelligent connected vehicles in complex adversarial environments.
[0048] This embodiment also provides an automotive Ethernet intrusion detection system based on multi-stage deep learning, including: The traffic acquisition and timing synchronization module is used to bypass and listen to multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and to perform a unified timing synchronization operation on the multi-protocol network traffic using the generalized precise time protocol to obtain the original packet sequence. The message aggregation and grouping module is used to set a sliding time window, perform time window aggregation and grouping operations on the original message sequence based on the sliding time window, and truncate to generate a windowed message sequence. The feature extraction and splitting module is used to split the windowed message sequence using a feature extractor to obtain two parallel feature data, wherein the first feature data is a statistical aggregation feature vector and the second feature data is a network traffic imaging feature matrix. The first-stage anomaly detection module is used to input the statistical aggregated feature vector into the first-stage attack detector, and use the first-stage attack detector to perform anomaly traffic detection on the statistical aggregated feature vector to obtain preliminary anomaly warning results and corresponding first-stage confidence levels. The second-stage attack classification module is used to input the network traffic imaging feature matrix into the second-stage attack classifier when the preliminary anomaly warning result indicates the existence of a suspicious network event, so as to obtain a refined attack classification result. The decision fusion and dynamic update module is used to perform a decision fusion operation based on the preliminary anomaly warning result and the fine attack classification result to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.
[0049] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0050] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for automotive Ethernet intrusion detection based on multi-stage deep learning, characterized in that, include: Bypass listening and collecting multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and using the generalized precise time protocol to perform unified time synchronization operation on the multi-protocol network traffic to obtain the original packet sequence. Set a sliding time window, and perform time window aggregation and grouping operations on the original message sequence based on the sliding time window to truncate and generate a windowed message sequence; The windowed message sequence is split using a feature extractor to obtain two parallel feature data streams. The first feature data stream is a statistical aggregation feature vector, and the second feature data stream is a network traffic imaging feature matrix. The statistical aggregated feature vector is input into the first-stage attack detector, and the first-stage attack detector is used to perform a rapid abnormal traffic detection on the statistical aggregated feature vector to obtain a preliminary abnormal warning result and the corresponding first-stage confidence level. When the preliminary anomaly warning result indicates the presence of a suspicious network event, the network traffic imaging feature matrix is input into the second-stage attack classifier to obtain a refined attack classification result; Based on the preliminary anomaly warning result and the fine attack classification result, a decision fusion operation is performed to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.
2. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, Also includes: The comprehensive judgment result is analyzed to extract the attacked protocol identifier and malicious source node characteristics, and the corresponding network degradation rule is matched in the preset security response policy library based on the attacked protocol identifier. The network degradation rules and the malicious source node characteristics are sent to the vehicle Ethernet switch. The switch then performs physical port isolation operations on subsequent packets that match the malicious source node characteristics to block malicious traffic from penetrating across gateways on the controller area network side.
3. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The unified time synchronization operation of the multi-protocol network traffic using the generalized precise time protocol includes: Based on the multi-protocol network traffic, determine the video stream data packets from the audio / video transmission protocol sender and the controller LAN data packets originating from the gateway bridge. Obtain a common reference clock signal on the transmission link of the vehicle network; Based on the common reference clock signal, a unified global timestamp is applied to video stream data packets originating from the audio and video transmission protocol sender and to controller LAN data packets originating from the gateway bridge. The global timestamp is used to perform time-series alignment processing on data packets of heterogeneous protocol types to obtain the original message sequence with consistent time.
4. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The step of performing time window aggregation and grouping operations on the original message sequence based on the sliding time window to truncate and generate a windowed message sequence includes: Based on the periodic messages in the original message sequence, an aggregation timer is started, and a protocol data unit header tag is added to the received periodic messages before they are stored in the buffer. If, before the aggregation timer expires, event-type messages or other periodic messages are continuously received and the buffer capacity meets the preset conditions, then the protocol data unit header tag is added to the received messages in sequence and stored in the buffer. When the aggregation timer expires, all messages in the buffer that have been labeled with the protocol data unit header are uniformly encapsulated into fixed-length Ethernet data packets to obtain the windowed message sequence.
5. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The feature extractor is used to split the windowed message sequence to obtain two parallel feature data streams, including: Extract a preset length of byte data from the windowed message sequence to obtain a basic feature sequence, wherein the preset length is 58 bytes; Determine whether the actual byte length of the basic feature sequence reaches 58 bytes; When the actual byte length of the basic feature sequence is less than 58 bytes, a zero-padding operation is performed on the basic feature sequence to obtain a standard byte sequence; Perform a row-wise summation operation on the standard byte sequence to calculate the first-path feature data; Perform a byte difference modulo operation on adjacent sampled data packets in the standard byte sequence to obtain differential feature data; Each byte in the differential feature data is further split into half-byte structures to obtain the second feature data.
6. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The step of using the first-stage attack detector to perform rapid anomaly traffic detection on the statistical aggregated feature vector includes: The statistical aggregated feature vector is input into multiple random forest decision trees contained in the first-stage attack detector for parallel evaluation and calculation; The average anomaly probability value of the classification results output by the multiple random forest decision trees is calculated. The average anomaly probability value is compared with the judgment threshold of the first-stage attack detector. When the average anomaly probability value is greater than the judgment threshold of the first-stage attack detector, the preliminary anomaly warning result is obtained, and the first-stage confidence level is determined based on the average anomaly probability value.
7. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The second-stage attack classifier is constructed using a pruned convolutional neural network, which includes a lightweight convolutional layer for spatial feature extraction and a fully connected layer for classification mapping.
8. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 7, characterized in that, The step of inputting the network traffic imaging feature matrix into the second-stage attack classifier to obtain refined attack classification results includes: The lightweight convolutional layer of the pruned convolutional neural network is used to perform spatial feature extraction and parameter dimensionality reduction on the network traffic imaging feature matrix to obtain the hidden layer feature map. The hidden layer feature map is input into a fully connected layer for network attack type mapping processing to obtain the fine-grained attack classification result; wherein, the specific network attack types indicated by the fine-grained attack classification result include: Media Access Control address flooding attack, Precision Time Protocol synchronization spoofing attack, Denial of Service attack, and replay attack.
9. The automotive Ethernet intrusion detection method based on multi-stage deep learning according to claim 1, characterized in that, The step of updating the judgment threshold of the first-stage attack detector using the first-stage confidence level includes: Extract the first-stage confidence level when the preliminary anomaly warning result and the fine attack classification result differ; Calculate the deviation compensation value between the confidence level of the first stage and the judgment threshold of the attack detector of the first stage; The update step size is calculated based on the deviation compensation value, and the judgment threshold of the first-stage attack detector is adjusted using the update step size to complete the dynamic feedback update of the first-stage attack detector.
10. A multi-stage deep learning-based automotive Ethernet intrusion detection system, characterized in that, include: The traffic acquisition and timing synchronization module is used to bypass and listen to multi-protocol network traffic at the mirror port of the vehicle Ethernet switch, and to perform a unified timing synchronization operation on the multi-protocol network traffic using the generalized precise time protocol to obtain the original packet sequence. The message aggregation and grouping module is used to set a sliding time window, perform time window aggregation and grouping operations on the original message sequence based on the sliding time window, and truncate to generate a windowed message sequence. The feature extraction and splitting module is used to split the windowed message sequence using a feature extractor to obtain two parallel feature data, wherein the first feature data is a statistical aggregation feature vector and the second feature data is a network traffic imaging feature matrix. The first-stage anomaly detection module is used to input the statistical aggregated feature vector into the first-stage attack detector, and use the first-stage attack detector to perform anomaly traffic detection on the statistical aggregated feature vector to obtain preliminary anomaly warning results and corresponding first-stage confidence levels. The second-stage attack classification module is used to input the network traffic imaging feature matrix into the second-stage attack classifier when the preliminary anomaly warning result indicates the existence of a suspicious network event, so as to obtain a refined attack classification result. The decision fusion and dynamic update module is used to perform a decision fusion operation based on the preliminary anomaly warning result and the fine attack classification result to obtain a comprehensive judgment result. When there is a discrepancy between the preliminary anomaly warning result and the fine attack classification result, the comprehensive judgment result is forced to adopt the fine attack classification result, and the judgment threshold of the first-stage attack detector is updated simultaneously using the first-stage confidence level.