Network abnormal state detection method based on multi-domain multi-level network behavior feature graph

Through the construction of multi-domain and multi-level network behavior characteristic maps and the application of deep neural network models, the problems of network threat detection and attack link traceability analysis in large-scale network environments are solved, real-time detection and efficient traceability are achieved, and it is suitable for routers, etc. Deployed on the device.

CN118740450APending Publication Date: 2024-10-01BEIJING INST OF COMP TECH & APPL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410836635.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing technologies are difficult to achieve real-time network threat detection and attack link traceability analysis in large-scale network environments. In particular, it is difficult to obtain internal traffic in backbone networks, which affects the efficiency and accuracy of network threat detection.

Method used

The method of constructing multi-domain and multi-level network behavior feature maps is adopted to divide the network into hierarchical domains, extract the behavioral features of each network level and domain, construct a network behavior feature map, and detect abnormal states through a deep neural network model, combining intra-domain and Comprehensive analysis of inter-domain losses to achieve distributed network threat detection and attack link restoration.

Benefits of technology

It realizes real-time network threat detection and attack link traceability analysis in large-scale network environments, improves detection efficiency and accuracy, supports lightweight deployment on routers and other devices, and has better practical application prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740450A_ABST
    Figure CN118740450A_ABST
Patent Text Reader

Abstract

The invention relates to a network abnormal state detection method based on a multi-domain and multi-level network behavior feature map, and belongs to the field of network security. The invention provides a construction method of a multi-domain and multi-level behavior feature map, and provides a network abnormal state detection method based on the feature map, so that the detection of the overall abnormal state of the network in a large-scale actual network environment is realized, and an attack link is restored to a certain extent. According to the invention, network abnormal state detection under a large-scale network topology condition is realized through a distributed detection mode. As the traditional graph-based network anomaly detection technology usually only carries out test verification in a small-scale network, real-time detection is difficult to carry out in a large-scale network during actual application. According to the technical scheme, the distributed thought is adopted, and the target network is reasonably divided, so that each network domain only needs to construct a small-scale graph structure for calculation, and real-time detection of the overall abnormal state of the network is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security, and in particular relates to a network abnormal state detection method based on a multi-domain and multi-level network behavior characteristic graph. Background Art

[0002] In recent years, network threat detection based on artificial intelligence technology has become a research hotspot in the field of network security. At present, network threat events are often generated by multiple network devices, such as distributed denial of service attacks (DDoS). Attackers control a large number of zombie hosts as springboards to jointly attack the target host. Compared with traditional denial of service attacks (DoS), it has a greater attack effect and is not easy to be discovered. In this case, researchers have proposed a method to detect network threats by analyzing the abnormal behavior of the entire network. Since the communication behavior in the network can abstract the connection status between different network devices, it can be regarded as a natural graph structure. With the introduction of deep learning technologies based on graph structures such as GCN, the method of modeling the overall behavior of the network using graph structures has been widely studied in recent years.

[0003] However, existing related studies are usually verified in small-scale networks composed of several or dozens of virtual machines or physical machines. The network topology scale in such experimental environments is much smaller than that in real network environments, thus ignoring the efficiency issues caused by graph establishment and calculation in large-scale networks, which in turn affects the real-time performance of network threat detection. In addition, some related studies conduct anomaly detection and analysis on backbone networks, thereby achieving overall anomaly detection on large-scale networks while ensuring a certain degree of real-time performance. However, since it is difficult to obtain the traffic inside the backbone nodes in the backbone network, it is difficult to trace the source of the discovered network anomaly behavior. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] The technical problem to be solved by the present invention is: in view of the current problem of advanced persistent network threat detection, a method for detecting network abnormality is proposed to realize network threat detection in a large-scale real network environment, and to a certain extent realize the tracing analysis of network attack links.

[0006] (II) Technical solution

[0007] In order to solve the above technical problems, the present invention provides a network abnormal state detection method based on a multi-domain and multi-level network behavior feature graph, which includes two parts:

[0008] 1) Construction method of multi-domain and multi-level network behavior feature graph: Based on the characteristics of the real network topology structure, the network is divided into different levels and domains, and the network behavior characteristics of each network level and each network domain are extracted to construct the network behavior feature graph;

[0009] 2) Network anomaly state detection method based on multi-domain and multi-level behavior feature graph: Based on the constructed network behavior feature graph, multiple network anomaly state detection models are trained for different network levels and different network domains by constructing intra-domain losses and inter-domain losses, and the detection results of each network anomaly state detection model are comprehensively analyzed to realize the detection of distributed network threats in a real network environment.

[0010] Preferably, the method for constructing a multi-domain and multi-level network behavior characteristic graph includes two parts: network grading and domain division, and network behavior characteristic graph construction:

[0011] (1) Network classification and domain division

[0012] The network within an organization is divided into different areas according to the functions and uses of network devices. Each area exchanges information with network devices in other areas and on the Internet through internal gateway devices and core routers connected to the gateway devices. The network topology diagram is abstracted into a tree diagram T, where the device R as the root node is the core router, devices R1-R4 are gateway devices in each area, and devices C1-C4 and C5-C6 as leaf nodes are network devices within the area.

[0013] 1) Network layer definition

[0014] The network level of a certain network device is defined as the total height of the tree graph T minus the depth of the node corresponding to the network device;

[0015] 2) Network domain definition

[0016] If a subtree D in the tree graph T satisfies the following characteristics:

[0017] a) D is a subtree of T, and its depth is 2;

[0018] b) All child nodes of the root node of D in T are contained in the subtree D;

[0019] Then the subtree D is called a network domain;

[0020] 3) Definition of upper / lower network domains

[0021] If a network domain D has a network domain D with one of its leaf nodes as the root node L , then D L It is the subordinate network domain of D;

[0022] If a network domain D has a network domain D with its root node as a leaf node U , then D U is the parent network domain of D;

[0023] (2) Construction of network behavior feature graph:

[0024] The network behavior characteristic graph describes the behavior characteristics of the entire network. It is composed of the behavior characteristic graphs of all network domains in the target network. The target network is the network to be detected and analyzed for abnormal status.

[0025] 1) Network traffic behavior feature vector

[0026] The network traffic behavior feature vector is a vector containing the statistical characteristics of various traffic, including the total number of data packets, the distribution of data packet sizes, the distribution of data packet arrival time intervals, the total size of transmitted data packets, the difference in the number of forward and reverse data packets, the total number of TCP packets of various types, the total number of DNS protocol packets of various types, and the number of TLS / SSL protocol connections;

[0027] Define the statistical feature vector merging operator C, for any vector sequence v1,v2,…,v consisting of statistical features q , where each vector is composed of different statistical features, q is a positive integer, then the combined vector v c =C(v1,v2,…,v q ) is a vector v1,v2,…,v q The statistical characteristics and corresponding elements; suppose the statistical characteristic vector is composed of three elements: total number, mean, and variance. Then for the vector The merged vector n1,μ1, are the total number, mean, and variance of the three elements in the vector v1, n2, μ2, The total number, mean, and variance of the three elements in the vector v2;

[0028] Statistical characteristics and definitions: For a certain statistical characteristic σ of the data distribution X X and a statistical characteristic σ of the data distribution Y Y , σ X and σ Y The statistical characteristics and are the corresponding statistical characteristics of X∪Y after the two data distributions are merged; the variances of data distributions X and Y are and Then the variance and The statistical characteristics and Where |X|,|Y| represent the calculated variance respectively and The number of samples of data distribution X and Y when ;

[0029] 2) Network domain traffic matrix

[0030] In a real network environment, the traffic matrix of a network domain D with k+1 nodes is expressed as:

[0031]

[0032] in, represents the network matrix of the network domain D in the sth time interval, represents the network traffic behavior feature vector between device i and device j in the sth time interval, They represent the network traffic behavior feature vectors between device i and the network domain outside network domain D and between the network domain outside network domain D and device j in the sth time interval, respectively, where i, j = 1, 2, …, k;

[0033] 3) Multi-domain and multi-level network behavior feature diagram

[0034] The network domain traffic matrix is ​​regarded as an adjacency matrix to generate a network domain behavior characteristic graph. By grading and domaining the entire network, and establishing a network domain traffic matrix and a network domain behavior characteristic graph for each network, a multi-domain and multi-level network behavior characteristic graph is obtained.

[0035] Preferably, the network anomaly state detection method based on multi-domain and multi-level network behavior characteristic graph is based on the multi-domain and multi-level network behavior characteristic graph to construct a distributed network anomaly state detection model, thereby realizing the overall abnormal state detection of the network, and by comprehensively analyzing the results of each network anomaly state detection model, multiple network domains with anomalies are located, thereby realizing the restoration of the network attack link to a certain extent.

[0036] Preferably, the network abnormal state detection method based on multi-domain and multi-level network behavior characteristic graph comprises the following steps:

[0037] (1) The target network is divided into different levels and domains to obtain n network domains D1, D2, …D n ;

[0038] (2) Collect the traffic data of the target network over a period of time, and form n training data sets consisting of network domain traffic matrix sequences based on the network domain division and network traffic behavior feature vectors:

[0039]

[0040] There is no network attack or abnormal behavior in the next period of time, s is the total number of time intervals for collecting data, and the time interval is the pre-defined interval time for each collection of network status, is the i-th network domain D i The network domain traffic matrix in the jth time interval, where is the field of real numbers, V(D i ) is the network domain D i The number of nodes, d is the dimension of the network traffic behavior feature vector, i = 1, 2, ..., n, j = 1, 2, ..., s;

[0041] (3) For n network domains, determine the prediction step length r and build n prediction models As n network abnormal state detection models:

[0042] 1) Each prediction model The input data is a network domain D of length r. i The output result is the network domain traffic matrix of the next time interval predicted by the model, where r <s;

[0043] 2) Each prediction model They are all deep neural network models, consisting of a fully connected network FCN, a long short-term memory network LSTM, and a graph convolutional network GCN, expressed as:

[0044]

[0045] in, They represent the fully connected network FCN, the long short-term memory network LSTM, and the graph convolutional network GCN respectively;

[0046] (4) Using an unsupervised approach to predict n models Conduct training, specifically:

[0047] 1) For prediction models , from the training data set Take any continuous sequence of length r in Input into the prediction model to get the prediction results Where m = r, r+1,…, s-1;

[0048] 2) Define matrix processing operators: Row operator and Col operator, the result of Row(M,i) is the i-th row element in the matrix M, and the result of Col(M,j) is the j-th column element in the matrix M;

[0049] 3) Calculate the prediction model through the loss function The prediction results and the traffic matrix of the network domain in the next time interval The loss in the domain In addition, if network domain Di There are p subordinate network domains And define the set Then the inter-domain loss is calculated as follows:

[0050]

[0051] Among them, C is the statistical feature vector merging operator, Row and Col are the row and column operators respectively; The content consists of two parts, one is D i The equipment and The network behavior characteristics between all devices in the network are as follows: i All devices in other subordinate network domains Network behavior characteristics between all devices in the network; The content consists of two parts, one is All devices in D i The network behavior characteristics between devices in the All devices in D i The network behavior characteristics between all devices in other subordinate network domains; Indicates network domain D i The network behavior characteristics between the jth device and other devices or the corresponding subordinate network domains;

[0052] Represents the network behavior characteristics between other devices or corresponding lower-level network domains and the j-th device;

[0053] If network domain D i If there is no lower-level network domain, the final loss Loss is only the intra-domain loss, Loss = Loss1; if there is a lower-level network domain, the final loss is the sum of the intra-domain loss and the inter-domain loss Loss = Loss1 + Loss2;

[0054] 3) Minimize the final loss calculated in step 2), perform back propagation, and update the prediction model Parameters;

[0055] 4) Repeat steps 1) to 3) until the prediction model is convergence;

[0056] (5) Determine the abnormal state detection threshold ε, and train the n prediction models after convergence. Deploy to each network domain D i The root node of the network is used to calculate the current network state predicted by the prediction model through the loss function Loss. The actual network status The difference between like It is considered that network domain D i Currently in an abnormal state, otherwise it is considered that the network domain D i Currently in normal state;

[0057] For the anomaly detection results of n network domains, the network domains in abnormal state are associated according to the superior-subordinate relationship between the network domains, and the network attack link is restored.

[0058] Preferably, in the network domain traffic matrix, the network traffic behavior feature vector of a leaf node covers the network traffic behavior feature vectors between each device in its subordinate network domain and all devices in other network domains.

[0059] Preferably, the inter-domain loss describes the difference in prediction results between two prediction models of the upper network domain and the lower network domain, with the purpose of correcting the prediction results of the upper network domain by the prediction results of the lower network domain.

[0060] Preferably, the loss functions L1 and L2 are both selected from the mean square error loss function and the cross entropy loss function.

[0061] The invention also provides a system for implementing the method.

[0062] (III) Beneficial effects

[0063] The present invention proposes a method for constructing a multi-domain and multi-level behavior feature graph, and proposes a method for detecting network abnormality based on the feature graph, which realizes the detection of the overall abnormality of the network in a large-scale actual network environment and restores the attack link to a certain extent. Compared with the traditional network abnormality detection solution, this solution has the following advantages:

[0064] 1) Detect network anomaly status under large-scale network topology conditions through distributed detection. Since traditional graph-based network anomaly detection technology is often only tested and verified in small-scale networks, it is difficult to perform real-time detection in large-scale networks in actual applications. This technical solution adopts the idea of ​​distribution and reasonably divides the target network so that each network domain only needs to build a smaller graph structure for calculation, thereby realizing real-time detection of the overall abnormal state of the network.

[0065] 2) By grading and dividing the entire network into different domains, the attack behaviors in the network can be quickly located and responded to in a timely manner, and help the tracing analysis of network attacks. Since each prediction model only analyzes a certain network domain, when an abnormal state occurs in the network, the network domain can be quickly located, and timely responses can be made by cutting off the router, blocking access to the external network, etc. In addition, the detection model in each network domain will also detect the interaction behavior of devices outside the domain (i.e., the 0th row and 0th column of the network domain traffic matrix), and increase the inter-domain loss in the upper network domain to ensure the accuracy of the alarm in the upper network domain. Therefore, when a cross-network attack occurs (including but not limited to remote brute force cracking, DDOS), the network domains where the attacking and attacked terminals are located, as well as the network domains passed in the middle, will generate abnormal alarms, thereby realizing the restoration of the attack link, which is helpful for the tracing analysis of network attacks.

[0066] 3) Supports online training of detection models, which can be lightweight deployed on devices such as routers, and has better practical application prospects. The anomaly detection model used in this solution is trained in an unsupervised manner, so the model training can be completed through online learning or the model can be updated regularly. In addition, since each detection model only detects the network domain, each detection model can achieve accurate anomaly detection with a small parameter scale. At the same time, each network domain generally has devices with gateway functions such as routers, so each detection model can be lightweight deployed on the device, which has better practical application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 is a flow chart of the method of the present invention;

[0068] Figure 2 It is a network information topology diagram;

[0069] Figure 3 It is the network domain behavior feature diagram;

[0070] Figure 4 This is the network structure diagram of the prediction model. DETAILED DESCRIPTION

[0071] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0072] In order to solve the problem of low detection efficiency of traditional graph-based network anomaly detection methods in real network environments, the present invention proposes a method for constructing a multi-domain and multi-level network behavior feature graph based on the characteristics of the real network topology structure, and proposes a method for detecting network anomaly states based on the feature graph, so as to realize the detection of network threats in a large-scale real network environment and the restoration of network attack links to a certain extent.

[0073] To achieve the above-mentioned invention object, the present invention proposes the following technical solution: a method for detecting network abnormality based on multi-domain and multi-level network behavior characteristic graph. The solution includes two parts:

[0074] 1) Construction method of multi-domain and multi-level network behavior feature graph: Based on the characteristics of the real network topology structure, the network is divided into different levels and domains, and the network behavior characteristics of each network level and each network domain are extracted to construct the network behavior feature graph;

[0075] 2) Network anomaly state detection method based on multi-domain and multi-level behavior feature graph: Based on the constructed network behavior feature graph, multiple anomaly detection models are trained for different network levels and different network domains by constructing intra-domain losses and inter-domain losses, and the detection results of each anomaly detection model are comprehensively analyzed to realize the detection of distributed network threats in a real network environment.

[0076] The following will refer to Figure 1 Provide a detailed description of each part of the plan.

[0077] (I) Construction method of multi-domain and multi-level network behavior feature graph

[0078] This section mainly proposes a method for constructing a multi-domain and multi-level network behavior characteristic graph, including two parts: network grading and domain division, and network behavior characteristic graph construction.

[0079] (1) Network classification and domain division

[0080] The internal network of an organization or company is usually divided into different areas according to the functions and uses of network devices. Each area exchanges information with network devices in other areas and on the Internet through internal gateway devices and core routers connected to the gateway devices. The network topology diagram can be abstracted as follows: Figure 2 In the tree diagram T shown, device R (root node) is a core router, devices R1-R4 are gateway devices of each area, and devices C1-C4, C5-C6 (leaf nodes) are network devices within the area.

[0081] 1) Network layer definition

[0082] The network level of a network device is defined as the total height of the tree graph T minus the depth of the node corresponding to the network device. Figure 2 The network level of the core router R is 3, and the network level of devices C1-C4 is 1.

[0083] 2) Network domain definition

[0084] If a subtree D in the tree graph T satisfies the following characteristics:

[0085] a) D is a subtree of T, and its depth is 2;

[0086] b) All child nodes of the root node of D in T are contained in the subtree D;

[0087] Then the subtree D is called a network domain. Figure 2 Device R and R1-R4 form a network domain, and device R2 and devices C1-C4 form a network domain.

[0088] 3) Definition of upper / lower network domains

[0089] If a network domain D has a network domain D with one of its leaf nodes as the root node L , then D L It is the subordinate network domain of D.

[0090] If a network domain D has a network domain D with its root node as a leaf node U , then D U It is the parent network domain of D.

[0091] (2) Construction of network behavior feature graph:

[0092] The network behavior characteristic graph describes the behavior characteristics of the entire network, which is composed of the behavior characteristic graphs of all network domains in the target network (i.e., the network to be detected and analyzed for abnormal status).

[0093] 1) Network traffic behavior feature vector

[0094] The network traffic behavior feature vector is mainly a vector containing statistical characteristics of various traffic, including but not limited to the total number of data packets, distribution of data packet size (maximum value, minimum value, mean value, standard deviation, etc.), distribution of data packet arrival time interval (maximum value, minimum value, mean value, standard deviation, etc.), total size of transmitted data packets, difference in the number of forward and reverse data packets, total number of various types of TCP data packets (including the number of SYN, ACK, FIN and other types of data packets), total number of various types of DNS protocol data packets (including the number of DNS request, MX record query and other types of data packets), and number of TLS / SSL protocol connections.

[0095] Define the statistical feature vector merging operator C, for any vector sequence v1,v2,…,v consisting of statistical features q (Each vector is composed of different statistical features), q is a positive integer, then the merged vector v c =C(v1,v2,…,v q ) is a vector v1,v2,…,v q The statistical characteristics and corresponding elements. Taking the statistical characteristic vector consisting of three elements, total number, mean, and variance, as an example, for the vector The merged vector n1,μ1, are the total number, mean, and variance of the three elements in the vector v1, n2, μ2, The total number, mean, and variance of the three elements in the vector v2.

[0096] Statistical characteristics and definitions: For a certain statistical characteristic σ of the data distribution X X and a statistical characteristic σ of the data distribution Y Y , σ X and σ Y The statistical characteristics and are the corresponding statistical characteristics of X∪Y after the two data distributions are merged. Taking variance as an example, the variances of data distributions X and Y are and Then the variance and The statistical characteristics and Where |X|,|Y| represent the calculated variance respectively and The number of samples of the data distribution X and Y when .

[0097] 2) Network domain traffic matrix

[0098] In a real network environment, the traffic matrix of a network domain D with k+1 nodes can be expressed as:

[0099]

[0100] in, represents the network matrix of the network domain D in the sth time interval, represents the network traffic behavior feature vector between device i (or the lower-level network domain with device i as the root node) and device j (or the lower-level network domain with device j as the root node) in the sth time interval, They respectively represent the network traffic behavior feature vectors between device i (or the lower-level network domain with device i as the root node) and the network domain outside network domain D, and between the network domain outside network domain D and device j (or the lower-level network domain with device j as the root node) in the sth time interval, where i, j = 1, 2, …, k.

[0101] In a network domain with a higher network domain hierarchy, its leaf node is often a router / gateway device. In the network domain traffic matrix, the network traffic behavior feature vector of the node covers the network traffic behavior feature vectors between each device in its subordinate network domain and all devices in other network domains (not the subordinate network domain of the node). Because as a gateway device, all devices under the node need to pass through the device when communicating with devices in other network domains.

[0102] 3) Multi-domain and multi-level network behavior feature diagram

[0103] In order to visualize the network traffic behavior characteristics within a network domain, the network domain traffic matrix 2) can be regarded as an adjacency matrix to generate a network domain behavior characteristic graph. Figure 2 Taking the network domain composed of device R and R1-R4 as an example, the number of nodes in the generated network domain behavior characteristic graph is 5, where nodes 1 to 4 are n network devices under the network domain, and node 0 represents the network device in other network domains, such as Figure 3 shown.

[0104] By grading and domaining the entire network and establishing a network domain traffic matrix and a network domain behavior characteristic graph for each network, a multi-domain and multi-level network behavior characteristic graph can be obtained (the multiple network domain behavior characteristic graphs obtained through the above operations are collectively referred to as multi-domain and multi-level network behavior characteristic graphs).

[0105] (II) Network anomaly detection method based on multi-domain and multi-level network behavior feature graph

[0106] This part mainly builds a distributed network anomaly state detection model based on multi-domain and multi-level network behavior feature graphs, thereby realizing the overall abnormal state detection of the network. In addition, by comprehensively analyzing the results of each network anomaly state detection model, multiple network domains with anomalies can be located, thereby realizing the restoration of network attack links to a certain extent.

[0107] The main steps include:

[0108] (1) The target network (i.e., the network to be detected for abnormal status) is classified and divided into domains to obtain n network domains D1, D2, … D n ;

[0109] (2) Collect traffic data of the target network over a period of time (during which there is no network attack or abnormal behavior), and form n training data sets consisting of network domain traffic matrix sequences based on the network domain division and network traffic behavior feature vectors:

[0110]

[0111]

[0112] Where s is the total number of time intervals for collecting data, and the time interval is a pre-defined interval for collecting network status each time, which can be selected as 0.1s, 0.5s, or 1s.

[0113] is the i-th network domain D i The network domain traffic matrix in the jth time interval, where is the field of real numbers, V(D i ) is the network domain D i , d is the dimension of the network traffic behavior feature vector, i = 1, 2, …, n, j = 1, 2, …, s.

[0114] (3) For n network domains, determine the prediction step length r and build n prediction models As n network abnormal state detection models:

[0115] 1) Each prediction model The input data is a network domain D of length r. i The output result is the network domain traffic matrix of the next time interval predicted by the model, where r <s。

[0116] 2) Each prediction model They are all deep neural network models, consisting of a fully connected network FCN, a long short-term memory network LSTM, and a graph convolutional network GCN, such as Figure 4 As shown, it can be expressed as:

[0117]

[0118] in, They represent the fully connected network FCN, the long short-term memory network LSTM, and the graph convolutional network GCN respectively;

[0119] (4) Using an unsupervised approach to predict n models Conduct training, including:

[0120] 1) For prediction models From the training dataset Take any continuous sequence of length r in Input into the prediction model to get the prediction results Where m = r, r+1,…, s-1;

[0121] 2) Define matrix processing operators: row operator Row and column operator Col, the result of Row(M,i) is the i-th row element in the matrix M, and the result of Col(M,j) is the j-th column element in the matrix M.

[0122] 3) Calculate the prediction model through the loss function The prediction results and the traffic matrix of the network domain in the next time interval (next step) The loss in the domain In addition, if network domain D i There are p subordinate network domains And define the set Then the inter-domain loss is calculated as follows:

[0123]

[0124] Wherein, C is the statistical feature vector merging operator defined in step (1), Row and Col are the row and column operators respectively. Indicates network domain D i Devices in or other subordinate network domains (D i remove The lower-level network domains other than Network behavior characteristics between all devices in the network domain D i The leaf node in the network domain D may be a terminal device (i.e., it has no lower-level network domain and is also a leaf node in the tree diagram T), or it may be a gateway device (i.e., it has a lower-level network domain and is not a leaf node in the tree diagram T). i The "device in" refers to the terminal type device, and the "other subordinate network domains" refers to the subordinate network domain with the gateway type device as the root node; the "jth subordinate network domain The network behavior characteristics between devices in the network domain are called "network domain D i Devices in and other lower-level network domains" and lower-level network domains Therefore, The content consists of two parts, one is D i The equipment and The network behavior characteristics between all devices in the network (from D i The device in initiates a connection request to The other part is the network traffic behavior characteristics of the device in Di All devices in other subordinate network domains Network behavior characteristics between all devices in the network; Indicates the jth subordinate network domain All devices and network domain D i Devices in or other subordinate network domains (D i remove The network behavior characteristics between the lower-level network domains outside the The content consists of two parts, one is All devices in D i The network behavior characteristics between devices in The device initiates a connection request to D i The network traffic behavior characteristics of the devices in the All devices in D i The network behavior characteristics between all devices in other subordinate network domains; Indicates network domain D i The network behavior characteristics between the j-th device (or the lower-level network domain with the j-th device as the root node) and other devices or corresponding lower-level network domains; Represents the network behavior characteristics between other devices or corresponding lower-level network domains and the j-th device (or the lower-level network domain with the j-th device as the root node).

[0125] The above inter-domain loss describes the difference in prediction results between the two prediction models of the upper network domain and the lower network domain, and the purpose is to correct the prediction results of the upper network domain through the prediction results of the lower network domain.

[0126] If network domain D i If there is no lower-level network domain, the final loss Loss is only the intra-domain loss, Loss = Loss1; if there is a lower-level network domain, the final loss is the sum of the intra-domain loss and the inter-domain loss Loss = Loss1 + Loss2.

[0127] Optionally, the loss functions L1 and L2 can be selected from functions such as mean square error loss and cross entropy loss;

[0128] 3) Minimize the final loss calculated in step 2) through the optimizer, perform back propagation, and update the prediction model Parameters of , optionally, optimizer stochastic gradient descent, Adam, etc.;

[0129] 4) Repeat steps 1) to 3) until the prediction model is convergence.

[0130] (5) Determine the abnormal state detection threshold ε, and train the n prediction models after convergence. Deploy to each network domain D i The root node of the network is used to calculate the current network state predicted by the prediction model through the loss function Loss. The actual network status The difference between like It is considered that network domain D i Currently in an abnormal state, otherwise it is considered that the network domain D i Currently in normal state.

[0131] (6) For the anomaly detection results of n network domains, the network domains in abnormal state are associated according to the superior-subordinate relationship between the network domains, so that the network attack link can be restored.

[0132] The embodiment of the present invention is Figure 2 The network shown is used as the target network. For the convenience of expression, the target network in this example is relatively small (usually there will be terminal devices under device R1 and device R3, which are not reflected in this example), but this technical solution can be applied to larger networks. Similarly, the network traffic behavior features extracted when constructing the network domain traffic matrix include the total number of data packets and the total size of data packets.

[0133] The present invention is Figure 2 The steps for detecting abnormal network status in the network shown are as follows:

[0134] (1) Network classification and domain division

[0135] According to the definition of network domain, Figure 2 Device R and R1-R4 form a network domain D0, device R2 and devices C1-C4 form a network domain D2, and device R4 and devices C5-C8 form a network domain D4.

[0136] (2) Constructing a network domain traffic matrix

[0137] According to the divided network domains, a network domain traffic matrix is ​​constructed. For the network domain traffic matrix of network domain D0 at time interval s As shown below.

[0138]

[0139] Each of these elements are both vectors of dimension 2, representing the total number and total size of data packets generated by the network domain under device Ri and the network domain under device Rj when the network is connected. They represent the extra-domain network ( Figure 2 The network traffic behavior characteristics of the network connection with the network domain under device Rj are shown in Indicates the network traffic behavior characteristics of the network connection between the network domain under device Ri and the external network ( Figure 2 as shown in

[0140] For the network domain traffic matrix of network domain D2 at time interval s is as follows.

[0141]

[0142] Each element is a vector of dimension 2, representing the total number of data packets and the total size of data packets generated by the network connection between device Ci and device Cj respectively. respectively represent the network traffic behavior characteristics of the network connection between other network domains (D3 and the network domains under devices R1 and R3) and device Cj. represents the network traffic behavior characteristics of the network connection between device Ci and other network domains (D3 and the network domains under devices R1 and R3), i, j = 1, 2, 3, 4.

[0143] The network domain traffic matrix of network domain D4 at time interval s is similar to

[0144] (3) Collect training data

[0145] Determine the time interval as 0.1 s, collect network traffic data for a total of s time intervals (during which there is no network attack behavior or abnormal behavior), and construct the network domain traffic matrix as the training data set according to step (2):

[0146]

[0147] (4) Model construction and training

[0148] Determine the detection step r < s, and construct 3 prediction models for the above 3 network domains respectively Each prediction model uses Figure 4 the network structure shown, and the input data of each prediction model is the network domain D i traffic matrix sequence of length r.

[0149]

[0150] In an unsupervised manner, train the models respectively on the data set

[0151] 1) For the prediction model From the training data set Take any continuous sequence of length r in Input into the model to get the prediction result Where m = r, r+1,…, s-1;

[0152] 2) Through the cross entropy loss function L cross The loss of the calculation model is and Only the loss within the domain is calculated, which are for The loss is the sum of the intra-domain loss and the inter-domain loss, where the intra-domain loss is The inter-domain loss is

[0153]

[0154] final

[0155] 3) Minimize through Adam optimizer Perform back propagation to update the prediction model Parameters;

[0156] 4) Repeat steps 1) to 3) until the prediction model is convergence.

[0157] (5) Model deployment detection

[0158] Determine the abnormal state detection threshold ε = 0.2, and train the n prediction models after convergence Deploy to each network domain D i The root node of the network is calculated by the loss function L to predict the current network state. The actual network status The difference between like It is considered that network domain D i Currently in abnormal state.

[0159] (6) Attack source tracing analysis

[0160] For the anomaly detection results of the above network domains, the network domains in abnormal state are associated according to the hierarchical relationship between network domains D0, D2, and D4, and the attack link of the network attack can be restored. Figure 2In the target network shown, device C2 launches a brute force attack on device C7. Since device C2 will establish a large number of network connections with C7 during the attack, the network domain D2 where the attacker is located, the network domain D4 where the victim is located, and the network domain D0 through which the attack passes will all generate alarms, while the network domains under devices R1 and R3 that the attack did not pass through will not generate alarms. Therefore, the attack links that can be restored for this attack are D2, D0, and D4.

[0161] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A network abnormal state detection method based on multi-domain and multi-level network behavior feature graph, characterized in that: The method consists of two parts: 1) Construction method of multi-domain and multi-level network behavior feature graph: Based on the characteristics of the real network topology structure, the network is divided into different levels and domains, and the network behavior characteristics of each network level and each network domain are extracted to construct the network behavior feature graph; 2) Network anomaly state detection method based on multi-domain and multi-level behavior feature graph: Based on the constructed network behavior feature graph, multiple network anomaly state detection models are trained for different network levels and different network domains by constructing intra-domain losses and inter-domain losses, and the detection results of each network anomaly state detection model are comprehensively analyzed to realize the detection of distributed network threats in a real network environment.

2. The method according to claim 1, characterized in that The method for constructing a multi-domain and multi-level network behavior characteristic graph includes two parts: network grading and domain division, and network behavior characteristic graph construction: (1) Network classification and domain division The network within an organization is divided into different areas according to the functions and uses of network devices. Each area exchanges information with network devices in other areas and on the Internet through internal gateway devices and core routers connected to the gateway devices. The network topology diagram is abstracted into a tree diagram T, where the device R as the root node is the core router, devices R1-R4 are gateway devices in each area, and devices C1-C4 and C5-C6 as leaf nodes are network devices within the area. 1) Network layer definition The network level of a certain network device is defined as the total height of the tree graph T minus the depth of the node corresponding to the network device; 2) Network domain definition If a subtree D in the tree graph T satisfies the following characteristics: a) D is a subtree of T, and its depth is 2; b) All child nodes of the root node of D in T are contained in the subtree D; Then the subtree D is called a network domain; 3) Definition of upper / lower network domains If a network domain D has a network domain D with one of its leaf nodes as the root node L , then D L It is the subordinate network domain of D; If a network domain D has a network domain D with its root node as a leaf node U , then D U is the parent network domain of D; (2) Construction of network behavior feature graph: The network behavior characteristic graph describes the behavior characteristics of the entire network. It is composed of the behavior characteristic graphs of all network domains in the target network. The target network is the network to be detected and analyzed for abnormal status. 1) Network traffic behavior feature vector The network traffic behavior feature vector is a vector containing the statistical characteristics of various traffic, including the total number of data packets, the distribution of data packet sizes, the distribution of data packet arrival time intervals, the total size of transmitted data packets, the difference in the number of forward and reverse data packets, the total number of TCP packets of various types, the total number of DNS protocol packets of various types, and the number of TLS / SSL protocol connections; Define the statistical feature vector merging operator C, for any vector sequence v1,v2,…,v consisting of statistical features q , where each vector is composed of different statistical features, q is a positive integer, then the combined vector v c =C(v1,v2,…,v q ) is a vector v1,v2,…,v q The statistical characteristics of the corresponding elements and; assuming that the statistical characteristic vector consists of three elements: total number, mean, and variance, then for the vector The merged vector are the total number, mean, and variance of the three elements in vector v1. The total number, mean, and variance of the three elements in the vector v2; Statistical characteristics and definitions: For a certain statistical characteristic σ of the data distribution X X and a statistical characteristic σ of the data distribution Y Y , σ X and σ Y The statistical characteristics and are the corresponding statistical characteristics of X∪Y after the two data distributions are merged; the variances of data distributions X and Y are and Then the variance and The statistical characteristics and Where |X|,|Y| represent the calculated variance respectively and The number of samples of data distribution X and Y when ; 2) Network domain traffic matrix In a real network environment, the traffic matrix of a network domain D with k+1 nodes is expressed as: in, represents the network matrix of the network domain D in the sth time interval, represents the network traffic behavior feature vector between device i and device j in the sth time interval, They represent the network traffic behavior feature vectors between device i and the network domain outside network domain D and between the network domain outside network domain D and device j in the sth time interval, respectively, where i, j = 1, 2, …, k; 3) Multi-domain and multi-level network behavior feature map The network domain traffic matrix is ​​regarded as an adjacency matrix to generate a network domain behavior characteristic graph. By grading and domaining the entire network, and establishing a network domain traffic matrix and a network domain behavior characteristic graph for each network, a multi-domain and multi-level network behavior characteristic graph is obtained.

3. The method according to claim 2, characterized in that The network anomaly state detection method based on multi-domain and multi-level network behavior characteristic graph is based on the multi-domain and multi-level network behavior characteristic graph, constructs a distributed network anomaly state detection model, thereby realizing the overall abnormal state detection of the network, and locates multiple network domains with anomalies by comprehensively analyzing the results of each network anomaly state detection model, thereby realizing the restoration of the network attack link to a certain extent.

4. The method according to claim 3, characterized in that The network abnormal state detection method based on multi-domain and multi-level network behavior feature graph comprises the following steps: (1) The target network is divided into different levels and domains to obtain n network domains D1, D2, …D n ; (2) Collect the traffic data of the target network over a period of time, and form n training data sets consisting of network domain traffic matrix sequences based on the network domain division and network traffic behavior feature vectors: … There is no network attack or abnormal behavior in the next period of time, s is the total number of time intervals for collecting data, and the time interval is the pre-defined interval time for each collection of network status, is the i-th network domain D i The network domain traffic matrix in the jth time interval, where is the field of real numbers, V(D i ) is the network domain D i The number of nodes, d is the dimension of the network traffic behavior feature vector, i = 1, 2, ..., n, j = 1, 2, ..., s; (3) For n network domains, determine the prediction step length r and build n prediction models As n network abnormal status detection models: 1) Each prediction model The input data is a network domain D of length r. i The output result is the network domain traffic matrix of the next time interval predicted by the model, where r <s; 2) Each prediction model They are all deep neural network models, consisting of a fully connected network FCN, a long short-term memory network LSTM, and a graph convolutional network GCN, expressed as: in, They represent the fully connected network FCN, the long short-term memory network LSTM, and the graph convolutional network GCN respectively; (4) Using an unsupervised approach to predict n models Conduct training, specifically: 1) For prediction models From the training dataset Take any continuous sequence of length r in Input into the prediction model to get the prediction results Where m = r, r+1,…, s-1; 2) Define matrix processing operators: Row operator and Col operator, the result of Row(M,i) is the i-th row element in the matrix M, and the result of Col(M,j) is the j-th column element in the matrix M; 3) Calculate the prediction model through the loss function The prediction results and the traffic matrix of the network domain in the next time interval The loss in the domain In addition, if network domain D i There are p subordinate network domains And define the set Then the inter-domain loss is calculated as follows: Among them, C is the statistical feature vector merging operator, Row and Col are the row and column operators respectively; The content consists of two parts, one is D i The equipment and The network behavior characteristics between all devices in the network are as follows: i All devices in other subordinate network domains Network behavior characteristics between all devices in the network; The content consists of two parts, one of which is All devices in D i The network behavior characteristics between devices in the All devices in D i The network behavior characteristics between all devices in other subordinate network domains; Indicates network domain D i The network behavior characteristics between the jth device and other devices or the corresponding subordinate network domains; Represents the network behavior characteristics between other devices or corresponding lower-level network domains and the j-th device; If network domain D i If there is no lower-level network domain, the final loss Loss is only the intra-domain loss, Loss = Loss1; if there is a lower-level network domain, the final loss is the sum of the intra-domain loss and the inter-domain loss Loss = Loss1 + Loss2; 3) Minimize the final loss calculated in step 2), perform back propagation, and update the prediction model Parameters; 4) Repeat steps 1) to 3) until the prediction model is convergence; (5) Determine the abnormal state detection threshold ε, and train the n prediction models after convergence. Deploy to each network domain D i The root node of the network is used to calculate the current network state predicted by the prediction model through the loss function Loss. The actual network status The difference between like It is considered that network domain D i Currently in an abnormal state, otherwise it is considered that the network domain D i Currently in normal state; For the anomaly detection results of n network domains, the network domains in abnormal state are associated according to the superior-subordinate relationship between the network domains, and the network attack link is restored.

5. The method according to claim 2, characterized in that In the network domain traffic matrix, the network traffic behavior feature vector of a leaf node covers the network traffic behavior feature vectors between each device in its subordinate network domain and all devices in other network domains.

6. The method according to claim 4, characterized in that The inter-domain loss describes the difference in prediction results between the two prediction models of the upper network domain and the lower network domain. The purpose is to correct the prediction results of the upper network domain through the prediction results of the lower network domain.

7. The method according to claim 4, characterized in that The loss functions L1 and L2 are selected from the mean square error loss function and the cross entropy loss function.

8. The method according to any one of claims 1 to 7, characterized in that: The method is applied in the field of network security technology.

9. A system for implementing the method according to any one of claims 1 to 7.

10. The system according to claim 9, characterized in that: The system is applied in the field of network security technology.