Distributed Inference Method, Data Processing Method, Device, Terminal and Computing Device

By storing the graph data to a distributed file system and distributing model parameters to multiple computing devices, the memory limitation problem in large-scale graph data processing is solved, and efficient distributed inference is achieved.

CN114139711BActive Publication Date: 2025-07-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111470154.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-07-25
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

When processing large-scale map data, the prior art needs to continuously expand the memory of computing devices to store graph neural networks and map data, resulting in memory limitation problems and affecting the inference speed.

Method used

Store graph data into a distributed file system, such as HDFS, provides relevant features through the distributed file system, and distributes the model parameters of the trained graph neural network to multiple computing devices to realize distributed inference and reduces the memory usage of computing devices.

Benefits of technology

It realizes that without expanding the memory of computing devices, the inference speed and efficiency of nodes in the graph data are improved, and is suitable for processing large-scale graph data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114139711B_ABST
    Figure CN114139711B_ABST
Patent Text Reader

Abstract

This application is applicable to the field of deep learning technology, and provides a distributed inference method, a data processing method, a device, a terminal, and a computing device. The distributed inference method includes: the terminal stores the graph data in a distributed file system, where the graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes; the terminal distributes the model parameters of the trained graph neural network to each computing device; each computing device calculates the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system. Through this application, the limitation of the memory of the computing device on the graph data can be reduced, and the inference speed of the nodes in the graph data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of deep learning, and particularly relates to a distributed inference method, a data processing method, a device, a terminal, and a computing device. Background Art

[0002] Graph neural networks are an extension of existing neural networks and are suitable for processing graph data, which exists in many fields of science and engineering, such as computer vision, molecular chemistry, pattern recognition, and data mining. When obtaining the inference results of nodes in graph data based on graph neural networks, mainly a single computing device is used to load the graph data into memory. Summary of the Invention

[0003] Embodiments of this application provide a distributed inference method, a data processing method, a device, a terminal, and a computing device to reduce the limitation of the memory of computing devices on graph data and improve the inference speed of nodes in graph data.

[0004] In a first aspect, embodiments of this application provide a distributed inference method applied to a distributed inference system. The distributed inference system includes a terminal, a distributed file system, and at least two computing devices, and includes:

[0005] The terminal stores graph data in the distributed file system. The graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes;

[0006] The terminal distributes the model parameters of the trained graph neural network to each of the computing devices;

[0007] Each of the computing devices calculates the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node.

[0008] In the embodiments of this application, by storing the graph data in the distributed file system, each computing device can extract the relevant features of the corresponding target node from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph data. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work together to obtain the inference result of the corresponding target node, thereby realizing the distributed inference of nodes in the graph data and improving the inference speed.

[0009] In a second aspect, embodiments of this application provide a data processing method applied to a terminal, including:

[0010] Store the graph spectrum data in a distributed file system. The graph spectrum data includes at least two node features and at least one edge feature. The edge feature represents the association relationship between two connected nodes. The distributed file system is used to provide relevant features of a corresponding target node for at least two computing devices. The relevant features of the target node include the node features of the target node and the edge features corresponding to the target node. The relevant features of the target node are used to calculate the inference result of the target node;

[0011] Distribute the model parameters of the trained graph neural network to each of the computing devices. The model parameters are used to calculate the inference results of the target nodes corresponding to the respective computing devices.

[0012] In the embodiments of the present application, by storing the graph spectrum data in a distributed file system, it is convenient for each computing device to extract the relevant features of the corresponding target node from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph spectrum data. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work collaboratively, thereby realizing the distributed inference of the nodes in the graph spectrum data and improving the inference speed.

[0013] In a third aspect, the embodiments of the present application provide a data processing method, which is applied to a computing device and includes:

[0014] Receive the model parameters of the trained graph neural network distributed by the terminal;

[0015] Extract the relevant features of the corresponding target node from the distributed file system. The distributed file system stores graph spectrum data. The graph spectrum data includes at least two node features and at least one edge feature. The edge feature represents the association relationship between two connected nodes. The relevant features of the target node include the node features of the target node and the edge features corresponding to the target node;

[0016] Based on the model parameters and the relevant features of the target node, calculate the inference result of the target node.

[0017] In the embodiments of the present application, based on the model parameters of the graph neural network and the relevant features of the target node, the inference result of the target node can be calculated. And by extracting the relevant features of the target node from the distributed file system, the occupation of the memory of the computing device by the graph spectrum data can be reduced, thereby improving the inference speed of the computing device for the target node.

[0018] In a fourth aspect, the embodiments of the present application provide a distributed inference system. The distributed inference system includes a terminal, a distributed file system, and at least two computing devices;

[0019] The terminal is used to store the graph data in a distributed file system. The graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes;

[0020] The terminal is used to distribute the model parameters of the trained graph neural network to each of the computing devices;

[0021] Each of the computing devices is used to calculate the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node.

[0022] In a fifth aspect, an embodiment of the present application provides a data processing device, which is applied to a terminal and includes:

[0023] A data storage module, which is used to store the graph data in a distributed file system. The graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The distributed file system is used to provide the relevant features of the corresponding target node for at least two computing devices. The relevant features of the target node are used to calculate the inference result of the target node. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node;

[0024] A parameter distribution module, which is used to distribute the model parameters of the trained graph neural network to each of the computing devices. The model parameters are used to calculate the inference result of the corresponding target node of each of the computing devices.

[0025] In a sixth aspect, an embodiment of the present application provides a data processing device, which is applied to a computing device and includes:

[0026] A parameter receiving module, which is used to receive the model parameters of the trained graph neural network distributed by the terminal;

[0027] A feature extraction module, which is used to extract the relevant features of the corresponding target node from the distributed file system. The distributed file system stores graph data, which includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node;

[0028] A result calculation module, which is used to calculate the inference result of the target node based on the model parameters and the relevant features of the target node.

[0029] In a seventh aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the data processing method described in the second aspect above are implemented.

[0030] In an eighth aspect, an embodiment of the present application provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the data processing method described in the third aspect above are implemented.

[0031] In a ninth aspect, an embodiment of the present application provides a chip, including a processor, where the processor is used to read and execute a computer program stored in a memory to execute the steps of the data processing method described in the second aspect above, or to execute the steps of the data processing method described in the third aspect above.

[0032] Optionally, the memory is connected to the processor through a circuit or a wire.

[0033] In a tenth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, where when the computer program is executed by a processor, the steps of the data processing method described in the second aspect above are implemented, or the steps of the data processing method described in the third aspect above are implemented.

[0034] In an eleventh aspect, an embodiment of the present application provides a computer program product, which when running on a terminal, causes the terminal to execute the steps of the data processing method described in the second aspect above, or to execute the steps of the data processing method described in the third aspect above.

[0035] It can be understood that the fourth aspect, fifth aspect, sixth aspect, seventh aspect, eighth aspect, ninth aspect, tenth aspect, and eleventh aspect provided above are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0037] Figure 1 It is an example diagram of spectral data;

[0038] Figure 2 It is a schematic diagram of the architecture of a distributed inference system provided by an embodiment of the present application;

[0039] Figure 3 It is a schematic diagram of storing graph data into the Hadoop distributed file system;

[0040] Figure 4 It is a schematic diagram of the distribution of model parameters;

[0041] Figure 5 It is a schematic diagram of the implementation process of a distributed inference method provided by an embodiment of the present application;

[0042] Figure 6 It is a schematic diagram of the implementation process of a data processing method provided by an embodiment of the present application;

[0043] Figure 7 It is a schematic diagram of the implementation process of a data processing method provided by another embodiment of the present application;

[0044] Figure 8 It is a schematic diagram of the implementation process of a data processing method provided by yet another embodiment of the present application;

[0045] Figure 9 It is a schematic diagram of the implementation process of a data processing method provided by still another embodiment of the present application;

[0046] Figure 10 It is a schematic diagram of a graph neural network;

[0047] Figure 11 It is a schematic diagram of the structure of a data processing device provided by an embodiment of the present application;

[0048] Figure 12 It is a schematic diagram of the structure of a data processing device provided by another embodiment of the present application;

[0049] Figure 13 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present application;

[0050] Figure 14 It is a schematic diagram of the structure of a computing device provided by an embodiment of the present application. Detailed implementation manners

[0051] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0052] It should be understood that when used in the specification of this application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.

[0053] It should also be understood that the term "and / or" used in the specification of this application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0054] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrases "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]" depending on the context.

[0055] In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.

[0056] The reference to "one embodiment" or "some embodiments" etc. described in the specification of this application means that a specific feature, structure or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0057] The Hadoop Distributed File System (HDFS) refers to a distributed file system designed to be suitable for running on general-purpose hardware. HDFS adopts a master-slave structure model. An HDFS cluster consists of a name node and several data nodes. The name node acts as the master server, managing the file namespace and the client's access operations to files. The data nodes manage the stored data.

[0058] HDFS exposes the file namespace and allows data to be stored in the form of files. The internal mechanism of HDFS is to split a file into one or more blocks, which are stored in a set of data nodes. The NameNode is used to operate on file or directory operations in the file namespace, such as opening, closing, renaming, etc., and at the same time determines the mapping between blocks and data nodes. The DataNode is responsible for read and write requests from the file system client. The DataNode also performs block creation, deletion, and block replication instructions from the NameNode.

[0059] A graph neural network is a neural network that acts directly on graph data. Graph data can also be called graph-structured data or a graph, which consists of nodes and edges. Each node represents an object, and the edge represents the association relationship between nodes. In actual application scenarios, many data can be represented in the form of a graph. For example, in the field of social networks, each user can be represented as a node, and the relationship between users can be represented as an edge. As Figure 1 shown is an example graph of graph data, Figure 1 where A, B, C, D, E, and F in it represent nodes, and the connecting lines between the nodes represent edges.

[0060] Node features can be divided into features that reflect the importance of nodes and features that reflect the structure of nodes. Features that reflect the importance of nodes include Eigenvector Centrality, Betweenness Centrality, and Closeness Centrality. Features that reflect the structure of nodes include Clustering Coefficient and Graphlet Degree Vector (GDV).

[0061] Eigenvector Centrality can be called eigenvector centrality, which characterizes that the importance of a certain node is determined by the importance of its neighbor nodes.

[0062] Betweenness Centrality can be called betweenness centrality, which characterizes that the more a node acts as a central hub, the more important it is.

[0063] Closeness Centrality can be called closeness centrality, which characterizes that the more important a node is, the shorter its distance to other nodes.

[0064] Clustering Coefficient can be called clustering coefficient, which is an index that reflects the connection density of the neighbor nodes of a certain node.

[0065] GDV is used to measure the local topology of nodes.

[0066] Edge features refer to the features between two nodes that form an edge. Edge features include distance features, local neighborhood overlap features, and global neighborhood overlap features.

[0067] The distance feature is the shortest path length between two nodes. The local neighborhood overlap feature is the number of common nodes between two nodes. The global neighborhood overlap feature is the number of paths with different path lengths between two nodes.

[0068] When using a graph neural network to infer the results of nodes in graph data, one existing solution is to store the graph neural network in the memory of a computing device and at the same time load all the graph data to be inferred into the memory at once, load small batches of data in batches, and use a graph neural network framework (DGL / PyG) for inference, iterating in a loop until inference on all nodes in the graph data is completed. However, in industrial application scenarios, it is often necessary to process large-scale graph data (with hundreds of millions of nodes, tens of billions of edges, and thousands of dimensions of node features), and it is necessary to continuously expand the memory of the computing device.

[0069] To solve the problem of continuously expanding the memory of a computing device when processing large-scale graph data, the embodiments of this application provide a distributed inference method. By storing the graph data in a distributed file system, it is convenient for the computing device to extract relevant features of the corresponding target nodes from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph data. Even when processing large-scale graph data, there is no need to expand the memory of the computing device, and relevant features of the corresponding target nodes are provided for each computing device. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work together to obtain the inference results of the corresponding target nodes, thereby realizing the distributed inference of nodes in the graph data and improving the inference speed of nodes in the graph data.

[0070] It should be understood that the magnitudes of the sequence numbers of the steps in this embodiment do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.

[0071] To illustrate the technical solutions described in this application, the following will be described through specific embodiments.

[0072] See Figure 2 , which is an architecture example diagram of a distributed inference system provided by an embodiment of this application. As Figure 2 shown, the distributed inference system includes a terminal, a distributed file system, and at least two computing devices.

[0073] The terminal stores the graph data in the distributed file system, which can expand the storage space of the graph data from the memory of one computing device to the computable computing cluster that can be derived, facilitating the distributed storage and extraction of the graph data. Among them, the above graph data includes at least two node features and at least one edge feature. The above distributed file system may refer to HDFS. Storing the graph data in HDFS may refer to storing the graph data in each data node in HDFS. As Figure 3 shown is an example diagram of storing graph data in HDFS.

[0074] Among them, the graph data in the terminal can be input or entered by the user, or sent to the terminal by other devices, which is not limited here.

[0075] The terminal usually installs a graph neural network, which can extract the model parameters of the graph neural network from the installed graph neural network and distribute the model parameters to each computing device in the distributed inference system, without storing the entire graph neural network in the memory of the computing device, reducing the occupancy of the memory of the computing device. Among them, the model parameters of the graph neural network include the model parameters of each layer of the graph neural network (such as weights, biases, etc.).

[0076] After each computing device receives the model parameters, it can extract the relevant features of the corresponding target node from the distributed file system and calculate the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node. Thus, through the collaborative work of each computing device, the inference results of all nodes in the graph data can be obtained, improving the inference speed of all nodes in the graph data.

[0077] Among them, the target node corresponding to a computing device refers to the node in the graph data for which the inference result is obtained through this computing device.

[0078] The relevant features of a target node include the node features of the target node and the edge features corresponding to the target node. The edge features corresponding to a target node may refer to the edge features of the target edge, and the target edge refers to the edge formed by the target node and other nodes, where the other nodes refer to the nodes in the graph data except the target node. As Figure 1 shown, if node A is the target node, then the edges formed by the connections between node A and node C, between node A and node F, and between node A and node B are all the target edges corresponding to node A.

[0079] For example, a distributed inference system includes four computing devices, namely computing device 1, computing device 2, computing device 3, and computing device 4. There are 800,000 nodes in the graph data. Every 200,000 nodes are divided into a group, and a total of four groups can be formed, which are respectively called the first group, the second group, the third group, and the fourth group. The 200,000 nodes in the first group are the target nodes corresponding to computing device 1, and the inference results of the 200,000 nodes in the first group can be obtained through computing device 1; the 200,000 nodes in the second group are the target nodes corresponding to computing device 2, and the inference results of the 200,000 nodes in the second group can be obtained through computing device 2; the 200,000 nodes in the third group are the target nodes corresponding to computing device 3, and the inference results of the 200,000 nodes in the third group can be obtained through computing device 3; the 200,000 nodes in the fourth group are the target nodes corresponding to computing device 4, and the inference results of the 200,000 nodes in the fourth group can be obtained through computing device 4; thus, the inference results of 800,000 nodes can be obtained through the above four computing devices.

[0080] As Figure 4 shown is an example diagram of the distribution of model parameters. The terminal distributes the model parameters to four computing devices, and all nodes in the graph data can be inferred through the four computing devices in Figure 4 .

[0081] In the embodiment of the present application, by storing the graph data in a distributed file system, each computing device can extract the relevant features of the corresponding target nodes from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph data. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work together to obtain the inference results of the corresponding target nodes, thereby realizing the distributed inference of the nodes in the graph data and improving the inference speed.

[0082] Refer to Figure 5 , which is a schematic diagram of the implementation process of the distributed inference method provided by an embodiment of the present application. The distributed inference method is applied to the distributed inference system as shown in Figure 2 . As shown in Figure 5 , the distributed inference method may include the following steps:

[0083] Step 501, the terminal stores the graph data in a distributed file system.

[0084] Among them, the graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes.

[0085] By storing the graph data in the distributed file system, the terminal can expand the storage space of the graph data from the memory of one computing device to the computable computing cluster, thereby reducing the limitation of the memory of the computing device on the graph data. Even when processing large-scale graph data, there is no need to expand the memory of the computing device, so that the present application can realize the inference of nodes in large-scale graph data.

[0086] Step 502, the terminal distributes the model parameters of the trained graph neural network to each computing device.

[0087] Step 503, each computing device calculates the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system.

[0088] Among them, the relevant features of the target node include the node features of the target node and the edge features corresponding to the target node.

[0089] By distributing the model parameters of the trained graph neural network to each computing device, the terminal can enable each computing device to realize the inference of the target node based on the received model parameters and the relevant features of the corresponding target node extracted from the distributed file system. That is, when inferring nodes, there is no need for the computing device to load the graph neural network framework, which improves the inference speed of the target node.

[0090] Among them, the computing device can extract the relevant features of the corresponding target node from the distributed file system after receiving the model parameters, or can extract the relevant features of the corresponding target node from the distributed file system before receiving the model parameters, which is not limited here.

[0091] In an optional embodiment, the terminal can generate a computing script of the graph neural network based on the distributed computing framework and upload the computing script to the distributed computing framework. The computing script is used to allocate computing tasks to each computing device; each computing device executes the above computing tasks based on the model parameters and the relevant features of the corresponding target node to obtain the inference result of the corresponding target node.

[0092] The computing script of the graph neural network includes the computing scripts of each layer of the graph neural network. The computing script of a layer in the graph neural network is a script representing the matrix operation of that layer.

[0093] After parsing the computing script, the distributed computing architecture can allocate computing tasks to each computing device to achieve task allocation.

[0094] The above computing tasks are used to indicate to perform a certain matrix operation, such as a convolution operation, on the model parameters and the relevant features of the corresponding target node.

[0095] In the embodiments of the present application, by storing the graph data in a distributed file system, each computing device can extract the relevant features of the corresponding target node from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph data. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work collaboratively to obtain the inference result of the corresponding target node, thereby realizing the distributed inference of the nodes in the graph data and improving the inference speed.

[0096] See Figure 6 , which is a schematic implementation flowchart of the data processing method provided by an embodiment of the present application. This data processing method is applied to a terminal in a distributed inference system as shown in Figure 2 . As shown in Figure 6 , this data processing method may include the following steps:

[0097] Step 601, store the graph data in a distributed file system.

[0098] Among them, the graph data includes at least two node features and at least one edge feature. The edge feature represents the association relationship between two connected nodes, that is, the edge feature of an edge represents the association relationship between the two nodes that make up the edge. The distributed file system is used to provide the relevant features of the corresponding target node for at least two computing devices. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node. The relevant features of the target node are used to calculate the inference result of the target node.

[0099] By storing the graph data in a distributed file system, the storage space of the graph data can be expanded from the memory of one computing device to the computable computing cluster, thereby reducing the limitation of the memory of the computing device on the graph data. Even when processing large-scale graph data, there is no need to expand the memory of the computing device, so that the present application can realize the inference of nodes in large-scale graph data.

[0100] Step 602, distribute the model parameters of the trained graph neural network to each computing device.

[0101] After receiving the model parameters, each computing device can calculate the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system.

[0102] By distributing the model parameters of the trained graph neural network to each computing device, each computing device can realize the inference of the target node based on the received model parameters and the relevant features of the corresponding target node. That is, when inferring a node, there is no need for the computing device to load the graph neural network framework, which improves the inference speed of the target node.

[0103] In the embodiment of the present application, by storing the graph data in a distributed file system, it is convenient for each computing device to extract the relevant features of the corresponding target node from the distributed file system, thereby reducing the limitation of the memory of the computing device on the graph data. By distributing the model parameters of the trained graph neural network to each computing device, multiple computing devices can work collaboratively to achieve distributed inference of nodes in the graph data and improve the inference speed of nodes in the graph data.

[0104] See Figure 7 , which is a schematic implementation flowchart of a data processing method provided by another embodiment of the present application. This data processing method is applied to a terminal in a distributed inference system as shown in Figure 2 . As shown in Figure 7 , this data processing method may include the following steps:

[0105] Step 701, store the graph data in a distributed file system.

[0106] This step is the same as step 601. For specific details, please refer to the relevant description of step 601 and will not be elaborated here.

[0107] Step 702, based on the distributed computing framework, generate a computing script for the graph neural network and upload the computing script to the distributed computing framework.

[0108] Among them, the above computing script is used to allocate computing tasks to each computing device. The above computing tasks are used to calculate the inference results of the target nodes corresponding to each computing device.

[0109] The distributed computing framework provides an Application Programming Interface (API) for the terminal. Through this API, the terminal can rewrite the model code of the graph neural network based on distributed computing frameworks such as Pyspark and Kafka to obtain a computing script for the graph neural network, thereby breaking the framework limitation and memory limitation of the prior art by using the existing high-performance computing of the distributed file system and the distributed computing framework. Compared with the inference method using the graph neural network framework, the present application can significantly improve the inference speed of large-scale graph data. Among them, distributed computing frameworks such as Pyspark and Kafka are batch processing and stream processing hybrid frameworks, which are more suitable for the iterative calculation of nodes in each layer of the graph neural network in graph data and can quickly achieve distributed inference of nodes in large-scale graph data. Moreover, the batch processing and stream processing hybrid framework has high real-time computing capabilities and can achieve real-time distributed inference of nodes in large-scale graph data.

[0110] Rewriting the model code of the graph neural network can refer to rewriting the matrix operations of each layer of the graph neural network to rewrite the matrix operations of each layer into scripts, so as to obtain the calculation scripts of each layer in the graph neural network.

[0111] Step 703: Distribute the model parameters of the trained graph neural network to each computing device.

[0112] By distributing the model parameters to each computing device, each computing device can execute the assigned computing tasks based on the received model parameters and the relevant features of the corresponding target node, and obtain the inference result of the corresponding target node.

[0113] The computing device executes the assigned computing tasks based on the received model parameters and the relevant features of the corresponding target node, which can be used to understand the message passing calculation of the graph neural network. After the message passing calculation is completed, the inference result of the target node can be obtained.

[0114] Before the computing device obtains the inference result of the corresponding target node, the distributed computing framework can assign the corresponding target node to each computing device, that is, the scheduling of the computing device is realized through the distributed computing framework.

[0115] For example, Pyspark can assign the identification information of the target node responsible for each computing device. During the inference process of each computing device, based on the identification information of the target node it is responsible for, it can extract the relevant features of the target node it is responsible for from the distributed file system.

[0116] The computing device can store the obtained inference result of the corresponding target node in the specified location of the distributed file system. The distributed computing framework can monitor whether each computing device has completed the inference of all nodes in the graph data. If it is monitored that the inference of all nodes is completed, it can feedback a success instruction to the terminal. The success instruction carries the storage location of the inference results of all nodes in the distributed file system (that is, the above-mentioned specified location). After receiving the above success instruction, the terminal can obtain the storage location of the inference results of all nodes in the distributed file system, which is convenient for subsequent query of the inference results.

[0117] In the embodiment of the present application, by generating the calculation script of the graph neural network based on the distributed computing framework, it can be realized that during the inference process, there is no need for the computing device to load the original graph neural network framework, which improves the inference speed of the nodes in the graph data.

[0118] See Figure 8 is a schematic diagram of the implementation process of the data processing method provided by another embodiment of the present application. The data processing method is applied to the computing device in the distributed inference system as shown in Figure 2 shown. As shown in Figure 8As shown, the data processing method may include the following steps:

[0119] Step 801: Receive the model parameters of the trained graph neural network distributed by the terminal.

[0120] After the terminal extracts the model parameters of the graph neural network, it distributes the model parameters to each computing device in the distributed inference system. Each computing device receiving the model parameters distributed by the terminal facilitates the collaborative work of each computing device, thereby enabling the inference of all nodes in the graph data.

[0121] Step 802: Extract the relevant features corresponding to the target node from the distributed file system.

[0122] Each computing device can calculate the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system. Thus, through the collaborative work of each computing device, the inference results of all nodes in the graph data can be obtained, improving the inference speed of all nodes in the graph data.

[0123] Step 803: Calculate the inference result of the target node based on the model parameters and the relevant features of the target node.

[0124] Each computing device can achieve the inference of the target node based on the received model parameters and the relevant features of the corresponding target node. That is, when inferring a node, there is no need for the computing device to load the graph neural network framework, improving the inference speed.

[0125] In the embodiment of the present application, by extracting the relevant features corresponding to the target node from the distributed file system, the limitation of the memory of the computing device on the graph data can be reduced, and through the collaborative work of multiple computing devices, the distributed inference of the nodes in the graph data can be achieved, improving the inference speed of the nodes in the graph data.

[0126] See Figure 9 , which is a schematic diagram of the implementation process of the data processing method provided by another embodiment of the present application. This data processing method is applied to a computing device in a distributed inference system as shown in Figure 2 As shown in Figure 9 As shown, the data processing method may include the following steps:

[0127] Step 901: Receive the model parameters of the trained graph neural network distributed by the terminal.

[0128] This step is the same as step 801. For specific details, please refer to the relevant description of step 801 and will not be elaborated here.

[0129] Step 902: Extract the relevant features corresponding to the target node from the distributed file system.

[0130] This step is the same as step 802. For specific details, please refer to the relevant description of step 802 and will not be elaborated here.

[0131] Step 903: Perform corresponding computational tasks based on the model parameters and relevant features of the target node to obtain the inference result of the target node.

[0132] Among them, the above-mentioned computational tasks are assigned to computing devices by the distributed computing framework.

[0133] The computing device performs corresponding computational tasks based on the received model parameters and relevant features of the corresponding target node, which can be understood as performing message passing calculations of the graph neural network. After performing the message passing calculations, the inference result of the target node can be obtained.

[0134] Optionally, the graph neural network includes an input layer, a prediction layer, and K hidden layers. The K hidden layers are located between the input layer and the prediction layer, where K is an integer greater than zero. Performing corresponding computational tasks based on the model parameters and relevant features of the target node to obtain the inference result of the target node includes:

[0135] Perform the computational tasks of the input layer based on the model parameters of the input layer and the relevant features of the target node to obtain the output features of the input layer;

[0136] For the i-th hidden layer, where the i-th hidden layer is any one of the K hidden layers, based on the computational script of the i-th hidden layer, perform the computational tasks of the i-th hidden layer on the model parameters of the i-th hidden layer and the input features of the target node in the i-th hidden layer to obtain the output features of the target node in the i-th hidden layer. The input features of the target node in the first hidden layer are the output features of the input layer;

[0137] If i is less than K, determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer, and set i + 1 as i, then return to perform the step of performing the computational tasks of the i-th hidden layer based on the model parameters of the i-th hidden layer and the input features of the target node in the i-th layer and subsequent steps;

[0138] If i is equal to K, perform the computational tasks of the prediction layer based on the model parameters of the prediction layer and the output features of the target node in the i-th hidden layer to obtain the inference result of the target node.

[0139] Among them, the above-mentioned prediction layer can also be called the output layer. The hidden layer refers to all layers other than the input layer and the prediction layer. The hidden layer is located between the input layer and the prediction layer, does not directly receive external signals, and does not directly send signals to the outside.

[0140] The model parameters of the graph neural network include the model parameters of each layer of the graph neural network (such as weights, biases, etc.). The computing tasks assigned to the computing device include the computing tasks of the computing device in each layer of the graph neural network.

[0141] The computing task of the input layer represents the operation of the input layer. Therefore, by performing the computing task of the input layer based on the model parameters of the input layer and the relevant features of the target node, the output features of the input layer can be obtained. The output features of the input layer are the input features of the target node in the first hidden layer. Here, the first hidden layer refers to the hidden layer immediately adjacent to the input layer in the graph neural network.

[0142] The computing task of the i-th hidden layer represents the operation of the i-th hidden layer. Therefore, by performing the computing task of the i-th hidden layer based on the model parameters of the i-th hidden layer and the input features of the target node in the i-th hidden layer, the output features of the target node in the i-th hidden layer can be obtained.

[0143] Among them, the (i + 1)-th hidden layer is the next hidden layer of the i-th hidden layer, which is located after and immediately adjacent to the i-th hidden layer in the graph neural network. i and i + 1 can be understood as the layer numbers of the hidden layers.

[0144] It is possible to start from the first hidden layer and sequentially perform the computing tasks of each hidden layer in the order of the K hidden layers in the graph neural network to obtain the output features of the target node in that hidden layer. After obtaining the output features of the target node in each hidden layer, it is necessary to determine whether the layer number of this hidden layer is K. If it is not K, then based on the computing script of the next hidden layer, calculate the output features of the target node in the next hidden layer, and repeat the calculation process of the output features (i.e., iterative calculation) until all K hidden layers are traversed, that is, until the output features of the target node in the K-th hidden layer are obtained.

[0145] The computing task of the prediction layer represents the operation of the prediction layer. Therefore, by performing the computing task of the prediction layer based on the model parameters of the prediction layer and the output features of the target node in the K-th hidden layer, the output result of the prediction layer can be obtained. The output result of the prediction layer is the inference result of the target node.

[0146] As Figure 10 shown is an example diagram of the graph neural network. Figure 10The graph neural network therein sequentially includes an input layer, three hidden layers, and a prediction layer. The three hidden layers are sequentially the first hidden layer, the second hidden layer, and the third hidden layer. The computing task of the first hidden layer is performed based on the model parameters of the first hidden layer and the output features of the input layer to obtain the output features of the target node in the first hidden layer. Since the layer number of the first hidden layer is 1, which is not equal to K (i.e., 3), the input features of the target node in the second hidden layer are first determined based on the output features of the target node in the first hidden layer, and then the computing task of the second hidden layer is performed based on the model parameters of the second hidden layer and the input features of the target node in the second hidden layer to obtain the output features of the target node in the second hidden layer. Since the layer number of the second hidden layer is 2, which is not equal to K, the input features of the target node in the third hidden layer are first determined based on the output features of the target node in the second hidden layer, and then the computing task of the third hidden layer is performed based on the model parameters of the third hidden layer and the input features of the target node in the third hidden layer to obtain the output features of the target node in the third hidden layer. Since the layer number of the third hidden layer is 3, which is equal to K, it means that all hidden layers have been traversed.

[0147] Optionally, determining the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer includes:

[0148] If the target node has neighbor nodes, obtain the output features of the neighbor nodes in the i-th hidden layer, and determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer and the output features of the neighbor nodes in the i-th hidden layer. A neighbor node refers to a node that forms an edge with the target node;

[0149] If the target node has no neighbor nodes, determine the output features of the target node in the i-th hidden layer as the input features of the target node in the (i + 1)-th hidden layer.

[0150] The neighbor nodes of a target node usually have an association relationship with the target node. Therefore, the relevant features of the neighbor nodes have a certain impact on the inference result of the target node. Therefore, in order to improve the inference accuracy of the target node, the relevant features of its neighbor nodes can be considered in the process of calculating the inference result of the target node.

[0151] The target node and its neighbor nodes may be nodes responsible for the same computing device, or may be nodes responsible for different computing devices. When the target node and its neighbor nodes are nodes responsible for the same computing device, after obtaining the output features of the target node in the i-th hidden layer, the computing device can directly call the output features of the neighbor nodes of the target node in the i-th hidden layer from its own memory. When the target node and its neighbor nodes are nodes responsible for different computing devices, after obtaining the output features of the target node in the i-th hidden layer, the computing device responsible for the target node can obtain the output features of its neighbor nodes in the i-th hidden layer from the computing device responsible for the neighbor nodes of the target node. Optionally, when the computing device obtains the output features of the node it is responsible for at each layer, it can store the output features in the distributed file system, facilitating the computing device or other computing devices to obtain the output features of any node at any layer from the distributed file system.

[0152] Among them, the output features of the target node in the i-th hidden layer and the output features of the neighbor nodes in the i-th hidden layer can be weighted and summed, and the obtained value of the weighted sum is determined as the input features of the target node in the i+1-th hidden layer. It should be noted that this application does not limit the weights used in the weighted sum. For example, when performing the weighted sum, the weight of the output features of the target node in the i-th hidden layer is 0.6, and the weight of the output features of the neighbor nodes in the i-th hidden layer is 0.4; or the weight of the output features of the target node in the i-th hidden layer is 0.5, and the weight of the output features of the neighbor nodes in the i-th hidden layer is 0.5.

[0153] After each computing device in the distributed inference system obtains the inference result of the corresponding target node, it can store the obtained inference result of the corresponding target node in a specified location in the distributed file system. The distributed computing framework can monitor whether each computing device has completed the inference of all nodes in the graph data. If it is monitored that the inference of all nodes is completed, it can feedback a success instruction to the terminal. The success instruction carries the storage location (i.e., the above-mentioned specified location) of the inference results of all nodes in the distributed file system. After receiving the above success instruction, the terminal can obtain the storage location of the inference results of all nodes in the distributed file system, facilitating subsequent query of the inference results.

[0154] The embodiment of this application breaks the framework limit and memory limit of the existing solution by using the existing high-performance computing of the distributed file system and the distributed computing framework. Compared with the inference method using the graph neural network framework, this application can significantly improve the inference speed of nodes in large-scale graph data.

[0155] See Figure 11, which is a schematic structural diagram of a data processing device provided in an embodiment of the present application. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.

[0156] The above data processing device includes:

[0157] A data storage module 1101, configured to store graph data into a distributed file system. The graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The distributed file system is used to provide relevant features of a target node for at least two computing devices. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node, and the relevant features of the target node are used to calculate the inference result of the target node;

[0158] A parameter distribution module 1102, configured to distribute the model parameters of the trained graph neural network to each computing device, and the model parameters are used to calculate the inference result of the target node corresponding to each computing device.

[0159] Optionally, the above data processing device further includes:

[0160] A script generation module, configured to generate a calculation script of a graph neural network based on a distributed computing framework and upload the calculation script to the distributed computing framework. The calculation script is used to allocate calculation tasks for each computing device, and the calculation tasks are used to calculate the inference result of the target node corresponding to each computing device.

[0161] The data processing device provided in the embodiment of the present application can be applied in the foregoing method embodiment. For details, refer to the description of the foregoing method embodiment and will not be elaborated here.

[0162] See Figure 12 , which is a schematic structural diagram of a data processing device provided in another embodiment of the present application. For the sake of convenience of description, only the parts related to the embodiments of the present application are shown.

[0163] The above data processing device includes:

[0164] A parameter receiving module 1201, configured to receive the model parameters of the trained graph neural network distributed by the terminal;

[0165] A feature extraction module 1202, configured to extract relevant features of a target node from a distributed file system. The distributed file system stores graph data, and the graph data includes at least two node features and at least one edge feature. The edge feature represents the association relationship between two connected nodes. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node;

[0166] The result calculation module 1203 is configured to calculate the inference result of the target node based on the model parameters and the relevant features of the target node.

[0167] Optionally, the result calculation module 1203 is specifically configured to:

[0168] Execute corresponding calculation tasks based on the model parameters and the relevant features of the target node to obtain the inference result of the target node.

[0169] Optionally, the graph neural network includes an input layer, a prediction layer, and K hidden layers. The K hidden layers are located between the input layer and the prediction layer, and K is an integer greater than zero. The result calculation module 1203 includes:

[0170] The first calculation unit is configured to execute the calculation task of the input layer based on the model parameters of the input layer and the relevant features of the target node to obtain the output features of the input layer;

[0171] The second calculation unit is configured to, for the i-th hidden layer, where the i-th hidden layer is any one of the K hidden layers, execute the calculation task of the i-th hidden layer based on the model parameters of the i-th hidden layer and the input features of the target node in the i-th hidden layer to obtain the output features of the target node in the i-th hidden layer. The input features of the target node in the first hidden layer are the output features of the input layer;

[0172] The feature determination unit is configured to, if i is less than K, determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer, and set i + 1 as i, and return to execute the above second calculation unit;

[0173] The third calculation unit is configured to, if i is equal to K, execute the calculation task of the i-th hidden layer based on the model parameters of the prediction layer and the output features of the target node in the i-th hidden layer to obtain the inference result of the target node.

[0174] Optionally, the feature determination unit is specifically configured to:

[0175] If the target node has neighbor nodes, obtain the output features of the neighbor nodes in the i-th hidden layer, and determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer and the output features of the neighbor nodes in the i-th hidden layer. The neighbor nodes refer to the nodes that form an edge with the target node;

[0176] If the target node has no neighbor nodes, determine the output features of the target node in the i-th hidden layer as the input features of the target node in the (i + 1)-th hidden layer.

[0177] The data processing device provided by the embodiments of the present application can be applied in the foregoing method embodiments. For details, please refer to the description of the foregoing method embodiments and will not be elaborated herein.

[0178] Figure 13 is a schematic structural diagram of a terminal provided by an embodiment of the present application. As Figure 13 shown, the terminal 13 of this embodiment includes: one or more processors 1300 (only one is shown in the figure), a memory 1301, and a computer program 1302 stored in the memory 1301 and executable on the at least one processor 1300. When the processor 1300 executes the computer program 1302, the steps in the foregoing various data processing method embodiments are implemented.

[0179] The terminal 13 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal may include, but is not limited to, a processor 1300 and a memory 1301. Those skilled in the art can understand that Figure 13 merely examples of the terminal 13, which do not constitute a limitation on the terminal 13, may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the terminal may further include input and output devices, network access devices, buses, etc.

[0180] The so-called processor 1300 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0181] The memory 1301 may be an internal storage unit of the terminal 13, such as a hard disk or memory of the terminal 13. The memory 1301 may also be an external storage device of the terminal 13, such as a plug-in hard disk equipped on the terminal 13, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 1301 may also include both the internal storage unit of the terminal 13 and the external storage device. The memory 1301 is used to store the computer program and other programs and data required by the terminal. The memory 1301 may also be used to temporarily store the data that has been output or will be output.

[0182] Figure 14 is a schematic structural diagram of a computing device provided by an embodiment of the present application. As Figure 14 shown, the computing device 14 of this embodiment includes: one or more processors 1400 (only one is shown in the figure), a memory 1401, and a computer program 1402 stored in the memory 1401 and executable on the at least one processor 1400. When the processor 1400 executes the computer program 1402, the steps in the above-mentioned various data processing method embodiments are implemented.

[0183] The computing device 14 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The computing device may include, but is not limited to, a processor 1400 and a memory 1401. Those skilled in the art can understand that Figure 14 merely examples of the computing device 14, and do not constitute a limitation on the computing device 14. It may include more or fewer components than those shown in the figure, or combine certain components, or different components. For example, the computing device may also include input / output devices, network access devices, a bus, etc.

[0184] The so-called processor 1400 may be a CPU, and this processor may also be other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.

[0185] The memory 1401 may be an internal storage unit of the computing device 14, such as a hard disk or memory of the computing device 14. The memory 1401 may also be an external storage device of the computing device 14, such as a plug-in hard disk, SMC, SD card, flash card, etc. equipped on the computing device 14. Further, the memory 1401 may also include both an internal storage unit of the computing device 14 and an external storage device. The memory 1401 is used to store the computer program and other programs and data required by the computing device. The memory 1401 may also be used to temporarily store data that has been output or will be output.

[0186] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiment and will not be elaborated here.

[0187] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.

[0188] The embodiment of the present application also provides a computer program product. When the computer program product runs on a terminal or a computing device, the terminal or the computing device can be made to execute the steps in the foregoing method embodiments.

[0189] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0190] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0191] In the embodiments provided in this application, it should be understood that the disclosed devices / terminals / computing devices and methods can be implemented in other ways. For example, the device / terminal / computing device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0192] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0193] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0194] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A distributed inference method, characterized in that, Applied to a distributed inference system, the distributed inference system includes a terminal, a distributed file system, and at least two computing devices, and includes: The terminal stores graph data in the distributed file system, where the graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes; The terminal distributes the model parameters of the trained graph neural network to each of the computing devices, and the model parameters include the model parameters of each layer of the graph neural network; Each of the computing devices calculates the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system, where the relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node.

2. The distributed inference method according to claim 1, wherein Before each of the computing devices calculates the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system, it further includes: The terminal generates a calculation script for the graph neural network based on the distributed computing framework and uploads the calculation script to the distributed computing framework, and the calculation script is used to allocate calculation tasks to each of the computing devices; Each of the computing devices executes the calculation task based on the model parameters and the relevant features of the corresponding target node to obtain the inference result of the corresponding target node.

3. A data processing method, characterized in that, Applied to a terminal, it includes: Storing graph data in a distributed file system, where the graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The distributed file system is used to provide the relevant features of the corresponding target node for at least two computing devices. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node, and the relevant features of the target node are used to calculate the inference result of the target node; Distributing the model parameters of the trained graph neural network to each of the computing devices, and the model parameters are used to calculate the inference result of the corresponding target node of each of the computing devices, and the model parameters include the model parameters of each layer of the graph neural network.

4. The data processing method according to claim 3, characterized in that It further includes: Generating a calculation script for the graph neural network based on the distributed computing framework and uploading the calculation script to the distributed computing framework, where the calculation script is used to allocate calculation tasks, and the calculation tasks are used to calculate the inference result of the corresponding target node of each of the computing devices.

5. A data processing method, characterized in that, Applied to a computing device, it includes: Receiving the model parameters of the trained graph neural network distributed by the terminal, where the model parameters include the model parameters of each layer of the graph neural network; Extracting the relevant features of the corresponding target node from the distributed file system. The distributed file system stores graph data, where the graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The relevant features of the target node include the node feature of the target node and the edge feature corresponding to the target node; Calculate the inference result of the target node based on the model parameters and the relevant features of the target node.

6. The data processing method according to claim 5, wherein It further includes: The calculating the inference result of the target node based on the model parameters and the relevant features of the target node includes: Perform corresponding calculation tasks based on the model parameters and the relevant features of the target node to obtain the inference result of the target node.

7. The data processing method according to claim 6, characterized in that, The graph neural network includes an input layer, a prediction layer, and K hidden layers. The K hidden layers are located between the input layer and the prediction layer, and K is an integer greater than zero. The performing corresponding calculation tasks based on the model parameters and the relevant features of the target node to obtain the inference result of the target node includes: Perform the calculation task of the input layer based on the model parameters of the input layer and the relevant features of the target node to obtain the output features of the input layer; For the i-th hidden layer, where the i-th hidden layer is any one of the K hidden layers, perform the calculation task of the i-th hidden layer based on the model parameters of the i-th hidden layer and the input features of the target node in the i-th hidden layer to obtain the output features of the target node in the i-th hidden layer. The input features of the target node in the first hidden layer are the output features of the input layer; If i is less than K, determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer, and set i + 1 as i, then return to execute the step of performing the calculation task of the i-th hidden layer based on the model parameters of the i-th hidden layer and the input features of the target node in the i-th layer and subsequent steps; If i is equal to K, perform the calculation task of the prediction layer based on the model parameters of the prediction layer and the output features of the target node in the i-th hidden layer to obtain the inference result of the target node.

8. The data processing method according to claim 7, wherein The determining the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer includes: If the target node has neighbor nodes, obtain the output features of the neighbor nodes in the i-th hidden layer, and determine the input features of the target node in the (i + 1)-th hidden layer based on the output features of the target node in the i-th hidden layer and the output features of the neighbor nodes in the i-th hidden layer. The neighbor nodes refer to the nodes that form edges with the target node; If the target node has no neighbor nodes, determine the output features of the target node in the i-th hidden layer as the input features of the target node in the (i + 1)-th hidden layer.

9. A distributed inference system, characterized in that, The distributed inference system includes a terminal, a distributed file system, and at least two computing devices; The terminal is used to store the graph data in the distributed file system. The graph data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes; The terminal is used to distribute the model parameters of the trained graph neural network to each of the computing devices, where the model parameters include the model parameters of each layer of the graph neural network; Each of the computing devices is used to calculate the inference result of the corresponding target node based on the model parameters and the relevant features of the corresponding target node extracted from the distributed file system, where the relevant features of the target node include the node features of the target node and the edge features corresponding to the target node.

10. A data processing device, characterized in that, Applied to the terminal, it includes: A data storage module for storing graph spectrum data in a distributed file system, where the graph spectrum data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The distributed file system is used to provide the relevant features of the corresponding target node for at least two computing devices. The relevant features of the target node include the node features of the target node and the edge features corresponding to the target node, and the relevant features of the target node are used to calculate the inference result of the target node; A parameter distribution module for distributing the model parameters of the trained graph neural network to each of the computing devices, where the model parameters are used to calculate the inference results of the corresponding target nodes of each of the computing devices, and the model parameters include the model parameters of each layer of the graph neural network.

11. A data processing device, characterized in that, Applied to the computing device, it includes: A parameter receiving module for receiving the model parameters of the trained graph neural network distributed by the terminal, where the model parameters include the model parameters of each layer of the graph neural network; A feature extraction module for extracting the relevant features of the corresponding target node from the distributed file system, where the distributed file system stores graph spectrum data, and the graph spectrum data includes at least two node features and at least one edge feature, and the edge feature represents the association relationship between two connected nodes. The relevant features of the target node include the node features of the target node and the edge features corresponding to the target node; A result calculation module for calculating the inference result of the target node based on the model parameters and the relevant features of the target node.

12. A terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data processing method according to any one of claims 3 to 4.

13. A computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data processing method according to any one of claims 5 to 8.

14. A chip, comprising a processor, characterized in that, The processor is used to read and execute the computer program stored in the memory to execute the steps of the data processing method according to any one of claims 3 to 4, or to execute the steps of the data processing method according to any one of claims 5 to 8.

15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the data processing method according to any one of claims 3 to 4, or implements the steps of the data processing method according to any one of claims 5 to 8.

Citation Information

Patent Citations

  • Distributed computing method and distributed computing system

    CN111275176A