A graph matching method, device and medium for heterogeneous graphs

The diffusion model and attention mechanism are used to calculate the structural similarity features of graph pairs, and combined with the hypergraph representation learning model to generate semantic similarity features, which solves the problem that local connected structures in heterogeneous graphs are not considered, and achieves more accurate graph similarity calculations. .

CN118467793BActive Publication Date: 2024-09-24CENT SOUTH UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410923861.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-09-24
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Existing heterogeneous graph similarity learning methods fail to effectively consider the local connectivity structure and core connected subgraphs of nodes in the graph, resulting in errors in similarity calculation results and limited accuracy improvement.

Method used

Diffusion model and attention mechanism are used to calculate the structural similarity characteristics of graph pairs, node communities are identified through spectral clustering, hypergraph modeling and random walks are used to generate hyperedge sets, and hypergraph representation learning models are combined for comparative learning to generate semantic similarities. Features, and splicing structural similar features and semantic similar features into a fully connected neural network to calculate the similarity score of the graph pair.

Benefits of technology

By capturing the local and global node connectivity features in heterogeneous graphs, learning more precise semantic features, improving the accuracy and reliability of graph similarity calculation, taking into account the comprehensive characteristics of graph structure and node attributes, improving the similarity score accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467793B
    Figure CN118467793B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically discloses a graph matching method, device and medium for heterogeneous graphs. The method of the present invention calculates the structural similarity features of graph pairs based on a diffusion model and an attention mechanism, and performs comparative learning through a multi-layer matching network to obtain a matching vector of a hyperedge-hyperedge and a matching vector of a hyperedge-hypergraph, and generates semantic similarity features based on the matching vector of a hyperedge-hyperedge and the matching vector of a hyperedge-hypergraph; the structural similarity features and the semantic similarity features are spliced ​​to obtain a global comparative feature vector of the graph pair, and the global comparative feature vector is input into a fully connected neural network to obtain a similarity score for reflecting the similarity degree of the graph pair. The method of the present invention combines semantic and structural features, integrates the similarity features of the graph structure itself, and learns semantic information with the features of nodes and subordinate communities. The heterogeneous graph similarity learning method proposed by the present invention takes into account more comprehensive considerations and can effectively and accurately obtain the similarity scores of the graph pairs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a graph matching method, device and medium for heterogeneous graphs. Background Art

[0002] In the era of big data, graph data has attracted much attention. The growth of multiple data sources and related data has led to the large scale of graphs in real-world scenarios. Such graphs are collectively referred to as large-scale graphs. Large-scale graphs are also classified as heterogeneous networks, in which there are multiple types of nodes and edges. Therefore, the underlying network contains rich heterogeneous semantic information. Large graph data contains many local node connection structures. Such local features can show the core connected subgraphs and important related semantics of the large graph, and can indirectly show the graph features of the large graph. Therefore, it has important research significance in the calculation of graph similarity for large-scale graphs.

[0003] Existing heterogeneous graph similarity learning only focuses on the global structural features of the graph, without considering the local connectivity structure of the nodes in the large graph. In the prior art, the graph similarity calculation method does not consider the inherent core connected subgraph in the graph when modeling graph features. This connected subgraph can show important local connectivity structures and semantic information in the large graph. For example, frequent interactions between user entities in social networks can show the characteristics of a close circle of friends, frequent cooperation between scholar entities in academic networks can show close academic cooperation groups, and frequent communication between institutional nodes in communication networks can show important communication organizations. Therefore, ignoring a variety of important semantic information in the large graph leads to errors in the similarity calculation results, and the accuracy improvement is limited.

[0004] In summary, there is an urgent need for a graph matching method, device and medium for heterogeneous graphs to solve the problems in the prior art. Summary of the invention

[0005] The present invention aims to provide a graph matching method, device and medium for heterogeneous graphs. The specific technical solution is as follows:

[0006] A graph matching method for heterogeneous graphs includes the following steps:

[0007] S1: Obtain a set of graph pairs for input, and calculate the structural similarity features of the graph pairs based on the diffusion model and attention mechanism;

[0008] S2: Spectral clustering is used to identify communities of nodes in graph pairs, and hypergraphs are used to model heterogeneous nodes and edges with community labels. Random walks are performed to generate hyperedge sets, and the hypergraph representation learning model is called to obtain hyperedge vector representations. The hyperedge vector representations are input into a multi-layer matching network for comparative learning to obtain hyperedge-hyperedge matching vectors and hyperedge-hypergraph matching vectors. Semantic similarity features are generated based on the hyperedge-hyperedge matching vectors and the hyperedge-hypergraph matching vectors.

[0009] S3: Concatenate structural similarity features and semantic similarity features to obtain a global comparison feature vector of the graph pair, input the global comparison feature vector into a fully connected neural network, and obtain a similarity score, which is used to reflect the similarity between the graph structures in the graph pair.

[0010] Preferably, in S1, the structural similarity features of the graph pairs are calculated based on the diffusion model and the attention mechanism, and the process is as follows:

[0011] The node connectivity features of the graph pair are converted into node representation vectors, the diffusion model is called to learn the node representation vectors to obtain node embeddings, the weight of each node is calculated based on the attention mechanism, the node embeddings are weighted summed to obtain graph embeddings, the graph embeddings are input into the tensor neural network, and the structural similarity features of the graph pair are obtained after learning.

[0012] Preferably, in S1, the calculation expression of the node representation vector is as follows:

[0013] ;

[0014] ;

[0015] ;

[0016] in, Indicates The initial node embedding matrix of the layer, at this time the diffusion depth is 0; Indicates The node embedding matrix of the layer, Indicates The learnable operation parameters corresponding to the layer; represents the weighted transformation matrix, , Representation diagram The adjacency matrix of Representation diagram The degree matrix of represents the diffusion depth; represents the embedding matrix learned after diffusion at each layer; Indicates the number of learning layers; The weight coefficient matrix representing the number of diffusion layers; Represents node embedding;

[0017] The weight of each node is calculated based on the attention mechanism, and the expression is as follows:

[0018] ;

[0019] ;

[0020] in, The diffusion depth is Time Node The weight feature vector of The diffusion depth is Time Node The eigenvector of The diffusion depth is Time Node The eigenvector of Represents a vector concatenation operation; Represents the learnable weight coefficient; represents the activation function;

[0021] The graph embedding is obtained by weighted summation of node embeddings , the expression is as follows:

[0022] ;

[0023] ;

[0024] ;

[0025] ;

[0026] in, Represents node embedding; represents the node-level attention vector; represents the learnable weight; Represents a learnable bias variable; for node weight feature vector Perform normalization to obtain node-level weights ; represents the hyperbolic tangent function;

[0027] Using tensor neural network to obtain structural similarity features , the expression is as follows:

[0028] ;

[0029] in, A weight vector representing the structural similarity comparison; represents the weight vector; and Respectively represent the graph embeddings of the two graphs in a graph pair; represents the learnable bias vector; , , Represents the structurally similar feature dimension of the output of a tensor neural network.

[0030] Preferably, in S2, spectral clustering is used to identify communities of heterogeneous graph nodes, and then a hypergraph is used to model heterogeneous nodes and edges with community labels, and the nodes are classified according to their importance level and The kernel algorithm performs random walks to generate a set of hyperedges, and the expression is as follows:

[0031] ;

[0032] ;

[0033] ;

[0034] ;

[0035] in, express Accounting method; Indicates the node importance level; Represents a node; represents a set of edges; represents the node embedding matrix; , Indicates Node value; , Indicates The PageRank value of each node; Represents a slave node To Node The random walk weight value of Representation Node Random walk The node after the jump; Represents a set of hyperedges.

[0036] Preferably, in S2, before calling the hypergraph representation learning model, the hyperedges are ranked and pooled according to their importance values, as expressed as follows:

[0037] ;

[0038] ;

[0039] in, Indicates the pooling ratio; Returns the top rankings The superedge subscript of each; Represents a hyperedge The importance value of .

[0040] Preferably, in S2, the hypergraph representation learning model is HyperSAGE, and the hyperedge The vector representation is , the expression is as follows:

[0041] ;

[0042] in, represents the final node vector representation.

[0043] Preferably, in S2, the process of inputting the hyperedge vector into the multi-layer matching network for contrastive learning is as follows:

[0044] Calculate the attention graph-level embedding of the contrast hypergraph starting from the hyperedge, the expression is as follows:

[0045] ;

[0046] ;

[0047] in, Representing Hypergraph Super edge Attentional graph-level embedding of Representing Hypergraph Super edge Attentional graph-level embedding of and Represents different sets of hyperedges; Represents a hyperedge and super edge The cosine similarity between ;

[0048] Functional expression of multilayer matching network as follows:

[0049] ;

[0050] in, Indicates the number of matching layers; Represents vector input; Indicates Layer trainable weight parameters;

[0051] The hyperedge set With hyperedge set All hyperedges in the graph and their corresponding attention level embedding are input into the multi-layer matching network to obtain the matching vector and matching vector , the expression is as follows:

[0052] ;

[0053] ;

[0054] The matching vectors of all hyperedges are input into the recurrent neural network to aggregate into the matching vector of the hyperedge-hypergraph, which is expressed as follows:

[0055] ;

[0056] in, Indicates Hyperedge of layer The matching vector of represents the matching vector of hyperedge-hypergraph; represents a recurrent neural network;

[0057] The hyperedge-hypergraph matching vector Matching vector with hyperedge-hyperedge Input multi-head self-attention mechanism to combine semantically similar features , the expression is as follows:

[0058] ;

[0059] in, Represents a multi-head self-attention mechanism.

[0060] Preferably, in S3, the semantic similarity feature Similar features to the structure Through vector concatenation operation, we can get the global contrast feature vector of the image pair. , and input the vector into the fully connected neural network to obtain the similarity score. Converted to a similarity score between 0 and 1:

[0061] ;

[0062] ;

[0063] ;

[0064] in, Represents a vector concatenation operation; Represents the final similarity score; represents the activation function; represents a fully connected neural network; Represents the predicted value in the model training sample With the true value The mean square error between Indicates the sample size.

[0065] In addition, the present invention also includes a computer device, including a memory and a processor;

[0066] The memory is used to store a computer program executable on the processor;

[0067] The processor is used to implement the steps of the above-mentioned graph matching method for heterogeneous graphs when executing the computer program.

[0068] In addition, the present invention also includes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the graph matching method for heterogeneous graphs as described above are implemented.

[0069] The application of the technical solution of the present invention has the following beneficial effects:

[0070] (1) The present invention proposes a graph matching method for heterogeneous graphs. For heterogeneous large graph data, two-layer comparative learning is performed on the underlying attribute features of heterogeneous nodes. Based on mining the underlying semantic association features between nodes, and using hypergraph extraction to model the core subgraph structure, matching and comparison between subgraph pairs are performed to learn the semantic comparison features between nodes. Therefore, the natural advantages of hypergraphs can be used to capture the underlying semantic information in heterogeneous graphs, and then learn more accurate semantic feature calculations. At the same time, based on the diffusion model, the global and local node connectivity features of the large graph are modeled, the graph structure features are extracted, and finally the semantic and graph structure features are fused to calculate the graph similarity feature vector. Therefore, not only the similar features of the graph structure itself are mined, but also the node attributes and subordinate community features are fused to learn semantic information. Therefore, the heterogeneous graph similarity learning method proposed in the present invention is more comprehensive and can effectively and accurately obtain the similarity score of the graph pair.

[0071] (2) In the method of the present invention, a diffusion model is proposed to model the local connectivity features of nodes, which can capture the fine-grained connectivity differences between different nodes in heterogeneous graphs, enhance the influence of local structure on the graph feature comparison stage, and improve the accuracy and reliability of graph similarity learning. In addition, the method of the present invention proposes to cluster nodes and then learn the corresponding community features after node attributes and association relationships. The community features can reflect the potential semantic information of the graph and help with subsequent semantic comparison calculations. Then, a hypergraph is used to model the subgraph that integrates the community features. The hypergraph helps to capture high-order relationships and can show the core graph structure of node associations within the hyperedge, thereby improving the accuracy of semantic calculations based on the hypergraph.

[0072] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0074] Figure 1 is a flowchart of the steps of a graph matching method for heterogeneous graphs in a preferred embodiment of the present invention;

[0075] Figure 2 It is a schematic diagram of a model of a graph matching method for heterogeneous graphs in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0077] Example:

[0078] like Figure 1 and Figure 2 As shown, this embodiment discloses a graph matching method for heterogeneous graphs, which is used to calculate the matching degree between graph structure data. It can be applied to the frequent interactions between user entities in social networks to show the characteristics of a close circle of friends, the frequent cooperation between scholar entities in academic networks to show a close academic cooperation group, and the frequent communication between institutional nodes in communication networks to show important communication organizations. The method includes the following steps:

[0079] S1: Obtain corresponding graph structure data according to the entity to be matched, wherein the graph structure data constitutes a graph pair set for input, and calculates the structural similarity features of the graph pair based on the diffusion model and the attention mechanism; it should be noted that in this embodiment, the graph pair set As input, we calculate the similarity between the graph structures in the graph pair. , .here and Respectively represent The set of nodes and edges of , , a total of N image pairs. represents the node feature matrix, Represents the total number of node attributes, Same as above.

[0080] S2: Spectral clustering is used to identify communities of nodes in graph pairs, hypergraphs are used to model heterogeneous nodes and edges with community labels, random walks are performed to generate hyperedge sets, hypergraph representation learning models are called to obtain hyperedge vector representations, and the hyperedge vector representations are input into a multi-layer matching network for comparative learning to obtain hyperedge-hyperedge matching vectors and hyperedge-hypergraph matching vectors. Semantic similarity features are generated based on the hyperedge-hyperedge matching vectors and hyperedge-hypergraph matching vectors.

[0081] S3: Concatenate structural similarity features and semantic similarity features to obtain a global comparison feature vector of the graph pair, input the global comparison feature vector into a fully connected neural network, and obtain a similarity score. The similarity score is used to reflect the similarity between the graph structures in the graph pair. Based on the similarity score, the matching degree between entities can be judged.

[0082] Preferably, in S1, the structural similarity features of the graph pairs are calculated based on the diffusion model and the attention mechanism, and the process is as follows:

[0083] The node connectivity features of the graph pair are converted into node representation vectors, and the high-dimensional node connectivity features are converted into low-dimensional computable node representation vectors through a graph representation learning model; the diffusion model is called to learn the node representation vector to obtain node embedding. The diffusion model in this embodiment is GDN. The over-smoothing problem of the graph neural network can be alleviated by learning the diffusion model. At the same time, the node representation learning time on the large graph is greatly reduced with medium computational complexity, and the node representation can be aggregated in the multi-layer feature space; the weight of each node is calculated based on the attention mechanism, and the node embeddings are weighted summed to obtain the graph embedding. The graph embedding is input into the tensor neural network, and the structural similarity features of the graph pair are obtained after learning.

[0084] Preferably, in S1, the calculation expression of the node representation vector is as follows:

[0085] ;

[0086] ;

[0087] ;

[0088] in, Indicates The initial node embedding matrix of the layer, at this time the diffusion depth is 0; Indicates The node embedding matrix of the layer, Indicates The learnable operation parameters corresponding to the layer; represents the weighted transformation matrix, , Representation diagram The adjacency matrix of Representation diagram The degree matrix of represents the diffusion depth; represents the embedding matrix learned after diffusion at each layer; Indicates the number of learning layers. In this embodiment, the number of learning layers is 3; The weight coefficient matrix representing the number of diffusion layers; Represents node embedding;

[0089] The weight of each node is calculated based on the attention mechanism, and the expression is as follows:

[0090] ;

[0091] ;

[0092] in, The diffusion depth is Time Node The weight feature vector of The diffusion depth is Time Node The eigenvector of The diffusion depth is Time Node The eigenvector of Represents a vector concatenation operation; Represents the learnable weight coefficient; represents the activation function;

[0093] The graph embedding is obtained by weighted summation of node embeddings , the expression is as follows:

[0094] ;

[0095] ;

[0096] ;

[0097] ;

[0098] in, Represents node embedding; represents the node-level attention vector; represents the learnable weight; Represents a learnable bias variable; for node weight feature vector Perform normalization to obtain node-level weights ; represents the hyperbolic tangent function.

[0099] Using tensor neural network to obtain structural similarity features , the expression is as follows:

[0100] ;

[0101] in, A weight vector representing the structural similarity comparison; represents the weight vector; and Respectively represent the graph embeddings of the two graphs in a graph pair; represents the learnable bias vector; , , Represents the structurally similar feature dimension of the output of a tensor neural network.

[0102] Heterogeneous graph structures contain a lot of semantic information due to the different connection modes of their node relationships. At the same time, they are affected by many factors. There may be multiple community structures with close connections between nodes in a network. This kind of community reflects the important connection subgraphs of the heterogeneous network in structure, and reflects the important real-world connections between nodes in semantics. For example, frequent interactions between user entities in social networks can show the characteristics of a close circle of friends, and frequent cooperation between scholar entities in academic networks can show close academic cooperation groups. Therefore, it has great research significance and value.

[0103] In the field of graph similarity learning, mining node subordinate communities in heterogeneous graphs can not only compare local features on the community-based subgraph structure, but also model the community's high-order relationship structure for semantic comparative learning. The present invention first uses spectral clustering to identify communities of heterogeneous graph nodes, then uses hypergraphs to model heterogeneous nodes and edges with community labels, and then uses pagerank to compare nodes with community labels. The kernel algorithm (k-core) performs random walks to generate hyperedges.

[0104] Specifically, in S1, spectral clustering is used to identify communities of heterogeneous graph nodes, and then a hypergraph is used to model heterogeneous nodes and edges with community labels, and the nodes are classified according to their importance level and The kernel algorithm performs random walks to generate a set of hyperedges, and the expression is as follows:

[0105] ;

[0106] ;

[0107] ;

[0108] ;

[0109] in, express Accounting method; Indicates the node importance level; Represents a node; represents a set of edges; represents the node embedding matrix; , Indicates Node value; , Indicates The PageRank value of each node; Represents a slave node To Node The random walk weight value of Representation Node Random walk The node after the jump; Represents a set of hyperedges.

[0110] It should be noted that The value reflects the connection position of the node in the graph. The larger the value, the closer the node is to the center of the graph, reflecting the tightly connected core network. The PageRank algorithm calculates the semantic importance of the node based on the connection relationship of the node in the graph and its own attribute information. The combination of the value and PageRank value as random walk weight helps to generate hyperedges that reflect the core connected substructure of the community, while retaining nodes with high semantic importance, which helps to provide reliable and effective graph data information for the subsequent calculation of semantic similarity.

[0111] Preferably, in S2, before calling the hypergraph representation learning model, the hyperedges are ranked and pooled according to their importance values, as expressed as follows:

[0112] ;

[0113] ;

[0114] in, represents the pooling ratio, ; Returns the top rankings The superedge subscript of each; Represents a hyperedge By retaining hyperedges with high importance values, the algorithm operation time and complexity of subsequent subgraph comparison can be reduced. At the same time, the core community connection area displayed by the hypergraph can minimize the loss of semantic comparison information between the two graphs.

[0115] Preferably, in S2, the hypergraph representation learning model is HyperSAGE, the node set and the hyperedge set are updated, and then used as the input of the hypergraph representation learning model HyperSAGE, and the final node vector is represented as . Super Edge The vector representation is , the expression is as follows:

[0116] .

[0117] Preferably, in S2, the process of inputting the hyperedge vector into the multi-layer matching network for contrastive learning is as follows:

[0118] Calculate the attention graph-level embedding of the contrast hypergraph starting from the hyperedge, the expression is as follows:

[0119] ;

[0120] ;

[0121] in, Representing Hypergraph Super edge Attentional graph-level embedding of Representing Hypergraph Super edge Attentional graph-level embedding of and Represents different sets of hyperedges; Represents a hyperedge and super edge The cosine similarity between ;

[0122] Functional expression of multilayer matching network as follows:

[0123] ;

[0124] in, Indicates the number of matching layers; Represents vector input; Indicates Layer trainable weight parameters;

[0125] The hyperedge set With hyperedge set All hyperedges in the graph and their corresponding attention level embedding are input into the multi-layer matching network to obtain the matching vector and matching vector , the expression is as follows:

[0126] ;

[0127] ;

[0128] The matching vectors of all hyperedges are input into the recurrent neural network to aggregate into the matching vector of the hyperedge-hypergraph, which is expressed as follows:

[0129] ;

[0130] in, Indicates Hyperedge of layer The matching vector of represents the matching vector of hyperedge-hypergraph; represents a recurrent neural network;

[0131] The hyperedge-hypergraph matching vector Matching vector with hyperedge-hyperedge Input multi-head self-attention mechanism to combine semantically similar features , the expression is as follows:

[0132] ;

[0133] in, Represents a multi-head self-attention mechanism.

[0134] Preferably, in S3, the semantic similarity feature Similar features to the structure Through vector concatenation operation, we can get the global contrast feature vector of the image pair. , and input the vector into the fully connected neural network to obtain the similarity score. Converted to a similarity score between 0 and 1:

[0135] ;

[0136] ;

[0137] ;

[0138] in, Represents a vector concatenation operation; Represents the final similarity score; represents the activation function; represents a fully connected neural network; Represents the predicted value in the model training sample With the true value The mean square error between , that is, the loss function; Indicates the sample size.

[0139] In addition, this embodiment also discloses a computer device, including a memory and a processor;

[0140] The memory is used to store a computer program executable on the processor;

[0141] The processor is used to implement the steps of the above-mentioned graph matching method for heterogeneous graphs when executing the computer program.

[0142] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device.

[0143] The computer device may be a computing device such as a mobile phone, a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but is not limited to, a processor and a memory. For example, the computer device may also include an input / output device, a network access device, a bus, etc.

[0144] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

[0145] The memory can be used to store the computer program and / or module, and the processor implements the computer program by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0146] Wherein, if the module / unit integrated in the computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0147] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned graph matching method for heterogeneous graphs are implemented.

[0148] Compared with the prior art, the present invention proposes a graph matching method for heterogeneous graphs, which performs two-layer comparative learning on the underlying attribute features of heterogeneous nodes; based on mining the underlying semantic association features between nodes, and using hypergraph extraction to model the core subgraph structure to perform matching and comparison between subgraph pairs, the semantic comparison features between nodes are learned. Therefore, the natural advantages of hypergraphs can be used to capture the underlying semantic information in heterogeneous graphs, and then more accurate semantic feature calculations can be learned; at the same time, the global and local node connectivity features of large graphs are modeled based on the diffusion model, and the graph structure features are extracted. Finally, the semantic and graph structure features are fused to calculate the graph similarity feature vector. Therefore, not only the similar features of the graph structure itself are mined, but also the attributes of the nodes and the subordinate community features are fused to learn the semantic information. Therefore, the heterogeneous graph similarity learning method proposed in the present invention is more comprehensive and can effectively and accurately obtain the similarity scores of graph pairs.

[0149] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0150] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A graph matching method for heterogeneous graphs, characterized in that: It is used to calculate the matching degree between graph structure data, including the following steps: S1: Obtain a set of graph pairs for input, and calculate the structural similarity features of the graph pairs based on the diffusion model and attention mechanism; S2: Spectral clustering is used to identify communities of nodes in graph pairs, and hypergraphs are used to model heterogeneous nodes and edges with community labels. Random walks are performed to generate hyperedge sets, and the hypergraph representation learning model is called to obtain hyperedge vector representations. The hyperedge vector representations are input into a multi-layer matching network for comparative learning to obtain hyperedge-hyperedge matching vectors and hyperedge-hypergraph matching vectors. Semantic similarity features are generated based on the hyperedge-hyperedge matching vectors and the hyperedge-hypergraph matching vectors. S3: concatenate the structural similarity features and the semantic similarity features to obtain a global comparison feature vector of the graph pair, input the global comparison feature vector into a fully connected neural network, and obtain a similarity score, which is used to reflect the similarity between the graph structures in the graph pair; The similarity between the graph structures in the graph pair is used to retrieve the friend circle features of frequent interactions between user entities in the social network. Or it can be used to search for academic cooperation groups that frequently cooperate between scholar entities in the academic network. Or it is an important communication organization used to retrieve frequent communications between institutional nodes in a communication network.

2. The graph matching method for heterogeneous graphs according to claim 1, characterized in that: In S1, the structural similarity features of graph pairs are calculated based on the diffusion model and attention mechanism. The process is as follows: The node connectivity features of the graph pair are converted into node representation vectors, the diffusion model is called to learn the node representation vectors to obtain node embeddings, the weight of each node is calculated based on the attention mechanism, the node embeddings are weighted summed to obtain graph embeddings, the graph embeddings are input into the tensor neural network, and the structural similarity features of the graph pair are obtained after learning.

3. The graph matching method for heterogeneous graphs according to claim 2, characterized in that: In S1, the calculation expression of the node representation vector is as follows: in, represents the initial node embedding matrix of the lth layer, and the diffusion depth is 0; X l-1 represents the node embedding matrix of the l-1th layer, W l represents the learnable operation parameters corresponding to the lth layer; A' represents the weighted transformation matrix, A'=D -1 / 2 AD -1 / 2 , A represents the adjacency matrix of graph G, D represents the degree matrix of graph G; K represents the diffusion depth; represents the embedding matrix learned after diffusion in each layer; l represents the number of learning layers; Φ (k) The weight coefficient matrix representing the number of diffusion layers; X l Represents node embedding; The weight of each node is calculated based on the attention mechanism, and the expression is as follows: in, represents the weight feature vector of node i when the diffusion depth is k; \\ represents the vector concatenation operation; ρ represents the learnable weight coefficient; σ() represents the activation function; The graph embedding u is obtained by weighted summation of node embeddings, which is expressed as follows: f1(x i )=m T ·tanh(W·x i +q); Among them, x i represents node embedding; m represents node-level attention vector; W represents learnable weight; q represents learnable bias variable; for node weight feature vector α i Perform normalization operation to obtain the node-level weight ω i ; tanh represents the hyperbolic tangent function; Use tensor neural network to obtain structural similarity features S struct (u1,u2), the expression is as follows: S struct (u1,u2)=σ(u1 T W struct u2+Q[u1\\u2]+b2); Among them, W struct represents the weight vector for comparing structural similarity; Q represents the weight vector; u1 and u2 represent the graph embeddings of the two graphs in the graph pair respectively; b2 represents the learnable bias vector; t represents the structural similarity feature dimension output by the tensor neural network.

4. The graph matching method for heterogeneous graphs according to claim 3, characterized in that: In S2, spectral clustering is used to identify communities of heterogeneous graph nodes, and then a hypergraph is used to model heterogeneous nodes and edges with community labels. A random walk is performed based on the node importance level and the k-core algorithm to generate a hyperedge set. The expression is as follows: K = KCore(V, E); PR = PageRank (V, E, X); E'={i, hop(i, 1), hop(i, 2),..., hop(i, p)}, i∈V'; Where KCore(,) represents the k-core algorithm; PageRank(,,) represents the node importance level; V represents the node; E represents the edge set; X represents the node embedding matrix; k i ∈K,k i represents the k-core value of the i-th node; pr i ∈PR,pr i represents the PageRank value of the i-th node; γ ij represents the random walk weight value from node i to node j; hop(i,p) represents the node after node i has p hops in the random walk; E' represents the hyperedge set.

5. The graph matching method for heterogeneous graphs according to claim 4, characterized in that: In S2, the hyperedges are ranked and pooled according to their importance values ​​before calling the hypergraph representation learning model. The expression is as follows: I e =∑k i ·pr i ,i∈e; Where q represents the pooling ratio; rank() means returning the hyperedge subscripts of the top q*|E'| in importance; I e Represents the importance value of hyperedge e.

6. The graph matching method for heterogeneous graphs according to claim 5, characterized in that: In S2, the hypergraph representation learning model is HyperSAGE, and the hyperedge e i The vector is represented by z i , the expression is as follows: z i =∑x i ,x i ∈e; Among them, x i represents the final node vector representation.

7. The graph matching method for heterogeneous graphs according to claim 6, characterized in that: In S2, the hyperedge vector representation is input into the multi-layer matching network for contrastive learning as follows: Calculate the attention graph-level embedding of the contrast hypergraph starting from the hyperedge, the expression is as follows: in, Representing Hypergraph For the hyperedge e i Attentional graph-level embedding of Representing Hypergraph For the hyperedge e j The attention graph-level embedding of E'1 and E'2 represents different sets of hyperedges; β i,j represents the hyperedge z i and the hyperedge z j The cosine similarity between ; Function expression f of multi-layer matching network match as follows: in, represents the number of matching layers; x1, x2 represent vector input; q i Represents the trainable weight parameters of the i-th layer; All hyperedges in hyperedge set E'1 and hyperedge set E'2 and their corresponding attention graph level embedding are input into the multi-layer matching network to obtain the matching vector and matching vector The expression is as follows: The matching vectors of all hyperedges are input into the recurrent neural network to aggregate into the matching vector of the hyperedge-hypergraph, which is expressed as follows: in, represents the matching vector of hyperedge i at layer l; represents the matching vector of hyperedge-hypergraph; RNN represents recurrent neural network; The hyperedge-hypergraph matching vector The matching vector S with the hyperedge-hyperedge edge Input the multi-head self-attention mechanism and combine them to get the semantically similar features S semantic , the expression is as follows: Among them, multihead represents the multi-head self-attention mechanism.

8. The graph matching method for heterogeneous graphs according to claim 7, characterized in that: In S3, the semantic similarity feature S semantic Similar to the structural features S struct Through vector concatenation operation, we can obtain the global contrast feature vector S of the image pair. all , and input the vector into the fully connected neural network to obtain the similarity score, which is converted to a similarity score between 0 and 1 by sigmoid: S all =concat(S struct ,S semantic ); Among them, concat() represents the vector concatenation operation; represents the final similarity score; sigmoid represents the activation function; MLP represents the fully connected neural network; L r Represents the predicted value in the model training sample and the true value y i The mean square error between ; N represents the number of samples.

9. A computer device, characterized in that: including memory and processor; The memory is used to store a computer program executable on the processor; The processor is used to implement the steps of the graph matching method for heterogeneous graphs according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the graph matching method for heterogeneous graphs according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Graph similarity search method based on sub-graph matching

    CN119415744A

  • A subgraph matching based graph similarity search method

    CN119415744B