Intrusion detection method, device, server, and storage medium

Through word embedding and deep learning technology, dimensionality reduction processes high-dimensional feature vectors and learns spatial and temporal structural features, solving the dimensional explosion problem caused by OHE, and improving the accuracy and efficiency of intrusion detection.

CN111783442BActive Publication Date: 2024-11-19STATE GRID JIANGXI ELECTRIC POWER CO LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911313579.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-19
Publication Date
2024-11-19
Estimated Expiration
2039-12-19

AI Technical Summary

Technical Problem

In the prior art, feature extraction based on one-hot encoding (OHE) has a dimensional explosion problem, which leads to excessively high data processing dimensions and is difficult to effectively reflect the complexity and relationship of network intrusion behavior.

Method used

The word embedding method is used to embed high-dimensional feature vectors into low-dimensional space, combine convolutional neural networks (CNN) and recurrent neural networks (RNN), learn spatial and temporal structural features, and identify attack traffic through linear classifiers to reduce dimensions to alleviate dimensional explosion question.

Benefits of technology

Through dimensionality reduction processing, the accuracy of feature extraction and intrusion detection are improved, and the spatial and temporal relationship of network intrusion behavior can be more effectively reflected, improving the accuracy and efficiency of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111783442B_ABST
    Figure CN111783442B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer technology, and in particular to an intrusion detection method, device, server, and storage medium, which are used to solve the technical problem of high data processing dimension of the intrusion detection method existing in the prior art. The method comprises: using a word embedding method to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space to obtain a low-dimensional feature vector; using the low-dimensional feature vector as training data, learning the spatiotemporal structural characteristics of the target byte sequence through a convolutional neural network CNN and a recurrent neural network RNN; based on the spatiotemporal structural characteristics, identifying attack traffic through a pre-acquired linear classifier. The present application can effectively improve the accuracy of intrusion detection while reducing the processing dimension and computing load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an intrusion detection method, device, server, and storage medium. Background Art

[0002] In recent years, with the rapid development of network information technology, information security issues have also become prominent. Intrusion detection is currently one of the main technical means to maintain network information security. Intrusion detection, that is, by checking the audit data of the operating system or the network data packet information, monitors the behavior or activities in the system that violate the security policy or endanger the system security. Generally, it collects information from several key points in the computer network system and analyzes this information to see if there are any behaviors that violate the security policy and signs of being attacked in the network. Intrusion detection is considered to be the second security gate after the firewall. It can monitor the network without affecting the network performance, help the system deal with network attacks, expand the security management capabilities of system administrators in security auditing, monitoring, attack identification and response, and improve the integrity of the information security infrastructure, thereby providing real-time protection against internal attacks, external attacks and misoperation.

[0003] Hacker attacks are developing from individual behaviors to organized and nationalized, with strong targeting and often clear commercial, economic interests or political demands. The means of attack have evolved from traditional random viruses, Trojan infections and network attacks to the use of social engineering, various zero-day vulnerabilities and advanced evasion techniques (AET) to launch targeted advanced persistent threats (APT) and other types of attacks. These attacks are often advanced, combined, and long-term, and can sometimes easily bypass traditional security detection and defense systems. Therefore, in order to cope with the increasing number of complex attacks, many countries around the world have positioned the prevention of advanced persistent threat attacks as an important part of the national security defense strategy. Research on intrusion detection methods that can cope with the current complex network forms is of great significance to improving the performance and reliability of intrusion detection systems.

[0004] With the rapid development of data mining and machine learning, researchers in this field have proposed a variety of intrusion detection solutions based on machine learning. Although traditional machine learning methods can be trained from historical data to extract patterns that reflect network intrusion behavior, see Figure 1As shown in the figure, traditional machine learning is usually divided into two stages: training and testing. In the training stage, historical data is extracted to form feature vectors. Human experts attach classification labels to each feature vector to obtain training samples. Various learning algorithms (such as decision trees, support vector machines, artificial neural networks, etc.) are run on the training samples to obtain classification models. In the testing stage, new data is also extracted to obtain feature vectors. The classification model is then used to classify the feature vectors to obtain classification results. It can be seen that in traditional machine learning solutions, the feature extraction stage still requires manual intervention. Human experts are required to attach classification labels to each feature vector based on experience and domain knowledge to determine the features that can reflect the nature of the intrusion. However, at the current level of technology, it is not possible to obtain a number of generally recognized features that can reflect the nature of the intrusion.

[0005] Later, people applied intelligent algorithms to the field of intrusion detection. Intrusion detection technology combined with intelligent algorithms includes the following aspects: feature extraction and learning algorithms. The core purpose of feature extraction research is to find features that can express the core essence of intrusion; while the core purpose of learning algorithm research is to find algorithms that can efficiently obtain hidden patterns in training samples. Among them, features can be divided into three categories: classic features, sequence features, and grammatical features; the research on learning algorithms can be divided into three categories: single classifiers, hybrid classifiers, and aggregate classifiers.

[0006] Although intrusion detection technology combined with intelligent algorithms has advantages such as self-adaptation and self-organization, it also has disadvantages such as long learning time, easy to fall into local optimal values, and poor performance in the learning process of neural networks containing multiple hidden layers. An important reason for these shortcomings is that it uses shallow structure learning. Shallow structure is a structure containing a layer of nonlinear feature mapping. It is effective in dealing with simple or restricted problems, but it encounters great challenges in dealing with complex problems. Therefore, the development of efficient deep learning architecture has become an urgent problem to be solved, and the concept of deep learning came into being.

[0007] Deep learning is developed from the research of artificial neural networks. A typical example is a multi-layer perceptron neural network with multiple hidden layers. Deep learning can map the original sample to a new feature space through layer-by-layer nonlinear feature learning, so this learning mechanism is very suitable for detecting various intrusion behaviors. Deep learning can be used to pre-train the initial parameters and feature extraction of feature neural networks in the field of network intrusion detection. The features learned from the original network data are used as the input of machine learning classification algorithms (such as logistic regression) to complete the classification task. In addition, in most studies, deep learning algorithms play the role of classifiers, and the input of the classifiers is artificially constructed network intrusion features. The deep learning algorithms currently used in the field of network intrusion detection are mainly divided into unsupervised deep learning algorithms, supervised deep learning algorithms, and hybrid learning algorithms.

[0008] Under the existing technology, few researchers have devoted themselves to applying deep learning technology to learn useful features or expressions from raw network traffic. For example, a deep learning-based intrusion detection scheme proposes to use One Hot Encoder (OHE) as a transformation method to extract features from characters corresponding to byte sequences in the application layer load, and convert each character corresponding to the byte sequence in the raw network traffic into a higher-dimensional OHE feature vector in turn, and further convert it into a grayscale image. For example, for the first n traffic bytes of the converted network flow, if the converted OHE feature vector is m-dimensional, then the entire network traffic can be converted into the m×n two-dimensional grayscale image required by the convolutional neural network, and then the convolutional neural network is trained using the two-dimensional grayscale image as input.

[0009] Although OHE can process non-continuous numerical features and expand features to a certain extent, it also has certain drawbacks. On the one hand, OHE assumes that the semantic and grammatical relationships between characters are independent of each other, so the relationship between two characters cannot be seen by just two OHE feature vectors; on the other hand, while OHE technology expands features, it also increases the data dimension. As the size of the character sequence increases, the dimension of the corresponding grayscale image becomes larger and larger, and the matrix becomes sparser, leading to the dimensionality explosion problem.

[0010] In summary, under the existing technology, the feature extraction method based on OHE coding has the problem of dimensionality explosion. In view of this, it is necessary to redesign a method to overcome this defect. Summary of the invention

[0011] The embodiments of the present application provide an intrusion detection method, apparatus, intelligent device and storage medium to solve the technical problem of dimensionality explosion caused by OHE encoding existing in the prior art.

[0012] The specific technical solutions provided by the embodiments of this application are as follows:

[0013] A first aspect of an embodiment of the present application provides an intrusion detection method, comprising:

[0014] Using a word embedding method, the high-dimensional feature vectors corresponding to each byte in the target byte sequence are respectively embedded into a low-dimensional space to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence;

[0015] Using the low-dimensional feature vector as training input, learning the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network (CNN) and a recurrent neural network (RNN);

[0016] Based on the spatiotemporal structural features, attack traffic is identified through a pre-acquired linear classifier.

[0017] Optionally, using a word embedding method, embedding high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space respectively, and before obtaining low-dimensional feature vectors corresponding to each byte in the target byte sequence respectively, further comprising:

[0018] Determine a target byte sequence from the network traffic corresponding to the application layer load, use the target byte sequence as input, train a pre-acquired neural network language model, and output a word embedding matrix corresponding to each byte in the target byte sequence;

[0019] The word embedding method is adopted to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into the low-dimensional space respectively, so as to obtain the low-dimensional feature vectors corresponding to each byte in the target byte sequence respectively, which specifically includes:

[0020] For each byte in the target byte sequence, perform the following operations:

[0021] A high-dimensional feature vector corresponding to a byte is multiplied by a word embedding matrix corresponding to the byte to obtain a low-dimensional feature vector corresponding to the byte, wherein the high-dimensional feature vector corresponding to the byte is obtained by encoding the byte using one-hot encoding (OHE).

[0022] Optionally, before taking the low-dimensional feature vector as training input and learning the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network CNN and a recurrent neural network RNN, the method further includes:

[0023] Set up a convolutional neural network, use a filter of size 1 preset threshold, add a first convolutional layer and a first max pooling layer, use a filter of size 2 preset threshold, add a second convolutional layer and a second max pooling layer, add a first dense layer, and set the output to be a first temporary vector;

[0024] Add a third convolutional layer and a third maximum pooling layer using a filter of size equal to a third preset threshold, add a fourth convolutional layer and a fourth maximum pooling layer using a filter of size equal to a fourth preset threshold, add a second dense layer, and set the output to be a second temporary vector;

[0025] The first temporary vector and the second temporary vector are connected as the output of the convolutional neural network.

[0026] Optionally, before taking the low-dimensional feature vector as training input and learning the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network CNN and a recurrent neural network RNN, the method further includes:

[0027] Set up a recurrent neural network, add the first recurrent neural network unit in the first layer, set the first pressure drop parameter and the first repeated loss parameter; add the second recurrent neural network unit in the second layer, set the second pressure drop parameter and the second repeated loss parameter; add a third dense layer, and set the output to a flow vector.

[0028] Optionally, the low-dimensional feature vector is used as a training input, and the temporal and spatial structural features of the target byte sequence are learned through a preset convolutional neural network CNN and a recurrent neural network RNN, specifically including:

[0029] The byte sequence contained in a data packet Packet is taken as a target byte sequence, and the low-dimensional feature vectors corresponding to multiple bytes contained in a target byte sequence are merged in sequence, and a two-dimensional image is obtained corresponding to a data packet;

[0030] Taking at least one of the two-dimensional images as input, training the preset convolutional neural network, optimizing the convolution window length, step size and / or pooling function, and outputting the spatial features corresponding to the at least one two-dimensional image;

[0031] Taking the header feature of the Packet and the spatial feature as input, a preset recurrent neural network is trained to output the spatiotemporal structural features corresponding to the at least one two-dimensional image.

[0032] Optionally, after identifying the attack traffic by using the pre-acquired linear classifier, the method further includes:

[0033] Determine the target byte sequence that is not identified as attack traffic as normal traffic;

[0034] The normal traffic is taken as the data object, and cluster analysis is performed by combining the K-means clustering algorithm with outlier detection.

[0035] A second aspect of an embodiment of the present application provides an intrusion detection device, including:

[0036] A dimensionality reduction unit is used to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space by using a word embedding method, so as to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence;

[0037] An extraction unit, used to learn the spatiotemporal structural features of the target byte sequence by using the low-dimensional feature vector as a training input through a preset convolutional neural network (CNN) and a recurrent neural network (RNN);

[0038] The identification unit is used to identify the attack traffic through a pre-acquired linear classifier based on the spatiotemporal structural features.

[0039] Optionally, a word embedding method is adopted to embed high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space respectively, and before obtaining low-dimensional feature vectors corresponding to each byte in the target byte sequence respectively, the dimension reduction unit is further used to:

[0040] Determine a target byte sequence from the network traffic corresponding to the network application layer load, use the target byte sequence as input, train a pre-acquired neural network language model, and output a word embedding matrix corresponding to each byte in the target byte sequence;

[0041] When a high-dimensional feature vector corresponding to each byte in the target byte sequence is respectively embedded into a low-dimensional space by adopting a word embedding method and a low-dimensional feature vector corresponding to each byte in the target byte sequence is obtained, the dimension reduction unit is specifically used to:

[0042] For each byte in the target byte sequence, perform the following operations:

[0043] A high-dimensional feature vector corresponding to a byte is multiplied by a word embedding matrix corresponding to the byte to obtain a low-dimensional feature vector corresponding to the byte, wherein the high-dimensional feature vector corresponding to the byte is obtained by encoding the byte using one-hot encoding (OHE).

[0044] A third aspect of the embodiment of the present application further provides a server, including: a memory and a processor; wherein:

[0045] A memory for storing executable instructions;

[0046] A processor is used to read and execute executable instructions stored in the memory to implement any of the methods described above.

[0047] According to a fourth aspect of the embodiments of the present application, a storage medium is provided, which enables execution of any of the methods described above when instructions in the storage medium are executed by a processor.

[0048] In the embodiment of the present application, it is proposed to use word embedding to reduce the dimensionality of high-dimensional feature vectors, embed the high-dimensional feature vectors into low-dimensional space respectively, form low-dimensional feature expressions, and then use spatiotemporal structure deep learning technology, use low-dimensional feature vectors as training data, learn spatial features through convolutional neural networks, learn temporal features through recurrent neural networks, and then identify attack traffic through linear classifiers. In this way, the high-dimensional feature vectors are reduced in dimensionality to obtain low-dimensional feature vectors, and the low-dimensional feature vectors are used as training inputs for feature extraction, which reduces the dimension of data processing and alleviates the dimensionality explosion problem to a certain extent; and, convolutional neural networks are used to learn spatial features, and recurrent neural networks are used to learn temporal features to obtain the spatiotemporal structure characteristics of the detection target, which more fully reflects the spatial relative relationship and temporal relative relationship of the detection target, and provides more reference basis for the accurate classification of the classifier, thereby helping the classifier to more accurately identify attack traffic and improve the accuracy of intrusion detection;

[0049] Furthermore, it is proposed to use the K-means clustering algorithm combined with outlier detection to further perform cluster analysis on the data identified as normal traffic, and identify unknown types of intrusion data that the classifier fails to identify. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of a general process of intrusion detection based on machine learning in the prior art;

[0051] Figure 2 A schematic diagram of the intrusion detection method according to an embodiment of the present application;

[0052] Figure 3 This is an example diagram of word embedding in an embodiment of the present application;

[0053] Figure 4 A flowchart of a preferred embodiment of the intrusion detection method in the embodiments of the present application;

[0054] Figure 5 This is a schematic diagram of the structure of an intrusion detection device in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to solve the dimensionality explosion problem existing in the prior art, in an embodiment of the present application, for a target byte sequence, each byte in the target byte sequence is first converted into a One Hot high-dimensional feature vector, and then these high-dimensional feature vectors are embedded into a low-dimensional space using a word embedding method, thereby forming a low-dimensional feature expression; then the low-dimensional feature vectors of each byte in a data packet (Packet) in the application layer load are merged to form a two-dimensional image, which is used as input and processed using a convolutional neural network, and the convolution window length, step size, and pooling function are continuously optimized. Based on the trained convolutional neural network, the two-dimensional image corresponding to each Packet is output; the header features of the Packet and the spatial features obtained after processing by the convolutional neural network are used as inputs of the recurrent neural network, and different recurrent neural network units (such as LSTM, GRU, etc.) are designed and tested; and then, the attack traffic is identified through a linear classifier (such as Softmax).

[0057] The optional implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings:

[0058] See also Figure 2 As shown, the specific process of an intrusion detection method provided in an embodiment of the present application is as follows:

[0059] Packet application layer payload contains rich semantic information. Traditional intrusion detection technology is difficult to analyze the data of application layer payload in a fine-grained manner. Therefore, most malicious codes are hidden in the application layer payload in various ways.

[0060] In the embodiment of the present application, the original network traffic is taken as the processing object, and a feature extraction and dimensionality reduction method suitable for network intrusion detection is designed and implemented at the packet level. The dimension is first reduced to a level that is easy for subsequent processing, and then high-quality spatiotemporal structural features that can reflect the essential attributes of network intrusion are obtained.

[0061] The target byte sequence is a byte sequence determined as a detection target. In the embodiment of the present application, the byte sequence contained in the network traffic corresponding to the application layer load is used as the detection target, and a target byte sequence includes multiple bytes. It can be set that n bytes constitute a target byte sequence, and the byte stream is equally divided into multiple target byte sequences; the byte stream to be detected can also be divided into data packets, and the bytes contained in a data packet constitute a target byte sequence.

[0062] S201: using a word embedding method, embedding high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space, respectively, to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence.

[0063] The high-dimensional feature vector corresponding to each byte, that is, the high-dimensional feature vector obtained after encoding each byte in the target byte sequence, for example, when the one-hot encoding OHE technology is used, the high-dimensional feature vector is the feature vector obtained after OHE encoding, and one byte corresponds to one high-dimensional feature vector. Since one-hot encoding OHE is a sparse coding method, while expanding the features, it also increases the dimension of feature expression. The dimension of the feature vector obtained after dimensionality reduction processing of the high-dimensional feature vector is reduced. Therefore, for the convenience of description, the feature vector after OHE encoding before dimensionality reduction processing is defined as a high-dimensional feature vector, and the feature vector after dimensionality reduction processing is defined as a low-dimensional feature vector, that is, the "high" in the high-dimensional feature vector and the "low" in the low-dimensional feature vector are relative concepts and cannot be understood as necessary restrictions on feature vectors.

[0064] In an embodiment of the present application, word embedding is used for dimensionality reduction processing, feature extraction and dimensionality reduction are performed on the byte sequence of the Packet application layer load, and one byte is regarded as a "word". Improvements are made on the basis of the neural network language model in the existing technology (such as the neural network language model proposed by Bengio et al.).

[0065] Specifically, in the embodiment of the present application, the method of reducing the dimensionality of the high-dimensional feature vector is: using a word embedding method to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space, which may specifically include the following methods:

[0066] Before S201, the byte sequence of the network application layer load is determined as the target byte sequence, and the pre-acquired neural network language model is trained with the target byte sequence as input to output the word embedding matrix corresponding to each byte. Generally speaking, one word embedding matrix is ​​obtained for one byte.

[0067] For example, when performing dimensionality reduction based on the neural network language model proposed by Bengio et al., the following method can be used:

[0068] Initialize the word feature matrix C in advance. The word feature matrix C is an inherent matrix in the neural network language model proposed by Bengio et al., and is used to obtain the distributed representation of words. Then, take the target byte sequence as input to train the pre-acquired neural network language model proposed by Bengio et al. During the training process, the values ​​of the elements in the word feature matrix C will be continuously optimized. The optimized word feature matrix C obtained after training is the word embedding matrix, and one byte corresponds to one word embedding matrix.

[0069] The values ​​of each element in the word feature matrix C are equivalent to the parameters of the neural network. These parameters will be continuously optimized as the neural network language model is trained to obtain the distributed feature representation of each byte.

[0070] Based on the "distance similarity" principle in linguistics, the similarity between words is measured by whether their adjacent words are related. Through the training of the neural network language model, each word can be mapped into a k-dimensional real vector, and then the semantic similarity between the words can be judged by the distance between them, and the similarity in the vector space can be used to represent the semantic similarity of the text. Correspondingly, in the embodiment of the present application, bytes are used as words, data packets are used as sentences, conversations are used as paragraphs, and byte sequences are used as input to train the neural network language model proposed by Bengio et al. The resulting word embedding matrix carries the semantic similarity information between a byte and its adjacent bytes.

[0071] Then, for each byte in the target byte sequence in the network traffic, perform the following operations:

[0072] Based on the OHE encoding technology, a byte in the target byte sequence is converted into a corresponding high-dimensional feature vector, that is, a high-dimensional feature vector, and then the high-dimensional feature vector corresponding to the one byte is multiplied by the word embedding matrix corresponding to the one byte to obtain the low-dimensional feature vector of the one byte.

[0073] For example, see Figure 3 As shown in Figure 2, the high-dimensional feature vector obtained after OHE encoding of a byte is [0 0 0 1 0], and the word embedding matrix corresponding to this byte is Multiply the high-dimensional feature vector with the corresponding word embedding matrix to obtain the reduced-dimensional low-dimensional feature vector [W41W42W43].

[0074] Among them, when the i-th item in the high-dimensional feature vector is 1, the vector corresponding to the i-th row in the word embedding matrix is ​​the obtained low-dimensional feature vector.

[0075] Since the word embedding matrix carries semantic similarity information, the word embedding method proposed in the embodiment of the present application, on the one hand, enables the low-dimensional feature vectors of each byte extracted from the Packet application layer load to reflect their semantic relationship, that is, the spatial proximity relationship of the formed low-dimensional feature vectors can reflect the similarity of their semantics; on the other hand, it makes the obtained feature vector as low-dimensional as possible, retains the semantic spatial proximity characteristics, and achieves dimensionality reduction, which can avoid the problem of data processing overload caused by the excessively high dimension of the OHE feature vector.

[0076] S202: Using the low-dimensional feature vector as training input, extracting the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network (CNN) and recurrent neural network (RNN).

[0077] Among them, the spatiotemporal structural features of the target byte sequence are extracted through the preset convolutional neural network CNN and recurrent neural network RNN, including first learning the spatial features of the target byte sequence through CNN, using the obtained spatial features as input, and learning the temporal features of the target byte sequence through RNN, and the output of RNN is the spatiotemporal structural features.

[0078] The low-dimensional feature vector is used as the training input, including merging the obtained low-dimensional feature vectors and using the obtained two-dimensional image as the input of CNN. For example, for a target byte sequence containing n traffic bytes, the low-dimensional feature vector obtained after each target byte is encoded by OHE is m-dimensional, then a target byte sequence containing n bytes can be converted into an m*n two-dimensional image by merging. A low-dimensional feature vector is used as a row of the matrix, and multiple low-dimensional feature vectors are arranged side by side to obtain a two-dimensional matrix with m*n elements. Each element value in the two-dimensional matrix is ​​used as the pixel value of the image to obtain a two-dimensional image.

[0079] In the embodiment of the present application, the time feature is defined as: the time relative relationship between multiple packets of each session in the data stream is the time feature. The time feature is the time sequence between the previous input packet and the next packet. The purpose of training RNN is to learn the changing trend of the time series, predict the characteristics of the next packet, and then use the correlation function to calculate the difference between the predicted and the real input, so as to determine whether it is abnormal data.

[0080] In an embodiment of the present application, before using a neural network to learn spatial features and temporal features, it is necessary to pre-set the corresponding convolutional neural network and recurrent neural network, design and implement a convolutional layer and pooling layer structure that can effectively capture the characteristics of each byte sequence of the application layer load in the packet, and design and implement a recurrent layer structure that can effectively capture the time series characteristics between packets in a session.

[0081] Specifically, as an implementable method, two convolutional neural networks can be constructed respectively in the following manner:

[0082] Build the first convolutional neural network: Based on the basic structure of the convolutional neural network, use a filter with a size of the first preset threshold, add the first convolutional layer and the first maximum pooling layer, use a filter with a size of the second preset threshold, add the second convolutional layer and the second maximum pooling layer, then add the first dense layer, and set the output to the first temporary vector.

[0083] For example, add the first convolutional layer with filter c1 of size s1, then set the first max pooling layer of size t1, add the second convolutional layer with filter c2 of size s2, then add the second max pooling layer of size t2, and next, add the first dense layer whose output is a temporary vector V temp1 .

[0084] Construct a second convolutional neural network: Based on the basic structure of the convolutional neural network, use a filter with a size of the third preset threshold, add a third convolutional layer and a third maximum pooling layer, use a filter with a size of the fourth preset threshold, add a fourth convolutional layer and a fourth maximum pooling layer, add a second dense layer, and set the output to a second temporary vector.

[0085] For example, use filter c3 of size s3, add a third convolutional layer, then add a third maximum pooling layer of size t3, use filter c4 of size s4, add a fourth convolutional layer, then set a fourth maximum pooling layer of size t4, and then add a second dense layer, setting its output to the second temporary vector V temp2 .

[0086] Afterwards, the first temporary vector V temp1 and the second temporary vector V temp2 Connection, as the output of the convolutional neural network.

[0087] As an implementable method, the following method can be used to construct a recurrent neural network:

[0088] Based on the basic structure of the recurrent neural network model, the first recurrent neural network unit is added to the first layer, and the first pressure drop parameter and the first repeated loss parameter are set; the second recurrent neural network unit is added to the second layer, and the second pressure drop parameter and the second repeated loss parameter are set; the third dense layer is added, and the output is set to a flow vector.

[0089] For example, as an implementation method, the LSTM model is used as a recurrent neural network. Based on the basic LSTM model, the first LSTM layer of l1 units is added, the pressure drop parameter is set to d1, the repeated loss parameter is set to r1, and then the l2 units of the second LSTM layer are added, the pressure drop parameter is set to d2, the repeated loss parameter is set to r2, and then a dense layer is added, whose output is the flow vector v f .

[0090] In the embodiments of the present application, the basic network structure type that can be used to construct RNN is not unique. For example, in addition to LSTM, variants of gated algorithms such as GRU (Gated Recurrent Unit) algorithm can also be implemented, but the performance of the gated algorithm mainly depends on the forget gate, and the variant algorithms also use the forget gate mechanism, so they do not show more obvious advantages compared to LSTM.

[0091] In S201, a low-dimensional feature vector is obtained, and the low-dimensional feature vectors of each byte in the network application layer payload are merged in sequence to obtain at least one two-dimensional image.

[0092] For example, as an implementation method, the byte sequence corresponding to the network application layer load is divided into data packets according to the data packets, and the low-dimensional feature vectors corresponding to the bytes in a data packet are merged to obtain a two-dimensional image. In this way, one data packet corresponds to one two-dimensional image.

[0093] Based on the above-constructed convolutional neural network and recurrent neural network, training is performed using the obtained multiple two-dimensional images as training inputs.

[0094] For the convolutional neural network, the convolution window length, step size and / or pooling function are continuously optimized, and the spatial features corresponding to the two-dimensional image are output based on the trained convolutional neural network.

[0095] For the recurrent neural network, the header features of the packet and the spatial features processed by the convolutional neural network are used as the input of the recurrent neural network, and the spatiotemporal structural features corresponding to the two-dimensional image are output based on the trained recurrent neural network. Among them, the RNN processing is at the session level, and the header features of the packet include information such as the IP header and TCP header, which can help identify any session.

[0096] Network traffic data is a hierarchical and highly complex data type. To capture its complex internal sequences and time series relationships, a carefully designed neural network structure is required. One solution in the prior art is to use CNN to extract spatial features only, while this application uses a convolutional neural network to process the byte sequence in the Packet application layer load, and a recurrent neural network to process the time series of Packets within the session, and constructs multiple hidden layers according to actual needs, so as to comprehensively and deeply capture the hidden patterns of malicious code. After the above steps, low-level spatial features and high-level time features can be captured, effectively improving detection efficiency.

[0097] S203: Based on the spatiotemporal structural features, identifying attack traffic through a pre-acquired linear classifier.

[0098] Based on the spatiotemporal structural features, identifying the attack traffic through a pre-acquired linear classifier may include: using the learned spatiotemporal structural features as input of a Softmax classifier, and identifying the attack traffic through the Softmax classifier.

[0099] In the embodiment of the present application, other traffic that is not identified as attack traffic is defaulted to normal traffic. Preferably, for the data identified as normal traffic, a cluster analysis is further performed by combining the K-means algorithm with outlier detection, and then the clustering results are optimized by calculating the weighted Euclidean distance.

[0100] The following is a complete preferred embodiment of the intrusion detection method of the present application. Figure 4 As shown, this embodiment includes the following detailed processes:

[0101] S401: extract corresponding features from the network traffic data and perform dimensionality reduction processing.

[0102] In the embodiment of the present application, similarly, the byte sequence in the network traffic corresponding to the application layer load in the network structure is used as the target byte sequence for feature extraction and dimensionality reduction. First, each byte in the target byte sequence is converted into a one-hot high-dimensional feature vector; then, based on the neural network language model proposed by Bengio et al., the neural network language model is trained through the collected historical network traffic data set, and these high-dimensional feature vectors are embedded into a low-dimensional space to form a low-dimensional feature expression, that is, to obtain a low-dimensional feature vector; then, the neural network is tuned and repeatedly tested on the data set to optimize the time cost and dimensionality reduction effect.

[0103] In this embodiment, the method of dimensionality reduction using word embedding is referred to the above embodiment and will not be described in detail here.

[0104] S402: Perform cross validation based on the obtained low-dimensional feature vector.

[0105] In the embodiment of the present application, as an implementable method, 10-fold cross-validation is performed.

[0106] S403: Based on the convolutional neural network, learn the spatial features of the target byte sequence.

[0107] In this embodiment, a byte sequence in a data packet is taken as a target byte sequence.

[0108] First, the low-dimensional feature vectors corresponding to each byte in a data packet in the network traffic need to be merged in sequence to form a two-dimensional image as the input of the convolutional neural network. That is, as an implementable method, the input of the convolutional neural network CNN can be a two-dimensional image obtained by merging the low-dimensional feature vectors. Then, the convolutional neural network is used for processing, and different convolution window lengths, step sizes, and pooling functions are designed and tested.

[0109] Specifically, the structure of the CNN model is first set. In the embodiment of the present application, in order to improve learning efficiency, a section of network traffic is used as the detection target. The byte sequence of the detection target is divided into n packets. A CNN model is created for each packet. The n packets are processed by n CNN models with different parameters, and then the outputs are merged as the spatial features of the target byte sequence. For example, when the byte sequence used as the detection target is divided into 2 packets, two CNN models are created. The specific creation method is as follows:

[0110] Create CNN model_1:

[0111] Add the first convolutional layer with filter w1 of size s1, then set the first maximum pooling layer, the first maximum pooling layer size is t1; add the second convolutional layer with filter w2 of size s2, then add the second maximum pooling layer of size t2, add the first dense layer, whose output is the first temporary vector V temp1 .

[0112] For example, preferably, the size of the filter c1 is set to S1=128, the first maximum pooling layer t1=2, the size of the filter c2 is set to S2=256, and the second maximum pooling layer t2=2.

[0113] Create CNN model_2:

[0114] Add a third convolutional layer with filter w3 of size s3, followed by a third max pooling layer of size t3, add a fourth convolutional layer with filter w4 of size s4, followed by a fourth max pooling layer of size t4, add a second dense layer whose output is the second temporary vector V temp2 .

[0115] For example, preferably, the size of the filter w3 is set to S3=192, the first maximum pooling layer t3=2, the size of the filter w4 is set to S2=320, and the second maximum pooling layer t4=2.

[0116] Concatenate two temporary vectors:

[0117] V temp =V temp1 +V temp2 ;

[0118] The output V of CNN model_1 temp1 and V temp2 Merge, and the resulting vector V temp That is the output of the convolutional neural network CNN, which is the spatial feature.

[0119] This method of creating multiple CNN models, using one CNN model to learn the features of a data packet, and then merging and outputting the features learned by each model can double the learning efficiency of the CNN model.

[0120] CNN requires that the input data has a fixed size, the data packet size in the network traffic is variable, and the grouping size of the byte sequence is variable. The inventors of the present application found that when the size of a target byte sequence stream is between 600-800 bytes, CNN training can achieve the highest accuracy.

[0121] After completing the construction of the convolutional neural network, proceed to do the following:

[0122] Merge the low-dimensional feature vectors corresponding to each byte in a data packet:

[0123] Set the low-dimensional feature vector obtained in the above steps as x i , x i ∈R, that is, x i Belongs to real number vectors. The low-dimensional feature vectors corresponding to n bytes are merged according to the following formula, where is the coalescing operator.

[0124] Among them, x i:i+j Represents the low-dimensional feature vector x i ,...,x i+j of merger.

[0125]

[0126] Merging, that is, merging multiple one-dimensional low-dimensional feature vectors into a feature matrix, and the low-dimensional feature vectors are used as the rows of the matrix in turn. Assuming that the dimension of the low-dimensional feature vector is m and the number of low-dimensional feature vectors is n, then the obtained feature matrix includes n rows and m columns. The element values ​​of the feature matrix are used as pixel values ​​to obtain a corresponding two-dimensional image, and the two-dimensional image is used as the input of CNN.

[0127] Taking the two-dimensional image as the model input, a convolution operation is performed:

[0128] The convolution operation involves a filter that is applied to a window of h bytes to produce new features. For example, the feature c is generated using the following formula (12): i, where b is the bias term and f represents the Rectified Linear Unit (ReLU).

[0129] c i =f(w·x i:i+h-1 +b) (12)

[0130] Feature Mapping:

[0131] The convolution filter is applied to each possible window {x 1:h ,x 2:h+1 ,...,x n-h+1:n}, and obtain the feature map c composed of the feature vectors after nonlinear transformation:

[0132] c=[c1,c2,...,c n-h+1 ] (13)

[0133] Feature mapping, i.e. feature mapping, performs pooling operation based on feature mapping c:

[0134] The maximum temporal pooling operation is applied to the feature map obtained above, and the maximum value is used as the final feature output of the convolution training stage.

[0135]

[0136] in, is the spatial feature vector, i.e., the spatial feature extracted by CNN. To explain the model, Applied in CNNmodel1 and model2, they are equivalent to temporary vector V temp1 and V temp2 .

[0137] Continue training and validating the convolutional neural network:

[0138] When the early termination condition is not met, it is determined whether the training data set is empty. If it is not empty, the remaining target sequences in the training data set are used as model input. The training data set is a set of several target byte sequences.

[0139] The early termination condition is to determine whether the currently input low-dimensional feature vector or two-dimensional image is of the required size. If the size does not meet the requirements, the training is terminated.

[0140] In the embodiment of the present application, the classification cross entropy loss function is used to verify the training effect of CNN. Specifically, the classification cross entropy loss function H(p,q)=-∑ xp(x)log(q(x)), p=true_dist, q=predict_dist, and use the training phase loss function RMSprop to update the weights and biases through the gradient descent optimization algorithm, that is, update the size of the filter w and the bias term b of the above convolution operation formula (12).

[0141] Use the trained convolutional neural network for testing:

[0142] Set a test data set, which includes multiple two-dimensional images. The target byte sequence is encoded by OHE to obtain the high-dimensional feature vector corresponding to each byte. The high-dimensional feature vector is processed by word embedding to achieve dimensionality reduction, and the low-dimensional feature vector corresponding to each byte is obtained. Multiple low-dimensional feature vectors corresponding to each byte in a target byte sequence are merged in sequence to obtain a two-dimensional image, which is used as the input of CNN. Use the preset test data set to test and fine-tune the CNN model, and return the temporary vector V corresponding to each two-dimensional image in the test data set temp , V temp That is the spatial feature output by CNN.

[0143] S404: The spatial features extracted by CNN are used as the input of RNN, the temporal features are learned through RNN, and the spatiotemporal structural features are output.

[0144] In S403, the low-dimensional feature vectors corresponding to each byte in a data packet are merged into a two-dimensional image, and the spatial feature vectors output by the CNN correspond to each two-dimensional image, that is, one spatial feature vector is outputted for each two-dimensional image of a data packet; in this step S404, a spatial feature vector is input, and a corresponding spatiotemporal structural feature is outputted, that is to say, after a two-dimensional image is sequentially inputted into the trained CNN and RNN, a corresponding spatiotemporal structural feature is outputted.

[0145] First, a recurrent neural network RNN ​​is constructed. In this embodiment, a long short-term memory network (LSTM) is selected as the basis for model creation. Specifically, the following steps are included:

[0146] Create LSTM model:

[0147] Add the first LSTM layer corresponding to l1 units, set the first pressure drop parameter d1 and the first repeat loss parameter r1, add the second LSTM layer corresponding to l2 units, set the second pressure drop parameter d2 and the second repeat loss parameter r2, add the corresponding third dense layer, and set its output to the flow vector v f .

[0148] Among them, l1 and l2 represent the dimensions of the corresponding hidden layer, that is, the number of hidden neurons is l1 and l2 respectively, d1 and d2 represent how much information can pass through the gate, d1 = 0.5 means randomly discarding nodes, and the value range of d1 is 0-1. f Represents the output of LSTM, which is a flow vector containing features such as the time information relationship between multiple Packets. r1 and r2 represent the repeated loss parameters in Dropout. Dropout is a regularization method that can be used during training. By probabilistically inactivating the input and recursive connections of LSTM neurons during forward transmission and weight update, this method can effectively avoid overfitting and improve model performance.

[0149] Train and validate the created LSTM model:

[0150] The header features of the packet and the spatial feature vector output by CNN As input, train the RNN.

[0151] For the specific process of RNN training and verification, please refer to the above description of CNN spatial features, which will not be repeated here.

[0152] Test the LSTM model:

[0153] Set a test data set, which includes multiple spatial feature vectors V output by the above CNN temp , each V temp It can be used directly as the input of RNN. Use the preset test data set to test the fine-tuned model and return the v corresponding to each spatial feature vector in the test data set. f .v f That is the spatiotemporal structural characteristics of the output.

[0154] S405: Using the spatiotemporal structural features as softmax input, and using softmax to identify attack traffic.

[0155] S406: Determine whether there are any unprocessed two-dimensional images (or other unprocessed data objects, such as low-dimensional feature vectors that have not been merged, etc.). If yes, return to S403; if not, proceed to S407.

[0156] S407: Perform cluster analysis on normal traffic that is not identified as attack traffic.

[0157] After S405, the attack traffic has been identified. Finally, the K-means clustering algorithm (i.e., k-means clustering algorithm) is applied to the classified normal traffic to further filter out the attack traffic that cannot be identified by softmax.

[0158] In the embodiment of the present application, it is proposed to use a combination of outlier detection and K-means clustering algorithm to perform cluster analysis, and optimize the clustering results through cluster analysis. The purpose of cluster analysis is to stratify, and the outlier detection method is used in each layer to screen the candidate outliers (abnormal points), and then the screened candidate outliers are judged one by one in multiple layers. If the number of layers that judge this point as an outlier is more than the number of layers that judge it as a normal point, it is finally determined to be an outlier. Among them, a discriminator can be used to discriminate candidate outliers. The discriminator is a component in the generative adversarial network, which is used to select candidate outliers.

[0159] Among them, the discriminator, namely Discriminator, is a component in the generative adversarial network and is a multi-layer perceptron.

[0160] Specifically, cluster analysis is performed by combining outlier detection with the K-means clustering algorithm, including:

[0161] Each clustering result is defined as a "layer", and multi-objective generative adversarial active learning is used at different layers to perform outlier detection. Each data category is completed by multiple layers of "voting" according to the rule of "the minority obeys the majority".

[0162] When the K-means clustering algorithm is used to cluster the data of normal traffic, the weighted Euclidean distance based on IGR (information gain ratio) is used to optimize the clustering results. The specific operations are as follows:

[0163] Calculate the Euclidean distance between the cluster center and the test point:

[0164]

[0165] where z j Indicates the value of the jth dimension corresponding to the cluster center point, a j represents the value of the jth dimension corresponding to the point to be tested, d(x,z) represents the obtained Euclidean distance, and w j Represents the weight of the jth dimension, with a total of m dimensions.

[0166] The weights for each dimension are calculated and then passed to each layer. The IGR value of the jth dimension is assigned to w j :

[0167] wj =IGR(Y,A j ) (twenty one)

[0168]

[0169] A j represents the value of the jth dimension, Y represents the class, and H(.) is the entropy function, which can be obtained by the following formula:

[0170]

[0171] P(.) represents the probability operator, a i Represents the probability index corresponding to the i-th element in the given input.

[0172] For example, for the following matrix, each column is an eigenvector and each row is A on the left side. j It represents the row dimension of the jth row. The impact of the dimension on clustering is the impact of the values ​​of A1 and A2 on clustering. The Euclidean distance is used to characterize the differences between dimensions to a certain extent.

[0173]

[0174] Different clustering results can be obtained by using different initialization parameters (the initialization parameters can be random initialization parameters), that is, different layers. Then, Generative Adversarial Networks (GAN) are used at different layers to detect outliers in each layer.

[0175] Among them, the generative adversarial network consists of k sub-generators G 1:k and 1 discriminator, each sub-generator actively learns a specific instance data subset X i The generation mechanism of these instance data x∈X i are similar to each other and Therefore, as the training process progresses, different sub-generators G i It can generate a reasonable reference distribution to assist the discriminator in achieving accurate classification. The specific instance data is the distribution data of the normal traffic data features classified by the softmax classifier above after clustering, and the subset is the subset of the distribution. Generative adversarial active learning, that is, using the generative adversarial network to detect outliers in each layer, when generating abnormal points, the Euclidean distance calculated by the above formula (20) is used as the judgment condition. When the Euclidean distance between the test point and the cluster center reaches the threshold value for judging as an abnormal point, these test points are judged as abnormal points.

[0176] In order to achieve that each sub-classifier can learn data x∈X iThe generation mechanism of , first divides the instance data into k identical subsets based on their similar output values ​​D(x). Since samples with similar outputs are more likely to be similar to each other in the sample space, the data in each subset may be similar to each other. Then, the generator gradually learns about the data x∈X by gradually generating potential outliers to output values ​​similar to the output data. i That is, the sub-generator D(G i The target value of (z)) is converted from 1 to T i , while T i is the data subset X i The representative statistics of i ), however the discriminator still tries to estimate the probability that the sample comes from the instance.

[0177] Therefore, the optimization can be performed by the following formula:

[0178]

[0179] Among them, n i represents the number of potential outliers generated by the i-th sub-generator; b represents the data generated according to the generation mechanism; k represents the number of subsets with similar output results; T i represents the representative statistics of the ith data subset; z is the noise variable used as input to generate potential outliers.

[0180] Since the inverse of spatial smooth transformation, that is, samples with similar outputs are more likely to be similar to each other in the sample space, in order to study the generation mechanism of data x∈Xi, for each sub-generator G, this application first divides the real data into k subsets on average, and the data in each subset may be similar to each other. Then the generator gradually learns to generate potential outliers and outputs similar values ​​to them. That is, the sub-generator The target value is converted from 1 to T i , where T i is the output value D(b (j) ) is a representative statistic of the minimum value of a data subset. i is the number of potential outliers in the sub-generator, i.e. n i It is the number of potential outliers generated by the i-th sub-generator. The same number of potential outliers is generated for each subset. Finally, the discriminator D outputs the classification result. The classification of each data point is obtained by "voting" the detection results of each layer according to the rule of "minority obeys majority".

[0181] Generally, when the K-means clustering algorithm is used for clustering, attribute differences are not considered, and all attributes are treated equally. In the embodiment of the present application, a weight is assigned to each attribute according to its importance in distinguishing types through the information gain ratio (IGR). These weighted attributes can obtain more accurate classification through lower K values, and can obtain clustering results for unknown type detection more efficiently, thereby improving the efficiency of intrusion detection.

[0182] Based on the same inventive concept, the present application embodiment also provides an intrusion detection device, see Figure 5 As shown, the device includes:

[0183] A dimensionality reduction unit 501 is used to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space by using a word embedding method, so as to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence;

[0184] An extraction unit 502 is used to learn the spatiotemporal structural features of the target byte sequence by using the low-dimensional feature vector as a training input through a preset convolutional neural network CNN and a recurrent neural network RNN;

[0185] The identification unit 503 is configured to identify attack traffic through a pre-acquired linear classifier based on the extracted spatiotemporal structural features.

[0186] Optionally, a high-dimensional feature vector corresponding to each byte in the target byte sequence is respectively embedded into a low-dimensional space by using a word embedding method. Before obtaining the low-dimensional feature vector, the dimension reduction unit 501 is further used to:

[0187] Determine a target byte sequence from the network traffic corresponding to the network application layer load, use the target byte sequence as input, train a pre-acquired neural network language model, and output a word embedding matrix corresponding to each byte in the target byte sequence;

[0188] Correspondingly, a word embedding method is adopted to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space respectively. When the low-dimensional feature vector is obtained, the dimension reduction unit is specifically used to:

[0189] For each byte in the target byte sequence, the following operations are performed respectively: a high-dimensional feature vector corresponding to a byte is multiplied by the word embedding matrix corresponding to the byte to obtain a low-dimensional feature vector of the byte; wherein the high-dimensional feature vector corresponding to the byte is obtained by encoding the byte using one-hot encoding (OHE).

[0190] Based on the same inventive concept, see Figure 6 As shown, the embodiment of the present application further provides a server, including: a memory 601 and a processor 602, wherein:

[0191] Memory 601, used to store executable instructions;

[0192] The processor 602 is used to read and execute executable instructions stored in the memory to implement any of the intrusion detection methods described above.

[0193] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which, when instructions in the storage medium are executed by a processor, enables the execution of any of the intrusion detection methods described above.

[0194] In the embodiment of the present application, the application layer load in the original traffic is taken as the processing object, and improvements are made based on relevant methods in natural language processing. It is proposed to adopt a word embedding method to obtain a low-dimensional feature vector for each byte, and then a convolutional neural network (CNN) is used to learn the spatial characteristics of the network traffic, and a long short-term memory (LSTM) network is used to learn the temporal characteristics. Then, a linear classifier is used to identify attack traffic, and finally, the data classified as normal traffic is clustered and unknown attack types are detected to detect the attack traffic.

[0195] Among them, the target byte sequence in the original network traffic is taken as the processing object, and the feature extraction and dimension reduction method suitable for network intrusion detection is designed and implemented at the Packet level. High-quality features that can reflect the essential attributes of network intrusion are obtained, and their dimensions are reduced to obtain low-dimensional feature vectors, which are easy to process later;

[0196] Among them, we designed and implemented the convolutional layer and pooling layer structures that can effectively capture the characteristics of each byte sequence of the application layer load in the packet, and designed and implemented the recurrent layer structure that can effectively capture the time series characteristics between packets in the session;

[0197] Furthermore, the clustering algorithm is combined with the outlier detection algorithm to further screen the normal traffic and achieve more comprehensive and accurate detection of traffic of unknown attack types. The role of clustering the classified normal traffic is that if the unknown attack is a variant of the known attack, their similarity is high. When the granularity of the analysis is the Packet level of the application layer load, softmax may ignore its slight differences. Combining the clustering algorithm with outlier detection to further analyze the normal traffic after softmax filtering can capture these tiny fragments, that is, the improved outlier determination method, which greatly improves the detection accuracy.

[0198] In summary, the intrusion detection method provided in the embodiment of the present application combines unsupervised learning with feature learning technology, and uses feature dimensionality reduction technology based on raw traffic to avoid the drawbacks of OHE technology. CNN and RNN are used to learn spatial features and temporal features respectively, to achieve automatic learning and extraction of network features, without the need for expert experience and knowledge domain for feature design, which greatly saves manpower and time, and can achieve high-efficiency, high-precision, and intelligent intrusion detection in a complex and high-speed network environment.

[0199] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0200] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0201] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0202] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

Claims

1. An intrusion detection method, characterized in that: include: Using a word embedding method, the high-dimensional feature vectors corresponding to each byte in the target byte sequence are respectively embedded into a low-dimensional space to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence; Using the low-dimensional feature vector as training input, the temporal and spatial structural features of the target byte sequence are learned through the preset convolutional neural network CNN and recurrent neural network RNN, specifically including: The byte sequence contained in a data packet Packet is taken as a target byte sequence, and the low-dimensional feature vectors corresponding to multiple bytes contained in a target byte sequence are merged in sequence, and a two-dimensional image is obtained corresponding to a data packet; Taking at least one of the two-dimensional images as input, training the preset convolutional neural network, optimizing the convolution window length, step size and / or pooling function, and outputting the spatial features corresponding to the at least one two-dimensional image; Taking the header feature of the Packet and the spatial feature as input, training a preset recurrent neural network, and outputting the spatiotemporal structural features corresponding to the at least one two-dimensional image; Based on the spatiotemporal structural features, identifying attack traffic through a pre-acquired linear classifier; Determine the target byte sequence that is not identified as attack traffic as normal traffic; The normal traffic is taken as the data object, and cluster analysis is performed by combining the K-means clustering algorithm with outlier detection.

2. The method according to claim 1, characterized in that Using a word embedding method, the high-dimensional feature vectors corresponding to each byte in the target byte sequence are respectively embedded into a low-dimensional space, and before obtaining the low-dimensional feature vectors corresponding to each byte in the target byte sequence, the method further includes: Determine a target byte sequence from the network traffic corresponding to the application layer load, use the target byte sequence as input, train a pre-acquired neural network language model, and output a word embedding matrix corresponding to each byte in the target byte sequence; The word embedding method is adopted to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into the low-dimensional space respectively, so as to obtain the low-dimensional feature vectors corresponding to each byte in the target byte sequence respectively, which specifically includes: For each byte in the target byte sequence, perform the following operations: A high-dimensional feature vector corresponding to a byte is multiplied by a word embedding matrix corresponding to the byte to obtain a low-dimensional feature vector corresponding to the byte, wherein the high-dimensional feature vector corresponding to the byte is obtained by encoding the byte using one-hot encoding (OHE).

3. The method according to claim 1, characterized in that Using the low-dimensional feature vector as training input, before learning the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network CNN and a recurrent neural network RNN, the method further includes: Set up a convolutional neural network, use a filter of size 1 preset threshold, add a first convolutional layer and a first max pooling layer, use a filter of size 2 preset threshold, add a second convolutional layer and a second max pooling layer, add a first dense layer, and set the output to be a first temporary vector; Add a third convolutional layer and a third maximum pooling layer using a filter of size equal to a third preset threshold, add a fourth convolutional layer and a fourth maximum pooling layer using a filter of size equal to a fourth preset threshold, add a second dense layer, and set the output to be a second temporary vector; The first temporary vector and the second temporary vector are connected as the output of the convolutional neural network.

4. The method according to claim 1, characterized in that Using the low-dimensional feature vector as training input, before learning the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network CNN and a recurrent neural network RNN, the method further includes: Set up a recurrent neural network, add a first recurrent neural network unit to the first layer, set a first pressure drop parameter and a first repeat loss parameter; Add a second recurrent neural network unit in the second layer, set a second pressure drop parameter and a second repeat loss parameter; Add a third Dense layer and set the output to flow vectors.

5. An intrusion detection device, characterized in that: include: A dimensionality reduction unit is used to embed the high-dimensional feature vectors corresponding to each byte in the target byte sequence into a low-dimensional space by using a word embedding method, so as to obtain low-dimensional feature vectors corresponding to each byte in the target byte sequence; The extraction unit is used to use the low-dimensional feature vector as a training input to learn the spatiotemporal structural features of the target byte sequence through a preset convolutional neural network CNN and a recurrent neural network RNN, specifically including: The byte sequence contained in a data packet Packet is taken as a target byte sequence, and the low-dimensional feature vectors corresponding to multiple bytes contained in a target byte sequence are merged in sequence, and a two-dimensional image is obtained corresponding to a data packet; Taking at least one of the two-dimensional images as input, training the preset convolutional neural network, optimizing the convolution window length, step size and / or pooling function, and outputting the spatial features corresponding to the at least one two-dimensional image; Taking the header feature of the Packet and the spatial feature as input, training a preset recurrent neural network, and outputting the spatiotemporal structural features corresponding to the at least one two-dimensional image; an identification unit, configured to identify attack traffic through a pre-acquired linear classifier based on the spatiotemporal structural features; Determine the target byte sequence that is not identified as attack traffic as normal traffic; The normal traffic is taken as the data object, and cluster analysis is performed by combining the K-means clustering algorithm with outlier detection.

6. The device according to claim 5, characterized in that By adopting a word embedding method, the high-dimensional feature vectors corresponding to each byte in the target byte sequence are respectively embedded into a low-dimensional space. Before obtaining the low-dimensional feature vectors corresponding to each byte in the target byte sequence, the dimensionality reduction unit is further used to: Determine a target byte sequence from the network traffic corresponding to the network application layer load, use the target byte sequence as input, train a pre-acquired neural network language model, and output a word embedding matrix corresponding to each byte in the target byte sequence; When a high-dimensional feature vector corresponding to each byte in the target byte sequence is respectively embedded into a low-dimensional space by adopting a word embedding method and a low-dimensional feature vector corresponding to each byte in the target byte sequence is obtained, the dimension reduction unit is specifically used to: For each byte in the target byte sequence, perform the following operations: A high-dimensional feature vector corresponding to a byte is multiplied by a word embedding matrix corresponding to the byte to obtain a low-dimensional feature vector corresponding to the byte, wherein the high-dimensional feature vector corresponding to the byte is obtained by encoding the byte using one-hot encoding (OHE).

7. A server, characterized in that: include: A memory and a processor; wherein: A memory for storing executable instructions; A processor, configured to read and execute executable instructions stored in a memory to implement the method according to any one of claims 1 to 4.

8. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the method according to any one of claims 1 to 4 can be performed.