Method and device for jointly constructing graph data and carrying out graph query based on privacy protection

By dividing the graph data into multiple blocks and building index data, combining MPC and ORAM technologies, the problem of low efficiency of large-scale graph data query in the existing technology is solved, and efficient and secure privacy protection graph query is achieved.

CN119248971APending Publication Date: 2025-01-03ALIPAY (HANGZHOU) INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411390079.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The existing multi-party privacy graph query method is difficult to achieve efficient response when processing large-scale graph data, resulting in limited practicality in practical applications.

Method used

By dividing the global graph data into multiple parts and dividing it into multiple blocks during the graph data construction stage, two arrays and the corresponding two sets of index data are built, and graph query is supported without traversing the entire graph, using MPC Computing and ORAM technology enables privacy protection and efficient query.

Benefits of technology

It realizes efficient query of graph data without destroying privacy, avoids full graph traversal, and improves query response speed and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248971A_ABST
    Figure CN119248971A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method and a device for jointly constructing graph data and carrying out graph query based on privacy protection. The graph data construction method can be applied to any one of a plurality of calculation parties, and specifically comprises the following steps that firstly, private graph fragments of private graph data of any one of N data parties under secret sharing are received from any one of the N data parties, and the private graph data are organized into a matrix composed of b * b blocks, wherein the block of the ith row and the jth column records a connecting edge list of which the starting point and the ending point are respectively positioned in the ith node range and the jth node range in the private graph, and b is a public parameter; combining the received N private graph fragments so as to construct global graph fragments for global graph data in the party; then, two arrays and two sets of corresponding index data are constructed based on the global graph fragments, one array comprises b elements, each element corresponds to data of b blocks in one row in the global graph fragments, and the other array comprises b2 elements which respectively correspond to data of b2 blocks in the global graph fragments;
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a method and apparatus for jointly constructing graph data based on privacy protection, a method and apparatus for performing graph query based on privacy protection, a computer-readable storage medium, and a computing device. Background Art

[0002] Relational network graphs, or graphs for short, are descriptions of the relationships between entities in the real world. Due to their inherent interconnectedness, they play an important role in many fields such as the financial industry, social networks, and public health. Generally, a relationship network graph contains a set of nodes and a set of edges. Nodes or vertices represent entities in the real world, and edges represent the connections between entities in the real world. For example, in a social network, users are entities, and the relationship or connection between two users is an edge.

[0003] A key application on graphs is ego-centric queries, which focus on a central node and all its directly connected neighbors (i.e., first-order neighbors). For example, in the financial industry, by querying the relationship between trading accounts in the transaction graph, it can assist in detecting illegal fund transfers, identifying high-risk accounts, etc.

[0004] Graph query based on multi-party graph fusion has great application prospects in many fields. For example, combining data from multiple banks can enable more comprehensive risk account or risk transaction detection; for another example, combining data from multiple social platforms can enable more comprehensive social data query, thereby providing users with more accurate recommended content. However, due to privacy protection requirements, various data parties are often unable to directly share graph data.

[0005] In theory, secure multi-party computing (MPC) technology allows multiple parties to complete agreed computing tasks, including graph queries, without directly sharing data. However, due to the large scale of graph data in actual application scenarios, existing multi-party privacy graph query methods are difficult to complete graph queries efficiently and have limited practicality.

[0006] Therefore, there is an urgent need for a scheme that can achieve efficient multi-party joint graph query without compromising privacy. Summary of the invention

[0007] The embodiments of this specification describe a method and device for jointly constructing graph data and performing graph query based on privacy protection. For any basic query, the query result can be obtained without traversing the entire graph, thereby achieving efficient graph query.

[0008] According to a first aspect, a method for jointly constructing graph data based on privacy protection is provided, which is applied to any computing party among multiple computing parties, including:

[0009] Receive private graph slices of its private graph data under secret sharing from any data party among the N data parties, where the private graph data is organized into a matrix consisting of b*b blocks, where the block in the i-th row and j-th column records: a list of connection edges whose starting point and end point are respectively located in the i-th and j-th node ranges in the private graph of the data party, where b is a public parameter. Combine the N received private graph slices to construct a global graph slice for the global graph data in this party, where the global graph data is the fusion result of the N private graph data of the N data parties. Based on the global graph slices, construct two arrays and two corresponding sets of index data; wherein the first array contains b first elements, and a single first element corresponds to a row of b blocks of data in the global graph slice; the second array contains b 2 The second elements correspond to b in the global graph slice. 2 Blocks of data.

[0010] In some embodiments, the multiple connection edges in the connection edge list are arranged in a joint key order of the start point and the end point.

[0011] In some embodiments, the number of connected edges recorded in each of the b*b blocks is the same; and at least one of the b*b blocks contains filled empty edges.

[0012] In some embodiments, combining the received N private graph slices includes: obtaining N connection edge list slices in N blocks that are all located in the i-th row and j-th column in the N private graph slices; jointly sorting the connection edge slices in the N connection edge list slices according to the starting point identifier by performing MPC calculation for joint comparison with other computing parties; and forming the block in the i-th row and j-th column in the global graph slice based on the jointly sorted connection edge slices.

[0013] In some embodiments, based on the global graph slice, two arrays and corresponding two sets of index data are constructed, including: sequentially extracting the global graph slice row by row, each row as a single array element forming a third array, the physical index sequence of the third array is consistent with its logical index sequence; sequentially extracting blocks of the global graph slice row by row, each block as a single array element forming a fourth array, the physical index sequence of the fourth array is consistent with its logical index sequence; based on the third and fourth arrays and their respective logical index sequences, the two arrays and the corresponding two sets of index data are determined.

[0014] Further, in some specific embodiments, based on the third and fourth arrays and their respective logical index sequences, the two arrays and the corresponding two sets of index data are determined, including: taking the third array and the fourth array as original arrays, respectively; based on the original arrays and their logical index sequences, jointly performing MPC calculations for out-of-order reordering with other computing parties to obtain a reordered array corresponding to the original array, and an index mapping slice indicating the mapping of the logical index sequence to the physical index sequence of the reordered array; incorporating the reordered array into the two arrays, and taking the logical index sequence of the original array as the logical index sequence of the reordered array, and incorporating it together with the index mapping slice into a set of index data corresponding to the reordered array.

[0015] Furthermore, in some examples, the MPC calculation for the shuffle is implemented through a target protocol, the input of the target protocol including the original array and its corresponding logical index sequence, and locally randomly generated shards of the shuffle function and inverse function shards of the shuffle function for the shuffle.

[0016] In some embodiments, the multiple computing parties are 3 computing parties, and the implementation of the secret sharing is based on a (2,3)-secret sharing scheme.

[0017] According to the second aspect, a method for performing graph query based on privacy protection is proposed, which is applied to any computing party among multiple computing parties, wherein two arrays constructed based on the method provided in the first aspect and two corresponding sets of index data are maintained. The method comprises:

[0018] According to a graph query request received from a client, a target array is determined from the two arrays; the graph query request includes an object identification shard of a target object identification under secret sharing; wherein the target object is a node or an edge. Based on the object identification shard, and the target index data corresponding to the target array, a single array element of the target array is located by jointly performing a first MPC calculation with other computing parties. Based on the object identification shard, and the global subgraph shard contained in the single array element, a second MPC calculation is jointly performed with other computing parties to obtain a result shard of the graph query result for providing to the client.

[0019] In some embodiments, based on a graph query request received from a client, a target array is determined from the two arrays, including: when the target object is a node, the first array of the two arrays is determined as the target array; when the target object is an edge, the second array of the two arrays is determined as the target array.

[0020] In some embodiments, locating a single array element of a target array includes: using the object identification slice to determine the index slice of the target logical index of the target object in the target array; based on the index slice and the target index data, locating the single array element by executing the first MPC calculation.

[0021] Further, in some specific embodiments, the target array is obtained by rearranging the original array, the original array and the target array have the same logical index sequence, and the physical index sequence of the original array is consistent with its logical index sequence; the target index data includes: an index mapping slice indicating that the logical index sequence is mapped to the physical index sequence of the target array. Wherein, based on the index slice and the target index data, by performing the first MPC calculation, locating the single array element includes: based on the index slice and the index mapping slice, performing the first MPC calculation to obtain the target physical index corresponding to the target logical index; according to the target physical index, locating the stored single array element.

[0022] In some embodiments, the target object is a target edge, and its edge identification slice includes a target start sub-slice and a target end sub-slice, and the global subgraph slice includes l edge slices corresponding to l connected edges, and each edge slice includes a start sub-slice and an end sub-slice. Wherein, based on the object identification slice and the global subgraph slice contained in the single array element, the second MPC calculation is performed in conjunction with other calculation parties to obtain the result slice of the graph query result, including: copying the edge identification slice of the target edge into l copies; performing the second MPC calculation based on the l edge identification slices and the l edge slices to obtain the result slice.

[0023] Further, in some specific embodiments, the graph query request indicates querying whether the target edge is included in the global graph data; wherein, performing the second MPC calculation based on the l edge identification slices and the l edge slices to obtain the result slices includes:

[0024] Based on 1 target starting point sub-slice in 1 edge identification slices and 1 starting point sub-slice in the said 1 edge slices, a first mask slice is obtained by jointly performing a first MPC sub-calculation for bitwise equality determination with other computing parties; based on 1 target ending point sub-slice in 1 edge identification slices and 1 ending point sub-slice in the said 1 edge slices, a second mask slice is obtained by jointly performing a second MPC sub-calculation for bitwise equality determination with other computing parties; based on the first mask slice and the second mask slice, a third mask slice is obtained by jointly performing a third MPC sub-calculation for bitwise logical AND operation with other computing parties; based on the third mask slice, a fourth MPC sub-calculation for determining whether there is a bit with a value of 1 is obtained by jointly performing with other computing parties.

[0025] In some embodiments, the target object is a target node, and the global subgraph shard includes 1 edge shards corresponding to 1 connecting edges, and each edge shard includes a starting sub-shard and an end sub-shard. Based on the object identification shard and the global subgraph shard contained in the single array element, the result shard of the graph query result is obtained by performing a second MPC calculation in conjunction with other calculation parties, including: copying the identification shard of the target node into 1 copies to obtain 1 target point shards; performing the second MPC calculation based on the 1 target point shards and the 1 edge shards to obtain the result shard.

[0026] Further, in some specific embodiments, the graph query request indicates querying the number of first-order neighbor nodes of the target node; wherein the second MPC calculation is performed based on l target point slices and the l edge slices to obtain the result slices, including:

[0027] Based on 1 target point slices and 1 starting point sub-slices in the 1 edge slices, a first MPC sub-calculation for bit-wise equality determination is performed in conjunction with other computing parties to obtain a first mask slice, which is a Boolean slice; based on the first mask slice, a second MPC sub-calculation for slice type conversion is performed in conjunction with other computing parties to obtain a second mask slice, which is an arithmetic slice; based on the second mask slice, a third MPC sub-calculation for calculating bit sum values ​​is performed in conjunction with other computing parties to obtain the result slice.

[0028] In some other specific embodiments, the graph query request indicates querying the first-order neighbor nodes of the target node; wherein the second MPC calculation is performed based on l target point slices and the l edge slices to obtain the result slices, including:

[0029] Based on 1 target point slices and 1 starting point sub-slices in the 1 edge slices, a first mask slice is obtained by jointly performing a first MPC sub-calculation for bit-by-bit equality judgment with other computing parties; based on the first mask slice and 1 end point sub-slices in the 1 edge slices, a second MPC sub-calculation for bit-by-bit multiplication is jointly performed with other computing parties to obtain a candidate node slice; and the result slice is determined based on the candidate node slice.

[0030] Furthermore, in some examples, determining the result shard based on the candidate node shard includes: based on the candidate node shard, obtaining a deduplicated node shard by jointly performing a third MPC sub-computation for deduplication processing with other computing parties; and determining the result shard based on the deduplicated node shard.

[0031] In some more specific examples, the l edge slices in the global subgraph are pre-sorted according to corresponding starting point identifiers, and the computational protocol of the third MPC sub-computation is designed for deduplication of adjacent elements.

[0032] In some more specific examples, determining the result shard based on the deduplicated node shard includes: based on the deduplicated shard, obtaining the result shard by jointly performing a fourth MPC sub-computation for out-of-order reordering with other computing parties.

[0033] According to a third aspect, a device for jointly constructing graph data based on privacy protection is provided, which is integrated in any computing party among a plurality of computing parties, comprising:

[0034] The private graph shard receiving module is configured to receive private graph shards of private graph data from any data party among the N data parties under secret sharing, wherein the private graph data is organized into a matrix consisting of b*b blocks, wherein the block in the i-th row and j-th column records: a list of connection edges whose starting point and end point are respectively located in the i-th and j-th node ranges in the private graph of the data party, wherein b is a public parameter. The private graph shard combining module is configured to combine the N received private graph shards, thereby constructing a global graph shard for the global graph data in this party, wherein the global graph data is a fusion result of the N private graph data of the N data parties. The global graph number construction module is configured to construct two arrays and two corresponding sets of index data based on the global graph shards; wherein the first array contains b first elements, and a single first element corresponds to a row of b blocks of data in the global graph shard; the second array contains b 2 The second elements correspond to b in the global graph slice. 2 Blocks of data.

[0035] According to a fourth aspect, a device for performing graph query based on privacy protection is provided, which is integrated in any one of a plurality of computing parties, wherein two arrays constructed based on the method provided in the first aspect and two corresponding sets of index data are maintained; the device comprises:

[0036] The target array determination module is configured to determine the target array from the two arrays according to a graph query request received from the client; the graph query request includes an object identification shard of the target object identification under secret sharing; wherein the target object is a node or an edge. The first MPC calculation module is configured to locate a single array element of the target array by performing a first MPC calculation in conjunction with other calculation parties based on the object identification shard and the target index data corresponding to the target array. The second MPC calculation module is configured to obtain a result shard of the graph query result by performing a second MPC calculation in conjunction with other calculation parties based on the object identification shard and the global subgraph shard contained in the single array element, for providing to the client.

[0037] According to a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method provided in the first aspect or the second aspect.

[0038] According to a sixth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect or the second aspect is implemented.

[0039] In summary, the above method and device disclosed in the embodiments of this specification support privacy-preserving graph fusion for any number of data providers. At the same time, for any query about a point or an edge, the corresponding subgraph can be extracted for analysis, thereby avoiding full graph traversal. Furthermore, by constructing a graph-native graph query engine GORAM, that is, a graph RAM that is divided into blocks based on the characteristics of graph data, the security of obtaining subgraphs can be further improved while ensuring the efficiency of queries, and achieving real-time query response. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 Schematic diagram of the square root ORAM workflow;

[0042] Figure 2 The three types of roles involved in the graph query solution disclosed in the embodiments of this specification are illustrated;

[0043] Figure 3 A schematic diagram of the implementation process of the graph query solution disclosed in the embodiments of this specification;

[0044] Figure 4 The two-dimensional data structure obtained by partitioning the graph data is shown;

[0045] Figure 5 The following is an illustration of the execution process of the constant round protocol disclosed in the embodiments of this specification;

[0046] Figure 6 A device for jointly constructing graph data based on privacy protection disclosed in an embodiment of this specification;

[0047] Figure 7 A device for performing graph query based on privacy protection is disclosed in an embodiment of this specification. DETAILED DESCRIPTION

[0048] In conjunction with the accompanying drawings, an improved map query solution (or improved solution for short) is provided for this specification, which can realize efficient map query. To help understanding, the inventive concept of the solution is briefly introduced below. In addition, the privacy technologies such as MPC mentioned in the inventive concept section will be further introduced later.

[0049] 1. Invention Concept

[0050] As mentioned in the background technology section, in theory, MPC allows multiple parties to complete graph queries without directly sharing data. However, currently, multi-party private graph queries based on MPC need to be completed on the basis of traversing the entire graph, which makes it difficult to provide efficient responses.

[0051] Specifically, each data provider P i Let its edge (u, v)∈E i Encrypted into a SecretShare list, where each edge is represented as Then, the data provider P i The secret sharing list is sent to the computing server, which creates a secret sharing list for the global graph G by merging the N secret sharing lists received from N data providers. In this way, the information the server learns is the number of edges. However, this data structure requires scanning the entire graph G for each query, which leads to a performance bottleneck when processing large-scale graphs.

[0052] Based on the above observations and analysis, the embodiments of this specification propose an improved graph query solution. For any basic query, for example, querying the number of neighbor nodes of a node, the query result can be obtained without traversing the entire graph, thereby achieving efficient graph query. It should be understood that the basic query mentioned in the text refers to a query centered on a node or edge, which acts on a subgraph consisting of a node and all its surrounding 1-degree neighbors, or a subgraph consisting of all given edges.

[0053] In the above-mentioned improvement scheme, during the graph data construction phase (offline phase), the global graph is divided into multiple parts (partitions), and this division satisfies: all the information required for any basic query is just contained in one of the parts. Therefore, during the query processing phase (online phase), the corresponding graph data part can be located according to the identifier of the query object (such as the target node identifier), and the graph query operation can be quickly completed based on this part of the graph data. It should be noted that the construction and query processing of graph data are carried out in a confidential state, and the privacy of the private graph data of each data party and the query target (such as the node identifier) ​​submitted by the client will be protected.

[0054] In addition, it should be noted that the above is only a brief introduction to the core improvements in the improvement scheme. In fact, based on this core improvement, a series of other improvements are also proposed. In order to help fully understand the improvement scheme proposed in the embodiments of this specification, some background technical knowledge (or preliminary knowledge) that needs to be mastered is introduced below.

[0055] 2. Preliminary Knowledge

[0056] 1. MPC technology

[0057] MPC is a cryptographic technique that allows multiple parties to jointly compute a function on their private inputs while ensuring that the private inputs of each party are not leaked to other parties. Each party can obtain the plaintext output of the function, or they can also obtain the secret sharing shard corresponding to the plaintext output.

[0058] 1.1 Secret Sharing

[0059] Secret sharing is one of the basic technologies in MPC. The (t, n)-secret sharing scheme divides any sensitive data x into n shares and provides them to n parties accordingly, so that any t parties can reconstruct the sensitive data x, while less than t parties will not be able to know any information about x.

[0060] Take the (2, 3)-secret sharing scheme as an example: x is divided into (x1, x2, x3), where each x i is uniformly random, and in Represents bitwise exclusive OR (XOR). Each participant has two shared shards (x i , x i+1 ), the subscript index is cyclic around 3. Therefore, no party can know any information about x, but any two parties can correctly reconstruct x. This secret sharing scheme is Boolean secret sharing, and the generated secret sharing shards can be called Boolean shards. In this paper, the Boolean shard of x is denoted as The implementation of the improvement plan may also involve converting Boolean slices into arithmetic slices to improve computational efficiency, that is, x≡x1+x2+x3 mod 2 k , where the arithmetic slice is denoted by

[0061] 1.2 Secure operations

[0062] Sharding based on secret sharing and All parties can collaborate to calculate the operation result shards of multiple common operations (op) The corresponding MPC protocols are used in collaborative computing. These protocols can ensure that: for z = op(x, y), And during the execution of the protocol, each party will not learn any information about the secret input of other parties.

[0063] Many of the existing MPC protocols have been developed to be quite mature and are applicable to operations such as bitwise exclusive or (XOR), and (AND), or (OR), addition (+), multiplication (x), comparison (>, ≥, =), and conversion between Boolean slices and arithmetic slices. By combining these basic operations, more advanced security algorithms can be designed, such as machine learning, relational queries, and graph algorithms. For example, the improved solution can use the MPC framework of ABY3.

[0064] 1.3 Security Guarantees

[0065] MPC guarantees the privacy of input and the correctness of output to deal with specific adversary models. The adversary model describes how the attacker attacks the participants. In a common classification method, the adversary model can be divided into a semi-honest model and a malicious model. In the semi-honest model, the participants will strictly follow the protocol but may try to infer the private information of other parties; in the malicious model, the participants may deviate from the protocol to obtain more information or interfere with the results. In another classification method, it can be divided into an honest-majority model and a dishonest-majority model, depending on the proportion of the attacked parties.

[0066] The underlying MPC protocol of the above improved scheme can provide security under the semi-honest model and the honest majority model. When there are three computing parties in the improved scheme, the honest majority is equivalent to non-colluding, that is, at most only one party can be hacked.

[0067] The above introduces the relevant knowledge of MPC technology.

[0068] In addition, the improvement plan further proposes improvements to the graph data query engine. Specifically, in order to achieve efficient and more secure access to multiple parts (partitions) of the global graph data, an index layer is built on top of the multiple parts to maintain a secret mapping from the query object ID (such as the target node ID) to the corresponding single part storage location, so as to securely access the target part without leaking any information about the query object ID.

[0069] The design of the index layer is inspired by ORAM, or Oblivious RAM, where the full name of RAM is Random Access Memory. Based on this, the technical architecture related to the implementation of the index layer in the improvement plan is called Graph-Oriented ORAM, or GORAM for short. To help understand, the relevant preparatory knowledge is introduced here.

[0070] 2. ORAM Technology

[0071] 2.1ORAM

[0072] ORAM is a cryptographic technology designed to ensure that when a visitor accesses memory, other parties cannot infer any information about the access content by observing the access pattern. In other words, ORAM can hide the specific location and data items accessed by the visitor in the storage system, preventing other parties from obtaining the visitor's private information by inferring the access pattern.

[0073] Working principle and characteristics of ORAM: 1) ORAM hides the actual access location of the accessor by confusing the access method of data. Even if the same data is accessed, ORAM's access mode is different each time, making it impossible for external observers to obtain useful information from the access mode. 2) ORAM uses technologies such as rearranging and encrypting data blocks and accessing fake locations to make each data access indistinguishable, thereby ensuring that external observers cannot see a clear access track. Typical implementations of ORAM often rely on randomization technology and a large number of disguised accesses to hide the real operation.

[0074] 2.2DORAM, Distributed ORAM

[0075] DORAM is a solution proposed to solve the scenario where a group of computing servers jointly hold a set of secret shared data. The servers can jointly access the target data based on the index of the secret share, that is, the computing DORAM does not require that data must be owned and accessed by a single data provider, so it is suitable for scenarios where multiple data providers contribute data together.

[0076] DORAM has become an active research field in recent years, and there are many efficient implementation schemes. The establishment of the index layer in the improved scheme is inspired by DORAM, and the implementation of the index layer is independent of the specific DORAM implementation. To help understand, the following introduces the classic square root hidden random access memory (Square-root ORAM) in the DORAM scheme example, which can achieve sublinear access complexity and provide strong security guarantees.

[0077] 2.3 Square Root ORAM

[0078] The workflow of square root ORAM is as follows Figure 1 As shown in the figure, the core idea is to rearrange the original array arr according to a random permutation (or rearrangement) function π, and then construct a vector index mapping based on the permutation function π. Shard the secret of logical index i Mapped into the rearranged plaintext physical index p, satisfying Specifically, the rearranged array (See Figure 1 In step ①), ORAM also stores the index mapping By secret sharing (see Figure 1 Step ② in the above example). Where π -1 Represents the inverse function of π, index mapping Each element in That is π -1(i) Record the physical position (physical index) of arr[i] after π is applied.

[0079] Further, optionally, the index mapping It can also be constructed recursively, that is, The consecutive P elements in are packed into a single element and then elements recursively construct an ORAM (see Figure 1 Steps ③ to ④) in the above code are repeated until the size of ORAM is reduced to no more than T elements. Correspondingly, the access process is also recursive, such as Figure 1 As shown, accessing arr[2] is equivalent to accessing the rearranged For π[2], access The elements in until the last level, where Indicates rounding up operation, and % indicates remainder operation.

[0080] The above introduces some preliminary knowledge that needs to be mastered to understand the improvement scheme proposed in the embodiments of this specification. Next, the improvement scheme is first briefly introduced, and then the specific implementation steps of the scheme are introduced.

[0081] 3. Overview of Improvement Plan

[0082] The improved solution includes a graph query system that supports private ego-centric queries on federated graph data and can achieve the following effects:

[0083] 1) Functionality: For various practical application scenarios in the real world, it supports any number of data providers and can handle arbitrary self-query operations, that is, queries on the subgraph of the target edge or target vertex and all its first-order neighbors.

[0084] 2) Privacy: In the process of processing query requests, the following two types of information can be kept private: a) The client's query object identifier, that is, the target node or target connection edge to be queried. b) The private graph data of the data provider. Specifically, any key information of the private graph data is not leaked, and the client users who obtain the query results cannot identify which data provider contributed to the query results.

[0085] 3) Efficiency and Scalability: The graph query system is practical and can generate real-time responses for each query request, even on graphs with billions of edges, responses can be obtained within seconds.

[0086] 3.1 Application scenario modeling of the improved solution

[0087] 1) The implementation of the program involves three types of roles, such as Figure 2 As shown, one category is data providers (or data parties for short), which can be any number N greater than or equal to 1, where each data provider has a private graph. Another category is computing parties, which can be 2 or more in number, responsible for executing query processing and communicating with each other through secure channels. The following mainly takes the example of 3 computing parties as an example for illustrative introduction. Another category is clients that submit queries and receive results.

[0088] It should be understood that the above three types of roles are decoupled, but each participant may assume a single role or a combination of different roles. For example, a participant may be both a data provider and a computing party. In addition, each data provider and each computing party may be implemented as any device, platform, server or device cluster with computing and processing capabilities. For example, the computing party may be a computing server.

[0089] 2) Private egocentric queries on federated graphs

[0090] It should be understood that the above-mentioned federated graph refers to a global graph obtained by fusing the private graphs of multiple data parties, and the actual plaintext fusion of private graphs will not occur.

[0091] Assume that the global graph G(V, E) is distributed among N data providers, where each data provider is denoted as P i , i∈[N], [N]={1,2,...,N}. V represents the global vertex set, and E represents the global valid edge set. It can be understood that V contains the identifier of each vertex v. In this paper, vertices and vertex identifiers can be used interchangeably. Similarly, edges and edge identifiers can also be used interchangeably. For any connecting edge e∈E, its starting node (or starting point, source node) is denoted as v s , and its destination node (or terminal node, end point) is recorded as v d , the identity of e can be represented as v s ||v d , where the symbol || represents concatenation. Sometimes, even if two edges have the same start and end points, they can be different edges because they may have different attribute values ​​(such as timestamps). For an undirected graph, each undirected edge can be converted into two directed edges.

[0092] Each data cube P i Holds private graph G i =(V i , E i ),satisfy And E = ∪ i∈[N] E i .at the same time, Because some vertices in the global vertex set V may not exist in any data cube. The global vertex set V is public, which allows clients to submit queries for the nodes they are interested in. Note that the N vertex sets V i The union of i∈[N] V i It is not necessary for any role, and the global vertex set V can be used as the encoding space of the vertex. In addition, during the query process, each data cube P i Private graph G i It needs to be kept private, so the global edge set E is also private.

[0093] The following mainly describes the example of the number of semi-honest computing parties being 3. Specifically, the three computing parties can be denoted as S i , i∈[3], where each computing party holds the secret data of the global graph data The edge set Because the global edge set E + May contain empty edges for privacy protection. Each client can identify the shard of the vertex of interest or edge-identified shards Submit it to the computing party for query, and obtain the query results returned by the computing party in a timely manner under the premise of meeting privacy requirements. Specifically, the client can perform any egocentric query, and each query is based on the corresponding global subgraph G sub = {V sub , E sub} and completed, G sub contains all first-order neighbors of the target vertex v in the query and the corresponding edges (v, v * )∈E, or, contains the target edge (v s , v d ) of all connected edges with the same start and end points.

[0094] 3.2 Overview of GORAM in the Improvement Scheme

[0095] like Figure 3 As shown, GORAM involves a global graph shard maintained by the computing party. GORAM divides the public vertex set V into b groups, and then shards the global graph Divide into b*b matrix blocks, each of which contains all connected edges whose starting and ending points are located in two specific vertex groups, and each row of matrix blocks includes all first-order neighbors corresponding to a vertex group. Therefore, a single matrix block constitutes the graph data part (graph partition) corresponding to the edge query, and a single row of matrix blocks constitutes the graph data part of the vertex query. In other words, for edge queries, you only need to locate the corresponding single matrix block to use the global subgraph data therein to complete the correct query. For vertex queries, you only need to locate the corresponding single row of matrix blocks to use the global subgraph data therein to complete the correct query. Both types of queries do not require traversing the entire graph.

[0096] GORAM shards the global graph Decomposition into VORAM and EORAM allows secure access to the corresponding graph data portion based on a given dense edge or dense node. Indexing is achieved by modeling partitions as ORAM, which is extended from accessing array-of-elements to accessing array-of-partitions in GROAM.

[0097] GORAM can be initialized securely and efficiently through the following three steps: 1) Each data party locally processes its private graph into a two-dimensional secret sharing shard; 2) Each computing party aggregates the private graph shards provided by all data parties into a global graph shard. 3) Each computing party builds a security index for each graph data part.

[0098] From the above, by adopting the improved solution proposed in the embodiments of this specification, any egocentric query can be completed efficiently and securely. For any query, the computing party can receive the identification fragment of the edge or vertex from the client, and access the corresponding graph data part in GORAM accordingly, and then return the query result to the client based on this graph data part.

[0099] 4. Offline initialization phase in the improved solution

[0100] Next, based on the above-mentioned overview of the improvement scheme and other contents, in combination with more drawings and embodiments, the specific implementation steps and implementation details of the offline initialization phase are introduced.

[0101] 4.1 Two-dimensional structure of graph data

[0102] The improvement involves dividing the graph data into a two-dimensional data structure, such as Figure 4 As shown in Figure 1, the graph data is divided into multiple blocks. In the two-dimensional data structure, the global vertex set V = {1, 2, ..., |V|} is divided into groups of k consecutive vertices (or a node range) into In the group of vertices, the corresponding b is constructed accordingly 2 b of the pair of vertex groups 2 matrix blocks. In each edge block (i, j) corresponding to the edge set {(v s , v d ))In s belongs to the i-th group of vertices, v d belongs to the jth group of vertices. Because the global vertex set V is public, each data cube P i The private graph data G can be locally stored according to the given public parameter k. i Processed into a two-dimensional data structure. Note that for any edge (v s , v d ), if it exists, it is located in the edge block For any vertex v, its first-order neighbor node is located in In the row block. It should be understood that for a directed graph, its first-order neighbors are outgoing neighbors. Based on this, the improved scheme can handle any self-query request.

[0103] The initialization process of the improved solution can be found in Figure 3 , which involves three stages: 1) local processing in the data cube; 2) global aggregation in the computing cube; 3) secure index construction. The following will introduce these three stages in turn.

[0104] 4.2 Local Processing

[0105] Because the global vertex set V is public, according to the given public parameter k, each data cube P i The following algorithm 1 can be used to store the private graph data G locally. i Processed into a two-dimensional data structure.

[0106]

[0107] Refer to Algorithm 1. Each data cube P i We can first determine the vertex set containing b based on the public global vertex set V 2 The two-dimensional data structure of blocks is denoted as G i .Block, where Then, according to the private graph G i Determine the edge list E corresponding to each block i Specifically, for any block (s, d), if G i There is an edge (v s , v d )satisfy and Then the edge (v s , vd ) are grouped into block (s, d).

[0108] Further, in one embodiment, the edges in each block (s, d) are based on v s ||v d (i.e., the concatenation of the starting point and the node or the joint key) to improve the execution efficiency of subsequent online queries.

[0109] In one embodiment, in order to fully protect the graph structure of the private graph, the number of edges in each block can be aligned. Otherwise, even in an encrypted state, the computing party can obtain the strength of the connection between different node groups based on the block size (that is, the number of edges in it). Specifically, each data party P i Each block can be filled to the maximum block size l using the empty edges i . Note that l i is the only G exposed to the computing party. i Information, each data cube can also further fill additional empty edges, so that l i Nor will it be exposed.

[0110] The above describes the local processing stage, each data cube P i Each can use private graph data G i Processed into a two-dimensional data structure G i .Block, which includes b*b blocks, each of which is l in size i .

[0111] Furthermore, the data source P i Secret sharing technology can be used locally to i .Block data (including all IDs and attribute values) is divided into M private graph shards And provide it to M computing parties accordingly. It should be understood that the quantifier "share" is used in this article to measure all the secret sharing shards obtained by the computing party for a certain data. The number of shards in each shard may be one or more, which depends on the specific secret sharing protocol.

[0112] In one example, assuming that the number of computing parties is 3, then the data party P i G i The data of .Block is divided into three secret sharing shards, namely (x1, x2), (x2, x3), and (x3, x1), where And any shard In another example, assume that the number of computing parties is 2. In this case, the data party P i The data of Gi.Block can be divided into two secret sharing shards, namely x1 and x2, where

[0113] Above, each data square P i By its private graph G i Perform local processing to obtain M private graph slices Each private graph slice has a two-dimensional data structure, including b*b blocks, each of which is l in size. i M private graph shards It is provided to M computing parties accordingly. For example, the j-th computing party gets the j-th private graph shard.

[0114] 4.3 Global Aggregation (or Global Combination)

[0115] For any computing party S among the multiple computing parties i , which can receive N private graph fragments corresponding to N private graphs from N data parties, that is i∈[N]. Based on this, the calculation method S i Aggregate these private graph shards to obtain global graph shards with a two-dimensional data structure As every G i .Block includes b*b blocks, or b*b connection edge lists, and the calculation square S i By dividing N The blocks at the same position in are spliced ​​together to obtain The blocks at the corresponding positions in .

[0116] For the splicing of the blocks located at the same position, in one embodiment, the calculation method S i N pieces of connection edge list fragments in N blocks in row i and column j of N private graph fragments can be obtained; then, the connection edge fragments in the N pieces of connection edge list fragments can be jointly sorted according to the starting point identifier by performing MPC calculation for joint comparison with other N-1 computing parties (or simply other computing parties). In this way, the global graph fragment can be obtained based on the joint sorted connection edge fragments. In this way, the efficiency of subsequent processing of online queries can be further improved.

[0117] From the above, we can calculate S i N private graphs can be sharded Global aggregation of i∈[N] to obtain global graph sharding There are b*b blocks in it, and the number of connected edges in each block is

[0118] Next, we will introduce the determination of the parameter k in the above global configuration. As mentioned above, it is necessary to configure the public parameter k in advance so that each data party can complete the above local processing. For the configuration of k, it is necessary to make Each row of contains the minimum number of edges that exceeds the block size threshold B, which helps to efficiently vectorize each global subgraph, that is, processing a batch of elements in a single vector processing, thereby effectively amortizing the communication delay.

[0119] In order to efficiently calculate k while protecting the edge distribution information in each data cube, it is assumed that the edges in the global graph are evenly distributed among the nodes of the global vertex set V. Based on this, it can be assumed that the number of edges included in each row in G.Block is Therefore, the improved solution proposes to obtain k by solving the following optimization problem:

[0120]

[0121] According to formula (1), the analytical expression of the optimal k can be obtained as Based on this, the calculation formula S i It can be sharded according to the number of N edges provided by N data cubes calculate Then Provide it to a data party so that it can reconstruct the numerical plaintext of k locally.

[0122] It can be understood that the preferred implementation method of calculating k introduced above can actually also be directly negotiated by N data parties and / or M computing parties based on experience to determine the specific parameter value of k.

[0123] From the above, in the global aggregation stage, each computing square S i You can get your own global graph fragments It has a two-dimensional data structure, which includes b*b blocks, and the number of connected edges in each block is

[0124] 4.4 Security Index Construction

[0125] In order to achieve more efficient and secure access to the partitions of each query, the improved solution extracts the use of a secure index layer on top of the graph partitions, which is inspired by ORAM.

[0126] 1) The key idea of ​​GORAM.

[0127] As mentioned above, the key idea of ​​ORAM is to shuffle the original data array arr according to the random permutation function π, and then establish an index mapping about π, which can divide the slices of logical index i into Map to the rearranged array The corresponding physical index p, thereby achieving the target element That is the correct access to arr[i].

[0128] The key idea of ​​GORAM is to replace the numerical elements in the underlying array with graph data parts. This replacement makes it possible to access the graph data once it is located in the array. Because the graph of the two-dimensional data structure has been organized into an array formed by multiple graph data parts, and the logical index of each graph data part can be directly calculated through the node or edge identifier, a mapping from its logical index to the physical index can be established for each graph data part.

[0129] 2) GORAM Index

[0130] Calculation Square S i Can be based on global graph sharding VORAM for node query and EORAM for edge query are constructed separately.

[0131] VORAM first It is modeled as an array of b global subgraph slices, where each global subgraph slice includes bl densely connected edges, that is, In other words, the global graph is sliced The third array is formed by extracting rows in sequence, and each row is used as a single array element. It should be understood that the physical index sequence of the third array is consistent with its logical index sequence; in addition, the "third" in the third array, as well as the "first", "second" and other similar terms in the text, are used to distinguish similar things and do not have other limiting functions such as sorting.

[0132] EORAM first Modeled as including b 2 An array of global subgraph slices, where each global subgraph slice includes l densely connected edges, that is, The index of EORAM is equivalent to the data of a block in After flattening, the index of each block is, for example, the index of block (i, j) is ib+j. In other words, the global graph is sliced The blocks are sequentially extracted row by row, and each block is used as a single array element to form a fourth array. It should be understood that the physical index sequence of the fourth array is consistent with its logical index sequence.

[0133] Furthermore, EORAM can establish an index mapping based on the third array, and VORAM can establish an index mapping based on the fourth array. Since the processes of establishing index mapping for the two are similar, for the sake of simplicity, the third array and the fourth array are collectively referred to as original arrays, and the steps of constructing index mapping are described below:

[0134] ① Use the random permutation function π to rearrange the original array to obtain and store the index mapping fragments In other words, the calculation square S i Based on the original array Arr and its logical index sequence, the MPC calculation for out-of-order rearrangement is performed in conjunction with other computing parties to obtain the rearranged array ShuArr corresponding to the original array Arr, and the index mapping fragment indicating the mapping of the logical index sequence to the physical index sequence of the rearranged array This process is called ShuffleMem in this paper (Section 4.5 below introduces the optimization solution for this process).

[0135] ② Build an index map to convert the logical index i into a physical index p, pointing to the corresponding array element in ShuArr. Specifically, Arr i and ShuArr p points to the same graph data part, that is, p = π(i). For the index mapping vector The construction of can refer to the above description of ORAM.

[0136] The above introduces the index construction in GORAM. The constructed index data includes: a) logical index sequence. It should be understood that the logical index sequence of the original array and the rearranged array is consistent; b) the slice of the index mapping vector used to map the logical index sequence to the rearranged array. It can be understood that VORAM and EORAM each correspond to a set of index data; in addition, the calculation method S i Only the rearranged array needs to be stored.

[0137] In the above construction method, replacing the general components of the array with the graph data part has a significant advantage. Specifically, the depth of the index layer is only related to the number of graph data parts. The index layer depths in VORAM and EORAM are b and b respectively. 2 , has nothing to do with the size of the graph data portion, or the number of connected edges in it.

[0138] It should be noted that GORAM may not be used in the improved solution. In this case, after obtaining the third array and the fourth array, the two are directly stored for subsequent graph queries.

[0139] In general, it is better to calculate the formula S i Sharding for the global graph The two arrays stored to support subsequent queries are called the first array and the second array. 1) When GORAM technology is not used, the first array can be the third array mentioned above, and the second array can be the fourth array mentioned above. The first and second arrays each correspond to a set of index data including a logical index sequence and a physical index sequence that is the same as the logical index data. 2) When GORAM technology is used, the first and second arrays are each rearranged arrays corresponding to the third and fourth arrays, and the corresponding set of index data includes a logical index sequence and an index mapping shard.

[0140] 4.5 Constant Round ShuffleMem Optimization

[0141] In the offline initialization phase, the computation and communication overhead of the ShuffleMem construction process accounts for the highest proportion. For an array Arr with n blocks and each block has B bits, the existing technology that can implement ShuffleMem has a communication and computation complexity of O(nBlogn), which is not practical for large nB, especially when each block also includes padding edges, which means that B is particularly large. To optimize this, the improved scheme proposes a ShuffleMem construction protocol with a constant round of O(nB) to accelerate the offline initialization phase.

[0142] 4.5.1 ShuffleMem build process requirements.

[0143] Each computing party holds the original array in is the graph data portion corresponding to the logical index i, or the global subgraph shard. For the introduction of the original array, please refer to the content of Section 4.4 above. After executing the ShuffleMem protocol, each computing party obtains two arrays output by the protocol. and

[0144] Rearranged array The corresponding plaintext is the result of applying the random permutation function π to D. π is a bijective function that replaces the array element D originally stored at the i-th position in D i Move to the π(i)th position. satisfy That is, Index Mapping Sharding Each element Record D i exist The position in.

[0145] 4.5.2 The core idea of ​​the constant round protocol. In the prior art, there is a constant round reordering protocol based on the (2, 3)-secret sharing framework, which can achieve a reordering of the array D with a complexity of O(n) and a communication round of O(1). However, the existing protocol has not been extended to computing The constant round protocol disclosed in the embodiments of this specification proposes an improvement by utilizing the following characteristics in the permutation:

[0146] ① Permutations are composable, that is, for a given vector x, there exists

[0147] ②Permutation is reversible. For any permutation function π, there exists a reversible function π -1 Make

[0148] ③The permutation function has a mapping vector Where L = {0, 1, ..., n-1}, n is the size of the vector x.

[0149] Specifically, the protocol design allows three computing parties to use a random permutation function π 12 , π 23 and π 31 , collaborate to achieve the rearrangement of data, that is, The permutation function π ij Only the calculation square S i and S j Because each computing party only knows 2 of the 3 random permutation functions, the global permutation function π 12 It is still unknown to each computing party. Based on this architecture, it is proposed to calculate by rearranging the index sequence L = {0, 1, ..., n-1} The inverse function of the rearrangement function is used, namely in Can be seen as Secret sharing shard.

[0150] 4.5.3 Construction of Constant Round Protocol

[0151] Intuitively, the execution flow of the constant round protocol can be seen in Figure 5 The following combination Figure 5 Describe the execution flow of the protocol.

[0152] First, it should be explained that each pair of calculation square S i and S j Share random seeds in advance i,j .like Figure 5As shown, the input of the protocol includes: two shards A and B held by computing party S1, two shards B and C held by S2, and two shards C and A held by S3, satisfying In other words, S1 holds Other parties hold It can be easily inferred.

[0153] Specifically, S1, S2, and S3 first hold the secret sharing shards of sequence 0, i.e. Each Z i is uniformly random. Each S i Only know Z i , which requires no interaction after a one-time setup.

[0154] exist Figure 1 In the protocol phase 0 shown in FIG. 1 , a secret sharing fragment of sequence L = [n] is constructed. The computing party S1 calculates locally Each calculation square S i+1 Send its local shard for L to the previous computation party S i .

[0155] exist Figure 1 In the protocol phase 1), each computing party uses a random seed s i,j Configuration-related random numbers. Specifically, each pair of computing parties generates a random number Z i,j and As well as with the original array The plaintext D and the random number associated with the sequence plaintext L, that is, and These random numbers are used directly as the reordering result. and In addition, each pair of computing squares S i and S j Each generates a random permutation function π i,j and

[0156] exist Figure 1 In the protocol phase 2 shown, the computing party starts to execute the main protocol. The execution of the protocol has the following two invariants:

[0157] ① is the rearrangement of D.

[0158] For example,

[0159] ② It is the result of reverse rearrangement of L.

[0160] For example,

[0161] That is to say, during the execution of the main protocol, multiple computing parties calculate This constitutes the final sharding of π(D). For the random permutation function Its characterization vector Constructed in a similar manner, but in reverse order.

[0162] exist Figure 1 In the protocol stage 3), the computing party S1 obtains the protocol output and The computing party S2 obtains the protocol output and The computing party S3 obtains the protocol output and

[0163] The above introduces the specific implementation of the improved solution in the offline initialization phase. Next, we will introduce how each computing party performs global graph sharding based on the offline initialization phase. The two sets of arrays and the corresponding two sets of index data are constructed to provide online graph query services for the client.

[0164] 5. Online Query Phase of Improvement Plan

[0165] 5.1 Accessing the graph partition

[0166] After the offline initialization phase, each computing party S i Maintain the global graph shards held by the party The two arrays (the first array and the second array) and the corresponding two sets of index data are constructed. In the online query stage, any computing method S i You can perform the following steps:

[0167] Step 1): Receive a graph query request sent by a client, which includes the object identity shard of the target object under secret sharing, where the target object is a node or an edge. That is, the object identity shard can be the target node shard Or target edge shard

[0168] Step 2): Determine the target array in the two arrays according to the type of the target object. Specifically, when the target object is a node, the first array in the two arrays is determined as the target array, for example, the rearranged array constructed in the above VORAM; or, when the target object is an edge, the second array in the two arrays is determined as the target array, for example, the rearranged array constructed in the above EORAM.

[0169] Step 3): Based on the object identification sharding and the target index data corresponding to the target array, the first MPC calculation is performed in conjunction with other computing parties to locate a single array element of the target array. Specifically:

[0170] First, the index slice of the target logical index of the target object in the target array is determined using the object identifier slice.

[0171] In one embodiment, it is assumed that the object identification fragment is the target node fragment At this point, the index fragmentation can be calculated It should be understood that this calculation can be done locally based on The public parameter k is implemented using homomorphic plaintext and ciphertext operations, or it can be obtained by performing privacy calculations in conjunction with other computing parties.

[0172] In another embodiment, assuming that the object identification fragment is the target edge fragment At this point, the index fragmentation can be calculated It should be understood that this calculation can be done locally based on The public parameters k and b are implemented using homomorphic plaintext and ciphertext operations, or they can be obtained by performing privacy calculations in conjunction with other computing parties.

[0173] Then, based on the index slices calculated above and the target index data corresponding to the target array, a single array element is located by performing a first MPC calculation.

[0174] In one embodiment, the above offline initialization phase uses GORAM technology. At this time, the calculated index sharding and the index mapping shards in the target index data Execute the first MPC calculation to obtain the target physical index p=π(i) corresponding to the target logical index i, and then, according to the target physical index p, select the stored target array Locate the corresponding single array element

[0175] In another embodiment, the GORAM technology is not used in the offline initialization phase. In this case, the calculated index sharding can be used. The first MPC calculation is performed jointly with other computing parties to obtain the target logical index i, and then this target logical index i is directly used as the target physical index p=i, and then the stored target array Locate the corresponding single array element

[0176] Step 4): Based on the global subgraph shard contained in the single array element located above, and the identification shard of the target object, a second MPC calculation is performed in conjunction with other computing parties to obtain a result shard of the graph query result for providing to the client.

[0177] It should be understood that the protocol design of the second MPC calculation is adapted to the query operation indicated by the query request. Next, the implementation of step 4) is exemplarily introduced by taking the query operation as edge query, neighbor node technology and neighbor node acquisition as examples.

[0178] 5.2 EdgeExist query

[0179] Edge existence query is used to detect the existence of a given edge (v s , v d ) exists, if it exists, it must be included in the block of G.Block Or the logical index in the second array is In this way, it is possible to avoid globally traversing the b*b*l pieces of connection edge data, and only need to compare with the l pieces of connection edge data in a single array element.

[0180] The following Algorithm 2 gives an example of edge existence query calculation, where the location of a single array element is based on index sharding. Access EORAM to obtain. It is a mask sharding that performs equality judgment (EQ) on the l connected edges corresponding to a given edge and a single array element, and finally aggregates the mask through a logical OR operation to obtain the result sharding of the edge existence query

[0181]

[0182]

[0183] 5.3 NeighborsCount

[0184] Neighbor node counting counts the outgoing edges of the target node v. All outgoing edges of the target node v exist in G.Block and are located in In the b blocks of rows, we can locate the logical index in the first array as A single array element includes b*l pieces of connection edge data. Thus, it is possible to avoid global traversal of b*b*l pieces of connection edge data, and only need to perform query processing based on bl pieces of connection edge data in a single array element.

[0185] The following Algorithm 3 gives an example of calculating the neighbor node count, where the location of a single array element is based on index sharding: Similarly, the target node v is compared with all b*l starting points in a single array element, and the bit number slices with the comparison result of 1 are obtained. Since counting is functionally equivalent to addition, the Boolean slices are converted into Convert to arithmetic sharding In order to implement addition efficiently.

[0186]

[0187] 5.4 NeighborsGet

[0188] Neighbor node query is used to obtain all first-order neighbors of the target node v. At the same time, it is best to ensure the privacy of the connection strength of the target node v. Algorithm 4 below gives an example of the calculation of neighbor node query. In Algorithm 4, the first three lines construct by accessing the corresponding single array element and comparing the starting point of the target node v and the bl connecting edges in the array element. where mask indicates all edges starting from the target node v. Then, Multiply the bits with the endpoints of the bl edges to get the slices indicating the candidate first-order neighbors It should be understood that in one embodiment, As the query result shard returned to the client.

[0189]

[0190]

[0191] In another embodiment, considering The bl bits in are either Either Where u is the first-order neighbor of the target node v, The number of will leak the connection strength between v and u, so in Algorithm 4, lines 5-8 are also designed to implement Deduplication.

[0192] Specifically, Algorithm 4 assumes that the extracted bl connecting edges are pre-assigned according to the key v s ||v d Sorting is performed (for this, please refer to the relevant description in the above embodiment). At this time, all the connecting edges with the same starting and ending points are arranged adjacently. Therefore, Algorithm 4 proposes Remove the first and last bits of the two bit strings, that is, and Perform inequality test (NEQ) to obtain For multiple identical endpoints arranged adjacently in candidate, only the corresponding bit of the last endpoint in same_mask is 1, and the others are 0. and By performing a bitwise multiplication operation, The bits corresponding to the repeated neighbors in are set to

[0193] Also note that Neighbor node u i and u i+1 The interval between them implies that the candidate u i+1 Therefore, in Algorithm 4, a shuffle operation is applied in line 8 to hide the quantity information.

[0194] 5.5 Complex Queries

[0195] It should be understood that the client can complete more complex queries by submitting multiple basic queries introduced above. In addition, the client can also provide user-defined functions to perform arbitrary statistical queries. The following two examples illustrate how to use them.

[0196] 1) Loop identification is crucial in transaction graph analysis. Identifying whether transactions across multiple suspicious accounts form a loop is an effective way to detect illegal fund transfers. Loop identification is equivalent to a series of edge existence queries, i.e., given three vertices v1, v2, and v3, by submitting edge existence queries on the edges (v1, v2), (v2, v3), and (v3, v1), as well as their reverse order, the client can detect whether there is a loop between the three vertices. Similarly, the client can submit more edge existence queries for more than three vertices.

[0197] 2) Clients can perform egocentric statistical queries based on the attribute fields of the graph. For example, each edge has additional fields recording attributes such as creation timestamp and transaction amount. These queries can be easily implemented by extending the basic query process.

[0198] In summary, by adopting the improved graph query solution disclosed in the embodiments of this specification, any number of data providers are supported to perform privacy-preserving graph fusion. At the same time, for any query about a point or an edge, the corresponding subgraph can be extracted for analysis, thereby avoiding full graph traversal. Furthermore, by constructing a graph-native graph query engine GORAM, that is, a graph RAM that is divided into blocks based on the characteristics of graph data, the security of obtaining subgraphs can be further improved while ensuring the efficiency of queries, and achieving real-time query response.

[0199] Corresponding to the method steps in the above-mentioned graph query solution, the embodiments of this specification also disclose related devices.

[0200] Figure 6 An apparatus for jointly constructing graph data based on privacy protection disclosed in an embodiment of this specification, wherein the apparatus 600 shown is integrated into any computing party among multiple computing parties, specifically including the following functional modules:

[0201] The private graph shard receiving module 610 is configured to receive private graph shards of its private graph data under secret sharing from any data party among the N data parties, wherein the private graph data is organized into a matrix consisting of b*b blocks, wherein the block in the i-th row and j-th column records: a list of connection edges in the private graph of the data party whose starting point and end point are respectively located in the i-th and j-th node ranges, wherein b is a public parameter. The private graph shard combining module 620 is configured to combine the N received private graph shards, thereby constructing a global graph shard for the global graph data in this party, wherein the global graph data is a fusion result of the N private graph data of the N data parties. The global graph number construction module 630 is configured to construct two arrays and two corresponding sets of index data based on the global graph shards; wherein the first array contains b first elements, and a single first element corresponds to a row of b blocks of data in the global graph shard; the second array contains b 2 The second elements correspond to b in the global graph slice. 2 Blocks of data.

[0202] In some embodiments, the multiple connection edges in the connection edge list are arranged in a joint key order of the start point and the end point.

[0203] In some embodiments, the number of connected edges recorded in each of the b*b blocks is the same; and at least one of the b*b blocks contains filled empty edges.

[0204] In some embodiments, the private graph shard combination module 620 is specifically configured as follows: obtaining N connection edge list shards in the N blocks that are all located in the i-th row and j-th column in the N private graph shards; jointly sorting the connection edge shards in the N connection edge list shards according to the starting point identifier by performing MPC calculation for joint comparison with other computing parties; and forming a block in the i-th row and j-th column in the global graph shard based on the jointly sorted connection edge shards.

[0205] In some embodiments, the global graph number construction module 630 is specifically configured as follows: sequentially extracting the global graph slices by rows, with each row forming a third array as a single array element, and the physical index sequence of the third array being consistent with its logical index sequence; sequentially extracting blocks by rows from the global graph slices, with each block forming a fourth array as a single array element, and the physical index sequence of the fourth array being consistent with its logical index sequence; and determining the two arrays and the corresponding two sets of index data based on the third and fourth arrays and their respective logical index sequences.

[0206] Further, in some specific embodiments, the global graph number construction module 630 is configured to determine the two arrays and the corresponding two sets of index data based on the third and fourth arrays and their respective logical index sequences, specifically including: taking the third array and the fourth array as the original arrays respectively; based on the original arrays and their logical index sequences, jointly performing MPC calculations for out-of-order reordering with other computing parties to obtain a reordered array corresponding to the original array, and an index mapping segment indicating that the logical index sequence is mapped to a physical index sequence of the reordered array; incorporating the reordered array into the two arrays, and taking the logical index sequence of the original array as the logical index sequence of the reordered array, and incorporating it together with the index mapping segment into a set of index data corresponding to the reordered array.

[0207] Furthermore, in some examples, the MPC calculation for the shuffle is implemented through a target protocol, the input of which includes the original array and its corresponding logical index sequence, as well as locally randomly generated shards of the shuffle function and inverse function shards of the shuffle function for the shuffle.

[0208] In some embodiments, the multiple computing parties are 3 computing parties, and the implementation of the secret sharing is based on a (2,3)-secret sharing scheme.

[0209] Figure 7 The present specification discloses a device for performing graph query based on privacy protection, wherein the device 700 shown is integrated into any one of a plurality of computing parties, and the device 700 stores two pre-built arrays and two corresponding sets of index data. Figure 7 As shown, the device 700 includes the following functional modules:

[0210] The target array determination module 710 is configured to determine the target array from the two arrays according to a graph query request received from the client; the graph query request includes an object identification shard of the target object identification under secret sharing; wherein the target object is a node or an edge. The first MPC calculation module 720 is configured to locate a single array element of the target array by performing a first MPC calculation in conjunction with other calculation parties based on the object identification shard and the target index data corresponding to the target array. The second MPC calculation module 730 is configured to obtain a result shard of the graph query result by performing a second MPC calculation in conjunction with other calculation parties based on the object identification shard and the global subgraph shard contained in the single array element, for providing to the client.

[0211] In some embodiments, the target array determination module 710 is specifically configured as follows: when the target object is a node, the first array of the two arrays is determined as the target array; when the target object is an edge, the second array of the two arrays is determined as the target array.

[0212] In some embodiments, the first MPC calculation module 720 is specifically configured to: use the object identification slice to determine the index slice of the target logical index of the target object in the target array; based on the index slice and the target index data, locate the single array element by executing the first MPC calculation.

[0213] Further, in some specific embodiments, the target array is obtained by rearranging the original array, the original array and the target array have the same logical index sequence, and the physical index sequence of the original array is consistent with its logical index sequence; the target index data includes: an index mapping fragment indicating that the logical index sequence is mapped to the physical index sequence of the target array.

[0214] Based on this, the first MPC calculation module 720 is further configured to: perform the first MPC calculation based on the index slice and the index mapping slice to obtain the target physical index corresponding to the target logical index; and locate the stored single array element according to the target physical index.

[0215] In some embodiments, the target object is a target edge, whose edge identification slice includes a target starting point sub-slice and a target ending point sub-slice, and the global subgraph slice includes l edge slices corresponding to l connected edges, each edge slice includes a starting point sub-slice and an ending point sub-slice.

[0216] Based on this, the second MPC calculation module 730 is specifically configured to: copy the edge identification fragment of the target edge into l copies; perform the second MPC calculation based on the l edge identification fragments and the l edge fragments to obtain the result fragment.

[0217] Further, in some specific embodiments, the graph query request indicates a query as to whether the target edge is included in the global graph data; the second MPC calculation module 730 is further configured to: based on 1 target starting point sub-slice in 1 edge identification slices, and 1 starting point sub-slice in the 1 edge slices, by jointly performing a first MPC sub-calculation for bitwise equality determination with other calculation parties, obtain a first mask slice; based on 1 target ending point sub-slice in 1 edge identification slices, and 1 ending point sub-slice in the 1 edge slices, by jointly performing a second MPC sub-calculation for bitwise equality determination with other calculation parties, obtain a second mask slice; based on the first mask slice and the second mask slice, by jointly performing a third MPC sub-calculation for bitwise logical AND operation with other calculation parties, obtain a third mask slice; based on the third mask slice, by jointly performing a fourth MPC sub-calculation for determining whether there is a bit with a value of 1 with other calculation parties, obtain the result slice.

[0218] In some embodiments, the target object is a target node, and the global subgraph slice includes l edge slices corresponding to l connecting edges, and each edge slice includes a starting sub-slice and an ending sub-slice.

[0219] Based on this, the second MPC calculation module 730 is specifically configured as follows: copying the identification slice of the target node into l copies to obtain l target point slices; performing the second MPC calculation based on the l target point slices and the l edge slices to obtain the result slices.

[0220] Further, in some specific embodiments, the graph query request indicates the number of first-order neighbor nodes of the target node to be queried. Based on this, the second MPC calculation module 730 is further configured as follows: based on the 1 target point slices, and the 1 starting point sub-slices in the 1 edge slices, by jointly performing a first MPC sub-calculation for bitwise equality judgment with other calculation parties, a first mask slice is obtained, which belongs to Boolean slice. Based on the first mask slice, by jointly performing a second MPC sub-calculation for slice type conversion with other calculation parties, a second mask slice is obtained, which belongs to arithmetic slice. Based on the second mask slice, by jointly performing a third MPC sub-calculation for calculating bit sum values ​​with other calculation parties, the result slice is obtained.

[0221] In some other specific embodiments, the graph query request indicates querying the first-order neighbor nodes of the target node. Based on this, the second MPC calculation module 730 is further configured to: based on 1 target point slices and 1 starting point sub-slices in the 1 edge slices, by jointly performing a first MPC sub-calculation for bitwise equality judgment with other calculation parties, obtain a first mask slice; based on the first mask slice and 1 end point sub-slices in the 1 edge slices, by jointly performing a second MPC sub-calculation for bitwise multiplication with other calculation parties, obtain a candidate node slice; and determine the result slice based on the candidate node slice.

[0222] Furthermore, in some examples, the second MPC computing module 730 is configured to determine the result sharding based on the candidate node sharding, specifically including: based on the candidate node sharding, obtaining a deduplicated node sharding by jointly performing a third MPC sub-computation for deduplication processing with other computing parties; and determining the result sharding based on the deduplicated node sharding.

[0223] In some more specific examples, the l edge slices in the global subgraph are pre-sorted according to corresponding starting point identifiers, and the computational protocol of the third MPC sub-computation is designed for deduplication of adjacent elements.

[0224] In some more specific examples, the second MPC computing module 730 is configured to determine the result shard based on the candidate node shard, specifically including: based on the deduplicated shard, obtaining the result shard by jointly performing a fourth MPC sub-computation for out-of-order reordering with other computing parties.

[0225] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0226] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for jointly constructing graph data based on privacy protection, applied to any computing party among multiple computing parties, comprising: Receive a private graph shard of its private graph data under secret sharing from any data party among the N data parties, wherein the private graph data is organized into a matrix consisting of b*b blocks, wherein the block in the i-th row and the j-th column records: a list of connection edges in the private graph of the data party whose starting point and end point are respectively located in the i-th and j-th node ranges, wherein b is a public parameter; Combining the received N private graph slices to construct a global graph slice for global graph data in the party, where the global graph data is a fusion result of the N private graph data of the N data parties; Based on the global graph slice, two arrays and two corresponding sets of index data are constructed; wherein the first array contains b first elements, and a single first element corresponds to a row of b blocks of data in the global graph slice; the second array contains b 2 The second elements correspond to b in the global graph slice. 2 Blocks of data.

2. The method according to claim 1, wherein: The multiple connection edges in the connection edge list are arranged in the order of the joint keys of the start point and the end point.

3. The method according to claim 1, wherein: The number of connected edges recorded in each of the b*b blocks is the same; and at least one of the b*b blocks contains filled empty edges.

4. The method according to claim 1 or 2, wherein: Combine the N private graph shards received, including: Obtain N connection edge list fragments in N blocks located in the i-th row and j-th column of the N private graph fragments; By performing MPC calculation for joint comparison with other computing parties, the connection edge fragments in the N connection edge list fragments are jointly sorted according to the starting point identifiers; The block of the i-th row and j-th column in the global graph slice is formed based on the joint sorted connected edge slices.

5. The method according to claim 1, wherein: Based on the global graph sharding, two arrays and two corresponding sets of index data are constructed, including: Sequentially extract the global graph slices by row, and each row is used as a single array element to form a third array, and the physical index sequence of the third array is consistent with its logical index sequence; Sequentially extracting blocks row by row from the global graph slice, each block being used as a single array element to form a fourth array, wherein a physical index sequence of the fourth array is consistent with a logical index sequence thereof; Based on the third and fourth arrays and their respective logical index sequences, the two arrays and the corresponding two sets of index data are determined.

6. The method according to claim 5, wherein: Based on the third and fourth arrays and their respective logical index sequences, determining the two arrays and the corresponding two sets of index data includes: The third array and the fourth array are respectively regarded as original arrays; Based on the original array and its logical index sequence, jointly with other computing parties, perform MPC calculations for out-of-order rearrangement to obtain a rearranged array corresponding to the original array, and an index mapping slice indicating the mapping of the logical index sequence to a physical index sequence of the rearranged array; The rearranged array is classified into the two arrays, and the logical index sequence of the original array is used as the logical index sequence of the rearranged array, and is classified together with the index mapping slice into a set of index data corresponding to the rearranged array.

7. The method according to claim 6, wherein: The MPC calculation for the shuffle is implemented through a target protocol, the input of which includes the original array and its corresponding logical index sequence, as well as locally randomly generated shuffle function slices for the shuffle and inverse function slices of the shuffle function.

8. The method according to claim 1, wherein: The multiple computing parties are 3 computing parties, and the implementation of the secret sharing is based on a (2,3)-secret sharing scheme.

9. A method for performing graph query based on privacy protection, applied to any computing party among multiple computing parties, wherein two arrays constructed based on the method of claim 1 and two corresponding sets of index data are maintained; the method comprises: Determine a target array from the two arrays according to a graph query request received from a client; The graph query request includes an object identification fragment of a target object identification under secret sharing; The target object is a node or an edge; Based on the object identification fragment and the target index data corresponding to the target array, a single array element of the target array is located by jointly performing a first MPC calculation with other computing parties; Based on the object identification slice and the global subgraph slice contained in the single array element, a second MPC calculation is performed in conjunction with other computing parties to obtain a result slice of the graph query result for providing to the client.

10. The method according to claim 9, wherein: According to a graph query request received from a client, determining a target array from the two arrays includes: In the case where the target object is a node, determining the first array of the two arrays as the target array; When the target object is an edge, the second array of the two arrays is determined as the target array.

11. The method according to claim 9, wherein: Locate a single array element of the target array, including: Determine the index slice of the target logical index of the target object in the target array using the object identification slice; Based on the index fragment and the target index data, the single array element is located by performing the first MPC calculation.

12. The method according to claim 11, wherein: The target array is obtained by rearranging the original array, the original array and the target array have the same logical index sequence, and the physical index sequence of the original array is consistent with its logical index sequence; The target index data includes: an index mapping fragment indicating the mapping of the logical index sequence to the physical index sequence of the target array; The step of locating the single array element by performing the first MPC calculation based on the index fragment and the target index data includes: Based on the index shard and the index mapping shard, perform the first MPC calculation to obtain a target physical index corresponding to the target logical index; According to the target physical index, the stored single array element is located.

13. The method according to claim 9, wherein: The target object is a target edge, whose edge identification slice includes a target start sub-slice and a target end sub-slice, and the global subgraph slice includes l edge slices corresponding to l connected edges, each edge slice includes a start sub-slice and an end sub-slice; Wherein, based on the object identification slice and the global subgraph slice contained in the single array element, by jointly performing the second MPC calculation with other computing parties, a result slice of the graph query result is obtained, including: Copy the edge identifier fragment of the target edge into l copies; The second MPC calculation is performed based on the l edge identification fragments and the l edge fragments to obtain the result fragment.

14. The method according to claim 13, wherein: The graph query request indicates querying whether the target edge is included in the global graph data; wherein the second MPC calculation is performed based on the l edge identification slices and the l edge slices to obtain the result slices, including: Based on the 1 target starting point sub-slices in the 1 edge identification slices and the 1 starting point sub-slices in the 1 edge slices, a first mask slice is obtained by performing a first MPC sub-calculation for bit-equality determination in conjunction with other calculation parties; Based on the 1 target endpoint sub-slices in the 1 edge identification slices and the 1 endpoint sub-slices in the 1 edge slices, a second mask slice is obtained by performing a second MPC sub-computation for bit-equality determination in conjunction with other computing parties; Based on the first mask slice and the second mask slice, a third mask slice is obtained by performing a third MPC sub-computation for a bitwise logical AND operation in conjunction with other computing parties; Based on the third mask slice, the result slice is obtained by jointly performing a fourth MPC sub-calculation for determining whether there is a bit with a value of 1 with other calculation parties.

15. The method according to claim 9, wherein: The target object is a target node, and the global subgraph slice includes l edge slices corresponding to l connecting edges, and each edge slice includes a starting sub-slice and an end sub-slice; Wherein, based on the object identification slice and the global subgraph slice contained in the single array element, by jointly performing the second MPC calculation with other computing parties, a result slice of the graph query result is obtained, including: Copy the target node's identification shard into l copies to obtain l target point shards; The second MPC calculation is performed based on the l target point slices and the l edge slices to obtain the result slices.

16. The method according to claim 15, wherein: The graph query request indicates querying the number of first-order neighbor nodes of the target node; wherein the second MPC calculation is performed based on l target point slices and the l edge slices to obtain the result slices, including: Based on the l target point slices and the l starting point sub-slices in the l edge slices, a first MPC sub-computation for bit-equality discrimination is performed in conjunction with other computing parties to obtain a first mask slice, which is a Boolean slice; Based on the first mask shard, by jointly performing a second MPC sub-computation for shard type conversion with other computing parties, a second mask shard is obtained, which belongs to an arithmetic shard; Based on the second mask slice, the result slice is obtained by jointly performing a third MPC sub-calculation for calculating the bit sum value with other calculation parties.

17. The method according to claim 15, wherein: The graph query request indicates querying the first-order neighbor nodes of the target node; wherein the second MPC calculation is performed based on l target point slices and the l edge slices to obtain the result slices, including: Based on the l target point slices and the l starting point sub-slices in the l edge slices, a first mask slice is obtained by performing a first MPC sub-calculation for bit-equality determination in conjunction with other calculation parties; Based on the first mask slice and the l end point sub-slices in the l edge slices, by jointly performing a second MPC sub-computation for bitwise multiplication with other computing parties, a candidate node slice is obtained; The result shard is determined based on the candidate node shard.

18. The method according to claim 17, wherein: Determining the result shard based on the candidate node shard includes: Based on the candidate node shards, obtaining deduplicated node shards by jointly performing a third MPC sub-computation for deduplication processing with other computing parties; The result shard is determined based on the deduplicated node shard.

19. The method according to claim 18, wherein: The l edge slices in the global subgraph are pre-sorted according to the corresponding starting point identifiers, and the computation protocol of the third MPC sub-computation is designed for deduplication of adjacent elements.

20. The method according to claim 18 or 19, wherein: Determining the result shard based on the deduplicated node shard includes: Based on the deduplicated shards, the result shards are obtained by jointly performing a fourth MPC sub-computation for out-of-order rearrangement with other computing parties.

21. A device for jointly constructing graph data based on privacy protection, integrated in any computing party among multiple computing parties, comprising: A private graph shard receiving module is configured to receive private graph shards of private graph data of any data party among the N data parties under secret sharing, wherein the private graph data is organized into a matrix consisting of b*b blocks, wherein the block in the i-th row and the j-th column records: a list of connection edges in the private graph of the data party whose starting point and end point are respectively located in the i-th and j-th node ranges, wherein b is a public parameter; A private graph shard combination module, configured to combine the received N private graph shards to construct a global graph shard for global graph data in the party, wherein the global graph data is a fusion result of the N private graph data of the N data parties; The global graph data construction module is configured to construct two arrays and two corresponding sets of index data based on the global graph slice; wherein the first array contains b first elements, and a single first element corresponds to a row of b blocks of data in the global graph slice; the second array contains b 2 The second elements correspond to b in the global graph slice. 2 Blocks of data.

22. A device for performing graph query based on privacy protection, integrated in any one of a plurality of computing parties, wherein two arrays constructed based on the method of claim 1 and two corresponding sets of index data are maintained; the device comprises: a target array determination module, configured to determine a target array from the two arrays according to a graph query request received from a client; The graph query request includes an object identification fragment of a target object identification under secret sharing; The target object is a node or an edge; A first MPC calculation module is configured to locate a single array element of the target array by performing a first MPC calculation in conjunction with other calculation parties based on the object identification shard and the target index data corresponding to the target array; The second MPC computing module is configured to perform a second MPC calculation in conjunction with other computing parties based on the object identification shard and the global subgraph shard contained in the single array element to obtain result shards of the graph query result for providing to the client.

23. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 20.

24. A computing device comprising a memory and a processor, wherein: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 20 is implemented.