Graph structure data retrieval method and device based on hierarchical perception neural sub-graph matching

By constructing the NC-Iso model, the problems of low computational efficiency and inaccurate matching results in subgraph matching are solved, achieving efficient and accurate graph pair matching and ranking capabilities, which are suitable for applications such as bioinformatics molecular alignment.

CN120910320APending Publication Date: 2025-11-07SCHOOL OF INFORMATION & COMM TECH NAT UNIV OF DEFENSE TECH OF THE CHINESE PEOPLES LIBERATION ARMY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510853051.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing technologies for subgraph matching suffer from low computational efficiency, inability to effectively handle differences in graph pair size, and lack of discriminative power in hinge distance metrics, resulting in inaccurate matching results and difficulty in sorting.

Method used

We construct an NC-Iso model based on hierarchical perceptual neural subgraph matching. The hierarchical dependency relationship is established in the root subtree of the node through the hierarchical perceptual GNN encoder. The hinge distance is normalized into an inclusion score using a similarity metric unit. The similarity advantage ratio is used to quantify the similarity and dissimilarity between graph pairs, forming a simple and effective neural subgraph matching architecture.

Benefits of technology

It improves the retrieval efficiency and accuracy of subgraph matching, can effectively handle differences in graph pair size, maintains a consistent hierarchical structure, has sorting capabilities, and is suitable for tasks that require evaluation of matching results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910320A_ABST
    Figure CN120910320A_ABST
Patent Text Reader

Abstract

The invention discloses a graph structure data retrieval method and device based on hierarchical perception neural sub-graph matching, and the method comprises the steps: S01, constructing an NC-Iso model, capturing the hierarchical relationship between the adjacent steps of a sub-tree and retaining the relative position between nodes in the sub-tree by constructing the adjacent hierarchical dependence between the steps in a node root sub-tree, and obtaining a NC-Iso model; normalizing the hinge distance into an inclusion score, quantizing the similarity and dissimilarity between the input graph pairs by using a similarity dominance ratio, and calculating a similarity score predicted value between the graph pairs according to the inclusion score and the similarity dominance ratio; s02, training the constructed NC-Iso model, and obtaining a graph structure data matching model after training is completed; and S03, obtaining a to-be-matched input graph pair, inputting the to-be-matched input graph pair into the graph structure data matching model, and obtaining retrieval result output. The method has the advantages of being simple in implementation method, high in retrieval matching efficiency and precision, high in generalization ability and mobility and the like.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of graph structure data retrieval, and particularly relates to a graph structure data retrieval method and device based on hierarchical perception neural subgraph matching. BACKGROUND

[0002] The subgraph matching problem aims to determine whether a subgraph in a data graph matches a query graph, and is the basis for many practical applications in the real world, such as social network specific user group retrieval, bioinformatics molecular structure comparison, and financial fraud detection. Traditional methods usually define subgraph matching as a combinatorial optimization problem, which ensures topological consistency by finding an exact node bijection between the query graph and the data graph subgraph. However, this usually requires exponential time cost.

[0003] The subgraph matching task is challenging due to the need for extensive time for combinatorial search. To solve the computational efficiency problem, with the development of deep learning technology, graph neural network-based methods use GNN encoders to extract graph information, and then use hinge distance metrics to measure containment constraints in the embedding space to solve this problem. However, such neural subgraph matching methods ignore the scale difference between graph pairs in the encoding process, and only focus on feature counting without considering the relative position of features in the node root subtree, which interferes with the satisfaction of containment constraints. In addition, the hinge distance metric lacks discriminability for matching graph pairs and cannot be applied to tasks that require ranking of matching results. SUMMARY

[0004] The technical problem to be solved by the present application is that in view of the technical problems existing in the prior art, the present application provides a graph structure data retrieval method and device based on hierarchical perception neural subgraph matching, which has the advantages of simple implementation method, high retrieval efficiency, strong generalization ability and strong migration ability.

[0005] To solve the above technical problems, the technical solution provided by the present application is: A graph structure data retrieval method based on hierarchical perception neural subgraph matching, comprising the following steps: Step S01. Model construction: constructing an NC-Iso model for neural subgraph matching to make predictions, the NC-Iso model comprising a hierarchical-aware GNN encoder, a graph summarization unit and a similarity measurement unit connected in sequence, the hierarchical-aware GNN encoder being used for feature encoding of input graph pairs to form node representations, the graph summarization unit being used for graph summarization of node representations output by the GNN encoder to generate graph-level representations, the similarity measurement unit being used for measuring similarity between input graph pairs according to graph-level representations output by the graph summarization unit, in the hierarchical-aware GNN encoder, adjacent hierarchical dependencies between levels in a root sub-tree of a node are constructed based on a sequential Combine function by taking the representation of a root node from a previous layer and aggregated information from a neighborhood as a sequence to explicitly capture hierarchical relationships between adjacent levels in a sub-tree and preserve relative positions between nodes in the sub-tree, in the similarity measurement unit, a hinge distance is normalized into an inclusivity score to evaluate inclusivity between graph pairs, and a similarity dominance ratio is used to quantify the degree of similarity and dissimilarity between input graph pairs, a similarity score prediction value between graph pairs is calculated according to the inclusivity score and the similarity dominance ratio, the similarity dominance ratio being a difference value between a similarity degree value of graph pairs and a dissimilarity degree value between graph pairs; Step S02. Model training: training the constructed NC-Iso model using a training set composed of different input graph pairs, the training process minimizing the distance between the similarity score prediction value and the similarity score true value of input graph pairs, and obtaining a graph structure data matching model after training is completed, the input of the model being an input graph pair composed of a data graph and a query graph, and the output being a matching result of whether a subgraph of the query graph matches the data graph; Step S03. Graph pair matching retrieval: obtaining an input graph pair composed of a data graph to be matched and a query graph, inputting into the graph structure data matching model after training to obtain a similarity score prediction value, and judging whether the input graph pair matches according to the similarity score prediction value.

[0006] Further, in the hierarchical-aware GNN encoder, first, a linear layer is used to convert discrete node labels into one-hot encoding in continuous space and as node initialization features, in the Combine step of the message passing process, the hierarchy of the root node sub-tree is modeled to give the GNN encoder hierarchical awareness, a gated recurrent unit GRU is used as a sequential Combine function, the output of the aggregation function and the hidden state of the root node in the previous layer are used as inputs, the hierarchy of the root node sub-tree is taken as a sequence element to establish a hierarchical dependency relationship within the sub-tree in a top-down manner, and two MLP layers are used as a learnable hash function to ensure the injectivity of feature mapping, wherein the updated node representation of node v at the jth layer is as follows:

[0007] where, denotes a two-layer MLP layer, Aggr is an aggregation function, is the representation of node v at the j-1th layer, is the neighbor node of node v, is the subtree of node v, is the node representation of node v at the j-1th layer.

[0008] Further, the graph summarization unit uses Max operator for graph summarization, and uses Mean operator to generate graph-level representation containing multi-scale node representation, and the calculation expression is:

[0009] where, is the node representation vector of node v at the jth layer of GNN, is the graph-level representation vector of graph G at the jth layer, k is the number of GNN layers, is the graph-level representation containing multi-scale node representation.

[0010] Further, the similarity measurement unit normalizes the hinge distance to the inclusive score according to the following formula:

[0011] where, Q is the query graph, D is the data graph, d represents the feature dimension index, exp() is a mapping function mapped to (0, 1], , and are the representations of the query graph Q and the data graph D in the embedding space, respectively.

[0012] Further, the similarity measurement unit calculates the similarity advantage ratio as follows: Two auxiliary functions are defined as follows:

[0013] where, represents the intersection of the feature multi-set of the graph pair in the embedding space, is used to calculate the minimum embedding containing and feature multi-sets in the embedding space; The calculation expression of the similarity advantage ratio is:

[0014] where, is the representation of the data graph in the embedding space, to evaluate the degree of common elements, i.e. the similarity degree, shared by the query graph Q and the data graph D, to evaluate the degree of normalized dissimilarity of the query graph Q with respect to the data graph D, to quantify the difference between the query graph and the data graph, the similarity advantage ratio SDR the value range of (Q, D) is -1 indicates that the query graph Q is completely different from the data graph D, and 1 indicates that the query graph Q is completely identical to the data D. Q Q

[0015] Further, the similarity degree measurement unit calculates the similarity degree prediction score between the graph pair according to the containment score, the similarity advantage ratio, according to the following formula:

[0016] wherein, represents the containment score between the query graph Q and the data graph D, represents the similarity advantage ratio between the query graph Q and the data graph D.

[0017] Further, in step S02, the mean square error loss function is used in the training process to minimize the distance between the similarity score prediction value and the similarity score true value of the input graph pair:

[0018] wherein, represents the similarity degree prediction score between the query graph Q and the data graph D obtained using the NC-Iso model, represents the similarity score true value between the query graph Q and the data graph D; In step S03, if the similarity degree prediction score between the query graph Q and the data graph D obtained using the NC-Iso model is greater than a preset threshold τ, it is determined that the input picture is matched, otherwise it is determined that it is not matched.

[0019] Further, the application is applied to bioinformatics molecular alignment in drug manufacturing, the input graph pair is the drug molecular structure graph of a new drug and the drug molecular structure graph of a known effective drug, each atom in the drug molecular structure graph is defined as a node, a chemical bond is defined as an edge, an atom class is defined as a node feature label, and a key functional structure with a specified effect is defined as a subgraph, the NC-Iso model is trained using a training set composed of different pairs of drug molecular structure graphs, and after the training is completed, a matching model is obtained, when the drug molecular structure graph of the new drug to be matched and the drug molecular structure graph of the known effective drug are obtained, they are input into the matching model to evaluate the similarity of the key functional structure between the drug molecular structure graph of the new drug and the drug molecular structure graph of the known effective drug, and whether the new drug has the specified effect is predicted according to the matching result. ​​

[0020] A computer device comprising a processor and a memory for storing a computer program, the processor being configured to execute the computer program to perform the method as described above.

[0021] A computer-readable storage medium storing a computer program which, when executed by a processor, performs the method as described above.

[0022] Compared with the prior art, the present application has the following beneficial effects: 1、The present application can eliminate the influence of the size gap of the graph pair on the containment constraint by constructing a neural subgraph matching architecture NC-Iso based on hierarchical perception, establishing a hierarchical dependency relationship between each level in the node root sub-tree, ensuring that the matched graph pair maintains a consistent hierarchical structure on the basis of meeting the feature count containment, forming a neural subgraph matching predictor based on the containment constraint, and realizing a simple and effective architecture for neural subgraph matching, so that the retrieval and matching of the similarity between the input graph pair can be efficiently realized.

[0023] 2、The present application can reduce the influence of the size difference of the graph pair in the coding stage by retaining the organization form of the nodes in the node root sub-tree and the relative positions between the nodes by using the NC-Iso architecture, explicitly expressing the relative positions between the nodes through the edges, and connecting adjacent levels in the sub-tree through the edges in the sub-tree, thereby establishing the adjacent hierarchical dependency between the levels in the root sub-tree, ensuring that the matched graph pair maintains a consistent hierarchical structure while meeting the feature count containment constraint, and further improving the matching accuracy.

[0024] 3、The present application can solve the limitations of the hinge distance measurement used in traditional methods by normalizing the hinge distance to a containment score, avoid the occurrence of extreme values, and at the same time, by quantifying the similarity and dissimilarity between the graph pairs as a similarity advantage ratio, the model can also be given the ability of ranking, which is convenient for quickly determining the best matching graph pair, thereby providing more effective and flexible evaluation, further improving the efficiency and accuracy of the matching. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 is a comparison diagram of the effect of the traditional GNN using the permutation invariant Combine function and the GNN using the sequential Combine function of the present embodiment.

[0026] Figure 2 is a flowchart of the implementation of the graph structure data retrieval method based on the hierarchical perception neural subgraph matching of the present embodiment.

[0027] Figure 3 is a schematic diagram of the implementation principle of the NC-Iso model architecture constructed by the present embodiment.

[0028] Figure 4 is a schematic diagram of the effect of the present embodiment on normalizing the hinge distance and considering the similarity and dissimilarity ratio between the query graph and the data graph.

[0029] Figure 5 is a schematic diagram of the results of the average AUROC and accuracy of five runs of the subgraph matching task in the specific application embodiment.

[0030] Figure 6 is a schematic diagram of the matching pair ranking results obtained using different algorithms in the specific application embodiment. DETAILED DESCRIPTION

[0031] The present application is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the scope of protection of the present application is not limited thereby.

[0032] First, the technical background related to the present application is exemplarily introduced.

[0033] The existing neural subgraph matching algorithms can generally be divided into two categories: exact algorithms and approximate algorithms. The exact algorithm solves the subgraph matching problem by finding all possible occurrences of the query graph in the data graph, which requires the use of a costly combination search strategy, has high computational complexity, and is difficult to extend to larger scale query graphs. In order to overcome this limitation, approximate algorithms have emerged, and similarity metrics (such as graph edit distance) and label similarity are used to enhance the fault tolerance of the approximate method. However, due to the heavy reliance on shallow node representation, the search space is greatly reduced, thus greatly affecting the accuracy of the algorithm.

[0034] The neural subgraph matching method can accelerate the subgraph matching calculation, which uses the message passing mechanism of the graph neural network (GNN) to generate graph representation, and performs subgraph matching prediction by detecting whether the graph representation meets the containment constraint. The neural subgraph matching method uses a graph neural network encoder to learn the graph representation, and judges the subgraph matching in the embedding space through the hinge distance metric. These methods relax the subgraph matching problem by detecting whether the embeddings meet the containment constraint. The containment constraint can be used as a necessary condition for subgraph matching, and is used as an inductive bias in the model. For example, NeuroMatch models the containment constraint between matching graph pairs at the graph level representation level, on the contrary, IsoNet and D2Match detect whether the containment constraint is met at the edge level or node level, and use Gumbel-Sinkhorn network or perfect bipartite matching technology to predict the whole graph. However, the above existing methods cannot handle the size difference between graph pairs, which affects the matching results. In addition, these models usually use hinge distance metrics, which cannot capture the matching degree of matching pairs, thus limiting their application to real-world scenarios that require ranking of subgraph matching degrees.

[0035] The hinge distance measurement is further used to detect violation of the containment constraint, thereby quickly filtering out the mismatched graph pairs. Among them, the fine-grained node / edge-based comparison method uses graph matching techniques (such as Gumbel-Sinkhorn network or perfect bipartite matching) on the learned node / edge alignment to evaluate the containment constraint violation. However, these methods force a one-to-one matching relationship between the query graph and the data graph node pairs, which is not suitable for mismatched graph pairs and graph pairs where only part of the nodes can be matched. At the same time, the time complexity of such fine-grained methods is quadratic to the number of nodes / edges, which cannot effectively handle graphs with hundreds of millions of nodes / edges. In contrast, the coarse-grained neural subgraph matching method directly evaluates the containment constraint violation at the graph level, which is more efficient in both training and inference stages, providing a faster solution for subgraph matching.

[0036] However, the current coarse-grained neural subgraph matching method faces the following two main challenges: (1) Difficulty in handling the size difference of graph pairs in the encoding stage. The coarse-grained neural subgraph matching method imposes a containment constraint on the representation generated by the GNN encoder, which only focuses on the number of features in the root node sub-tree, ignoring the organization form of the features. Therefore, in terms of feature count, the root node with a larger sub-tree may inadvertently contain the root node with a smaller sub-tree, thereby interfering with the judgment of the containment constraint, leading to incorrect matching results.

[0037] (2) Lack of discrimination in hinge distance measurement for matched graph pairs. In existing technologies, the hinge distance measurement usually assigns all matched data graph-query graph pairs as zero distance, which although can satisfy the containment constraint, hinders the ability to sort the matching pairs, resulting in a lack of discrimination among the matching graph pairs. The discrimination of matching graph pairs is crucial for the retrieval task and the recommendation system to find the best match, and using the discrimination of matching graph pairs can also help applications such as drug discovery, social network analysis, etc. to preferentially select matching pairs for further analysis.

[0038] The present application proposes a new neural subgraph matching architecture NC-Iso model based on graph neural network, which uses the GNN encoder to establish the hierarchical dependency relationship between adjacent levels in the node root sub-tree to preserve the relative position of the features, ensuring that the matched graph pairs not only meet the containment constraint in terms of feature count, but also maintain consistent hierarchical structure, while using hinge distance normalization as a containment constraint compliance score, and using a similar advantage ratio to enhance the measurement of the similarity and dissimilarity between the matching graph pairs, which can improve the sorting ability of the matching graph pairs, quantify the advantage of the similarity and dissimilarity between the graph pairs, and thus facilitate the rapid determination of the best matching graph pair.

[0039] Specifically, the NC-Iso model constructed in this invention includes a GNN encoder, a graph summarization unit, and a similarity measurement unit connected sequentially. The GNN encoder encodes the input graph pairs (query graph, data graph) using a sequential combine function to form node representations. The graph summarization unit summarizes the node representations output by the GNN encoder to generate graph-level representations. The similarity measurement unit measures the similarity between input graph pairs based on the graph-level representations output by the graph summarization unit, forming a hierarchical-aware neural subgraph matching architecture. The GNN encoder establishes hierarchical dependencies between each level within the root subtree of a node using a sequential combine function to eliminate the impact of graph pair size differences on inclusion constraints. This ensures that matched graph pairs maintain a consistent hierarchical structure while satisfying feature count inclusion, forming a neural subgraph matching predictor based on inclusion constraints. This provides a simple and effective architecture for neural subgraph matching. Furthermore, by preserving the organization of nodes in the root subtree and the relative positions between nodes, the impact of graph size differences during the encoding stage can be mitigated. Furthermore, since the relative positions between nodes are explicitly expressed through edges, and edges within subtrees connect adjacent steps, the GNN encoder in the NC-Iso model of this invention, by constructing adjacent hierarchical dependencies between steps in the root subtree, can ensure that matched graph pairs maintain a consistent hierarchical structure while satisfying the feature count inclusion constraint, thereby improving the accuracy of graph pair matching. Simultaneously, inspired by GIoU loss, this invention employs a novel similarity metric in the similarity measurement unit, normalizing the hinge distance into a compliance score for inclusion constraints to evaluate the inclusion between graph pairs. This addresses the limitations of traditional methods using hinge distance metrics and avoids extreme values. Moreover, by normalizing the similarity and dissimilarity metrics between graph pairs into the similarity advantage ratio (SDR), the model is endowed with ranking capabilities, providing a more effective and flexible evaluation.

[0040] The technical terms and basic principles involved in this invention will be further explained.

[0041] Symbol representation: This invention addresses undirected connected graphs where nodes are labeled, and can be represented as follows: ,in It is a set of vertices with a number of nodes. , It is an adjacency matrix. It is a node label table. This is the node feature matrix, typically initialized based on node labels. Each node... With a label Related. Therefore, a graph can be represented by a multiset. This multiset is indicated by... Through function Each representative element is obtained. The number of times it appears. If yes A subset of satisfies , Given data graph ,like yes The subgraph, then , And the adjacency matrix yes A subset of. Represents vertices The k-th order neighborhood, where .

[0042] Definition (Subgraph Matching): Query graph With data chart D subgraph D A match is made if and only if there exists a bijective function. , so that (1) for If a corresponding tag exists, then (2) For Then it is called Q and D subgraph D A match is formed, and P is called a solution. To the number of solutions, This constitutes a set of subgraph matching pairs. The present invention further... Represented as Clearly, for non-matching pairs, there exists a partial solution. ,in It is a partial solution set. and .

[0043] Observation 1 (Containment): For any Yes, solving P can be done using a node alignment matrix. It means that, among them This indicates that node i and node j are matched. After node alignment, for ,exist , yes The submatrix of can be represented as: (1) In the above formula, the upper part represents The subgraph matching is in node / edge level fine-grained containment, and the lower inequality means that the sum of each item is non-negative, representing the coarse-grained containment at the graph level. This property can be extended to the subgraph level, where the k-order neighborhood of the data graph node / edge contains the k-order neighborhood of the corresponding query graph node / edge.

[0044] GNN-based containment constraint: Given the feature multiset of the input graph The containment constraint focuses on the feature count. The message passing graph neural network (MPNN) operates on the node root sub-tree, aggregates on the neighborhood node feature multiset, and updates the representation of the root node. For the sake of simplicity, the present invention refers to the MPNN as GNN. For any matched node pair , the k-order neighbor of node and the k-order neighbor subgraph matching centered at node , that is The aggregated information contains the aggregated message of node . Inspired by this association between the two, the present invention uses GNN in the subgraph matching task, where the node in the graph at the j-th layer encoding process can be represented as: (2) Where represents the j-order multiset of node , represents the first-order neighbor of node , represents the aggregated information from the neighbors of node , combines the representation of the last layer of node and the aggregated neighbor information of the current layer, is a learnable hash function, and since the graph structure is unordered, the Aggr function and the Combine function can use the Sum, Mean, and Max functions with the permutation invariance property. In order to embody the containment constraint, for the node in the query graph and the data graph node to be matched, the node representation should contain the node representation in each dimension. For , each node in the query graph should be contained by at least one node in the data graph , so at the graph level, should contain in each dimension.

[0045] Further analysis of the neural subgraph matching problem: Neural subgraph matching formal definition: Given a pair of graphs as input, neural subgraph matching usually contains two stages: (1) encoding stage: the node feature sets of the two graphs are mapped to the feature space ; (2) scoring stage: based on distance or similarity measure function, the total matching score of the learned alignment matrix is evaluated using fine-grained node / edge comparison method, and the matching score is calculated at the graph level using coarse-grained graph-level comparison method.

[0046] Traditional neural subgraph matching methods focus on imposing inclusion constraints on the representations generated by GNN encoders, which mainly consider the count of features without considering the organization form of features, i.e. the relative position of nodes. When only based on feature count, the probability of a larger scale graph containing a smaller scale graph is increased, leading to incorrect matching results, so the traditional matching method will be affected by the size difference between the graph pair. Since GNN runs in the form of node-rooted sub-tree, the definition of subgraph matching is extended to the sub-tree level to highlight the importance of the relative position between features or nodes in these sub-trees.

[0047] Definition of sub-tree level subgraph matching: for any matched node pair , satisfying , where is a node-rooted sub-tree, then there exists a solution P such that (1) all nodes can find a unique corresponding node in , (2) for all , there exists .

[0048] From the above (2) requirement, the importance of first-order relative position can be seen, which can be extended to k-order relative position consistency between the matched graph pair, i.e. for any order k, , it should satisfy , is the k-th power of the adjacency matrix. In the root node sub-tree, the edges connect adjacent sub-tree levels. Therefore, the relative position between nodes can be expressed by the edge connection, and the relative position information can be captured by preserving the adjacent sub-tree levels.

[0049] GNN establishes the relationship between the root node and its aggregated neighborhood in the Combine stage, and under this guidance, the invention focuses on the Combine function within the GNN, which is the key to preserving the hierarchical relationship. Considering that the permutation-invariant Combine function is used in the prior art, which regards the root node and aggregated neighbors as unordered multisets, it will lead to sub-tree level insensitivity, which may result in the loss of hierarchical relationship information. ​

[0050] The subtree hierarchy insensitivity problem is as follows: given an arbitrary root node representation , its aggregated neighborhood information , and a permutation-invariant function: (1) for the function, if no bias term is used, the Combine function satisfies: (3) With this function, it is impossible to distinguish between root nodes and neighbor nodes.

[0051] (2) for the function, a bias term ξ can be used to help generate a hierarchy-weighted multiset. However, this bias term still cannot model the hierarchy structure in the subtree in nature.

[0052] This problem is illustrated in Figure 1 , for two root nodes , in the root node subtree, a GNN using a permutation-invariant Combine function can have difficulty distinguishing between and . In contrast, the order Combine function, due to the introduction of hierarchy awareness, makes and distinguishable. Therefore, the containment constraint in the traditional method can be seen as a containment constraint on the subtree augmented multisets, where the representation of a root node with a larger subtree (i.e., a larger neighborhood) can inadvertently contain the representation of a mismatched node with a smaller subtree, which limits the expressiveness of the node representation and further damages the expressiveness of the graph-level representation, leading to incorrect matches.

[0053] To detect whether the containment constraint is violated, a scoring approach using the hinge distance metric can be used, which is expressed as: (4) where ensures the non-negativity of the metric value. The metric result takes a value in the range . represents the query graph , the i-th dimension in the representation space is not contained by the data graph , violating the containment constraint. Therefore, if , the containment constraint is satisfied, i.e., .

[0054] Although the above scoring method can evaluate the violation of the containment constraint, there are still three major drawbacks. First, the method lacks a clear reference point, making it difficult to consistently compare distance scores. Second, a single extreme score can distort the distance between graph pairs. In addition, this scoring method assigns a zero distance to all matching pairs, which cannot distinguish the relative matching degree of matching pairs and cannot be applied to applications that require ranking of matching results.

[0055] The present application can ensure that the matched graph pair not only meets the containment constraint in feature counting, but also maintains a consistent hierarchical structure, thereby improving the matching accuracy, and in the similarity measurement stage, the hinge distance is normalized as a containment score (a compliance score of the containment constraint) to evaluate the containment between the input graph pairs, and the similarity advantage ratio is used to quantify the degree of similarity and dissimilarity between the input graph pairs, and the containment score and the similarity advantage ratio are integrated as a similarity measure to measure the similarity between the input graph pairs, which can improve the ranking ability of the matched graph pair, quantify the advantage of the similarity and dissimilarity between the graph pairs, and thus facilitate the rapid determination of the best matching graph pair.

[0056] The present application will be further described below in conjunction with specific embodiments.

[0057] As shown in Figure 2 , 3 The steps of the graph structure data retrieval method based on the hierarchical perception neural subgraph matching of the present embodiment include: Step S01. Model construction: constructing an NC-Iso model for neural subgraph matching to make predictions, the NC-Iso model comprising a hierarchical-aware GNN encoder, a graph summarization unit and a similarity measurement unit connected in sequence, the hierarchical-aware GNN encoder being used for feature encoding of input graph pairs to form node representations, the graph summarization unit being used for graph summarization of node representations output by the GNN encoder to generate graph-level representations, the similarity measurement unit being used for measuring the similarity between input graph pairs according to the graph-level representations output by the graph summarization unit, in the hierarchical-aware GNN encoder, the adjacent hierarchical dependencies between levels in the root sub-tree of a node are constructed based on the sequential Combine function by taking the representation of the root node from the previous layer and the aggregated information from the neighborhood as a sequence to explicitly capture the hierarchical relationship between adjacent levels in the sub-tree and preserve the relative positions between nodes in the sub-tree, in the similarity measurement unit, the containment score is normalized from the hinge distance to evaluate the containment between graph pairs, and the similarity advantage ratio is used to quantify the degree of similarity and dissimilarity between input graph pairs, and the similarity score prediction value between graph pairs is calculated according to the containment score and the similarity advantage ratio, the similarity advantage ratio being the difference between the similarity degree value of the graph pair and the dissimilarity degree value between the graph pair; Step S02. Model training: training the constructed NC-Iso model using a training set composed of different input graph pairs, the training process minimizing the distance between the similarity score prediction value and the similarity score true value of the input graph pair, and obtaining a graph structure data matching model after training, the input of the model being an input graph pair composed of a data graph and a query graph, and the output being a matching result of whether the subgraph of the query graph matches the data graph; Step S03. Graph matching: obtaining an input graph pair composed of a data graph to be matched and a query graph, inputting the input graph pair into the trained graph structure data matching model to obtain a similarity score prediction value, and determining whether the input graph pair matches according to the similarity score prediction value.

[0058] The present embodiment can explicitly capture the hierarchical relationship by constructing the hierarchical dependency relationship in the sub-tree by taking the representation of the root node from the previous layer and the aggregated information from the neighborhood as a sequence, and ensure that the matched graph pair maintains consistent hierarchical relationship, and in order to solve the problem that the existing metrics used in the scoring stage are not sensitive to the matching degree, a new similarity measurement is adopted, as shown in Figure 4 The hinge distance is normalized into a containment score to reduce the influence of extreme scores, and the similarity advantage ratio SDR is used to quantify the similarity and dissimilarity between graph pairs, thereby effectively giving the model the ranking ability based on the similarity advantage ratio (SDR).

[0059] In this embodiment, the hierarchical-aware GNN encoder is used in the subgraph matching task. First, a linear layer is used to convert the discrete node label into one-hot encoding in continuous space. In order to endow the GNN encoder with hierarchical awareness, this embodiment models the hierarchy of the root node sub-tree in the Combine step of the message passing process. Wherein the node v updates the node representation at the jth layer as follows: (5) wherein, represents two-layer MLP, Aggr is the aggregation function, is the node representation of the node v at the jth layer, is the node representation of the node v at the j-1th layer, is the neighbor node of the node v, is the sub-tree of the node v, is the node representation of the node v at the j-1th layer.

[0060] As shown in the above formula (5), this embodiment specifically uses the gated recurrent unit GRU as the Combine function, and the GRU takes the output of the aggregation function (i.e. the sub-tree of the node v ) and the hidden state of the root node v at the last layer as inputs, by regarding the hierarchy of the root node sub-tree as a sequence element, the NC-Iso establishes a hierarchical dependency relationship in the sub-tree in a top-down manner, and then uses two-layer MLP as a learnable hash function to ensure the injectivity of feature mapping.

[0061] In this embodiment, since the query graph is smaller than the data graph in size, the Max operator is used for graph summarization to generate a graph-level representation containing multi-scale node representations. The Max operator can focus on capturing the most significant features, and is independent of the size of the graph pair, while the traditional Sum and Mean operators are affected by the size difference of the graph pair. By using the Max operator for graph summarization, this embodiment can effectively capture the most significant features to generate a graph-level representation containing multi-scale node representations, and is not affected by the size difference of the graph pair.

[0062] Specifically, the graph-level representation containing multi-scale node representations generated by combining the Max operator and the Mean operator can be represented as: (6) wherein, is the node representation vector of the node v at the jth layer GNN, is the graph-level representation vector of the graph G at the jth layer, and k is the number of GNN layers, is the graph-level representation containing multi-scale node representations. This embodiment can represent the entire encoding stage as .

[0063] Given the graph-level representation of input pairs, the scoring stage detects violations of containment constraints in the embedding space. However, previous metric-based scoring ranges from 0 to positive infinity, which can result in intractable extreme values, fail to provide consistent distance score comparisons, and lack the ability to distinguish matching pairs. This embodiment adopts a new distance measurement method to first normalize the hinge distance into the following containment score: (7) wherein, Q is the query graph, D is the data graph, d denotes the feature dimension index, and exp() is a mapping function mapping to (0, 1], , are the representations of the query graph Q and the data graph D in the embedding space, respectively. By mapping to the interval , the normalization of the hinge distance is achieved, and through this normalized form, the influence of extreme values is reduced, which can be interpreted as a measure of the relative degree of containment satisfaction.

[0064] To further improve the ranking ability of the model, this embodiment further calculates the similarity advantage ratio, and the calculation process is as follows: First, define two auxiliary functions: (8) wherein, denotes the intersection of the feature multi-sets of the graph pair in the embedding space, is used to calculate the minimum embedding that simultaneously contains and feature multi-sets in the embedding space.

[0065] Then the similarity advantage ratio can be calculated as follows: (9) In the above formula, the similarity advantage ratio takes the data graph representation as the reference point, the first term is used to evaluate the degree of commonality between the query graph Q and the data graph D, i.e., the degree of similarity, and the second term is used to evaluate the normalized dissimilarity of the query graph Q relative to the data graph D, which quantifies the difference between the multi-sets and , while ensuring that in the case of , the unmatched graph pair is not assigned a score of zero, and the subtraction of the similarity and dissimilarity quantifies the advantage ratio of the similarity. The value range of the similarity advantage ratio is , -1 indicates that the query graph Q is completely different from the data graph D, and 1 indicates that the query graph QThe data D is exactly the same.

[0066] Further, based on the inclusion score and the similarity advantage ratio as the similarity measure, the similarity prediction score between the graph pairs is calculated, and the expression is as follows: (10) The embodiment adopts the similarity measure The shortcomings of the previous hinge distance measure can be overcome, such as Figure 4 As shown, the inclusion score is normalized to handle extreme values, and the advantage ratio is used to establish a reference point and describe similarity, so that the learning model has the ability to sort matching pairs. After the model training is completed, each score in the similarity measure can be used individually to adapt to specific downstream tasks, providing more flexible subgraph matching evaluation. The embodiment in the present embodiment, in step S02, in the model training phase, the model can be trained with mean square error (MSE) loss, by minimizing the distance between the prediction score of the graph pair and the given score, which is conducive to the control of the score range of the similarity measure, that is, the loss function is as follows:

[0067] (11) Given the prediction score of each graph pair, the embodiment determines whether the two are subgraph matching by threshold τ, which is learned by the following prediction function p(·). Specifically, in step S03, if the similarity prediction score between the query graph Q and the data graph D obtained by using the NC-Iso model is greater than the preset threshold τ, it is determined that the input graph pair is matched, otherwise it is determined to be not matched, and the following function can be used for prediction: (12) To verify the effectiveness of the present application, in the specific application embodiment, the NC-Iso model of the present application is compared with 8 neural baseline methods and 7 accurate subgraph matching algorithms, and the following is considered: (1) Effectiveness: the effectiveness of the model of the present application compared with the neural baseline method. (2) Generalization ability: the model of the present application is trained on small graphs, and its generalization ability on large graphs is analyzed. (3) Efficiency: the running time of NC-Iso is compared with the baseline method. (4) Ablation study: the influence and transferability of the encoder structure and the similarity measure of the present application.

[0068] ​​Experiments are conducted on seven real-world datasets from different domains, including chemistry (AIDS, COX2), biology (Enzymes, Proteins, DD), image processing (MSRC_21) and point cloud (FIRSTMM_DB) datasets. AUROC is used to evaluate the sample ability of the model to distinguish positive and negative samples, and accuracy is also used as a measure of the overall correctness of the model. In addition, the Spearman rank correlation coefficient (p) and Hit@K are used to evaluate the ranking ability of the model. The NC-Iso of the present embodiment and the same category of neural subgraph matching methods NeuroMatch, IsoNet and D2Match are compared, and the baseline method also uses the most popular graph similarity calculation models in recent years, such as GMN-embed, SimGNN, MCSNet, Greed and Eric. The original graphs in the dataset are divided into training set and test set in the ratio of 8:2, and 20% of the training graphs are used as the validation set. The true value is calculated by VF3 or RapidMatch. Each batch of training data contains 64 (D, Q+, Q-) triples, and each epoch contains 100 iterations. Each model is trained for 10 epochs as a warm-up phase, and then tested on the validation set every epoch. An early stopping strategy with a patience value of 50 is used to prevent overfitting. For traditional algorithms, set a timeout of 100 seconds for each pair of graphs, and record the total running time to find the first solution for each pair of graphs as their inference time. The average AUROC and accuracy (with standard deviation) of five runs of the subgraph matching task in the specific application embodiment are shown in Figure 5 , where the optimal result is indicated in bold and the suboptimal result is marked with an underline. 'OOM' means out of memory.

[0069] Since the traditional algorithm performs exact matching, the present embodiment only compares the two indicators of AUROC and accuracy with the neural baseline model, and the results of the average AUROC and accuracy (with standard deviation) of five runs of the subgraph matching task are shown in Figure 5 . According to the results, the NC-Iso of the present embodiment shows the best performance in the two evaluation indicators of all datasets, which is due to the hierarchical dependency preservation and the similarity measure enhanced by SDR. The NC-Iso of the present embodiment has made substantial progress compared with other neural subgraph matching methods, with an absolute increase in AUROC of up to 6.95%, and also shows stronger competitiveness compared with the most advanced graph similarity learning model using a more complex architecture.

[0070] Due to the NP-complete nature of the subgraph matching problem, obtaining large graph training data is challenging. Therefore, the ability of the neural subgraph matching task to train on small graphs and generalize to unseen large graphs is crucial. The present embodiment further conducts a generalization experiment, in which all models are trained on graphs with less than 100 nodes and then evaluated on unseen large graphs with up to 5000 nodes. The experiment does not include models that encounter out-of-memory problems. As shown in Table 1, the present NC-Iso shows up to 8% improvement in AUROC. While other coarse-grained methods such as Eric and NeuroMatch show a significant performance drop, the present NC-Iso still maintains superior performance, which can be due to the fact that the present NC-Iso takes into account the impact of graph size difference, and the present NC-Iso combines hierarchical dependency, ensuring consistent node hierarchy for matched graph pairs, and uses max-pooling to mitigate the impact of noise caused by size difference between graph pairs.

[0071] Table 1: Generalization capability experiment results.

[0072]

[0073] Table 2 provides a comparison of the inference time of the present NC-Iso and baseline methods, which lists the three fastest traditional algorithms, the fastest neural baseline method, and the two best neural baseline algorithms. As can be seen from the table, the efficiency of the present NC-Iso is still competitive compared with the fastest neural baseline method, and is only slower by milliseconds. It can also be seen that although all neural baseline methods are more efficient than traditional methods, their application scenarios are different, and neural baseline methods can provide fast prediction, while traditional methods perform well in finding more accurate bijections.

[0074] Table 2: Average inference time per batch (in seconds).

[0075]

[0076] The present embodiment further conducts a model architecture effectiveness ablation experiment to verify the effectiveness of the model backbone architecture of the present application in preserving the hierarchical dependency relationship in the node root subtree. The ablation experiment replaces the model backbone of the present application with popular GNNs (such as GIN, GCN, GraphSAGE and GAT) for comparison, and in addition, replaces the Max operator used in the graph summary of the present application with Sum and Mean operators for experiments. Table 3 gives the best results of the ablation experiment on GNN and graph summary operation. The results show that the backbone model architecture of the present application is always superior to other GNNs using permutation invariant Combine functions. In addition, compared with Sum and Mean operators, the Max operator is proved to be the optimal operator of NC-Iso. We observe that the AUROC improvement can be as high as 3%.

[0077] Table 3: Model architecture effectiveness ablation experiment (AUROC)

[0078] The present embodiment further conducts a similarity measure method effectiveness ablation experiment to evaluate the effectiveness and flexibility of the proposed similarity measure method and two components in the matching pair ranking and node-level alignment two downstream tasks. The first is Compliance (CP), which evaluates the constraint compliance, the second is SDR, which considers the advantage of similarity, and the third is the combination of the two components .

[0079] The matching pair ranking experiment evaluates the ability of the model to rank the matching degree of the matching pair. 20 matching query graphs are sampled for each data graph, and MCSNet and IsoNet report out-of-memory errors on the Proteins dataset, so only the median and range of scores of four datasets are reported . The ranking results are shown in Figure 6 , which clearly show that the SDR of the present application can rank the matching pair with the highest and most stable score, which is better than CP, which only focuses on constraint compliance, and , which considers both constraint compliance and graph pair similarity. It is worth noting that although all three methods focus on constraint compliance, compared with NeuroMatch and Greed, the method of the present application still significantly improves the ranking accuracy of the matching pair when only using constraint compliance, and since the data graph representation is used as a reference point in the measurement method of the present application, it allows more consistent score comparison for constraint compliance. IsoNet achieves the second-best ranking effect of matching pair ranking next to the present application compared with other comparative methods, which benefits from the iterative improvement of the Gumbel-Sinkhorn network, but this method is constrained by high computational cost.

[0080] The embodiment takes subgraph matching as a coarse-grained graph-level task and uses graph-level representation for prediction. However, the similarity measurement manner of the application and each component thereof can also be applied to a fine-grained node-level method to provide an alignment result of nodes in a subgraph matching task. To verify this capability, the embodiment compares each query graph-data graph node pair in a node alignment experiment and reports Hit@K of 12800 graph pairs. The experiment compares the model of the application with NeuroMatch and Greed, which are similar coarse-grained graph-level methods of the application and also predict subgraph matching by hinge distance measurement, and the results are shown in Table 4.

[0081] Table 4: Node-level alignment effectiveness experiment results (results show the average Hit@k of each node)

[0082] As can be clearly seen from Table 4, the NC-Iso of the application has a significant improvement over the similar baseline, and combining CP and SDR together can improve the performance of node-level alignment, which shows that the architecture and distance measurement of the application can also be applied to a node-level neural subgraph matching task under appropriate supervision. In summary, the similarity measurement of the application can be flexibly used to solve different downstream tasks related to subgraph matching.

[0083] In summary, a large number of experiments on different data sets verify the effectiveness and efficiency of the application, which outperforms traditional and neural baseline methods.

[0084] The application can be applied to various application scenarios that require subgraph retrieval, such as social network analysis applications, anomaly detection, and bioinformatics molecular alignment applications in the field of new drug manufacturing.

[0085] The application will be further described below by taking the application of the application to the bioinformatics molecular alignment application scenario in the field of new drug manufacturing as an example.

[0086] The application can be applied to the bioinformatics molecular alignment application in the field of new drug manufacturing to perform similarity alignment of key functional structures between newly developed drugs and drugs with known effects, so as to infer whether the newly developed drugs have corresponding effects. Taking a drug molecule as an example, an atom can be defined as a node, a chemical bond can be defined as an edge, an atom category can be defined as a node feature label, and a key functional structure with a specified effect can be defined as a subgraph. Then, the input (Q, D) graph pair can be defined as (a known functional subgraph in an existing drug molecule, a new drug molecule graph), that is, the input graph pair is a drug molecule structure graph of a new drug and a drug molecule structure graph of a drug with known effects, and the detailed steps of applying the application to realize drug molecule structure graph structure retrieval between the new drug and the drug with known effects are as follows: Step S01. Model construction: constructing an NC-Iso model for neural subgraph matching to make predictions, the NC-Iso model comprising a hierarchical-aware GNN encoder, a graph summarization unit and a similarity measurement unit connected in sequence, the hierarchical-aware GNN encoder being used for feature encoding of input graph pairs (a drug molecular structure graph of a new drug and a drug molecular structure graph of a known effective drug) to form node representations, the graph summarization unit being used for graph summarization of the node representations output by the GNN encoder to generate graph-level representations, and the similarity measurement unit being used for measuring the similarity between the input graph pairs according to the graph-level representations output by the graph summarization unit, in the hierarchical-aware GNN encoder, the sequential Combine function is used to build the adjacent hierarchical dependencies between the adjacent layers in the node root sub-tree by taking the representation of the root node from the previous layer and the aggregated information from the neighborhood as a sequence, so as to explicitly capture the hierarchical relationship between the adjacent layers in the sub-tree and preserve the relative positions between the nodes in the sub-tree, in the similarity measurement unit, the hinge distance is normalized to a containment score to evaluate the containment between the graph pairs, and the similarity advantage ratio is used to quantify the degree of similarity and dissimilarity between the input graph pairs, and the similarity score prediction value between the graph pairs is calculated according to the containment score and the similarity advantage ratio, and the similarity advantage ratio is the difference between the similarity degree value and the dissimilarity degree value between the graph pairs.

[0087] Specifically, in the hierarchical-aware GNN encoder, a linear layer is used to convert the discrete node labels into one-hot encoding in a continuous space as the node initialization features, and the input graph pairs obtain node representations with hierarchical awareness through the GNN encoder, which correspond to the information of atoms. In the Combine step of the message passing process, the hierarchy of the root node sub-tree is modeled, and the updated node representation of node v at the j-th layer is as shown in formula (5), i.e. as follows: .

[0088] In this embodiment, the gated recurrent unit (GRU) is used as the Combine function, and the GRU takes the output of the aggregation function (i.e. the sub-tree of node v) and the hidden state of the root node v at the previous layer as inputs, and forms a top-down hierarchical dependency relationship within the sub-tree by taking the hierarchy of the root node sub-tree as a sequence element, and then uses a two-layer MLP as a learnable hash function to ensure the injectivity of feature mapping.

[0089] In this embodiment, the hierarchical representation indicates the connection order of atoms and other atoms through chemical bonds. Taking three atoms a, b, and c as an example, if there is no hierarchical perception ability, when the node a is represented by a 2-layer GNN encoder, the node a will obtain the same node representation under two different connection orders a-b-c and a-c-b. In contrast, the embodiment has hierarchical perception ability, and different node representations of the a atom under different connection orders are obtained, which helps to distinguish the local structure.

[0090] Further, the graph summary unit obtains a graph-level representation by inputting the node representation. In this embodiment, since the query graph represented by the atomic functional group is smaller in scale than the data graph represented by the entire molecule, the Max operator is used to summarize the graph to generate a graph-level representation. The use of the Max operator can focus on capturing the most significant atomic features and is independent of the graph size, which can solve the problem that the traditional Sum and Mean operators are affected by the size difference of the graph pair.

[0091] Specifically, the generated graph-level representation containing multi-scale node representations can be represented as formula (6), that is:

[0092] Where k is the number of GNN layers.

[0093] In this embodiment, the input graph pair is summarized to obtain the overall information of the query graph atomic functional group and the overall information of the data graph new drug molecule graph. Further, the graph-level representation of the given input graph pair is measured for graph similarity, and the violation of the containment constraint is detected in the embedding space.

[0094] In this embodiment, a new distance measurement method is adopted. First, the hinge distance is converted into a containment score as shown in formula (7), that is: .

[0095] In order to further improve the ranking ability of the model, two auxiliary functions as shown in formula (8) are defined:

[0096] The intersection of the graph pair feature multi-set in the embedding space, which corresponds to the part of the known functional atomic group and the new drug molecule structure in this embodiment, is used to calculate the minimum embedding in the embedding space that contains and feature multi-sets at the same time, which corresponds to the new structure containing both the known functional atomic group structure and the new drug molecule structure in this embodiment. The similarity advantage ratio can be calculated according to formula (9): .

[0097] Finally, the similarity metric is formed based on the inclusion score and the similarity odds ratio as shown in equation (10), i.e.: .

[0098] After constructing the model in the above manner, the model is further trained based on the obtained similarity prediction value. In this embodiment, the NC-Iso model is trained using a training set composed of different pairs of molecular structure graphs, and the model can be trained using the mean square error (MSE) loss, which is conducive to the control of the score range of the similarity metric by minimizing the distance between the predicted score and the given score of the graph pair. The loss function is shown in equation (11). Further, after the model training is completed, the similarity prediction value of the graph pair is input, and the prediction value can provide more flexible subgraph matching evaluation. If the similarity prediction score between the query graph Q and the data graph D obtained using the NC-Iso model is greater than the preset threshold τ, it is determined that the input picture matches, otherwise it is determined that the input picture does not match.

[0099] In this embodiment, the prediction value output by the model represents the subgraph matching score of the known functional subgraph in the existing drug molecule and the subgraph of the new drug molecule graph. The greater the score, the more similar the two are, indicating that the new drug molecule has a higher possibility of having the specified medical effect. Conversely, the smaller the similarity score, the less similar the two are, indicating that the new drug molecule may not have the specified medical effect, and thus it can be predicted whether the new drug has the specified medical effect.

[0100] This embodiment further provides a computer device, including a processor and a memory, the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0101] It can be understood that the above method of this embodiment can be executed by a single device, such as a computer or a server, etc., and can also be applied to a distributed scenario to be completed by multiple devices cooperating with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and the multiple devices interact with each other to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing related programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, and a dynamic storage device, etc. The memory can store an operating system and other application programs, and when the above method of this embodiment is implemented by software or firmware, the related program code is saved in the memory and executed by the processor.

[0102] This embodiment further provides a computer readable storage medium having a computer program stored therein, which is executed by a processor to implement the above method.

[0103] Those skilled in the art will appreciate that the above-described embodiments of the present application can be embodied as a method, system, or computer program product. Accordingly, the present application can be embodied in hardware alone, software alone, or in a combination of software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer program instructions. The present application is described in reference to the flow diagrams and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the application illustrated in the attached drawings, which flow diagrams and / or block diagrams Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more functions specified in the flow diagram and / or block diagram. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow

[0104] The foregoing is merely illustrative of the principles of the application, and the application should not be construed so as to be limited thereto. While the application has been described above with reference to specific embodiments thereof, it is apparent that many changes, modifications, and variations can be made to the embodiments without departing from the spirit and the scope of the application. Accordingly, it is intended to embrace future modifications, alterations, and equivalents of the application, including patents issued hereafter for which the parent has priority, in the same family.

Claims

1. A graph structure data retrieval method based on hierarchical perception neural subgraph matching, characterized in that the steps of Comprise: Step S01. Model construction: constructing an NC-Iso model for neural subgraph matching for prediction, the NC-Iso model comprising a hierarchical-aware GNN encoder, a graph summarization unit and a similarity measurement unit connected in sequence, the hierarchical-aware GNN encoder being used for feature encoding of input graph pairs to form node representations, the graph summarization unit being used for graph summarization of node representations output by the GNN encoder to generate graph-level representations, and the similarity measurement unit being used for measuring similarity between input graph pairs according to graph-level representations output by the graph summarization unit, in the hierarchical-aware GNN encoder, adjacent hierarchical dependencies between levels in a node root sub-tree are constructed based on a sequential Combine function by taking the representation of the root node from the previous layer and the aggregated information from the neighborhood as a sequence to explicitly capture the hierarchical relationship between adjacent levels in the sub-tree and preserve the relative positions between nodes in the sub-tree, in the similarity measurement unit, hinge distance is normalized to an inclusiveness score to evaluate the inclusiveness between graph pairs, and a similarity dominance ratio is used to quantify the degree of similarity and dissimilarity between input graph pairs, and a similarity score prediction value between graph pairs is calculated according to the inclusiveness score and the similarity dominance ratio, the similarity dominance ratio being the difference between the similarity degree value of the graph pairs and the dissimilarity degree value between the graph pairs; Step S02. Model training: training the constructed NC-Iso model using a training set composed of different input graph pairs, the training process minimizing the distance between the similarity score prediction value and the true value of the input graph pairs, and obtaining a graph structure data matching model after training, the input of the model being an input graph pair composed of a data graph and a query graph, and the output being a matching result of whether the subgraph of the query graph matches the data graph; Step S03. Graph pair matching retrieval: obtaining an input graph pair composed of a data graph to be matched and a query graph, inputting the input graph pair into the trained graph structure data matching model to obtain a similarity score prediction value, and judging whether the input graph pair matches according to the similarity score prediction value.

2. The hierarchical-aware neural subgraph matching based graph structure data retrieval method according to claim 1, characterized in that, In the hierarchical-aware GNN encoder, first, a linear layer is used to convert discrete node labels into one-hot encoding in continuous space and as node initialization features, the hierarchy of the root node sub-tree is modeled in the Combine step of the message passing process to give the GNN encoder hierarchical awareness, a gated recurrent unit GRU is used as a sequential Combine function, the output of the aggregation function and the hidden state of the root node in the previous layer are used as inputs, the hierarchy of the root node sub-tree is taken as a sequence element to establish a hierarchical dependency within the sub-tree in a top-down manner, and two MLP layers are used as a learnable hash function to ensure the injectivity of feature mapping, wherein the updated node representation of node v at the jth layer is as follows: wherein, represents a two-layer MLP layer, Aggr is an aggregation function, is a representation of a node at the j-1 layer, is a neighbor node of node v, is a subtree of node v, is a node representation of node v at the j-1 layer. 3.The hierarchical-aware neural subgraph matching based graph structure data retrieval method according to claim 1, characterized in that, In the graph summarization unit, a Max operator is used for graph summarization, and a Mean operator is used to generate a graph-level representation containing multi-scale node representations, and the calculation expression is: wherein, is the node representation vector of node v at the j-th layer of the GNN, is the graph-level representation vector of graph G at the j-th layer, k is the number of layers of the GNN, is the graph-level representation containing multi-scale node representations.

4. The method of claim 1, wherein, In the similarity measurement unit, the hinge distance is normalized to an inclusiveness score according to the following formula: wherein, Q is a query graph, D is a data graph, d represents a feature dimension index, exp() is a mapping function mapping to (0, 1], , are representations of the query graph Q and the data graph D in the embedding space, respectively.

5. The method of claim 1, wherein, The calculation process of the similarity advantage ratio in the similarity measurement unit is as follows: Two auxiliary functions are defined: wherein, representing the intersection of the sets of features in the embedding space, for computing the minimum embedding in the embedding space that simultaneously contains and the sets of features. The calculation expression of the similarity advantage ratio is as follows: in, For the representation of the data graph in the embedding space, This is used to assess the degree to which query graph Q and data graph D share common elements, i.e., their similarity. Used to evaluate the normalized dissimilarity of query graph Q relative to data graph D, quantifying the difference between the query graph and the data graph, similarity advantage ratio SDR The range of values ​​for (Q, D) is: -1 indicates a query graph Q Completely different from data graph D, 1 represents the query graph. Q It is exactly the same as data D. 6.The graph structure data retrieval method based on hierarchical perception neural subgraph matching according to any one of claims 1-5, characterized in that, The similarity prediction score between the graph pairs is calculated according to the inclusion score and the similarity advantage ratio in the similarity measurement unit according to the following formula: wherein, denotes an inclusion score between the query graph Q and the data graph D, denotes a similarity odds ratio between the query graph Q and the data graph D.

7. The hierarchical-aware neural subgraph matching based graph structure data retrieval method according to any one of claims 1-5, characterized in that, In step S02, the mean square error loss function is used in the training process to minimize the distance between the similarity score prediction value and the similarity score true value of the input graph pair: wherein, denotes the similarity prediction score between the query graph Q and the data graph D using the NC-Iso model, denotes the similarity score ground truth between the query graph Q and the data graph D. In step S03, if the similarity prediction score between the query graph Q and the data graph D obtained by using the NC-Iso model is greater than the preset threshold τ, it is determined that the input picture is matched, otherwise it is determined that the input picture is not matched. 8.The graph structure data retrieval method based on hierarchical perception neural subgraph matching according to any one of claims 1-5, characterized in that, In the application of bioinformatics molecular alignment in drug manufacturing, the input graph pair is the drug molecular structure graph of a new drug and the drug molecular structure graph of a known effective drug, each atom in the drug molecular structure graph is defined as a node, the chemical bond is defined as an edge, the atom category is defined as a node feature label, and the key functional structure with a specified effect is defined as a subgraph, the NC-Iso model is trained using a training set composed of different drug molecular structure graph pairs, and after the training is completed, a matching model is obtained, when the drug molecular structure graph of the new drug to be matched and the drug molecular structure graph of the known effective drug are obtained, they are input into the matching model to evaluate the similarity of the key functional structure between the drug molecular structure graph of the new drug and the drug molecular structure graph of the known effective drug, and whether the new drug has the specified effect is predicted according to the matching result.

9. A computer apparatus comprising a processor and a memory for storing a computer program, characterised in that, The processor is configured to execute the computer program to perform the method of any one of claims 1-8.

10. A computer readable storage medium storing a computer program, characterized in that, The computer program is configured to be executed by the processor to perform the method of any one of claims 1-8.