A network attack threat analysis method and system based on knowledge graph
Through a knowledge graph-based method, entity recognition and tensor decomposition technology are used to construct a lightweight knowledge graph, combined with real-time network data analysis, to solve the problem of being unable to discover hidden threats and process new threat data in advance in the existing technology, and achieve high efficiency. The ability to identify unknown threats.
Patent Information
- Application Number
- CN202410262372.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-03-07
AI Technical Summary
Existing network attack threat analysis is limited by the knowledge limitations of annotators, cannot detect hidden threats in advance, and cannot effectively process new threat data.
Adopt a knowledge graph-based method to extract entity relationships through entity recognition, tensor decomposition and cosine similarity, build a lightweight knowledge graph, conduct threat path analysis based on real-time network data, use association weights to measure the threat level of the propagation path, and identify new Unknown threat.
It avoids the knowledge limitations of manual annotation, improves the accuracy and efficiency of identifying unknown threat data, reduces the complexity of threat data identification, and can proactively identify new unknown threats.
Smart Images

Figure CN118157939B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a network attack threat analysis method and system based on knowledge graph. Background Art
[0002] Cyber attacks refer to the use of computer networks or network technologies to damage, steal, tamper with or interfere with network systems, equipment or data through unauthorized or malicious means. Such behavior may be initiated by hackers, malware, network viruses and other attackers to obtain confidential information, disrupt system operations, obtain illegal benefits or carry out other improper behaviors.
[0003] Cyber attack threat analysis is the process of systematically analyzing and evaluating the various potential threats and risks facing network systems. This analysis usually involves identifying and analyzing the possible attack paths, threat sources, attacker behavior patterns, and possible impacts of attacks. Through threat analysis, the security of network systems can be evaluated, potential security vulnerabilities and weaknesses can be identified, and appropriate defensive measures can be taken to address them. Threat analysis can also help organizations understand the current security threat situation, promptly detect and respond to emerging threats and attack behaviors, and ensure the security and stable operation of network systems.
[0004] Current network attack threat analysis focuses on existing threat databases and is unable to process new threat data. In addition, network threat paths are mostly manually labeled based on existing information. This results in existing threat analysis solutions being limited by the knowledge limitations of labelers and unable to detect hidden threats in advance. Summary of the invention
[0005] In order to solve the technical problems in the prior art that network attack threat analysis is limited by the knowledge limitations of labelers and cannot discover hidden threats in advance, and cannot process new threat data, the present invention provides a network attack threat analysis method and system based on knowledge graph.
[0006] The technical solution provided by the embodiment of the present invention is as follows:
[0007] First aspect
[0008] An embodiment of the present invention provides a network attack threat analysis method based on a knowledge graph, comprising:
[0009] S1: Obtain network operation data;
[0010] S2: Perform entity recognition and entity attribute extraction on network operation data, perform tensor decomposition on entities and entity attributes, and extract entity relationships from the entities and entity attributes after tensor decomposition using cosine similarity;
[0011] S3: Construct a lightweight knowledge graph by combining entities, entity attributes, and entity relationships;
[0012] S4: Get real-time network data;
[0013] S5: Input the real-time network data into the lightweight knowledge graph as input data and output the propagation path;
[0014] S6: Determine whether there is a propagation path and a subpath of the propagation path in the lightweight knowledge graph. If so, output the propagation path as a dangerous path and enter S9. Otherwise, enter S7, where a subpath is an edge between any two nodes in the propagation path.
[0015] S7: According to the lightweight knowledge graph, the propagation path is associated with reasoning, and the association weights and values between the propagation path and each path in the lightweight knowledge graph are calculated;
[0016] S8: when the association weight and value are greater than the preset association weight and value, outputting the propagation path as a dangerous path;
[0017] S9: Provide early warning of dangerous paths.
[0018] Second aspect
[0019] An embodiment of the present invention provides a network attack threat analysis system based on a knowledge graph, comprising:
[0020] processor;
[0021] A memory having computer-readable instructions stored thereon, which, when executed by a processor, implements the knowledge graph-based network attack threat analysis method of the first aspect.
[0022] The third aspect
[0023] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the knowledge graph-based network attack threat analysis method as described in the first aspect is implemented.
[0024] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0025] In the present invention, the basic element entities, entity attributes and entity relationships of the knowledge graph are extracted by combining tensor decomposition technology and cosine similarity, and the high-dimensional tensor is decomposed into multiple low-dimensional tensors, so as to find the structure and pattern hidden in the data, analyze the hidden threats based on the existing threats, avoid the knowledge limitations of manual annotation, and use the associated weights and values to quantify the new propagation paths, measure the threat level of the propagation paths, and then actively identify new unknown threat data, and improve the recognition accuracy of unknown data. In addition, the use of lightweight knowledge graphs reduces the recognition complexity of threat data, while ensuring the accuracy of threat data recognition, it improves the efficiency of threat data recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A schematic diagram of a flow chart of a network attack threat analysis method based on a knowledge graph provided in an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the structure of a network attack threat analysis system based on a knowledge graph provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0030] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0031] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0032] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0033] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0034] Reference Manual Attached Figure 1 , showing a flow chart of a network attack threat analysis method based on knowledge graph provided in an embodiment of the present invention.
[0035] The embodiment of the present invention provides a network attack threat analysis method based on a knowledge graph, which can be implemented by a network attack threat analysis device based on a knowledge graph, and the network attack threat analysis device based on a knowledge graph can be a terminal or a server. The processing flow of the network attack threat analysis method based on a knowledge graph may include the following steps:
[0036] S1: Obtain network operation data.
[0037] In a possible implementation, the network operation data includes structured data, semi-structured data, and unstructured data.
[0038] Among them, structured data (such as information in databases), semi-structured data (such as web page content, documents) and unstructured data (such as text, images, audio, etc.) can come from various sources, such as the Internet, internal company systems, open data sources, etc., including various existing network attack threat data. These data can come from various sources, such as the Internet, internal company systems or open data sources. These data contain various network activities and possible network attack threat information. By collecting and analyzing them, we can better understand the network operation status and potential security risks.
[0039] In a possible implementation manner, after S1, the following steps are further included:
[0040] S1A: Preprocess the network operation data and obtain preprocessed data.
[0041] Among them, preprocessing includes data cleaning, data integration, data conversion and data loading.
[0042] It should be noted that the preprocessing of the acquired network operation data includes steps such as data cleaning, data integration, data conversion and data loading. For example, for network data from different data sources, data cleaning is first performed to delete duplicate, missing or erroneous data; then data integration is performed to integrate data from different sources into a unified data model; then data conversion is performed to convert the data format into a form suitable for analysis; finally, data loading is performed to load the processed data into the corresponding storage system or database for subsequent analysis and processing. This improves the quality and consistency of the data, enhances the availability and reliability of the data, and provides a more accurate and reliable data foundation for subsequent network attack threat analysis, thereby improving the efficiency of analysis and the support capability of decision-making.
[0043] S2: Perform entity recognition and entity attribute extraction on network operation data, perform tensor decomposition on entities and entity attributes, and extract entity relationships from the entities and entity attributes after tensor decomposition using cosine similarity.
[0044] Among them, tensor decomposition is a common data analysis method that can decompose high-dimensional tensors into multiple low-dimensional tensors to find structures and patterns hidden in the data. In the entity relationship extraction task, entities and entity attributes can be represented in tensor form, and then tensor decomposition methods (such as singular value decomposition, tensor decomposition machine, etc.) can be used to extract the relationship between entities. By representing entities and entity attributes in tensor form and performing tensor decomposition, potential semantic structures and patterns can be discovered, thereby assisting the entity relationship extraction task, and further improving the fine-grained recognition and identification accuracy of network attack threats based on the knowledge graph constructed based on the entity relationship.
[0045] Specifically, a three-dimensional tensor can be constructed, in which one dimension represents the entity and the other two dimensions represent the entity attributes. Then, through tensor decomposition, low-dimensional entity representations and entity attribute representations can be obtained, which can help us understand the relationship between entities and the interaction between attributes. The advantage of this method is that it can use the association information between entities and entity attributes to extract relationships, thereby improving the performance and effect of the model.
[0046] In a possible implementation, S2 specifically includes:
[0047] S201: Perform entity recognition and entity attribute extraction on network operation data through machine learning algorithms.
[0048] Specifically, commonly used knowledge extraction methods are those based on machine learning. Machine learning algorithms can be support vector machines, conditional random fields, or deep learning models (such as recurrent neural networks, convolutional neural networks, etc.). These methods can learn patterns and rules from a large number of labeled samples, and perform accurate entity extraction and attribute extraction on new data.
[0049] S202: Vectorize entities and entity attributes:
[0050]
[0051] Among them, E de represents the entity matrix of dimension de after vectorization, v i ,i=1,2,…,n represents the i-th entity vector, A da represents the entity attribute matrix with dimension da after vectorization, u j ,j=1,2,…,m represents the jth entity attribute vector.
[0052] S203: Combined with the random projection principle, tensor decomposition is performed on the entity vector and the entity attribute vector respectively to obtain an entity tensor including multiple fine-grained entity vectors and an entity attribute tensor including multiple fine-grained entity attribute vectors:
[0053] T e =E de ×P e
[0054]
[0055] T e ≈U e ×Σ e ×V e T
[0056] T a =A da ×P a
[0057]
[0058] Among them, T e and T a They represent the entity tensor and entity attribute tensor decomposed by combining the random projection principle, P e [i,j] and P a [i,j] respectively represent the first Gaussian projection matrix and the second Gaussian projection matrix with i rows and j columns. The symbol “~” indicates compliance. represents the standard normal distribution, ‖P e[:,j]‖2 represents the bi-norm of the j-th column in the first Gaussian projection matrix, ‖P a [:,j]‖2 represents the bi-norm of the j-th column in the second Gaussian projection matrix. The symbol “:” means taking all row elements. e and U a Denote the left singular matrices of the entity matrix and entity attribute matrix, V e and V a Represent the right singular matrices of the entity matrix and entity attribute matrix, Σ e and Σ e Denotes the diagonal matrices containing singular values on the diagonal of the entity matrix and entity attribute matrix respectively, and the symbol “T” indicates transpose.
[0059] It should be noted that the random projection method projects the original tensor onto a low-dimensional subspace and then decomposes it on the subspace. The random projection method can usually significantly reduce the computational complexity and can be used to decompose large tensors and reduce the time it takes to build a knowledge graph. During the tensor decomposition process, high-dimensional original vectors are mapped to a low-dimensional subspace that represents the location of entities and entity attributes in a more abstract and compact space. This representation makes the relationship between entities and entity attributes clearer and more explainable, while also reducing the complexity of data storage and processing.
[0060] S204: Combine the decomposed fine-grained entity attribute vectors and calculate the cosine similarity between the decomposed fine-grained entity vectors:
[0061]
[0062] Among them, e ik ,e jk denotes the fine-grained entity vector on the kth dimension in the i-th entity tensor and the fine-grained entity vector on the kth dimension in the j-th entity vector, respectively. ik ,a jk Respectively denote the i-th entity attribute vector corresponding to the fine-grained entity vector in the i-th entity tensor on the k-th dimension, denote the j-th entity attribute vector corresponding to the fine-grained entity vector in the j-th entity tensor on the k-th dimension, K denotes the maximum dimension, the symbol “|| ||” denotes the modulus of the vector, and the symbol “·” denotes the dot product operation;
[0063] It should be noted that through the cosine similarity method, in the process of each knowledge graph update, the intervention of artificial intelligence algorithms with huge resource consumption is avoided. Instead, tensor decomposition and cosine similarity are combined to utilize the extremely low-complexity cosine similarity operation. While ensuring the accuracy of entity relationship extraction, the complexity of the entity relationship extraction process is reduced, and the processing efficiency of the solution is improved to cope with high-timeliness network attack threat analysis.
[0064] S205: When the cosine similarity is greater than a preset cosine similarity, the entities corresponding to the entity tensors are connected to complete the entity relationship extraction between the entities.
[0065] It should be noted that those skilled in the art can set the size of the preset cosine similarity according to actual needs, and the present invention is not limited here. Specifically, a smaller preset cosine similarity can be set to discover more possible hidden threats, and then lightweight it to complete the construction of a high-quality knowledge graph.
[0066] S3: Build a lightweight knowledge graph by combining entities, entity attributes, and entity relationships.
[0067] Among them, lightweight knowledge graph refers to simplifying, optimizing and streamlining complex knowledge graphs to reduce their storage space and computing resource consumption, and improve the query efficiency and processing speed of the graph. The purpose of building a lightweight knowledge graph is to better utilize the information in the knowledge graph and provide more efficient graph query and analysis functions.
[0068] In a possible implementation, S3 specifically includes:
[0069] S301: Establish a primary knowledge graph by taking entities as nodes, entity relationships as edges, and entity attributes as values.
[0070] S302: Introduce node degree, node clustering coefficient and node betweenness centrality to comprehensively evaluate node core value and edge core value.
[0071] In a possible implementation, S302 specifically includes:
[0072] S302A: Calculate the node degree, node clustering coefficient and node betweenness centrality for each node:
[0073]
[0074] Among them, Degree(z) represents the degree of node z, δ(z,e) represents the indicator function, ClusteringCoefficient(z) represents the node clustering coefficient of node z, E(z) represents the set of edges between neighbor nodes of node z, N(z) represents the set of neighbor nodes of node z, BetweennessCentrality(z) represents the node betweenness centrality of node z, σ st represents the number of all paths from node s to node t, σ st (z) represents the number of paths from node s to node t that pass through node z;
[0075] S302B: Calculate the node core value and edge core value according to the node degree, node clustering coefficient and node betweenness centrality, as well as the corresponding weight coefficients:
[0076]
[0077] EdgeCoreness(e)=Coreness(z1)+Coreness(z2)
[0078] Among them, Coreness(z) represents the node coreness value, EdgeCoreness(e) represents the edge coreness value, and z1 and z2 represent the connected nodes of edge e.
[0079] S303: Combine the node core value and the edge core value to select the core nodes and core edges.
[0080] In a possible implementation manner, the core nodes and core edges are screened by using the Louvain algorithm, and S303 specifically includes:
[0081] S303A: Treat each node as an independent community;
[0082] S303B: Calculate the new community modularity of each node after it moves to the adjacent community and the old community modularity before it moves to the adjacent community, and calculate the community modularity gain based on the new community modularity and the old community modularity:
[0083]
[0084] △Q=Q new -Q old
[0085] Among them, A ij represents the weight of the edge between node i and node j, k i ,k j They represent the degree of node i and node j, that is, the number of neighbor nodes of node i and node j, m represents the sum of the weights of all edges, δ c (ci ,c j ) represents the community indicator function, Q new Indicates that node i moves to the adjacent community c j The new community modularity after Q old Indicates that node i has not moved to the adjacent community c j The old community modularity, △Q represents the community modularity gain;
[0086] Among them, modularity is an indicator to measure the quality of the community structure in a graph. It describes the degree of difference between a graph with a given community structure and a random network. Modularity gain is an important indicator used in community detection algorithms to measure the change in modularity caused by moving a node from one community to another. In community detection algorithms, modularity is an indicator to measure the community structure in a network graph. It describes the difference between the connection of the actual edges in the network graph and the connection of the random network model. Specifically, modularity quantifies the difference between the connection pattern of the actual edges in the network and the expected connection pattern. The larger the modularity, the better the community structure in the graph, and the greater the difference compared with the random network. In the Louvain algorithm, the goal is to maximize the modularity to obtain a better community structure.
[0087] In addition, the length and value of the edge are ignored, and the weight of the edge between nodes i and j is quantized to 1, thereby retaining more useful information, avoiding the overfitting problem caused by the lightweight process, and improving the usability of the lightweight knowledge graph and the accuracy of network attack threats.
[0088] S303C: Move nodes in the primary knowledge graph into adjacent communities with the maximum modularity gain as the constraint;
[0089] S303D: Repeat S303A-S303C until the modularity gain remains unchanged and multiple fusion communities, i.e., core nodes obtained after screening, are obtained;
[0090] S303E: Remove the edges without connected objects from the primary knowledge graph to obtain the core edges.
[0091] S304: retain the core nodes and core edges, complete the lightweighting of the primary knowledge graph, and obtain a lightweight knowledge graph.
[0092] It should be noted that this solution comprehensively considers entities, entity attributes and entity relationships, and by establishing a primary knowledge graph, the lightweight process is more comprehensive and accurate. The degree, clustering coefficient and betweenness centrality of the node evaluate the coreness of the node, so that the core nodes and edges can be selected more accurately in the lightweight process. By introducing indicators such as the degree, clustering coefficient and betweenness centrality of the node, the core value of the node and the edge can be better evaluated, thereby retaining the core information of the graph in the lightweight process. This ensures that the lightweight knowledge graph can still maintain the key structure and important information of the original graph. The Louvain algorithm can select core nodes and core edges while ensuring efficiency, and can select according to the core values of nodes and edges, further improving the accuracy and efficiency of the lightweight process. Through the lightweight process, the primary knowledge graph is simplified into a lightweight knowledge graph, reducing the complexity and storage space of the graph, making subsequent graph analysis and application more efficient and convenient. While retaining the core information, the lightweight process also minimizes unnecessary redundancy and noise, maintaining the integrity and accuracy of the knowledge graph.
[0093] In summary, this solution can better achieve the lightweight of the primary knowledge graph, while retaining the key information and structure of the graph, and improving the efficiency of graph analysis and application. While ensuring the integrity of the primary knowledge graph, the graph structure is minimized to the greatest extent, reducing the complexity of the knowledge graph in the actual network attack analysis process.
[0094] S4: Get real-time network data.
[0095] Among them, real-time network data includes network traffic, log information, event records, etc. The purpose of obtaining real-time network data is to capture the current network status and activity and provide it for subsequent analysis and processing steps.
[0096] S5: Input the real-time network data into the lightweight knowledge graph as input data and output the propagation path.
[0097] Specifically, real-time network data is input into the lightweight knowledge graph as input data, and the propagation path is output. In this step, real-time network data is input into the lightweight knowledge graph that has been constructed in advance, and the system identifies possible propagation paths based on the input data. The propagation path is the path along which information, attacks, or other events propagate between nodes in the network. By combining real-time data with the knowledge graph, the system is able to analyze possible propagation paths in the network.
[0098] S6: Determine whether there is a propagation path and a sub-path of the propagation path in the lightweight knowledge graph. If so, output the propagation path as a dangerous path and enter S9. Otherwise, enter S7, where the sub-path is the edge between any two nodes in the propagation path.
[0099] Specifically, first check whether there is a propagation path or a subpath of the propagation path that matches the real-time network data in the lightweight knowledge graph. The propagation path refers to the path for information, attacks or other events to propagate between nodes in the network, and the subpath is the edge between any two nodes in the propagation path. If a propagation path or a subpath of the propagation path that matches the real-time network data is found in the lightweight knowledge graph, the system identifies these paths as dangerous paths, outputs them as a result, and enters the next step S9 to perform relevant early warning or treatment measures. If a propagation path or a subpath of the propagation path that matches the real-time network data is not found in the lightweight knowledge graph, the system will continue to execute the next step S7 for further processing and analysis. By inputting real-time network data into the lightweight knowledge graph and checking the propagation path, the system can monitor potential threats or abnormal behaviors in the network in real time. Once a propagation path matching a known threat or attack behavior is found, the system immediately identifies it as a dangerous path and triggers the corresponding warning mechanism so that network administrators can take timely action to avoid the waste of computing resources caused by repeated data identification and improve the speed of threat data identification.
[0100] S7: According to the lightweight knowledge graph, the propagation path is associated with reasoning, and the association weights and values between the propagation path and each path in the lightweight knowledge graph are calculated.
[0101] Among them, the association weight and value here refers to the measurement of the degree of association between the propagation path and each path in the lightweight knowledge graph. Specifically, the association weight and value are used to measure the correlation or similarity between the propagation path and the path in the knowledge graph. By quantifying the degree of association between the propagation path and the path in the knowledge graph, the potential threat of the propagation path can be more accurately evaluated, and effective threat assessment and risk management can be carried out. This real-time monitoring method can detect potential threats in a timely manner, improve the real-time and flexibility of network security, and comprehensively consider the association weights and values of multiple paths, avoiding the limitations of a single indicator or path, thereby improving the comprehensiveness and accuracy of security analysis.
[0102] In a possible implementation, S7 specifically includes:
[0103] S701: sort all nodes in the propagation path and the lightweight knowledge graph according to the order of the nodes in the lightweight knowledge graph to obtain a sorted node sequence;
[0104] S702: Calculate the ranking of each node in the node sequence in the propagation path and the lightweight knowledge graph;
[0105] S703: Calculate the ranking difference between the same node in the propagation path and the path in the lightweight knowledge graph:
[0106] d i=|R(P)-R(P i )|
[0107] Among them, d i represents the ranking difference value, R(P), R(P i ) represent the same node in the propagation path P and the path P in the lightweight knowledge graph respectively. i Ranking in
[0108] S704: Combine the ranking difference values and calculate the Spearman rank correlation coefficient between the propagation path and each path in the lightweight knowledge graph:
[0109]
[0110] Among them, ρ i represents the Spearman rank correlation coefficient, and n represents the node sequence length of the propagation path.
[0111] Among them, the Spearman rank correlation coefficient is a non-parametric method used to measure the correlation between two variables. It is applicable to continuous or ordered data and does not require the data to be normally distributed. In the analysis of the propagation path and each path in the lightweight knowledge graph, the Spearman rank correlation coefficient is used to evaluate the degree of association between the propagation path and each lightweight knowledge graph path. Using the Spearman rank correlation coefficient as an influencing factor for similarity calculation can more accurately evaluate the degree of association between the propagation path and each path in the lightweight knowledge graph. All existing paths in the lightweight knowledge graph are dangerous paths. By calculating the association weights and values between the propagation path and each path in the lightweight knowledge graph, the probability of the propagation path turning into a dangerous path can be evaluated. The greater the association weight and value, the greater the probability of turning into a dangerous path.
[0112] S705: Using the Spearman rank correlation coefficient as the correlation factor, calculate the path similarity between the propagation path and each path in the lightweight knowledge graph, and output the path similarity as the correlation weight and value:
[0113]
[0114] Among them, s in (P,P i ) represents the association weight and value, I represents the total number of paths in the lightweight knowledge graph, and P j represents the feature vector of the propagation path in the jth dimension, P i,j represents the feature vector of the i-th path in the lightweight knowledge graph in the j-th dimension, and J represents the feature vector dimension.
[0115] It should be noted that by sorting the nodes in the propagation path and the knowledge graph and calculating the ranking of the nodes in the path, the importance of the nodes in the path and the similarity between the paths can be effectively compared, which is helpful to discover potential threat paths. Using the Spearman rank correlation coefficient as the correlation factor, the degree of association between the propagation path and each path in the knowledge graph can be more accurately measured, thereby improving the calculation accuracy of the path similarity. By calculating the path similarity and outputting it as the association weight and value, the degree of association between the propagation path and each path in the knowledge graph can be quantified, providing a quantitative indicator and basis for network threat analysis. Each step of this method has a clear explanation and calculation process, so the result is highly interpretable, which helps analysts understand and interpret the analysis results, so as to better formulate response strategies. This method does not depend on a specific network structure or threat type, so it has strong versatility and applicability, and can be applied to various network environments and threat scenarios. Through the steps of node sorting, Spearman rank correlation coefficient calculation and path similarity calculation, the degree of association between the propagation path and the lightweight knowledge graph can be effectively analyzed.
[0116] S8: When the associated weight and value is greater than the preset associated weight and value, the propagation path is output as a dangerous path.
[0117] It should be noted that those skilled in the art can set the size of the preset association weight and value according to actual needs, and the present invention is not limited here. Specifically, the preset association weight and value can be set according to the security level of the protection device. The higher the security level, the lower the preset association weight and value, so as to monitor more abnormal data as much as possible, improve the security of the device, and reduce the probability of it being attacked by the network.
[0118] S9: Provide early warning of dangerous paths.
[0119] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0120] In the present invention, the basic element entities, entity attributes and entity relationships of the knowledge graph are extracted by combining tensor decomposition technology and cosine similarity, and the high-dimensional tensor is decomposed into multiple low-dimensional tensors, so as to find the structure and pattern hidden in the data, analyze the hidden threats based on the existing threats, avoid the knowledge limitations of manual annotation, and use the associated weights and values to quantify the new propagation paths, measure the threat level of the propagation paths, and then actively identify new unknown threat data, and improve the recognition accuracy of unknown data. In addition, the use of lightweight knowledge graphs reduces the recognition complexity of threat data, while ensuring the accuracy of threat data recognition, it improves the efficiency of threat data recognition.
[0121] Reference Manual Attached Figure 2, showing a structural schematic diagram of a network attack threat analysis system based on knowledge graph provided by the present invention.
[0122] The present invention also provides a network attack threat analysis system 20 based on knowledge graph, which is applied to the above-mentioned network attack threat analysis method based on knowledge graph, including:
[0123] Processor 201;
[0124] The memory 202 stores computer-readable instructions, and when the computer-readable instructions are executed by the processor 201, the network attack threat analysis method based on the knowledge graph as described in the method embodiment is implemented.
[0125] The knowledge graph-based network attack threat analysis system 20 provided by the present invention can execute the above-mentioned knowledge graph-based network attack threat analysis method and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.
[0126] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0127] In the present invention, the basic element entities, entity attributes and entity relationships of the knowledge graph are extracted by combining tensor decomposition technology and cosine similarity, and the high-dimensional tensor is decomposed into multiple low-dimensional tensors, so as to find the structure and pattern hidden in the data, analyze the hidden threats based on the existing threats, avoid the knowledge limitations of manual annotation, and use the associated weights and values to quantify the new propagation paths, measure the threat level of the propagation paths, and then actively identify new unknown threat data, and improve the recognition accuracy of unknown data. In addition, the use of lightweight knowledge graphs reduces the recognition complexity of threat data, while ensuring the accuracy of threat data recognition, it improves the efficiency of threat data recognition.
[0128] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0129] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0130] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0131] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0132] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0133] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0134] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, a network attack threat analysis method based on a knowledge graph as described in the method embodiment is implemented.
[0141] A computer-readable storage medium provided by the present invention can implement the steps and effects of the network attack threat analysis method based on the knowledge graph of the above-mentioned method embodiment. To avoid repetition, the present invention will not go into details.
[0142] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0143] In the present invention, the basic element entities, entity attributes and entity relationships of the knowledge graph are extracted by combining tensor decomposition technology and cosine similarity, and the high-dimensional tensor is decomposed into multiple low-dimensional tensors, so as to find the structure and pattern hidden in the data, analyze the hidden threats based on the existing threats, avoid the knowledge limitations of manual annotation, and use the associated weights and values to quantify the new propagation paths, measure the threat level of the propagation paths, and then actively identify new unknown threat data, and improve the recognition accuracy of unknown data. In addition, the use of lightweight knowledge graphs reduces the recognition complexity of threat data, while ensuring the accuracy of threat data recognition, it improves the efficiency of threat data recognition.
[0144] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0145] Compared with the prior art, the above technical solution has at least the following beneficial effects:
[0146] In the present invention, the light and shadow of the static objects can be optimized based on the light baking technology, and the light streaming of the game animation can be optimized based on the light streaming processing technology, and the screen of the nostalgic online game can be optimized to enhance the attractiveness of the nostalgic online game to new players and enhance the market competitiveness of the nostalgic online game.
[0147] There are a few points to note:
[0148] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.
[0149] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.
[0150] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0151] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A network attack threat analysis method based on knowledge graph, characterized in that: include: S1: Obtain network operation data; S2: performing entity recognition and entity attribute extraction on the network operation data, performing tensor decomposition on the entities and the entity attributes, and extracting entity relationships on the entities and entity attributes after tensor decomposition in combination with cosine similarity; S3: Construct a lightweight knowledge graph by combining the entity, the entity attribute and the entity relationship; S4: Get real-time network data; S5: Input the real-time network data as input data into the lightweight knowledge graph, and output a propagation path; S6: Determine whether the propagation path and the subpath of the propagation path exist in the lightweight knowledge graph. If so, output the propagation path as a dangerous path and enter S9. Otherwise, enter S7, wherein the subpath is an edge between any two nodes in the propagation path. S7: performing association reasoning on the propagation path according to the lightweight knowledge graph, and calculating association weights and values between the propagation path and each path in the lightweight knowledge graph; S8: when the association weight and value are greater than a preset association weight and value, outputting the propagation path as a dangerous path; S9: issuing an early warning for the dangerous path; Wherein, the S2 specifically includes: S201: Performing entity recognition and entity attribute extraction on the network operation data by using a machine learning algorithm; S202: Vectorizing the entity and the entity attributes: Among them, E de represents the entity matrix of dimension de after vectorization, v i ,i=1,2,…,n represents the i-th entity vector, A da represents the entity attribute matrix with dimension da after vectorization, u j ,j=1,2,…,m represents the jth entity attribute vector; S203: Combined with the random projection principle, tensor decomposition is performed on the entity vector and the entity attribute vector respectively to obtain an entity tensor including multiple fine-grained entity vectors and an entity attribute tensor including multiple fine-grained entity attribute vectors: T e =E de ×P e T e ≈U e ×Σ e ×V e T T a =A da ×P a Among them, T e and T a They represent the entity tensor and entity attribute tensor decomposed by combining the random projection principle, P e [i,j] and P a [i,j] respectively represent the first Gaussian projection matrix and the second Gaussian projection matrix with i rows and j columns. The symbol "~" indicates compliance. represents the standard normal distribution, ‖P e [:,j]‖2 represents the bi-norm of the jth column in the first Gaussian projection matrix, ‖P a [:,j]‖2 represents the bi-norm of the j-th column in the second Gaussian projection matrix. The symbol ":" means taking all row elements. e and U a Respectively represent the left singular matrices of the entity matrix and the entity attribute matrix, V e and V a denote the right singular matrices of the entity matrix and the entity attribute matrix, Σ e and Σ e denote diagonal matrices containing singular values on the diagonals of the entity matrix and the entity attribute matrix, respectively, and the symbol "T" denotes transposition; S204: Combine the decomposed fine-grained entity attribute vectors and calculate the cosine similarity between the decomposed fine-grained entity vectors: Among them, e ik ,e jk denotes the fine-grained entity vector on the kth dimension in the i-th entity tensor and the fine-grained entity vector on the kth dimension in the j-th entity vector, respectively. ik ,a jk Respectively denote the i-th entity attribute vector corresponding to the fine-grained entity vector in the i-th entity tensor on the k-th dimension, denote the j-th entity attribute vector corresponding to the fine-grained entity vector in the j-th entity tensor on the k-th dimension, K denotes the maximum dimension, the symbol "|| ||" denotes the modulus of the vector, and the symbol "·" denotes the dot product operation; S205: When the cosine similarity is greater than a preset cosine similarity, entities corresponding to the entity tensors are connected to complete entity relationship extraction between entities.
2. The network attack threat analysis method based on knowledge graph according to claim 1 is characterized in that: The network operation data includes structured data, semi-structured data and unstructured data.
3. The network attack threat analysis method based on knowledge graph according to claim 1 is characterized in that: After S1, the following is also included: S1A: Preprocess the network operation data to obtain preprocessed data, wherein the preprocessing includes data cleaning, data integration, data conversion and data loading.
4. The network attack threat analysis method based on knowledge graph according to claim 1 is characterized in that: The S3 specifically includes: S301: Establish a primary knowledge graph by taking the entity as a node, the entity relationship as an edge, and the entity attribute as a value; S302: Introducing node degree, node clustering coefficient and node betweenness centrality to comprehensively evaluate node core value and edge core value; S303: Filter core nodes and core edges by combining the node core value and the edge core value; S304: retain the core nodes and the core edges, complete the lightweighting of the primary knowledge graph, and obtain the lightweight knowledge graph.
5. The network attack threat analysis method based on knowledge graph according to claim 4 is characterized in that: The S302 specifically includes: S302A: Calculate the node degree, node clustering coefficient and node betweenness centrality for each node: Among them, Degree(z) represents the degree of node z, δ(z,e) represents the indicator function, ClusteringCoefficient(z) represents the node clustering coefficient of node z, E(z) represents the set of edges between neighbor nodes of node z, N(z) represents the set of neighbor nodes of node z, BetweennessCentrality(z) represents the node betweenness centrality of node z, σ st represents the number of all paths from node s to node t, σ st (z) represents the number of paths from node s to node t that pass through node z; S302B: Calculate the node core value and edge core value according to the node degree, the node clustering coefficient and the node betweenness centrality, and the corresponding weight coefficients: EdgeCoreness(e)=Coreness(z1)+Coreness(z2) Among them, Coreness(z) represents the node coreness value, EdgeCoreness(e) represents the edge coreness value, and z1 and z2 represent the connection nodes of edge e.
6. The network attack threat analysis method based on knowledge graph according to claim 4 is characterized in that: The core nodes and the core edges are screened by the Louvain algorithm, and S303 specifically includes: S303A: Treat each node as an independent community; S303B: Calculate the new community modularity of each node after it moves to the adjacent community and the old community modularity before it moves to the adjacent community, and calculate the community modularity gain based on the new community modularity and the old community modularity: △Q=Q new -Q old Among them, A ij represents the weight of the edge between node i and node j, k i ,k j They represent the degree of node i and node j, that is, the number of neighbor nodes of node i and node j, m represents the sum of the weights of all edges, δ c (c i ,c j ) represents the community indicator function, Q new Indicates that node i moves to the adjacent community c j The new community modularity after Q old Indicates that node i has not moved to the adjacent community c j The old community modularity, △Q represents the community modularity gain; S303C: moving nodes in the primary knowledge graph into adjacent communities with the maximum modularity gain as a constraint; S303D: repeat S303A-S303C until the modularity gain remains unchanged, and multiple fusion communities, i.e., core nodes obtained after screening, are obtained; S303E: Remove edges without connected objects from the primary knowledge graph to obtain the core edges.
7. The network attack threat analysis method based on knowledge graph according to claim 1 is characterized in that: The S7 specifically includes: S701: sorting all nodes in the propagation path and the lightweight knowledge graph according to the order of the nodes in the lightweight knowledge graph to obtain a sorted node sequence; S702: Calculate the ranking of each node in the node sequence in the propagation path and the lightweight knowledge graph; S703: Calculate the ranking difference value of the same node in the propagation path and the path in the lightweight knowledge graph: d i =|R(P)-R(P i )| Among them, d i represents the ranking difference value, R(P), R(P i ) represent the path P of the same node in the propagation path P and the lightweight knowledge graph respectively. i Ranking in S704: Calculate the Spearman rank correlation coefficient between the propagation path and each path in the lightweight knowledge graph in combination with the ranking difference value: Among them, ρ i represents the Spearman rank correlation coefficient, and n represents the node sequence length of the propagation path; S705: Using the Spearman rank correlation coefficient as a correlation factor, calculating the path similarity between the propagation path and each path in the lightweight knowledge graph, and outputting the path similarity as a correlation weight and value: Among them, s in (P,P i ) represents the association weight and value, I represents the total number of paths in the lightweight knowledge graph, P j represents the feature vector of the propagation path in the jth dimension, P i,j represents the feature vector of the i-th path in the lightweight knowledge graph in the j-th dimension, and J represents the feature vector dimension.
8. A network attack threat analysis system based on knowledge graph, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the knowledge graph-based network attack threat analysis method as described in any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the knowledge graph-based network attack threat analysis method as described in any one of claims 1 to 7 is implemented.
