Graph computing method and device

By decomposing the graph into multiple subgraphs and loading them into multiple computing units to execute multiple algorithms in parallel, the problem of low serial execution efficiency and high memory access overhead of multiple algorithms in graph computing is solved, and efficient graph computing is achieved.

CN111859027BActive Publication Date: 2024-09-27HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910335121.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-24
Publication Date
2024-09-27
Estimated Expiration
2039-04-24

AI Technical Summary

Technical Problem

In the prior art, in graph computing, the serial execution of multiple algorithms results in low computing efficiency, and frequent graph loading and release results in high memory access overhead, resulting in input/output bottlenecks.

Method used

By decomposing the graph into multiple subgraphs and loading them into multiple computing units in parallel, multiple computing units are used to execute multiple algorithms in parallel, sharing the same graph, avoiding waiting and repeated graph loading and releasing operations, and optimizing task scheduling and allocation.

Benefits of technology

It improves the overall efficiency of multi-algorithm graph calculations, shortens calculation time, saves memory access time, breaks input/output bottlenecks, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111859027B
    Figure CN111859027B
Patent Text Reader

Abstract

The present application discloses a graph computing method and device, which can support concurrent execution of graph computing by multiple algorithms. By loading multiple subgraphs of a graph into multiple computing units, multiple algorithms are executed in parallel through multiple computing units, and the same graph can be shared between multiple algorithms, thereby executing multiple algorithms in parallel on the same graph, saving the time delay caused by waiting for the execution of other algorithms to end when executing a certain algorithm, thereby improving the overall efficiency of graph computing by multiple algorithms and shortening the overall time of graph computing by multiple algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a graph computing method and device. Background Art

[0002] A graph is a basic data structure that contains a series of nodes and edges connecting the nodes. Many entities in life and the relationships between entities can be intuitively expressed through points and edges on a graph. Therefore, graph-based analysis technology - graph computing technology came into being. Using graph computing technology, various practical application scenarios such as social networks, call networks, bipartite graphs between users and products, cooperative relationships between authors in papers, index relationships between articles, financial transaction networks, interactions between wireless base stations in a region and various servers in the cloud, and data exchange relationships between mobile game users can be modeled as graphs. By computing on the graph, the rules contained in the entities represented by the graph can be mined.

[0003] With the promotion of graph computing technology, we often face the situation where a large number of users require to calculate the graph at the same time. Different users need to use the same or different algorithms to calculate the graph. Therefore, the computing device will receive batch computing requests, and each computing request is used to request to use one or more algorithms to calculate the graph. The computing device will use each algorithm to calculate the graph in a serial manner according to the computing request. Specifically, assuming that the computing request requires the use of N algorithms to calculate a certain graph, the computing device will first load the graph from the external memory to the internal memory, and use algorithm 1 to calculate the graph. When the execution of algorithm 1 is completed and the calculation result of algorithm 1 is obtained, the graph will be released from the memory; similarly, the graph will be loaded from the external memory to the internal memory again, and algorithm 2 will be used to calculate the graph. When the execution of algorithm 2 is completed and the calculation result of algorithm 2 is obtained, the graph will be released from the memory. By analogy, when each algorithm is executed in sequence, the calculation results of N algorithms can be obtained. Where N is a positive integer.

[0004] From the above examples, it can be seen that when a serial method is used to calculate a graph, the next algorithm can be used for calculation only after the calculation of one algorithm is completed, resulting in low calculation efficiency. Summary of the invention

[0005] The present application provides a graph computing method and device, which can improve the computational efficiency of graph computing.

[0006] The first aspect of the present application provides a graph computing method, which can be executed by, but not limited to, a graph computing device. For example, the graph computing device can be a plurality of computing units in a distributed cloud environment. The method includes:

[0007] receiving at least one computing request, wherein the at least one computing request is used to request to use multiple algorithms to compute the graph;

[0008] loading a plurality of subgraphs of the graph into a plurality of computational units;

[0009] The plurality of algorithms are executed in parallel by the plurality of computing units.

[0010] The above provides a method that can support the concurrent execution of graph calculations by multiple algorithms. By loading multiple subgraphs of a graph into multiple computing units, multiple algorithms are executed in parallel through multiple computing units. The same graph can be shared among multiple algorithms, thereby executing multiple algorithms in parallel on the same graph, saving the delay caused by waiting for the completion of execution of other algorithms when executing a certain algorithm, thereby improving the overall efficiency of graph calculations by multiple algorithms and shortening the overall time for graph calculations by multiple algorithms.

[0011] Moreover, by sharing the same graph among multiple algorithms, multiple algorithms can reuse the graph loaded in the memory when performing graph calculations, without having to execute the steps of loading the graph into the memory and releasing the graph from the memory for each algorithm separately. This avoids the overhead caused by repeatedly loading the same graph into the memory and releasing it from the memory, saves the time for accessing the memory, and breaks the input / output (English full name: input / output, English abbreviation: IO) bottleneck.

[0012] In a possible implementation, executing the multiple algorithms in parallel by the multiple computing units includes:

[0013] Get at least one task from each algorithm;

[0014] The tasks in the multiple algorithms are executed in parallel by the multiple computing units.

[0015] In a possible implementation, obtaining at least one task in each algorithm includes at least one of the following:

[0016] According to the function name corresponding to each step in the algorithm, dividing at least one step corresponding to the same function name in the algorithm into a task;

[0017] Based on the collection, application and distribution GAS model, the algorithm is divided into collection tasks, application tasks and distribution tasks;

[0018] Based on the overall communication synchronization BSP model, the algorithm is divided into local tasks, communication tasks and synchronization tasks;

[0019] According to the execution subject of each step in the algorithm, the steps with the same execution subject in the algorithm are divided into one task;

[0020] According to the order in which each step in the algorithm accesses the vertices or edges in the graph, the steps in the algorithm with the same access order are divided into one task;

[0021] According to the vertices or edges visited in the graph by each step in the algorithm, the steps with the same vertices or edges visited in the algorithm are divided into one task;

[0022] Divide each step in the algorithm into a task;

[0023] According to the action performed by each step in the algorithm, the steps with the same action in the algorithm are divided into a task;

[0024] According to the iterative process to which each step in the algorithm belongs, dividing the steps in the algorithm belonging to the same iterative process into one task;

[0025] According to the judgment branch to which each step in the algorithm belongs, the steps in the algorithm belonging to the same judgment branch are divided into one task.

[0026] The above method, by decomposing the algorithm into tasks, can group together tasks with the same data access mode for different algorithms processing the same graph, breaking down the barriers between different algorithms and effectively exposing the similarity of the data access patterns of each task, thereby taking advantage of the similar regularity of graph access by tasks of the same type, and reasonably scheduling and allocating tasks, thereby reasonably utilizing and scheduling system resources and providing services with higher overall performance. In particular, when applied to the concurrent execution of multiple algorithms by multiple users, decomposing multiple algorithms into tasks helps to unify the management of multiple algorithms.

[0027] In a possible implementation, loading the multiple subgraphs of the graph into multiple computing units includes:

[0028] loading the plurality of subgraphs of at least one modality into the plurality of computing units;

[0029] The executing the tasks in the multiple algorithms in parallel by the multiple computing units includes:

[0030] For any task of the multiple algorithms, the task is performed by the multiple computing units according to a subgraph of a target modality, where the target modality is a modality among the at least one modality that matches the task.

[0031] In a possible implementation, the task includes the step of searching from a first vertex in the graph to a second vertex in the graph, and the second vertex in the subgraph of the target modality is arranged before the first vertex.

[0032] The method provided above takes into account the affinity between different types of tasks and subgraphs of different modes, realizes multi-modal management of graphs, and can associate the assignment of tasks with the mode of subgraphs, thereby assigning tasks to computing units loaded with appropriate subgraphs. It can provide relatively optimized data structures for tasks, improve the problem of limited data locality that is prevalent in the field of graph computing, and thus improve the execution speed of computing tasks. Specifically, since the collection task needs to access the pre-order information of each vertex, and the subgraph of the in-edge mode just aggregates the pre-order information of each vertex, data locality can be improved; similarly, for the distribution task, the distribution task needs to provide information to all post-order nodes, so assigning the distribution task to the computing unit loaded with the out-edge mode for processing can improve data locality, thereby improving computing efficiency.

[0033] In a possible implementation, executing the tasks in the multiple algorithms in parallel by the multiple computing units includes:

[0034] Obtaining priorities of the multiple algorithms according to the number of iterations of the multiple algorithms;

[0035] According to the priority of each algorithm, a scheduling scheme is obtained, where the scheduling scheme is used to indicate a corresponding relationship between at least one target task and at least one target subgraph, where the target task is a task currently scheduled among the tasks of the multiple algorithms, and the target subgraph is a subgraph currently scheduled among the subgraphs of the multiple subgraphs;

[0036] The at least one target task is executed in parallel by a plurality of computing units loaded with the at least one target subgraph.

[0037] In a possible implementation, executing the tasks in the multiple algorithms in parallel by the multiple computing units includes:

[0038] Obtaining priorities of the multiple algorithms according to a configuration instruction, wherein the configuration instruction is used to indicate the priorities of the multiple algorithms;

[0039] According to the priority of each algorithm, a scheduling scheme is obtained, where the scheduling scheme is used to indicate a corresponding relationship between at least one target task and at least one target subgraph, where the target task is a task currently scheduled among the tasks of the multiple algorithms, and the target subgraph is a subgraph currently scheduled among the subgraphs of the multiple subgraphs;

[0040] The at least one target task is executed in parallel by a plurality of computing units loaded with the at least one target subgraph.

[0041] The above method can ensure that the priority of the algorithm can be defined by the user to meet the needs of the user. In other words, it is conducive to the system to implement scheduling according to different scheduling goals, so that the system has good configurability.

[0042] In a possible implementation, executing the multiple algorithms in parallel by the multiple computing units includes at least one of the following:

[0043] For any algorithm among the plurality of algorithms, executing a portion of the algorithm except a loading step, wherein the loading step is a step of loading the graph into a memory of a computing unit;

[0044] For any algorithm among the multiple algorithms, a portion of the algorithm except a release step is executed, where the release step is a step of releasing the graph from a memory of a computing unit.

[0045] The method provided above, for the same subgraph, can avoid the process of releasing the subgraph from the memory of the computing unit when executing multiple algorithms on the subgraph by deleting the release steps in one or more algorithms, thereby saving the time and performance overhead caused by repeatedly releasing the same subgraph.

[0046] In a possible implementation manner, before receiving at least one computing request, the method further includes:

[0047] Dividing the graph to obtain the multiple subgraphs;

[0048] storing the plurality of subgraphs in a graph storage device;

[0049] The step of loading the plurality of subgraphs of the graph into at least one of the plurality of computing units comprises:

[0050] A plurality of subgraphs of the graph are loaded from the graph storage device to the plurality of computational units.

[0051] The method provided above divides the graph into multiple sub-graphs in advance and stores multiple sub-graphs. If a calculation request is received, the multiple sub-graphs can be directly loaded into the multiple computing units without temporarily dividing the graph into sub-graphs. This saves the delay caused by temporarily dividing the graph into sub-graphs, speeds up the execution of multiple algorithms, improves the efficiency of executing multiple algorithms, and helps to quickly process and complete calculation requests.

[0052] In a possible implementation manner, dividing the graph includes:

[0053] The graph is divided according to the number of the plurality of computing units.

[0054] The method provided above can support the average loading of subgraphs to multiple computing units, that is, when multiple subgraphs of a graph are loaded into computing units, the number of subgraphs loaded by different computing units is the same or approximately the same, thereby ensuring that when each computing unit executes an algorithm according to the loaded subgraph, the load between different computing units is balanced.

[0055] In a possible implementation, the method further includes:

[0056] Sending a capacity expansion request, where the capacity expansion request is used to request capacity expansion of the multiple computing units;

[0057] receiving a capacity expansion instruction, wherein the capacity expansion instruction is used to instruct to expand the capacity of the plurality of computing units;

[0058] creating at least one computational unit;

[0059] Copying at least one subgraph of the graph to obtain at least one instance of the subgraph;

[0060] loading an instance of the at least one subgraph into the created at least one computational unit;

[0061] The plurality of algorithms are executed in parallel by means of the created at least one computing unit.

[0062] In a possible implementation, the capacity expansion request includes at least one of the number of computing units to be added and the capacity expansion fee.

[0063] The method provided above can automatically perform dynamic capacity expansion in the process of executing multiple algorithms in parallel on the graph. By creating more computing units to execute algorithms, the overall computing power of the system can be improved, thereby shortening the latency of executing multiple algorithms. In addition, by diverting the workload required to execute the algorithm to the newly added computing units, the load balancing of the system can be achieved. In particular, in scenarios where the multiple computing units rented by users are insufficient to support the parallel execution of multiple algorithms, the system's adaptability can be improved by automatically triggering a capacity expansion request to prompt the user to rent more computing units to execute the algorithm.

[0064] In a possible implementation manner, copying at least one subgraph of the graph includes:

[0065] Counting the number of times each subgraph in the graph is requested by the multiple algorithms;

[0066] The subgraphs in the graph whose request times reach a threshold are copied.

[0067] The method provided above takes into account that the number of accesses that a single graph can support has a physical upper limit. If the number of accesses to the graph exceeds the physical upper limit, it is likely that the graph cannot support the parallel execution of multiple algorithms, which will cause a bottleneck in the execution process of the graph algorithm. For example, if a subgraph is a hot subgraph, for example, the subgraph contains celebrity information, and a large number of users may access the subgraph to query celebrity information at the same time, then the subgraph may not be able to support being scheduled by multiple tasks at the same time, and it is also impossible to execute multiple algorithms in parallel, resulting in a limitation on the overall speed of graph calculation. In the above implementation, the graph computing device can sense the number of requests for each subgraph. If the number of requests for a subgraph exceeds the threshold, it indicates that the demand for the subgraph is very large and it is likely to be a hot subgraph. Then, by triggering the subgraph to be copied into multiple copies and deploying them on different computing units, the subgraph is processed by multiple computing units, which can improve the processing efficiency of the subgraph. That is, by allowing concurrent computing requests to be diverted to different instances for computing, concurrency is linearly expanded.

[0068] The second aspect of the present application provides a graph computing device, which is used to execute the method provided by the first aspect or any possible implementation of the first aspect. Specifically, the graph computing device includes various units for executing the method provided by the first aspect or any possible implementation of the first aspect.

[0069] The third aspect of the present application provides a graph computing device, comprising multiple computing units, each computing unit comprising a processor and a memory, the memory storing at least one instruction, the instruction being loaded and executed by the processor to implement the method provided by the first aspect or any possible implementation of the first aspect.

[0070] A fourth aspect of the present application provides a graph computing system, including a graph computing device and a graph storage device;

[0071] The graph computing device includes a plurality of computing units;

[0072] The graph storage device is used to store multiple subgraphs of a graph;

[0073] The graph computing device is used to load the multiple subgraphs from the graph storage device to the multiple computing units to execute the method provided by the first aspect or any possible implementation of the first aspect.

[0074] The fifth aspect of the present application provides a non-transitory readable storage medium, and when the non-transitory readable storage medium is executed by a graph computing device, the graph computing device executes the method provided in the aforementioned first aspect or any possible implementation of the first aspect. The storage medium stores a program. The types of the storage medium include but are not limited to volatile memory, such as random access memory, non-volatile memory, such as flash memory, hard disk drive (HDD), solid state drive (SSD).

[0075] A sixth aspect of the present application provides a computer program product, and when the computer program product is executed by a graph computing device, the graph computing device executes the method provided in the aforementioned first aspect or any possible implementation of the first aspect. The computer program product may be a software installation package, and when the method provided in the aforementioned first aspect or any possible implementation of the first aspect needs to be used, the computer program product may be downloaded and executed on the graph computing device. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0077] Figure 1 An architecture diagram of a graph computing system provided in an embodiment of the present application;

[0078] Figure 2 A functional architecture diagram of a graph computing device provided in an embodiment of the present application;

[0079] Figure 3 A flowchart of the graph computing device provided in an embodiment of the present application;

[0080] Figure 4 Another workflow diagram of the graph computing device provided in the embodiment of the present application;

[0081] Figure 5 Another workflow diagram of the graph computing device provided in the embodiment of the present application;

[0082] Figure 6 A schematic diagram of the method flow provided for this application;

[0083] Figure 7 A schematic diagram of a subgraph of an inbound edge mode and a subgraph of an outbound edge mode provided in this application;

[0084] Figure 8 Schematic diagram of algorithm decomposition and unified management of multiple algorithms provided for this application;

[0085] Fig. 9 A schematic diagram of a multi-algorithm task scheduling provided in this application;

[0086] Fig.10 A schematic diagram of a task scheduling based on subgraph mode provided for this application;

[0087] Fig.11 A schematic diagram of a first bipartite graph and a second bipartite graph provided in the present application;

[0088] Fig.12 A flowchart of an execution iterative algorithm provided for this application;

[0089] Fig.13 A schematic diagram of the structure of a graph computing device provided by the present application;

[0090] Fig.14 Another structural schematic diagram of the graph computing device provided by the present application;

[0091] Fig.15 Another structural schematic diagram of the graph computing device provided by the present application;

[0092] Fig.16 A structural schematic diagram of the graph computing system provided in this application. DETAILED DESCRIPTION

[0093] The technical method in the embodiments of the present application is described below in conjunction with the drawings in the embodiments of the present application.

[0094] The term "unit" in this application can be implemented by hardware, or by hardware executing corresponding software, and the hardware or software has the function of executing the corresponding steps in the following method. For example, the receiving unit can be replaced by a transceiver to perform the receiving step in the following method, and the computing unit can be replaced by a processor and a memory to perform the executing step in the following method.

[0095] The term "module" in this application may be a software module.

[0096] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.

[0097] The following introduces the concepts used in this application.

[0098] Graph: A data structure including at least one vertex and at least one edge. In some scenarios, the vertices in the graph can be mapped to entities, and the edges in the graph can be mapped to the relationship between entities. The graph can be a directed graph or an undirected graph. Of course, the graph can also include other data besides vertices and edges, such as vertex labels and edge labels. In an exemplary scenario, in the scenario applied to friend recommendation, each vertex in the graph can represent a user, each edge in the graph can represent the social relationship between different users, and the data of each vertex in the graph is the user's portrait data and the user's behavior data, such as the user's age, occupation, hobbies, education, etc. For another example, in the scenario applied to product recommendation, each vertex in the graph can represent a user or a product, and each edge in the graph can represent the interactive relationship between the user and the product, such as a purchase relationship, a collection relationship, etc. For another example, in the scenario applied to financial risk control, each vertex in the graph can represent an account, a transaction, or funds. The edge in the graph can represent the flow relationship of funds, for example, the loop in the graph can represent a circular transfer. For another example, in the scenario of enterprise network optimization, each vertex in the graph can represent a network element, such as a router, a switch, a terminal, etc., and each edge in the graph can represent the connection relationship between different network elements.

[0099] Algorithm: includes a series of operations on the vertices and / or edges of the graph to perform operations such as statistics, sorting, and path selection on the vertices and / or edges of the graph. As an example, the algorithm can be a web page ranking algorithm (also known as PageRank algorithm), Pixie random walk algorithm, breadth-first search (full name in English: Breadth-First Search, English abbreviation: BFS) algorithm, depth-first search (full name in English: Depth-First-Search) algorithm, personalized web page ranking algorithm (also known as PersonalRank algorithm), k-core (English: k-core) algorithm, k-hop (English: k-hop) algorithm, shortest path (English: shortest paths) algorithm, all shortest paths (English: all shortest paths) algorithm, association path algorithm, close centrality algorithm, label propagation algorithm, modularity-based community discovery algorithm (English: Louvain algorithm), association prediction algorithm, node2vec algorithm (an algorithm that maps nodes in a network to Euclidean space), real-time recommendation algorithm, common neighbor algorithm, single-source shortest path algorithm, connected component algorithm, triangle counting algorithm, clustering coefficient algorithm, etc.

[0100] Subgraph: A part of a graph, including some vertices and some edges in the graph. A subgraph can also be called a partition in the graph. A graph can contain multiple subgraphs.

[0101] Gather apply scatter (GAS) model: a programming specification for an algorithm. According to the GAS model, the algorithm can be divided into three tasks: gather (gather), apply, and scatter.

[0102] The collection task may include the steps of obtaining data from the adjacent vertices of the vertex in the graph and the steps of obtaining data from the edges in the graph. The collection task can be regarded as the process of the working vertex collecting data from the adjacent vertices and itself. For example, the collection task may be to sum the data of each edge in the graph, or to calculate the number of vertices adjacent to a vertex. During the execution of the collection task, the vertex and the edge may be in read-only state.

[0103] The application task may include the steps of updating the data of the vertices in the graph and synchronizing the data of the vertices in the graph to the mirror vertices of the vertices. For example, the application task may be the number of adjacent vertices of the same vertex calculated by each computing vertex. The application task may be that the mirror vertex sends the calculation results of the collection task to the main vertex, the main vertex summarizes the calculation results of multiple mirror vertices, uses the summary results and the vertex data of the previous step, performs further calculations according to business needs, and then updates the data of the main vertex and synchronizes it to the mirror vertex. In the process of executing the application task, the working vertex can be in a modifiable state, and the edge can be in an unmodifiable state.

[0104] The distribution task may include the steps of sending data to the adjacent vertices of the vertex in the graph and updating the data of the edges in the graph. For example, the distribution task may be the process of updating the data on the edge after the working vertex completes the data update, and notifying the adjacent vertices that have a dependency relationship with the working vertex to update the status. In the process of executing the distribution task, the working vertex may be in a read-only state, and the edge may be in a writable state.

[0105] Bulk synchronous parallel computing model (BSP) model: a programming specification of an algorithm. According to the BSP model, the algorithm can be divided into three tasks: local tasks, communication tasks, and synchronization tasks.

[0106] Local tasks: also known as local computation tasks, may include the steps in the algorithm that perform calculations based on local data. For example, a local task may include a calculation process that a single processing unit needs to complete.

[0107] Communication tasks may include steps in an algorithm that require different computing units to interact. For example, a communication task may include a step in an algorithm where processing unit A sends the computation result of a subgraph to processing unit B.

[0108] The synchronization task may include a step in the algorithm to wait for the communication task to end. For example, the synchronization task may include a barrier synchronization process.

[0109] Modality (English: modality): refers to the form of data, or the way of expressing data. For the same data, different modes of the data are different in form, but contain the same substantive information. In an embodiment of the present application, a subgraph may have at least one modality. For example, for a certain subgraph, the vertices contained in the subgraph of modality 1 are the same as the vertices contained in the subgraph of modality 2, the edges contained in the subgraph of modality 1 are the same as the edges contained in the subgraph of modality 2, and the arrangement order of the vertices contained in the subgraph of modality 1 and the arrangement order of the vertices contained in the subgraph of modality 2 may be different. For example, if a subgraph includes vertex 1, vertex 2...vertex 100, the subgraph of modality 1 and the subgraph of modality 2 both include vertex 1, vertex 2...vertex 100, and vertex 1 in the subgraph of modality 1 is arranged in front of vertex 2, while vertex 1 in the subgraph of modality 2 is arranged behind vertex 2.

[0110] Incoming edge mode: refers to the mode of the subgraph built based on the incoming edge. The incoming edge mode is used to indicate the incoming edge relationship between different vertices in the subgraph. Specifically, the end point of each edge in the subgraph can be arranged in front, and the starting point of each edge can be arranged in the back. For example, if the subgraph includes vertex A, vertex B and vertex C, the relationship between these three vertices is: there is an edge between vertex A and vertex B, and the direction of the edge is vertex A pointing to vertex B, and there is another edge between vertex A and vertex C, and the direction of the edge is vertex A pointing to vertex C, then in the subgraph of the incoming edge mode, vertex A can be arranged in front, and vertex B and vertex C can be arranged in the back.

[0111] Out-edge modality: refers to the modality of a subgraph built based on out-edges. A subgraph with out-edge modality may include at least one out-edge. Specifically, the starting point of each edge in the subgraph may be arranged in front, and the end point of each edge may be arranged in the back. For example, if a subgraph includes vertices A, B, and C, and the relationship between these three vertices is: there is an edge between vertices A and B, and the direction of the edge is from vertex A to vertex B, and there is another edge between vertex A and vertex C, and the direction of the edge is from vertex A to vertex C, then in the subgraph with out-edge modality, vertices B and C may be arranged in front, and vertex A may be arranged in the back.

[0112] The following is an exemplary introduction to the system architecture of the present application.

[0113] Figure 1 An architectural diagram of a graph computing system provided in an embodiment of the present application, the graph computing system includes a graph computing device 101 and a terminal 102, the terminal 102 is used to send a computing request to the graph computing device 101, the graph computing device 101 is used to receive the computing request of the terminal 102, execute the graph computing method provided in the following method embodiment, and send the computing result to the terminal 102.

[0114] like Figure 1 As shown, the graph computing device 101 may include one or more computing units, and different computing units may perform the same or different steps in the following method embodiments. In some possible embodiments, the computing unit may be a physical device; for example, the computing unit may be a physical server, a central processing unit (full name in English: central processing unit, abbreviated in English: CPU), etc. In other possible embodiments, the computing unit may be a virtualized device; for example, the computing unit may be a virtual machine, a container, a pod (pod refers to the basic unit of container operation when running, managing, and orchestrating containerized applications in Kubernetes), a core of a processor, etc. In other possible embodiments, the computing unit may be a basic unit in software, for example, a computing unit may be an application, a service, a microservice, a module, a submodule, a class or a function, etc. Among them, the specifications of one or more computing units in the graph computing device 101 may be the same, for example, one or more computing units may include the same number of processors and the same capacity of memory, of course, the specifications of one or more computing units may also be different, and this embodiment does not limit this.

[0115] Multiple computing units can be implemented by a single machine or form a distributed system. In some possible embodiments, multiple computing units can run on the same physical device, and different computing units can communicate through the communication network inside the physical device. For example, multiple computing units can be multiple virtual machines or multiple containers in a physical server; for another example, multiple computing units can be multiple processors communicating through a bus in a physical server or multiple cores in the same processor. In other possible embodiments, different computing units in the graph computing device 101 can run on different physical devices, such as different locations, different computing centers, different computer rooms, different racks, etc., and different physical devices in the graph computing device 101 can interact through the network.

[0116] In some possible embodiments, the graph computing device 101 can be provided to users as a cloud computing service, for example, it can be provided to users as a graph engine service (English full name: Graph Engine Service, English abbreviation: GES). The graph computing device 101 can run in a cloud environment, for example, it can run on a public cloud, a private cloud, or a hybrid cloud. As an example, the graph computing device 101 can be an elastic cloud server (English full name: elastic cloud server, English abbreviation: ECS) cluster, and each computing unit in the graph computing device 101 is an ECS; for another example, the graph computing device 101 can be a virtual machine cluster, and each computing unit in the graph computing device 101 is a virtual machine running in a cloud environment; for another example, the graph computing device 101 can be provided as a cloud container engine (English full name: cloud container engine, English abbreviation: CCE), and each computing unit in the graph computing device 101 is a container running in a cloud environment; for another example, the graph computing device 101 can be provided as a cloud service platform (English: cloud service stage), and each computing unit in the graph computing device 101 is an application, service or microservice running in a cloud environment.

[0117] It should be understood that the operation of the graph computing device 101 in a cloud environment is only an example. The graph computing device 101 can also be operated in an edge environment, and each computing unit in the graph computing device 101 can be an edge computing device in the edge environment; the graph computing device 101 can also be operated in an edge environment, and each computing unit in the graph computing device 101 can be a terminal device in a terminal environment; this embodiment does not limit the operating environment of the graph computing device 101. In addition, the various computing units of the graph computing device 101 can also be respectively operated in different environments. For example, the graph computing device 101 can run some computing units of the graph computing device 101 in three of the cloud environment, the edge environment, and the terminal environment, or in any two of them.

[0118] The terminal 102 may be a mobile phone, a notebook, a server, a desktop computer, etc. The terminal 102 may interact with the graph computing device 101 through a network.

[0119] In some possible embodiments, the graph computing system may further include a graph storage device 103, which is used to provide a graph storage service for the graph computing device 101. The graph storage device 103 may be implemented by a single machine or may constitute a distributed system. For example, the graph storage device 103 may be a distributed memory. The graph storage device 103 may be implemented by a cloud storage service, and the graph storage device 103 may run in a cloud environment, such as a public cloud, a private cloud, or a hybrid cloud. As an example, the graph storage device 103 may be an object storage service (full name in English: object storage service, abbreviated in English: OBS), a cloud hard disk, a cloud database, and the like.

[0120] Figure 1 The graph computing system shown can be provided as a big data engine, and the graph computing device 101 and the graph storage device 103 can be provided as different levels of the big data engine divided according to logical functions. For example, the graph computing device 101 can be provided as a computing layer, and the graph storage device 103 can be provided as a storage layer.

[0121] One point that needs to be explained is that the above text only uses the graph computing device 101 and the graph storage device 103 as two separate devices as an example. In some possible embodiments, the graph computing device 101 and the graph storage device 103 can be integrated together, that is, the graph computing device 101 can have the functions of computing and storing the graph at the same time.

[0122] The following is an illustrative introduction to the application scenarios of the present application.

[0123] The graph computing method provided in the embodiments of the present application can be applied to various online and / or offline platforms related to graph computing, graph analysis, graph query, etc., and can also be packaged into various different applications. Among them, the processing logic provided in the following method embodiments can be used as a built-in graph computing function of the platform or application, so that the platform and / or application can play a role in many fields such as public safety, financial risk control, anti-fraud, social media, root cause analysis, digital asset management, data tracing, etc.

[0124] In particular, in the application of cloud platforms, as graph analysis is increasingly popularized, the algorithms for analyzing graphs are becoming more and more abundant; at the same time, the data scale of graphs is also increasing; and there are usually multiple or even multiple groups of users / tenants using the platform at the same time on the cloud platform. The graphs of each group of users are different, and a large number of users often need to use multiple analysis algorithms to calculate on large-scale graphs at the same time. For example, for multiple users under the same tenant, the terminals of these users can concurrently request to use different algorithms to calculate the same graph; for example, different tenants can use the same algorithm to calculate different graphs through terminal requests. By implementing the method provided in this application, the cloud platform can support the function of concurrently executing multiple algorithms on the same graph. On the one hand, different algorithms can improve the computing efficiency and speed of the cloud platform through concurrent execution, thereby improving the performance of the cloud platform. On the other hand, different algorithms can share the same graph, so that the number of times the graph is loaded will not increase with the increase in the number of algorithms, breaking the input / output (English full name: input / output, English abbreviation: I / O) bottleneck.

[0125] In an exemplary scenario, it can be used to perform data analysis and insights in social media-type enterprises. In this scenario, the enterprise's terminal can send a social network graph to a graph computing device, and the graph computing device stores the social network graph in a graph storage device. The terminal can send a calculation request to the graph computing device, and the calculation request is used to request the use of a web page ranking algorithm (hereinafter referred to as algorithm P) and a breadth-first traversal algorithm (hereinafter referred to as algorithm B) to calculate the social network graph. After receiving the calculation request, the graph computing device can load the social network graph from the graph storage device to the multiple calculation units. The multiple calculation units can execute algorithm P and algorithm B in parallel on the social network graph to obtain the results of algorithm P and the results of algorithm B, and return the results of algorithm P and the results of algorithm B to the enterprise's terminal. The result of algorithm P is the score of each vertex in the social network graph, which is a floating point number between 0 and 1, and the score represents the importance of the vertex calculated according to the structure of the social network graph; and the result of algorithm B is to find a preceding vertex for each vertex on the social network graph starting from a given root node R, thereby forming a tree starting from the root node R, and associating all reachable vertices.

[0126] The following is an illustrative introduction to the logical functional architecture of the graph computing device provided in this application.

[0127] See also Figure 2 ,according to Figure 2In the order from top to bottom, if terminal 1, terminal 2 and terminal 3 simultaneously send calculation request 1, calculation request 2 and calculation request 3 to the graph computing device, calculation request 1, calculation request 2 and calculation request 3 respectively indicate to use algorithm 1, algorithm 2 and algorithm 3 to calculate the same graph. After receiving calculation request 1, calculation request 2 and calculation request 3, the graph computing device can call algorithm 1, algorithm 2 and algorithm 3, load multiple subgraphs of the graph into the memory of processing unit 1, processing unit 2 and processing unit 3, generate a bipartite graph between the algorithm and the graph, generate a bipartite graph between the subgraph and the task according to the bipartite graph, generate a scheduling scheme between the subgraph and the task according to the bipartite graph, and execute the tasks of algorithm 1, algorithm 2 and algorithm 3 through processing unit 1, processing unit 2 and processing unit 3 according to the scheduling scheme to execute the scheduling scheme.

[0128] The following is an illustrative introduction to the workflow of the graph computing device of the present application.

[0129] See also Figure 3 , which shows a workflow diagram of the graph computing device provided by the present application. Figure 3 The graph computing device shown includes a request cache module, a scheduling module, a distributed task execution module, a first bipartite graph construction module, a second bipartite graph construction module, a task generation module, a subgraph modal management module, a data injection module, a pattern editing module, a partitioning module, and a subgraph modal generation module.

[0130] in, Figure 3 The modules in can be used to execute Figure 2 For example, the first bipartite graph construction module can be used to perform Figure 2 The second bipartite graph construction module can be used to perform the step of generating a bipartite graph between the algorithm and the graph. Figure 2 The step of generating a bipartite graph between subgraphs and tasks in the scheduling module can be used to execute Figure 2 In the step of generating a scheduling plan, the distributed task execution module can be Figure 2 The distributed task execution module can be used to execute the processing unit 1, processing unit 2 and processing unit 3 in Figure 2 The steps to execute the scheduling plan.

[0131] from Figure 3As can be seen on the left, the graph computing device can have two inputs and one output. One of the inputs is raw data, which is used to construct a graph. The raw data is injected into the graph computing device via a data injection module; during the data injection process, the pattern editing module obtains the raw data from the data injection module, and constructs the raw data into a graph according to the pattern (English: schema) information input by the terminal. For example, the pattern editing module can construct a graph representing a social network based on a large amount of user data. The partitioning module is used to partition the constructed graph, and each partition forms a subgraph. Afterwards, each subgraph generates a subgraph of one or more modes through a subgraph pattern generation module. The subgraph modal management module can manage the subgraph of each mode. In addition, each subgraph of each mode can be persistently stored in the graph storage device for subsequent calculations of the graph.

[0132] The mode information is used to indicate the way to construct the semantics of the graph, that is, the method of defining the data items of the vertices and edges in the graph. The mode information may include vertex declarations, edge declarations, format attributes, mode declarations, etc.

[0133] Another input of the graph computing device is a computing request triggered by a single user or a user group. The computing request is also called a query. The computing request indicates the graph and the algorithm to be executed, such as the name of the algorithm and the name of the graph. The computing request will be input into the request cache module, and the request cache module will cache the computing request for batch processing. According to the algorithm and graph indicated by the computing request, a first bipartite graph can be generated through a first bipartite graph construction module, that is, a bipartite graph between the algorithm and the task. The first bipartite graph will decompose the algorithm into a series of tasks according to the programming model based on its implementation through a task generation module, such as generating collection tasks, application tasks and distribution tasks based on the GAS model. The generated tasks can be associated with the subgraph of the matching modality through the subgraph modality management module to generate a second bipartite graph, that is, a bipartite graph between the task and the subgraph. The scheduling module can schedule the distributed task execution module to execute tasks according to the second bipartite graph. Among them, considering that some algorithms are iterative algorithms, new tasks will be dynamically generated with continuous iterations. The scheduling module has an output arrow pointing to the request cache module so as to dynamically add new iterative tasks to the request cache module. The distributed task execution module is used to execute multiple algorithms. In addition, the distributed task execution module can monitor the tasks of the iterative algorithm, save and accumulate the intermediate results of these tasks, and output the final result to the user when the iterative algorithm is terminated.

[0134] The output of the graph computing device is the calculation results of multiple algorithms, which can be fed back to the user.

[0135] exist Figure 3 Based on Figure 4 , Figure 4 yes Figure 3 A specific example of Figure 4 The figure shows the process of using the graph computing device to calculate the graph using the web page ranking algorithm, the BFS algorithm and the random walk algorithm. Figure 3 In contrast, Figure 4 The provided graph computing device not only includes Figure 3 The modules in the system also include data cleaning module, reading module, writing module, visualization module, reading module and scheduling module. Figure 4 and Figure 3 For common modules and workflows, please refer to the above Figure 3 Description, the following description Figure 4 Relative to Figure 3 To talk about unique modules and workflows.

[0136] The data cleaning module is used to clean the original data in the data injection module, such as filtering out noise data, etc. The data output by the data cleaning module can be constructed into a graph through the pattern editing module. The reading module is used to read multiple subgraphs of the graph from the graph storage device during the graph calculation process. The writing module is used to write multiple subgraphs of the graph into the graph storage device. The visualization module is used to visualize the results calculated by the calculation unit, for example, it can generate a user interface (Full name in English: User Interface, English abbreviation: UI) display instruction, the UI display instruction is used to instruct the terminal to display the user interface including the calculation results, and the UI display instruction can be sent to the terminal. The scheduling module is used to schedule according to the tasks in multiple algorithms and multiple subgraphs, so as to execute the tasks through the calculation unit.

[0137] exist Figure 3 as well as Figure 4 Based on Figure 5 , which shows another workflow diagram of the graph computing device provided by the present application. Figure 4 The difference is, Figure 4 The figure shows the process of using multiple algorithms to perform parallel calculations on a single graph. Figure 5 The process of using multiple algorithms to calculate multiple graphs in parallel is shown. Figure 3 and Figure 4 The difference is, Figure 5 The provided graph computing device not only includes Figure 3 as well as Figure 4 Each module in Figure 5 It also includes a load balancing module. Figure 5 and Figure 4 as well as Figure 3 For common modules and workflows, please refer to the above Figure 3 as well as Figure 4 Description, the following description Figure 5 Relative to Figure 3 as well as Figure 4 To talk about unique modules and workflows.

[0138] The load balancing module is used to balance the loads of multiple computing units. Figure 5 As shown, user 1, user 2, ... user n corresponding to tenant 1, and user 1, user 2, ... user n corresponding to tenant 2 can trigger computing requests through their respective terminals at the same time, and the computing device can simultaneously receive requests from the terminals of two groups of users corresponding to two tenants, where n is a positive integer. In this scenario, Figure 5 The load balancing module shown can determine that the computing power of multiple computing units may not be sufficient to support the tasks generated by processing a large number of computing requests based on the CPU usage, free memory or other information of the multiple computing units. To this end, the load balancing module can send an expansion request to the terminal. After receiving the expansion request, the terminal returns an expansion instruction. After the load balancing module expands the computing unit, it can copy the subgraph into multiple instances and load these instances to the newly added computing unit so that the newly added computing unit can share the workload.

[0139] like Figure 6 As shown, a flow chart of a graph computing method is introduced, and the method includes steps 601 to 603 executed by a graph computing device.

[0140] Step 601: The graph computing device receives at least one computing request.

[0141] At least one calculation request is used to request the use of multiple algorithms to calculate a graph. Specifically, each calculation request can be used to request the use of one or more algorithms to calculate a graph. In some possible embodiments, the calculation request may include an algorithm identifier and a graph identifier. The algorithm identifier is used to indicate the corresponding algorithm, such as the algorithm name, identity identifier (full name in English: identification, abbreviated in English: ID), number, etc. The graph identifier is used to indicate the corresponding graph, such as the algorithm ID, name, number, etc. In addition, the calculation request may also include a user identifier, and the user identifier is used to indicate the corresponding user, such as the user ID, name, etc.

[0142] In some possible embodiments, one or more terminals may generate one or more computing requests, send one or more computing requests to a graph computing device, and the graph computing device may receive at least one computing request from one or more terminals. For example, a terminal may run in a terminal environment, a graph computing device may run in a cloud environment, and the terminal and the graph computing device may exchange computing requests through each other's public Internet Protocol addresses (English full name: internet protocol address, English abbreviation: IP) addresses.

[0143] The graphs requested by the computing requests of different terminals may be the same or different, and the algorithms requested by the computing requests of different terminals may be the same or different. Figure 4 In the scenario of single graph and multiple algorithms shown in the figure, multiple users may request to use different algorithms to perform calculations on the same graph at the same time. Then, the terminals of multiple users may send calculation requests to the graph calculation device in parallel. The graph calculation device may receive calculation requests from multiple terminals at the same time and execute multiple algorithms in parallel on the same graph by executing the following steps 602 to 603 to process calculation requests from multiple terminals. Figure 5 In the multi-graph and multi-algorithm scenario shown, multiple users from multiple tenants may want to use different algorithms to perform calculations on the same or different graphs at the same time. The terminals of multiple users from multiple tenants may concurrently send calculation requests to the graph computing device. The graph computing device may simultaneously receive the calculation requests from multiple terminals, and execute the corresponding multiple algorithms in parallel on each graph in the multiple graphs by executing the following steps 602 to 603 to process the calculation requests from multiple terminals.

[0144] It should be noted that the graph computing device may be a computing unit cluster, and the execution subject of step 601 may be one or more computing units in the computing unit cluster. In some possible embodiments, the computing unit cluster may include one or more computing units of the control plane, and the one or more computing units of the control plane are used to receive at least one computing request. For example, the computing unit of the control plane may be a master node, a client node, etc. in the computing unit cluster. In other possible embodiments, each computing unit in the computing unit cluster may receive at least one computing request.

[0145] Step 602: The graph computing device loads multiple subgraphs of the graph into multiple computing units.

[0146] The graph computing device can obtain the graph identifier from the computing request, determine multiple subgraphs of the graph based on the graph corresponding to the graph identifier, and load the multiple subgraphs into the memory of the multiple computing units. After the loading is completed, the memory of each computing unit will cache multiple subgraphs.

[0147] The graph computing device may load all or part of the subgraphs of the graph into the computing unit. Specifically, if the graph includes a total of N subgraphs, for each computing unit, the graph computing device may load all N subgraphs into the computing unit; in addition, the graph computing device may also load M subgraphs into the computing unit, where N and M are positive integers, and M is less than N.

[0148] In some possible embodiments, the graph computing device may determine the storage capacity of the computing unit. If the storage capacity of the computing unit is sufficient, for example, the storage capacity is greater than a preset threshold, the graph computing device may load a full amount of subgraphs into the computing unit. If the storage capacity of the computing unit is insufficient, for example, the storage capacity is less than a preset threshold, the graph computing device may load a partial subgraph into the computing unit.

[0149] As an example, the graph computing device may adopt an average loading method, and may obtain the ratio between the total number of subgraphs and the total number of computing units as the number of subgraphs to be loaded by each computing unit, and load the number of subgraphs to each computing unit, so that the number of subgraphs loaded by different computing units may be equal or approximately equal. For example, if the graph includes N subgraphs and the computing units include M, then for each computing unit, N / M subgraphs may be loaded to the computing unit, where / represents division.

[0150] In some possible embodiments, multiple subgraphs of a graph may be pre-stored in a graph storage device, and a graph computing device may load the multiple subgraphs from the graph storage device to multiple computing units. For example, the graph computing device may pre-divide the graph into multiple subgraphs, store the multiple subgraphs in the graph storage device, generate an identifier of the graph and a correspondence between the storage positions of the multiple subgraphs according to the storage positions of the multiple subgraphs in the graph storage device, and store the correspondence. When receiving at least one computing request, the storage positions of the multiple subgraphs may be queried from the correspondence according to the identifier of the graph, the multiple subgraphs may be read from the storage positions in the graph storage device, and the multiple subgraphs may be loaded from the graph storage device to multiple computing units.

[0151] The graph computing device may divide the graph into multiple subgraphs in advance, and store the multiple subgraphs obtained by division into the graph storage device. As an example, the graph storage device may store a database, which is used to store the subgraphs of the graph. After the graph computing device divides the subgraphs, the subgraphs may be stored in the database. If a computing request is received, the multiple subgraphs of the graph are read from the database.

[0152] By pre-dividing a graph into multiple sub-graphs and storing the multiple sub-graphs, if a computing request is received, the multiple sub-graphs can be directly loaded into the multiple computing units without temporarily dividing the graph into sub-graphs, thus saving the delay caused by temporarily dividing the graph into sub-graphs, speeding up the execution of multiple algorithms, improving the efficiency of executing multiple algorithms, and helping to quickly process and complete the computing requests of the terminal.

[0153] Of course, dividing a graph into subgraphs in advance is only an example. In other possible embodiments, if a graph computing device receives a computing request, it can determine the graph indicated by the computing request, divide the graph, and obtain multiple subgraphs.

[0154] Optionally, if the graph computing device receives a computing request, the graph computing device may query whether the graph storage device stores a subgraph of the graph. If the graph storage device stores multiple subgraphs of the graph, the multiple subgraphs are loaded into the computing unit. If the graph storage device does not store multiple subgraphs of the graph, the graph indicated by the computing request is divided into multiple subgraphs, and the multiple subgraphs are loaded into the computing unit. In addition, the multiple subgraphs may be stored in the graph storage device so that the subgraphs can be loaded from the graph storage device the next time a computing request for the graph is received.

[0155] Through this implementation method, the graph computing device can store new graph subgraphs into the graph storage device multiple times as the number of graphs being computed increases, thereby expanding the amount of subgraph data in the graph storage device and dynamically maintaining the graph subgraphs.

[0156] In some other possible embodiments, the graph computing device may divide the graph into multiple sub-graphs after receiving a computing request. This embodiment does not limit the timing of dividing the graph into sub-graphs.

[0157] Regarding the process of dividing a graph into subgraphs, the graph computing device may partition the graph, and each partition forms a subgraph. In some possible embodiments, the graph computing device may partition the graph according to the number of multiple computing units. As an example, the graph computing device may divide the graph into subgraphs that are integer multiples of the number of computing units. For example, if the total number of multiple computing units is K, the graph computing device may divide the graph into K times subgraphs, where K is a positive integer.

[0158] This implementation can support evenly loading subgraphs to multiple computing units, ensuring that when subgraphs are loaded into computing units, the number of subgraphs loaded into different computing units is the same or approximately the same. For example, if a user rents 5 virtual machines, the graph can be divided into 10 subgraphs, and if a computing request is received, 2 subgraphs can be loaded into each virtual machine.

[0159] As an example, the total number of subgraphs obtained by division can be determined based on at least one of the size of the graph and the capabilities of multiple computing units. The total number of subgraphs obtained by division can be positively correlated with the size of the graph. The larger the size of the graph, the larger the total number of subgraphs can be. The total number of subgraphs obtained by division can be negatively correlated with the capabilities of multiple computing units. The stronger the capability of the computing unit, the smaller the total number of subgraphs can be, and the larger the amount of data in a single subgraph. Among them, the capability of the computing unit may include the processing capability and storage capability of the computing unit, and the processing capability can be represented by indicators such as the main frequency and number of cores of the computing unit, and the storage capability can be represented by indicators such as the storage capacity of the computing unit.

[0160] In some possible embodiments, the total number of subgraphs can be used as a parameter that can be configured in the graph computing device. The parameter can be adjusted through the system's profiler tool or by analyzing historical data of the graph computing device. The parameter can be used in conjunction with various graph partitioning algorithms.

[0161] In some other possible embodiments, the graph computing device may also divide the graph into multiple subgraphs according to the graph backup storage method. For example, if the graph is divided into M data blocks during backup storage, each of the M data blocks may be used as a subgraph, where M is a positive integer.

[0162] In some possible embodiments, each subgraph of the graph may include at least one modality, and the graph computing device may load multiple subgraphs of at least one modality of the graph into multiple computing units. The graph computing device may load subgraphs of all modalities of the graph into multiple computing units. For example, if the subgraph includes W modalities, for each computing unit, the graph computing device may load multiple subgraphs of W modalities of the graph into the computing unit respectively, where W is a positive integer.

[0163] Taking the subgraph including the two modes of the incoming edge mode and the outgoing edge mode as an example, if the graph includes a total of n subgraphs, then the graph includes a total of (2*n) subgraphs of different modes, and the (2*n) subgraphs of different modes are the subgraphs of the incoming edge mode and the outgoing edge mode. Figure 1 , the child of the outgoing mode Figure 1 , the child of the incoming edge modal Figure 2 , the child of the outgoing mode Figure 2...subgraph n of the incoming edge mode, subgraph n of the outgoing edge mode. For any computing unit, if the graph computing device wants to load all the subgraphs of the graph into the computing unit, the graph computing device will load (2*n) subgraphs of different modes into the computing unit; if the graph computing device wants to load the subgraphs of the graph into the computing unit in an average loading manner, and assuming that there are a total of m computing units, the graph computing device will load (2*n / m) subgraphs of different modes into the computing unit; where n and m are positive integers, and m is less than n, * represents multiplication, and / represents division.

[0164] In some possible embodiments, the graph computing device may pre-divide the graph into multiple subgraphs; for each subgraph, generate the subgraph of at least one modality; pre-store multiple subgraphs of at least one modality in the graph storage device; if a computing request is received, the graph computing device may load multiple subgraphs of at least one modality from the graph storage device. For example, see Figure 7 For each subgraph in the graph, the graph computing device can generate a subgraph of the incoming edge mode and a subgraph of the outgoing edge mode, and store the subgraphs of the two modes in the graph storage device. Figure 7 The solid vertices and hollow vertices in the subgraph represent the ownership relationship between different vertices in the subgraph, so as to distinguish the vertices contained in the subgraph itself and the mirror images of the vertices.

[0165] In some possible embodiments, the graph computing device may obtain identifiers of multiple algorithms from a computing request, determine multiple algorithms based on the algorithms corresponding to the algorithm identifiers, and call the multiple algorithms. The process of calling multiple algorithms and step 602 may be executed sequentially. As an example, multiple algorithms may be called first, and then step 602 may be executed; or step 602 may be executed first, and then multiple algorithms may be called. Of course, the process of calling multiple algorithms and step 602 may also be executed in parallel, and this embodiment does not limit the order of the process of calling multiple algorithms and step 602.

[0166] In an exemplary scenario, applied to the field of cloud computing, the graph computing device can load multiple subgraphs into all computing units rented by the user; in addition, the graph computing device can also select some computing units from all computing units rented by the user and load multiple subgraphs into these computing units.

[0167] Among them, after receiving a computing request, the graph computing device can temporarily create at least one computing unit in the cluster, and load multiple subgraphs into the at least one created computing unit; in addition, the graph computing device can also power on multiple computing units in a dormant state in the cluster when receiving a computing request, and load multiple subgraphs into the powered-on multiple computing units; in addition, the graph computing device can also determine multiple computing units in a running state in the cluster when receiving a computing request, and load multiple subgraphs into multiple computing units. This embodiment does not limit which implementation method is adopted in the implementation.

[0168] One point that needs to be explained is that the execution subject of step 602 may be multiple computing units that are to load subgraphs, that is, step 602 may include: multiple computing units load multiple subgraphs of a graph. The execution subject of step 602 may also be a computing unit other than the computing unit that is to load the subgraph in the graph computing device. For example, the graph computing device may be a computing unit cluster, and the computing unit cluster includes a computing unit of the control plane and a computing unit of the data plane. The computing unit of the control plane may load multiple subgraphs into the computing unit of the data plane. For example, the computing unit of the control plane may generate a control instruction, and send the control instruction to the computing unit of the data plane, and the control instruction is used to instruct to load multiple subgraphs, and the computing unit of the data plane may receive the control instruction and load multiple subgraphs of the graph. Among them, the computing unit of the data plane may be a slave node in the computing unit cluster. As an example, the computing unit of the control plane in the graph computing device may obtain a user identifier from a computing request, query the computing unit of the data plane leased by the user identifier, and load multiple subgraphs into the computing unit of the data plane.

[0169] Step 603: The graph computing device executes multiple algorithms in parallel through multiple computing units.

[0170] Multiple computing units can execute multiple algorithms in parallel based on at least one loaded subgraph, that is, they can execute multiple algorithms on at least one subgraph at the same time. Multiple computing units can reuse the same subgraph when executing multiple algorithms. Specifically, if the input of any two or more algorithms is the same subgraph, the computing units can execute the two or more algorithms at the same time based on the subgraph. For example, if Algorithm 1, Algorithm 2, and Algorithm 3 all need to load subgraphs, Figure 1 To perform calculations, multiple calculation units can be based on Figure 1 , execute Algorithm 1, Algorithm 2 and Algorithm 3 in parallel.

[0171] By executing multiple algorithms in parallel on at least one subgraph, the effects achieved include but are not limited to the following two aspects:

[0172] On the one hand, for any subgraph, when an algorithm is executed according to the subgraph, other algorithms can be executed at the same time, thus avoiding the delay caused by the algorithm waiting for the execution of other algorithms, shortening the overall time of multi-algorithm graph calculation, and improving the overall efficiency of multi-algorithm graph calculation. Figure 1 When executing Algorithm 1, Algorithm 2 and Algorithm 3 can be executed simultaneously, which avoids the delay caused by waiting for the completion of Algorithm 1 when executing Algorithm 2, and also avoids the delay caused by waiting for the completion of Algorithm 2 when executing Algorithm 3.

[0173] On the other hand, by sharing the same graph among multiple algorithms, multiple algorithms can reuse the graph already loaded in memory when performing graph calculations, without having to perform the steps of loading and releasing the graph into memory for each algorithm separately. This avoids the overhead caused by repeatedly loading and releasing the same graph into memory, saves memory access time, and breaks the IO bottleneck. Figure 1 When executing Algorithm 1, Algorithm 2, and Algorithm 3, you can execute a loading sub-item for Algorithm 1, Algorithm 2, and Algorithm 3. Figure 1 Steps to avoid loading sub-modules after executing Algorithm 1 once Figure 1 In the case of the process, execute the loading sub-item again for Algorithm 2 Figure 1 This process also avoids executing the loading sub-module again for Algorithm 3. Figure 1 process, thus avoiding repeated loading of the same sub Figure 1 In addition, the child can be released after Algorithm 1, Algorithm 2, and Algorithm 3 are all executed. Figure 1 , to avoid releasing the child after having executed Algorithm 1 once Figure 1 In the case of , execute Algorithm 2 again to release the child Figure 1 This process also avoids executing Algorithm 3 again to release the child Figure 1 process, thus avoiding the repeated release of the same child Figure 1 The delay caused.

[0174] In some possible embodiments, step 603 may include the following steps 1 and 2:

[0175] Step 1: For each algorithm among the multiple algorithms, the graph computing device obtains at least one task in the algorithm.

[0176] Tasks are also called operators. Tasks are partial steps in an algorithm. Each algorithm can include one or more tasks. For example, if an algorithm includes Q steps, a task can be P steps in the algorithm, where P is greater than or equal to 1 and less than or equal to Q, and P and Q are positive integers. The same algorithm can be divided into different tasks according to different functions. For example, an algorithm can include collection tasks, application tasks, and distribution tasks; for another example, an algorithm can include local tasks, communication tasks, and synchronization tasks.

[0177] The graph computing device can decompose the algorithm into tasks with finer granularity by acquiring at least one task in the algorithm, so as to manage and schedule the corresponding algorithm by managing and scheduling the tasks.

[0178] In some possible embodiments, step one may include any one or more of the following ways 1 to 9 in combination. Optionally, the graph computing device may determine whether the algorithm conforms to the programming model. If the algorithm conforms to the programming model, the following way 1 is executed. If the algorithm does not conform to the programming model, the following ways 2 to 9 are executed. Among them, the programming model refers to the specification for writing the algorithm. For example, the programming model may be a Pregel model (a vertex-centric programming model), a GAS model, a BSP model, etc. The algorithm conforms to the programming model, which means that the function names contained in the algorithm are consistent with the function names specified in the programming model. For example, if the algorithm conforms to the GAS algorithm, the algorithm will contain a function named "gather", a function named "apply", and a function named "scatter"; the algorithm does not conform to the programming model, which means that the function names in the algorithm are inconsistent with the function names specified in the programming model, for example, the function names contained in the algorithm are user-defined function names.

[0179] Method 1: The graph computing device divides at least one step corresponding to the same function name in the algorithm into a task according to the function name corresponding to each step in the algorithm.

[0180] As an example, the graph computing device may pre-store at least one function name, or read at least one function name from the algorithm; the graph computing device may divide at least one step corresponding to the same function name into a task according to the at least one function name. For example, the step corresponding to the function name "gather" in the algorithm may be obtained as a collection task, the step corresponding to the function name "apply" in the algorithm may be obtained as an application task, and the step corresponding to the function name "scatter" in the algorithm may be obtained as a distribution task.

[0181] Method 2: The graph computing device divides the algorithm into multiple tasks according to the algorithm's programming model.

[0182] Method 2 may include any one or a combination of the following methods (2.1) and (2.2).

[0183] Method (2.1) The graph computing device is based on the GAS model and divides the algorithm into collection tasks, application tasks and distribution tasks.

[0184] As an example, the graph computing device can divide the processing logic of each step in the algorithm into collection tasks, the processing logic of updating the data of the vertex in the graph and the step of synchronizing the data of the vertex in the graph to the mirror vertex of the vertex into application tasks, and the processing logic of updating the data of the vertex in the graph and the step of synchronizing the data of the vertex in the graph to the mirror vertex of the vertex into distribution tasks.

[0185] Method (2.2) The graph computing device can divide the algorithm into local tasks, communication tasks and synchronization tasks based on the BSP model.

[0186] As an example, the graph computing device can divide the processing logic of each step in the algorithm into steps where the processing logic is to perform calculations based on the data on this end into local tasks; divide the processing logic of the steps where the processing logic is to interact with other devices outside the local end into communication tasks; and divide the processing logic of the steps where the processing logic is to wait for the end of the communication task into synchronization tasks.

[0187] In some possible embodiments, for multiple algorithms using the same programming model, the graph computing device may divide the multiple algorithms into multiple tasks according to the programming model, and the types of the multiple tasks of different algorithms are the same. For example, if Algorithm 1 and Algorithm 2 both conform to the GAS model, the graph computing device may divide Algorithm 1 into a collection task, an application task, and a distribution task, and divide Algorithm 2 into a collection task, an application task, and a distribution task.

[0188] One point that needs to be explained is that dividing the algorithm into tasks based on the GAS model or the BSP model is only an example. In some possible embodiments, the algorithm can be implemented based on other programming models other than the GAS model or the BSP model. Accordingly, the algorithm can be divided into tasks based on other programming models. This embodiment does not limit the programming model used for dividing the algorithm.

[0189] For example, Figure 8 A schematic diagram of algorithm decomposition and unified management of multiple algorithms is shown. Any algorithm executed by a graph computing device is usually an instance of an algorithm, that is, a software implementation based on a specific algorithm (such as the shortest path algorithm or the subgraph matching algorithm) and a given programming model. Figure 8As shown in the figure, the solid-line box, the dotted-line box and the bold box represent different algorithms, and each algorithm is implemented as an instance of a graph analysis application through a programming model. Taking the GAS model as an example, according to this programming model, various algorithms can be decomposed into a combination of three tasks, namely, the collection task, the application task and the distribution task, and each task acts on the graph according to a certain rule. The execution process of these three operators forms an iteration of the graph computing process; among them, the arrow from the distribution task to the collection task indicates that the algorithm is composed of a series of iterations. It can be seen that various algorithms on a graph computing platform can be decomposed into a series of tasks, which will be assigned to computing units on the cloud or offline. Since each algorithm is decomposed into smaller tasks, the execution of multiple algorithms can be mixed together. For different algorithms, the data access method of the same type of tasks is consistent. For example, the data access method of the collection task of Algorithm 1, Algorithm 2 and Algorithm 3 is consistent, and the data access method of the distribution task of Algorithm 1, Algorithm 2 and Algorithm 3 is consistent.

[0190] By decomposing algorithms into tasks, different algorithms that process the same graph can be grouped together with tasks that have the same data access method, breaking down the barriers between different algorithms and effectively exposing the similarities in the data access patterns of each task. This allows tasks of the same type to be reasonably scheduled and allocated, taking advantage of the similar regularity of graph access by tasks of the same type, thereby rationally utilizing and scheduling system resources and providing services with higher overall performance. In particular, when applied to the concurrent execution of multiple algorithms by multiple users, decomposing multiple algorithms into tasks helps to unify the management of multiple algorithms.

[0191] Method three: The graph computing device can divide the steps with the same execution subject in the algorithm into one task according to the execution subject of each step in the algorithm.

[0192] The execution subject of a step refers to the hardware or software that executes the step. In this embodiment, the execution subject may refer to a computing unit or a computing unit with computing capabilities contained in the computing unit. For example, the computing unit may be a virtual machine, and the execution subject may be a thread in the virtual machine. If multiple steps in an algorithm are to be executed separately by T threads in the virtual machine, the steps executed by the same thread may be divided into one task.

[0193] Method 4: The graph computing device can divide the steps with the same access order in the algorithm into one task according to the order in which each step in the algorithm accesses the vertices or edges in the graph.

[0194] For example, the step of visiting from a vertex to a predecessor vertex in the algorithm can be divided into one task, and the step of visiting from a vertex to a successor vertex in the algorithm can be divided into another task.

[0195] Method 5: The graph computing device can divide the steps with the same vertices or edges visited in the algorithm into one task according to the vertices or edges visited in the graph in each step of the algorithm.

[0196] For example, if the algorithm contains 5 steps, step 1 and step 2 need to visit vertex 1, vertex 2 to vertex 1000, step 3 and step 6 need to visit vertex 1001, vertex 1002 to vertex 6000, and step 5 needs to visit vertex 6001, vertex 6002 to vertex 7000, then step 1 and step 2 can be divided into task 1, step 3 and step 6 can be divided into task 2, and step 5 can be divided into task 3.

[0197] Method 6: The graph computing device can divide each step in the algorithm into a task.

[0198] For example, if the algorithm contains H steps, the algorithm can be divided into H tasks, each task includes 1 step, where H is a positive integer.

[0199] Method 7: The graph computing device can divide the steps with the same action in the algorithm into one task according to the action performed by each step in the algorithm.

[0200] For example, if the algorithm contains three steps, step 1 executes the action of obtaining data 1 in the graph, step 2 executes the action of obtaining data 2 in the graph, and step 3 executes the action of calculating the average of data 1 and data 2, then steps 1 and 2 can be divided into task 1, and step 3 can be divided into task 2.

[0201] Method 8: The graph computing device can divide the steps in the algorithm that belong to the same iterative process into one task according to the iterative process to which each step in the algorithm belongs.

[0202] For example, if the algorithm contains R iterations, all steps of the first iteration can be divided into Task 1, all steps of the second iteration can be divided into Task 2, all steps of the third iteration can be divided into Task 3, and so on. R is a positive integer.

[0203] Method 9: The graph computing device can divide the steps belonging to the same judgment branch in the algorithm into one task according to the judgment branch to which each step in the algorithm belongs.

[0204] For example, if the algorithm includes: if the data is greater than a threshold, then execute processing step 1, processing step 2 and processing step 3 on the data; if the data is not greater than the threshold, then execute processing step 6 and processing step 5 on the data, then processing step 1, processing step 2 and processing step 3 can be divided into task 1, and processing step 6 and processing step 5 can be divided into task 2.

[0205] In some possible embodiments, for any algorithm among the multiple algorithms, the graph computing device may execute a portion other than a loading step in the algorithm, where the loading step is a step of loading the graph into a memory of a computing unit. For example, the portion other than the loading step may be divided into at least one task, and the at least one divided task may be executed in parallel by the multiple computing units.

[0206] Through this implementation, for the same subgraph, when executing multiple algorithms on the subgraph, by avoiding the process of loading the subgraph into the memory of the computing unit when executing the one or more algorithms, the time and performance overhead caused by repeatedly loading the same subgraph is saved.

[0207] In some possible embodiments, for any algorithm among the multiple algorithms, the graph computing device may execute the portion other than the release step in the algorithm. The release step is a step of releasing the graph from the memory of the computing unit. For example, the portion other than the release step may be divided into at least one task, and the at least one divided task may be executed in parallel by the multiple computing units.

[0208] Through this implementation, for the same subgraph, when executing multiple algorithms on the subgraph, by avoiding the process of releasing the subgraph from the memory of the computing unit when executing the one or more algorithms, the time and performance overhead caused by repeatedly releasing the same subgraph is saved.

[0209] Step 2: The graph computing device executes tasks in multiple algorithms in parallel through multiple computing units.

[0210] As an example, for any computing unit, the computing unit can execute tasks in different algorithms in multiple algorithms in parallel on the same subgraph. The graph computing device can assign tasks in multiple algorithms to the multiple computing units, and each computing unit can execute the tasks assigned by the graph computing device in parallel.

[0211] In some possible embodiments, the graph computing device may create a task pool. After acquiring tasks of multiple algorithms, the graph computing device may cache the tasks of the multiple algorithms in the task pool; the graph computing device may select one or more tasks from the task pool and assign the one or more tasks to the multiple computing units; each computing unit may execute the tasks assigned by the graph computing device in parallel. When multiple computing units have finished executing the assigned tasks, the graph computing device may select the remaining one or more tasks from the task pool and assign the remaining one or more tasks to the multiple computing units. Each computing unit may again execute the tasks assigned by the graph computing device in parallel, and so on, until the task pool is empty, that is, the tasks of multiple algorithms have been assigned. In the process of assigning tasks, each task can be assigned and only assigned to a subgraph of a modality, and each subgraph of each modality can be assigned one or more tasks.

[0212] For example, see Fig. 9 , Fig. 9 The solid line box above includes Algorithm 1, Algorithm 2, ..., Algorithm k, and Figure 1 , Figure 2 ...Figure n, which represents the correspondence between algorithms and graphs, reflects a set of algorithms to be executed in a concurrent execution environment and which graphs each algorithm needs to be processed on; Fig. 9 The dotted box in the solid box below represents the correspondence between tasks and subgraphs. Fig. 9 The solid-line box above is a fine-grained expression, which reflects a set of tasks to be executed in the concurrent execution environment and which subgraph of which mode each task needs to be processed on; the process of assigning tasks can be regarded as the process of selecting a set of edges from the dotted-line box. Where k and n are positive integers.

[0213] Through the above steps 1 and 2, different algorithms are decomposed into a series of tasks, so that multiple algorithms can be fully mixed together for execution, thus better supporting the concurrent execution of multiple algorithms. At the same time, because the granularity of tasks is finer than that of algorithms, more scheduling space is provided, and the loaded subgraphs can be better utilized to serve more concurrent analysis algorithms, thus improving the overall system performance during batch processing.

[0214] In some possible embodiments, the graph computing device may associate the modality of the subgraph with the task allocation process. Specifically, step 2 may include the following steps (2.1) to (2.2):

[0215] In step (2.1), the graph computing device may load multiple subgraphs of at least one mode of the graph into the multiple computing units. For example, for each computing unit in the multiple computing units, the graph computing device may load a subgraph of an incoming edge mode and a subgraph of an outgoing edge mode into the computing unit.

[0216] Step (2.2) For any task in the multiple algorithms, the task is performed according to the subgraph of the target modality.

[0217] The target modality is a modality that matches the task in at least one modality. As an example, the order of vertices in the subgraph of the target modality may be consistent with the order of searching for vertices in the task. In some possible embodiments, taking two vertices in the graph as an example, the two vertices may be called the first vertex and the second vertex, respectively. The task may include the step of searching from the first vertex in the graph to the second vertex in the graph, that is, the first vertex is the vertex visited first in the task, and the second vertex is the vertex visited later in the task. The second vertex in the subgraph of the target modality is arranged before the first vertex, that is, the second vertex is arranged in front and the first vertex is arranged in the back in the subgraph.

[0218] In some possible embodiments, considering the update of information on the graph, it usually comes from the data flowing along the edge and the calculation performed on the vertex. The data flowing along the edge includes two levels: 1) each vertex obtains the latest data from its predecessor vertex along the incoming edge direction to update the local information of the vertex; 2) each vertex propagates its latest local information to the successor node along the outgoing edge direction. Therefore, the subgraph can be expressed as two modes, the incoming edge mode represents the incoming edge relationship of the subgraph, and the outgoing edge mode represents the outgoing edge relationship of the subgraph.

[0219] Accordingly, step (2.2) may include: executing a collection task according to a subgraph of the incoming edge modality; executing a distribution task according to a subgraph of the outgoing edge modality. In particular, the collection tasks of multiple algorithms may be executed in parallel according to the same subgraph of the incoming edge modality; and the distribution tasks of multiple algorithms may be executed in parallel according to the same subgraph of the outgoing edge modality. For example, see Fig.10 , the collection tasks of Algorithm 1, Algorithm 2, and Algorithm 3 can be executed in parallel based on the same subgraph of the incoming edge modality.

[0220] Through the above steps (2.1) to (2.2), the affinity between different types of tasks and subgraphs of different modes is considered, and the multi-modal management of the graph is realized. The distribution of tasks can be associated with the mode of the subgraph, so that the tasks are assigned to the computing unit loaded with the appropriate subgraph. A relatively optimized data structure can be provided for the task, improving the problem of limited data locality that is prevalent in the field of graph computing, thereby improving the execution speed of computing tasks. For example, in the algorithm built based on the GAS model, among the tasks decomposed by the algorithm, the collection task needs to access the pre-order information of each vertex, and in the subgraph of the in-edge mode, the pre-order information of each vertex is aggregated together, so the data locality can be improved; similarly, for the distribution task, the distribution task needs to provide information to all post-order nodes, so assigning the distribution task to the computing unit loaded with the out-edge mode for processing can improve data locality, thereby improving computing efficiency.

[0221] In addition, a mini-batch synchronization mechanism can be used between the subgraph of the incoming edge mode and the subgraph of the outgoing edge mode to provide information updates for the mirror node.

[0222] In some possible embodiments, the graph computing device may obtain a scheduling scheme between tasks and subgraphs, and execute tasks of multiple algorithms in parallel according to the scheduling scheme. Specifically, step 603 may include the following steps A to C:

[0223] Step A: The graph computing device obtains the priorities of multiple algorithms.

[0224] In some possible embodiments, the priority is obtained by a method including but not limited to a combination of any one or more of the following methods 1 and 2:

[0225] Method 1: The graph computing device obtains the priorities of multiple algorithms according to a configuration instruction, where the configuration instruction is used to indicate the priorities of the multiple algorithms.

[0226] In some possible embodiments, the configuration instruction may carry the importance coefficient of each algorithm, and the graph computing device may obtain the importance coefficient of each algorithm according to the configuration instruction, and obtain the priority of each algorithm according to the importance coefficient of each algorithm. Among them, the priority of the algorithm may be positively correlated with the importance coefficient of the algorithm. The importance coefficient indicates the importance of the algorithm. The larger the importance coefficient, the more important the algorithm is and the more it needs to be scheduled in time. The importance coefficient can be normalized to control the value range in the interval of 0 to 1.

[0227] Method 2: The graph computing device obtains the priorities of multiple algorithms according to the number of iterations of the multiple algorithms.

[0228] The graph computing device can obtain the number of iterations of multiple algorithms, calculate the number of iterations of multiple algorithms, and obtain the priorities of multiple algorithms. Among them, the number of iterations of the algorithm is the number of times the algorithm has been used to calculate the graph, that is, the number of times the algorithm has been currently executed. The number of iterations of the algorithm can be less than or equal to the total number of times the algorithm needs to be calculated. In some possible embodiments, if it is expected that a new task can get results as soon as possible, a value negatively correlated with the number of iterations can be obtained as the priority of the algorithm. Then, since the number of iterations of the new task is small, it can be scheduled with priority and thus executed by the computing unit as soon as possible. In other possible embodiments, if it is expected that an old task that has been executed for a long time can get results as soon as possible, a value positively correlated with the number of iterations can be obtained as the priority of the algorithm. Then, since the number of iterations of the old task is large, it can be scheduled with priority and thus executed as soon as possible.

[0229] As an example, the graph computing device can calculate the importance coefficients of multiple algorithms and the number of iterations of multiple algorithms according to any one or more combinations of the following formulas (1), (2) and (3) to obtain the priorities of multiple algorithms.

[0230] a iA,jG =δ iA,jG * <A,G> *e -t<A,G> ; (1)

[0231] a iA,jG =δ iA,jG * <A,G> *(1-e -t<A,G> ); (2)

[0232] a iA,jG =1; (3)

[0233] Among them, a iA,jG represents the priority of algorithm A in calculating graph G, ρ<A,G> is the importance coefficient of graph G calculated by algorithm A, ρ<A,G> After normalization, ρ<A,G> Greater than 0 and less than or equal to 1, t<A,G> is the number of iterations that algorithm A currently performs on graph G; δ<iA,jG> is the Dirac Delta function. If the computation request indicates that algorithm A is used to compute graph G, then δ<iA,jG> Take 1. If the computation request does not indicate that algorithm A is used to compute graph G, then δ<iA,jG> Take 0, * means multiplication.

[0234] In some possible embodiments, the user can control whether new tasks are scheduled first or old tasks are scheduled first through configuration instructions. Specifically, if the user expects new tasks to be scheduled first, the configuration instruction for instructing the graph computing device to calculate according to formula (1) can be triggered. After the graph computing device receives the configuration instruction, it will obtain the priority of the algorithm according to formula (1), so that the priority of the algorithm is negatively correlated with the number of iterations of the algorithm. If the user expects old tasks to be scheduled first, the configuration instruction for instructing the graph computing device to calculate according to formula (2) can be triggered. After the graph computing device receives the configuration instruction, it will obtain the priority of the algorithm according to formula (2), so that the priority of the algorithm is positively correlated with the number of iterations of the algorithm. In this way, the scenario when the graph is executed by the iterative algorithm is fully considered, and it can be ensured that the definition method of the algorithm priority can be customized by the user to meet the user's needs. In other words, it is beneficial for the system to implement scheduling according to different scheduling goals, so that the system has good configurability.

[0235] Step B: The graph computing device obtains a scheduling solution according to the priority of each algorithm among the multiple algorithms.

[0236] The scheduling scheme is used to indicate the correspondence between at least one target task and at least one target subgraph. For example, the scheduling scheme may include the identifier of at least one target task and the identifier of at least one target subgraph. Each target task is a task in multiple algorithms, the target task is a task currently scheduled among the tasks of multiple algorithms, and the target subgraph is a subgraph currently scheduled among the subgraphs of multiple subgraphs.

[0237] The priority of an algorithm is used to indicate the priority of an algorithm among multiple algorithms. Whenever you need to schedule tasks of multiple algorithms, you can schedule tasks of multiple algorithms with high priority first, and then schedule tasks of multiple algorithms with low priority, so as to control the execution end time of different algorithms and allow algorithms with high priority to complete execution as soon as possible.

[0238] In some possible embodiments, the process of generating a scheduling solution may include the following steps (B.1) to (B.3):

[0239] Step (B.1): The graph computing device generates a first bipartite graph.

[0240] The first bipartite graph is used to indicate the scheduling relationship between the graph and the algorithm, and the first bipartite graph can be regarded as a coarse-grained bipartite graph. The first bipartite graph includes a first vertex, a second vertex, and a first edge. The first vertex represents the graph, the second vertex represents the algorithm, the first edge connects the first vertex and the second vertex, and the first edge indicates that the currently received computing request includes a computing request for requesting to use the algorithm corresponding to the second vertex to compute the graph corresponding to the first vertex.

[0241] For example, see Fig.11 , the first bipartite graph can be Fig.11 In the bipartite graph of the top layer, the first vertex is the inner row of hollow vertices in the bipartite graph of the top layer, the second vertex is the outer row of solid vertices in the bipartite graph of the top layer, and the first edge is the realization in the bipartite graph of the top layer. Fig.11 In the top-level bipartite graph, there are multiple second vertices connected to the same first vertex, which means that a batch of computing requests received by the graph computing device include requests to execute multiple algorithms on the same graph. In this scenario, the computing speed can be improved by concurrently executing multiple algorithms.

[0242] Step (B.2): The graph computing device generates a second bipartite graph based on the first bipartite graph.

[0243] The second bipartite graph is used to indicate the scheduling relationship between the subgraph and the task, and the second bipartite graph can be regarded as a fine-grained bipartite graph. It includes a third vertex, a fourth vertex and a second edge, the third vertex represents the task, the fourth vertex represents the subgraph, and the second edge connects the third vertex and the fourth vertex. Among them, combined with the modality of the subgraph, the second bipartite graph can be used to indicate the scheduling relationship between the subgraph with any modality and the task, and the fourth vertex represents a subgraph of a certain modality. In addition, the second edge can be determined according to the edge of the first bipartite graph. For example, if a batch of calculation requests currently received includes a calculation request for calculating graph j using algorithm i, then the first edge between the first vertex corresponding to algorithm i in the first bipartite graph and the second vertex corresponding to graph j will be connected, and accordingly, the second edge between the third vertex corresponding to each task of algorithm i in the second bipartite graph and the fourth vertex corresponding to each subgraph of graph j will be connected.

[0244] For example, see Fig.11 , the second bipartite graph can be Fig.11 In the bipartite graph of the middle bottom layer, the third vertex is the outer row of solid vertices in the bipartite graph of the bottom layer, the fourth vertex is the inner row of hollow vertices in the bipartite graph of the bottom layer, and the second edge is the solid line in the bipartite graph of the bottom layer.

[0245] In some possible embodiments, the first vertex can be mapped to the fourth vertex according to the correspondence between the graph and the subgraph; the second vertex can be mapped to the third vertex according to the correspondence between the algorithm and the task; the first edge can be mapped to the second edge to obtain a second bipartite graph.

[0246] For example, see Fig.11, the correspondence between the graph and the subgraph and the correspondence between the algorithm and the task can be represented by the hierarchical relationship between the top-level bipartite graph and the bottom-level bipartite graph. Specifically, a correspondence between a graph and a subgraph can be represented by an inner dotted line between the top-level bipartite graph and the bottom-level bipartite graph. For example, the correspondence between graph A and subgraph B can be represented by a dotted line between the inner vertex a in the top-level bipartite graph and the inner vertex b in the bottom-level bipartite graph. A correspondence between an algorithm and a task can be represented by an outer dotted line between the top-level bipartite graph and the bottom-level bipartite graph. For example, the correspondence between algorithm C and task D can be represented by a dotted line between the outer vertex c in the top-level bipartite graph and the outer vertex d in the bottom-level bipartite graph.

[0247] In step (B.3), the graph computing device selects a target edge from the second bipartite graph, and uses the correspondence between the task represented by the target edge and the subgraph as a scheduling solution.

[0248] The process of obtaining a scheduling solution can be modeled as the process of selecting a set of edges from the underlying bipartite graph. Here, the selected edges are referred to as target edges. The third vertex connected to the target edge is the task to be scheduled this time, and the fourth vertex connected to the target edge is the subgraph to be scheduled this time. In some possible embodiments, considering that a task is assigned to at most one subgraph, the same third vertex in a set of target edges is connected to at most one fourth vertex; in addition, a subgraph can be assigned to one or more tasks, so the same fourth vertex in a set of target edges can be connected to one or more third vertices.

[0249] As an example, the process of selecting a target edge may include the following steps (B.3.1) to (B.3.2).

[0250] Step (B.3.1) For each edge in the first bipartite graph, the graph computing device obtains the weight of the edge according to the subgraph and task corresponding to the edge.

[0251] Step (B.3.1) may include any one or a combination of the following methods 1 and 2.

[0252] Method 1: Get the importance coefficient corresponding to the edge, and get the weight of the edge based on the importance coefficient.

[0253] For example, if the first vertex connected by the edge represents graph G, and the second vertex connected by the edge represents algorithm A, the importance coefficient of calculating graph G using algorithm A can be obtained, and the importance coefficient can be operated to obtain the weight, where the weight is positively correlated with the importance coefficient.

[0254] Method 2: Get the number of iterations corresponding to the edge, and get the weight of the edge based on the number of iterations.

[0255] For example, if the first vertex connected by the edge represents the graph G, and the second vertex connected by the edge represents the algorithm A, the number of times the algorithm A has been used to calculate the graph G can be obtained, and the number of iterations can be calculated to obtain the weight.

[0256] It should be noted that method 1 and method 2 can be performed either or in combination. For example, if method 1 and method 2 are combined, the importance coefficient and the number of iterations corresponding to the edge can be obtained, and the importance coefficient and the number of iterations can be calculated to obtain the weight of the edge. For example, any one of the above formulas (1) and (2) can be used to calculate the importance coefficient and the number of iterations.

[0257] In step (B.3.2), the graph computing device selects a target edge from the first bipartite graph according to the weight of each edge in the first bipartite graph, and the weight of the target edge meets a preset condition.

[0258] The preset conditions may include that the sum of weights is the largest among the sum of weights of multiple edges in the second bipartite graph, the sum of weights ranks first by a preset number of digits among the sum of weights of multiple edges in the second bipartite graph, the sum of weights exceeds a threshold, etc.

[0259] In some possible embodiments, the graph computing device may use constraints and a linear programming method to select a target edge. Specifically, the graph computing device may obtain a target function based on the first bipartite graph, and use a linear programming algorithm to calculate the target function based on the constraints to obtain a solution of the target function as the target edge.

[0260] The objective function is used to select a target edge from the first bipartite graph. For example, the objective function may indicate a group of edges with the largest sum of weights. Exemplarily, the objective function may be as shown in the following formula (4).

[0261] max(TrB T X); (4)

[0262] Among them, max means finding the maximum value, Tr means finding the trace of the matrix, B is the transcription of the importance matrix A, B = c + log 2 |A|. c is a constant. B and c can be used for matrix preprocessing technology to obtain numerical calculation benefits. A is the importance coefficient matrix. Each row in A represents a task obtained after algorithm decomposition. Each column in A represents a subgraph of a mode. Each non-zero element in A indicates that the task corresponding to the element and the subgraph corresponding to the element can be assigned together, and the value of the non-zero element is the importance coefficient of executing the task on the subgraph. X is the full permutation matrix (premutation matrix). The role of X is to perform B TThe columns of the matrix are swapped so that the sum of the elements on the diagonal of the swapped matrix is ​​maximized, that is, a set of optimal solutions is found. The corresponding relationship between the tasks and the subgraphs represented by the elements on the diagonal is the selected scheduling solution.

[0263] The constraint condition is used to ensure that different edges in the target edge are not disjoint. For example, the constraint condition can be used to constrain that there is only one 1 in each row and only one 1 in each column of X solved by the above formula (4). As an example, the constraint condition can include the following formula (5), the following formula (6) and the following formula (7), where T represents a transpose operation.

[0264]

[0265]

[0266]

[0267] The linear programming algorithm may be a subgraph matching algorithm of a bipartite graph, for example, an auction algorithm (English: auction algorithm), a Hungarian augmented path algorithm (English: Hungarian augmented path algorithm), etc.

[0268] By running the above linear programming algorithm, we can get X in the above formula (4), where X is a set of non-interconnected edges in the second bipartite graph. X just gives a set of scheduling schemes: the vertex at one end of an edge in the second bipartite graph (representing a task) and the vertex at the other end (representing a subgraph of a certain mode) are scheduled to be executed together.

[0269] Through the above implementation, for multiple algorithms executed on the same graph, their association relationship will be reflected in the first bipartite graph between the coarse-grained algorithm and the graph, and then reflected in the fine-grained second bipartite graph. Therefore, when scheduling is implemented according to the above linear programming-based method, a subgraph of a mode can be processed in parallel by multiple tasks without being repeatedly loaded and exited (evict).

[0270] Step C: The graph computing device executes at least one target task in parallel by loading multiple computing units of at least one target subgraph.

[0271] The graph computing device can determine the target task and target subgraph of this scheduling according to the scheduling scheme, determine the computing unit loaded with the target subgraph, and execute the target task in parallel through these computing units loaded with the target subgraph. In some possible embodiments, after the computing unit completes the parallel execution of the target task, the graph computing device can repeat the above steps A to C, that is, re-acquire the scheduling scheme to obtain the corresponding relationship between the remaining tasks and the subgraphs, so as to allocate the remaining tasks until the tasks of multiple algorithms have been executed.

[0272] See also Fig.12 , which shows an exemplary process of the graph computing method, Fig.12 The branch on the left can be pre-executed offline, including the following steps (1) to (4):

[0273] (1) User edit graph mode information:

[0274] (2) importing raw data based on pattern information and constructing a graph based on the raw data;

[0275] (3) Divide the input graph into multiple subgraphs;

[0276] (4) Persistently store each subgraph of each modality.

[0277] Fig.12 The right branch can be executed in real time while online, including the following steps (5) to (10):

[0278] (5) Receive batch computing requests:

[0279] (6) Generate the first bipartite graph;

[0280] (7) Decompose the algorithm into tasks and load each subgraph of each modality;

[0281] (8) Generate a second bipartite graph based on the tasks and the subgraphs;

[0282] (9) Solve the bipartite graph and obtain the scheduling plan;

[0283] (10) According to the scheduling plan, load the subgraph and execute the task.

[0284] Considering that most algorithms executed on graphs are iterative algorithms, see Fig.12 , the process of calculating the graph using an iterative algorithm can also include the following steps 1 to 3:

[0285] Step 1: The computing unit executes the tasks of the first execution process of the iterative algorithm according to the multiple subgraphs, and obtains the computing results of the first execution process.

[0286] Step 2: The calculation unit determines whether the algorithm has converged.

[0287] As an example, the calculation unit may determine that the iterative algorithm has not converged based on at least one of the calculation result of the first execution process and the number of iterations. For example, the calculation unit may determine whether the number of iterations has reached a preset number of times. If the number of iterations has not reached the preset number of times, the calculation unit determines that the iterative algorithm has not converged. If the number of iterations has reached the preset number of times, the calculation unit determines that the iterative algorithm has converged. For another example, the calculation unit may determine whether the calculation result of the first execution process meets a preset condition. If the calculation result of the first execution process does not meet the preset condition, the calculation unit determines that the iterative algorithm has not converged.

[0288] Step 3: If the iterative algorithm does not converge, the computing unit executes the tasks of the second execution process of the iterative algorithm according to the multiple subgraphs and the calculation results of the first execution process to obtain the calculation results of the second execution process.

[0289] Afterwards, the computing unit can re-judge whether the iterative algorithm has converged. If the iterative algorithm has not converged, the third execution process of the iterative algorithm is executed according to the calculation results of the multiple subgraphs and the second execution process, and so on, until the iterative algorithm converges. The calculation results of this execution process can be output, for example, the calculation results of this execution process are visualized to present the calculation results of this execution process.

[0290] In some possible embodiments, see Fig.12 For the algorithms that have not converged among the multiple algorithms, the tasks of the algorithms that have not converged can be obtained as the remaining tasks, so as to dynamically generate new tasks. If the next computing request is received, the tasks of the algorithms requested in the next computing request can be obtained, and these new tasks can be executed concurrently with the remaining tasks until there are no new computing requests to be processed.

[0291] In some possible embodiments, when multiple computing units execute multiple algorithms in parallel, the graph computing device may expand the capacity of the multiple computing units so that the algorithms can be executed by more computing units. Specifically, the expansion process is detailed in the following steps 1 to 8.

[0292] Step 1: The graph computing device sends an expansion request to the terminal.

[0293] The capacity expansion request is used to request the expansion of multiple computing units. In some possible embodiments, the capacity expansion request may include at least one of the number of computing units to be added and the capacity expansion fee, where the capacity expansion fee is the fee that the user has to pay for the newly added computing units. For example, if it costs n to rent a computing unit per unit time, and m computing units are currently to be added, the capacity expansion request may include the number m of computing units to be added and the capacity expansion fee (m*n), where m is a positive integer and n is a positive number.

[0294] In some possible embodiments, the graph computing device may generate a capacity expansion request and send the capacity expansion request to the terminal when the computing capacity of multiple computing units does not meet the demand. For example, the computing request sent by the terminal to the graph computing device may include an expected duration, which is the duration that the user expects multiple computing units to complete the graph calculation. The graph computing device may determine whether the multiple computing units can complete the graph calculation within the expected duration. If the multiple computing units cannot complete the graph calculation within the expected duration, the graph computing device may generate a capacity expansion request. For another example, the graph computing device may monitor the load of each computing unit and determine in real time whether the load of each computing device exceeds a threshold. When the load of one or more computing units exceeds the threshold, the graph computing device may generate a capacity expansion request. For another example, multiple computing units may monitor whether their own load exceeds a threshold. If their own load exceeds the threshold, multiple computing units send a notification message to the graph computing device. After the graph computing device receives the notification message from one or more computing units, the graph computing device may generate a capacity expansion request. For example, the graph computing device can determine whether the total amount of data that can be calculated by multiple computing units is greater than the data amount of the graph based on the data amount of the graph and the specifications of each computing unit. If the total amount of data that can be calculated by multiple computing units is less than or equal to the data amount of the graph, the graph computing device can generate an expansion request.

[0295] Step 2: The terminal receives a request for expansion from the graph computing device and displays a prompt message.

[0296] The prompt information is used to prompt the user whether to expand the capacity of the multiple computing units. In some possible embodiments, the prompt information may also include at least one of the number of computing units to be added and the expansion fee.

[0297] Step three: The terminal receives the confirmation instruction, generates an expansion instruction, and sends the expansion instruction to the graph computing device. The expansion instruction is used to instruct to expand the capacity of multiple computing units.

[0298] The confirmation instruction is used to indicate confirmation of expanding the capacity of multiple computing units, and the confirmation instruction can be triggered by a confirmation operation performed by the user on the terminal. As an example, the prompt information displayed by the terminal may include a confirmation option, and if the user triggers a click operation on the confirmation option, the terminal receives the confirmation instruction.

[0299] Step 4: The graph computing device receives the capacity expansion instruction from the terminal.

[0300] In some possible embodiments, after receiving the confirmation instruction, the terminal may send a payment request to the financial server, where the payment request includes the capacity expansion fee, the identifier of the user account, and the identifier of the merchant account corresponding to the graph computing device. After receiving the payment request, the financial server will obtain the identifier of the user account and the identifier of the merchant account from the payment request, deduct the capacity expansion fee from the user account, and add the capacity expansion fee to the merchant account. After the deduction is successful, the financial server may send a payment success message to the terminal. After receiving the payment success message, the terminal sends a capacity expansion instruction to the graph computing device. After the graph computing device receives the capacity expansion instruction, it executes the following step five. Alternatively, the financial server may send a payment success message to the graph computing device. After the graph computing device receives the payment success message and the capacity expansion instruction, it executes the following step five.

[0301] It should be noted that the above description is only based on the example that the graph computing device and the financial server are two separate devices. In other possible embodiments, the graph computing device and the financial server can be integrated together, and the integrated device has both the graph computing function and the online transaction function. In this implementation, the integrated device can pre-store the merchant account identification. After the terminal receives the confirmation instruction, it can send a payment request to the integrated device. After receiving the payment request, the integrated device will deduct the expansion fee from the user account and add the expansion fee to the merchant account. After the deduction is successful, the integrated device can execute the following step five.

[0302] Step 5: The graph computing device creates at least one computing unit.

[0303] Step six: The graph computing device copies at least one subgraph of the graph to obtain an instance of at least one subgraph.

[0304] Among them, the instance of a subgraph is a copy of the subgraph, and the instance of a subgraph can be the same as the subgraph.

[0305] Step 7: The graph computing device loads at least one instance of the subgraph into at least one created computing unit.

[0306] Step seven is the same as the above step 602 and will not be described in detail here.

[0307] Step 8: The graph computing device executes multiple algorithms in parallel through the at least one created computing unit.

[0308] Step eight is the same as the above step 603 and will not be described in detail here.

[0309] In some possible embodiments, the graph computing device can count the number of times each subgraph in the graph is requested by multiple algorithms, determine whether the number of requests for each subgraph reaches a threshold, copy the subgraph in the graph whose number of requests reaches the threshold, obtain instances of the subgraph whose number of requests reaches the threshold, load these subgraph instances into the expanded target computing unit, and execute multiple algorithms in parallel on these subgraph instances by the target computing unit. The number of requests is the sum of the number of times multiple algorithms request the subgraph.

[0310] Through this implementation, considering that the number of accesses that a single graph can support has a physical upper limit, if the number of accesses to the graph exceeds the physical upper limit, it is likely that the graph cannot support the parallel execution of multiple algorithms, which will cause a bottleneck in the execution process of the graph algorithm. For example, if a subgraph is a hot subgraph, for example, the subgraph contains celebrity information, and a large number of users may access the subgraph to query celebrity information at the same time, then the subgraph may not be able to support being scheduled by multiple tasks at the same time, and it is also impossible to execute multiple algorithms in parallel, resulting in a limitation on the overall speed of graph calculation. In the above implementation, the graph computing device can sense the number of requests for each subgraph. If the number of requests for a subgraph exceeds the threshold, it indicates that the demand for the subgraph is very large and it is likely to be a hot subgraph. Then, by triggering the subgraph to be copied into multiple copies and deploying them on different computing units, the subgraph is processed by multiple computing units, which can improve the processing efficiency of the subgraph. That is, by allowing concurrent computing requests to be diverted to different instances for computing, concurrency is linearly expanded.

[0311] In some possible embodiments, during the parallel execution of multiple algorithms, multiple subgraphs may be write-protected. As an example, the write-protection method includes but is not limited to any one or a combination of multiple of the following methods 1 to 3:

[0312] Method 1 (locking): When any task of any algorithm writes to any subgraph, the computing unit can lock the subgraph. During the execution of the task, other tasks except the task cannot write to the subgraph. When the algorithm task finishes writing to the subgraph, the computing unit can release the lock. By executing method 1, on the one hand, it can ensure that the writing steps executed on the subgraph are executed serially, and on the other hand, this method is relatively simple to implement and manage.

[0313] Method 2 (multi-version concurrency control (MVCC)). The computing unit can cache the full state of each subgraph in multiple subgraphs; for example, the current state, historical state, and transition state of the subgraph can be stored. By executing method 2, it is beneficial to perform write operations simultaneously.

[0314] Method three: For any subgraph among multiple subgraphs, a target instance can be selected from multiple instances of the subgraph, and the target instance can be regarded as the preferred instance among multiple instances. When a write instruction is received for any instance of the subgraph, data can be written to the target instance first according to the write instruction. When the writing is completed, the target instance is synchronized with other instances other than the target instance in the multiple instances, thereby achieving data consistency of all instances of the subgraph. Optionally, when a write instruction is received for any instance, the distribution task can be terminated and can only be resumed after all instances complete the write operation, thereby achieving stricter consistency.

[0315] Through the above implementation, the probability of data conflict occurring when multiple tasks share the same subgraph can be reduced, and the robustness of the system when the distributed computing unit executes multiple tasks in parallel can be ensured.

[0316] In some possible embodiments, the graph computing device may create a cache space for each task of each algorithm. When any intermediate result of the task is obtained, the graph computing device may cache the intermediate result in the cache space. When the task is executed, the cache space may be released.

[0317] The method provided in this embodiment provides a method that can support the concurrent execution of graph calculations by multiple algorithms. By loading multiple subgraphs of a graph into multiple computing units, multiple algorithms are executed in parallel through multiple computing units. The same graph can be shared among multiple algorithms, thereby executing multiple algorithms in parallel on the same graph, saving the delay caused by waiting for the completion of execution of other algorithms when executing a certain algorithm, thereby improving the overall efficiency of graph calculations by multiple algorithms and shortening the overall time for graph calculations by multiple algorithms.

[0318] The present application also provides a graph computing device 1300. Fig.13 As shown, the graph computing device 1300 includes a receiving unit 1301 , a loading unit 1302 and multiple computing units 1303 .

[0319] The receiving unit 1301 is used to execute step 601. The loading unit 1302 is used to execute step 602. The plurality of calculating units 1303 are used to execute step 603.

[0320] In one possible implementation, multiple computing units 1303 include: an acquisition module, used to execute step one in step 603, for example, it can be used to execute any one or a combination of multiple methods one to nine in step one in step 603 to divide the algorithm into multiple tasks; an execution module, used to execute step two in step 603.

[0321] In a possible implementation, the loading unit 1302 is used to load multiple subgraphs of at least one modality into multiple computing units; the execution module is used to execute a task according to the subgraph of the target modality;

[0322] In a possible implementation, the execution module is used to execute steps A to C in step 603 .

[0323] In a possible implementation, the plurality of computing units 1303 are also used to execute parts other than the loading step in the algorithm.

[0324] In a possible implementation, the plurality of computing units 1303 are also used to execute parts other than the release step in the algorithm.

[0325] In a possible implementation, the device also includes: a partitioning unit for partitioning a graph; a storage unit for storing multiple subgraphs into a graph storage device; and a loading unit 1302 for loading multiple subgraphs of the graph from the graph storage device to multiple computing units.

[0326] In a possible implementation, the partitioning unit is used to partition the graph according to the number of the plurality of computing units 1303 .

[0327] In one possible implementation, the device also includes a sending unit for sending an expansion request; a receiving unit for receiving an expansion instruction; a creating unit for creating at least one computing unit; a copying unit for copying at least one subgraph of the graph; a loading unit 1302 for loading an instance of at least one subgraph into the at least one created computing unit; and the at least one created computing unit is used to execute multiple algorithms in parallel.

[0328] The graph computing device 1300 can be provided to users as a cloud computing service, for example, as a graph engine service. Figure 1 As shown, the graph computing device 1300 (or part of it) is deployed in a cloud environment. After the user triggers a computing request through a terminal, the graph computing device 1300 is started to execute multiple algorithms on the graph, and the calculation results can be provided to the user.

[0329] One thing that needs to be explained is that Fig.13 When the graph computing device provided in the embodiment performs graph computing, only the division of the above-mentioned units and modules is used as an example. In practical applications, the above-mentioned functions can be assigned to different units and modules as needed, that is, the internal structure of the graph computing device is divided into different units and modules to complete all or part of the functions described above. In addition, the graph computing device provided in the above embodiment and the graph computing method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0330] The present application also provides a graph computing device 1400. Fig.14 As shown, the graph computing device 1400 includes multiple computing units 1410, each computing unit 1410 includes a processor 1411, a memory 1412, a transceiver 1413 and a bus 1414, and the processor 1411, the memory 1412, and the transceiver 1413 communicate with each other through the bus 1414.

[0331] Among them, the processor can be a central processing unit (CPU). The memory can include a volatile memory (volatile memory), such as a random access memory (RAM). The memory can also include a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory, a HDD or a SSD. The memory stores executable code, and the processor executes the executable code to execute the aforementioned graph calculation method. The memory can also include other software modules required for running processes such as an operating system. The operating system can be LINUX. TM ,UNIX TM ,WINDOWS TM wait.

[0332] The memory 1412 of each computing unit 1410 of the graph computing device 1400 stores codes corresponding to the various units of the graph computing device 1300. The processor 1411 executes these codes to implement the functions of the various units of the graph computing device 1300, that is, to execute Figure 6 The embodiment provides a graph calculation method.

[0333] The graph computing device 1400 can be deployed in a cloud environment. Multiple computing units 1410 in the graph computing device 1400 can form a distributed system. Different computing units 1410 can communicate through a wired or wireless network.

[0334] The present application also provides a graph computing device 1500. Fig.15 As shown, the graph computing device 1500 includes a plurality of computing units 1510, a transceiver 1511, and a bus 1512;

[0335] Each computing unit 1510 includes a processor 1521 and a memory 1522 ; the processor 1521 may be the same as the processor 1411 , and the memory 1522 may be the same as the memory 1412 , which will not be elaborated herein.

[0336] The multiple computing units 1510 in the computing device 1500 can be deployed in a single machine, and different computing units 1510 can communicate through a bus 1512.

[0337] This application also proposes a graph computing system, such as Fig.16 As shown in the figure, the computing system includes Fig.14 On the basis of the graph computing device 1400 shown in the embodiment, a graph storage device 1600 is also included, and the graph storage device 1600 is used to store multiple subgraphs of the graph. In some possible embodiments, the graph storage device 1600 can be provided to users as a cloud storage service, and users can apply for a certain capacity of storage space in the cloud storage service to store multiple subgraphs of the graph in the storage space. When the graph computing device 1400 is running, the required multiple subgraphs are loaded from the graph storage device 1600 through the communication network.

[0338] As a possible product form, the graph computing device of the embodiment of the present application can be implemented by a general-purpose processor. The general-purpose processor includes a processing circuit and an input interface connected and communicating with the internal processing circuit, the input interface is used to receive at least one computing request; the processing circuit is used to execute the above-mentioned graph computing method. Optionally, the general-purpose processor may also include a storage medium, the storage medium is used to store instructions executed by the processing circuit.

[0339] As a possible product form, the graph computing device of the embodiment of the present application can also be implemented using the following: one or more field programmable gate arrays (FPGA), programmable logic devices (PLD), controllers, state machines, gate logic, discrete hardware components, any other suitable circuits, or any combination of circuits that can perform the various functions described throughout the present application.

[0340] In some possible embodiments, the present application further provides a computer program product, and when the computer program product is executed by a graph computing device, the graph computing device executes the above-mentioned graph computing method. The computer program product may be a software installation package, and when the above-mentioned graph computing method is needed, the computer program product may be downloaded and executed on the graph computing device.

[0341] The descriptions of the processes corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process, please refer to the relevant descriptions of other processes.

[0342] Those of ordinary skill in the art will appreciate that the various method steps and units described in the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0343] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0344] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0345] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0346] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0347] If the integrated 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0348] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. Available media can be magnetic media, (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., SSD), etc.

[0349] It should be understood that the above-mentioned various product forms of the graph computing device respectively have the above-mentioned Figure 6 Any functions of the calculation method in the figure in the method embodiment will not be repeated here.

[0350] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A graph computing method, characterized in that: The method comprises: receiving at least one computing request, wherein the at least one computing request is used to request to use multiple algorithms to compute a graph, wherein the graph is a data structure including at least one vertex and at least one edge; Loading multiple subgraphs of at least one mode of the graph into the memory of each computing unit of the multiple computing units, the at least one mode comprising an in-edge mode and an out-edge mode, the in-edge mode is used to indicate an in-edge relationship between different vertices in the subgraph, and the out-edge mode is used to indicate an out-edge relationship between different vertices in the subgraph; Obtain at least one task in each algorithm, wherein the at least one task includes a collection task and a distribution task, The at least one task is a part of the algorithm except a loading step and / or a releasing step, wherein the loading step is a step of loading the graph into a memory of a computing unit, and the releasing step is a step of releasing the graph from the memory of a computing unit; Through the multiple computing units, the collection tasks of the multiple algorithms are executed in parallel according to the same subgraph of the incoming edge mode, and the distribution tasks of the multiple algorithms are executed in parallel according to the same subgraph of the outgoing edge mode.

2. The method according to claim 1, characterized in that: The obtaining of at least one task in each algorithm includes at least one of the following: According to the function name corresponding to each step in the algorithm, dividing at least one step corresponding to the same function name in the algorithm into a task; According to the execution subject of each step in the algorithm, the steps with the same execution subject in the algorithm are divided into one task; According to the order in which each step in the algorithm accesses the vertices or edges in the graph, the steps in the algorithm with the same access order are divided into one task; According to the vertices or edges visited in the graph by each step in the algorithm, the steps with the same vertices or edges visited in the algorithm are divided into one task; According to the action performed by each step in the algorithm, the steps with the same action in the algorithm are divided into a task; According to the iterative process to which each step in the algorithm belongs, dividing the steps in the algorithm belonging to the same iterative process into one task; According to the judgment branch to which each step in the algorithm belongs, the steps in the algorithm belonging to the same judgment branch are divided into one task.

3. The method according to claim 1, characterized in that The tasks in the multiple algorithms include the steps of searching from a first vertex in the graph to a second vertex in the graph, the second vertex in the subgraph of the target modality is arranged before the first vertex, and the target modality is a modality among the at least one modality that matches the task.

4. The method according to claim 1, characterized in that: The method further comprises: Obtaining priorities of the multiple algorithms according to the number of iterations of the multiple algorithms; According to the priority of each algorithm, a scheduling scheme is obtained, where the scheduling scheme is used to indicate a corresponding relationship between at least one target task and at least one target subgraph, where the target task is a task currently scheduled among the tasks of the multiple algorithms, and the target subgraph is a subgraph currently scheduled among the subgraphs of the multiple subgraphs; The at least one target task is executed in parallel by a plurality of computing units loaded with the at least one target subgraph.

5. The method according to claim 1, characterized in that The method further comprises: Sending a capacity expansion request, where the capacity expansion request is used to request capacity expansion of the multiple computing units; receiving a capacity expansion instruction, wherein the capacity expansion instruction is used to instruct to expand the capacity of the plurality of computing units; creating at least one computational unit; Copying at least one subgraph of the graph to obtain at least one instance of the subgraph; loading an instance of the at least one subgraph into the created at least one computational unit; The plurality of algorithms are executed in parallel by means of the created at least one computing unit.

6. The method according to claim 5, characterized in that The copying of at least one subgraph of the graph comprises: Counting the number of times each subgraph in the graph is requested by the multiple algorithms; The subgraphs in the graph whose request times reach a threshold are copied.

7. A graph computing device, characterized in that: include: A receiving unit, configured to receive at least one computing request, wherein the at least one computing request is used to request to use multiple algorithms to compute a graph, wherein the graph is a data structure including at least one vertex and at least one edge; A loading unit, configured to load a plurality of subgraphs of at least one mode of the graph into a memory of each computing unit among the plurality of computing units, wherein the at least one mode comprises an in-edge mode and an out-edge mode, wherein the in-edge mode is used to indicate an in-edge relationship between different vertices in the subgraph, and the out-edge mode is used to indicate an out-edge relationship between different vertices in the subgraph; The plurality of computing units include: an acquisition module, used for acquiring at least one task in each algorithm, wherein the at least one task includes a collection task and a distribution task, and the at least one task is a part of the algorithm except a loading step and / or a releasing step, wherein the loading step is a step of loading the graph into a memory of a computing unit, and the releasing step is a step of releasing the graph from the memory of the computing unit; An execution module is used to execute the collection tasks of the multiple algorithms in parallel according to the same subgraph of the incoming edge mode through the multiple computing units, and to execute the distribution tasks of the multiple algorithms in parallel according to the same subgraph of the outgoing edge mode.

8. The device according to claim 7, characterized in that The acquisition module is further configured to perform at least one of the following: According to the function name corresponding to each step in the algorithm, dividing at least one step corresponding to the same function name in the algorithm into a task; According to the execution subject of each step in the algorithm, the steps with the same execution subject in the algorithm are divided into one task; According to the order in which each step in the algorithm accesses the vertices or edges in the graph, the steps in the algorithm with the same access order are divided into one task; According to the vertices or edges visited in the graph by each step in the algorithm, the steps with the same vertices or edges visited in the algorithm are divided into one task; According to the action performed by each step in the algorithm, the steps with the same action in the algorithm are divided into a task; According to the iterative process to which each step in the algorithm belongs, dividing the steps in the algorithm belonging to the same iterative process into one task; According to the judgment branch to which each step in the algorithm belongs, the steps in the algorithm belonging to the same judgment branch are divided into one task.

9. The device according to claim 7, characterized in that The tasks in the multiple algorithms include the steps of searching from a first vertex in the graph to a second vertex in the graph, the second vertex in the subgraph of the target modality is arranged before the first vertex, and the target modality is a modality among the at least one modality that matches the task.

10. The device according to claim 7, characterized in that The execution module is further used to obtain the priorities of the multiple algorithms according to the number of iterations of the multiple algorithms; and obtain a scheduling scheme according to the priority of each algorithm, wherein the scheduling scheme is used to indicate the corresponding relationship between at least one target task and at least one target subgraph, wherein the target task is a task currently scheduled among the tasks of the multiple algorithms, and the target subgraph is a subgraph currently scheduled among the subgraphs of the multiple subgraphs; The at least one target task is executed in parallel by a plurality of computing units loaded with the at least one target subgraph.

11. The device according to claim 7, characterized in that The device also includes: A sending unit, used to send a capacity expansion request, where the capacity expansion request is used to request to expand the multiple computing units; The receiving unit is further used to receive a capacity expansion instruction, where the capacity expansion instruction is used to instruct to expand the multiple computing units; A creation unit, used to create at least one computing unit; a copying unit, configured to copy at least one subgraph of the graph to obtain an instance of at least one subgraph; The loading unit is further used to load the instance of the at least one subgraph into the created at least one computing unit; The at least one created computing unit is used to execute the multiple algorithms in parallel.

12. The device according to claim 11, characterized in that The replication unit is used to count the number of times each subgraph in the graph is requested by the multiple algorithms; and replicate the subgraph in the graph whose request number reaches a threshold.

13. A graph computing device, characterized in that: The method comprises a plurality of computing units, each of which comprises a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method according to any one of claims 1 to 6.

14. A graph computing system, characterized in that: It includes a graph computing device and a graph storage device; The graph computing device includes a plurality of computing units; The graph storage device is used to store multiple subgraphs of a graph, wherein the graph is a data structure including at least one vertex and at least one edge; The graph computing device is used to load the multiple subgraphs from the graph storage device to the memory of the multiple computing units to execute any method described in claims 1 to 6.

15. A non-transitory readable storage medium, characterized in that: When the non-transitory readable storage medium is executed by a graph computing device, the graph computing device executes any one of the methods of claims 1 to 6.