A heterogeneous graph neural network acceleration method and system based on a meta-path graph

By constructing a meta-path graph and performing graph partitioning and hierarchical encoding, the high semantic graph construction overhead and redundant computation problems in heterogeneous graph neural networks are solved, thereby improving computational efficiency and inference speed.

CN119623509BActive Publication Date: 2025-11-18HUAZHONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411569136.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-11-18
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

Existing heterogeneous graph neural networks suffer from high semantic graph construction overhead, memory overhead, and redundant computation when processing meta-path instances, resulting in inference latency and low computational efficiency.

Method used

By constructing a meta-path graph, information from heterogeneous graphs is integrated, and graph partitioning and hierarchical coding methods are used to reduce redundant calculations and improve computational efficiency.

Benefits of technology

It significantly reduces the computational complexity of heterogeneous graph neural networks, improves training speed and inference efficiency, and is suitable for processing large-scale heterogeneous graph data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623509B_ABST
    Figure CN119623509B_ABST
Patent Text Reader

Abstract

The application relates to a heterogeneous graph neural network acceleration method and system based on a meta-path graph, which comprises the following steps: constructing a meta-path graph in the form of a graph according to all meta-path instances according to a given heterogeneous graph and a given type of meta-path; performing graph partitioning on the meta-path graph to obtain a plurality of meta-path subgraphs; performing workload partitioning on the meta-path subgraphs; performing layer-based meta-path instance coding according to the workload partitioning; merging the coding of all meta-path instance slices according to the inter-layer relationship of the meta-path graph to obtain the coding of the meta-path instance; and performing intra-meta-path instance aggregation and inter-meta-path instance aggregation calculation to obtain the final features of the target vertex. The application greatly reduces the redundant calculation in the heterogeneous graph neural network, thereby improving the model reasoning efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of heterogeneous graph neural network acceleration technology, and in particular to a method and system for accelerating heterogeneous graph neural networks based on meta-path graphs. Background Technology

[0002] A heterogeneous graph is a graph structure where vertices and edges have different types. In heterogeneous graphs, the connections between vertices and between vertices and edges can be diverse and complex, reflecting various relationships in the real world. Key concepts in heterogeneous graphs include: Vertex Types: Vertices in a heterogeneous graph can be categorized into different types, each with specific attributes and semantics. For example, in a social network, vertex types could be users, groups, or pages. Edge Types: Edges in a heterogeneous graph can also be categorized into different types, each representing relationships between vertices of different types. For example, in a social network, edge types could be friend relationships, like relationships, or comment relationships. Metapaths define specific types of connection patterns between vertices. They describe how a path through a series of vertex and edge types leads from one vertex to another. Metapaths are an important tool for capturing the complex relationships between vertices in a heterogeneous graph.

[0003] Heterogeneous Graph Neural Networks (HGNNs) are neural network models designed for processing heterogeneous graph data. Compared to traditional Graph Neural Networks (GNNs), HGNNs can efficiently handle different types of vertices and edges in heterogeneous graphs. The development of HGNNs can be traced back to traditional graph representation learning methods, such as vertex embeddings and graph embeddings. Then, with the development of deep learning, GNNs were introduced to learn representations of graph data. Due to the complexity of heterogeneous graphs, researchers have proposed various GNN-based heterogeneous graph models to address the challenges of heterogeneous graph data. These models aim to learn representations of different types of vertices in heterogeneous graphs and to learn through information transfer and connections between vertices.

[0004] Given the multivariate mapping relationships between heterogeneous graphs and metapaths, the number of metapath instances is often quite large. Maintaining this large number of metapath instances is a challenge. Early research matched metapath instances using breadth-first search (BFS). BFS-based heterogeneous graph neural networks first list all metapath instances and then store them in a large memory space, which can be thousands of times larger than the original graph. When a metapath instance is needed, the encoder can directly read it. Since all metapath instances are stored separately, the encoding suffers from a lot of redundant computation. However, encoding metapath instances in vertex index order leads to an unbalanced load. Recent solutions employ depth-first search (DFS) to traverse metapath instances from the original graph. DFS-based methods support matching metapath instances when constructing the semantic graph. Once a metapath instance is matched, its semantic information is immediately encoded into the embedding and used to incrementally update the semantic graph before being discarded. Therefore, DFS-based HGNNs do not need to store metapath instances, thus reducing significant storage overhead. However, once meta-path instances are used, discarding them can lead to additional overhead in model inference by re-matching meta-path instances from the original graph, thus increasing inference latency. DFS-based solutions can change the encoding order and matching direction of meta-path instances, reducing redundant computation between meta-path instances of the same target vertex, but redundant computation between different vertices still exists. Neither of these approaches completely solves the problems inherent in heterogeneous graph neural networks, such as high semantic graph construction overhead, memory overhead, and redundant computation. Therefore, this invention aims to construct an efficient heterogeneous graph neural network system.

[0005] CN114298279A discloses a method for constructing the design space of heterogeneous graph neural networks (HNNs) with multiple design dimensions. It proposes a unified framework for HNNs and defines their design space based on this framework. This invention overcomes the shortcomings of previous works that only evaluated HNNs at the model level, providing researchers with a module-level evaluation perspective and allowing for further analysis of the design dimensions that play a crucial role in model performance. The invention also constructs the Space4HGNN platform for the design space of HNNs and extracts guiding principles for design models based on this platform, providing standard evaluation and modular implementations of HNNs. This platform provides researchers with module-level evaluation and offers users a simple interface to help them evaluate the impact of different design dimensions. However, this invention does not completely solve the problems existing in HNNs.

[0006] As mentioned above, heterogeneous graph neural networks based on metapaths are widely used, but none of the published invention patents have solved the problem proposed in this invention. This invention aims to propose an efficient method and system for generating metapaths in heterogeneous graph neural networks.

[0007] Furthermore, on the one hand, there are differences in understanding among those skilled in the art; on the other hand, the applicant studied a large number of documents and patents when making this invention, but due to space limitations, not all details and contents were listed in detail. However, this does not mean that the present invention does not possess the features of these prior art. On the contrary, the present invention already possesses all the features of the prior art, and the applicant reserves the right to add relevant prior art to the background art. Summary of the Invention

[0008] Current heterogeneous graph neural networks (HGNNs) typically employ a depth-first search (DFS) approach to traverse meta-path instances from the original graph. DFS-based methods support matching meta-path instances during semantic graph construction. Once a meta-path instance is matched, its semantic information is immediately encoded into the embedding and used to incrementally update the semantic graph before being discarded. Therefore, DFS-based HGNNs do not need to store meta-path instances, significantly reducing storage overhead. However, discarding meta-path instances after they have been used can lead to additional overhead for each HGNN model in inference by re-matching meta-path instances from the original graph, increasing inference latency. DFS-based solutions can change the encoding order and matching direction of meta-path instances, reducing redundant computation between meta-path instances of the same target vertex, but redundant computation between different vertices still exists. Neither of these approaches completely solves the problems inherent in heterogeneous graph neural networks, such as high semantic graph construction overhead, memory overhead, and redundant computation.

[0009] To address the shortcomings of existing technologies, this invention provides a method for accelerating heterogeneous graph neural networks based on meta-path graphs. The method includes: constructing a meta-path graph from all meta-path instances according to a given heterogeneous graph and a given type of meta-path; partitioning the meta-path graph to obtain several meta-path sub-graphs; dividing the meta-path sub-graphs into workloads; encoding meta-path instances based on layers according to the workload division; merging the encodings of all meta-path instance slices according to the inter-layer relationships of the meta-path graph to obtain the encodings of the meta-path instances; and performing aggregation calculations within and between meta-path instances to obtain the final features of the target vertex.

[0010] This invention accelerates the computation of graph neural networks by constructing a meta-path graph, which effectively integrates information from heterogeneous graphs. The meta-path graph not only provides a deep representation of specific types of relationships but also optimizes the computation process through an efficient data structure. This method significantly reduces the computational complexity of heterogeneous graph neural network models, enabling faster training and improved inference efficiency when dealing with large-scale heterogeneous graphs.

[0011] According to a preferred embodiment, the steps of constructing a meta-path graph include: extracting vertices and edges from the heterogeneous graph based on the types of occurrences in the meta-path; copying the recurring vertices and edges to the previous partial meta-path graph, and further expanding them according to the meta-path pattern to form a complete meta-path graph. The resulting meta-path graph not only has high expressive power but also ensures the integrity and consistency of the graph structure through the copying and expansion of recurring vertices and edges, thereby enhancing the neural network's ability to learn complex relationships.

[0012] According to a preferred embodiment, the step of partitioning the metapath graph includes: collecting the vertices in the central layer of the metapath graph to obtain all the vertices in the central layer of the metapath graph; dividing the vertices in the central layer into several batches, with each batch containing the same number of central layer vertices; starting from all vertices in each batch, traversing the metapath graph according to the outgoing and incoming edge directions to obtain the metapath subgraph corresponding to the batch.

[0013] When partitioning the metapath graph, collecting the vertices of the central layer and processing them in batches effectively reduces the computational load and simplifies the graph structure of each batch, facilitating subsequent computation. This batching strategy enables parallel processing of multiple subgraphs, improving overall computational efficiency, especially in large-scale graph data scenarios, significantly accelerating the training and inference speed of heterogeneous graph neural network models.

[0014] According to a preferred embodiment, the step of partitioning the workload of the metapath subgraph includes: dividing the metapath subgraph into at least two parts by layers, each part containing consecutive layers and constituting a metapath slice graph containing a portion of metapath instances; and traversing the metapath slice graph in layer order to obtain all metapath instance slices.

[0015] Dividing the metapath subgraph into multiple parts by layer and forming metapath slices enables independent processing of information at different levels. This not only facilitates more efficient computation using feature information from different levels, but also allows for the extraction of more detailed metapath instance features through layer-by-layer traversal of the slices. This enables heterogeneous graph neural network models to more accurately capture hierarchical structures during the learning process, thereby improving the performance of heterogeneous graph neural network models.

[0016] According to a preferred embodiment, the step of obtaining the encoding of a metapath instance includes: encoding the metapath instance slices to obtain partial encoding of the metapath instance; using the edge relationships between different layers, re-encoding the encoding of the metapath instance slices in different subgraphs to obtain the encoding of all metapath instances; performing metapath instance internal aggregation on different metapath subgraphs to obtain the feature information of the target vertex; and performing metapath instance aggregation on the feature information of the same target vertex between different metapath graphs to obtain the final features of all target vertices.

[0017] In the process of obtaining the encoding of meta-path instances, merging the encodings of different subgraphs based on inter-layer relationships can fully utilize the structural information of the graph to improve the richness of feature representation. By performing aggregation calculations on the internal and external meta-path instances, the feature information of the target vertex is finally obtained, demonstrating the significant technical effect of this method in improving feature fusion quality and information transmission efficiency. This will help achieve better performance in downstream tasks.

[0018] According to a preferred embodiment, the steps of encoding metapath instance slices include: determining whether there is a completely identical continuous part in the metapath definition corresponding to the metapath graph; if so, performing priority layer partitioning; otherwise, performing layer-based partitioning.

[0019] In the encoding process, by determining whether there are completely identical continuous parts in the meta-path graph and implementing priority layer partitioning, the efficiency and accuracy of encoding are effectively improved. Compared with traditional methods, this layer-based partitioning strategy can quickly locate similar structures, reduce redundant computation, and thus significantly improve processing speed during encoding. This technical effect enables heterogeneous graph neural network models to adapt more flexibly and efficiently to different computational needs when facing complex heterogeneous graph structures, further enhancing the practicality of heterogeneous graph neural network models.

[0020] This invention provides, from a second aspect, a heterogeneous graph neural network acceleration system based on meta-path graphs. The system includes a construction module, a partitioning module, a computation module, and a merging module. The construction module constructs a meta-path graph from all meta-path instances according to a given heterogeneous graph and a given type of meta-path. The partitioning module partitions the meta-path graph to obtain several meta-path subgraphs. The computation module divides the workload of the meta-path subgraphs. The merging module performs layer-based meta-path instance encoding based on the workload division, merges the encodings of all meta-path instance slices according to the inter-layer relationships of the meta-path graph to obtain the encodings of the meta-path instances, and performs aggregation calculations within and between meta-path instances to obtain the final features of the target vertex.

[0021] The system's modular design allows each module to run in parallel on dedicated hardware units (such as GPUs or multi-core CPUs), thereby improving the speed and efficiency of information processing. At the hardware level, through parallel computing and efficient data transmission, the system can quickly process large-scale heterogeneous graph data, reduce computational latency, optimize resource utilization, and ensure high efficiency in real-time application scenarios.

[0022] According to a preferred embodiment, the construction module includes several construction sub-modules for constructing a meta-path graph; wherein, the several construction sub-modules include an extraction module and an extension module, the extraction module extracts vertices and edges in the heterogeneous graph according to the types appearing in the meta-path; the extension module copies the repeated vertices and edges to the previous partial meta-path graph and further extends it according to the meta-path pattern to form a complete meta-path graph.

[0023] The extraction and expansion modules within the construction module utilize efficient data structures and memory management to quickly extract vertices and edges from heterogeneous graphs and construct meta-path graphs. This process leverages the hardware's parallel read / write capabilities and optimizes memory access, significantly improving information processing speed. This efficient construction capability enables the system to quickly generate the necessary graph data when faced with complex graph structures, reducing construction time.

[0024] The partitioning module's design allows the hardware to employ parallel algorithms during graph partitioning, thereby rapidly generating multiple metapath subgraphs. The module's effectiveness lies in reducing computational resource requirements; the hardware can efficiently utilize multiple cores or processing units simultaneously, lowering the overall computational burden and improving information processing efficiency. This process ensures the efficiency of subsequent computations, laying the foundation for large-scale graph data processing.

[0025] According to a preferred embodiment, the calculation module includes several calculation sub-modules; the calculation sub-modules are used to divide the metapath subgraph into workloads according to layers, obtain several metapath slice graphs, and perform encoding calculations; the calculation sub-module includes a load module and an encoding module; the load module is used to divide the metapath subgraph into at least two parts according to layers, each part containing consecutive layers and constituting a metapath slice graph containing a part of the metapath instance; the encoding module is used to traverse the metapath slice graph according to the order of layers to obtain all metapath instance slices.

[0026] The computation module intelligently partitions the workload of the meta-path subgraph, maximizing the utilization of the hardware's parallel computing capabilities. The design of the load and encoding modules ensures that the hardware can handle multiple tasks during encoding computation, significantly improving computation speed. Simultaneously, the hierarchical traversal strategy makes data processing more efficient, reducing memory bandwidth consumption and effectively improving information processing efficiency.

[0027] According to a preferred embodiment, the merging module includes several merging sub-modules; the merging sub-modules include an encoding merging module, a meta-path internal aggregation module, and a meta-path inter-aggregation module; the encoding merging module is used to encode meta-path instance slices and obtain partial codes of meta-path instances, and uses the edge relationships between different layers to re-encode the codes of meta-path instance slices in different subgraphs to obtain all meta-path instance codes; the meta-path internal aggregation module is used to perform meta-path instance internal aggregation on the same meta-path subgraphs to obtain the feature information of the target vertices; the meta-path inter-aggregation module is used to perform meta-path instance inter-aggregation on the feature information of the same target vertices between different meta-path graphs to obtain the final features of all target vertices.

[0028] The merging module achieves rapid integration of computation results through encoding merging, aggregation within metapaths, and aggregation between metapaths. At the hardware level, this module effectively manages data flow, reducing data transfer requirements between different processing units and thus improving transmission speed. Furthermore, the efficiency of aggregation computation enables the system to quickly obtain the final features of the target vertex, enhancing the overall performance and accuracy of information processing. Attached Figure Description

[0029] Figure 1 A flowchart illustrating a heterogeneous graph neural network acceleration method based on meta-path graphs provided in an embodiment of the present invention;

[0030] Figure 2 An example diagram illustrating a parallel implementation method for a heterogeneous graph neural network acceleration method based on meta-path graphs provided in an embodiment of the present invention;

[0031] Figure 3 This is an example of a method for constructing a meta-path graph in the heterogeneous graph neural network acceleration method based on meta-path graph provided in the embodiments of the present invention;

[0032] Figure 4 This is an example of layer-based encoding operations in the heterogeneous graph neural network acceleration method based on meta-path graphs provided in this embodiment of the invention;

[0033] Figure 5 This is a schematic diagram of all metapath instances of the heterogeneous graph APCPA and their corresponding metapath graphs.

[0034] Figure 6 This is a schematic diagram of the module connection relationship of a heterogeneous graph neural network acceleration system based on meta-path graphs provided in an embodiment of the present invention.

[0035] List of reference numerals

[0036] 101: Construction module; 102: Partitioning module; 103: Calculation module; 104: Merging module; 105: Construction sub-module; 106: Extraction module; 107: Extension module; 108: Partitioning sub-module; 109: Calculation sub-module; 110: Load module; 111: Encoding module; 112: Merging sub-module; 113: Encoding merging module; 114: Meta-path internal aggregation module; 115: Meta-path inter-aggregation module. Detailed Implementation

[0037] The following is a detailed explanation with reference to the accompanying drawings.

[0038] First, some of the terms used in this invention will be explained.

[0039] Heterogeneous graphs are graph data structures with multiple vertex types or multiple edge types, as opposed to homogeneous graphs (which have only one vertex type and one edge type). They are typically represented as G = (V, E, V...). t E t ), where V is the set of all vertices in the graph, E is the set of all edges in the graph, and V t E is a set of vertex types in the graph. t It is a set of edge types in the graph.

[0040] Metapath: A sequence of vertex type combinations, typically represented as V1V2…V n Where V1, V2, ..., V n ∈V t A metapath represents a combination of relationships between multiple vertices.

[0041] Metapath instance: A path in the graph whose vertex types satisfy the definition of a metapath (i.e., an instantiated metapath), usually represented as v1v2…v n Where v1, v2, ..., v n ∈V.

[0042] Metapath graph: The compressed storage format for metapath instances in this invention. This graph stores all metapath instances.

[0043] Current heterogeneous graph neural networks typically employ depth-first search (DFS) to traverse meta-path instances in the original graph. DFS-based methods efficiently match meta-path instances during semantic graph construction. Once a match is found, its semantic information is instantly encoded into the embedding vector and used for incremental semantic graph updates, eventually eliminating the need for these meta-path instances. This DFS-based approach significantly reduces storage costs by eliminating the need to store meta-path instances. However, discarding meta-path instances can cause the heterogeneous graph neural network model to re-match meta-path instances from the original graph during each inference iteration, increasing computational latency. DFS-based strategies can adjust the encoding order and matching direction of meta-path instances to reduce unnecessary computation between meta-path instances targeting the same target vertex, but redundant computation still exists between different vertices. In summary, these two methods do not fully address the key issues in heterogeneous graph neural networks, such as the high cost of semantic graph construction, memory consumption, and redundant computation.

[0044] For example, on an online social media platform, users, posts, and comments form the core elements of interaction. User A posts about healthy eating and receives several comments, with users B and C expressing interest in the content. User B praises the recipe, while user C asks for more recommendations. As time goes on, user D also joins the discussion, expressing interest in this dietary approach and hoping to get more information.

[0045] In this context, the platform's recommendation system uses depth-first search (DFS) to analyze user-relevant content in order to provide personalized recommendations for new user E. However, because the system does not store previous comments and interaction instances, it needs to recalculate all comments related to user A's posts every time user E logs in. This not only wastes computing resources but also significantly prolongs user E's waiting time, impacting the user experience.

[0046] If the recommendation system can effectively store this interaction information, it can directly reference the comments of users B, C, and D when processing user E's request, thereby reducing redundant calculations and improving recommendation efficiency.

[0047] To address the shortcomings of existing technologies, this invention provides a method and system for accelerating heterogeneous graph neural networks based on meta-path graphs. The method and system of this invention can be used for social network analysis. For example, this method can efficiently analyze heterogeneous graph data in social networks, identify relationships and influence among users, and support applications such as recommendation systems and community detection. The method and system of this invention can also be used for knowledge graph construction. For example, this acceleration method can speed up the construction and reasoning process of knowledge graphs, helping to quickly extract relationships and insights from large amounts of heterogeneous data, providing support for intelligent question answering and information retrieval. The method and system of this invention can also be used in bioinformatics research. In bioinformatics, the meta-path graph acceleration method can be used to analyze complex biological networks, helping to identify interactions between genes and disease-related biomarkers. The method and system of this invention can also be used to optimize logistics and supply chains. For example, analyzing heterogeneous logistics networks can optimize route planning and resource allocation in supply chain management, improving operational efficiency and reducing costs. The method and system of this invention can also be used for financial risk assessment. For example, using the heterogeneous graph neural network acceleration method, complex relationships between customers, transactions, and markets can be quickly analyzed in financial data to improve the accuracy of risk assessment and fraud detection.

[0048] The present invention can also provide a high-efficiency graph data processing accelerator, which can efficiently process the encoding and inference calculations of heterogeneous graph data and metapath graphs, thereby improving the overall computing speed.

[0049] The present invention can also provide a heterogeneous graph neural network analysis device, which can be used for different types of heterogeneous graph neural network analysis, supports the construction and processing of metapath graphs, and is suitable for research and industrial fields.

[0050] The present invention can also provide a meta-path graph partitioning and encoding optimization algorithm, which aims to optimize the partitioning and encoding process of the meta-path graph to improve the inference efficiency of heterogeneous graph neural networks and solve the performance bottleneck problem.

[0051] The present invention can also provide a heterogeneous graph neural network inference platform, which integrates the above methods by building a software platform, providing a user-friendly interface and API, and facilitating users to perform inference and analysis of heterogeneous graph neural networks in various application scenarios.

[0052] This invention also provides an intelligent heterogeneous graph neural network processing system and method, proposing a complete system solution that supports data storage, graph partitioning, workload management, and inference computation of heterogeneous graphs, and is suitable for the needs of large-scale graph data processing.

[0053] This invention provides a method for accelerating heterogeneous graph neural networks based on meta-path graphs, see [link to relevant documentation]. Figure 1 After the initial step, the method may include the following steps.

[0054] S1: Construction of the metapath graph.

[0055] Given a heterogeneous graph and metapaths of a given type, storing all metapath instances in the form of a graph is called a metapath graph.

[0056] S2: Metapath graph partitioning.

[0057] The metapath graph is partitioned to obtain several metapath subgraphs.

[0058] S3: If duplicate parts exist, perform priority layer partitioning. If no duplicate parts exist, based on layer partitioning, implement workload partitioning for the meta-path subgraph.

[0059] S4: Layer-based encoding and aggregation.

[0060] Based on the workload division, layer-based meta-path instance encoding is performed to obtain the encoding of all meta-path instances, and then subsequent inference computation of heterogeneous graph neural networks is performed.

[0061] Finish.

[0062] Specifically, step S1 includes the following steps.

[0063] S11: For a given metapath, extract the vertices and edges in the heterogeneous graph based on the type in which it appears in the metapath. These vertices and edges will form part of the metapath graph.

[0064] S111: Determine the metapath. The structure of the metapath includes the starting vertex, the target vertex, and the types and order between them. For example, a metapath might be represented as "user-purchase-product", where "user" and "product" are vertices, and "purchase" is the edge type.

[0065] S112: Identify the type in the metapath.

[0066] Analyze the type of each vertex and edge in the metapath, and record the definition of each type in the heterogeneous graph. Different types of vertices and edges may affect the structure and properties of the graph.

[0067] S113: Extract vertices and edges from a heterogeneous graph.

[0068] Use database queries or graph traversal algorithms (such as depth-first search or breadth-first search) to extract vertices and edges corresponding to each type in the metapath from the heterogeneous graph. Ensure that the vertices connected by the extracted edges conform to the order and type requirements of the metapath.

[0069] S114: Construct the initial metapath graph portion.

[0070] The extracted vertices and edges are combined to form the initial part of the metapath graph. This part of the graph may contain scattered vertices and edges and has not yet formed a complete structure.

[0071] S12: Copy the repeated vertices and edges to the previous partial metapath graph, and further expand it according to the metapath pattern to form a complete metapath graph.

[0072] S121: Check for duplicates.

[0073] Traverse the extracted vertices and edges, and check which vertices and edges already exist in the constructed metapath graph.

[0074] Use hash tables or sets to efficiently store and retrieve existing vertices and edges.

[0075] S122: Copy operation.

[0076] For each repeated vertex and edge, copy it and add it to the already constructed metapath graph, ensuring that the edge connections remain unchanged. Record their positions in the metapath graph for later processing.

[0077] S123: Extend based on metapath pattern.

[0078] Further expand the graph by adding new vertices and edges using the structure and patterns of metapaths (e.g., the order in which vertices are connected by specific edges). Ensure that the new elements added are consistent with the existing elements in the graph and follow the definition of metapaths.

[0079] S124: Form a complete metapath graph.

[0080] After all vertices and edges have been added, check the connectivity of the metapath graph to ensure that there are no isolated vertices or edges, so that the graph can fully represent the logical structure of the metapath.

[0081] S13: For different metapaths, repeat steps S11 to S12 to obtain the metapath graphs corresponding to all metapaths.

[0082] A metapath graph is a hierarchical multipart graph. The vertices of a metapath graph can be divided into several layers, the number of layers being equal to the length of the metapath plus 1. The number of layers in a metapath graph is equal to the length of the metapath plus 1, which means that each layer corresponds to a vertex in the metapath.

[0083] Each layer's vertices can only be connected to vertices of adjacent layers through edges, forming an ordered hierarchical structure that facilitates graph reasoning and computation.

[0084] The adjacency matrix of the metapath graph is a sparse block matrix, where only the blocks between vertices in each layer and vertices in the next layer contain non-zero elements; all other blocks are zero. In other words, non-zero elements in the adjacency matrix of the metapath graph only appear in the blocks corresponding to vertices in each layer, and all other blocks are zero blocks. This configuration not only reduces storage space requirements but also improves computational efficiency, because most operations only need to focus on the connections between adjacent layers.

[0085] S131: Prepare different metapaths.

[0086] Determine the set of different metapaths to be processed. Each metapath may have different vertex and edge types, and therefore needs to be processed independently.

[0087] S132: Iterative processing of metapaths.

[0088] For each metapath, repeat steps S11 and S12.

[0089] Step S11 extracts the vertices and edges corresponding to the current metapath, forming a preliminary metapath graph. Step S12 checks for and copies duplicate vertices and edges, then expands them according to the metapath pattern to form a complete metapath graph.

[0090] S133: Collect all metapath graphs.

[0091] After processing all metapaths, collect all generated metapath graphs to ensure they can be used in subsequent steps.

[0092] Step S2 includes the following steps.

[0093] S21: For a specific metapath graph, collect the vertices in the central layer of the metapath graph to obtain all the vertices in the central layer of the metapath graph.

[0094] First, let's define the "central layer" in the metapath graph. Typically, the central layer refers to the key vertices in the metapath responsible for connecting the upper and lower layers; these vertices are usually the middle vertices in the metapath.

[0095] Traverse the metapath graph, identify and extract all vertices at the central layer. This can be achieved using graph traversal algorithms such as breadth-first search or depth-first search. During the traversal, each vertex is labeled with its level to distinguish vertices at different levels.

[0096] All identified central layer vertices are stored in a list or set to ensure their uniqueness and completeness. Effectively collecting and identifying central layer vertices provides a clear data foundation for subsequent processing, ensuring the full utilization of the graph's structure and relationships. The selection of central layer vertices directly impacts the efficiency and effectiveness of subsequent algorithms.

[0097] S22: Divide the vertices of the central layer into several batches, with each batch containing the same number of central layer vertices.

[0098] Specifically, the number of center-layer vertices in each batch is determined based on actual needs and computing resources. This number should be kept reasonable to avoid excessive computational burden during traversal. The collected center-layer vertices are grouped according to the set batch size. If the total number of vertices is not divisible by the batch size, the last batch may contain the remaining vertices. An algorithm (such as a block partitioning algorithm) is used to achieve a uniform partitioning of vertices, ensuring that the load of each batch is as similar as possible.

[0099] Dividing the central layer vertices into batches can improve the efficiency of parallel processing, allowing multiple batches to be processed simultaneously during subsequent traversals, thus improving computational performance.

[0100] S23: Starting from all vertices in each batch, traverse the metapath graph according to the outgoing and incoming edge directions to obtain the metapath subgraph corresponding to each batch.

[0101] Specifically, the traversal direction (outgoing and incoming edges) is determined, and corresponding traversal strategies are designed for the vertices in each batch. Outgoing edge traversal means starting from a vertex and visiting its adjacent lower-level vertices, while incoming edge traversal is the reverse operation. Starting from the vertices in each batch, outgoing and incoming edge traversals are performed respectively. For example, depth-first search (DFS) or breadth-first search (BFS) can be used to accomplish this process. During the traversal, the visited vertices and edges are recorded to form the metapath subgraph corresponding to that batch. Based on the traversal results, the metapath subgraph corresponding to each batch is constructed. Each subgraph will contain the vertices of that batch and the edges connected to them, forming a relatively independent structure.

[0102] By employing effective traversal strategies and subgraph construction, complex metapath graphs can be decomposed into multiple manageable parts, thereby reducing computational complexity and providing a clear graph structure for subsequent analysis.

[0103] S24: For different metapath graphs, repeat steps S21 to S23 to divide all metapath graphs into all metapath subgraphs. A metapath subgraph is a subgraph extracted based on the structure and vertex relationships of a specific metapath graph. A metapath subgraph consists of vertices and edges that satisfy a specific metapath, reflecting the relationships between vertices in a specific context.

[0104] Step S3 includes the following steps.

[0105] S31: For a metapath subgraph, the metapath subgraph is divided into several parts by layer. Each part contains multiple consecutive layers, forming a subgraph. Each subgraph contains a portion of the metapath instance and is called a metapath slice graph.

[0106] Specifically, for the metapath subgraph, different hierarchical structures are identified and divided. The metapath subgraph is divided into several parts by layer, ensuring that each part contains multiple consecutive layers. Each part constitutes a new subgraph, namely the metapath slice. Each metapath slice will contain a portion of the metapath instance, focusing on preserving the relationships between consecutive layers to ensure the coherence of information.

[0107] This layered approach effectively reduces computational complexity, making subsequent encoding and analysis more efficient. It also helps preserve inter-layer relationships and enhances the heterogeneous graph neural network model's ability to process multi-layer information in complex heterogeneous graphs.

[0108] S32: By traversing the metapath slice graph in the order of layers, all metapath instance slices can be obtained.

[0109] Specifically, each metapath slice graph is traversed layer by layer, either from bottom to top or from top to bottom. During the traversal, vertices and edges related to the metapath are extracted to form complete metapath instance slices. For each metapath instance slice, its structural features and connectivity relationships are recorded.

[0110] This step ensures the integrity and correctness of each metapath instance slice, enabling subsequent analysis to be based on accurate structural information. An efficient implementation of the traversal algorithm can further improve data processing speed and reduce computation time.

[0111] S33: For different metapath slice graphs, repeat steps S31 to S32 to obtain all metapath instance slices.

[0112] Specifically, steps S31 and S32 are repeated for different metapath slice graphs. After processing each metapath slice graph, all its corresponding metapath instance slices are stored to ensure data consistency and integrity during processing.

[0113] By systematically processing each metapath slice graph, all relevant metapath instance slices can be obtained, providing a sufficient data foundation for subsequent aggregation and encoding. This systematic and repeated processing not only improves data coverage but also enhances the adaptability of the heterogeneous graph neural network model to different metapaths, thereby improving its generalization ability.

[0114] Step S4 includes the following steps.

[0115] S41: For all metapath instance slices of a specific metapath graph, encode the metapath instance slices to obtain partial encoding of the metapath instances.

[0116] Specifically, it determines whether there are identical continuous parts in the metapath definition corresponding to the metapath graph. If so, priority-based partitioning is implemented, that is, these identical continuous parts are preferentially partitioned into subgraphs. Otherwise, layer-based partitioning is implemented, that is, the metapath graph is directly partitioned into subgraphs of two layers each.

[0117] S42: After obtaining the encoding of the metapath instance slices in the metapath graph, the encoding of the metapath instance slices in different subgraphs is re-encoded using the edge relationships between different layers to obtain the encoding of all metapath instances.

[0118] Specifically, after obtaining the encoding of the meta-path instance slices in each meta-path graph, the edge relationships between different layers are identified. Based on these edge relationships, the encodings of the meta-path instance slices in different subgraphs are merged and re-encoded. Aggregation functions (such as summation, averaging, or other complex aggregation methods) are used to integrate the encodings of different layers to generate a global encoding representation.

[0119] This re-encoding enhances the information about relationships between vertices, helps capture features across levels, and improves the ability of heterogeneous graph neural network models to understand complex relationships. By effectively fusing the encodings of different subgraphs, a more comprehensive and richer feature representation can be obtained.

[0120] S43: After completing the metapath instance encoding for all metapath graphs, perform metapath instance aggregation within different metapath subgraphs, that is, aggregate metapath instances with the same target vertex to obtain the feature information of that target vertex.

[0121] Specifically, after encoding the metapath instances of all metapath graphs, for each metapath subgraph, metapath instances with the same target vertex are aggregated. Aggregation methods (such as max pooling, average pooling, etc.) are used to integrate the feature information of the same target vertex to generate a feature representation for each target vertex. It is crucial to ensure the consistency and integrity of information during the aggregation process to avoid information loss.

[0122] This aggregation step effectively reduces noise, highlights the core features of the target vertex, and improves the accuracy of subsequent analysis. Through internal aggregation, the feature information of different meta-path instances is integrated, ensuring the richness and accuracy of the target vertex features.

[0123] S44: For all metapath instance slices of different metapath graphs, repeat steps S41 to S43 to obtain the feature information of all target vertices under different metapaths.

[0124] S45: Aggregate the feature information of the same target vertices between different metapath graphs to obtain the final features of all target vertices.

[0125] Specifically, feature information of the same target vertices in different metapath graphs is aggregated to identify duplicate target vertices. Appropriate aggregation strategies (such as weighted averaging, voting, etc.) are used to integrate the features of the same target vertices to generate the final feature representation. It is crucial to ensure that the impact of different metapaths on the target vertex features is considered during the aggregation process, maintaining the diversity and accuracy of the information.

[0126] Cross-graph aggregation integrates information from different meta-path graphs, providing a more comprehensive and accurate representation of vertex features. This process helps improve the performance of the final heterogeneous graph neural network model on specific tasks (such as classification and regression), providing more robust support for subsequent decision-making.

[0127] To facilitate understanding and explanation, this invention provides a specific application scenario for a heterogeneous graph neural network acceleration method based on meta-path graphs. See [link to relevant documentation]. Figure 3 and Figure 4 .

[0128] like Figure 3 As shown, Figure 3 (a) shows a heterogeneous graph of paper citations, including three vertex types: Author (A), Paper (P), and Conference (C), representing information about the author, paper, and conference, respectively. The graph also contains two edge types: AP indicates that an author wrote a paper, and PC indicates that a paper was published in a conference. For a given metapath APA, this metapath indicates that two authors co-authored a paper. Extraction module 106 extracts vertices and edges in the heterogeneous graph that conform to the metapath, generating... Figure 3 The metapath is shown in (b). Extension module 107 is responsible for extracting the portion (such as...) Figure 3 (b) is shown) constructed into a complete metapath graph, generating Figure 3 (c) shows the complete metapath graph.

[0129] In existing technologies, semantic information is typically captured based on semantic graphs and lists of metapath instances. This invention fundamentally changes the existing technical solution by using metapath graphs to capture semantic information. Therefore, it eliminates the need to construct a semantic graph and store all metapath instances, avoiding the high overhead of semantic graph construction and significantly reducing the overhead of storing metapath instances.

[0130] Figure 5 It consists of tables and metapath diagrams, which show... Figure 3 (a) All metapath instances of the heterogeneous graph APCPA, which can be partitioned into 5 layers (L1 to L5). Storing these metapath instances involves a large number of duplicate vertices. Figure 4 All metapath instances are stored in the form of a metapath graph.

[0131] like Figure 4 As shown, the metapath APCPA contains two parts, "AP" and "PA," which are identical, so the corresponding encoding only needs to be calculated once. Statistically, there are a total of 25 metapath instances in the heterogeneous graph APCPA. In this process, the redundant computation in the heterogeneous graph neural network mainly occurs in the encoding stage of the metapath instances, which requires encoding each metapath instance (e.g., 1-4-8-4-1) into a vector. This encoding operation is a simple linear operation, such as MEAN (averaging the feature vectors of each vertex of the metapath instance). Therefore, for different metapath instances, such as 1-4-8-4-1 and 1-4-8-4-3, there is a large amount of redundant computation, meaning that the common part (1-4-8-4) between different metapath instances needs to be encoded multiple times. In the encoding stage, the traditional method requires 100 (25) times. 4) The computation is much simpler, while the layer-based encoding method only requires 39 computations, which significantly reduces redundant computations, greatly compresses storage overhead, and improves the inference efficiency of the heterogeneous graph neural network model.

[0132] like Figure 2 As shown, this invention proposes a parallel implementation system for an acceleration method of heterogeneous graph neural networks based on meta-path graphs. The system includes a construction module 101, a partitioning module 102, a computation module 103, and a merging module 104. The construction module 101 is connected to the partitioning module 102. The partitioning module 102 is connected to the computation module 103. The computation module 103 is connected to the merging module 104.

[0133] Preferably, the construction module 101, partitioning module 102, computing module 103, and merging module 104 can run in a multi-core processor or multi-threaded server. Each module can run as a separate thread or process, utilizing multi-threaded parallel processing to improve performance. For example, the multi-core processor (e.g., 8 cores or more) could be an Intel Xeon E5-2699 v4 (22 cores / 44 threads) or an AMD EPYC 7742 (64 cores / 128 threads). The multi-threaded server could be a Dell PowerEdge R740 server configured with two Intel Xeon Scalable processors, supporting up to 56 cores, or an HPE ProLiant DL380 Gen10 server configured with two AMD EPYC processors, supporting up to 128 cores.

[0134] The construction module 101 and the partitioning module 102 can perform data transfer within the multi-core processor using a high-speed bus inside the server (such as QPI (QuickPath Interconnect) or Infinity Fabric). The partitioning module 102 and the computing module 103 can be connected using high-speed memory access (such as NUMA architecture). The computing module 103 and the merging module 104 can perform inter-module data transfer using a high-speed bus inside the server (such as QPI or Infinity Fabric).

[0135] like Figure 2 and Figure 6 As shown, the construction module 101 is responsible for constructing a metapath graph from a given heterogeneous graph and different metapaths. The construction module 101 consists of several construction sub-modules 105. Each construction sub-module 105 includes an extraction module 106 and an extension module 107. The extraction module 106 extracts vertices and edges in the heterogeneous graph that conform to metapaths. The extension module 107 is responsible for constructing the extracted portions into a complete metapath graph. After construction, the metapath graph is sent to the partitioning module 102.

[0136] When the building module 101 is an independent processor, the building module 101 can be a high-performance multi-core CPU, such as an Intel Xeon E5-2699 v4 (22 cores / 44 threads).

[0137] In the case where the construction module 101 consists of several hardware components, the construction submodule 105 may include a data processing unit, memory, and input / output ports. The construction submodule 105 may contain a processor or FPGA (Field-Programmable Gate Array) for executing the computational tasks of the extraction module 106 and the expansion module 107. This hardware can efficiently process graph data and perform complex computations. To store the heterogeneous graph, extracted vertices and edges, and constructed metapath graphs, the construction submodule 105 may also include memory components such as SRAM or DRAM. The construction submodule 105 may have connection ports (such as USB, Ethernet, etc.) for receiving input heterogeneous graphs and sending the constructed metapath graphs to the partitioning module 102. If efficient processing of large amounts of data is required, the construction submodule 105 may have parallel processing capabilities, using multiple cores or processing units to process multiple data streams simultaneously.

[0138] In the case where extraction module 106 and expansion module 107 constitute the hardware of construction submodule 105, extraction module 106 includes a data acquisition unit, a processor or accelerator, memory, and a port. The data acquisition unit, for example, is a data receiving port capable of receiving data from the heterogeneous graph, ensuring access to and reading of vertex and edge information. The processor or accelerator, for example, is a CPU or GPU capable of running graph algorithms to analyze the heterogeneous graph to identify and extract vertices and edges conforming to specific metapaths. The memory, for example, is DDR4 RAM, with sufficient storage space to cache the extracted vertices and edges for subsequent processing. The port is used to transmit the extracted data to expansion module 107.

[0139] The expansion module 107 includes a computing unit, memory, and ports. The computing unit, such as a CPU (e.g., an AMD EPYC or Intel Xeon processor) or GPU (e.g., an NVIDIA A100), is capable of processing extracted vertices and edges, executing the logic and algorithms required to construct a complete metapath graph. The memory, such as DDR4 or DDR5 RAM, has sufficient memory to store intermediate results during the construction process and the final metapath graph for fast access and modification. The ports can be network interface cards (NICs), such as Broadcom or Intel Ethernet cards, used to send metapath graph data to the partitioning module 102. Alternatively, the output module can also be a direct storage interface: such as a SATA or NVMe interface, used to store the generated graph on a hard disk or solid-state drive for subsequent processing. Figure 2 and Figure 6 As shown, the partitioning module 102 consists of several partitioning sub-modules 108. The partitioning sub-modules 108 are responsible for dividing the metapath graph into multiple subgraphs. After partitioning, the resulting metapath subgraphs are sent to the calculation module 103.

[0140] When partition module 102 is an independent processor, partition module 102 can be a high-performance multi-core CPU, such as the AMD EPYC 7742 (64 cores / 128 threads).

[0141] Preferably, when the partitioning module 102 consists of several hardware components, the partitioning submodule 108 may include a processor, memory, storage devices, and ports. First, the processor can be a high-performance multi-core CPU, such as the AMD EPYC 7742, which has 64 cores and 128 threads, enabling parallel processing of multiple partitioning tasks and significantly improving computational efficiency. Second, the memory can be high-bandwidth DDR4 or DDR5 memory to store the metapath graph and its intermediate partitioning results, ensuring sufficient storage capacity and fast access speeds when processing large-scale graph data. Furthermore, to achieve fast data read and write, using NVMe solid-state drives (SSDs) such as the Samsung 970 EVO or Western Digital Black SN750 is ideal, facilitating rapid storage and retrieval of partitioned graph data. To further accelerate the graph partitioning algorithm, the partitioning submodule 108 can also be equipped with a GPU (such as NVIDIA A100 / Tesla V100) or FPGA (such as the Xilinx Virtex series), especially when processing complex graph structures, these accelerators can significantly improve parallel computing performance. Meanwhile, to ensure efficient data transmission, it is also necessary to equip the subgraph with a high-performance Ethernet card (such as the Mellanox ConnectX series). This will ensure that the partitioned subgraph can be quickly sent to the computing module 103 for further processing. Through this combination of hardware, the sub-module 108 can efficiently complete its function, laying a solid foundation for subsequent computing processing.

[0142] like Figure 2 and Figure 6 As shown, the calculation module 103 consists of several calculation sub-modules 109. The calculation sub-modules 109 are responsible for encoding calculations on the meta-path subgraph. The calculation sub-module 109 includes a load module 110 and an encoding module 111. The load module 110 is responsible for performing layer-based load partitioning on the meta-path subgraph to generate a meta-path slice graph. The encoding module 111 is responsible for traversing the meta-path slice graph and encoding it.

[0143] When the computing module 103 is a standalone processor, the computing module 103 can be a high-performance multi-core CPU, such as an AMD EPYC 7742 (64 cores / 128 threads).

[0144] With the computation submodule 109 equipped with a processor, a multi-core CPU, such as an Intel Xeon or AMD Ryzen series, can be selected. These high-performance processors support parallel computing and are suitable for handling complex coding tasks. Simultaneously, graphics processing units (GPUs) such as the NVIDIA RTX series or AMD Radeon series can be used to accelerate parallel computing on large-scale data, especially when traversing and encoding metapath slice graphs, providing significant performance improvements. Furthermore, large-capacity DDR4 or DDR5 memory is essential to support high-speed data access and ensure no bottlenecks occur when processing metapath slice graphs. For storage, high-speed NVMe solid-state drives (SSDs), such as the Samsung 970 EVO or Western Digital Black SN850, will facilitate fast access to data in metapath subgraphs and slice graphs.

[0145] The load module 110 and encoding module 111, as components of the computing submodule 109, each possess specific physical hardware configurations. The load module 110 is primarily responsible for layer-based load balancing, and its hardware may include multi-core processors such as the AMD Ryzen 9 5950X or Intel Core i9-11900K, paired with high-frequency DDR4 or DDR5 memory modules, such as the Corsair Vengeance LPX series. Furthermore, load balancers such as the F5 BIG-IP and Mellanox ConnectX-6 network interface cards ensure efficient resource management and fast data transfer. The encoding module 111 focuses on traversing the meta-path slice graph and performing encoding. It is typically equipped with powerful graphics processing units (GPUs), such as the NVIDIA A100 or RTX 3080, and Intel Xeon Gold processors to improve encoding efficiency. It also requires high-speed SSD storage, such as the Samsung 970 NVMe SSD, for fast access to encoded data, while large-capacity DDR4 or DDR5 memory ensures stability during processing. Through this optimized combination of hardware, the load module 110 and the encoding module 111 can work together efficiently, improving the overall performance of the computing submodule. For example... Figure 2 and Figure 6As shown, the merging module 104 consists of several merging sub-modules 112. The merging sub-modules 112 are responsible for merging the slice codes of metapath instances and performing subsequent aggregation calculations. The merging sub-modules 112 include an encoding merging module 113, a metapath intra-module aggregation module 114, and a metapath inter-module aggregation module 115. The encoding merging module 113 is responsible for merging the slice codes of metapath instances to obtain the codes of all metapath instances. The metapath intra-module aggregation module 114 is used to aggregate the codes of all metapath instances with the same target vertex under the same metapath to generate feature information of the target vertex. The metapath inter-module aggregation module 115 is used to further aggregate the feature information of all identical target vertices under different metapaths to obtain the final features.

[0146] In the case where the merging module 104 is an independent processor, the merging module 104 can be a high-performance multi-core CPU and GPU, such as NVIDIA Tesla V100 or A100, for accelerating computing.

[0147] If the construction module 101 and the partitioning module 102 are located on different physical servers, a high-speed Ethernet (such as 10GbE or 40GbE) can be used for network connection. The partitioning module 102 and the computing module 103 use a PCIe (PCI Express) bus to connect the CPU and GPU, supporting high-speed data transmission. The computing module 103 and the merging module 104 use a PCIe (PCI Express) bus for data transmission between the CPU and GPU.

[0148] This configuration enables the system to achieve efficient construction and encoding of meta-path graphs, and significantly improves the inference efficiency of heterogeneous graph neural networks. The independence and parallel processing capabilities of each module allow the system to handle large-scale heterogeneous graph data, meeting the needs of practical applications.

[0149] Merging submodule 112, as a component of merging module 104, comprises multiple physical hardware components to implement the functions of merging meta-path instance slice encoding and subsequent aggregation calculations. Merging submodule 112 can be equipped with multi-core processors, such as the AMD Ryzen 9 5900X or Intel Xeon Platinum series, which provide powerful multi-threaded processing capabilities suitable for complex merging and aggregation calculations. Merging submodule 112 also includes a high-performance graphics processing unit (GPU), such as the NVIDIA RTX 3080 or AMD Radeon RX 6900 XT, to accelerate encoding merging and aggregation operations, especially when processing large-scale data, significantly improving computational efficiency. Merging submodule 112 also includes large-capacity memory, such as Corsair Vengeance LPX 32GB DDR4 memory, to ensure sufficient memory space for storing temporary data and calculation results during large-scale aggregation calculations. For fast data access, merging submodule 112 can also be configured with high-speed SSD storage, such as the Samsung 970 EVO Plus NVMe SSD, to provide superior data read and write capabilities. The port of the merging submodule 112 is equipped with a Mellanox ConnectX-6 network interface card, which can support high-speed data transmission between modules, thereby ensuring the efficiency of the merging submodule 112 in processing data.

[0150] The intra-metapath aggregation module 114 and inter-metapath aggregation module 115, as part of the hardware components of the merging submodule 112, each undertake different aggregation calculation tasks, thus their physical hardware designs and selections have different focuses. For the intra-metapath aggregation module 114, its hardware may include multi-core processors, such as AMD Ryzen 7 5800X or Intel Core i7 series processors, which have efficient multi-threading capabilities and can handle aggregation calculations for a large number of metapath instance encodings with the same target vertices. Furthermore, 32GB or more of DDR4 memory (such as Corsair Vengeance LPX) can support the storage and processing of large amounts of data during aggregation operations to improve computational speed, while high-speed SSD storage such as Samsung 970 EVO NVMe SSDs is provided to ensure fast access and retrieval of required data during aggregation calculations. In contrast, the hardware of the inter-metapath aggregation module 115 can include high-performance graphics processing units (GPUs), such as NVIDIA A100 or RTX 3090. These GPUs can accelerate the aggregation calculation of feature information of the same target vertices under different metapaths, possessing powerful processing capabilities and suitable for complex data processing tasks. Furthermore, multi-core processors from the Intel Xeon Silver or AMD EPYC series can also be used in the inter-metapath aggregation module 115 to support large-scale data processing and complex aggregation operations, and are equipped with 64GB or more of DDR4 memory to ensure sufficient memory space for efficient computation when processing feature information aggregation between different metapaths. Through this combination of hardware, the intra-metapath aggregation module 114 and the inter-metapath aggregation module 115 can efficiently complete their respective aggregation calculation tasks, thereby improving the overall computing performance and efficiency of the merging module 104.

[0151] Furthermore, in this system, each module's port is assigned a unique number to ensure the smooth transfer and processing of data from the heterogeneous graph to the final feature information.

[0152] First, the extraction module 106 includes a first port for receiving heterogeneous graph data and a second port for sending extracted data. The expansion module 107 includes a third port for receiving extracted data and a fourth port for sending the completed metapath graph. The second port is connected to the third port. The connection between the second and third ports can be a wired connection, such as using a Cat 6 Ethernet cable.

[0153] Then, the expansion module 107 sends the completed metapath graph to the partitioning module 102 via port 4, achieving a seamless connection from extraction to expansion. Ports 4 and 5 can also be connected via a wired connection, such as using a Cat 6 Ethernet cable.

[0154] The partitioning submodule 108 receives the metapath graph from the construction module 101 through port 5, and sends the partitioned metapath subgraph to port 7 of the load module 110 through port 6. Port 6 is connected to port 7 of the load module 110. The connection between port 6 and port 7 is a wired connection using a Cat 6 Ethernet cable, transmitting data in a sequential data stream manner.

[0155] The load module 110 receives the metapath subgraph through port 7 and sends the generated metapath slice graph to port 9 of the encoding module 111 through port 8. Port 8 and port 9 are connected in a structured data exchange manner.

[0156] Next, the encoding module 111 receives the metapath slice image through port 9 and sends the encoded metapath instance slice image to port 11 of the merging module 104 through port 10, with the connection method being a unified encoding format. A wired connection can be used between port 10 and port 11, such as using fiber optic cables for structured data exchange, to ensure high-speed data transmission and stability.

[0157] The encoding and merging module 113 receives data through port 11 and sends the merged metapath instance encoding to port 13 of the metapath internal aggregation module 114 through port 12. The connection method is data integration. Port 12 and port 13 can be connected by a wired connection, such as using a fiber optic cable for data integration.

[0158] The metapath internal aggregation module 114 receives the merged metapath instance encoding through port 13 and sends the aggregated target vertex feature information to port 15 of the metapath inter-aggregation module 115 through port 14. The connection method is feature aggregation. Ports 14 and 15 can be connected by a wire, such as using an optical fiber to transmit information in the form of feature aggregation.

[0159] Finally, the metapath aggregation module 115 receives the aggregated target vertex feature information through port 15 and outputs the final feature information through port 16, thus realizing the closed loop of the entire data processing.

[0160] It should be noted that the specific embodiments described above are exemplary. Those skilled in the art can devise various solutions inspired by the disclosure of this invention, and these solutions all fall within the scope of this invention and its protection. Those skilled in the art should understand that this specification and its accompanying drawings are illustrative and not intended to limit the scope of the claims. The scope of protection of this invention is defined by the claims and their equivalents. This specification contains multiple inventive concepts; phrases such as "preferredly" or "according to a preferred embodiment" indicate that the corresponding paragraph discloses an independent concept. The applicant reserves the right to file divisional applications based on each inventive concept.

Claims

1. A method for accelerating heterogeneous graph neural networks based on meta-path graphs, characterized in that, The method includes: Given a heterogeneous graph and metapaths of a given type, construct a metapath graph from all metapath instances in the form of a graph. The metapath graph is partitioned to obtain several metapath subgraphs; The workload is divided into subgraphs of the metapath; Based on the workload division, layer-based metapath instance encoding is performed. The encodings of all metapath instance slices are merged according to the inter-layer relationships of the metapath graph to obtain the encoding of the metapath instance. Internal aggregation and inter-metapath instance aggregation calculations are then performed to obtain the final features of the target vertex. Specifically, the encoding of metapath instance slices is performed to obtain partial encodings of metapath instances. Utilizing the edge relationships between different layers, the encodings of metapath instance slices in different subgraphs are re-encoded to obtain all metapath instance encodings. Internal aggregation of metapath instances is performed on different metapath subgraphs to obtain the feature information of the target vertex. Finally, inter-metapath instance aggregation is performed on the feature information of the same target vertex across different metapath graphs to obtain the final features of all target vertices. The steps for encoding the metapath instance slices include: Determine whether there is an identical continuous part in the metapath definition corresponding to the metapath graph; If so, priority-based partitioning is implemented; otherwise, layer-based partitioning is implemented.

2. The method for accelerating heterogeneous graph neural networks based on meta-path graphs according to claim 1, characterized in that, The steps to construct a metapath graph include: Extract vertices and edges from the heterogeneous graph based on the types appearing in the metapath; Repeated vertices and edges are copied to the previous partial metapath graph and further expanded according to the metapath pattern to form a complete metapath graph.

3. The method for accelerating heterogeneous graph neural networks based on meta-path graphs according to claim 1 or 2, characterized in that, The steps for partitioning a metapath graph include: Collect the vertices in the central layer of the metapath graph to obtain all the vertices in the central layer of the metapath graph; The vertices of the central layer are divided into several batches, with each batch containing the same number of central layer vertices. Starting from all vertices in each batch, the metapath graph is traversed according to the outgoing and incoming edge directions to obtain the metapath subgraph corresponding to each batch.

4. The method for accelerating heterogeneous graph neural networks based on meta-path graphs according to claim 3, characterized in that, The steps for partitioning the workload of the metapath subgraph include: The metapath subgraph is divided into at least two parts by layers, each part containing consecutive layers and constituting a metapath slice graph containing a portion of metapath instances. The metapath slice graph is traversed in layer order to obtain all metapath instance slices.

5. A heterogeneous graph neural network acceleration system based on meta-path graphs, characterized in that, The system includes: Construct module (101) constructs a metapath graph by combining all metapath instances in the form of a graph based on a given heterogeneous graph and a metapath of a given type; The partitioning module (102) partitions the metapath graph to obtain several metapath subgraphs; The calculation module (103) divides the workload of the metapath subgraph; The merging module (104) performs layer-based meta-path instance encoding based on the workload division, merges the encodings of all meta-path instance slices according to the inter-layer relationship of the meta-path graph to obtain the encoding of the meta-path instance, performs internal aggregation and inter-meta-path instance aggregation calculations to obtain the final features of the target vertex. The merging module (104) includes several merging sub-modules (112); the merging sub-modules (112) include an encoding merging module (113), an internal meta-path aggregation module (114), and an inter-meta-path aggregation module (115). The encoding merging module (113) is used to encode the meta-path instance slices and obtain the partial encoding of the meta-path instance. By utilizing the edge relationship between different layers, the encoding of the meta-path instance slices in different subgraphs is re-encoded to obtain the encoding of all meta-path instances. The metapath internal aggregation module (114) is used to perform metapath instance internal aggregation on the same metapath subgraph to obtain the feature information of the target vertex; The metapath aggregation module (115) is used to aggregate the feature information of the same target vertices between different metapath graphs to obtain the final features of all target vertices. The steps of the encoding and merging module (113) in encoding the metapath instance slices include: Determine whether there is an identical continuous part in the metapath definition corresponding to the metapath graph; If so, priority-based partitioning is implemented; otherwise, layer-based partitioning is implemented.

6. The heterogeneous graph neural network acceleration system based on meta-path graphs according to claim 5, characterized in that, The construction module (101) includes several construction sub-modules (105). The construction submodule (105) is used to construct the metapath graph; The plurality of construction sub-modules (105) include an extraction module (106) and an extension module (107). The extraction module (106) extracts vertices and edges in the heterogeneous graph according to the types that appear in the metapath; The extension module (107) copies the repeated vertices and edges to the previous partial metapath graph and further extends it according to the metapath pattern to form a complete metapath graph.

7. The heterogeneous graph neural network acceleration system based on meta-path graphs according to claim 5 or 6, characterized in that, The computing module (103) includes several computing sub-modules (109); The calculation submodule (109) is used to divide the metapath subgraph into layers according to the workload, obtain several metapath slice graphs and perform encoding calculations; The computing submodule (109) includes a load module (110) and an encoding module (111). The load module (110) is used to divide the metapath subgraph into at least two parts by layers, each part containing consecutive layers and constituting a metapath slice graph containing a portion of metapath instances. The encoding module (111) is used to traverse the metapath slice graph in the order of layers to obtain all metapath instance slices.

Citation Information

Patent Citations

  • Implementation method of multi-view heterogeneous hypergraph convolutional network model

    CN117634561A

  • Heterogeneous graph neural network node classification method of double-view normal form based on network mode and meta-path

    CN118228103A