A method, device and storage medium for continuous subgraph matching based on timing constraints
Through the continuous subgraph matching method based on timing constraints, the candidate storage index graph is constructed and filtering rules and status information are used to solve the problem of redundant solution checking in the existing technology that consumes a lot of time and space overhead, and achieve an efficient multi-step attack. detection.
Patent Information
- Application Number
- CN202410061329.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-01-16
AI Technical Summary
Existing continuous subgraph matching algorithms have the problem that redundant solution checking consumes a lot of time and space overhead in multi-step attack detection. In particular, algorithms without timing constraints produce redundant solutions, while timing-constrained algorithms have high index space costs and intermediate costs. The result is high maintenance costs.
Adopt a continuous subgraph matching method based on timing constraints, build a candidate storage index graph, use filtering rules and status information to determine node matching, reduce the search space, avoid Cartesian product operations, and introduce a merge strategy to reduce duplicate edge overhead, only when necessary Perform a backtracking search.
It effectively reduces the number of redundant solutions, reduces search overhead, reduces index space overhead, and improves matching efficiency. It has a significant acceleration effect especially when processing many repeated edges.
Smart Images

Figure CN118113756B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a method, device and storage medium for continuous subgraph matching based on timing constraints. Background Art
[0002] In the field of cyberspace security, an important task is multi-step attack detection. When an attacker implements a multi-step attack event, he needs to complete a number of fixed single-step attack behaviors. Through time and space constraints, he establishes the correlation between attack events and forms an attack detection template containing multiple security event entities. In attack detection, there are more and more cyberspace security events generated based on real-time data. These security events themselves are a large graph, in which the vertices can be security event entities and the edges are the relationships between security event entities. Detecting multi-step attack events on this graph can be accomplished using subgraph matching technology, that is, querying isomorphic subgraphs in the security event graph. The so-called isomorphic subgraphs refer to subgraphs with one-to-one correspondence between topological structures and vertex labels.
[0003] A series of persistent subgraph matching algorithms have been proposed in the past. These algorithms are divided into two categories: persistent subgraph matching algorithms without timing constraints and persistent subgraph matching algorithms with timing constraints. For persistent subgraph matching algorithms without timing constraints, one of the most advanced algorithms, RapidFlow, proposes a dual matching technique to eliminate redundant calculations caused by the self-morphism problem in the query graph, and reduces the search space through pruning technology. The matching order in the search space does not necessarily start from the updated edge. Another most advanced algorithm, CaLiG, proposes a low-cost indexing structure to speed up the indexing and incremental matching process by dividing the subgraph into two parts: the core and the shell. For persistent subgraph matching algorithms with timing constraints, the most advanced algorithm, Timing, decomposes the query graph into smaller subgraphs according to the timing constraints, and searches for matches that meet the timing constraints by matching the decomposed subgraphs.
[0004] For continuous subgraph matching algorithms without timing constraints, RapidFlow and CaLiG algorithms only consider structural constraints to find matches for query graphs, that is, the resulting matches are isomorphic embeddings of the query graphs, without considering the timing constraints of the query graphs. In practical applications, a large number of redundant solutions will be generated, and the inspection of these redundant solutions requires a lot of time and space overhead. For continuous subgraph matching algorithms with timing constraints, although the Timing algorithm considers the timing constraints of the query graph, the algorithm needs to store some matching results in the index, and due to the decomposition strategy, the algorithm needs to connect the matching results with Cartesian products during the search phase. Therefore, the algorithm has the limitations of high index space cost and high maintenance cost of intermediate results. Summary of the invention
[0005] The present invention provides a method, device and storage medium for continuous subgraph matching based on timing constraints, aiming to solve the limitations of existing continuous subgraph matching algorithms.
[0006] The present invention provides a continuous subgraph matching method based on timing constraints, comprising:
[0007] In attack detection, a query graph is obtained based on the cyberspace security events generated by real-time data. In the cyberspace security event database, a data graph is formed by associating the network attack behaviors detected in real time. The vertices in the query graph and the data graph represent security event entities, and the edges represent the relationships between security event entities. At the same time, a temporal constraint relationship between the edges of the query graph is established.
[0008] In the offline phase, an index is constructed based on the initial query graph and the initial data graph to obtain an edge-based candidate storage index graph. The nodes of the candidate storage index graph are divided into multiple groups, and each group corresponds to an edge in the query graph.
[0009] In the online stage, links are created for nodes with common vertices. The filtering rules and status information are used to determine whether two nodes in the candidate storage index graph match each other. The edges of the two matching nodes are updated for search, and all nodes are traversed in this way. When the last sequential node is traversed, the backtracking search process is performed from this node to obtain the matching result of the timing constraint.
[0010] As a further improvement of the present invention, creating a link for nodes having a common vertex includes:
[0011] If the edges corresponding to the first node and the second node in the data graph have a common vertex, and the edge corresponding to the first node appears before the edge corresponding to the second node in the query graph, a link between the first node and the second node is created; otherwise, a link between the first node and the second node is not created.
[0012] As a further improvement of the present invention, when an edge between two nodes in the candidate storage index graph is created, the filtering rules that need to be met are: a. the corresponding edges of the two nodes in the data graph are adjacent and satisfy the timing constraints; b. the mapping edges of the two nodes in the query graph are adjacent.
[0013] As a further improvement of the present invention, whether two nodes in the candidate storage index graph match each other is determined by state information, and edges of the two matching nodes are updated for searching, including:
[0014] Determine whether the nodes in the candidate storage index graph have complete neighbor conditions. If the complete neighbor condition is met, the state information of the node is 1. If the complete neighbor condition is not met, the state information of the node is 0. Update the edge between the two nodes with state information of 1, and in the matching stage, only traverse the nodes with state information of 1 in the candidate storage index graph.
[0015] As a further improvement of the present invention, for a newly inserted node, a backtracking search is performed only when the newly inserted node status information is 1; if the newly inserted node status information is 0, a backtracking search is not performed.
[0016] As a further improvement of the present invention, for a newly inserted node, if the node has a preceding timing sequence, the node will be inserted, and a link will be created for the node, while the status information of all involved points will be updated; otherwise, the newly inserted node will be discarded.
[0017] As a further improvement of the present invention, if the status information of a newly inserted node is 1 after the link is created, and there is no post-sequence after the node, the backtracking search process is executed starting from the node, and during the search process, the nodes whose search status information is not 1 are skipped, and finally a complete matching result is obtained.
[0018] As a further improvement of the present invention, a merging strategy is adopted for nodes in the candidate storage index graph: nodes with the same neighbor structure are merged together as a single node, and after the matching process, the single node is replaced with all the merged nodes to restore the matching result;
[0019] The merging strategy is divided into merging in the indexing phase and merging in the searching phase. For merging in the indexing phase, the points to be merged are required to have exactly the same information except for the timestamp, and the neighbor structure must be the same. For merging in the searching phase, the points to be merged are required to have similar neighbor structures.
[0020] The present invention also provides a continuous subgraph matching device based on timing constraints, comprising: a processor; and a memory, wherein a computer executable program is stored in the memory, and when the computer executable program is executed by the processor, the continuous subgraph matching method based on timing constraints is executed.
[0021] The present invention also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for continuous subgraph matching based on timing constraints is implemented.
[0022] The beneficial effects of the present invention are:
[0023] Compared with the continuous subgraph matching algorithms RapidFlow and CaLiG without timing constraints, the TC-Match algorithm of the present invention reduces the candidate set in the search space by storing the timing information of each edge in the node of the CSS index and filtering some edges that are unlikely to produce matches in advance according to the filtering rules, so as to achieve the purpose of reducing redundant solutions. Compared with the continuous subgraph matching algorithm Timing with timing constraints, the TC-Match algorithm does not consider decomposing the query graph, but constructs the query graph into a lightweight CSS index of K-part graphs according to the relationship between the edges between the query graphs, so as to reduce the number of Cartesian product operations and the cost of maintaining intermediate results. In addition, TC-Match does not save the results of partial matching, but performs dynamic search to obtain results after each update and the update meets the conditions, so as to reduce the overhead of the index space. TC-Match introduces state information in the CSS index to reduce the number of invalid searches. The search process is performed only when the update edge state information is 1 and the update edge is for the last timing, so as to reduce unnecessary search overhead. To address the high overhead of dealing with duplicate edges, TC-Match uses two strategies: index phase merging and search phase merging. These two strategies have a very good acceleration effect when there are many duplicate edges. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a query graph obtained according to cyberspace security events generated by real-time data in the present invention;
[0025] Figure 2 It is a data graph formed by correlating network attack behaviors detected in real time in the present invention;
[0026] Figure 3 It is a candidate storage index graph constructed according to the query graph and the data graph of the present invention;
[0027] Figure 4 is a candidate storage index graph of the node merging strategy in the present invention;
[0028] Figure 5 is a flow chart of attack modes in network traffic according to an embodiment of the present invention;
[0029] Figure 6 is a flow chart of a credit card fraud mode in a transaction according to an embodiment of the present invention;
[0030] Figure 7 It is a comparison chart of average query time of various algorithms in the experimental results of the present invention;
[0031] Figure 8 It is a comparison chart of the number of query graphs that cannot be completed within 1 hour by various algorithms in the experimental results of the present invention;
[0032] Fig. 9 It is a comparison chart of query time details of various algorithms on different data sets in the experimental results of the present invention;
[0033] Fig.10 It is a comparison chart of memory usage of various algorithms in the experimental results of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0035] Embodiment 1:
[0036] The present invention provides a continuous subgraph matching method based on timing constraints, comprising:
[0037] In attack detection, a query graph is obtained based on the cyberspace security events generated by real-time data. In the cyberspace security event database, a data graph is formed by associating the network attack behaviors detected in real time. The vertices in the query graph and the data graph represent security event entities, and the edges represent the relationships between security event entities. At the same time, a temporal constraint relationship between the edges of the query graph is established.
[0038] In the offline phase, an index is constructed based on the initial query graph and the initial data graph to obtain an edge-based candidate storage index graph. The nodes of the candidate storage index graph are divided into multiple groups, each group corresponding to an edge in the query graph; multiple edges e in the data graph that match the same edge ∈ of the query graph are classified into the same node of the candidate storage index graph;
[0039] In the online stage, links are created for nodes with common vertices. The filtering rules and status information are used to determine whether two nodes in the candidate storage index graph match each other. The edges of the two matching nodes are updated for search, and all nodes are traversed in this way. When the last sequential node is traversed, the backtracking search process is performed from this node to obtain the matching result of the timing constraint.
[0040] Define the data graph as G, the query graph as Q, and the timing constraint as O. To distinguish the edges in the query graph Q and the data graph G, use ∈ to represent the edges in the query graph Q and e to represent the edges in the data graph G. Figure 1 (a) is a query graph, which is a directed graph with labels, where u i represents a vertex in the query graph, ∈ i (l i ) represents the edge∈ i The label is l i , Figure 1 (b) is the timing constraint of the query graph, ∈ i <∈ jIt means that edge i must appear before edge j. Figure 2 is a dynamically updated data graph, where v i represents the vertex in the data graph, l i Represents the label of this edge, t i represents the timestamp of the edge, and Δe represents the dynamically inserted edge. The labels of vertices or edges represent their types. For example, in network security data, the labels of edges represent the types of attack events.
[0041] For the problem of continuous temporal subgraph matching, a new and efficient algorithm TC-Match is proposed. The algorithm is divided into an offline phase and an online phase. In the offline phase, the index is constructed based on the initial query graph and the initial data graph. In the online phase, the filtering rules and state information are used to quickly determine whether the updated edge should be retained. When certain state conditions are met, the search process is executed to obtain the matching results of the temporal constraints.
[0042] When an edge between two nodes in the candidate storage index graph is created, the filtering rules that need to be met are: a. The corresponding edges of the two nodes in the data graph are adjacent and meet the timing constraints; b. The mapping edges of the two nodes in the query graph are adjacent.
[0043] Since weak embedding is a necessary condition for embedding, an edge-based candidate storage index graph (CSS) is proposed in the TC-Match algorithm to store weak embedding as an intermediate result to reduce the backtracking search space. CSS is a k-part graph structure constructed based on the query graph Q and the data graph G. The nodes of CSS are divided into multiple groups, each of which corresponds to an edge in the query graph. When an edge between two nodes in CSS is created, it is necessary to meet the following requirements: 1. The edges corresponding to the two nodes in the data graph G are adjacent and meet the timing constraint. The timing constraint means that one edge must appear before or after another edge; 2. The mapping edges of the two nodes in the query graph Q are adjacent. The mapping edge adjacency in the query graph Q means that if two nodes in CSS are mapped to two edges of the query graph Q, and these two edges have a common vertex, then these two edges are adjacent, that is, the mapping edges corresponding to the two nodes in CSS are adjacent. For example: suppose the query graph is a→b→c, one node in the CSS is (a,b) and the other node is (b,c), then the edges mapping these two nodes to the query graph are a→b and b→c. Obviously, a→b and b→c have common vertices, which are called "adjacent", and a→b and b→c are the "mapping edges" of the CSS nodes (a,b) and (b,c).
[0044] The state information is used to determine whether two nodes in the candidate storage index graph match each other, and the edges of the two matching nodes are updated for searching, including: determining whether the nodes in the candidate storage index graph have complete neighbor conditions, if the complete neighbor condition is met, the state information of the node is 1, if the complete neighbor condition is not met, the state information of the node is 0, and the edge between the two nodes with state information of 1 is updated, and in the matching stage, only the nodes with state information of 1 in the candidate storage index graph are traversed. The complete neighbor condition means that the nodes in the candidate storage index graph have adjacent edges at both ends of the corresponding edges in the query graph, that is, the neighborhood of the node is complete.
[0045] Obviously, CSS maintains the Cartesian product of all matching results, that is, each group in CSS contributes exactly one edge to the embedding of the query graph Q. In order to further speed up the matching process, the state information of the node is introduced in CSS to indicate whether the neighbors of the node are all well "matched". If the neighborhood of a node in CSS is complete, then the state information of this node is 1. For example, the query graph is a→b→c→d, and there are nodes (a,b), (b,c), and (c,d) in CSS. Since (b,c) is adjacent to (a,b) and (c,d) respectively, if (b,c) has both (a,b) and (c,d) neighbors around it, then the node (b,c) has a complete neighbor situation, and its state information is 1, otherwise it is 0. In the matching stage, only the nodes with state information of 1 in CSS are traversed and processed to reduce redundant partial matches. Figure 3 (a) is based on Figure 1 The query graph in (a) and Figure 2 The CSS constructed by the data graph in G, in which, since the edge (v2, v3) and the edge (v6, v3) match ∈ 1, two nodes are created in CSS, namely (v2, v3, l4, t2) and (v6, v3, l4, t6). For other points in CSS, the creation process is similar to the above.
[0046] Creating links for nodes with common vertices, including: if the edges corresponding to the first node and the second node in the data graph have a common vertex, and the edge corresponding to the first node appears before the edge corresponding to the second node in the query graph, then creating a link between the first node and the second node; otherwise, not creating a link between the first node and the second node.
[0047] After the CSS nodes are created, links are created for these nodes based on whether there are common vertices. For example, (v2, v5, l1, t3) and (v3, v5, l5, t5) have a common vertex v5, so a link is created between the two nodes. In order to reduce the subsequent search space, a CSS simplification strategy is proposed. For example, for (v3, v5, l5, t5) and (v6, v3, l4, t6), these two nodes match ∈3 and ∈1 respectively, but because Figure 1 In the timing constraints of (b), ∈3>∈1, so even if the two nodes have a common vertex v3, no link is created between the two nodes, e.g. Figure 3 (b) is shown in order to reduce the subsequent search space.
[0048] For a newly inserted node, backtracking search is performed only when the newly inserted node status information is 1; if the newly inserted node status information is 0, backtracking search is not performed.
[0049] In order to reduce the number of invalid searches, status information is set for each node in the CSS. The status information is 1 only when the complete neighbor condition is met, otherwise it is 0. The search is performed only when the status information of the newly inserted node is 1. Figure 3 In (b), (v2,v3,l4,t2) and (v6,v3,l4,t6), since in the query graph Q, ∈1 has two neighbors ∈3 and ∈2, the node (v2,v3,l4,t2) satisfies ∈3, that is, (v3,v5,l5,t5), and also satisfies ∈2, that is, (v2,v5,l1,t3), so the node state information of (v2,v3,l4,t2) is 1. However, since the (v6,v3,l4,t6) node only satisfies ∈2, that is, (v6,v5,l1,t4), and since in the timing constraint, ∈1 must appear before ∈3, but the appearance time of (v6,v3,l4,t6) is t6, and the appearance time of (v3,v5,l5,t5) corresponding to ∈3 is t5, the (v6,v3,l4,t6) node does not satisfy ∈3, so the (v6,v3,l4,t6) node state information is 0. Assuming that the (v6,v3,l4,t6) node is the newly inserted node, since the node state information is not 1, no backtracking search is performed.
[0050] For a newly inserted node, if there is a previous sequence before the node, the node will be inserted, and a link will be created for the node, and the status information of all involved points will be updated; otherwise, the newly inserted node will be discarded. Figure 2 The update edge Δe=(v8,v9,l3,t 10 ), due to (v8,v9,l3,t 10) corresponds to ∈5 in the query graph Q, and in the timing constraint, ∈2 and ∈3 are required to appear before ∈5, respectively. In CSS, both ∈2 and ∈3 are not empty, so (v8, v9, l3, t 10 ) node and create a link for the node according to the above process, and update the status information of all involved points.
[0051] If the state information of a newly inserted node is 1 after the link is created, and there is no subsequent sequence after the node, the backtracking search process will be performed from this node, and during the search process, the nodes whose state information is not 1 will be skipped, and finally a complete matching result will be obtained. Figure 3 (c), node (v8,v9,l3,t 10 ) is created, its status information is 1, and this node is the last node in the sequence, so DFS search is performed on CSS with this node as the starting point. During the search, nodes whose status information is not 1 are skipped, and finally a complete matching result {((v8,v9,l3,t 10 ),∈5),((v5,v8,l2,t9),∈4),((v2,v5,l1,t3),∈2),((v2,v3,l4,t2),∈1),((v3,v5,l5,t5),∈3)}.
[0052] In the data graph G, for the edges that do not match the query graph Q, it means that these edges do not conform to the query graph Q and will be discarded during processing without performing the search process. For example, Figure 2 The edge (v2,v1) and the edge (v1,v4) in .
[0053] A merging strategy is adopted for nodes in the candidate storage index graph: nodes with the same neighbor structure are merged together as a single node. After the matching process, the single node is replaced with all the merged nodes to restore the matching result. The merging strategy is divided into merging in the indexing stage and merging in the search stage. For merging in the indexing stage, the points to be merged are required to have exactly the same information except the timestamp, and the neighbor structure must be the same. For merging in the search stage, the points to be merged are required to have similar neighbor structures.
[0054] In a time series graph, there may be some edges with the same information except for the timestamp. Such edges are called duplicate edges. The existence of duplicate edges will cause the matching results to increase exponentially, increasing the difficulty of searching. When CSS constructs duplicate edges, the processing method is the same as the first duplicate edge. Therefore, a CSS node merging strategy is proposed, which is to reduce the size of the candidate set by merging some nodes with similar structures. In general, the idea is to merge nodes with the same neighbor structure together as a single node. After the matching process, the matching results can be restored by simply replacing this node with all merged nodes. Specifically, the merging strategy can be divided into merging in the indexing stage and merging in the search stage. For merging in the indexing stage, the points to be merged are required to have exactly the same information except for the timestamp, and the neighbor structure must be the same; for merging in the search stage, only similar neighbor structures are required, that is, when the remaining part of the points to be merged have the same neighbor points, then the points to be merged have similar neighbor structures. The indexing stage is a forward tracing process from the first node to the last node, while the search stage is a backtracking process from the last node to the first node.
[0055] For example Figure 4 In the CSS, assuming that the status information of all nodes is 1, the matching order is ∈4, ∈3, ∈2, ∈1. Obviously, ∈2 and ∈4 have different neighbor structures, that is, the neighbors of ∈2 and ∈4 in the rest of the CSS indexing process are ∈3 and ∈5 respectively, so these two nodes cannot be merged in the indexing node. However, when the search phase processes to ∈5, since ∈2 and ∈4 have the same neighbor ∈1 in the rest of the CSS search process, that is, ∈2 and ∈4 are considered to have similar neighbor structures, these two nodes can be merged in the search phase to reduce the size of the candidate set when ∈2 is matched.
[0056] Embodiment 2:
[0057] The present invention also provides a continuous subgraph matching device based on timing constraints, comprising: a processor; and a memory, wherein a computer executable program is stored in the memory, and when the computer executable program is executed by the processor, the continuous subgraph matching method based on timing constraints in Example 1 is executed.
[0058] Embodiment three:
[0059] The present invention also provides a storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for continuous subgraph matching based on timing constraints in the first embodiment is implemented.
[0060] Embodiment 4:
[0061] As an application example of the present invention, Figure 5"Attack patterns in network traffic" in it shows the process of typical network attack patterns. The victim browses an infected website at time t1, which leads to the download of malicious scripts at time t2. After successfully invading the victim's device, the threat actor establishes communication with a malicious C&C server. The infected victim host registers with the C&C server at time t3 and receives commands from the C&C server at time t4. After executing these commands, more malware is installed, enabling the thread participant to fully control the infected computer. Finally, the leaked data is sent back to the C&C server at time t5. Obviously, the timestamps in the above example follow a strict chronological order, i.e., t1 < t2 < t3 < t4 < t5. Therefore, this network attack pattern can be modeled as a time-constrained query graph. By applying the TC-Match algorithm, such network attacks against network traffic data can be quickly detected.
[0062] Example 5:
[0063] As an application example of the present invention, Figure 6 "Credit card fraud in transactions" in it describes a typical credit card fraud pattern in a series of transactions. Criminals attempt to illegally cash out funds from a bank with the help of merchants and intermediaries. Specifically, the criminals make a false purchase from the merchant at time t1. Once the merchant receives a real payment from the bank at time t2, he will transfer the money back to the criminals through one or more intermediaries at time t3 or t4 respectively. Obviously, this pattern has a strict chronological order t1 < t2 < t3 < t4. Using the TC-Match algorithm, the system can detect such transaction cycles in real time. Therefore, the bank can stop such frauds in time and reduce losses.
[0064] Example 6:
[0065] Experiments are conducted on the TC-Match algorithm of the present invention and the Timing algorithm, RapidFlow algorithm, and CaLiG algorithm to obtain the differences between the algorithms.
[0066] All experiments were conducted on a PC equipped with an Intel Xeon 2×3.0GHz CPU (with 36 cores and 512GB RAM) running Ubuntu 20.04.5LTS in single-threaded mode. The experiments were conducted by comparing the TC-Match algorithm with three other algorithms, where the Timing algorithm is the most advanced temporal subgraph matching algorithm, and the RapidFlow and CaLiG algorithms are the two most advanced continuous subgraph matching algorithms. Four datasets are used, which are commonly used to evaluate the existing technologies of continuous subgraph matching. WikiTalk is obtained from the Stanford SNAP library, where a directed edge (u,v,t) represents user u editing the talk page of user v at time t. The username is regarded as the vertex label and the network behavior "edit" is regarded as the only edge label. CAIDA is obtained from Anonymized Internet Traces2, where each network communication record is a six-tuple including source IP / port, destination IP / port, protocol used and communication timestamp. Vertex labels and edge labels are regarded as ports and protocols respectively. LiveJournal is obtained from the RapidFlow paper, where edges are randomly sampled from a static graph to form an update stream, and vertex labels are also randomly assigned from a label set. LSBench is a synthetic dynamic social network generated by LinkedStream Benchmark. Each record in the stream data is a five-tuple consisting of a subject type / id, a predicate, and an object type / id. The stream graph is constructed on the stream data using the types of the subject / object and the predicate as vertex labels and edge labels, respectively. For each test, the algorithm is run for a query set containing 50 query graphs. Given a query, the query time elapsed is reported, including the time for index updates and incremental matching searches. If the algorithm cannot complete the query graph within 1 hour (denoted as INF), the algorithm is terminated and the algorithm is marked as an unsolved query. In the experiment, the average running time and algorithm running memory usage over more than 50 query graphs were tested. The final experimental results are shown in Figures 7 to 10 shown.
[0067] Comparative experiments have shown that in terms of average query time, TC-Match is more than an order of magnitude faster than the three algorithms mentioned above: Timing, RapidFlow, and CaLiG. In terms of average space consumption, TC-Match is 2.1-7.5 times less than the three algorithms mentioned above. In addition, experiments have also proved that TC-Match is better than CaLiG in terms of stability.
[0068] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.
Claims
1. A continuous subgraph matching method based on timing constraints, characterized in that: include: In attack detection, a query graph is obtained based on the cyberspace security events generated by real-time data. In the cyberspace security event database, a data graph is formed by associating the network attack behaviors detected in real time. The vertices in the query graph and the data graph represent security event entities, and the edges represent the relationships between security event entities. At the same time, a temporal constraint relationship between the edges of the query graph is established. In the offline phase, an index is constructed based on the initial query graph and the initial data graph to obtain an edge-based candidate storage index graph. The nodes of the candidate storage index graph are divided into multiple groups, and each group corresponds to an edge in the query graph. In the online phase, links are created for nodes with common vertices. The filtering rules and status information are used to determine whether two nodes in the candidate storage index graph match each other. The edges of the two matching nodes are updated for search. All nodes are traversed in this way. When the last sequential node is traversed, the backtracking search process is performed from this node to obtain the matching result of the timing constraint. When an edge between two nodes in the candidate storage index graph is created, the filtering rules that need to be met are: a. The corresponding edges of the two nodes in the data graph are adjacent and meet the timing constraints; b. The mapping edges of the two nodes in the query graph are adjacent; The state information is used to determine whether two nodes in the candidate storage index graph match each other, and the edges of the two matching nodes are updated for searching, including: Determine whether the nodes in the candidate storage index graph have complete neighbor conditions. If the complete neighbor condition is met, the state information of the node is 1. If the complete neighbor condition is not met, the state information of the node is 0. Update the edge between the two nodes with state information of 1, and in the matching phase, only traverse the nodes with state information of 1 in the candidate storage index graph; the complete neighbor condition means that the nodes in the candidate storage index graph have adjacent edges at both ends of the corresponding edge in the query graph, that is, the neighborhood of the node is complete.
2. The method for continuous subgraph matching based on timing constraints according to claim 1, characterized in that: Create links between nodes that have common vertices, including: If the edges corresponding to the first node and the second node in the data graph have a common vertex, and the edge corresponding to the first node appears before the edge corresponding to the second node in the query graph, a link between the first node and the second node is created; otherwise, a link between the first node and the second node is not created.
3. The method for continuous subgraph matching based on timing constraints according to claim 1, characterized in that: For a newly inserted node, backtracking search is performed only when the newly inserted node status information is 1; if the newly inserted node status information is 0, backtracking search is not performed.
4. The method for continuous subgraph matching based on timing constraints according to claim 3, characterized in that: For a newly inserted node, if there is a predecessor sequence before the node, the node will be inserted, and a link will be created for the node, and the status information of all involved points will be updated; otherwise, the newly inserted node will be discarded.
5. The method for continuous subgraph matching based on timing constraints according to claim 3, characterized in that: If the status information of a newly inserted node is 1 after the link is created, and there is no subsequent sequence after the node, the backtracking search process is executed from the node, and during the search process, the nodes whose search status information is not 1 are skipped, and finally a complete matching result is obtained.
6. The method for continuous subgraph matching based on timing constraints according to claim 1, characterized in that: A merging strategy is adopted for nodes in the candidate storage index graph: nodes with the same neighbor structure are merged together as a single node. After the matching process, the single node is replaced with all the merged nodes to restore the matching results; The merging strategy is divided into merging in the indexing phase and merging in the searching phase. For merging in the indexing phase, the points to be merged are required to have exactly the same information except for the timestamp, and the neighbor structure must be the same. For merging in the searching phase, the points to be merged are required to have similar neighbor structures.
7. A continuous subgraph matching device based on timing constraints, characterized in that: include: processor; and a memory, wherein a computer executable program is stored in the memory, and when the computer executable program is executed by the processor, the continuous subgraph matching method based on timing constraints as claimed in any one of claims 1 to 6 is executed.
8. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the continuous subgraph matching method based on timing constraints as claimed in any one of claims 1 to 6 is implemented.
