Sub-graph matching method and system based on hybrid extension strategy and de-weighting optimization

By adopting hybrid expansion strategy and deduplication optimization technology in subgraph matching, adaptively adjusting the expansion strategy and using black and white vertex coding and public expansion merging, the repeated calculation problem in the subgraph matching enumeration stage in the existing technology is solved, and the matching efficiency is improved.

CN119888284APending Publication Date: 2025-04-25BEIJING INSTITUTE FOR GENERAL ARTIFICIAL INTELLIGENCE
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411952842.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art has repeated calculation problems in the enumeration stage of sub-graph matching, and a single expansion strategy cannot adapt to different query contexts, resulting in inefficiency.

Method used

Using a hybrid scaling strategy and deduplication optimization method, the scaling strategy is adaptively adjusted, combined with black and white vertex coding and public scaling merging technology, reduce duplicate calculations and improve efficiency.

Benefits of technology

It significantly improves the efficiency of sub-graph matching, reduces repeated calculations, adapts to the characteristics of different data graphs and query graphs, and improves the vertex expansion speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888284A_ABST
    Figure CN119888284A_ABST
Patent Text Reader

Abstract

The invention provides a sub-graph matching method based on a hybrid extension strategy and de-weighting optimization, which is characterized by comprising the following steps of: adaptively adjusting extension strategy selection in a matching process through the hybrid extension strategy, selecting a proper extension strategy for different sub-graph partial matching, and accelerating vertex extension speed; repeated operation in the sub-graph matching process is reduced through efficient merging, and black and white vertex coding for guiding merging is carried out; according to the black and white vertex codes, matching and combining the plurality of shared calculation parts into an aggregation form part, and performing matching and combining calculation on the aggregation form part in a subsequent expansion process, and performing prospective de-weighting optimization to obtain a public expansion result; by caching and multiplexing public extension results, pruning is guided to be carried out on search paths which generate repeated results or cannot generate results, public extension multiplexing of retrospective de-duplication optimization is carried out, and query graphs in various forms are efficiently processed on data graphs with various characteristics and various scales.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hybrid coding technology for data graph information processing, and more specifically, to a subgraph matching system and method based on a hybrid expansion strategy and deduplication optimization. Background Art

[0002] Subgraph matching is a very important research topic in the field of graph analysis, which belongs to the graph pattern mining problem. The subgraph matching problem refers to finding all subgraphs that match the query graph in the corresponding data graph given a query graph (graph pattern). This matching relationship is a homomorphic relationship and an isomorphic relationship. Taking subgraph isomorphism as an example, a matching subgraph needs to correspond one-to-one with the vertices and edges of the query graph. Subgraph matching has important applications in many fields, including social network analysis, biological protein action analysis, chemical molecule search, financial fraud detection, etc.; not only that, subgraph matching is also a core operator of graph database systems and resource description framework (RDF) storage engines; for example: in a graph database system, the query statement is abstracted into a query graph, the query vertices are variables or constants, and the query edges are the relationships between them, and then search is performed in the data graph. Since the subgraph matching problem is an NP-hard problem, how to efficiently enumerate all matching subgraphs is a challenging task. The overall computational framework of subgraph matching is divided into filtering candidate sets, generating matching orders, enumerating subgraphs, and filtering subgraphs. Figure 3 The performance of the subgraph matching process is mainly limited by the enumeration stage. Therefore, in order to improve the efficiency of subgraph matching, most recent work focuses on how to speed up the enumeration.

[0003] The existing technologies for reducing repeated calculations in the enumeration stage are either based on the idea of ​​merging or the idea of ​​reusing, and they do not take into account the reduction of repeated calculations comprehensively. Secondly, they all use a single expansion strategy to perform vertex expansion, which is not suitable for all query contexts; the existing methods are mainly divided into two types of vertex expansion strategies: one is the expansion strategy based on edge verification, which first calculates a smaller set of candidate vertices for the vertex to be expanded, and then for each vertex in the candidate vertex set, verifies whether there is an edge connecting it to its backward neighbor (the backward neighbor is the vertex before the point in the matching order); the other is the expansion strategy based on set intersection, which obtains the expansion result by performing an intersection operation on the neighbor list of the backward neighbor of the vertex to be expanded. For example, Figure 2As shown in the figure, the left side of the dotted line is the edge that needs to be verified, and the intersection of the two dotted boxes on the right side of the dotted line is the result of set intersection. For cases where the neighbor lists are quite different, the effect of edge verification is better. For cases where the lengths of neighbor lists are similar, set intersection is more efficient. Therefore, a single expansion strategy cannot meet all partial matching expansion situations; there are too many repeated calculations: due to the problem of excessive memory overhead when using subgraph matching based on breadth-first search, most of the existing advanced works adopt subgraph matching methods based on depth-first search. In dealing with repeated calculations, it is impossible to completely merge partial matches with repeated expansion results like breadth-first search, so most of them use heuristic methods to reduce local repeated calculations. However, most of them have a limited scope of deduplication because they only consider merging or reusing one technical route without considering the interaction between the two. Even technologies like DAF only consider the pruning of search subtrees that cannot generate results, but do not consider the reuse of search subtrees that can generate final results, and other problems remain to be solved; therefore, it is necessary to propose a subgraph matching system and method based on a hybrid expansion strategy and deduplication optimization to at least partially solve the problems existing in the prior art. Summary of the invention

[0004] A series of simplified concepts are introduced in the content of the invention, which will be further described in detail in the specific implementation method section; the content of the invention of the present invention does not mean to attempt to limit the key features and essential technical features of the technical solution claimed for protection, nor does it mean to attempt to determine the scope of protection of the technical solution claimed for protection.

[0005] To at least partially solve the above problems, the present invention provides a subgraph matching method based on a hybrid expansion strategy and deduplication optimization, comprising:

[0006] S10, through the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process, select the appropriate expansion strategy for the partial matching of different subgraphs, and accelerate the vertex expansion speed;

[0007] S20, uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging;

[0008] S30, according to the black and white vertex codes, multiple shared computing parts are matched and merged into an aggregated form part, and in the subsequent expansion process, the aggregated form part is matched and merged for calculation, and forward-looking deduplication optimization is performed to obtain a public expansion result;

[0009] S40, by caching and reusing common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

[0010] Preferably, S10 includes:

[0011] S101, based on the cost model drive, combined with edge verification and set intersection, evaluates the various scenarios that different expansion strategies are adapted to, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy;

[0012] S102, according to the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process; when processing data graphs with large differences in data features, adapt to multiple matching scenarios to accelerate the vertex expansion speed;

[0013] Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i For the edge verification strategy, it verifies that u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

[0014] Preferably, S20 includes:

[0015] S201, using efficient merging, given a query graph Q and a matching order O, setting O to be sorted according to the numbers of the query vertices, and merging at high speed during the matching process;

[0016] S202, reduce repeated operations in the subgraph matching process, for each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, ui Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

[0017] Preferably, S30 includes:

[0018] S301, merging multiple shared computing partial matches into an aggregated form portion according to black and white vertex codes; and expanding this group of partial matches at the same time;

[0019] S302, in the subsequent expansion process, partially match and merge the aggregated forms, perform forward-looking deduplication optimization, and obtain a common expansion result;

[0020] According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time;

[0021] When querying vertex u i When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

[0022] Preferably, S40 includes:

[0023] S401, guiding the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results;

[0024] S402, perform retrospective deduplication optimization for public extension reuse to avoid multiple calculations of the same extension result; efficiently process various forms of query graphs on data graphs of various features and sizes;

[0025] By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u iThe mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

[0026] The present invention provides a subgraph matching system based on a hybrid expansion strategy and deduplication optimization, comprising:

[0027] Vertex hybrid expansion acceleration module, through hybrid expansion strategy, adaptively adjusts the expansion strategy selection during the matching process, selects appropriate expansion strategy for partial matching of different subgraphs, and accelerates the vertex expansion speed;

[0028] The black and white vertex encoding module uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging;

[0029] The public extension merging and aggregation module matches and merges multiple shared computing parts into an aggregated form part according to the black and white vertex codes. In the subsequent expansion process, the aggregated form parts are matched and merged for forward-looking deduplication optimization to obtain the public extension results.

[0030] The common extension reuse module caches and reuses common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

[0031] Preferably, the vertex blending extension acceleration module comprises:

[0032] Drive the hybrid expansion unit, based on the cost model, combined with edge verification and set intersection, evaluate the various scenarios that different expansion strategies are suitable for, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy;

[0033] The expansion strategy adjustment unit adaptively adjusts the expansion strategy selection during the matching process according to the hybrid expansion strategy; when processing data graphs with large differences in data features, it adapts to multiple matching scenarios and accelerates the vertex expansion speed;

[0034] Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i For the edge verification strategy, it verifies that u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

[0035] Preferably, the black and white vertex encoding module includes:

[0036] The query vertex numbering unit adopts efficient merging. Given a query graph Q and a matching order O, O is set to be sorted according to the number of query vertices, and merged at high speed during the matching process;

[0037] Guide the merging of black and white coding units to reduce repeated operations in the subgraph matching process. For each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

[0038] Preferably, the public extension merging and aggregation module includes:

[0039] The matching and aggregation form unit matches and merges multiple shared computing parts into one aggregation form part according to the black and white vertex codes; and expands this group of partial matches at the same time;

[0040] Match and merge the calculation to remove duplicate units, and in the subsequent expansion process, partially match and merge the calculations in the aggregated form to perform forward-looking deduplication optimization and obtain public expansion results;

[0041] According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time;

[0042] When querying vertex u i When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

[0043] Preferably, the public extension multiplexing module includes:

[0044] A search path pruning unit, which guides the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results;

[0045] The public extension reuse unit performs retrospective deduplication optimization of public extension reuse to avoid multiple calculations of the same extension results; it efficiently processes various forms of query graphs on data graphs of various features and sizes;

[0046] By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u iThe mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

[0047] Compared with the prior art, the present invention has at least the following beneficial effects:

[0048] The invention discloses a subgraph matching method and system based on a hybrid expansion strategy and deduplication optimization. The hybrid expansion strategy is used to adaptively adjust the expansion strategy selection in the matching process, select appropriate expansion strategies for matching different subgraph parts, and accelerate the vertex expansion speed. The invention adopts efficient merging to reduce repeated operations in the subgraph matching process, and performs black-and-white vertex coding to guide merging. According to the black-and-white vertex coding, multiple shared calculation parts are matched and merged into an aggregated form part, and the aggregated form part is matched and merged in the subsequent expansion process to perform forward-looking deduplication optimization and obtain a common expansion result. The common expansion result is cached and reused to guide the pruning of search paths that produce repeated results or cannot produce results, and the common expansion reuse of retrospective deduplication optimization is performed, so that various forms of query graphs can be efficiently processed on data graphs of various features and sizes. The speed of vertex expansion can be improved, and an adaptive hybrid expansion strategy is proposed to dynamically select an appropriate expansion strategy in the matching process. In order to further reduce repeated calculations in the subgraph matching process, the invention proposes a common expansion merging and common expansion reuse technology based on black-and-white vertex coding, which significantly deduplication optimization to a greater extent than the prior art. The invention has important technical significance and significant effects.

[0049] The subgraph matching method and system based on hybrid expansion strategy and deduplication optimization described in the present invention, and other advantages, objectives and features of the present invention will be reflected in part through the following description, and in part will also be understood by technical personnel in the field through research and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0051] Figure 1 This is a diagram of an embodiment of the subgraph matching system based on hybrid expansion strategy and deduplication optimization described in the present invention.

[0052] Figure 2 This is a diagram showing an implementation example of the subgraph matching method based on a hybrid expansion strategy and deduplication optimization and system cost model calculation according to the present invention.

[0053] Figure 3 This is another embodiment diagram of the subgraph matching method based on hybrid expansion strategy and deduplication optimization and system common expansion merging scenario 1 described in the present invention.

[0054] Figure 4 This is an embodiment diagram of common extension merging scenario 2 of the subgraph matching system based on hybrid extension strategy and deduplication optimization described in the present invention.

[0055] Figure 5 This is a diagram of an implementation example 3 of the subgraph matching method based on a hybrid expansion strategy and deduplication optimization and the system common expansion merging scenario according to the present invention.

[0056] Figure 6 This is another embodiment diagram of the subgraph matching method based on hybrid expansion strategy and deduplication optimization and system common expansion merging scenario 4 described in the present invention.

[0057] Figure 7 This is a diagram of an embodiment of the subgraph matching method based on hybrid expansion strategy and deduplication optimization and system common expansion multiplexing described in the present invention. DETAILED DESCRIPTION

[0058] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments so that those skilled in the art can implement it according to the instructions; as shown in the figure, the present invention provides a subgraph matching method based on a hybrid expansion strategy and deduplication optimization, including:

[0059] S10, through the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process, select the appropriate expansion strategy for the partial matching of different subgraphs, and accelerate the vertex expansion speed;

[0060] S20, uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging;

[0061] S30, according to the black and white vertex codes, multiple shared computing parts are matched and merged into an aggregated form part, and in the subsequent expansion process, the aggregated form part is matched and merged for calculation, and forward-looking deduplication optimization is performed to obtain a public expansion result;

[0062] S40, by caching and reusing common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

[0063] The principle and effect of the above technical scheme are as follows: the present invention provides a subgraph matching method based on a hybrid expansion strategy and deduplication optimization, including: adaptively adjusting the expansion strategy selection in the matching process through a hybrid expansion strategy, selecting a suitable expansion strategy for matching different subgraph parts, and accelerating the vertex expansion speed; adopting efficient merging to reduce repeated operations in the subgraph matching process, and performing black-and-white vertex coding to guide merging; according to the black-and-white vertex coding, matching and merging multiple shared calculation parts into an aggregated form part, matching and merging the aggregated form parts in the subsequent expansion process, performing forward-looking deduplication optimization, and obtaining a common expansion result; by caching and reusing the common expansion results, guiding the pruning of search paths that produce duplicate results or cannot produce results, performing retrospective deduplication optimization of common expansion reuse, and efficiently processing various forms of query graphs on data graphs of various features and sizes; being able to improve the speed of vertex expansion, proposing an adaptive hybrid expansion strategy, and dynamically selecting a suitable expansion strategy in the matching process; in order to further reduce repeated calculations in the subgraph matching process, the present invention proposes a common expansion merging and common expansion reuse technology based on black-and-white vertex coding, which significantly deduplication optimization to a greater extent than the prior art; it has important technical significance and significant effects.

[0064] In one embodiment, S10 includes:

[0065] S101, based on the cost model drive, combined with edge verification and set intersection, evaluates the various scenarios that different expansion strategies are adapted to, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy;

[0066] S102, according to the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process; when processing data graphs with large differences in data features, adapt to multiple matching scenarios to accelerate the vertex expansion speed;

[0067] Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i For the edge verification strategy, it verifies that u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

[0068] The principle and effect of the above technical solution are as follows: S10 includes:

[0069] S101, based on the cost model drive, combined with edge verification and set intersection, evaluates the various scenarios that different expansion strategies are adapted to, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy;

[0070] S102, according to the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process; when processing data graphs with large differences in data features, adapt to multiple matching scenarios to accelerate the vertex expansion speed;

[0071] Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i For the edge verification strategy, it verifies that u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u iThe candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, the change in the length of each neighbor set will affect the amount of calculation for set intersection. The specific calculation process is as follows:

[0072] (1) Edge verification cost estimation: For a partial matching set to be expanded, denoted as M, it is a matching mapping of the first i query vertices in the query graph, and the matching order O is set to be the encoding order of the query vertices. Then consider the next vertex u to be expanded i , its backward neighbor set is denoted as N - (u i ). Then M expands u i The computational cost of the edge verification strategy is equal to the product of the number of edges to be verified and the average cost of verifying an edge; however, for various data structures used for edge checking, the cost of verifying a non-existent edge is T N and the cost T of verifying the existence of the edge E are different. Therefore, when estimating the edge verification cost, it is necessary to consider both the check of the non-existent edge and the check of the existing edge. Then it is defined as the sum of the cost of verifying the non-existent edge and the cost of verifying the existence of the edge (the parameter corresponding to the sum of the cost):

[0073]

[0074] where S is a subset of the set of backward neighbors, because in the extended u i Sometimes the calculation is divided into multiple steps, and only a part of the backward neighbors is selected each time. k is a query vertex in set S whose mapped data vertex has the smallest set of neighbors in M, N min It represents the smallest neighbor set; p u is a probability, indicating that u and u i The query edge between them (denoted as e(u,u i )))’s candidate edge set, the probability that an edge that actually exists in the data graph appears, that is, the probability that a candidate edge is proven to exist; p u The calculation is as follows Figure 3 As shown;

[0075] (2) Set intersection cost estimation: The present invention uses leapfrog connection to perform set intersection operation. Leapfrog connection is a method for intersection of multiple sets. It sets an iterator for each set and then cyclically compares the size of the current elements of the two sets until the iterator of one set reaches the end position. Therefore, the cost of intersection depends on the length of all adjacency lists involved in the intersection operation. The check operation when using leapfrog connection to find the intersection is the process of constantly comparing whether two vertices are equal. The cost of setting such a comparison operation is T C , then the set intersection cost of M is defined as follows:

[0076]

[0077] Where N(M(u),l i ) is the data vertex M(u) with respect to label l i Neighbor list.

[0078] (3) Finally, the strategy is selected by comparing the value of the following function with 0. When it is greater than 0, the set intersection strategy is selected. When it is less than 0, the edge verification effect is significantly improved.

[0079] F(M,S)=T EV (M,S)-T SI (M,S)

[0080] By combining edge verification and set intersection, we evaluate the various scenarios that different expansion strategies are suitable for, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy.

[0081] In one embodiment, S20 includes:

[0082] S201, using efficient merging, given a query graph Q and a matching order O, setting O to be sorted according to the numbers of the query vertices, and merging at high speed during the matching process;

[0083] S202, reduce repeated operations in the subgraph matching process, for each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

[0084] The principle and effect of the above technical solution are: given a query graph Q and a matching order O, O is set to be sorted according to the query vertex numbers, and merged at high speed during the matching process; reducing repeated operations in the subgraph matching process, for each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices to guide the merging of black and white vertices, reducing repeated operations in the subgraph matching process.

[0085] In one embodiment, S30 includes:

[0086] S301, merging multiple shared computing partial matches into an aggregated form portion according to black and white vertex codes; and expanding this group of partial matches at the same time;

[0087] S302, in the subsequent expansion process, partially match and merge the aggregated forms, perform forward-looking deduplication optimization, and obtain a common expansion result;

[0088] According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time;

[0089] When querying vertex u i When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

[0090] The principle and effect of the above technical solution are as follows: according to the black and white vertex coding, multiple shared calculation partial matches are merged into an aggregate form part; and this group of partial matches is expanded at the same time; in the subsequent expansion process, the aggregate form partial matches are merged and calculated, and forward-looking deduplication optimization is performed to obtain a common expansion result; according to the black and white vertex coding, multiple shared calculation partial matches are merged into an aggregate form part; and this group of partial matches is expanded at the same time, including: in order to share the expansion calculation between multiple partial matches, the public expansion merging technology will merge multiple partial matches into an aggregate embedding, and expand this group of partial matches at the same time; when the query vertex u is usedi When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only be expanded individually; between the vertices u to be expanded i There are different black and white coding combinations between a vertex and its backward neighbors. When a vertex is expanded, there are four different expansion situations:

[0091] (1) Case 1: u i and its backward neighbors are all black vertices. Figure 4 As shown, due to u i All the backward neighbors of are black vertices, then the mapping of each black backward neighbor in M ​​is a unique data vertex. i The extended result R M (u i ) is obtained directly by expanding these data vertices using a hybrid strategy. i It is a black vertex, so these expansion results cannot be combined and used, so you need to use u i Each mapping of M is used to expand M separately. These submatches expanded from M have different computational behaviors in the next expansion;

[0092] (2) Case 2: u i is a white vertex but its backward neighbors are all black vertices. Figure 5 As shown, due to u i All backward neighbors of are still black vertices, so for u i The extended result R M (u i ) is the same as in case 1. However, due to u i becomes a white vertex, which is connected to the next vertex u to be expanded i+1 are not adjacent, then u i The expansion result of will not affect the subsequent expansion. Therefore, these expansion results are temporarily combined into a set for use. At this time, M will only expand an aggregate embedding;

[0093] (3) Case 3: u i is a black vertex, and there is a white vertex among its backward neighbors; more than the above two cases, at this time due to u i There is a white vertex in the backward neighbor of u i The expansion of M will no longer be a fixed expansion result; Figure 6 As shown, u iThe mapping of the white backward neighbors in M ​​is a set of data vertices, where various data points will affect u i The expansion of u will have different effects, resulting in different expansion results; then it is necessary to consider splitting this aggregate embedding to ensure the correctness of the expansion; in the specific implementation, the algorithm will first i Perform mixed expansion calculation on all black backward neighbors to obtain a u i The intermediate result set of u; if there is no black backward neighbor, the white backward neighbor with the least number of mappings will be selected, and then the neighbor lists of each mapped point will be unioned to form u i The intermediate result set; then, due to u i It is a black vertex, so each vertex v in this intermediate result set is used as u i The mapping of v is used to modify M in reverse, reduce the set of white backward neighbors, and generate a new partial match M related to v. v Finally, the algorithm expands each newly generated M v ;

[0094] (4) Case 4: u i is a white vertex, and there are white vertices among its backward neighbors; Figure 7 As shown, this situation means that u i and its white backward neighbors are all in the aggregated state, so should we continue to merge the white backward neighbors, or expand them by Cartesian product to merge u i This is a question that needs to be considered. It actually depends on the number of Cartesian product expansions and u i If the former is smaller, then split the aggregate embedding and execute the strategy of case 2 for each split sub-match; if the latter is smaller, u i Treat it as a black vertex and execute the strategy of Case 3 instead; try to maintain the partially matched extensions in a converged state before they diverge to reduce more repeated calculations.

[0095] In one embodiment, S40 includes:

[0096] S401, guiding the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results;

[0097] S402, perform retrospective deduplication optimization for public extension reuse to avoid multiple calculations of the same extension result; efficiently process various forms of query graphs on data graphs of various features and sizes;

[0098] By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u i The mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

[0099] The principle and effect of the above technical solution are: by caching and reusing the common extension results, guiding the pruning of the search paths that produce duplicate results or cannot produce results; performing retrospective deduplication optimization of common extension reuse to avoid multiple calculations of the same extension results; efficiently processing various forms of query graphs on data graphs of various features and sizes; by caching and reusing the common extension results, guiding the pruning of the search paths that produce duplicate results or cannot produce results, including: common extension merging by merging the mapped data points of the white vertices, and simultaneously expanding the mapped data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u i, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; CEB (abbreviation of Common Extension Buffer) is set to represent the common extension buffer; the CEB structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current common extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start extending among its sibling embeddings, then it is necessary to calculate its extension normally, generate the common extension result, and update the corresponding cache area in the common extension buffer; after the modification, the valid bit will be set to true; if before extending M, it is found that the valid bit is already true, then the result of this extension has been recorded and does not need to be recalculated, and the common extension result in the common extension buffer can be directly reused; such as Figure 7 As shown, the backward neighbors of u4 are u0 and u1, and u2 and u3 are irrelevant vertices to u4. No matter how the mapping data points of u2 and u3 change, it will not affect the expansion result generated by u4. Therefore, the partial matches generated in the red dotted box are sibling embeddings, and the public expansion results cached in the public expansion buffer (u4) are reused. This significantly deduplicates and optimizes to a greater extent than the existing technology. It has important technical significance and significant effects.

[0100] The present invention provides a subgraph matching system based on a hybrid expansion strategy and deduplication optimization, comprising:

[0101] Vertex hybrid expansion acceleration module, through hybrid expansion strategy, adaptively adjusts the expansion strategy selection during the matching process, selects appropriate expansion strategy for partial matching of different subgraphs, and accelerates the vertex expansion speed;

[0102] The black and white vertex encoding module uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging;

[0103] The public extension merging and aggregation module matches and merges multiple shared computing parts into an aggregated form part according to the black and white vertex codes. In the subsequent expansion process, the aggregated form parts are matched and merged for forward-looking deduplication optimization to obtain the public extension results.

[0104] The common extension reuse module caches and reuses common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

[0105] The principle and effect of the above technical solution are as follows: the present invention provides a subgraph matching system based on hybrid expansion strategy and deduplication optimization, including: a vertex hybrid expansion acceleration module, which adaptively adjusts the expansion strategy selection during the matching process through the hybrid expansion strategy, selects appropriate expansion strategies for different subgraph partial matching, and accelerates the vertex expansion speed; a black and white vertex encoding module, which adopts efficient merging to reduce repeated operations in the subgraph matching process, and performs black and white vertex encoding to guide merging; a public expansion merging aggregation module, which merges multiple shared computing parts into an aggregated form part according to the black and white vertex coding, and performs forward-looking deduplication optimization on the aggregated form part matching and merging calculation in the subsequent expansion process. , obtain the common extension results; the common extension reuse module, by caching and reusing the common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, and performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes; it can improve the speed of vertex expansion, and proposes an adaptive hybrid expansion strategy, and dynamically selects the appropriate expansion strategy during the matching process; in order to further reduce the repeated calculations in the subgraph matching process, the present invention proposes a common extension merging and common extension reuse technology based on black and white vertex coding, which significantly deduplicates and optimizes to a greater extent than the existing technology; it has important technical significance and significant effects.

[0106] In one embodiment, a vertex blending extension acceleration module includes:

[0107] Drive the hybrid expansion unit, based on the cost model, combined with edge verification and set intersection, evaluate the various scenarios that different expansion strategies are suitable for, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy;

[0108] The expansion strategy adjustment unit adaptively adjusts the expansion strategy selection during the matching process according to the hybrid expansion strategy; when processing data graphs with large differences in data features, it adapts to multiple matching scenarios and accelerates the vertex expansion speed;

[0109] Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i For the edge verification strategy, it verifies that u iThe edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

[0110] The principle and effect of the above technical solution are as follows: a vertex hybrid expansion acceleration module, including: a driving hybrid expansion unit, based on a cost model driving, combined with edge verification and set intersection, evaluating the various scenarios adapted by different expansion strategies, so that different subgraph partial matches dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy; an expansion strategy adjustment unit, according to the hybrid expansion strategy, adaptively adjusts the expansion strategy selection during the matching process; when processing data graphs with large differences in data features, adapts to a variety of matching scenarios to accelerate the vertex expansion speed; based on a cost model driving, combined with edge verification and set intersection, evaluating the various scenarios adapted by different expansion strategies, so that different subgraph partial matches dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: driven by a cost model, evaluating the expansion costs of multiple strategies; subgraph matching realizes the matching process by expanding a query vertex in the query graph each time, setting the next query vertex to be u i For the edge verification strategy, it verifies that u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, the change in the length of each neighbor set will affect the amount of calculation for set intersection. The specific calculation process is as follows:

[0111] (1) Edge verification cost estimation: For a partial matching set to be expanded, denoted as M, it is a matching mapping of the first i query vertices in the query graph, and the matching order O is set to be the encoding order of the query vertices. Then consider the next vertex u to be expanded i , its backward neighbor set is denoted as N - (u i ). Then M expands u i The computational cost of the edge verification strategy is equal to the product of the number of edges that need to be verified and the average cost of verifying an edge; however, for various data structures used for edge checking, the cost of verifying a non-existent edge is T N and the cost T of verifying the existence of the edge E are different. Therefore, when estimating the edge verification cost, it is necessary to consider both the check of the non-existent edge and the check of the existing edge. Then it is defined as the sum of the cost of verifying the non-existent edge and the cost of verifying the existence of the edge (the parameter corresponding to the sum of the cost):

[0112]

[0113] where S is a subset of the set of backward neighbors, because in the extended u i Sometimes the calculation is divided into multiple steps, and only a part of the backward neighbors is selected each time. k is a query vertex in set S whose mapped data vertex has the smallest set of neighbors in M, N min It represents the smallest neighbor set. u is a probability, indicating that u and u i The query edge between them (denoted as e(u,u i ))) is the probability that an edge that actually exists in the data graph appears in the candidate edge set, that is, the probability that a candidate edge is proven to exist. u The calculation is as follows Figure 3 As shown;

[0114] (2) Estimation of the cost of set intersection: The present invention uses leapfrog connection to perform set intersection operations. Leapfrog connection is a method for intersecting multiple sets in existing work. Specifically, it first sets an iterator for each set. The iterator initially points to the first element of each set, and then cyclically compares the sizes of the current elements pointed to by the iterators of the two sets, that is, it continuously moves the iterator with the smaller element value backward, and continues to compare the set with the larger element value with the next set until the iterator of a certain set reaches the end position of the end of the set. Therefore, the cost of finding the intersection depends on the length of all adjacency lists involved in the intersection operation. The checking operation when using leapfrog connection to find the intersection is the process of continuously comparing whether two vertices are equal. The cost of setting such a comparison operation is T C , then the set intersection cost of M is defined as follows:

[0115]

[0116] where M(u) is the mapping data point of query vertex u in partial matching M, l i is the query vertex u i Vertex labels, N(M(u),l i ) is the data vertex M(u) with respect to label l i Neighbor list.

[0117] (3) After the cost estimates of different expansion strategies are obtained, the strategy selection is finally carried out through the following cost model. Specifically, when the function value of the following function is greater than 0, the set intersection strategy is selected. When it is less than 0, the edge verification effect is significantly improved.

[0118] F(M,S)=T EV (M,S)-T SI (M,S)

[0119] By combining edge verification and set intersection, we evaluate the various scenarios that different expansion strategies are suitable for, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy.

[0120] In one embodiment, the black and white vertex encoding module includes:

[0121] The query vertex numbering unit adopts efficient merging. Given a query graph Q and a matching order O, O is set to be sorted according to the number of query vertices, and merged at high speed during the matching process;

[0122] Guide the merging of black and white coding units to reduce repeated operations in the subgraph matching process. For each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

[0123] The principle and effect of the above technical solution are as follows: the black-and-white vertex coding module includes: a query vertex numbering unit, which adopts efficient merging to give a query graph Q and a matching order O, and sets O to be sorted according to the query vertex numbers, and merges at high speed during the matching process; guides the merging of black-and-white coding units to reduce repeated operations in the subgraph matching process, and for each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u iwill be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

[0124] In one embodiment, the public extension merging and aggregation module includes:

[0125] The matching and aggregation form unit matches and merges multiple shared computing parts into one aggregation form part according to the black and white vertex codes; and expands this group of partial matches at the same time;

[0126] Match and merge the calculation to remove duplicate units, and in the subsequent expansion process, partially match and merge the calculations in the aggregated form to perform forward-looking deduplication optimization and obtain public expansion results;

[0127] According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time;

[0128] When querying vertex u i When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

[0129] The principle and effect of the above technical solution are as follows: a common extension merging and aggregation module, including: a matching and aggregation form unit, which matches and merges multiple shared calculation parts into one aggregate form part according to black and white vertex coding; and simultaneously expands this group of partial matches; a matching and merging calculation deduplication unit, which performs forward-looking deduplication optimization on the aggregate form partial matching and merging calculation in the subsequent expansion process to obtain a common extension result; according to black and white vertex coding, multiple shared calculation parts are matched and merged into one aggregate form part; and simultaneously expands this group of partial matches, including: in order to share the extension calculation between multiple partial matches, the common extension merging technology will merge multiple partial matches into one aggregate embedding, and simultaneously expand this group of partial matches; when using the query vertex u i When the extension part matches M, it will be based on u i Multiple expansion results in multiple submatches. i is a white vertex, merging these submatches into a cohesive embedding; if u iis a black vertex, then each submatch can only be expanded individually; between the vertices u to be expanded i There are different black and white coding combinations between a vertex and its backward neighbors. When a vertex is expanded, there are four different expansion situations:

[0130] (1) Case 1: u i and its backward neighbors are all black vertices. Figure 4 As shown, due to u i All the backward neighbors of are black vertices, then the mapping of each black backward neighbor in M ​​is a unique data vertex. i The extended result R M (u i ) is obtained directly by expanding these data vertices using a hybrid strategy. i It is a black vertex, so these expansion results cannot be combined and used, so you need to use u i Each mapping of M is used to expand M separately. These submatches expanded from M have different computational behaviors in the next expansion;

[0131] (2) Case 2: u i is a white vertex but its backward neighbors are all black vertices. Figure 5 As shown, due to u i All backward neighbors of are still black vertices, so for u i The extended result R M (u i ) is the same as in case 1. However, due to u i becomes a white vertex, which is connected to the next vertex u to be expanded i+1 are not adjacent, then u i The expansion result of will not affect the subsequent expansion. Therefore, these expansion results are temporarily combined into a set for use. At this time, M will only expand an aggregate embedding;

[0132] (3) Case 3: u i is a black vertex, and there is a white vertex among its backward neighbors; more than the above two cases, at this time due to u i There is a white vertex in the backward neighbor of u i The expansion of M will no longer be a fixed expansion result; Figure 6 As shown, u i The mapping of the white backward neighbors in M ​​is a set of data vertices, where various data points will affect u i The expansion of u will have different effects, resulting in different expansion results; then it is necessary to consider splitting this aggregate embedding to ensure the correctness of the expansion; in the specific implementation, the algorithm will firsti Perform mixed expansion calculation on all black backward neighbors to obtain a u i The intermediate result set of u; if there is no black backward neighbor, the white backward neighbor with the least number of mappings will be selected, and then the neighbor lists of each mapped point will be unioned to form u i The intermediate result set; then, due to u i It is a black vertex, so each vertex v in this intermediate result set is used as u i The mapping of v is used to modify M in reverse, reduce the set of white backward neighbors, and generate a new partial match M related to v. v Finally, the algorithm expands each newly generated M v ;

[0133] (4) Case 4: u i is a white vertex, and there are white vertices among its backward neighbors; Figure 7 As shown, this situation means that u i and its white backward neighbors are all in the aggregated state, so should we continue to merge the white backward neighbors, or expand them by Cartesian product to merge u i This is a question that needs to be considered. It actually depends on the number of Cartesian product expansions and u i If the former is smaller, then split the aggregate embedding and execute the strategy of case 2 for each split sub-match; if the latter is smaller, u i Treat it as a black vertex and execute the strategy of Case 3 instead; try to maintain the partially matched extensions in a converged state before they diverge to reduce more repeated calculations.

[0134] In one embodiment, the common extension multiplexing module includes:

[0135] A search path pruning unit, which guides the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results;

[0136] The public extension reuse unit performs retrospective deduplication optimization of public extension reuse to avoid multiple calculations of the same extension results; it efficiently processes various forms of query graphs on data graphs of various features and sizes;

[0137] By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u iThe mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

[0138] The principle and effect of the above technical solution are as follows: the common extension reuse module includes: a search path pruning unit, which guides the pruning of search paths that produce duplicate results or cannot produce results by caching and reusing common extension results; a common extension reuse unit, which performs retrospective deduplication optimization of common extension reuse to avoid multiple calculations of the same extension results; efficiently processes various forms of query graphs on data graphs of various features and sizes; guides the pruning of search paths that produce duplicate results or cannot produce results by caching and reusing common extension results, including: common extension merging by merging the mapping data points of white vertices, and simultaneously expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u i, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; CEB (abbreviation of Common Extension Buffer) is set to represent the common extension buffer; the CEB structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current common extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start extending among its sibling embeddings, then it is necessary to calculate its extension normally, generate the common extension result, and update the corresponding cache area in the common extension buffer; after the modification, the valid bit will be set to true; if before extending M, it is found that the valid bit is already true, then the result of this extension has been recorded and does not need to be recalculated, and the common extension result in the common extension buffer can be directly reused; such as Figure 7 As shown, the backward neighbors of u4 are u0 and u1, and u2 and u3 are irrelevant vertices to u4. No matter how the mapping data points of u2 and u3 change, it will not affect the expansion result generated by u4. Therefore, the partial matches generated in the red dotted box are sibling embeddings, and the public expansion results cached in the public expansion buffer (u4) are reused. This significantly deduplicates and optimizes to a greater extent than the existing technology. It has important technical significance and significant effects.

[0139] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and implementation methods. They are fully applicable to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A subgraph matching method based on a hybrid expansion strategy and deduplication optimization, characterized in that: include: S10, through the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process, select the appropriate expansion strategy for the partial matching of different subgraphs, and accelerate the vertex expansion speed; S20, uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging; S30, according to the black and white vertex codes, multiple shared computing parts are matched and merged into an aggregated form part, and in the subsequent expansion process, the aggregated form part is matched and merged for calculation, and forward-looking deduplication optimization is performed to obtain a public expansion result; S40, by caching and reusing common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

2. The subgraph matching method based on hybrid expansion strategy and deduplication optimization according to claim 1 is characterized in that: S10 includes: S101, based on the cost model drive, combined with edge verification and set intersection, evaluates the various scenarios that different expansion strategies are adapted to, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy; S102, according to the hybrid expansion strategy, adaptively adjust the expansion strategy selection during the matching process; when processing data graphs with large differences in data features, adapt to multiple matching scenarios to accelerate the vertex expansion speed; Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i ; For the edge verification strategy, it verifies u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

3. The subgraph matching method based on hybrid expansion strategy and deduplication optimization according to claim 1 is characterized in that: The S20 includes: S201, using efficient merging, given a query graph Q and a matching order O, setting O to be sorted according to the numbers of the query vertices, and merging at high speed during the matching process; S202, reduce repeated operations in the subgraph matching process, for each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

4. The subgraph matching method based on hybrid expansion strategy and deduplication optimization according to claim 1 is characterized in that: S30 includes: S301, merging multiple shared computing partial matches into an aggregated form portion according to black and white vertex codes; and expanding this group of partial matches at the same time; S302, in the subsequent expansion process, partially match and merge the aggregated forms, perform forward-looking deduplication optimization, and obtain a common expansion result; According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time; When querying vertex u i When the extension part matches M, it will be based on u i The multiple expansion results in multiple submatches; if u i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

5. The subgraph matching method based on hybrid expansion strategy and deduplication optimization according to claim 1, characterized in that: S40 includes: S401, guiding the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results; S402, perform retrospective deduplication optimization for public extension reuse to avoid multiple calculations of the same extension result; efficiently process various forms of query graphs on data graphs of various features and sizes; By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u i The mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

6. A subgraph matching system based on a hybrid expansion strategy and deduplication optimization, characterized in that: include: Vertex hybrid expansion acceleration module, through hybrid expansion strategy, adaptively adjusts the expansion strategy selection during the matching process, selects appropriate expansion strategy for partial matching of different subgraphs, and accelerates the vertex expansion speed; The black and white vertex encoding module uses efficient merging to reduce repeated operations in the subgraph matching process and performs black and white vertex encoding to guide merging; The public extension merging and aggregation module matches and merges multiple shared computing parts into an aggregated form part according to the black and white vertex codes. In the subsequent expansion process, the aggregated form parts are matched and merged for forward-looking deduplication optimization to obtain the public extension results. The common extension reuse module caches and reuses common extension results, guides the pruning of search paths that produce duplicate results or cannot produce results, performs retrospective deduplication optimization of common extension reuse, and efficiently processes various forms of query graphs on data graphs of various features and sizes.

7. The subgraph matching system based on hybrid expansion strategy and deduplication optimization according to claim 6, characterized in that: Vertex blending extension acceleration module, including: Drive the hybrid expansion unit, based on the cost model, combined with edge verification and set intersection, evaluate the various scenarios that different expansion strategies are suitable for, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy; The expansion strategy adjustment unit adaptively adjusts the expansion strategy selection during the matching process according to the hybrid expansion strategy; when processing data graphs with large differences in data features, it adapts to multiple matching scenarios and accelerates the vertex expansion speed; Based on the cost model drive, combined with edge verification and set intersection, the various scenarios adapted by different expansion strategies are evaluated, so that different subgraph partial matches can dynamically adjust the selected expansion strategy during the expansion process, select appropriate expansion strategies for different subgraph partial matches, and build a hybrid expansion strategy, including: through the cost model drive, evaluate the expansion costs of multiple strategies; subgraph matching expands one query vertex in the query graph each time to realize the matching process, and sets the next query vertex to be u i ; For the edge verification strategy, it verifies u i The edge existence relationship of each candidate point in the candidate vertex set is determined by u. i The size of the candidate vertex set, u i The candidate vertex set of is obtained by filtering the data graph; for the set intersection strategy, it needs to let u i The neighbor sets of the mapped data points of each backward neighbor of intersect, that is, obtain the common elements of these sets, where u i The backward neighbor is u i Matches before and with u i Therefore, changes in the length of each neighbor set will affect the amount of computation required to find the intersection of the sets.

8. The subgraph matching system based on hybrid expansion strategy and deduplication optimization according to claim 6, characterized in that: Black and white vertex encoding module, including: The query vertex numbering unit adopts efficient merging. Given a query graph Q and a matching order O, O is set to be sorted according to the number of query vertices, and merged at high speed during the matching process; Guide the merging of black and white coding units to reduce repeated operations in the subgraph matching process. For each query vertex u i If it does not match u i+1 connected or it is the last query vertex, then u i will be encoded as a white vertex; if u i and u i+1 There is an edge connecting them, u i Will be encoded as black vertices, and the black and white vertex encoding will be used to guide the merging.

9. The subgraph matching system based on hybrid expansion strategy and deduplication optimization according to claim 6, characterized in that: Public extension merge aggregation module, including: The matching and aggregation form unit matches and merges multiple shared computing parts into one aggregation form part according to the black and white vertex codes; and expands this group of partial matches at the same time; Match and merge the calculation to remove duplicate units, and in the subsequent expansion process, partially match and merge the calculations in the aggregated form to perform forward-looking deduplication optimization and obtain public expansion results; According to the black-white vertex encoding, multiple shared computation partial matches are merged into an aggregate form partial; and the set of partial matches are expanded at the same time, including: in order to share the expansion computation between multiple partial matches, the common expansion merging technique merges multiple partial matches into an aggregate embedding, and the set of partial matches are expanded at the same time; When querying vertex u i When the extension part matches M, it will be based on u i The multiple expansion results in multiple submatches; if u i is a white vertex, merging these submatches into a cohesive embedding; if u i is a black vertex, then each submatch can only continue to expand individually.

10. The subgraph matching system based on hybrid expansion strategy and deduplication optimization according to claim 6, characterized in that: Public extension reuse modules, including: A search path pruning unit, which guides the pruning of search paths that produce duplicate results or fail to produce results by caching and reusing common extension results; The public extension reuse unit performs retrospective deduplication optimization of public extension reuse to avoid multiple calculations of the same extension results; it efficiently processes various forms of query graphs on data graphs of various features and sizes; By caching and reusing the common extension results, the search paths that produce duplicate results or cannot produce results are guided to be pruned, including: common extension merging by merging the mapping data points of the white vertices, and expanding the mapping data points in subsequent matching; for the vertex u to be expanded i , if both parts match in u i The mappings on the backward neighbors of are exactly the same, then their extension calculations are shared, and such partial matches are called sibling embeddings; when one of the sibling embeddings calculates the extension result, these common extension results are reused between the sibling embeddings; therefore, the common extension buffer structure is used to cache the common extensions between the sibling embeddings, obtain the common extension results, and reuse the common extension results; the common extension buffer includes a valid bit and a cache area. When the extension partially matches M, first check whether the current public extension buffer valid bit is true or false; if the valid bit is false, it means that M is the first one to start expanding among its sibling embeddings, so it needs to be calculated normally Its extension generates a public extension result and updates the corresponding cache area in the public extension buffer; after the modification, the valid bit will be set to the true value true; if before extending M, it is found that the valid bit is already the true value true, then the result of this extension has been recorded and does not need to be recalculated, and the public extension result in the public extension buffer can be reused directly; u4's backward neighbors are u0 and u1, u2 and u3 are irrelevant vertices for u4, no matter how the mapping data points of u2 and u3 change, it will not affect the extension result generated by u4; therefore, the partial matches generated in the red dotted box are all sibling embeddings, and the public extension results cached in the public extension buffer (u4) are reused.

Citation Information

Cited By

  • Incremental dynamic hypergraph matching method taking overlapping as center

    CN121564373A