Joint query method, device and equipment across graph database cluster and storage medium

By generating and transmitting execution plans and query results across graph database cluster systems, the problem of low efficiency in cross-cluster queries is solved, enabling efficient cross-cluster queries and computations while ensuring data security and resource utilization.

CN115827686BActive Publication Date: 2026-03-20HENAN XINGHUAN ZHONGZHI INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In cross-graph database cluster systems, data cannot be directly copied or transmitted due to physical distribution and security requirements, resulting in low efficiency for cross-cluster queries.

Method used

The system obtains the query statement from the initiating graph database cluster, generates an execution plan, encrypts it, and sends it to the participating graph database clusters. The participating graph database clusters decrypt and execute the query task, and finally return the result to the initiating graph database cluster. Only the execution plan and query result are transmitted, not the data itself.

Benefits of technology

It improves the query and computation efficiency of cross-graph database clusters, reduces network load, and ensures data security and full utilization of system resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115827686B_ABST
    Figure CN115827686B_ABST
Patent Text Reader

Abstract

The application discloses a kind of joint query method, device and equipment across graph database cluster and storage medium, the method includes: obtaining query statement by initiator graph database cluster, and generating execution plan according to query statement;Execution plan includes multiple serial sub-execution plans;Execution plan is sent to participant graph database cluster;Participant graph database cluster is at least one cluster in multiple graph database clusters;Initiator graph database cluster and participant graph database cluster execute corresponding query task according to execution plan, and participant graph database cluster returns query result to initiator graph database cluster.The embodiment of the present application effectively realizes the joint query of safe cross graph database cluster, while reducing the load required to be borne by network link, thereby improving the task query, calculation efficiency of cross graph database cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of database, and particularly relate to a cross-graph database cluster joint query method and device, equipment and storage medium. BACKGROUND

[0002] When designing and deploying a large data system composed of multiple attribute graph database clusters, data can be stored in different clusters, and each cluster processes corresponding business in the respective cluster. Each cluster is physically independent of each other and can be placed in different physical space locations. Communication between clusters is transmitted through network link information. At the same time, the data stored on each cluster can have cross-cluster association. Although these data are logically connected, due to physical distribution and security requirements, these data cannot appear in other clusters in the form of replication, direct access, cross-cluster transmission, etc. SUMMARY

[0003] Embodiments of the present application provide a cross-graph database cluster joint query method, device, equipment and storage medium, which can perform cross-graph database cluster joint query while ensuring data security.

[0004] In a first aspect, embodiments of the present application provide a cross-graph database cluster joint query method, comprising: an initiator graph database cluster obtains a query statement and generates an execution plan according to the query statement; the execution plan includes multiple serial sub-execution plans; the initiator graph database cluster is any one of multiple graph database clusters; the execution plan is sent to a participant graph database cluster; the participant graph database cluster is at least one of the multiple graph database clusters; the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, and the participant graph database cluster returns the query result to the initiator graph database cluster.

[0005] In a second aspect, the embodiments of the present application further provide a joint query device across graph database clusters, comprising: a query statement acquisition module, configured to acquire a query statement by an initiator graph database cluster, and generate an execution plan according to the query statement; the execution plan comprises a plurality of serial sub-execution plans; the initiator graph database cluster is any one of a plurality of graph database clusters; an execution plan sending module, configured to send the execution plan to a participant graph database cluster; the participant graph database cluster is at least one of the plurality of graph database clusters; an execution plan execution module, configured to execute corresponding query tasks according to the execution plan by the initiator graph database cluster and the participant graph database cluster, and return query results to the initiator graph database cluster by the participant graph database cluster.

[0006] In a third aspect, the embodiments of the present application further provide an electronic device, comprising:

[0007] at least one processor; and

[0008] a memory connected with the at least one processor in communication; wherein,

[0009] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the joint query method across graph database clusters according to any one of the embodiments of the present application.

[0010] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores computer instructions for enabling a processor to implement the joint query method across graph database clusters according to any one of the embodiments of the present application when the processor executes the computer instructions.

[0011] The technical scheme of the embodiment is that the initiator graph database cluster obtains a query statement, and generates an execution plan according to the query statement; the execution plan comprises a plurality of serial sub-execution plans; the initiator graph database cluster is any one of the plurality of graph database clusters; the execution plan is sent to a participant graph database cluster; the participant graph database cluster is at least one of the plurality of graph database clusters; the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, and the participant graph database cluster returns a query result to the initiator graph database cluster. According to the method, the execution plan is sent to at least one participant graph database cluster, the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, the joint query across the graph database clusters is effectively implemented, in the cross-cluster transmission process, only the transmission of the execution plan and the query result is involved, the specific query data is not involved, the load required to be borne by the network link is reduced, and the task query and calculation efficiency across the graph database clusters are improved. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 A flowchart of a joint query method across graph database clusters provided by the embodiment of the application;

[0013] Figure 2 A joint query method across graph database clusters provided by the embodiment of the application;

[0014] Figure 3 A joint query method across graph database clusters provided by the embodiment of the application;

[0015] Figure 4 A joint query method across graph database clusters provided by the embodiment of the application;

[0016] Figure 5 A structure schematic diagram of a joint query device across graph database clusters provided by the embodiment of the application;

[0017] Figure 6 A structure schematic diagram of an electronic device for implementing the embodiment of the application. DETAILED DESCRIPTION

[0018] The application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the application, and not to limit the application. In addition, it should be noted that, for the convenience of description, only the parts related to the application are shown in the drawings, not all structures.

[0019] Figure 1A flowchart of a cross-graph database cluster joint query method provided by the embodiment of the present application, the embodiment can be applicable to the case of cross-graph database cluster joint query, the method can be executed by a cross-graph database cluster joint query device, the device can be realized in the form of software and / or hardware, and optionally, realized by an electronic device, which can be a mobile terminal, a PC terminal or a server, etc. Specifically, the method comprises the following steps:

[0020] In S110, the initiator graph database cluster obtains a query statement and generates an execution plan according to the query statement.

[0021] The initiator graph database cluster is any one of the plurality of graph database clusters. The plurality of graph database clusters form a large data system. The same kind of graph database is deployed in each graph database cluster. The graph database used can be any kind of graph database. It should be noted that the initiator graph database cluster can also be a third-party secure and trusted graph database, so as to improve the flexibility of the technical solution of the present application. The third-party secure and trusted graph database is different from the large data system in which the graph database cluster is located. The query statement can be any query statement, for example, it can be "match (vertex a)-[edge f]->(vertex b)-[edge g]->(c) where uid (vertex a) = "xyzzy" return c.name". Wherein, "->" can be understood as the arrow (pointing) of the edge. The execution plan can be understood as the specific execution step corresponding to the query statement. The execution plan comprises a plurality of serial sub-execution plans, which can be understood as vertex query plans or edge query plans.

[0022] In the embodiment, the query statement is obtained by the initiator graph database cluster, and the execution plan is generated according to the query statement, so that the subsequent participating graph database cluster can execute the corresponding query task according to the execution plan.

[0023] Optionally, before the initiator graph database cluster obtains the query statement, it further comprises: the initiator graph database cluster sends first joint query configuration parameters to each participating graph database cluster; the first joint query configuration parameters comprise first encryption parameters, first decryption parameters and graph name parameters; each participating graph database cluster receives the first joint query configuration parameters and configures according to the first joint query configuration parameters; the participating graph database cluster sends second joint query configuration parameters to each cluster; each cluster receives the second joint configuration parameters and configures according to the second joint configuration parameters; the second joint query configuration parameters comprise second encryption parameters and second decryption parameters.

[0024] The first encryption parameter and the first decryption parameter can be a pair of encryption and decryption parameters (algorithms), and the embodiment does not limit specific encryption and decryption parameters (algorithms). For example, the encryption and decryption parameters can be symmetric encryption algorithms, asymmetric encryption algorithms, etc. The graph name parameter can be understood as the name of a graph database graph in a graph database cluster, and the graph database includes one or more graphs. The graph name parameter can include one or more graph names.

[0025] In the embodiment, all clusters can send joint query configuration parameters to other clusters, and other clusters receive the joint query configuration parameters and perform corresponding configuration. Specifically, the initiator graph database cluster sends the first joint query configuration parameter to each participant graph database cluster, each participant graph database cluster receives the first joint query configuration parameter, and each participant graph database cluster performs configuration in the corresponding configuration file according to the first joint query configuration parameter. After the initiator graph database cluster sends the encrypted data file to each participant graph database cluster, each participant graph database cluster can perform decryption according to the first joint configuration parameter, and the graph name parameter corresponding to the graph in each participant graph database cluster can execute the decrypted data file. The participant graph database cluster sends the second joint query configuration parameter to the initiator graph database cluster and the remaining participant graph database clusters; the initiator graph database cluster and the remaining participant graph database clusters receive the second joint configuration parameter, and perform configuration in the corresponding configuration file according to the second joint configuration parameter, so that the initiator graph database cluster and the remaining participant graph database clusters can perform decryption according to the second joint configuration parameter after the participant graph database cluster sends the encrypted data file to the initiator graph database cluster and the remaining participant graph database clusters. It should be noted that for the graph name parameter, the graph name parameter can be encrypted according to the first encryption parameter, the initiator graph database cluster sends the encrypted graph name parameter to each participant graph database cluster, and each participant graph database cluster decrypts the encrypted graph name parameter according to the first decryption parameter after receiving the encrypted graph name parameter to obtain the decrypted graph name parameter, thereby ensuring the security of the graph name parameter in the transmission process. In addition, the subsequent execution plan and cross-cluster plan can be encrypted into a data file for transmission. For the sending of the graph name parameter, the graph name parameter can be sent to the participant graph database cluster together with the execution plan, or the first encryption parameter and the first decryption parameter can be sent to the participant graph database cluster before the execution plan is sent.

[0026] S120, sending the execution plan to the participant graph database cluster.

[0027] The participant graph database cluster is at least one of a plurality of graph database clusters. In this embodiment, the encrypted execution plan is sent to the participant graph database cluster, the participant graph database cluster receives the encrypted execution plan and decrypts it, so that the participant graph database cluster performs a query of a related task according to the decrypted execution plan.

[0028] Optionally, the execution plan is sent to the participant graph database cluster in the following manner: the initiator graph database cluster encrypts the execution plan according to the first encryption parameter and sends the encrypted execution plan to each participant graph database cluster; and each participant graph database cluster decrypts the encrypted execution plan according to the first decryption parameter to obtain the decrypted execution plan.

[0029] In this embodiment, the initiator graph database cluster encrypts the execution plan before sending it to each participant graph database cluster, sends the encrypted execution plan to the participant graph database cluster, each participant graph database cluster decrypts the encrypted execution plan to obtain the decrypted execution plan, and the graph corresponding to the graph name parameter in each participant graph database cluster performs a corresponding query task according to the decrypted execution plan, thereby realizing the security of the execution plan during cross-cluster transmission.

[0030] S130, the initiator graph database cluster and the participant graph database cluster perform a corresponding query task according to the execution plan, and the participant graph database cluster returns the query result to the initiator graph database cluster.

[0031] In this embodiment, the initiator graph database cluster and the participant graph database cluster perform a corresponding query task according to the execution plan, during the execution, the initiator graph database cluster and / or the participant graph database cluster generates a cross-cluster plan according to the cross-cluster association relationship and sends it to the cluster (the initiator graph database cluster and / or the participant graph database cluster) having the cross-cluster association relationship, each cluster performs a corresponding query task according to the execution plan and the cross-cluster plan, the participant graph database cluster returns the query result to the initiator graph database cluster after performing the execution plan and the cross-cluster plan in the cluster, the initiator graph database cluster integrates the query result of the execution plan and the cross-cluster plan in the cluster with the query result returned by each participant graph database cluster, and outputs the integrated query result.

[0032] Optionally, the initiator graph database cluster and the participant graph database cluster can execute the corresponding query task according to the execution plan in the following manner: the initiator graph database cluster executes according to the execution plan; in the process of execution, the initiator graph database cluster generates a first cross-cluster plan according to the current execution result, and sends the first cross-cluster plan to the participant graph database cluster, and the participant graph database cluster executes the corresponding sub-execution plan according to the first cross-cluster plan; and / or, the participant graph database cluster executes according to the execution plan; in the process of execution, the participant graph database cluster generates a second cross-cluster plan according to the respective current execution result, and sends the second cross-cluster plan to the other cluster, and the other cluster executes the corresponding sub-execution plan according to the second cross-cluster plan.

[0033] In the present embodiment, the cross-cluster plan can be understood as containing the execution notification information of the sub-execution plan corresponding to the execution plan and the current result data or data file required by the participant graph database cluster, for each cluster to execute the sub-execution plan corresponding to the execution plan in the cluster according to the cross-cluster plan.

[0034] In the present embodiment, the initiator graph database cluster and the participant graph database cluster can execute the query task in the following manner: after the initiator graph database cluster executes a part of the sub-execution plan according to the execution plan, if it is determined according to the intermediate result of executing the sub-execution plan that the next sub-execution plan needs the cooperation of other clusters for execution, i.e., there is a cross-cluster association relationship, then the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, i.e., the first cross-cluster plan (not containing the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to the participant graph database cluster, and the participant graph database cluster executes the sub-execution plan (sub-query task) corresponding to the execution plan according to the first cross-cluster plan. In the present embodiment, the cross-cluster association relationship and the cross-cluster plan can be understood according to the following example: if there are three vertices a, b, and c, the directed edges include a->b (edge f) and b->c (edge g), and when executing the vertices corresponding to the endpoints of all directed edges, b and c exist in different clusters, such as b is stored in the initiator graph database cluster and c is stored in the participant graph database cluster, then there is a cross-cluster relationship between the sub-query tasks corresponding to the sub-execution plan. The corresponding cross-cluster plan is to execute the vertex c sub-query task, and the participant graph database cluster executes the sub-execution plan (vertex c sub-query task) corresponding to the execution plan according to the cross-cluster plan. At the same time, the initiator graph database cluster can also execute the vertex c sub-query task in the cluster according to the sub-execution plan, but there is no query result.

[0035] As shown in the example, Figure 2 Figure 2 ​Another cross-database cluster joint query method provided by the embodiment of the present application is shown in the figure. The initiator database cluster is cluster A, and the participant database cluster is cluster B. Each layer in each cluster processes a part of the execution plan and passes the remaining sub-execution plan to the next layer for execution and processing. The initiator database cluster outputs the final query result. After the initiator database cluster A executes the vertex query plan (a) sub-execution plan according to the execution plan, it is determined according to the intermediate result of executing the vertex query plan (a) that the next step sub-execution plan needs to be cooperatively executed by cluster B, that is, there is a cross-cluster association relationship. Then, the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, that is, the first cross-cluster plan (not including the vertex query plan (b) of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to the participant database cluster B. The participant database cluster B executes the vertex query plan (b') corresponding to the execution plan according to the first cross-cluster plan.

[0036] In the formula, the sub-execution plan and the sub-query task are in a one-to-many or one-to-one relationship. If there is no cross-cluster association requirement in the process of executing the sub-execution plan, the corresponding sub-execution plan and sub-query task are in a one-to-one relationship. If there is a cross-cluster association requirement in the process of executing the sub-execution plan, the corresponding sub-execution plan and sub-query task are in a one-to-many relationship. The sub-execution plan can include multiple sub-query tasks. The sub-query task can exist in the initiator database cluster or in the participant database cluster. As shown in the formula, the vertex query plan b and the vertex query plan b' are both sub-query tasks. Figure 2

[0037] In the embodiment, the initiator database cluster and the participant database cluster can also perform query tasks in the following manner. All clusters have a common task distribution layer. After the initiator database cluster distributes the execution plan to each participant database cluster, the initiator database cluster and each participant database cluster simultaneously perform according to the execution plan. After the initiator database cluster and each participant database cluster execute a part of the sub-execution plan according to the execution plan, if each cluster determines according to the intermediate result of executing the sub-execution plan that the next step sub-execution plan needs to be cooperatively executed by other clusters, that is, there is a cross-cluster association relationship, then the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, that is, the second cross-cluster plan (not including the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to other clusters (except the cluster itself and all other clusters). Other clusters execute the sub-execution plan (sub-query task) corresponding to the execution plan according to the second cross-cluster plan.

[0038] For example, as shown in the formula, the vertex query plan b and the vertex query plan b' are both sub-query tasks. Figure 3 Figure 3 ​​Another cross-database cluster joint query method provided by the embodiment of the present application is shown in the figure. Figure 3 In the figure, the initiator database cluster is not shown, and the clusters A, B and C can all be the initiator database cluster, and all the clusters have a common task distribution layer. After the task distribution layer distributes the execution plan to the clusters A, B and C, the clusters simultaneously perform according to the execution plan. After each cluster performs the corresponding vertex query plan sub-execution plan according to the execution plan, each cluster determines, according to the intermediate result of the execution sub-execution plan, that the next step sub-execution plan needs to be cooperatively executed by other clusters, i.e., there is a cross-cluster association relationship. Then, the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, i.e., the second cross-cluster plan (not containing the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to other clusters (except the cluster itself). Other clusters execute the sub-execution plan (sub-query task) corresponding to the execution plan according to the second cross-cluster plan. Finally, each participating database cluster returns the query result of the last sub-execution plan to the initiator database cluster.

[0039] In the embodiment, the initiator database cluster and the participating database cluster can also perform the query task in the following manner. After the initiator database cluster performs a part of the sub-execution plan according to the execution plan, if it is determined, according to the intermediate result of the execution sub-execution plan, that the next step sub-execution plan needs to be cooperatively executed by other clusters, i.e., there is a cross-cluster association relationship, then the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, i.e., the first cross-cluster plan (not containing the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to all participating database clusters. Each participating database cluster executes the sub-execution plan (sub-query task) corresponding to the execution plan according to the first cross-cluster plan, while the initiator database cluster also executes the sub-execution plan belonging to the cluster itself. After the initiator database cluster and each participating database cluster perform a part of the sub-execution plan according to the execution plan, if it is determined, according to the intermediate result of the execution sub-execution plan, that the next step sub-execution plan needs to be cooperatively executed by other clusters, i.e., there is a cross-cluster association relationship, then the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, i.e., the second cross-cluster plan (not containing the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to other clusters (except the cluster itself). Other clusters execute the sub-execution plan (sub-query task) corresponding to the execution plan according to the second cross-cluster plan.

[0040] As shown in the figure, Figure 4 Figure 4 ​Another cross-database cluster joint query method provided by the embodiment of the present application is shown in the figure. After the initiator database cluster A executes the vertex query plan (a) sub-execution plan according to the execution plan, it is determined according to the intermediate result of executing the vertex query plan (a) that the next sub-execution plan needs to be cooperatively executed by cluster B, that is, there is a cross-cluster association relationship, and then the data of the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, that is, the first cross-cluster plan (not containing the vertex query plan (b) of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to the participant database cluster B and the participant database cluster C. The participant database cluster B and the participant database cluster C execute the vertex query plan (b') and the vertex query plan (b'') corresponding to the execution plan according to the first cross-cluster plan. At the same time, the initiator database cluster A also executes the vertex query plan (b) sub-execution plan belonging to the cluster. After the initiator database cluster A, the participant database cluster B and the participant database cluster C execute part of the sub-execution plan according to the execution plan, each cluster determines according to the intermediate result of executing the sub-execution plan that the next sub-execution plan needs to be cooperatively executed by other clusters, that is, there is a cross-cluster association relationship, and then the data of the sub-query task corresponding to the sub-execution plan is filtered according to the cross-cluster relationship, that is, the second cross-cluster plan (not containing the sub-query task of the initiator cluster) corresponding to the cross-cluster associated sub-query task is sent to other clusters (except the cluster), and other clusters execute the sub-execution plan (sub-query task) corresponding to the execution plan according to the second cross-cluster plan.

[0041] In this embodiment, the initiator database cluster and the participant database cluster perform query tasks in multiple ways, which can cover various cross-cluster query task scenarios and effectively ensure the execution efficiency of cross-cluster query tasks.

[0042] In this embodiment, the number of participant database clusters is not limited, that is, it can be horizontally expanded to more clusters, improving the flexibility and scalability of the scheme. At the same time, there is no limitation on the edges (sub-execution plans) involved in the query, that is, the sub-execution plan can be vertically expanded (allowing more edges to appear in the execution plan), so that the functionality and scalability of the scheme are guaranteed.

[0043] In this embodiment, there is no limitation on the initiator graph database cluster, any cluster in the cluster and a third-party legal cluster can be used as the initiator cluster, and during the entire execution process, the participant graph database cluster can also send a cross-cluster plan to other clusters, so that other clusters execute the corresponding sub-execution plan according to the cross-cluster plan (equivalent to any participant graph database cluster can also perform a distributed subquery task operation), which reduces the centralization degree of cluster management, enables the participant graph database cluster to participate in data query calculation, subquery task distribution and other operations to the greatest extent, and enables the resources in the entire system to be more fully utilized.

[0044] It should be noted that when each cluster is used as an initiator graph database cluster, the query statements corresponding to the execution plans executed by the initiator graph database clusters can be different, that is, each cluster can simultaneously perform multiple different query tasks.

[0045] Optionally, the manner in which the participant graph database cluster returns the query result to the initiator graph database cluster can be that the participant graph database cluster returns the query result obtained by executing the last sub-execution plan to the initiator graph database cluster.

[0046] The query result includes an empty query result and a correct query result. It should be noted that the initiator graph database cluster and the participant graph database cluster have the same execution plan, and the initiator graph database cluster and / or the participant graph database cluster can determine that there is a cross-cluster association relationship between the data before sending the cross-cluster plan according to the current execution result, but when there are multiple participant graph database clusters, it is not determined which participant graph database cluster has a cross-cluster association relationship with the initiator graph database cluster, or it is not determined which other cluster (other participant graph database cluster or initiator graph database cluster) has a cross-cluster association relationship with the participant graph database cluster, therefore, the initiator graph database cluster and / or the participant graph database cluster sends the cross-cluster plan to all clusters. In addition, the initiator graph database cluster can have the same cross-cluster association relationship with multiple participant graph database clusters, or the participant graph database cluster can have the same cross-cluster association relationship with multiple other clusters.

[0047] In the case where the cross-cluster association relationship can be determined according to the current execution result, but the participating graph database cluster that has the cross-cluster association relationship with the initiator graph database cluster cannot be determined, the following explanations are made: still taking the three vertices a, b, and c and the directed edges including a->b (edge f) and b->c (edge g) as examples, when all vertices corresponding to the end points of the directed edges are executed, the initiator graph database cluster can find vertex b in the cluster, but it can be known through the association relationship corresponding to the edge that the pointed vertex c can exist partially in the initiator graph database cluster or does not exist in the initiator graph database cluster. When there are multiple participating graph database clusters, it can be determined that the initiator graph database cluster has the cross-cluster association relationship with the participating graph database cluster, but the initiator graph database cluster cannot determine the participating graph database cluster to which vertex c belongs. In addition, the initiator graph database cluster can have the same cross-cluster association relationship with multiple participating graph database clusters, which can be understood as that vertex c can be stored in participating graph database cluster A and at the same time stored in participating graph database cluster B, that is, there is repeated node data in different clusters. Of course, the initiator graph database cluster can have a real cross-cluster association relationship with only one participating graph database cluster. The participating graph database cluster can also have a real cross-cluster association relationship with only one other cluster.

[0048] It can be understood that, in the process of executing the cross-cluster plan by all participating graph database clusters, the participating graph database cluster that has the real cross-cluster relationship with the initiator graph database cluster returns the correct query result after executing all sub-execution plans, that is, after executing the last sub-execution plan. The participating graph database cluster that does not have the cross-cluster relationship with the initiator graph database cluster returns an empty result after executing all sub-execution plans. Even if the participating graph database cluster that does not have the cross-cluster relationship with the initiator graph database cluster generates an empty intermediate result in the process of executing the cross-cluster plan, it does not affect the execution of the subsequent sub-execution plan, and when there is repeated node data in different clusters, the correct execution of the execution plan can be effectively guaranteed, and the correctness of the query result can be guaranteed.

[0049] Optionally, the initiator graph database cluster generates a first cross-cluster plan according to the current execution result, and sends the first cross-cluster plan to the participant graph database cluster. The participant graph database cluster can execute the corresponding sub-execution plan according to the first cross-cluster plan in the following manner: the initiator graph database cluster encrypts the first cross-cluster plan according to the first encryption parameter, and sends the encrypted first cross-cluster plan to each participant graph database cluster; each participant graph database cluster decrypts the encrypted first cross-cluster plan according to the first decryption parameter to obtain the decrypted first cross-cluster plan; and the participant graph database cluster executes the corresponding sub-execution plan according to the decrypted first cross-cluster plan. Correspondingly, the participant graph database cluster generates a second cross-cluster plan according to the current execution result, and sends the second cross-cluster plan to other clusters. Other clusters can execute the corresponding sub-execution plan according to the second cross-cluster plan in the following manner: the participant graph database cluster encrypts the second cross-cluster plan according to the second encryption parameter, and sends the encrypted second cross-cluster plan to other participant graph database clusters and the initiator graph database cluster; other participant graph database clusters and the initiator graph database cluster decrypt the encrypted second cross-cluster plan according to the second decryption parameter to obtain the decrypted second cross-cluster plan; and other clusters execute the corresponding sub-execution plan according to the decrypted second cross-cluster plan.

[0050] In this embodiment, before the initiator graph database cluster sends the first cross-cluster plan, the first cross-cluster plan is encrypted according to the first encryption parameter. Correspondingly, the participant graph database cluster decrypts the encrypted first cross-cluster plan according to the first decryption parameter. Before the participant graph database cluster sends the second cross-cluster plan, the second cross-cluster plan is encrypted according to the second encryption parameter. Correspondingly, other clusters decrypt the encrypted second cross-cluster plan according to the second decryption parameter. Before the initiator graph database cluster sends the second cross-cluster plan, the second cross-cluster plan is encrypted according to the first encryption parameter. Correspondingly, the participant graph database cluster decrypts the encrypted second cross-cluster plan according to the first decryption parameter, thereby realizing the security of the cross-cluster plan in the cross-cluster transmission process.

[0051] Optionally, the participant graph database cluster can return the query result to the initiator graph database cluster in the following manner: the participant graph database cluster encrypts the query result according to the second encryption parameter, and returns the encrypted query result to the initiator graph database cluster; and the initiator graph database cluster decrypts the encrypted query result according to the second decryption parameter.

[0052] In the embodiment, the participant graph database cluster encrypts the query result according to the second encryption parameter, writes the encrypted query result into a data file, sends the data file to the initiator graph database cluster, the initiator graph database cluster decrypts the encrypted query result in the data file according to the second decryption parameter, the initiator graph database cluster integrates the execution plan of the cluster and the query result of the cross-cluster plan and the decrypted query result returned by each participant graph database cluster, and outputs the integrated query result, thereby effectively ensuring the security of the query result in the cross-cluster transmission process.

[0053] The technical scheme of the embodiment comprises the following steps: an initiator graph database cluster acquires a query statement, and generates an execution plan according to the query statement; the execution plan comprises a plurality of serial sub-execution plans; the initiator graph database cluster is any one of a plurality of graph database clusters; the execution plan is sent to a participant graph database cluster; the participant graph database cluster is at least one of the plurality of graph database clusters; the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, and the participant graph database cluster returns the query result to the initiator graph database cluster. According to the embodiment, the execution plan is sent to at least one participant graph database cluster, and the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, thereby effectively realizing the joint query across the graph database clusters, and only the transmission of the execution plan (including the cross-cluster plan) and the query result (including the intermediate query result required in the cross-cluster plan) is involved in the cross-cluster transmission process, without involving specific query data, thereby reducing the load required to be borne by the network link, and improving the task query and calculation efficiency across the graph database clusters.

[0054] Figure 5 A structure diagram of a joint query device across graph database clusters is provided in the embodiment. As shown in the figure, the device comprises a query statement acquisition module 501, an execution plan sending module 502, and an execution plan execution module 503. Figure 5

[0055] The query statement acquisition module 501 is configured to acquire a query statement by an initiator graph database cluster, and generate an execution plan according to the query statement; the execution plan comprises a plurality of serial sub-execution plans; the initiator graph database cluster is any one of a plurality of graph database clusters.

[0056] The execution plan sending module 502 is configured to send the execution plan to a participant graph database cluster; the participant graph database cluster is at least one of the plurality of graph database clusters.

[0057] ​The execution plan execution module 503 is configured to execute corresponding query tasks according to the execution plan by the initiator graph database cluster and the participant graph database cluster, and the participant graph database cluster returns query results to the initiator graph database cluster.

[0058] According to the technical scheme of the embodiment, the initiator graph database cluster obtains a query statement through the query statement obtaining module, and generates an execution plan according to the query statement; the execution plan includes a plurality of serial sub-execution plans; the initiator graph database cluster is any one of a plurality of graph database clusters; the execution plan is sent to the participant graph database cluster through the execution plan sending module; the participant graph database cluster is at least one of the plurality of graph database clusters; the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan through the execution plan execution module, and the participant graph database cluster returns query results to the initiator graph database cluster. According to the embodiment of the disclosure, the execution plan is sent to at least one participant graph database cluster, and the initiator graph database cluster and the participant graph database cluster execute corresponding query tasks according to the execution plan, which effectively realizes joint query across graph database clusters, and only the transmission of the execution plan and the query results is involved in the cross-cluster transmission process, without involving specific query data, thereby reducing the load required to be borne by the network link, and improving the task query and calculation efficiency across graph database clusters.

[0059] Optionally, the apparatus further includes a configuration module, configured to: the initiator graph database cluster sends first joint query configuration parameters to each of the participant graph database clusters; the first joint query configuration parameters include first encryption parameters, first decryption parameters, and graph name parameters; each of the participant graph database clusters receives the first joint query configuration parameters and configures according to the first joint query configuration parameters; the participant graph database cluster sends second joint query configuration parameters to each of the clusters; each of the clusters receives the second joint configuration parameters and configures according to the second joint configuration parameters; the second joint query configuration parameters include second encryption parameters and second decryption parameters.

[0060] Optionally, the execution plan sending module is specifically configured to: the initiator graph database cluster encrypts the execution plan according to the first encryption parameters, and sends the encrypted execution plan to each of the participant graph database clusters; each of the participant graph database clusters decrypts the encrypted execution plan according to the first decryption parameters to obtain a decrypted execution plan.

[0061] Optionally, the execution plan execution module is specifically configured to: the initiator graph database cluster performs according to the execution plan; in the process of performing, the initiator graph database cluster generates a first cross-cluster plan according to the current execution result, and sends the first cross-cluster plan to the participant graph database cluster, and the participant graph database cluster performs a corresponding sub-execution plan according to the first cross-cluster plan; and / or, the initiator graph database cluster and the participant graph database cluster perform according to the execution plan; in the process of performing, the initiator graph database cluster and the participant graph database cluster generate a second cross-cluster plan according to the respective current execution result, and send the second cross-cluster plan to the other cluster, and the other cluster performs a corresponding sub-execution plan according to the second cross-cluster plan.

[0062] Optionally, the execution plan execution module is further configured to: the participant graph database cluster returns a query result obtained by executing the last sub-execution plan to the initiator graph database cluster; the query result includes an empty query result and a correct query result.

[0063] Optionally, the execution plan execution module is further configured to: the initiator graph database cluster encrypts the first cross-cluster plan according to the first encryption parameter, and sends the encrypted first cross-cluster plan to each of the participant graph database cluster; each of the participant graph database cluster decrypts the encrypted first cross-cluster plan according to the first decryption parameter, and obtains a decrypted first cross-cluster plan; and the participant graph database cluster executes a corresponding sub-execution plan according to the decrypted first cross-cluster plan.

[0064] Optionally, the execution plan execution module is further configured to: the participant graph database cluster encrypts the second cross-cluster plan according to the second encryption parameter, and sends the encrypted second cross-cluster plan to the other participant graph database cluster and the initiator graph database cluster; the other participant graph database cluster and the initiator graph database cluster decrypt the encrypted second cross-cluster plan according to the second decryption parameter, and obtain a decrypted second cross-cluster plan; and the other cluster executes a corresponding sub-execution plan according to the decrypted second cross-cluster plan.

[0065] Optionally, the execution plan execution module is further configured to: the participant graph database cluster encrypts the query result according to the second encryption parameter, and returns the encrypted query result to the initiator graph database cluster; and the initiator graph database cluster decrypts the encrypted query result according to the second decryption parameter.

[0066] The apparatus can perform the method provided by all the preceding embodiments of the present application, has the corresponding function modules and beneficial effects of performing the method. Technical details not described in detail in the present embodiment can be referred to the method provided by all the preceding embodiments of the present application.

[0067] Figure 6 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0068] As shown in Figure 6 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected to the at least one processor 11 in communication, wherein the memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0069] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunications networks.

[0070] The processor 11 can be various general and / or special purpose processing components having processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the federated query method across a graph database cluster.

[0071] In some embodiments, the federated query method across a graph database cluster can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the federated query method across a graph database cluster described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the federated query method across a graph database cluster by any other suitable means, such as by means of firmware.

[0072] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0073] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, and partially on a machine or a remote machine or a server.

[0074] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0075] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0076] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0077] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0078] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.

[0079] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for joint querying across a graph database cluster, characterized in that, include: The system initiates the process of obtaining a query statement from the graph database cluster and generating an execution plan based on the query statement. The execution plan includes multiple sequential sub-execution plans; The initiating graph database cluster can be any one of multiple graph database clusters; The execution plan is sent to the participant graph database cluster; The participating graph database cluster is at least one of multiple graph database clusters; The initiating graph database cluster and the participating graph database cluster execute corresponding query tasks according to the execution plan, and the participating graph database cluster returns the query results to the initiating graph database cluster; The initiating graph database cluster and the participating graph database cluster execute corresponding query tasks according to the execution plan, including: The initiating graph database cluster executes according to the execution plan; During execution, the initiating graph database cluster generates a first cross-cluster plan based on the current execution result and sends the first cross-cluster plan to the participating graph database clusters. The participating graph database clusters then execute the corresponding sub-execution plans according to the first cross-cluster plan; and / or, The initiating graph database cluster and the participating graph database cluster execute according to the execution plan; During execution, the initiating graph database cluster and the participating graph database cluster generate a second cross-cluster plan based on their respective current execution results, and send the second cross-cluster plan to other clusters. The other clusters then execute the corresponding sub-execution plans according to the second cross-cluster plan. The cross-cluster plan includes execution notification information for the sub-execution plans corresponding to the execution plan and the current result data or data files required by the participating graph database cluster. It is used by each cluster to execute the sub-execution plans corresponding to the execution plan in its own cluster according to the cross-cluster plan.

2. The method according to claim 1, characterized in that, Before the graph database cluster retrieves the query statement, it also includes: The initiating graph database cluster sends a first joint query configuration parameter to each of the participating graph database clusters; the first joint query configuration parameter includes a first encryption parameter, a first decryption parameter, and a graph name parameter; Each of the participating graph database clusters receives the first joint query configuration parameters and configures itself according to the first joint query configuration parameters; The participating graph database cluster sends a second joint query configuration parameter to each cluster; each cluster receives the second joint query configuration parameter and configures itself according to the second joint query configuration parameter; the second joint query configuration parameter includes a second encryption parameter and a second decryption parameter.

3. The method according to claim 2, characterized in that, Sending the execution plan to the participant graph database cluster includes: The initiating graph database cluster encrypts the execution plan according to the first encryption parameter, and sends the encrypted execution plan to each of the participating graph database clusters; Each of the participating graph database clusters decrypts the encrypted execution plan according to the first decryption parameter to obtain the decrypted execution plan.

4. The method according to claim 1, characterized in that, The participating graph database cluster returns the query results to the initiating graph database cluster, including: The participating graph database cluster will return the query results obtained from executing the last sub-execution plan to the initiating graph database cluster; the query results include empty query results and correct query results.

5. The method according to claim 3, characterized in that, The initiating graph database cluster generates a first cross-cluster plan based on the current execution result and sends the first cross-cluster plan to the participating graph database cluster. The participating graph database cluster executes the corresponding sub-execution plan according to the first cross-cluster plan, including: The initiating graph database cluster encrypts the first cross-cluster plan according to the first encryption parameter, and sends the encrypted first cross-cluster plan to each of the participating graph database clusters; Each of the participating graph database clusters decrypts the encrypted first cross-cluster plan according to the first decryption parameter to obtain the decrypted first cross-cluster plan; The participating graph database cluster executes the corresponding sub-execution plan according to the decrypted first cross-cluster plan; Accordingly, the participating graph database clusters generate a second cross-cluster plan based on their respective current execution results, and send the second cross-cluster plan to other clusters. The other clusters then execute the corresponding sub-execution plans according to the second cross-cluster plan, including: The participating graph database cluster encrypts the second cross-cluster plan according to the second encryption parameter, and sends the encrypted second cross-cluster plan to other participating graph database clusters and the initiating graph database cluster; The other participating graph database clusters and the initiating graph database cluster decrypt the encrypted second cross-cluster plan according to the second decryption parameter to obtain the decrypted second cross-cluster plan; Other clusters execute their corresponding sub-execution plans according to the decrypted second cross-cluster plan.

6. The method according to claim 3, characterized in that, The participating graph database cluster returns the query results to the initiating graph database cluster, including: The participating graph database cluster encrypts the query result according to the second encryption parameter and returns the encrypted query result to the initiating graph database cluster. The initiating graph database cluster decrypts the encrypted query result according to the second decryption parameter.

7. A joint query device for cross-graph database clusters, characterized in that, include: The query statement acquisition module is used to initiate the acquisition of query statements from the graph database cluster and generate an execution plan based on the query statements. The execution plan includes multiple sequential sub-execution plans; The initiating graph database cluster can be any one of multiple graph database clusters; An execution plan sending module is used to send the execution plan to the participant graph database cluster; The participating graph database cluster is at least one of multiple graph database clusters; An execution plan execution module is used for the initiating graph database cluster and the participating graph database cluster to execute corresponding query tasks according to the execution plan, and the participating graph database cluster to return the query results to the initiating graph database cluster; The execution plan execution module is specifically configured to: the initiating graph database cluster execute according to the execution plan; during execution, the initiating graph database cluster generates a first cross-cluster plan based on the current execution result and sends the first cross-cluster plan to the participating graph database cluster, and the participating graph database cluster executes the corresponding sub-execution plan according to the first cross-cluster plan; and / or, the initiating graph database cluster and the participating graph database cluster execute according to the execution plan; during execution, the initiating graph database cluster and the participating graph database cluster generate a second cross-cluster plan based on their respective current execution results and send the second cross-cluster plan to other clusters, and the other clusters execute the corresponding sub-execution plan according to the second cross-cluster plan; wherein, the cross-cluster plan includes execution notification information of the sub-execution plan corresponding to the execution plan and the current result data or data file required by the participating graph database cluster, for each cluster to execute the sub-execution plan corresponding to the execution plan in its own cluster according to the cross-cluster plan.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the joint query method for a cross-graph database cluster as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the joint query method for a cross-graph database cluster as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-party data joint query method and device, server and storage medium

    CN111382174A

  • Data query and synchronization optimization method and device

    CN112784119A