A method and system for incremental meta-path storage and dynamic maintenance
By transforming heterogeneous graphs into path graphs and performing dynamic maintenance, the problem of high time overhead in meta-path generation in heterogeneous graph neural networks is solved, achieving efficient meta-path generation and aggregation operations and improving system performance.
Patent Information
- Application Number
- CN202310330142.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-03-30
AI Technical Summary
Existing heterogeneous graph neural networks have excessive time overhead for generating metapaths, resulting in huge latency in real-time inference scenarios. Furthermore, the accuracy of existing methods decreases significantly as the number of graph updates increases.
An incremental method for dynamic maintenance of meta-path instances is adopted. This method transforms a given heterogeneous graph and meta-path instances into a path graph and performs dynamic maintenance after the graph is updated, including merging and recovery operations. This reduces access to irregular data and improves algorithm performance.
Significantly reduce the memory space required for storage, reduce data redundancy and vertex access counts, and achieve high efficiency in metapath generation and improved system performance.
Smart Images

Figure CN116340581B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of graph neural network acceleration system, and particularly relates to a method and system for incremental meta-path storage and dynamic maintenance. BACKGROUND
[0002] The application of graph data is more and more extensive, and the research on homogeneous graph has been very mature, followed by the rise of heterogeneous graph. Heterogeneous graph is widely used in fields such as emotional dialogue generation, malicious account detection, and spam review detection. Since heterogeneous graph can more comprehensively reflect the information of vertices and edges than homogeneous graph, many famous enterprises and companies widely use heterogeneous graph to solve problems in practice. For example, Alibaba uses heterogeneous graph to detect spam, and Didi uses heterogeneous graph to predict taxi information of users. In addition, the paper citation dataset, such as DBLP, also contains different vertex and edge types, representing author, paper, conference and other information. Therefore, more and more models based on heterogeneous graph are emerging, including heterogeneous information network embedding and heterogeneous graph neural network.
[0003] There is a complex interaction between multiple types of nodes and relationships in heterogeneous graph, and how to accurately extract different semantic information becomes a research difficulty. The most important application of heterogeneous graph today is based on meta-path, and with the guidance of meta-path to multiple types of nodes and relationships, multiple semantic representations in heterogeneous graph can be captured. Meta-path is a sequence of vertex types (usually represented as V1V2…V n ), representing the combination of relationships between multiple vertices, and meta-path instance is the instantiated meta-path (usually represented as v1v2…v n ). Through meta-path, semantic and structural information in heterogeneous graph can be effectively obtained.
[0004] In order to obtain semantic and structural information in the meta-path-based heterogeneous graph, the meta-path instances need to be matched in advance, and then meta-path-based aggregation is performed on the basis of the meta-path instances, including intra-meta-path aggregation (structural information aggregation) and inter-meta-path aggregation (semantic information aggregation). The meta-path-based graph model can generally be divided into two types, one of which uses all meta-path instances, and the other of which uses part of the meta-path instances by sampling. In the real world, the graph is usually constantly changing, which means that a series of additions or deletions will be made to the vertices or edges. When the graph changes, the meta-path needs to be matched again for model reasoning each time, which leads to significant model delay, and more importantly, real-time reasoning of dynamic heterogeneous graphs, such as the Didi taxi system, needs to be performed on the user taxi information. If the delay is too high, it will result in very poor user experience.
[0005] The existing method for generating meta-paths in dynamic heterogeneous graph neural networks is mainly through preprocessing, that is, for each meta-path, each vertex in the heterogeneous graph is sequentially traversed to match the meta-path instance. Due to the sparsity and irregularity of the graph, the time overhead brought by this matching method is very large, and in the face of real-time reasoning scenarios, it will produce huge time delay. Some methods use candidate set method to process the original meta-path instance, but this method is only limited to a small number of graph updates, and once the number of graph updates increases, the model accuracy will be greatly reduced.
[0006] As described above, the meta-path-based heterogeneous graph neural network is widely used, but the published invention patents do not solve the problems proposed in the present application. The present application aims to propose an efficient generation method and system of meta-paths in heterogeneous graph neural networks, and the research focus is to accelerate the matching meta-path stage in the meta-path-based heterogeneous graph neural network, which has the highest time consumption proportion in the real-time reasoning process of the heterogeneous graph neural network.
[0007] In addition, on the one hand, there are differences in the understanding of those skilled in the art, and on the other hand, the applicant has studied a large number of literatures and patents when making the present application, but due to the limited space, all the details and contents are not listed in detail, which does not mean that the present application does not have these characteristics of the prior art, on the contrary, the present application has all the characteristics of the prior art, and the applicant reserves the right to add related prior art in the background art. SUMMARY
[0008] In order to solve the problem that the existing technology cannot realize the excessive time consumption of meta-path generation in heterogeneous graph neural networks, the present application provides an incremental dynamic maintenance method and system of meta-path instances, which fully utilizes the characteristics of graph updates in dynamic graphs, reduces a large number of irregular data access in the meta-path generation process, and achieves the purpose of improving the algorithm performance.
[0009] To achieve the above objectives, the present invention provides an incremental method for dynamically maintaining meta-path instances, comprising:
[0010] Transform a given heterogeneous graph and a given type of metapath instance into a path graph;
[0011] Execute the graph update task and perform dynamic maintenance on the path graph of the graph update task;
[0012] Execute a trigger condition query on the dynamically maintained path graph, where,
[0013] Perform a merge operation on the path graph that meets the triggering conditions; and
[0014] Perform a recovery operation on path graphs that do not meet the triggering conditions.
[0015] Preferably, transforming a given heterogeneous graph and metapath instances of a given type of metapath into a path graph may include:
[0016] S11: Given an original graph and a metapath of a given type, match metapath instances in the graph that satisfy the metapath definition;
[0017] S12: Traverse the metapath instances obtained from S11 to transform the metapath instances into a path graph.
[0018] Preferably, performing a graph update task and dynamically maintaining the path graph resulting from the graph update task may include:
[0019] S21: Determine whether the type of the added or deleted point or edge affects the existing metapath instance. If it does, proceed with the next step; otherwise, skip.
[0020] S22: If the graph update type is edge deletion, then traverse the set of points of the corresponding type in the path graph for that edge type and perform the deletion operation on them;
[0021] S23: If the graph update type is to add an edge, then traverse the neighbor set of the corresponding type of point set in the path graph to determine the position of the point or edge to be added in the path graph.
[0022] S24: If the graph update type is to add or delete points, then it is converted into an operation of adding or deleting multiple edges, and steps S22 and S23 are repeated.
[0023] In particular, in step S22, if the deletion operation generates one or more independent points at the same time, then these independent points need to be deleted together.
[0024] Preferably, performing a merge operation on a path graph that meets the triggering conditions may include:
[0025] S31: Obtain the metapath satisfying the metapath definition in all given metapath types;
[0026] S32: Obtain the path graph corresponding to the metapath obtained in step S31;
[0027] S33: Perform the merging operation on the center part of the path graph obtained in step S32.
[0028] In particular, the metapath satisfying the metapath definition can be a metapath satisfying the length greater than the preset length (such as 2) and the center part symmetric (such as the center part satisfying V i V j V i form). In addition, the merging operation on the center part of the metapath satisfying the metapath definition can be to only retain the V i V j V i part of V j .
[0029] Preferably, performing the recovery operation on the path graph not satisfying the triggering condition can include:
[0030] S41: For the path graph on which the merging operation is not performed, sequentially traverse the path graph to obtain all metapath instances;
[0031] S42: For the path graph on which the merging operation is performed, traverse the path graph from the center to the direction of both sides to obtain all metapath instances.
[0032] Preferably, step S11 can include:
[0033] S111: For the original graph and the given type of metapath, sequentially match the instances satisfying the metapath definition from a certain vertex in the graph;
[0034] S112: Repeat step S111 until the entire original graph is traversed to obtain all metapath instances;
[0035] S113: For the given different types of metapath instances, repeat steps S111 and S112 until all instances of the given types of metapaths are obtained.
[0036] Preferably, step S12 can include:
[0037] S121: For the given type of metapath, traverse all instances of the type of metapath obtained in S11, and convert the edges in each instance into point storage;
[0038] S122: For all types of metapaths, repeat step S121 to obtain the path graph of all types of metapath instances.
[0039] Specifically, in step S121, if two edges in the meta-path instance are connected by a vertex, an edge is connected between the two transformed vertices, and thus the new vertex storage format of all instances of the meta-path type, i.e., the path graph, is obtained.
[0040] Preferably, the present application also relates to an incremental meta-path storage and dynamic maintenance system, which can comprise:
[0041] a maintenance module configured to dynamically maintain all path graphs and send the path graphs to the recovery module in a task load balancing manner;
[0042] a recovery module configured to perform a recovery operation on the path graphs updated by the maintenance module to obtain all meta-path instances and perform an aggregation operation on the meta-path instances.
[0043] Preferably, the maintenance module comprises one or more maintenance sub-modules, which can comprise:
[0044] a graph update receiving unit configured to receive a graph update instruction;
[0045] a path graph updating unit configured to traverse the path graph to perform an update of the path graph in response to the graph update instruction;
[0046] a path graph subgraph allocation unit configured to send the updated path graph to the recovery module.
[0047] Preferably, the recovery module comprises one or more recovery sub-modules, which can comprise:
[0048] a reading unit configured to perform a recovery operation on the path graphs from the maintenance module to obtain all meta-path instances;
[0049] an aggregation unit configured to perform an aggregation operation on the path graphs from the reading unit to obtain an aggregation result of each meta-path instance.
[0050] The present application provides a method and system for accelerating meta-path instance matching in a meta-path-based heterogeneous graph neural network. On the one hand, the path graph is used to store the meta-path instance, which can greatly reduce the memory space required for storage and reduce data redundancy. On the other hand, by merging operation, a large number of vertex access times are saved, thereby reducing a large number of random memory accesses, making the meta-path generation very efficient. More importantly, in the existing traditional method, the generation of the meta-path instance and the aggregation based on the meta-path are executed in sequence, while the method proposed in the present application can make the meta-path generation and the aggregation operation be executed simultaneously, which further improves the performance of the system. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 is a flowchart of an incremental meta-path storage and dynamic maintenance method provided by the present application;
[0052] Figure 2 is a structural block diagram of an incremental meta-path storage and dynamic maintenance system provided by the present application;
[0053] Figure 3 is one of preferred application scenarios of an incremental meta-path storage and dynamic maintenance method provided by the present application;
[0054] Figure 4 The merging operation of path graphs and the operation of updating path graphs using an incremental meta-path storage and dynamic maintenance method provided by the present application are shown.
[0055] List of reference signs
[0056] 1: maintenance module; 2: recovery module; 3: maintenance submodule; 4: recovery submodule; 5: graph update receiving unit; 6: path graph updating unit; 7: path graph subgraph assigning unit; 8: reading unit; 9: aggregation unit. DETAILED DESCRIPTION
[0057] The preferred embodiments of the present application are described in detail below with reference to the accompanying drawings, so that the advantages and features of the present application can be more easily understood by those skilled in the art, and the protection scope of the present application is more clearly defined.
[0058] First, some terms appearing in the present application are explained:
[0059] Heterogeneous graph: Unlike homogeneous graph (in which there is only one node type and one edge type), it is a graph data structure with multiple node types or multiple edge types, usually represented as G=(V, E, V t , E t ), where V is the set of all nodes in the graph, E is the set of all edges in the graph, V t is the set of node types in the graph, and E t is the set of edge types in the graph.
[0060] Meta-path: A meta-path is a sequence of vertex types, usually represented as V1V2…V n , where V1, V2, …, V n ∈ V t . A meta-path represents the combination of relationships between multiple vertices.
[0061] Meta-path instance: A meta-path instance is a path in the graph, the node types in the path meet the definition of the meta-path (i.e. the instantiated meta-path), usually represented as v1v2…vn wherein v1, v2,..., v n ∈ V.
[0062] Path graph: is a graph formed by all the meta-path instances after format conversion in the present application, which stores all the meta-path instances.
[0063] Dynamic maintenance: after the graph update occurs, the path graph is updated accordingly to ensure the correctness of the meta-path instances stored in the path graph.
[0064] Embodiment 1
[0065] The present application provides a kind of incremental meta-path instance dynamic maintenance method, see Figure 1 , which can include the following steps:
[0066] S1: the given heterogeneous graph and all the meta-path instances of the given type meta-path are converted into a new storage format (for the convenience of description, it is called "path graph").
[0067] S2: after the graph update occurs, the path graph is executed accordingly Dynamic maintenance.
[0068] S3: the path graph that meets the trigger condition is executed merging operation.
[0069] S4: the path graph that does not meet the trigger condition is executed recovery operation.
[0070] According to a preferred embodiment, before the merging or recovery operation is executed on the dynamically maintained path graph, the state of the path graph needs to be determined, that is, the trigger condition query is executed on the path graph. Specifically, the trigger condition is whether the current path graph meets the merging requirement.
[0071] Specifically, in the present application, the path graph that meets the merging requirement is merged to make it faster to complete the subsequent steps. On the other hand, when the model needs to be inferred, the path graph that does not meet the merging requirement is executed recovery operation to obtain all the meta-path instances for calculation.
[0072] According to a preferred embodiment, step S1 can include the following sub-steps:
[0073] S11: for the original graph and the meta-path of the given type, match all the meta-path instances in the graph that meet the meta-path definition.
[0074] S12: according to all the meta-path instances obtained in step S11, traverse the meta-path instances to construct a new storage format of the meta-path instances, that is, the path graph.
[0075] According to a preferred embodiment, step S2 can include the following sub-steps:
[0076] S21: judging whether the type of the added or deleted point or edge will affect the existing meta-path instance, if yes, performing the following step; otherwise, skipping step S2.
[0077] S22: if the graph update type is deleting an edge, traversing the point set of the corresponding type of the edge type in the path graph, and performing the deleting operation thereon.
[0078] S23: if the graph update type is adding an edge, traversing the neighbor set of the point set of the corresponding type of the edge type in the path graph to determine the position of the point and edge to be added in the path graph.
[0079] S24: if the graph update type is adding or deleting a point, it can be converted into the operation of adding or deleting multiple edges, and repeating steps S22 and S23 to realize the update of the path graph.
[0080] In particular, in step S22, if the deleting operation produces an independent point, the independent point also needs to be deleted.
[0081] According to a preferred embodiment, step S3 can include the following sub-steps:
[0082] S31: judging all given meta-path types to obtain a meta-path satisfying the preset meta-path definition.
[0083] S32: obtaining the storage format (or path graph) of the meta-path obtained in step S31 in step S2.
[0084] S33: performing a merging operation on the center part of the storage format (or path graph) obtained in step S2.
[0085] In particular, in step S31, the preset meta-path definition can be a meta-path with a length greater than a preset length (such as 2) and a center part symmetry. Specifically, the meta-path with a center part symmetry can be a meta-path with a center part satisfying V i V j V i . It should be understood that the above meta-path definition is only a special case for understanding and illustration, and those skilled in the art can also make other forms of definition.
[0086] In particular, in step S33, the center part of the storage format (or path graph) obtained in step S32 is subjected to a merging operation, which can be in the form of V i V j V i . Further, the merging operation on the center part of the storage format (or path graph) can be to retain only V i Vj V i of V j part.
[0087] According to a preferred embodiment, step S4 can comprise the following sub-steps:
[0088] S41: for the path graph which has not performed the merging operation, traverse the path graph in order to obtain all the meta-path instances.
[0089] S42: for the path graph which has performed the merging operation, traverse the path graph from the center to both sides to obtain all the meta-path instances.
[0090] According to a preferred embodiment, step S11 further comprises the following sub-steps:
[0091] S111: for the original graph and a given type of meta-path, from a certain vertex in the graph, match the instances which conform to the definition of the meta-path in order according to the definition of the meta-path.
[0092] S112: repeat step S111 until the entire original graph is traversed to obtain all the meta-path instances.
[0093] S113: for a given different type of meta-path instance, repeat steps S111 and S112 until all the instances of the given type of meta-path are obtained.
[0094] In particular, in step S112, the meta-path instances are preferably stored in a list manner.
[0095] According to a preferred embodiment, step S12 further comprises the following sub-steps:
[0096] S121: for a given type of meta-path, traverse all the instances of the type of meta-path obtained in S11 and store the edges in each instance as points.
[0097] S122: for all types of meta-paths, repeat step S121 to obtain the new storage format of the meta-path instances of all types, i.e. the path graph of the meta-path instances of all types.
[0098] In particular, in step S121, the point contains the start vertex and target vertex information of the edge in the corresponding instance.
[0099] Further, in step S121, if two edges in the meta-path instance are connected by a point, then the two vertices after conversion are connected by an edge, so that the new storage format of all the meta-path instances of the type of meta-path is obtained, i.e. the path graph.
[0100] For the convenience of understanding and illustration, a specific application scenario of the incremental meta-path instance dynamic maintenance method is given, referring to Figure 3 and Figure 4 , in particular:
[0101] As shown in Figure 3 , Figure 3 (a) is a heterogeneous graph of a paper citation, including three node types, namely Author (A), Paper (P) and Conference (C), representing the information of authors, papers and conferences respectively; two edge types, A-P and P-C, representing the information that an author writes a paper and a paper is published in a conference respectively. For a given meta-path APCPA, the meta-path expresses the information that two authors write papers published in the same conference. Using step S1, i.e. traversing the original graph, all meta-path instances can be obtained. Further, as shown in Figure 3 (b), for the meta-path instance 1-4-7-5-2 in the graph, its meaning is that the paper 4 written by the author 1 and the paper 5 written by the author 2 are both published in the conference 7. As shown in Figure 3 (c), using step S2 again, all meta-path instances are converted into path graphs for storage.
[0102] Figure 4 The merging operation of the path graph and the operation of updating the path graph are shown, wherein the original graph is selected as the heterogeneous graph in Figure 3 (a), and the meta-path is selected as APCPA. In particular, since the meta-path selected is APCPA, the merging requirement is met. Therefore, the path graph in Figure 4 (a) can be merged, and the merged path graph is shown in Figure 4 (b). Further, Figure 4 (c) and (d) show the updating results of the path graph after the graph update (including the operation of deleting edges shown in (c) and the operation of adding edges shown in (d)).
[0103] Embodiment 2
[0104] The present application provides an incremental meta-path instance dynamic maintenance system, referring to Figure 2 , which can include a maintenance module 1 and a recovery module 2 capable of communicating with each other.
[0105] According to a preferred embodiment, the maintenance module 1 is configured to dynamically maintain all path graphs and send the path graphs to the recovery module 2 in a task load balancing manner. The recovery module 2 is configured to perform a recovery operation on the path graph after the maintenance module 1 completes the updating of the path graph, obtain all meta-path instances, and perform an aggregation operation based on the meta-path instances.
[0106] Specifically, the update information of the path graph can include the addition and deletion of edges or points. In particular, the addition or deletion of points can be regarded as the addition or deletion of multiple edges. Further, after the path graph is updated, the path graph is distributed to the recovery module in the form of a connected branch.
[0107] According to a preferred embodiment, referring to Figure 2 The maintenance module 1 can include one or more maintenance sub-modules 3. Specifically, the maintenance sub-module 3 can be used to perform the update task for one or more path graphs.
[0108] Further, the maintenance sub-module 3 can include a graph update receiving unit 5, a path graph updating unit 6 and / or a path graph subgraph distribution unit 7. Specifically, the graph update receiving unit 5 is configured to receive the instruction of the graph update. The path graph updating unit 6 is configured to traverse the path graph to complete the update of the path graph in response to the received graph update instruction. The path graph subgraph distribution unit 7 is configured to send the updated path graph to the recovery module 2.
[0109] According to a preferred embodiment, referring to Figure 2 The recovery module 2 can include one or more recovery sub-modules 4. Specifically, the recovery sub-module 4 can be used to read the meta-path instance from the path graph and perform the aggregation operation.
[0110] Further, the recovery sub-module 4 can include a reading unit 8 and / or an aggregation unit 9. Specifically, the reading unit 8 is configured to perform the recovery operation on the path graph from the maintenance module 1 to obtain all the meta-path instances. In other words, after receiving the path graph from the maintenance module 1, the reading unit 8 will traverse the path graph to obtain all the meta-path instances, and then send the meta-path instances to the aggregation unit 9. The aggregation unit 9 is configured to perform the aggregation operation on the meta-path instances from the reading unit 8 to obtain the aggregation result of each meta-path instance. In particular, the aggregation result output by the aggregation unit 9 can be used for subsequent calculation of model inference.
[0111] According to a preferred embodiment, in the present application, the reading unit 8 and the aggregation unit 9 can be started synchronously or in parallel. Specifically, the reading unit 8 can send the corresponding result to the aggregation unit 9 as soon as it obtains a meta-path instance, so as to allow the aggregation unit 9 to use the meta-path instance for aggregation calculation, which greatly increases the parallelism and calculation efficiency of the system.
[0112] In particular, the data processed by the processor carrying the meta-path storage and dynamic maintenance method of the application is specifically a heterogeneous graph in a real scene, such as a paper set data set, an Internet movie data set, and the like. These data sets are heterogeneous graph data sets, which contain multiple point or edge types. In the application process, the processor (such as a CPU) calls the data to be processed from the hard disk, reads the data, and performs aggregation operations within the meta-path to complete part of the inference calculation of the heterogeneous graph neural network. After the processor (such as a CPU) processes the data, the data is sent to a graphics processing unit (GPU) through a PCIe bus to perform subsequent inference calculation of the heterogeneous graph neural network.
[0113] Those skilled in the art should understand that, as long as the purpose of the application can be achieved, other steps or operations can be included before and / or after the above steps a, b and / or S1-S3, or between the steps, such as further optimizing and / or improving the method described in the application. In addition, although the method described in the application is shown and described as a series of actions performed in sequence, it should be understood that the method is not limited by the order of sequence. For example, some actions can occur in a different order than described herein. Alternatively, one action can occur simultaneously with another action.
[0114] Those skilled in the art can understand that the various exemplary embodiments described in the application can be implemented by software or by software combined with necessary hardware. Therefore, the specific embodiments according to the application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium or a non-transitory computer readable storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or on a network, including a number of instructions to make a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the application.
[0115] In an exemplary embodiment, the program product of the application can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or apparatus, or any combination of the above. More specific examples of readable storage media include, but are not limited to, an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0116] Accordingly, based on the same inventive concept, the application also provides an electronic device.
[0117] In example embodiments, the electronic device is in the form of a general purpose computing device. Components of the electronic device can include, but are not limited to, at least one processor, at least one memory, a bus that connects different system components, including the memory and the processor.
[0118] The memory stores, among other things, computer readable instructions that can be executed by the processing unit to cause the processing unit to perform a method recited by the present application. The processor includes at least a data processing unit recited by the present application (sometimes also referred to as a "module"). The memory can include a readable medium in the form of a volatile memory unit, such as a random access memory (RAM) and / or a cache memory unit, and can further include a read only memory (ROM).
[0119] The memory of the present application can also include a program / utility having a set of program modules that include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, as are found in each of the examples, or some combination thereof, that can include an implementation of a network environment.
[0120] The bus can be representative of one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or local bus using any of a variety of bus structures, and the like.
[0121] The electronic device can also communicate with one or more external devices, such as a keyboard or a pointing device, through an I / O interface. Additionally, the electronic device can communicate with one or more devices that enable a user to interact with the electronic device, and / or one or more devices (e.g., a router, a modem, etc.) that enable the electronic device to communicate with one or more other computing devices.
[0122] Such communication can occur via an input / output (I / O) interface. Still yet, the electronic device can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter. The network adapter can communicate with the other modules of the electronic device through the bus. It should be appreciated that the network adapter can also be utilized to enable the electronic device to communicate with other electronic devices or systems that are not illustrated, such as by way of an example, a device in a cloud computing environment.
[0123] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to devise modifications which, though perhaps not explicitly described or shown herein, nonetheless fall within the scope of the application. Accordingly, the patent application includes all modifications encompassed within the scope of the claims and their equivalents. The patent application contains several inventive concepts, and the applicant reserves the right to file separate applications on each of these concepts, or on any combination or sub-combination of these concepts.
Claims
1. A method for incremental meta-path storage and dynamic maintenance, characterized in that, The method comprises the following steps: transforming a given heterogeneous graph and a meta-path instance of a given type of meta-path into a path graph, and matching a meta-path instance satisfying a meta-path definition in the graph for a given original graph and a given type of meta-path; traversing the meta-path instance to transform the meta-path instance into a path graph, traversing all instances of the type of meta-path for a given type of meta-path, and storing edges in each instance as points; repeating the above step for all types of meta-paths to obtain path graphs of all types of meta-path instances; performing a graph update task and performing dynamic maintenance on the path graph that has undergone the graph update; performing a trigger condition query on the path graph that has undergone the dynamic maintenance, wherein, performing a merging operation on the path graph that satisfies the trigger condition to obtain a meta-path satisfying the meta-path definition in all given meta-path types; obtaining the path graph corresponding to the meta-path satisfying the meta-path definition; and performing a merging operation on the central part of the path graph; and performing a recovery operation on the path graph that does not satisfy the trigger condition, traversing the path graph in order for the path graph that has not undergone the merging operation to obtain all meta-path instances; and traversing the path graph from the center to both sides for the path graph that has undergone the merging operation to obtain all meta-path instances.
2. The method of claim 1, wherein, The step of performing a graph update task and performing dynamic maintenance on the path graph that has undergone the graph update comprises the following steps: determining whether the type of the added or deleted point or edge affects an existing meta-path instance, and if so, performing the following steps, otherwise skipping; if the graph update type is deleting an edge, traversing the point set of the corresponding type of the edge type in the path graph and performing a deletion operation thereon; if the graph update type is adding an edge, traversing the neighbor set of the point set of the corresponding type of the edge type in the path graph to determine the position of the point or edge that needs to be added in the path graph; if the graph update type is adding or deleting a point, converting it into an operation of adding or deleting multiple edges, and repeating the steps of "if the graph update type is deleting an edge, traversing the point set of the corresponding type of the edge type in the path graph and performing a deletion operation thereon" or "if the graph update type is adding an edge, traversing the neighbor set of the point set of the corresponding type of the edge type in the path graph to determine the position of the point or edge that needs to be added in the path graph".
3. The method of claim 1, wherein, The step of matching a meta-path instance satisfying a meta-path definition in the graph for a given original graph and a given type of meta-path comprises the following steps: for the original graph and the given type of meta-path, starting from a certain vertex in the graph, sequentially matching instances that meet the meta-path definition; repeating the above step until the entire original graph is traversed to obtain all meta-path instances; and repeating the above steps for different types of given meta-path instances until all instances of the given type of meta-path are obtained.
4. A system for incremental meta-path storage and dynamic maintenance, the system performing the method for incremental meta-path storage and dynamic maintenance according to any one of claims 1 to 3, characterized in that, The method comprises the following steps: a maintenance module (1) configured to dynamically maintain all path graphs and send the path graphs to a recovery module (2) in a task load balancing manner; a recovery module (2) configured to perform a recovery operation on the path graph updated by the maintenance module (1) to obtain all meta-path instances, and perform an aggregation operation on the meta-path instances.
5. The system of claim 4, wherein, The maintenance module (1) comprises one or more maintenance sub-modules (3), which comprise: a graph update receiving unit (5) configured to receive a graph update instruction; a path graph updating unit (6) configured to traverse a path graph to perform an update of the path graph in response to the graph update instruction; a path graph subgraph assigning unit (7) configured to send the updated path graph to a recovery module (2).
6. The system of claim 4 or 5, wherein, The recovery module (2) comprises one or more recovery sub-modules (4), which comprise: a reading unit (8) configured to perform a recovery operation on the path graph from the maintenance module (1) to obtain all meta-path instances; an aggregating unit (9) configured to perform an aggregation operation on the path graph from the reading unit (8) to obtain an aggregation result of each meta-path instance.
Citation Information
Patent Citations
Subject-based community search method on heterogeneous information network
CN114722304A
FPGA-based dynamic graph processing method
US20210191763A1