Intrusion detection method and system based on generative adversarial network and trusted execution environment

Through collaborative training and model lightweight processing in a trusted execution environment, combined with dynamic adversarial evolution, the problems of data privacy leakage and limited edge computing resources in intrusion detection systems are solved, and efficient new attack identification and real-time detection are achieved.

CN120675796APending Publication Date: 2025-09-19SHANGHAI TONTON INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510969720.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing intrusion detection systems face problems such as a lack of real attack samples, the risk of data privacy leakage, the threat of adversarial attacks, and limited edge computing resources, resulting in insufficient model detection accuracy and poor real-time performance.

Method used

An intrusion detection method based on a generative adversarial network and a trusted execution environment is adopted. By collaboratively training and encrypting the original traffic data within the TEE, an initial intrusion detection model is constructed. The model is lightweighted through distillation to adapt to the edge environment, and dynamic adversarial evolution is combined to process suspicious traffic sets, thereby improving the model's anti-deception performance and real-time detection capabilities.

Benefits of technology

It ensures data security, improves the model's ability to identify new attacks and the real-time performance of edge environments, and enhances the model's anti-deception performance and zero-day attack detection capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675796A_ABST
    Figure CN120675796A_ABST
Patent Text Reader

Abstract

The invention relates to an intrusion detection method and system based on a generative adversarial network and a trusted execution environment, and belongs to the technical field of intrusion detection. The method comprises the following steps: acquiring encrypted original traffic data, and cooperatively training the encrypted original traffic data through trusted execution to obtain an initial intrusion detection model; distilling the intrusion detection initial model to obtain an edge deployable intrusion detection initial model; acquiring edge real-time traffic data, and processing the edge real-time traffic data through the edge deployable intrusion detection initial model to obtain a suspicious traffic set; and processing the suspicious traffic set and the historical intrusion attack set through dynamic adversarial evolution to obtain an anti-cheating security intrusion detection model, thereby synchronously improving zero-day attack detection capability and model anti-cheating performance on the premise of ensuring data security, and adapting to real-time requirements of edge scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intrusion detection, and in particular relates to an intrusion detection method and system based on a confrontation generation network and a trusted execution environment. Background Art

[0002] Existing intrusion detection systems face multiple challenges: a shortage of real attack samples, especially training data for new threats, which makes it difficult for models to detect zero-day attacks; moreover, training data contains sensitive network traffic and user behavior information, making traditional cloud training methods vulnerable to data theft and posing a significant risk of privacy leakage; at the same time, the threat of adversarial attacks is increasing, and attackers can deceive detection models by injecting malicious samples, resulting in insufficient accuracy in model intrusion detection; in addition, edge computing resources are limited, making complex models difficult to deploy on terminal devices, and cloud processing is subject to delays and poor real-time performance.

[0003] In response to the above challenges, existing technical solutions have obvious limitations: although traditional GANs can use generators to synthesize attack samples to alleviate data imbalance, their training process is exposed to an unsafe environment, resulting in the risk of leakage of model parameters and original data; TEE technology can ensure the integrity of code and data, but cannot independently solve the problems of data scarcity and model anti-adversarial robustness.

[0004] Therefore, there is an urgent need for a new method that deeply integrates generative learning and hardware-level privacy protection to simultaneously improve zero-day attack detection capabilities and model anti-deception performance while ensuring data security, and adapt to the real-time needs of edge scenarios. Summary of the Invention

[0005] In order to solve the above problems existing in the prior art, the present invention proposes an intrusion detection method and system based on a generative adversarial network and a trusted execution environment.

[0006] The purpose of the present invention can be achieved through the following technical solutions:

[0007] An intrusion detection method based on a generative adversarial network and a trusted execution environment, comprising:

[0008] S1: Obtain encrypted raw traffic data, and collaboratively train the encrypted raw traffic data through trusted execution to obtain an initial intrusion detection model;

[0009] S2: Obtaining an edge-deployable intrusion detection initial model by distilling the intrusion detection initial model;

[0010] S3: Acquire edge real-time traffic data, and process the edge real-time traffic data using the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set;

[0011] S4: Processing the suspicious traffic set and the historical intrusion attack set through dynamic adversarial evolution to obtain an anti-deception security intrusion detection model.

[0012] Preferably, the process of trustworthy execution of collaborative training in step S1 is:

[0013] Preprocessing the encrypted raw traffic data within the TEE to obtain a structured traffic data set;

[0014] An initial intrusion detection model is obtained by collaboratively training the structured traffic dataset.

[0015] Preferably, the process of constructing the structured traffic data set is:

[0016] The encrypted input data is processed by the TEE enclave hardware decryption module to obtain plaintext traffic data;

[0017] Analyzing the plaintext traffic data by feature extraction to obtain a traffic statistical feature vector;

[0018] Processing the traffic statistical feature vector by standardization calculation to obtain a normalized traffic feature matrix;

[0019] The normalized traffic feature matrix is ​​processed through data annotation and classification to obtain a structured traffic data set.

[0020] Preferably, the training process of the initial intrusion detection model is:

[0021] Initialize the network structure through the generator to obtain the intrusion detection generator;

[0022] The intrusion detection discriminator is obtained by initializing the network structure through the discriminator;

[0023] Iteratively optimizing the intrusion detection generator and the intrusion detection discriminator through adversarial training to obtain an intrusion detection optimized generator and an intrusion detection optimized discriminator;

[0024] An initial intrusion detection model is obtained through feature conversion classification training based on the intrusion detection optimization generator and the intrusion detection optimization discriminator.

[0025] Preferably, the process of constructing the initial model of edge deployable intrusion detection in step S2 is as follows:

[0026] Reconstructing the initial intrusion detection model through model distillation to obtain a lightweight intrusion detection model;

[0027] Processing the intrusion detection lightweight model through a security encapsulation protocol to obtain an intrusion detection security encapsulation model;

[0028] The intrusion detection security encapsulation model is issued through an encrypted channel and verified in the device TEE module to obtain an edge deployable intrusion detection initial model.

[0029] Preferably, the construction process of the intrusion detection lightweight model is:

[0030] In the TEE isolation environment, a discriminator is used to extract knowledge from the initial intrusion detection model to generate an intermediate intrusion detection distillation model;

[0031] Temperature scaling is applied to the intrusion detection distillation intermediate model and an attention mechanism is added to obtain an intrusion detection lightweight model.

[0032] Preferably, the process of generating the suspicious traffic set in step S3 is:

[0033] Capture edge real-time traffic data from the network interface of the edge device and split it into frames to form a sequence of original traffic frames;

[0034] Obtaining standardized traffic feature information by preprocessing the original traffic frame sequence;

[0035] Processing the standardized traffic feature information through the edge deployable intrusion detection preliminary model to obtain a traffic confidence score;

[0036] Determine the edge real-time traffic data by the traffic confidence score to obtain suspicious traffic data;

[0037] A suspicious traffic set is obtained by encrypting and integrating the suspicious traffic data.

[0038] Preferably, the process of determining the traffic confidence score is:

[0039] The traffic classification label is obtained by comparing the confidence score with the threshold;

[0040] The traffic classification label is filtered and processed by the suspicious traffic label to obtain the suspicious traffic to be encrypted;

[0041] Processing the suspicious traffic to be encrypted by fragmented hybrid encryption to obtain an encrypted suspicious traffic block;

[0042] A suspicious traffic set is obtained by uploading the encrypted suspicious traffic block to a central repository.

[0043] Preferably, the process of dynamic counter-evolution in step S4 is:

[0044] The anti-deception security intrusion detection model is obtained by processing the suspicious traffic set and the historical intrusion attack set through dynamic counter-evolution.

[0045] Deeply verify the suspicious traffic set through cloud TEE to obtain a new attack sample library;

[0046] Obtain a historical intrusion attack set, and construct a dynamic intrusion training set by fusing the suspicious traffic set, the new attack sample library, and the historical intrusion attack set;

[0047] Through the dynamic intrusion training set in TEE adversarial training, an anti-deception security intrusion detection model is output and a closed-loop update is triggered.

[0048] An intrusion detection system based on a generative adversarial network and a trusted execution environment, which is applied to the above-mentioned intrusion detection method and includes a trusted execution collaborative training module, a distillation deployment module, a suspicious traffic set acquisition module, and a dynamic intrusion detection module;

[0049] The trusted execution collaborative training module is used to obtain encrypted original traffic data, and obtain an initial intrusion detection model by trusted execution collaborative training of the encrypted original traffic data;

[0050] The distillation deployment module is used to obtain an edge deployable intrusion detection initial model by distilling the intrusion detection initial model;

[0051] The suspicious traffic set acquisition module is used to acquire edge real-time traffic data, and process the edge real-time traffic data through the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set;

[0052] The dynamic intrusion detection module is used to obtain an anti-deception security intrusion detection model by processing the suspicious traffic set and the historical intrusion attack set through dynamic counter-evolution.

[0053] The beneficial effects of the present invention are:

[0054] (1) The encrypted raw traffic data is collaboratively trained through trusted execution to obtain an initial intrusion detection model, ensuring that sensitive data such as keys, model parameters, and attack samples are in a hardware-level encryption environment throughout the process.

[0055] (2) By distilling the initial intrusion detection model, an edge deployable intrusion detection initial model is obtained, which makes the model lightweight and facilitates deployment in edge environments, thereby improving the real-time performance of intrusion detection.

[0056] (3) By acquiring edge real-time traffic data, the edge real-time traffic data is processed by the edge deployable intrusion detection initial model to obtain a suspicious traffic set, and the suspicious traffic set and the historical intrusion attack set are processed by dynamic adversarial evolution to obtain an anti-deception security intrusion detection model, thereby improving the model's ability to identify new attacks. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] To facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0058] Figure 1The figure is a flow chart of an intrusion detection method based on a generative adversarial network and a trusted execution environment according to the present invention. DETAILED DESCRIPTION

[0059] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0060] See also Figure 1 , an intrusion detection method based on adversarial generative network and trusted execution environment, comprising:

[0061] S1: Obtain encrypted raw traffic data, and collaboratively train the encrypted raw traffic data through trusted execution to obtain an initial intrusion detection model;

[0062] In this embodiment, a preliminary intrusion detection model is built within a hardware-level Trusted Execution Environment (TEE), simultaneously resolving the conflict between data privacy and zero-day attack detection. The specific process is as follows: Network traffic collected by edge devices (including sensitive information such as PCAP files and NetFlow logs) is encrypted using the AES-GCM-256 algorithm. The key is generated through remote authentication protocols, ensuring that only the target TEE enclave can decrypt it.

[0063] In this embodiment, after the encrypted raw traffic data is uploaded to the TEE, it is decrypted and structured within the CPU secure enclave, key statistical features (such as the mean packet length, traffic entropy, protocol type encoding, etc.) are extracted, and standardized calculations are performed. Finally, the encrypted raw traffic data is divided into normal traffic data and attack traffic data.

[0064] In this embodiment, collaborative training utilizes a generative adversarial network, a process completely contained within the TEE memory space. Specifically, the generator utilizes a four-layer fully connected architecture with the LeakyReLU activation function. A noise vector is input to the generator for processing and output of synthetic attack traffic data. The discriminator, based on a 1D-CNN architecture, is responsible for distinguishing between real and synthetic traffic data. The training process strictly adheres to the adversarial learning paradigm: the discriminator is optimized by maximizing the probability of identifying real traffic, logD(x), and minimizing the probability of misidentifying generated traffic, log(1-D(G(z))). The generator improves the deceptiveness of synthetic samples by maximizing log(D(G(z))). Hardware-level security at this stage is demonstrated in two aspects: gradient calculations and parameter updates are performed exclusively in the enclave's physical memory, and SGX memory encryption prevents the leakage of intermediate variables.

[0065] In this embodiment, a feature extractor is further constructed based on the trained generator to enhance zero-day attack detection capabilities. Specifically, the output of its third fully connected layer is intercepted. This layer learns the underlying distribution characteristics of attack traffic during training, and the extracted feature vectors are highly discriminative. This feature extractor is combined with a lightweight 1D-CNN classifier (containing two convolutional layers and a sigmoid output layer). Normal traffic data and synthetic attack traffic data are used as positive and negative samples to train the classification model, thereby improving the model's sensitivity to unknown attack patterns.

[0066] It's important to note that the core model parameters of the generator and discriminator in a generative adversarial network are encrypted with a key and stored in regular memory or on a hard drive. This key is securely generated internally by the hardware of the Trusted Execution Environment (TEE), such as the Intel SGX chip. This key itself is hardware-protected and cannot be accessed by external software (including the operating system or malicious attackers). Only when the model needs to be executed (training or inference) are the parameters securely loaded back into the hardware-protected enclave and automatically decrypted using the hardware to restore them to plaintext for use. The parameters remain encrypted outside the enclave, ensuring that even if the storage medium is stolen, an attacker cannot obtain the original model parameters.

[0067] S2: Obtaining an edge-deployable intrusion detection initial model by distilling the intrusion detection initial model;

[0068] In this embodiment, the initial intrusion detection model is reconstructed through model distillation and lightweighting to adapt it to the resource-constrained edge environment. Specifically, within the TEE enclave, knowledge distillation is performed based on the discriminator, and temperature scaling and attention migration techniques are used to compress the original model structure into a lightweight network, namely, the edge-deployable initial intrusion detection model.

[0069] In this embodiment, the edge-deployable intrusion detection initial model is processed through a secure encapsulation protocol, parameters are encrypted using a TEE hardware key, and a remote authentication tag is embedded, which is then sent to the edge device through an encrypted channel. During deployment, the validity of the certificate must be verified within the device's TEE module, and illegal devices will refuse to load the model, ensuring that the defense system cannot be tampered with.

[0070] S3: Acquire edge real-time traffic data, and process the edge real-time traffic data using the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set;

[0071] In this embodiment, this step focuses on real-time threat perception and feedback mechanisms in edge environments, forming a closed loop for dynamic attack sample collection. The edge-deployable intrusion detection model analyzes input traffic data. After preprocessing, each frame of traffic data is input into a feature extractor, converted into a feature vector, and ultimately outputted by a lightweight classifier with a confidence score.

[0072] In this embodiment, when the confidence score of the traffic data is greater than 0.95, the traffic data is determined to be normal traffic data and is released; otherwise, the traffic data is marked as suspicious traffic and triggered to be encrypted and uploaded to the suspicious traffic set;

[0073] Specifically, a sharded hybrid encryption mechanism is adopted, metadata (source / destination IP, timestamp) is encrypted by AES-128, and the payload content is processed using homomorphic encryption to ensure that the transmission process cannot be parsed.

[0074] S4: Processing the suspicious traffic set and the historical intrusion attack set through dynamic adversarial evolution to obtain an anti-deception security intrusion detection model.

[0075] In this embodiment, after the suspicious traffic is uploaded to the cloud TEE, the deep verification program is started, and the complete discriminator of S1 is called for secondary analysis. The nature of the threat is confirmed in combination with the attack pattern matching algorithm. The traffic confirmed as a new attack will drive the generator to synthesize enhanced samples. 5% Gaussian noise is injected during the generation process to improve diversity, and finally a new attack sample library is output.

[0076] In this embodiment, adversarial samples are generated using a historical intrusion attack set. Projected gradient descent is used to calculate perturbations within the TEE enclave, iteratively generating highly deceptive samples. The suspicious traffic set, the new attack sample library, and the historical intrusion attack set are then integrated to construct a dynamic intrusion training set. An adversarial training loop is initiated within the TEE, with a complete training cycle performed every 24 hours. After three rounds, an anti-spoofing model is output, ultimately triggering a closed-loop update. The new model is distilled and compressed using the S2 process before being securely distributed to edge devices. Simultaneously, the new attack sample library is injected into the historical intrusion attack set, continuously enhancing the model's defenses against new attacks.

[0077] An intrusion detection system based on a generative adversarial network and a trusted execution environment includes a trusted execution collaborative training module, a distillation deployment module, a suspicious traffic set acquisition module, and a dynamic intrusion detection module;

[0078] The trusted execution collaborative training module is used to obtain encrypted original traffic data, and obtain an initial intrusion detection model by trusted execution collaborative training of the encrypted original traffic data;

[0079] The distillation deployment module is used to obtain an edge deployable intrusion detection initial model by distilling the intrusion detection initial model;

[0080] The suspicious traffic set acquisition module is used to acquire edge real-time traffic data, and process the edge real-time traffic data through the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set;

[0081] The dynamic intrusion detection module is used to obtain an anti-deception security intrusion detection model by processing the suspicious traffic set and the historical intrusion attack set through dynamic counter-evolution.

[0082] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to equivalent embodiments using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. An intrusion detection method based on a generative adversarial network and a trusted execution environment, characterized in that: include: S1: Obtain encrypted raw traffic data, and collaboratively train the encrypted raw traffic data through trusted execution to obtain an initial intrusion detection model; S2: Obtaining an edge-deployable intrusion detection initial model by distilling the intrusion detection initial model; S3: Acquire edge real-time traffic data, and process the edge real-time traffic data using the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set; S4: Processing the suspicious traffic set and the historical intrusion attack set through dynamic adversarial evolution to obtain an anti-deception security intrusion detection model.

2. The intrusion detection method according to claim 1, wherein: The process of trusted execution collaborative training in step S1 is as follows: Preprocessing the encrypted raw traffic data within the TEE to obtain a structured traffic data set; An initial intrusion detection model is obtained by collaboratively training the structured traffic dataset.

3. The intrusion detection method according to claim 2, characterized in that: The construction process of the structured traffic dataset is as follows: The encrypted input data is processed by the TEE enclave hardware decryption module to obtain plaintext traffic data; Analyzing the plaintext traffic data by feature extraction to obtain a traffic statistical feature vector; Processing the traffic statistical feature vector by standardization calculation to obtain a normalized traffic feature matrix; The normalized traffic feature matrix is ​​processed through data annotation and classification to obtain a structured traffic data set.

4. The intrusion detection method according to claim 2, wherein: The training process of the initial intrusion detection model is as follows: Initialize the network structure through the generator to obtain the intrusion detection generator; The intrusion detection discriminator is obtained by initializing the network structure through the discriminator; Iteratively optimizing the intrusion detection generator and the intrusion detection discriminator through adversarial training to obtain an intrusion detection optimized generator and an intrusion detection optimized discriminator; An initial intrusion detection model is obtained through feature conversion classification training based on the intrusion detection optimization generator and the intrusion detection optimization discriminator.

5. The intrusion detection method according to claim 1, wherein: The process of constructing the initial model of edge deployable intrusion detection in step S2 is as follows: Reconstructing the initial intrusion detection model through model distillation to obtain a lightweight intrusion detection model; Processing the intrusion detection lightweight model through a security encapsulation protocol to obtain an intrusion detection security encapsulation model; The intrusion detection security encapsulation model is issued through an encrypted channel and verified in the device TEE module to obtain an edge deployable intrusion detection initial model.

6. The intrusion detection method according to claim 5, characterized in that: The construction process of the intrusion detection lightweight model is as follows: In the TEE isolation environment, a discriminator is used to extract knowledge from the initial intrusion detection model to generate an intermediate intrusion detection distillation model; Temperature scaling is applied to the intrusion detection distillation intermediate model and an attention mechanism is added to obtain an intrusion detection lightweight model.

7. The intrusion detection method according to claim 1, wherein: The generation process of the suspicious traffic set in step S3 is as follows: Capture edge real-time traffic data from the network interface of the edge device and split it into frames to form a sequence of original traffic frames; Obtaining standardized traffic feature information by preprocessing the original traffic frame sequence; Processing the standardized traffic feature information through the edge deployable intrusion detection preliminary model to obtain a traffic confidence score; Determine the edge real-time traffic data by the traffic confidence score to obtain suspicious traffic data; A suspicious traffic set is obtained by encrypting and integrating the suspicious traffic data.

8. The intrusion detection method according to claim 6, wherein: The process of traffic confidence score determination is as follows: The traffic classification label is obtained by comparing the confidence score with the threshold; The traffic classification label is filtered and processed by the suspicious traffic label to obtain the suspicious traffic to be encrypted; Processing the suspicious traffic to be encrypted by fragmented hybrid encryption to obtain an encrypted suspicious traffic block; A suspicious traffic set is obtained by uploading the encrypted suspicious traffic block to a central repository.

9. The intrusion detection method according to claim 1, wherein: The process of dynamic counter-evolution in step S4 is as follows: The anti-deception security intrusion detection model is obtained by processing the suspicious traffic set and the historical intrusion attack set through dynamic counter-evolution. Deeply verify the suspicious traffic set through cloud TEE to obtain a new attack sample library; Obtain a historical intrusion attack set, and construct a dynamic intrusion training set by fusing the suspicious traffic set, the new attack sample library, and the historical intrusion attack set; Through the dynamic intrusion training set in TEE adversarial training, an anti-deception security intrusion detection model is output and a closed-loop update is triggered.

10. An intrusion detection system based on a generative adversarial network and a trusted execution environment, the system being applied to the intrusion detection method according to any one of claims 1 to 9, characterized in that: It includes trusted execution collaborative training module, distillation deployment module, suspicious traffic set acquisition module, and dynamic intrusion detection module; The trusted execution collaborative training module is used to obtain encrypted original traffic data, and obtain an initial intrusion detection model by trusted execution collaborative training of the encrypted original traffic data; The distillation deployment module is used to obtain an edge deployable intrusion detection initial model by distilling the intrusion detection initial model; The suspicious traffic set acquisition module is used to acquire edge real-time traffic data, and process the edge real-time traffic data through the edge deployable intrusion detection preliminary model to obtain a suspicious traffic set; The dynamic intrusion detection module is used to obtain an anti-deception security intrusion detection model by processing the suspicious traffic set and the historical intrusion attack set through dynamic counter-evolution.

Citation Information

Cited By

  • Network flow intelligent cleaning method and system based on multi-dimensional feature matching, and medium

    CN120856596A