Network anomaly detection method and device, equipment, storage medium and product
By constructing a fully connected graph and deep learning model combined with cluster analysis, and using support vector machine classifiers, the problem of low network anomaly detection accuracy in the existing technology is solved, and efficient detection and early warning of network anomalies are achieved.
Patent Information
- Application Number
- CN202410920208.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-20
AI Technical Summary
Existing multivariate time series anomaly detection methods have low detection accuracy for network anomalies, especially when normal network activities exhibit significantly different sequence patterns and sparse anomalies.
Construct a fully connected graph of the network to be tested, use a deep learning model to obtain the graph embedding of nodes, perform cluster analysis, and train and predict the network status through a support vector machine classifier to improve the detection accuracy of abnormal events.
It significantly improves the detection accuracy of abnormal network events, ensures the stability and security of network operations, and can effectively prevent and quickly respond to potential threats.
Smart Images

Figure CN118677685A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of network detection technology, and in particular, relates to a network anomaly detection method, device, equipment, storage medium and product. Background Art
[0002] Nowadays, many network management companies collect a large amount of data logs to measure and monitor the status of devices (e.g., routers, switches), interfaces (e.g., local area network (LAN) or wide area network (WAN)) in the network. A network usually consists of multiple devices, each of which has some interfaces, for example, SDWAN devices have LAN and WAN interfaces. Each interface is measured by multiple indicators or attributes, such as the number of in / out octets and the number of in / out unicast packets, which describe the multivariate time series of network operations or activities.
[0003] Large network logs record multivariate time series generated by heterogeneous devices and sensors in the network, which can often reveal important information about abnormal activities, such as network intrusions and equipment failures. Existing machine learning methods for anomaly detection in multivariate time series usually assume that 1) normal sequences have consistent behavior for training unsupervised models, or 2) a large number of labeled normal and abnormal sequences are required for supervised models. However, in practice, normal network activities can exhibit significantly different sequence patterns (e.g., before and after rerouting part of the network traffic). In addition, the recorded abnormal events can be sparse. Therefore, existing anomaly detection methods have low detection accuracy for abnormal events. Summary of the invention
[0004] The embodiments of the present application provide a network anomaly detection method, apparatus, device and computer storage medium to solve the problem that the existing anomaly detection methods have low detection accuracy for abnormal events.
[0005] In a first aspect, an embodiment of the present application provides a network anomaly detection method, the method comprising:
[0006] Constructing a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested;
[0007] According to the historical network data of the plurality of nodes, a deep learning model is used to obtain a graph embedding of each of the plurality of nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors;
[0008] Cluster the graph embedding of each node to obtain the clustering result;
[0009] Using the clustering results to train a support vector machine classifier to obtain a target model;
[0010] The real-time network data of the network to be tested and the target model are used to perform abnormal prediction on the network to be tested, so as to obtain the network status of the network to be tested.
[0011] In a second aspect, an embodiment of the present application provides a network anomaly detection device, the device comprising:
[0012] A construction module, used to construct a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested;
[0013] An acquisition module, configured to acquire a graph embedding of each of the plurality of nodes using a deep learning model according to historical network data of the plurality of nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors;
[0014] The clustering module is used to cluster the graph embedding of each node to obtain the clustering results;
[0015] A training module, used to train a support vector machine classifier using the clustering results to obtain a target model;
[0016] The prediction module is used to use the real-time network data of the network to be tested and the target model to perform abnormal prediction on the network to be tested, so as to obtain the network status of the network to be tested.
[0017] In a third aspect, an embodiment of the present application provides a terminal device, the device comprising: a processor and a memory storing computer program instructions;
[0018] When the processor executes the computer program instructions, the network anomaly detection method according to the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the network anomaly detection method of the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the network anomaly detection method as in the first aspect.
[0021] The network anomaly detection method provided in the embodiment of the present application constructs a fully connected graph to comprehensively capture the dynamics of network interfaces, integrates a deep learning model to accurately extract complex relationships between nodes, uses cluster analysis to enhance the model's anti-interference ability, and uses a support vector machine classifier to achieve efficient analysis of real-time data. The core of this network anomaly detection method focuses on significantly improving the detection accuracy of abnormal events, ensuring the stability and security of network operation, and effectively preventing and quickly responding to various potential threats. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 It is a flowchart of a network anomaly detection method provided by an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of the process of generating graph embedding provided in an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of the structure of a network anomaly detection device provided in an embodiment of the present application;
[0026] Figure 4 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0029] In order to solve the problems of the prior art, the embodiments of the present application provide a network anomaly detection method, device, equipment, storage medium and product.
[0030] The following first introduces the network anomaly detection method provided in the embodiment of the present application.
[0031] Figure 1 A schematic diagram of a network anomaly detection method flow chart provided by an embodiment of the present application is shown.
[0032] like Figure 1 As shown, the method includes:
[0033] Step 101, constructing a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested;
[0034] In this embodiment, the fully connected graph is represented by G=(V, E), where G represents a graphical representation of the entire network, consisting of a node set V and an edge set E.
[0035] V is a set of nodes, and each node i∈V corresponds to an interface or device in the network. Assuming there are n such interfaces or devices in the network, then |V|=n, which means that the number of elements in V is equal to n.
[0036] E is a set of edges, representing connections between nodes. In a fully connected graph, there is an edge between any two nodes i and j, even though they may not be directly connected in the actual network. This means that E contains the connections between all pairs of nodes in V.
[0037] Step 102, obtaining a graph embedding of each of the multiple nodes using a deep learning model according to the historical network data of the multiple nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors;
[0038] In this embodiment, the historical network data can be represented by a feature vector sequence of length T that changes over time. In this sequence, each time point corresponds to a state of the node, which can contain multiple features, such as temperature, flow, activity level, etc. The length T of the sequence reflects the length of the observed time window or historical records. It should be noted that the historical network data is the historical network data of each node.
[0039] The deep learning model includes a neural network layer (gate-conv layer) and a graph attention layer (GAT layer);
[0040] In one embodiment, obtaining a graph embedding of each of the multiple nodes using a deep learning model according to the historical network data of the multiple nodes includes:
[0041] For each of the multiple nodes, extract features from the historical network data of each node using the neural network layer to obtain a local time feature of each node;
[0042] Determine the spatial relationship between the multiple nodes using the graph attention layer and the local temporal features of each node;
[0043] The local temporal features and the spatial relationship are integrated to obtain the graph embedding.
[0044] In this embodiment, for each node, the local temporal features can be first extracted using the gate-conv layer, and then the spatial relationship of the nodes can be captured using the graph attention layer. Finally, the spatial relationship and local temporal features are integrated into a graph embedding.
[0045] Specifically, in one embodiment, the use of the neural network layer to extract features from the historical network data of each node to obtain the local time features of each node includes:
[0046] Using the one-dimensional convolution in the neural network layer to extract features from the historical network data of each node, to obtain a first feature;
[0047] The first feature is screened using a preset function and a gating mechanism of the neural network layer to obtain the local time feature.
[0048] In this embodiment, refer to Figure 2 , Figure 2 Figure 1 is a flow chart of graph embedding. Apply one-dimensional convolution to the T-length time series of each node to extract the first feature. The convolution kernel size is K, the hidden size is C, and the output is [m,n]∈R (T -K+1)×2Cwhere m and n split the output into two halves with the same hidden size h.
[0049] Then, the GLU in the neural network layer is used as a nonlinear gating mechanism to obtain local temporal features through the element-wise multiplication operation GatedConv(v)=m·σ(n) of m and σ(n), where σ is a sigmoid function used to control which information is related to the temporal features.
[0050] After the Gate-Conv layer, a graph attention layer is introduced to capture the spatial relationship between nodes. This layer uses the output of the gated linear unit as input and calculates the attention score α between nodes. ik , aggregate the information of neighbor nodes and generate the updated node feature vector Vi∈R c .
[0051] Specifically, the above process can be expressed by the first formula:
[0052] GatedConv(v)=m·σ(n)∈R (T-K+1)×(c)
[0053] Among them, m, n are the first features, σ is a function, T is the length of the historical network data, K is the size of the convolution kernel of the one-dimensional convolution, and C is the hidden size of the convolution kernel of the one-dimensional convolution.
[0054] In this embodiment, by using graph representation and embedded learning technology, key patterns and features in network data can be captured, effectively distinguishing normal and abnormal network behaviors. By comprehensively considering the temporal dependencies across time points and the spatial dependencies between nodes, the algorithm can more accurately predict whether the network operation graph sequence will lead to abnormal events, providing more reliable early warning and monitoring capabilities. In addition, a neural network structure based on graph convolution and gated convolution is adopted, combining the processing power and computational efficiency of spatiotemporal information. Compared with traditional methods, this algorithm can be trained and predicted in a shorter time, improving the efficiency and practicality of the algorithm.
[0055] Step 103, clustering the graph embedding of each node to obtain a clustering result;
[0056] Specifically, in an embodiment of the present application, clustering the graph embedding of each node to obtain a clustering result includes:
[0057] Marking the graph embedding of each node for anomalies to obtain a first data set, wherein the first data set includes a marked first sub-data set and an unmarked second sub-data set;
[0058] Determine a contrast center loss using the first sub-dataset, a first cluster center corresponding to the first sub-dataset, and a second cluster center corresponding to the second sub-dataset;
[0059] Determine a cluster assignment probability matrix of the first data set by using the third cluster center of the first data set and the first data set, wherein the cluster assignment probability matrix includes the probability of each data in the first data set being assigned to each cluster;
[0060] determining a cluster-oriented loss using the cluster assignment probabilities;
[0061] The clustering result is determined according to the contrast center loss and the cluster-oriented loss.
[0062] In this embodiment, after obtaining the graph embedding of each node, a part of the graph embedding can be identified to obtain abnormal data and normal data. Then, the abnormal data and normal data are marked to obtain the first sub-dataset E i The remaining graph embeddings are the second sub-dataset.
[0063] After obtaining the first sub-dataset and the second sub-dataset, set the first cluster center C of the first sub-dataset yi And the second cluster center C of the second sub-dataset j .
[0064] The contrast center loss is calculated by the second formula, where the second formula is:
[0065]
[0066] Where LCC is the contrast center loss, Ei is the first sub-dataset, Cyi is the first cluster center, Cj is the second cluster center, and m is the amount of data in the first sub-dataset. ε is a constant used to prevent division by zero and can be set to 1e-6.
[0067] Formally, this method calculates the embedded E i Assigned to μ j The probability of cluster j with centered is:
[0068]
[0069] This method derives an auxiliary distribution (called Q) consisting of high-confidence assignments of the current distribution. The main idea is to emphasize data points with high confidence assignments to ensure cluster purity. The following formula defines the calculation of the auxiliary distribution (P for short):
[0070]
[0071] where q ijThe second power of puts more weight on instances closer to the center, and ∑ i q ij The partitions of are normalized based on cluster size, making the model robust to biased classes. Note that for labeled samples, our method replaces the true distribution with an auxiliary distribution, making the training process proceed in a semi-supervised manner.
[0072] Their distance is measured by calculating the KL divergence. The clustering-oriented loss is defined as:
[0073]
[0074] It can be concluded that the total loss is the sum of the contrast center loss and the KL divergence loss with the hyperparameter λ:
[0075] L=L cc +λ×L KL
[0076] In this embodiment, the clustering structure of normal and abnormal events is learned by contrasting the center loss, and the auxiliary distribution P is used to optimize the clustering assignment to ensure the purity and robustness of the clustering. By adjusting the hyperparameter λ, a balance can be found between intra-class compactness and inter-class separability to achieve effective distinction between normal and abnormal events. This semi-supervised learning method is particularly useful in scenarios where labeled samples are scarce, because it can effectively use limited labeled information to guide the clustering process of unlabeled samples.
[0077] Step 104, training a support vector machine classifier using the clustering result to obtain a target model;
[0078] In this embodiment, after the clustering result is obtained, the clustering result can be used to train a support vector machine, thereby obtaining a target model that can predict network anomalies.
[0079] Step 105 , using the real-time network data of the network to be tested and the target model to perform abnormality prediction on the network to be tested, and obtain the network status of the network to be tested.
[0080] After obtaining the target model, the real-time network data of the network to be tested is input into the target model, so as to predict the network status of the network to be tested through the target model, wherein the real-time network data can be represented in the form of a graph sequence, and the target model can map the judgment result to a binary signal y∈{0,1}, wherein 0 indicates that the network is normal and 1 indicates that the network is abnormal.
[0081] The network anomaly detection method provided in the embodiment of the present application constructs a fully connected graph to comprehensively capture the dynamics of network interfaces, integrates a deep learning model to accurately extract complex relationships between nodes, uses cluster analysis to enhance the model's anti-interference ability, and uses a support vector machine classifier to achieve efficient analysis of real-time data. The core of this network anomaly detection method focuses on significantly improving the detection accuracy of abnormal events, ensuring the stability and security of network operation, and effectively preventing and quickly responding to various potential threats.
[0082] Figure 3 A schematic diagram of the structure of a network anomaly detection device provided by an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0083] Reference Figure 3 , the network anomaly detection device 300 may include:
[0084] A construction module 301 is used to construct a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested;
[0085] An acquisition module 302 is used to acquire a graph embedding of each of the multiple nodes using a deep learning model based on historical network data of the multiple nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors;
[0086] A clustering module 303 is used to cluster the graph embedding of each node to obtain a clustering result;
[0087] A training module, used to train a support vector machine classifier using the clustering results to obtain a target model;
[0088] The prediction module 304 is used to use the real-time network data of the network to be tested and the target model to perform abnormality prediction on the network to be tested, so as to obtain the network status of the network to be tested.
[0089] Optionally, the acquisition module 302 includes:
[0090] An extraction submodule, for extracting features from the historical network data of each node of the plurality of nodes using the neural network layer to obtain a local time feature of each node;
[0091] A first determination submodule, configured to determine the spatial relationship between the plurality of nodes using the graph attention layer and the local temporal features of each node;
[0092] An integration submodule is used to integrate the local temporal features and the spatial relationship to obtain the graph embedding.
[0093] Optionally, the extraction submodule includes:
[0094] An extraction unit, configured to perform feature extraction on the historical network data of each node using the one-dimensional convolution in the neural network layer to obtain a first feature;
[0095] A screening unit is used to screen the first feature by using a preset function and a gating mechanism of the neural network layer to obtain the local time feature.
[0096] Optionally, the extraction submodule is specifically used for:
[0097] By using the first formula, the neural network layer is used to extract features from the historical network data of each node to obtain the local time features of each node;
[0098] The first formula includes:
[0099] GatedConv(v)=m·σ(n)∈R(T-K+1)×(c)
[0100] Among them, m, n are the first features, σ is a function, T is the length of the historical network data, K is the size of the convolution kernel of the one-dimensional convolution, and C is the hidden size of the convolution kernel of the one-dimensional convolution.
[0101] Optionally, the clustering module 303 includes:
[0102] A marking submodule, used for marking the graph embedding of each node for abnormality to obtain a first data set, wherein the first data set includes a marked first sub-data set and an unmarked second sub-data set;
[0103] a second determination submodule, configured to determine a contrast center loss using the first sub-dataset, a first cluster center corresponding to the first sub-dataset, and a second cluster center corresponding to the second sub-dataset;
[0104] A second determination submodule, configured to determine a first data set cluster assignment probability matrix using the third cluster center of the first data set and the first data set, wherein the cluster assignment probability matrix includes a probability of each data in the first data set being assigned to each cluster;
[0105] A third determination submodule, configured to determine a cluster-oriented loss using the cluster assignment probability;
[0106] The fourth determination submodule is used to determine the clustering result according to the contrast center loss and the clustering-oriented loss.
[0107] It should be noted that the network anomaly detection device 300 is a device corresponding to the above-mentioned network anomaly detection method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0108] Figure 4 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application is shown.
[0109] The terminal device may include a processor 401 and a memory 402 storing computer program instructions.
[0110] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0111] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0112] In certain embodiments, the memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0113] The processor 401 implements any one of the network anomaly detection methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0114] In one example, the terminal device may further include a communication interface 404 and a bus 410. Figure 4As shown, the processor 401, the memory 402, and the communication interface 404 are connected via a bus 410 and communicate with each other.
[0115] The communication interface 404 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0116] Bus 410 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0117] In addition, in combination with the network anomaly detection method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the network anomaly detection methods in the above embodiment is implemented.
[0118] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0119] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0120] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0121] Aspects of the present disclosure are described above 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 disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box 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, or other programmable network anomaly detection device to produce a machine so that these instructions executed by the processor of the computer or other programmable network anomaly detection device enable the implementation of the functions / actions specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0122] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A network anomaly detection method, characterized in that: The method comprises: Constructing a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested; According to the historical network data of the plurality of nodes, a deep learning model is used to obtain a graph embedding of each of the plurality of nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors; Cluster the graph embedding of each node to obtain the clustering result; Using the clustering results to train a support vector machine classifier to obtain a target model; The real-time network data of the network to be tested and the target model are used to perform abnormal prediction on the network to be tested, and the network status of the network to be tested is obtained.
2. The network anomaly detection method according to claim 1, characterized in that: The deep learning model includes a neural network layer and a graph attention layer; The step of obtaining a graph embedding of each of the plurality of nodes by using a deep learning model according to the historical network data of the plurality of nodes comprises: For each of the multiple nodes, extract features from the historical network data of each node using the neural network layer to obtain a local time feature of each node; Determine the spatial relationship between the multiple nodes using the graph attention layer and the local temporal features of each node; The local temporal features and the spatial relationship are integrated to obtain the graph embedding.
3. The network anomaly detection method according to claim 2, characterized in that: The utilizing the neural network layer to extract features from the historical network data of each node to obtain the local time features of each node includes: Using the one-dimensional convolution in the neural network layer to extract features from the historical network data of each node, to obtain a first feature; The first feature is screened using a preset function and a gating mechanism of the neural network layer to obtain the local time feature.
4. The network anomaly detection method according to any one of claims 2 to 3, characterized in that: The utilizing the neural network layer to extract features from the historical network data of each node to obtain the local time features of each node includes: By using the first formula, the neural network layer is used to extract features from the historical network data of each node to obtain the local time features of each node; The first formula includes: GatedConv(v)=m·σ(n)∈R(T-K+1)×(c) Among them, m, n are the first features, σ is a function, T is the length of the historical network data, K is the size of the convolution kernel of the one-dimensional convolution, and C is the hidden size of the convolution kernel of the one-dimensional convolution.
5. The network anomaly detection method according to claim 1, characterized in that: The graph embedding of each node is clustered to obtain a clustering result, including: Marking the graph embedding of each node for anomalies to obtain a first data set, wherein the first data set includes a marked first sub-data set and an unmarked second sub-data set; Determine a contrast center loss using the first sub-dataset, a first cluster center corresponding to the first sub-dataset, and a second cluster center corresponding to the second sub-dataset; Determine a cluster assignment probability matrix of the first data set by using the third cluster center of the first data set and the first data set, wherein the cluster assignment probability matrix includes the probability of each data in the first data set being assigned to each cluster; determining a cluster-oriented loss using the cluster assignment probabilities; The clustering result is determined according to the contrast center loss and the cluster-oriented loss.
6. The network anomaly detection method according to claim 5, characterized in that: The contrast center loss is calculated by a second formula; The second formula is: Among them, LCC is the contrast center loss, Ei is the first sub-dataset, Cyi is the first cluster center, Cj is the second cluster center, m is the amount of data in the first sub-dataset, and ε is a constant.
7. A network anomaly detection device, characterized in that: The device comprises: A construction module, used to construct a fully connected graph of the network to be tested, wherein the fully connected graph includes a plurality of nodes, and any two nodes are connected to each other, wherein a node is used to represent an interface in the network to be tested; An acquisition module, configured to acquire a graph embedding of each of the plurality of nodes using a deep learning model according to historical network data of the plurality of nodes, wherein the graph embedding is used to represent a temporal dependency relationship and a spatial relationship between a node and its neighbors; The clustering module is used to cluster the graph embedding of each node to obtain the clustering results; A training module, used to train a support vector machine classifier using the clustering results to obtain a target model; The prediction module is used to use the real-time network data of the network to be tested and the target model to perform abnormal prediction on the network to be tested, so as to obtain the network status of the network to be tested.
8. A terminal device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the network anomaly detection method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the network anomaly detection method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer product includes a computer program, and when the computer program is executed by a processor, the network anomaly detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Cross-domain network quality detection method, device, equipment and computer program product
CN119211068A
