A power grid DDoS detection method integrating multi-scale local and global information
By combining multi-scale convolution and Transformer in the DDoS-MSCT model, the problem of lack of combination of local and global structures in network models in the existing technology is solved, and more accurate and reliable DDoS attack detection is achieved.
Patent Information
- Application Number
- CN202411121677.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-08-15
AI Technical Summary
Existing network models lack the combination of local and global structures in DDoS attack detection, resulting in the inability to effectively capture feature information and remote dependencies at different scales, affecting detection performance.
A power grid DDoS detection method is designed that integrates multi-scale local and global information. Through the DDoS-MSCT model, combined with multi-scale convolutional neural network and Transformer, the local feature extraction module and global feature extraction module are used to capture the complex characteristics of DDoS attacks. and long-range dependencies.
It improves the accuracy and robustness of DDoS attack detection, enhances the ability to classify network traffic data, and improves detection performance.
Smart Images

Figure CN118659921B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network security of artificial intelligence, and in particular relates to a power grid DDoS detection method integrating multi-scale local and global information. Background Art
[0002] As the Internet continues to expand, cybersecurity issues continue to escalate. The emergence of cloud computing, big data, and artificial intelligence has brought huge obstacles to cybersecurity. DDoS (distributed denial of service) attacks have become a prominent cyber threat in communication networks, and their prevalence has increased rapidly in the past few years. As a common form of cyber attack, DDoS attacks have the characteristics of low initiation cost and high difficulty in tracing. Nevertheless, these attacks may have serious consequences and cause significant losses to the target entity. The overwhelming nature of these attacks makes it impossible for the victim to provide services at normal capacity. Therefore, timely detection of these attacks is the main defense mechanism. Traditional security solutions such as firewalls and intrusion detection systems rely on manually set thresholds, cannot effectively respond to various attack scenarios, and are prone to false positives. To meet these challenges, researchers and security experts are actively exploring new methods and technologies to improve the accuracy of identifying malicious traffic in DDoS attacks.
[0003] Machine learning is well-known for its ability to extract patterns from raw data and has been widely used in different research fields. In recent years, more and more scholars have begun to study DDoS intrusion detection systems based on machine learning algorithms. Iman Sharafaldin et al. used four widely used machine learning algorithms (ID3, RF, Naive Bayes, Logistic Regression) to build models. First, they used CIC Flow Meter to extract 80 traffic features from the data set and used RF to test the feature effect. The highest accuracy rate reached 78%, which achieved good experimental results at the time; however, machine learning methods are widely affected by feature engineering, and even the accuracy of feature engineering methods has a decisive influence on the accuracy of machine learning models. Deep learning is the main reason for the rise of contemporary artificial intelligence in all walks of life. Its strong generalization ability makes it stand out from other machine learning techniques because it can automatically find useful features in large amounts of data without manual processing. The advantage of using deep learning methods is the ability to learn high-level abstract features instead of focusing on low-level detailed features. This feature enables deep learning to provide excellent performance when processing large data sets. Therefore, more and more researchers are using deep learning technology in the development of DDoS attack detection systems.
[0004] In 2020, Mahmoud Said Elsayed et al. proposed the DDoSNet model. The authors used autoencoders instead of PCA to detect subtle anomalies that linear PCA could not detect, which can effectively improve the accuracy of anomaly detection. For the processing of the CIC-DDoS2019 dataset, multiple features with socket functions were deleted, 77 valid features and 1 label feature were retained, and samples containing missing values and outliers were deleted. Model evaluation shows that high improvements have been achieved in accuracy, precision, recall, F1 score, etc., with an accuracy of 99%; in 2021, Marcos VOAssis et al. proposed a GRU-based deep learning method to detect DDoS and intrusion attacks. Using 83 features of the original dataset, the authors obtained an average evaluation effect of 99.94% for four attributes (accuracy, precision, recall, and F1 score). For the identification of normal traffic, GRU achieved a specificity of 99.6%; Haomin Wang et al. proposed a hybrid neural network DDosTC structure that combines the computational efficiency and scalability of Transformer with the predictive power of convolutional neural network CNN for identifying DDoS events in software-defined network (SDN) environments. The authors selected 76 relevant features and removed any instances with missing or invalid data. Subsequently, different proportions of training sets (80%, 70%, 60%) and corresponding proportions of test sets (20%, 30%, 40%) were randomly selected for experiments. The results show that DDosTC achieves better performance than traditional deep learning algorithm models and traditional hybrid models, reaching 99.82%, 99.78% and 99.70% accuracy, respectively, and all indicators have improved to varying degrees compared with other single models; In 2022, Devrim Akgun et al. proposed a deep learning model based on Inception-like blocks. In the data preprocessing stage, the authors first removed the features with limited meaning in the decision-making process, reducing the original 88 features to 67. Secondly, all categories were randomly selected, only 56,025 samples of normal traffic were kept for each anomaly traffic category (except for the WebDDoS category, which had only 439 samples), and the original large-scale dataset was compressed to a great extent, creating a dataset of 672,793 samples. The authors introduced a feature selection algorithm that uses information gain evaluation to identify and extract essential features from the CIC-DDoS2019 dataset. The algorithm aims to capture valuable information in the original data while minimizing the impact of irrelevant features. Of the 67 features, only the last 40 important features were retained. The new dataset was deduplicated to remove duplicate samples on the 40-factor dataset, resulting in a dataset containing 660,621 samples.Experiments using a newly developed dataset show that the proposed model demonstrates up to 99.99% accuracy in detecting abnormal traffic. This performance outperforms other deep learning models, including DNN, CNN, and LSTM, as evaluated in this study. After reviewing various machine learning and deep learning algorithms, it is found that deep learning algorithms generally produce superior results. However, it is worth noting that the detection performance is significantly affected by different data preprocessing strategies and the model architecture adopted. Although CNNs are effective in various intrusion detection tasks, basic CNN networks still have some limitations when processing network traffic data. Since CNNs mainly focus on local information, it may not be able to capture global contextual information and long-range dependencies at different scales. In addition, the use of fixed-size convolutional kernels, while improving efficiency, limits the model's perception range and may result in information loss or blurring. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a power grid DDoS detection method that integrates multi-scale local and global information, which solves the problem that the current network model structure lacks a detection method that combines local and global structures.
[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a power grid DDoS detection method integrating multi-scale local and global information, comprising the following steps:
[0007] S1, obtain the features of the input traffic and convert it into a traffic input sequence through the embedding layer;
[0008] S2, input the traffic input sequence and Embedding vector into the DDoS-MSCT model to obtain the CLS token;
[0009] S3. Obtain the classification result of the input traffic according to the CLS token.
[0010] Further: S1 comprises the following sub-steps:
[0011] S11, obtaining the characteristics of the input traffic and compressing it into a sequence form;
[0012] S12. Project the features of the input traffic in sequence form to any dimension through the one-dimensional convolution of the embedding layer to obtain the traffic input sequence.
[0013] Further: in S2, the DDoS-MSCT model includes a plurality of model blocks connected in sequence, each model block includes a local feature extraction module and a global feature extraction module connected to each other, the input end of the local feature extraction module serves as the input end of the model block, and the output end of the global feature extraction module serves as the output end of the model block;
[0014] Among them, the local feature extraction module is used to downsample and increase the feature dimension to learn the feature information of different receptive fields, and the global feature extraction module is used to learn the global feature information.
[0015] Further: In S2, the method of obtaining the CLS token is specifically as follows:
[0016] The traffic input sequence and the Embedding vector are continuously feature extracted through several model blocks to obtain CLS tokens. The feature extraction method of each model block is as follows:
[0017] The local features of the input information are extracted by the local feature extraction module to obtain the local feature representation, and the global features of the local feature representation are extracted by the global feature extraction module to obtain the global feature representation, which serves as the input information of the next model block.
[0018] Further: the local feature extraction module includes a first temporal convolution, a second temporal convolution, a four-branch convolution path, a point-by-point convolution layer and a one-dimensional maximum pooling layer connected in sequence;
[0019] Wherein, the four-branch convolution path includes a first branch convolution sub-path, a second branch convolution sub-path, a third branch convolution sub-path and an expansion convolution sub-path;
[0020] The structures of the first to third branch convolution subpaths are the same, and all include a depthwise one-dimensional convolution and a first one-dimensional convolution layer connected to each other, wherein the depthwise one-dimensional convolution is also connected to the second temporal convolution, and the first one-dimensional convolution layer is also connected to the pointwise convolution layer;
[0021] The dilated convolution subpath includes an extended one-dimensional convolution and a second one-dimensional convolution layer connected to each other, the extended one-dimensional convolution is also connected to the second temporal convolution, and the second one-dimensional convolution layer is also connected to the point-by-point convolution layer.
[0022] Further: the method of extracting local features of input information by the local feature extraction module to obtain local feature representation is specifically:
[0023] SA1, processing the input information through the first temporal convolution and the second temporal convolution in sequence to obtain a first feature map;
[0024] SA2, input the first feature map into the first branch convolution subpath, the second branch convolution subpath, the third branch convolution subpath and the dilated convolution subpath respectively, extract data information of different receptive fields, and obtain the second to fifth feature maps;
[0025] SA3, merge the second to fifth feature maps through a point-by-point convolution layer to obtain the sixth feature map, and concatenate the sixth feature map with the input information to obtain the seventh feature map;
[0026] SA4. Input the seventh feature map into the one-dimensional maximum pooling layer to obtain local feature representation.
[0027] Furthermore: the global feature extraction module is specifically an encoder module, which includes interconnected multi-head self-attention and feedforward networks.
[0028] Further: S3 is specifically:
[0029] The CLS tokens are sequentially input into the Transformer encoder and the linear layer to obtain the classification results of the input traffic, which are classified as normal or abnormal.
[0030] The beneficial effects of the present invention are:
[0031] (1) The present invention provides a power grid DDoS detection method that integrates multi-scale local and global information, designs a DDoS-MSCT model for detecting DDoS attacks in the network, and integrates a multi-scale convolutional neural network and a Transformer to fully utilize the advantages of feature extraction and sequence modeling to effectively capture the local and global patterns of DDoS attacks. The present invention combines a local feature extraction module with a global feature extraction module to comprehensively capture the characteristic patterns and laws of DDoS attacks. The local feature extraction module is composed of a convolution layer composed of multiple parallel convolution kernels of different sizes. It is used to capture feature information of different scales by performing convolution and pooling operations on input data of different scales. This multi-scale representation capability enables multi-scale convolution to better capture complex features from DDoS attacks. The global feature extraction module utilizes the long-range modeling advantage of Transformer at the global scale, introduces Transformer into the field of network security, and uses its powerful sequence modeling capability to classify network traffic data. Transformer can capture long-range dependencies in input data and effectively utilize global context information, thereby improving the efficiency of DDoS attack detection. Compared with previous methods, the present invention improves the detection performance of power grid DDoS attacks.
[0032] (2) The purpose of the present invention is to start from the abnormal traffic detection based on deep learning, fully consider the network traffic characteristics of the real network environment, and propose a DDoS-MSCT model that combines multi-scale convolution with Transformer. By combining multi-scale feature extraction and global modeling technology, the accuracy and robustness of the model can be improved, thereby improving the reliability and effectiveness of abnormal traffic detection in the real network environment, and solving the problem that the current network model structure lacks a combination of local and global structures for detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1The present invention is a flow chart of a power grid DDoS detection method integrating multi-scale local and global information.
[0034] Figure 2 This is a network structure diagram of the DDoS-MSCT model of the present invention.
[0035] Figure 3 This is the network structure diagram of the local feature extraction module.
[0036] Figure 4 This is the network structure diagram of the global feature extraction module.
[0037] Figure 5 Schematic diagram for obtaining classification results of input traffic. DETAILED DESCRIPTION
[0038] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0039] like Figure 1 As shown, in one embodiment of the present invention, a power grid DDoS detection method integrating multi-scale local and global information includes the following steps:
[0040] S1, obtain the features of the input traffic and convert it into a traffic input sequence through the embedding layer;
[0041] S2, input the traffic input sequence and Embedding vector into the DDoS-MSCT model to obtain the CLS token;
[0042] S3. Obtain the classification result of the input traffic according to the CLS token.
[0043] The S1 comprises the following sub-steps:
[0044] S11, obtaining the characteristics of the input traffic and compressing it into a sequence form;
[0045] S12. Project the features of the input traffic in sequence form to any dimension through the one-dimensional convolution of the embedding layer to obtain the traffic input sequence.
[0046] In this embodiment, the input traffic is a 77-dimensional feature. In order to convert the features of the input traffic into a sequence form, the present invention projects the input sequence to any dimension through one-dimensional convolution.
[0047] In S2, the DDoS-MSCT model includes a plurality of model blocks connected in sequence, each model block includes a local feature extraction module and a global feature extraction module connected to each other, the input end of the local feature extraction module serves as the input end of the model block, and the output end of the global feature extraction module serves as the output end of the model block;
[0048] Among them, the local feature extraction module is used to downsample and increase the feature dimension to learn the feature information of different receptive fields, and the global feature extraction module is used to learn the global feature information.
[0049] like Figure 2 As shown, in this embodiment, the DDoS-MSCT model consists of L model blocks, where L is the total number of preset model blocks, and each model block consists of a local feature extraction module (LFEM) and a global feature extraction module (GFEM), which can benefit from the advantages of multi-scale convolutional neural networks and Transformer.
[0050] In S2, the method of obtaining the CLS token is specifically as follows:
[0051] The traffic input sequence and the Embedding vector are continuously feature extracted through several model blocks to obtain CLS tokens. The feature extraction method of each model block is as follows:
[0052] The local features of the input information are extracted by the local feature extraction module to obtain the local feature representation, and the global features of the local feature representation are extracted by the global feature extraction module to obtain the global feature representation, which serves as the input information of the next model block.
[0053] In this embodiment, the global feature extraction module of the last model block outputs the final CLS token, which is used to output the classification result of the input traffic.
[0054] like Figure 3 As shown, in this embodiment, the local feature extraction module includes a first temporal convolution, a second temporal convolution, a four-branch convolution path, a point-by-point convolution layer and a one-dimensional maximum pooling layer connected in sequence;
[0055] Wherein, the four-branch convolution path includes a first branch convolution sub-path, a second branch convolution sub-path, a third branch convolution sub-path and an expansion convolution sub-path;
[0056] The structures of the first to third branch convolution subpaths are the same, and all include a depthwise one-dimensional convolution and a first one-dimensional convolution layer connected to each other, wherein the depthwise one-dimensional convolution is also connected to the second temporal convolution, and the first one-dimensional convolution layer is also connected to the pointwise convolution layer;
[0057] The dilated convolution subpath includes an extended one-dimensional convolution and a second one-dimensional convolution layer connected to each other, the extended one-dimensional convolution is also connected to the second temporal convolution, and the second one-dimensional convolution layer is also connected to the point-by-point convolution layer.
[0058] In this embodiment, the convolution kernel size of the first temporal convolution and the second temporal convolution is 1×3, and applying continuous convolution to the input information in sequence helps to better encode the sequence information. In order to process data information with different receptive fields, the convolution kernels of the first to third branch convolution subpaths are selected as 1×3, 1×5 and 1×7 respectively, and an expansion convolution subpath is added. In addition, the present invention uses deep one-dimensional convolution instead of ordinary convolution to extract features. The deep one-dimensional convolution uses a convolution kernel for each branch convolution subpath to ensure that only one convolution kernel is convolved on a single channel. Therefore, the number of channels in the generated feature map is precisely aligned with the number of input channels. However, this leads to unsatisfactory utilization of feature information of different channels at the same spatial position. In order to solve this limitation, a point-by-point convolution layer is used to retain the spatial dimension of the feature map while changing the number of channels for feature fusion. The implementation of point-by-point convolution corresponds to the traditional convolution method.
[0059] The dilated convolution subpath injects holes into the standard convolution kernel to form an extended one-dimensional convolution to increase the receptive field of the model without increasing the size of the convolution kernel or the number of layers.
[0060] The method of extracting local features of input information by using a local feature extraction module to obtain local feature representation is specifically as follows:
[0061] SA1, processing the input information through the first temporal convolution and the second temporal convolution in sequence to obtain a first feature map;
[0062] SA2, input the first feature map into the first branch convolution subpath, the second branch convolution subpath, the third branch convolution subpath and the dilated convolution subpath respectively, extract data information of different receptive fields, and obtain the second to fifth feature maps;
[0063] SA3, merge the second to fifth feature maps through a point-by-point convolution layer to obtain the sixth feature map, and concatenate the sixth feature map with the input information to obtain the seventh feature map;
[0064] SA4. Input the seventh feature map into the one-dimensional maximum pooling layer to obtain local feature representation.
[0065] In this embodiment, the local feature extraction module connects the first to third branch convolution subpaths and the dilated convolution subpath in parallel to better extract the local feature information of the model, thereby improving its accuracy and generalization ability. In order to avoid overfitting and speed up convergence, the Dropout mechanism and Batch Normalization (BN) mechanism are adopted. The Dropout mechanism introduces regularization by randomly discarding some units or connections. The BN mechanism forces the feature map distribution of the previous layer output to return to the standard normal distribution by reducing the internal covariate shift. Finally, the input sequence passes through the one-dimensional maximum pooling layer of the local feature extraction module, and the sequence length is reduced to half of the original, and the number of channels is doubled. After multiple local feature extraction modules, the DDoS-MSCT model can extract feature representations of different scales and dimensions, thereby improving the generalization ability and accuracy of the model.
[0066] like Figure 4 As shown, in this embodiment, the global feature extraction module is specifically an encoder module, which includes interconnected multi-head self-attention and feedforward networks.
[0067] In this embodiment, the global feature extraction module uses the encoder module in the Transformer to perform global feature extraction. The global feature extraction module of the last model block is used to output the CLS token. The present invention represents the CLS token by designing a learnable Embedding vector, which is randomly initialized before inputting the global feature extraction module and continuously updated during the process of continuous feature extraction of the traffic input sequence by all model blocks. The vector effectively encodes the semantic features of the traffic input sequence and can be used to classify the traffic input sequence.
[0068] like Figure 5 As shown, in this embodiment, S3 specifically includes: inputting the CLS token into the Transformer encoder and the linear layer in sequence to obtain the classification result of the input traffic, and the classification result is normal or abnormal.
[0069] The beneficial effects of the present invention are as follows: the present invention provides a power grid DDoS detection method that integrates multi-scale local and global information, designs a DDoS-MSCT model for detecting DDoS attacks in the network, and integrates a multi-scale convolutional neural network and a Transformer to fully utilize the advantages of feature extraction and sequence modeling to effectively capture the local and global patterns of DDoS attacks. The present invention combines a local feature extraction module with a global feature extraction module to comprehensively capture the characteristic patterns and laws of DDoS attacks. The local feature extraction module is composed of a convolution layer composed of multiple parallel convolution kernels of different sizes. By performing convolution and pooling operations on input data of different scales, it is used to capture feature information of different scales. This multi-scale representation capability enables multi-scale convolution to better capture complex features from DDoS attacks. The global feature extraction module utilizes the long-distance modeling advantage of Transformer at the global scale, introduces Transformer into the field of network security, and uses its powerful sequence modeling capability to classify network traffic data. Transformer can capture remote dependencies in input data and effectively utilize global context information, thereby improving the efficiency of DDoS attack detection. Compared with previous methods, the present invention improves the detection performance of power grid DDoS attacks.
[0070] The purpose of the present invention is to start from abnormal traffic detection based on deep learning, fully consider the network traffic characteristics of the real network environment, and propose a DDoS-MSCT model that combines multi-scale convolution with Transformer. By combining multi-scale feature extraction and global modeling technology, the accuracy and robustness of the model can be improved, thereby improving the reliability and effectiveness of abnormal traffic detection in the real network environment, and solving the problem that the current network model structure lacks a combination of local and global structures for detection.
[0071] In the description of the present invention, it is necessary to understand that the orientation or positional relationship indicated by the terms "center", "thickness", "upper", "lower", "horizontal", "top", "bottom", "inner", "outer", "radial", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are used only for descriptive purposes, and cannot be understood as indicating or implying the relative importance or the number of implicitly specified technical features. Therefore, the features defined by "first", "second", and "third" may explicitly or implicitly include one or more of the features.
Claims
1. A power grid DDoS detection method integrating multi-scale local and global information, characterized in that: The following steps are involved: S1, obtain the features of the input traffic and convert it into a traffic input sequence through the embedding layer; S2, input the traffic input sequence and Embedding vector into the DDoS-MSCT model to obtain the CLS token; S3, obtaining the classification result of the input traffic according to the CLS token; In S2, the DDoS-MSCT model includes a plurality of model blocks connected in sequence, each model block includes a local feature extraction module and a global feature extraction module connected to each other, the input end of the local feature extraction module serves as the input end of the model block, and the output end of the global feature extraction module serves as the output end of the model block; Among them, the local feature extraction module downsamples the feature layer and increases the dimension to learn the local feature information of different receptive fields, and the global feature extraction module is used to learn the global feature information; In S2, the method of obtaining the CLS token is specifically as follows: The traffic input sequence and the Embedding vector are continuously feature extracted through several model blocks to obtain CLS tokens. The feature extraction method of each model block is as follows: The local features of the input information are extracted by the local feature extraction module to obtain the local feature representation, and the global features of the local feature representation are extracted by the global feature extraction module to obtain the global feature representation, which is used as the input information of the next model block; The local feature extraction module includes a first temporal convolution, a second temporal convolution, a four-branch convolution path, a point-by-point convolution layer and a one-dimensional maximum pooling layer connected in sequence; Wherein, the four-branch convolution path includes a first branch convolution sub-path, a second branch convolution sub-path, a third branch convolution sub-path and an expansion convolution sub-path; The structures of the first to third branch convolution subpaths are the same, and all include a depthwise one-dimensional convolution and a first one-dimensional convolution layer connected to each other, wherein the depthwise one-dimensional convolution is also connected to the second temporal convolution, and the first one-dimensional convolution layer is also connected to the pointwise convolution layer; The dilated convolution subpath includes an extended one-dimensional convolution and a second one-dimensional convolution layer connected to each other, the extended one-dimensional convolution is also connected to the second temporal convolution, and the second one-dimensional convolution layer is also connected to the point-by-point convolution layer; The method of extracting local features of input information by using a local feature extraction module to obtain local feature representation is specifically as follows: SA1, processing the input information through the first temporal convolution and the second temporal convolution in sequence to obtain a first feature map; SA2, input the first feature map into the first branch convolution subpath, the second branch convolution subpath, the third branch convolution subpath and the dilated convolution subpath respectively, extract data information of different receptive fields, and obtain the second to fifth feature maps; SA3, merge the second to fifth feature maps through a point-by-point convolution layer to obtain the sixth feature map, and concatenate the sixth feature map with the input information to obtain the seventh feature map; SA4, input the seventh feature map into the one-dimensional maximum pooling layer to obtain local feature representation; The S3 is specifically: The CLS tokens are sequentially input into the Transformer encoder and the linear layer to obtain the classification results of the input traffic, which are classified as normal or abnormal.
2. The power grid DDoS detection method integrating multi-scale local and global information according to claim 1 is characterized in that: The S1 comprises the following sub-steps: S11, obtaining the characteristics of the input traffic and compressing it into a sequence form; S12. Project the features of the input traffic in sequence form to any dimension through the one-dimensional convolution of the embedding layer to obtain the traffic input sequence.
3. The power grid DDoS detection method integrating multi-scale local and global information according to claim 1 is characterized in that: The global feature extraction module is specifically an encoder module, which includes interconnected multi-head self-attention and feedforward networks.
