Privacy-protecting method and device for jointly querying shortest path distance by multiple parties

By constructing a boundary graph and utilizing data interaction methods such as secret sharing and privacy computation, the problem of low efficiency in multi-party joint queries for the global shortest path distance is solved, achieving efficient computation and privacy protection, improving computational efficiency and reducing communication overhead.

CN121524322APending Publication Date: 2026-02-13ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511606402.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

In financial transaction network analysis, joint queries for the global shortest path distance by multiple parties are inefficient. Furthermore, due to data privacy regulations and trade secrets, graph data cannot be directly shared, resulting in low computational efficiency and excessive time consumption.

Method used

By constructing a boundary graph and utilizing data interaction methods based on secret sharing and privacy computing, each party can query the shortest path distance from the source point to the destination point in the boundary graph, reducing computational load and protecting privacy data from leakage.

Benefits of technology

It improves the efficiency of multi-party joint query of the global shortest path distance, achieving a speedup of up to 106 times, while reducing communication overhead and protecting privacy data from being leaked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121524322A_ABST
    Figure CN121524322A_ABST
Patent Text Reader

Abstract

The invention discloses a privacy-protecting method and device for jointly querying the shortest path distance by multiple parties. The first party determines a query node pair containing a source point and an end point, the source point is located in a sub-graph of the first party, and the sub-graph is connected with a sub-graph of the second party through edges between respective boundary points. And each party executes first data interaction based on secret sharing based on the edge weight in the respective held boundary diagram, so that each party obtains the data fragment of the first shortest path distance from the source point to each boundary point. Wherein the boundary graph of any party takes the boundary points in the sub-graph held by the party as nodes, and the shortest path distance between the boundary points in the sub-graph held by the party is taken as an edge weight. And the first party and the second party execute second data interaction based on privacy calculation based on the data fragments of the first shortest path distance held by the first party and the data fragments of the second shortest path distance from each boundary point to the end point, so that the first party obtains a global shortest path distance from the source point to the end point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of graph database technology, and in particular to a method and apparatus for privacy-preserving multi-party joint query of the shortest path distance. Background Technology

[0002] In financial transaction network analysis, shortest path distance calculation is a fundamental and critical technical requirement. For example, banks need to identify potential fraud risks by analyzing transaction paths between users. However, in real-world scenarios, graph data is often scattered across graph databases of different institutions. Due to data privacy regulations and trade secret requirements, these institutions cannot directly share their graph data. Furthermore, as businesses expand, the scale of graph data across these institutions reaches staggering levels. Calculating the shortest path distance between these massive graph datasets from different institutions is inefficient and time-consuming.

[0003] Therefore, we hope to find an improved solution that can enhance the efficiency of multi-party collaboration in querying the global shortest path distance in each graph data and reduce the time consumption. Summary of the Invention

[0004] This specification describes one or more embodiments of a method and apparatus for privacy-preserving multi-party joint querying of the shortest path distance, in order to improve the efficiency of multi-party joint querying of the global shortest path distance. The specific technical solution is as follows.

[0005] In a first aspect, the embodiments provide a method for privacy-preserving multi-party joint querying of the shortest path distance, including:

[0006] The first party determines a pair of query nodes containing a source point and an end point; wherein the source point is located in a subgraph held by the first party, and the subgraph is connected to the subgraph held by the second party through edges between their respective boundary points;

[0007] The first party and the second party perform a first data interaction based on secret sharing, based on the edge weights in their respective boundary graphs, so that each party obtains a data slice of the first shortest path distance from the source point to each boundary point; wherein, the boundary graph of any party uses the boundary points in the subgraph held by that party as nodes, and the shortest path distance between each boundary point in the subgraph held by that party as the edge weight.

[0008] The first party and the second party, based on their respective data fragments of the first shortest path distance and the data fragments of the second shortest path distance from each boundary point to the destination, perform a second data interaction based on privacy computation, so that the first party obtains the global shortest path distance from the source point to the destination.

[0009] In one implementation, either party constructs its boundary graph in the following way: determining the shortest path distance between each boundary point of the local subgraph; for any set of boundary points, if the shortest path between the boundary points in the set does not pass through other boundary points, then adding the shortest path distance between the boundary points in the set as an edge weight to its own boundary graph.

[0010] In one implementation, the step of performing the first data interaction based on secret sharing includes:

[0011] The first party queries the initial shortest path distance from the source point to each of its own boundary points in the local subgraph; the second party initializes the initial shortest path distance from the source point to each of its own boundary points; the first and second parties perform a first sub-data interaction based on secret sharing, so that each party obtains a data shard of edge weights in all boundary graphs and a data shard of the initial shortest path distance from the source point to all boundary points; the first and second parties iteratively perform a second sub-data interaction based on multi-party secure computation, based on the data shards of edge weights, the data shards of initial shortest path distances obtained by each party, and the data shards of edge weights between boundary points in each party's boundary graph, so that each party obtains a data shard of the first shortest path distance from the source point to each of its own boundary points.

[0012] In one implementation, the step of iteratively executing the second sub-data interaction based on multi-party secure computation includes: in any iterative query, performing a data interaction based on encrypted path remapping and encrypted aggregation, such that each party obtains a data shard of the new shortest path distance after adding the current shortest path distance to the associated edge weights; wherein the associated edge weights include the associated edge weights in each boundary graph and the associated edge weights between the boundary points of each boundary graph. Next, performing a data interaction based on privacy comparison, such that each party obtains a data shard of the updated shortest path distances from the source point to each boundary point; wherein any updated shortest path distance is the minimum value among the corresponding current shortest path distance and several new shortest path distances.

[0013] In one implementation, the iterative query is executed N times, where N is the total number of boundary points for each party. The data shards obtained by each party representing the first shortest path distance from the source point to each boundary point are the updated shortest path distance data shards obtained by each party after executing the N iterative queries.

[0014] In one implementation, the method further includes:

[0015] After completing logN iterations of the query process, the first party and the second party, based on the data shards of the current shortest path distance from the source point to each boundary point and the data shards of the second shortest path distance from each boundary point to the destination held by each party, perform a third data interaction based on privacy comparison, so that each party obtains the data shards of the actual shortest distance from the source point to the destination in the current iteration and the data shards of the theoretical shortest distance; where N is the total number of boundary points of each party;

[0016] The first party and the second party, based on their respective data slices of the actual shortest distance and the data slices of the theoretical shortest distance, perform a fourth data interaction based on privacy computation, so that the first party obtains the difference between the actual shortest distance and the theoretical shortest distance;

[0017] Firstly, differential privacy processing is performed on the difference to obtain a first value that is less than the current number of remaining iterations. This first value is used as the new number of remaining iterations.

[0018] In one implementation, when the endpoint is located in a subgraph held by the first party, the step of performing the second data interaction based on privacy computation includes: performing the second data interaction based on privacy computation based on data fragments of the first shortest path distance corresponding to each boundary point of the first party held by each party, and data fragments of the second shortest path distance from each boundary point of the first party to the endpoint.

[0019] In one implementation, when the endpoint is located in a subgraph held by the second party, the step of performing the second data interaction based on privacy computation includes: performing the second data interaction based on privacy computation based on data fragments of the first shortest path distance corresponding to each boundary point of the second party held by each party, and data fragments of the second shortest path distance from each boundary point of the second party to the endpoint.

[0020] In one implementation, the step of performing the second data interaction based on privacy computation includes: a first party and a second party performing a data interaction based on privacy summation and privacy comparison, such that each party obtains a data fragment with the minimum sum of shortest path distances. The minimum sum of shortest path distances is the minimum of the sums of the first shortest path distances of each boundary point of the second party and the second shortest path distances of the same boundary point. The first party, based on the data fragment with the minimum value sent by the second party and held by itself, determines the complete minimum value and uses it as the global shortest path distance from the source point to the destination point.

[0021] Secondly, the embodiments provide a privacy-preserving method for multi-party joint querying of the shortest path distance, executed by a first party, including:

[0022] Determine a pair of query nodes that include a source node and an end node; wherein the source node is located in the subgraph held by the first party, and the subgraph is connected to the subgraph held by the second party through edges between their respective boundary points;

[0023] Based on the edge weights in the boundary graphs held by each party, a first data interaction based on secret sharing is performed with the second party, so that each party obtains a data shard of the first shortest path distance from the source point to each boundary point; wherein, the boundary graph of any party uses the boundary points in the subgraph held by that party as nodes, and the shortest path distance between each boundary point in the subgraph held by that party as the edge weight.

[0024] Based on the data fragments of the first shortest path distance held by each party and the data fragments of the second shortest path distance from each boundary point to the destination, a second data interaction based on privacy computation is performed with the second party, so that the first party obtains the global shortest path distance from the source point to the destination.

[0025] Thirdly, the embodiments provide a privacy-preserving method for multi-party joint querying of the shortest path distance, executed by a second party, including:

[0026] Based on the edge weights in the boundary graphs held by each party, a first data interaction based on secret sharing is performed with the first party, so that each party obtains a data shard containing the first shortest path distance from the source point to each boundary point; wherein, the query node pair containing the source point and the destination point is determined by the first party, the source point is located in the subgraph held by the first party, and the subgraph is connected to the subgraph held by the second party through the edges between their respective boundary points; the boundary graph of any party uses the boundary points in the subgraph held by that party as nodes, and the shortest path distance between each boundary point in the subgraph held by that party as the edge weight.

[0027] Based on the data fragments of the first shortest path distance held by each party and the data fragments of the second shortest path distance from each boundary point to the destination, a second data interaction based on privacy computation is performed with the first party, so that the first party obtains the global shortest path distance from the source point to the destination.

[0028] Fourthly, the embodiments provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in any one of the first to second aspects.

[0029] Fifthly, an embodiment provides a computing device including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in any one of the first to second aspects.

[0030] In the methods and apparatus provided in the embodiments of this specification, any party constructs a boundary graph based on its own subgraph and its boundary points. When querying the shortest path distance from the source point to the destination, each party performs a first data interaction based on secret sharing, based on the edge weights of the boundary graph held by each party. This realizes the query process of data fragments for the first shortest path distance from the source point to each boundary point in each party's boundary graph. Then, based on the data fragments of the first shortest path distance and the data fragments of the second shortest path distance from each boundary point to the destination, each party performs a second data interaction based on privacy computation, thereby obtaining the global shortest path distance from the source point to the destination. The embodiments do not require traversing the subgraphs of each party to find the shortest path between the source point and the destination. Instead, the shortest path distance from the source point to each boundary point is found by traversing the boundary graph based on the shortest path distance between the boundary points represented by the edge weights in the boundary graph. This greatly reduces the computational load of the shortest path distance, improves the efficiency of multi-party joint queries for the global shortest path distance, and protects privacy data from leakage. Attached Figure Description

[0031] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0032] Figure 1 This is a schematic diagram illustrating the principle of risk analysis between two parties using a transaction network diagram.

[0033] Figure 2 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this application;

[0034] Figure 3 A flowchart illustrating a method for privacy-preserving multi-party joint query of the shortest path distance provided in an embodiment;

[0035] Figures 4-6 This is a schematic diagram illustrating the multiple data processing steps in any given iterative query process.

[0036] Figure 7 A schematic block diagram of an apparatus for multi-party joint query of the shortest path distance provided in an embodiment;

[0037] Figure 8A schematic block diagram of another apparatus for multi-party joint query of the shortest path distance provided in the embodiments. Detailed Implementation

[0038] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0039] As mentioned earlier, in financial transaction network analysis, different institutions hold their own transaction network graphs, which contain nodes and edges between them. Nodes represent users, and edges represent transactions between users, each with a weight. The edge weights in the transaction network graph can be values ​​determined based on the transaction amount and / or the number of transactions represented by the edge. Different institutions can, under privacy-preserving conditions, jointly calculate the shortest path distance between two user nodes globally based on their respective transaction network graphs. This shortest path distance is the sum of the weights of all edges along the shortest path. The transaction network graph can be a directed graph or an undirected graph. The two user nodes can be referred to as the source and the destination, respectively.

[0040] The aforementioned institutions may include banks or third-party payment institutions. When an institution receives a transaction to be executed between two users, it can determine the risk level of the transaction by identifying the shortest path distance between the two users, i.e., whether the transaction is high-risk or low-risk.

[0041] Figure 1 This is a schematic diagram illustrating the principle of risk analysis between two parties using a transaction network graph. Bank P and Bank Q each hold their own transaction network graphs. When determining the transaction risk between user A and user B, Bank P can query the shortest path distance between user A and user B based on its transaction network graph. This shortest path may cross into Bank Q's transaction network graph through edges between boundary points. Here, edges between boundary points represent interbank transactions, and the nodes connected by these interbank transaction edges are boundary points. Each bank's transaction network graph is private data and cannot be sent out in plaintext.

[0042] When the shortest path distance between two users is greater than a threshold, the social distance between the two users is considered very far, and the transaction is considered high-risk; when the shortest path distance between two users is greater than a threshold, the social distance between the two users is considered relatively close, and the transaction is considered low-risk.

[0043] Other risk assessments can also be made based on the shortest path distance between two users, which will not be listed here.

[0044] In this system, the transaction network graph of any single institution can be considered a subgraph, and the transaction network graphs of all institutions collectively form the global graph. Subgraphs are connected by edges between boundary points, and each institution's subgraph contains both boundary and non-boundary points from its subgraph. For example, in... Figure 1 In the transaction network graph of bank P, nodes C, D, and E are boundary points, while nodes A and B are non-boundary points; in the transaction network graph of bank Q, nodes F and G are boundary points. When multiple parties jointly determine the global shortest path distance, each institution acts as a different participant.

[0045] When determining the global shortest path distance jointly by multiple parties, iterative computation can be performed on the subgraphs provided by each party based on Secure Multi-Party Computation (MPC). However, when the subgraph is very large, this iterative computation process becomes extremely time-consuming and computationally inefficient.

[0046] To improve the computational efficiency of multi-party joint determination of the global shortest path distance, this application provides a privacy-preserving method for multi-party joint querying of the shortest path distance. This method is based on a boundary graph constructed by each party. The following describes the method in conjunction with... Figure 2 Please provide an explanation.

[0047] Figure 2 This is a schematic diagram illustrating an implementation scenario of an embodiment disclosed in this application. It includes a computing device of a first party and a computing device of a second party, a first subgraph held by the first party, a second subgraph held by the second party, a first boundary graph held by the first party, and a second boundary graph held by the second party. In each boundary graph, nodes are boundary points in the corresponding subgraph, and edge weights are the shortest path distances between boundary points in the corresponding subgraph. The first party and the second party perform data interaction based on privacy computation, performing a global query in their respective boundary graphs, enabling the query initiator to obtain the shortest path distance between the source and destination points globally. This shortest path distance is also the shortest path distance within the global scope formed by the first and second subgraphs, but the query search process is actually performed within the boundary graphs of each party, and its search results are equivalent to the search results obtained within the global scope formed by the first and second subgraphs.

[0048] Since the number of nodes and edges in the first boundary graph is much smaller than that in the first subgraph, and the number of nodes and edges in the second boundary graph is much smaller than that in the second subgraph, the computational efficiency of the query process provided in this embodiment is greatly improved. The applicant conducted experiments on large-scale subgraphs, and the results show that, compared with existing solutions, this embodiment can achieve a runtime efficiency of up to 10... 6 It provides a speedup of up to 10 times and reduces communication overhead by more than 10 times. 6 times.

[0049] The technical concepts involved in this embodiment are explained below.

[0050] A graph, including a transaction network graph, subgraphs, and boundary graphs, is a non-linear data structure composed of nodes and edges. Edges represent relationships between nodes and can be directed or undirected, possibly with weights (such as the number of transactions or the transaction amount).

[0051] The shortest path distance is the distance of the path with the smallest sum of edge weights among all possible paths between two nodes in a graph. The distance is the sum of the edge weights contained in the path.

[0052] Privacy-preserving computation refers to a technology that enables multiple parties to collaborate on computations while protecting data privacy. It ensures that participating parties cannot access the raw data of other parties, but only obtain the computation results.

[0053] Shortest path distance calculation based on privacy protection refers to the collaborative calculation of the shortest path distance between two nodes by multiple participants, each holding a portion of the graph data (their respective subgraphs) without disclosing their private data.

[0054] A 2-hop index is a graph index structure used for efficiently finding the shortest path. This index pre-computes and stores a set of labels for each node, with each label containing a node and the distance to that node. Shortest path queries are quickly answered by combining these labels (two hops).

[0055] Secure multi-party computation (MPC) is a privacy-preserving computation protocol that allows multiple parties to collaboratively compute a function and output only the result without revealing their individual private inputs. MPC uses cryptographic techniques to protect data privacy, ensuring that each party completes the computation task without disclosing its own data. The MPC protocol incorporates algorithms such as secret sharing, homomorphic encryption, obfuscated circuits, and unintentional transmission. Besides using MPC for privacy-preserving computation, this embodiment can also utilize other privacy-preserving computation techniques.

[0056] Figure 2 This is one implementation scenario in which the query method provided in this embodiment can be applied. The query method provided in this embodiment can also be applied in other implementation scenarios, such as scenarios with two or more parties. For ease of explanation, the following description will continue to use the first party (P0 party) and the second party (P1 party) as examples. It can be understood that the first party and the second party each execute the relevant output processing procedures through their respective computing devices. The computing device of any party can be implemented through any device, equipment, platform, device cluster, etc., with computing and processing capabilities.

[0057] The following is combined Figure 3 The query method provided in this embodiment will be described in detail.

[0058] Figure 3 This is a flowchart illustrating a privacy-preserving multi-party joint query method for finding the shortest path distance, provided as an embodiment. This embodiment includes an index building phase and an online query phase. The index building phase only needs to be executed once, while the online query phase can be executed multiple times, with each query based on the already built index. In the steps included in this method, steps S310 and S320 belong to the index building phase, and steps S330 to S350 belong to the online query phase. Party P0 holds subgraph G0, and party P1 holds subgraph G1.

[0059] In step S310, P0 constructs the corresponding 2-hop index H0 locally based on the data in subgraph G0, and P1 constructs the corresponding 2-hop index H1 locally based on the data in subgraph G1.

[0060] A 2-hop index can also be called a two-hop index or a two-hop label index. Subgraphs G0 and G1 each contain multiple nodes representing users and edges representing transactions between users. Edges have edge weights, which can be determined based on transaction information, such as transaction amount and number of transactions.

[0061] The purpose of this step is to establish a shortest path index covering the subgraph in each party's local subgraph. P0's subgraph G0 can be stored in a graph database, from which P0 can read information such as nodes and edges. P1's subgraph G1 can also be stored in a graph database, from which P1 can read information such as nodes and edges.

[0062] The following uses P0 as an example to illustrate the construction process of the 2-hop index H0. P0 traverses all node pairs (u, v) in the local subgraph G0 and uses algorithms such as 2-hop labeling to extract the following label information for each node pair: source label L(u) and destination label L(v). The source label L(u) contains all intermediate nodes reachable from node u and their corresponding distances. The destination label L(v) contains all intermediate nodes reachable from node v and their corresponding distances.

[0063] by Figure 1 Taking the transaction network graph of Bank of China P as an example, the label information of node pair (A, B) is as follows:

[0064] Lout(A)={(C,1),(K,100)……}

[0065] Lout(B)={(E,1),(K,10)……}

[0066] Among them, node K is Figure 1 Not shown in the diagram. C is an intermediate node reachable from node A in 1 hop, and K is an intermediate node reachable from node A in 100 hops. E is an intermediate node reachable from node B in 1 hop, and K is reachable from node B in 10 hops. Assume... Figure 1 If the weights of both sides are 1, then the path distance is the sum of the number of hops in the path.

[0067] If the shortest path from (u,v) involves boundary points, the label information is marked with a boundary flag. For each set of paths in the label information, only the shortest distance path is retained. For example, in Lout(A), (K,100) indicates that the path from A to K involves 100 hops, which is the shortest path distance between A and K. When querying the shortest path distance from A to B, the intersection of the intermediate nodes, i.e., K, is found in the labels Lout(A) and Lout(B). Then, the shortest path from A to B can be determined as A-100-→K-10-B (represented by 2 hops), thus the shortest path distance between A and B is 100+10=110.

[0068] P0 constructs a local label index H from the label information of all node pairs in subgraph G0. s0 Using the same method, P1 constructs a local label index H from the label information of all node pairs in subgraph G1. s1 .

[0069] In step S320, P0 determines the shortest path distance between each boundary point in its local subgraph G0, treats each boundary point as a node, and uses the shortest path distance as the edge weight to construct P0's boundary graph G. B0 P1 determines the shortest path distance between each boundary point in its local subgraph G1, treats each boundary point as a node, and uses the shortest path distance as the edge weight to construct P1's boundary graph G. B1 .

[0070] The boundary graph is used as an index during the online query phase. Each side's boundary graph uses the boundary points in the subgraph held by that side as nodes, and the edge weights are the shortest path distances between each boundary point in the subgraph held by that side.

[0071] The purpose of this step is to connect the boundary points of each subgraph and pre-query the shortest path distance between the boundary points so that the "shortest path distance between boundary points" can be directly used during the online query phase.

[0072] Each party can read information such as nodes and edges from its local graph database to determine the shortest path distance between boundary point pairs, and then construct the corresponding boundary graph based on the local boundary point set and the shortest path distance between boundary point pairs.

[0073] by Figure 2 For example, the boundary point set of the first subgraph contains nodes 0, 1, and 2. The boundary point set of the second subgraph contains nodes 3, 4, and 5. The first subgraph and the second subgraph held by the second party are connected by edges between their respective boundary points. These edges include: the edge from node 3 to node 0, the edge from node 0 to node 4, the edge from node 5 to node 1, and a bidirectional edge between nodes 2 and 5. The first party determines the shortest path distance between its boundary points (nodes 0, 1, and 2) within its local first subgraph, without interacting with the second party. The second party determines the shortest path distance between its boundary points (nodes 3, 4, and 5) within its local second subgraph, without interacting with the first party.

[0074] The following uses P0 as an example to illustrate its boundary graph G. B0 The construction process.

[0075] P0 scans its subgraph G0 locally to identify its boundary point set V. B0 Next, enumerate all local boundary point pairs (b1, b2), and determine their values ​​based on the local label index H. s0 Query whether there exists a path between boundary point pairs (b1, b2) that satisfies the following conditions: ① the path distance is the shortest in the local subgraph G0; ② it does not pass through other boundary points. This can be determined based on the label index H. s0 The included boundary path identifiers determine whether the path does not pass through other boundary points.

[0076] If it exists, the path is deemed valid. This path is then used as the edge weight for the boundary point pair (b1, b2), and the pair (b1, b2) is added to the local boundary graph G. B0 middle.

[0077] A valid path is the shortest path between two boundary points that does not contain any additional boundary points. In a boundary graph, there is either no edge or only one edge between any two boundary points.

[0078] Using the same method described above, P1 can determine its own set of boundary points V within the subgraph G1. B1 Find the shortest path distance between each boundary point and construct the local boundary graph G. B1 .

[0079] In this embodiment, the tag index H is used. s0The included boundary path identifiers can identify the shortest path distance between boundary point pairs that does not contain other boundary points, and construct the corresponding edges in the boundary graph. The boundary graph constructed in this way can remove redundant edges, reduce the number of edges in the boundary graph, and thus reduce communication overhead in subsequent calculations.

[0080] For example, with Figure 2 Taking the first subgraph as an example, if a valid path can contain other boundary points, then based on the first subgraph, edges can be established in the boundary graph between nodes 0 and 1, between nodes 0 and 2, and between nodes 1 and 2. These edges are stored in pairs, resulting in n edges. 2 There are 'n' edges, where n is the number of boundary points in the corresponding subgraph. There is redundancy in the boundary graph. If a valid path cannot contain other boundary points, an edge between nodes 0 and 2 will not be constructed in the boundary graph, because the shortest path between nodes 0 and 2 includes node 1, and storing edges (0,1) and (1,2) can indirectly represent (0,2), thus reducing the number of edges.

[0081] After this step, each party obtains its own boundary graph, and subsequent queries and calculations will be performed on these boundary graphs and the edges shared by both parties.

[0082] In step S330, P0 determines the query node pair (s,t) that includes the source and destination nodes.

[0083] The source point s is located in the subgraph G0 held by P0. The destination point t can be located in the subgraph G0 held by P0 or in the subgraph G1 held by P1.

[0084] In step S340, P0 and P1 perform a first data interaction based on secret sharing, based on the edge weights in subgraph G0 held by P0 and the edge weights in subgraph G1 held by P1, so that each party obtains the first shortest path distance D from the source vertex s to each boundary vertex. s2B new Data sharding.

[0085] The meaning of each boundary point differs depending on the scenario. When the endpoint t is located in subgraph G0 held by P0, each boundary point refers to all boundary points of P0. When the endpoint t is located in subgraph G1 held by P1, each boundary point refers to all boundary points of P1.

[0086] The aforementioned boundary points can also be any boundary points that include both the boundary points of P0 and the boundary points of P1, from which the appropriate data can be selected as needed.

[0087] It is understandable that, under normal circumstances, the first shortest path distance D s2B newIt contains multiple distance values ​​and can be represented as a vector. For example, with... Figure 2 For example, the first boundary graph contains boundary points 0, 1, and 2, and the second boundary graph contains boundary points 3, 4, and 5. The first shortest path distance D... s2B new It can include the first shortest path distance from the source point s to the boundary points 0, 1 and 2 respectively, or it can include the first shortest path distance from the source point s to the boundary points 3, 4 and 5 respectively, or it can include all of the above.

[0088] Any first shortest path distance, such as the first shortest path distance from the source point s to the boundary point 0, is the shortest path distance in the global scope. Its shortest path may cross the subgraph of the other party (the second party or party P1). The global scope is the scope of the global graph that includes the subgraphs of each party.

[0089] Step S350, P0 and P1, based on the first shortest path distance D held by P0. s2B new Data partitioning and the second shortest path distance D from each boundary point to the endpoint t B2t The data fragmentation, and the first shortest path distance D held by P1. s2B new Data sharding and the second shortest path distance D B2t The data is sharded, and a second data interaction based on privacy computation is performed, so that P0 obtains the global shortest path distance from the source point s to the destination point t.

[0090] When the destination t is located in the subgraph G0 held by P0, each boundary point refers to all boundary points of P0. Second shortest path distance D B2t This refers to the shortest path distance from all boundary points of P0 to the destination t in the subgraph G0 of P0. The second shortest path distance D... B2t This is determined locally by P0 based on subgraph G0. Then, P0 and P1 determine the second shortest path distance D held by P0. B2t Perform data interaction based on secret sharing, so that each party obtains the second shortest path distance D. B2t Data sharding.

[0091] P0 and P1, based on the first shortest path distance D corresponding to each boundary point of P0 held by each party. s2B new The data is partitioned, and the second shortest path distance D from each boundary point of P0 to the endpoint t is calculated. B2t The data is sharded, and the second data interaction is performed.

[0092] When the destination t is located in the subgraph G1 held by P1, each boundary point refers to all boundary points of P1. Second shortest path distance D B2t This refers to the shortest path distance from all boundary points of P1 to the destination t in the subgraph G1 of P1. The second shortest path distance D B2t This is determined locally by P1 based on subgraph G1. Next, P0 and P1 determine the second shortest path distance D held by P1. B2t Perform data interaction based on secret sharing, so that each party obtains the second shortest path distance D. B2t Data sharding.

[0093] P0 and P1, based on the first shortest path distance D corresponding to each boundary point of P1 held by each party. s2B new The data is partitioned, and the second shortest path distance D from each boundary point of P1 to the endpoint t is calculated. B2t The data is sharded, and the second data interaction is performed.

[0094] During the second data interaction, parties P0 and P1 can specifically perform data interactions based on privacy summation and privacy comparison, enabling each party to obtain a data fragment with the minimum sum of shortest path distances. Party P1 sends this minimum data fragment to party P0, and party P0 sums the minimum data fragment sent by party P1 with its own minimum data fragment to obtain the complete minimum value. This complete minimum value is used as the global shortest path distance from the source point s to the destination point t.

[0095] The minimum value of this shortest path sum is the first shortest path distance D corresponding to each boundary point of P1. s2B new The second shortest path distance D between the two boundary points B2t The minimum value among the sums.

[0096] Distance D from the first shortest path s2B new What's the same is the second shortest path distance D B2t It also contains multiple distance values ​​and can be represented as a vector. For example, with Figure 2 For example, the first boundary graph contains boundary points 0, 1, and 2, and the second boundary graph contains boundary points 3, 4, and 5. When the destination t is located on the first side, the first shortest path distance D is... s2B new Second shortest path distance D B2t These are all shortest path distances corresponding to boundary points 0, 1, and 2. When the destination t is located in the second direction, the first shortest path distance D is... s2B new Second shortest path distance DB2t These are all the shortest path distances to boundary points 3, 4, and 5.

[0097] The core ideas of steps S340 and S350 are explained below. For a query initiated by one party (such as P0), when both the source point s and the destination point t belong to P0's local subgraph G0, the shortest path may pass through the other party's graph (P1), forming a cross-graph path. Since cross-graph paths must use boundary points as interfaces, any global shortest path that passes through the other party's subgraph must be able to find the boundary point set V of its own party, i.e., P0. B0 Find two boundary points b1 and b2 such that the path is:

[0098] s→b1∈V B0 →…(via P1 square graph)…→b2∈V B0 →t (1)

[0099] Among them, boundary points b1 and b2 may be the same or different.

[0100] Based on equation (1) above, the global shortest path distance between the source point s and the destination point t can be decomposed into three segments:

[0101] The distance dist(s,b1) is calculated by P0 based on the local index;

[0102] Dist(b1,b2) is calculated jointly in an encrypted environment by crossing each other's subgraphs through the boundary graph.

[0103] The distance dist(b2,t) is calculated by P0 based on the local index.

[0104] Therefore, the global shortest path distance is the minimum of the sum of the paths on all legal boundary point pairs (b1, b2), expressed as:

[0105] dist(s,t)=min[dist(s,b1)+dist(b1,b2)+dist(b2,t)] (2)

[0106] Here, dist(s,t) is the global shortest path distance between the source vertex s and the destination vertex t. dist(s,b1) is the path from the source vertex s to the boundary vertex b1 in subgraph G0, dist(b1,b2) is the global path from the boundary vertex b1 to the boundary vertex b2 (which may cross the opposite subgraph), and dist(b2,t) is the path from the boundary vertex b2 to the destination vertex t in subgraph G0. b1,b2∈V B0 .

[0107] In the process of finding this minimum value, P0 can calculate the shortest path distance vector D from the source point s to each of its own boundary points locally. s2BThe P0 side calculates the shortest path distance vector D from each boundary point to the endpoint t locally. B2t Next, the shortest path distance vector D from the source point s to each of the player's boundary points is calculated globally. s2B The scaling process is performed to iteratively update the global shortest path distances for all points originating from the source point s and reaching each boundary point of P0, thus ultimately finding the first shortest path distance D. s2B new Next, by using D S2B new +D T2B Perform vector summation to obtain a sum vector. The smallest element of this sum vector is the shortest path distance from the source point s to the destination point t in the global scope.

[0108] The above describes the design concept of steps S340 and S350 when both the source point s and the destination point t belong to the local subgraph G0 of P0. Based on the same principle, it can be known that when the destination point t belongs to the subgraph G1 of P1, the global shortest path is the minimum value of the sum of the path from the source point s to the boundary point b1 of P0 in subgraph G0, the global path from the boundary point b1 to the boundary point b3 of P1 (crossing the opposing subgraph), and the path from the boundary point b3 to the destination point t in subgraph G1.

[0109] The scaling process described above can be performed based on privacy-preserving computation and the Bellman-Ford scaling algorithm. The subgraphs, indices, and boundary graphs of each party are all privacy data and cannot be sent out in plaintext. The edge weights of the connecting edges between boundary points of each party are information shared by all parties and are not considered privacy data.

[0110] The following describes a specific implementation of step S340. Step S340 can be executed through the process shown in steps 1 to 3. Among them, steps 1 and 2 belong to the data preparation process, and step 3 belongs to the iterative query process.

[0111] Step 1: P0 queries the local subgraph G0 for the initial shortest path distance D from the source point s to each of its own boundary points. S2B Initial shortest path distance D S2B It can be represented as a vector, which contains multiple distance values.

[0112] P1 initializes the initial shortest path distances from the source point s to each of its own boundary points. For example, it can be initialized to infinity.

[0113] Step 2: P0 and P1, based on their respective initial shortest path distances and edge weights in the boundary graphs, perform the first sub-data interaction based on secret sharing, so that each party obtains data slices of edge weights in all boundary graphs and data slices of initial shortest path distances from the source point s to all boundary points.

[0114] All boundary graphs include the boundary graphs of P0 and P1, and all boundary points include the boundary points of P0 and P1.

[0115] This step involves the secret sharing of complete data held by all parties. The specific execution process can be found in existing technologies and will not be detailed here. In the various embodiments of this application, the corresponding data fragments obtained by each party can yield complete data under the assumption of reconstruction. Reconstruction may include operations such as summation.

[0116] Step 3: P0 and P1 iteratively execute the second sub-data interaction based on MPC, using the data partitions of edge weights obtained by each party, the data partitions of initial shortest path distances, and the data partitions of edge weights between boundary points in each party's boundary graph. This ensures that each party obtains the first shortest path distance D from the source point s to each boundary point. S2B new Data sharding.

[0117] The specific iterative process of step 3 is explained in detail below. Step 3 can be performed through the following steps 3-1 and 3-2.

[0118] Step 3-1: In any iteration query, P0 and P1 perform data interaction based on encrypted path remapping and encrypted aggregation, based on the data shards of the current shortest path distance held by each party and the data shards of the edge weights in all boundary graphs, so that each party obtains a new shortest path distance data shard after superimposing the current shortest path distance with the associated edge weights.

[0119] The associated edge weights include the associated edge weights in each boundary graph and the associated edge weights between boundary points in different boundary graphs. "Associated" refers to the edge weight of a direct vector edge, where the direction of the edge is consistent with the direction of the current shortest path, allowing the current shortest path distance to be superimposed with the associated edge weights. "Superimposed" here means addition or summation.

[0120] In the initial iterative query, the initial shortest path distance can be used as the current shortest path distance. In subsequent query iterations, the updated shortest path distance obtained from the previous iteration is used as the current shortest path distance.

[0121] The data interaction based on encrypted path remapping and encrypted aggregation described above can be executed using encrypted path remapping algorithms and encrypted aggregation algorithms. Encrypted path remapping algorithms can employ algorithms such as Oblivious ExtendPermutation (OEP). The OEP algorithm is used for path remapping under encrypted conditions. Encrypted aggregation algorithms can employ algorithms such as Oblivious Group Aggregation (OGA). The OGA algorithm is used to perform encrypted aggregation and comparison with the minimum value without knowing the index affiliation. Both the OEP and OGA algorithms are based on homomorphic encryption technology.

[0122] Step 3-2: Next, P0 and P1 perform privacy-based data interaction based on the data shards of the new shortest path distance held by each party, so that each party obtains the updated data shards of the shortest path distance from the source point s to each boundary point.

[0123] In this context, any updated shortest path distance is the minimum value among the current shortest path distance and several new shortest path distances. Both the current shortest path distance and any new shortest path distance can be represented as vectors. During comparison, elements at the same positions in the two vectors are compared, and the minimum value at each position is taken as the minimum value, which is the updated shortest path distance.

[0124] In the privacy data comparison process of this step, the data exists in the form of data fragments, and none of the parties can obtain the plaintext data. For a more detailed explanation of the execution process of this step, please refer to existing technologies; it will not be elaborated here.

[0125] The second sub-data interaction based on MPC includes data interaction based on encrypted path remapping and encrypted aggregation, as well as the aforementioned data interaction based on privacy comparison.

[0126] The following is combined Figures 4-6 The data interaction and data processing processes between P0 and P1 in any iterative query are described. Figures 4-6 This is a schematic diagram illustrating the multiple data processing steps in any given iterative query process.

[0127] The first boundary graph of P0 contains boundary points 0, 1, and 2, while the second boundary graph of P1 contains boundary points 3, 4, and 5.

[0128] Figure 4 The left side of the middle graph is the first boundary graph, and the right side is Dis. old v in the list s0 v s1 and v s2These are data slices representing the current shortest path distances from the source point to boundary points 0, 1, and 2, respectively. The data e in the Edge list... 10 e 01 e 21 and e 12 This refers to the data slices representing the edge weights in the first boundary graph. P0 holds the node identifier (subscript) corresponding to each edge weight data slice, while P1 does not have this node identifier. new v in the list s0 v s1 and v s2 These are data fragments representing the new shortest path distances from the source point to boundary points 0, 1, and 2, respectively.

[0129] Complete Dis copy Adding the elements in the list to the corresponding elements in the complete Edge list yields the complete Dis. com The data in the list represents the complete Dis com By aggregating and taking the minimum value from the data in the list, we can obtain the complete Dis. new The data in the list. This is only a theoretical discussion. Figure 4 The processing procedure is explained below. In fact, all of the above processes are processed in the form of data fragments through privacy interaction, and are not processed in the form of complete data.

[0130] P0 and P1 respectively hold Dis old Dis copy Edge, Dis com and Dis new Data shards in the list. Based on the data shards held by each party, P0 and P1 exchange data from Dis via OEP-based data interaction. old List mapping yields Dis copy List, so that Dis copy The node identifiers corresponding to each current shortest path distance data shard in the list are consistent with the node identifiers of each edge weight in the Edge list. Consistency means they can be added together, i.e., the two paths have the same direction on the boundary graph. In other words, for example, v s1 With e 10 The corresponding complete values ​​can be added together, v s1 This represents the data fragment representing the current shortest path from source node s to node 1, e 10 Data partitioning that represents the edge weights between boundary point 1 and boundary point 0.

[0131] Next, P0 and P1 each execute Dis locally. copy The summation of corresponding values ​​in the list and the Edge list yields the Dis values ​​for each party. com List.

[0132] P0 and P1, based on each party's Dis com Data sharding in the list performs OGA-based data exchange to achieve complete Disk com Grouping and finding the minimum value of data in a list, that is, grouping the complete data in a list... com The list represents the aggregation of multiple data points from the source point s to the same boundary point, with the minimum value being taken to obtain a new Dis. com List. For example, from two d s1 The minimum value in the data is selected for subsequent operations. For example... Figure 4 Dis com The list is the list after OGA operations.

[0133] P0 and P1, based on their respective holdings of Dis com Data sharding of the list, performing data interaction based on OEP, and processing the complete Dis com The list is rewritten so that each party receives Dis new Data sharding for a list.

[0134] Next, P0 and P1, based on their respective holdings of Dis... new Data sharding of the list enables data interaction based on privacy comparisons, achieving Dis... old Lists and Dis new Compare the corresponding distance values ​​in the list, and update Dis with the minimum value. old In the list. For example, Dis old v in the list s0 and Dis new v in the list s0 Compare the values ​​and update the minimum value to Dis. old The list contains data fragments that represent the updated shortest path distances from the source point s to each boundary point.

[0135] The above describes the process of scaling the shortest path distances from the source point s to each boundary point of P0 in the P0 boundary graph. During this iterative query process, both P0 and P1 also need to execute... Figure 5 The data update process is shown.

[0136] exist Figure 5 In the left-hand diagram, yellow nodes 3, 4, and 5 are the boundary points in the second boundary graph. (Right-hand diagram...) old v in the list s3 v s4 and v s5 These are data slices representing the current shortest path distances from the source point to boundary points 3, 4, and 5, respectively. The data in the Edge list is e. 43 e34 e 54 and e 45 This refers to the data slices representing the edge weights in the second boundary graph. P1 holds the node identifier (subscript) corresponding to each edge weight data slice, while P0 does not have this node identifier. new v in the list s3 v s4 and v s5 These are data fragments representing the new shortest path distances from the source point to boundary points 3, 4, and 5, respectively.

[0137] P0 and P1 respectively hold Figure 5 Dis old Dis copy Edge, Dis com and Dis new Data sharding in the list. P0 and P1 can communicate based on... Figure 5 The data shown indicates that execution and Figure 4 The same operation is performed in the embodiment to process the data in each list and obtain Dis respectively. new The data in the list is sharded and based on... Figure 4 The same operation as in the embodiment, using the Dis held by each party. new The data shards in the list represent the Dis held by each party. old The data shards in the list are updated to obtain the updated shortest path distances from the source point s to each boundary point.

[0138] The above describes the process of scaling the shortest path distances from the source point s to each boundary point of P1 in the P1 boundary graph. During this iterative query process, both P0 and P1 also need to execute... Figure 6 The data update process is shown.

[0139] exist Figure 6 In the middle, on the right Dis old v in the list s0 v s1 v s2 v s3 v s4 and v s5 These are data slices representing the current shortest path distances from the source point to boundary points 0, 1, 2, 3, 4, and 5, respectively. The data in the Edge list is e. 30 e 51 e 52 e 04 and e 25 This refers to data partitioning based on the edge weights between boundary points in the first and second boundary graphs. For example, e 30This refers to the edge weights between boundary point 3 and boundary point 0. P1 and P0 hold the node identifiers (i.e., subscripts) corresponding to the data fragments for each edge weight. new v in the list s0 v s1 v s2 v s4 and v s5 These are data fragments representing the new shortest path distances from the source point to boundary points 0, 1, 2, 4, and 5, respectively.

[0140] P0 and P1 respectively hold Figure 6 Dis old Dis copy Edge, Dis com and Dis new Data sharding in the list. P0 and P1 can communicate based on... Figure 6 The data shown indicates that execution and Figure 4 The same operation is performed in the embodiment to process the data in each list and obtain Dis respectively. new The data in the list is sharded and based on... Figure 4 The same operation as in the embodiment, using the Dis held by each party. new The data shards in the list represent the Dis held by each party. old The data shards in the list are updated to obtain the updated shortest path distances from the source point s to each boundary point.

[0141] in, Figure 6 Dis old Data sharding in a list can be used Figure 4 and Figure 5 The updated Dis old Data sharding in the list.

[0142] In addition to the OEP+OGA scheme, ORAM (Oblivious RAM) technology can also be used to protect the privacy data of the above topology. ORAM is an encryption technology that protects privacy by hiding data access patterns, mainly used to prevent attackers from inferring sensitive information by analyzing access frequency or sequence. Specific implementation methods can be found in existing technologies and will not be detailed here.

[0143] The above describes the process of scaling the edges between different boundary graphs by taking the shortest path distances from the source point s to each boundary point on both sides of P0 and P1.

[0144] During any iteration of the query, P0 and P1 need to execute... Figures 4-6The data update process shown involves scaling the source point s across all boundary graphs and along the edges between two boundary graphs to find the data slice with the shortest path distance from the source point s to all boundary points in the global scope.

[0145] pass Figures 4-6 and Figure 2 As can be seen, taking boundary point 0 as an example, the shortest path distance (v) from source point s to boundary point 0 in the global scope is... s0 ), can be obtained by finding the shortest path distance (v) from the source point s to the boundary point 1. s1 The edge weights (v) between boundary point 1 and boundary point 0 are superimposed on the boundary. 10 ), and the shortest path distance (v) from source point s to boundary point 3. s3 The edge weights (v) between boundary point 3 and boundary point 0 are superimposed on the boundary. 30 The edge weights mentioned above are the shortest path distances (v_s) from the source point s to the boundary point 0 in the global scope. s0 The associated edge weights.

[0146] When the total number of boundary points for each party is N, the above iterative query process needs to be executed N times to achieve scaling across all boundary points. After the above iterative query process has been executed N times, the updated shortest path distances from the source point s to each boundary point obtained by each party can be partitioned into data slices, which are used as the first shortest path distances D from the source point s to each boundary point. S2B new Data sharding.

[0147] In another embodiment of this application, the number of iterations can be pruned to shorten the overall processing flow and improve processing efficiency. In this embodiment, P0 and P1 can respectively perform steps 4 to 6.

[0148] Step 4: After completing logN iterations of the query process, P0 and P1, based on the data fragments of the current shortest path distance from the source point s to each boundary point and the second shortest path distance D from each boundary point to the destination t, respectively... B2t The data is sharded, and a third data interaction based on privacy comparison is performed so that each party obtains the data shard of the actual shortest distance UB from the source point s to the destination point t in the current iteration and the data shard of the theoretical shortest distance LB.

[0149] Where N is the total number of boundary points for each party, which is also the original total number of iterations.

[0150] The data partitioning of the actual shortest distance UB can be determined in the following way: P0 and P1, based on the current shortest path distance D from the source point s to each boundary point held by each party. s2BData partitioning and the second shortest path distance D from each boundary point to the endpoint t B2t The data sharding, through third data interaction based on privacy comparison, achieves the minimum value of the sum of the current shortest path distance and the corresponding second shortest path distance, so that each party obtains the data shard of the minimum value, which is the data shard of the actual shortest distance UB from the source point s to the destination point t in the current iteration.

[0151] P0 and P1 can interact based on the following formula:

[0152] UB = min{D s2B +D B2t} (3)

[0153] Among them, D s2B D is the current shortest path distance from the source point s to each boundary point. B2t It is the second shortest path distance from each boundary point to the endpoint t, and min is the sign of taking the minimum value.

[0154] The data partitioning based on the theoretical shortest distance (LB) can be determined as follows: For parties P0 and P1, the partitioning is based on the current shortest path distance D from the source point s to each boundary point, held by each party. s2B Data partitioning and the second shortest path distance D from each boundary point to the endpoint t B2t Data sharding, through third-party data interaction based on privacy comparison, enables the determination of the current shortest path distance D. s2B The minimum value and the distance D of the second shortest path B2t The minimum value of the sum is taken, so that each party obtains a data slice of the sum, which is the data slice of the theoretical shortest distance LB from the source point s to the destination t in the current iteration.

[0155] P0 and P1 can interact based on the following formula:

[0156] LB = min{D s2B}+min{D B2t} (4)

[0157] Step 5: P0 and P1, based on their respective data fragments of the actual shortest distance UB and the theoretical shortest distance LB, perform a fourth data interaction based on privacy computation, so that P0 obtains the difference Ga between the actual shortest distance and the theoretical shortest distance. P0 obtains the complete difference Ga, not just the data fragments.

[0158] P0 and P1 can exchange data in this step based on the following formula:

[0159] Ga=UB–LB (5)

[0160] The difference Ga is less than N-logN. The difference Ga is the minimum number of iterations still required, and its value is less than the original remaining number of iterations N-logN.

[0161] Step 6: P0 performs differential privacy processing on the difference Ga to obtain a first value that is less than the current number of remaining iterations. The first value Ga is... noisy Used as the new remaining number of iterations.

[0162] Specifically, P0 can add noise to the difference Ga using the following formula:

[0163] Ga noisy =Ga+max{0,Lap(λ)+λlogN} (6)

[0164] Where λ is the Laplace distribution scale under privacy budget ε control. Lap(λ) is the Laplace noise, and λlogN is a correction term used to protect the correctness of the Bellman algorithm. By adding noise max{0,Lap(λ)+λlogN}, Ga noisy It is greater than Ga, thus ensuring that the shortest distance can be calculated correctly.

[0165] The difference Ga contains private data from party P0 and cannot be sent to party P1 in plaintext. To protect data privacy, differential privacy processing can be performed on the difference Ga, and the resulting first value Ga can be used as the privacy parameter. noisy Send to P1.

[0166] Both sides are based on the remaining number of iterations after pruning (the first value Ga). noisy Then execute the subsequent iterative query process. After the iterative query process is completed, you can get the same result as if you had executed N iterations, but the number of iterations has been reduced compared to before.

[0167] Since the edge weights on the boundary graph are greater than 1, each round of the Bellman-Ford scaling process can only yield a result greater than the current theoretical shortest distance LB. Because the Bellman-Ford algorithm shortens the distance by a maximum of 1 per round (because the edge weight ≥ 1), the difference Ga represents the remaining number of iterations that may still be needed. Therefore, the total number of Bellman scaling rounds can be dynamically adjusted based on this difference Ga, terminating the remaining computation early. To prevent UB and LB from leaking information about the boundary point distribution or distance distribution, differential privacy noise (such as Laplace noise) is added to the difference Ga to conceal specific round changes.

[0168] In this embodiment, without affecting the correctness of the final query, early termination and protocol execution pruning are achieved by estimating the remaining number of iterations required by the Bellman-Ford algorithm, which significantly improves query efficiency. At the same time, differential privacy is used to protect intermediate sensitive information in the process.

[0169] In summary, this embodiment significantly reduces the amount of data required for privacy-preserving computation by constructing an index structure to transform the shortest path distance calculation in the original subgraph into a smaller boundary graph. Furthermore, by combining a privacy-preserving dynamic pruning algorithm, it effectively reduces the number of computation rounds while ensuring security. Experimental results show that compared to existing schemes, this approach significantly improves execution efficiency and communication overhead, and significantly enhances practicality and scalability on large-scale graphs while protecting privacy.

[0170] In this specification, the terms "first," "first shortest path distance," "first data interaction," and "first sub-data interaction," as well as the corresponding "second" (if present) in the text, are used merely for the convenience of distinction and description and do not have any limiting meaning.

[0171] The foregoing description describes specific embodiments of this specification; other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than those shown in the embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the drawings do not necessarily need to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0172] Figure 7 This is a schematic block diagram of an apparatus for multi-party joint querying of the shortest path distance, provided as an embodiment. This embodiment is related to... Figure 2The method executed by the first party in the illustrated embodiment corresponds to that of the first party. The device 700, deployed in the first party, includes the following modules: a query node determination module 710, a shortest path query module 720, and a global distance determination module 730. The query node determination module 710 is configured to determine query node pairs containing a source point and an endpoint. The source point is located in a subgraph held by the first party, which is interconnected with the subgraph held by the second party through edges between their respective boundary points. The shortest path query module 720 is configured to perform a first data interaction with the second party based on secret sharing, according to the edge weights in the boundary graphs held by each party, so that each party obtains data fragments of the first shortest path distance from the source point to each boundary point. The boundary graph of any party uses the boundary points in its held subgraph as nodes, and the edge weights are the shortest path distances between each boundary point in the party's held subgraph. The global distance determination module 730 is configured to perform a second data interaction with the second party based on the data fragments of the first shortest path distance held by each party and the data fragments of the second shortest path distance from each boundary point to the destination, so that the first party obtains the global shortest path distance from the source point to the destination.

[0173] In one implementation, the device 700 further includes a boundary graph construction module 740, configured to: determine the shortest path distance between each boundary point of the local subgraph; and for any set of boundary points, if the shortest path between the set of boundary points does not pass through other boundary points, add the shortest path distance between the set of boundary points as an edge weight to the local boundary graph.

[0174] In one implementation, the shortest path query module 720 includes: an initial query submodule 21, a data sharding submodule 22, and an iterative query submodule 23. The initial query submodule 21 is configured to query the initial shortest path distances from the source point to each boundary point of the local subgraph. The data sharding submodule 22 is configured to perform a first sub-data interaction with the second party based on secret sharing, so that each party obtains data shards of edge weights in all boundary graphs and data shards of the initial shortest path distances from the source point to all boundary points. The initial shortest path distances from the source point to several boundary points of the second party are initialized. The iterative query submodule 23 is configured to iteratively perform a second sub-data interaction with the second party based on the data shards of edge weights obtained by each party, the data shards of the initial shortest path distances, and the data shards of edge weights between boundary points in each party's boundary graph, so that each party obtains data shards of the first shortest path distances from the source point to each boundary point.

[0175] In one implementation, the iterative query submodule 23 is specifically configured as follows: In any iterative query, it performs data interaction with the second party based on encrypted path remapping and encrypted aggregation, so that each party obtains a data shard of the new shortest path distance after adding the current shortest path distance to the associated edge weights. The associated edge weights include the associated edge weights in each boundary graph and the associated edge weights between the boundary points of each boundary graph. Next, it performs data interaction with the second party based on privacy comparison, so that each party obtains a data shard of the updated shortest path distances from the source point to each boundary point. Each updated shortest path distance is the minimum value among the corresponding current shortest path distance and several new shortest path distances.

[0176] In one implementation, the device 700 further includes an iteration count update module (not shown in the figure), specifically comprising: a distance determination submodule, a difference determination submodule, and a difference processing submodule (not shown in the figure). The distance determination submodule is configured to, after executing logN iteration query processes, perform a third data interaction with the second party based on privacy-based comparison, using data fragments of the current shortest path distance from the source point to each boundary point and data fragments of the second shortest path distance from each boundary point to the destination held by each party. This results in each party obtaining data fragments of the actual shortest distance from the source point to the destination in the current iteration and data fragments of the theoretical shortest distance. Here, N is the total number of boundary points for each party. The difference determination submodule is configured to perform a fourth data interaction with the second party based on privacy-based computation, using the obtained data fragments of the actual shortest distance and the theoretical shortest distance. This results in the first party obtaining the difference between the actual shortest distance and the theoretical shortest distance. The difference processing submodule is configured to perform differential privacy processing on the difference to obtain a first value less than the current remaining iteration count, which is used as the new remaining iteration count.

[0177] In one implementation, the global distance determination module 730 is specifically configured to: when the destination is located in the subgraph held by the first party, perform a second data interaction with the second party based on privacy-based computation, based on the data fragments of the first shortest path distances corresponding to each boundary point of the first party held by each party, and the data fragments of the second shortest path distances from each boundary point of the first party to the destination.

[0178] In one implementation, the global distance determination module 730 is specifically configured to: when the destination is located in the subgraph held by the second party, perform a second data interaction with the second party based on privacy-based computation, based on the data fragments of the first shortest path distances corresponding to each boundary point of the second party held by each party, and the data fragments of the second shortest path distances from each boundary point of the second party to the destination.

[0179] In one implementation, the global distance determination module 730 is specifically configured to: perform data interaction with the second party based on privacy summation and privacy comparison, so that each party obtains a data fragment with the minimum value of the shortest path distance sum; then, determine the complete minimum value based on the data fragment with the minimum value sent by the second party and held by the current party, and use it as the global shortest path distance from the source point to the destination point. The minimum value of the shortest path sum is the minimum of the sums of the first shortest path distances of each boundary point of the second party and the second shortest path distances of the same boundary point.

[0180] Figure 8 A schematic block diagram of another apparatus for multi-party joint query of the shortest path distance provided in this embodiment. This embodiment is similar to... Figure 2 The method executed by the second party corresponds to the method shown in the embodiment. The device 800, deployed in the second party, includes the following modules: a secret interaction query module 810 and a global distance interaction module 820. The secret interaction query module 810 is configured to perform a first data interaction with the first party based on secret sharing, based on the edge weights in the boundary graphs held by each party, so that each party obtains a data fragment of the first shortest path distance from the source point to each boundary point. The query node pair containing the source point and the destination point is determined by the first party. The source point is located in the subgraph held by the first party, and the subgraphs held by the second party are interconnected through edges between their respective boundary points. The boundary graph of any party uses the boundary points in the subgraph held by that party as nodes, and the edge weights are the shortest path distances between each boundary point in the subgraph held by that party. The global distance interaction module 820 is configured to perform a second data interaction with the first party based on privacy computation, based on the data fragments of the first shortest path distances held by each party and the data fragments of the second shortest path distances from each boundary point to the destination, so that the first party obtains the global shortest path distance from the source point to the destination.

[0181] In one implementation, the device 800 further includes a boundary index construction module 830, configured to: determine the shortest path distance between each boundary point of the local subgraph; and for any set of boundary points, if the shortest path between the set of boundary points does not pass through other boundary points, add the shortest path distance between the set of boundary points as an edge weight to the local boundary graph.

[0182] In one implementation, the secret interaction query module 810 includes: an initialization submodule 11, a secret sharing submodule 12, and a query iteration submodule 13. The initialization submodule 11 is configured to initialize the initial shortest path distances from the source point to several boundary points of the second party. The secret sharing submodule 12 is configured to perform a first sub-data interaction with the first party based on secret sharing, so that each party obtains data fragments of edge weights in all boundary graphs and data fragments of the initial shortest path distances from the source point to all boundary points. The query iteration submodule 13 is configured to iteratively perform a second sub-data interaction with the first party based on the data fragments of edge weights obtained by each party, the data fragments of the initial shortest path distances, and the data fragments of edge weights between boundary points in each party's boundary graph, so that each party obtains data fragments of the first shortest path distances from the source point to each respective boundary point.

[0183] In one implementation, the query iteration submodule 13 is specifically configured as follows: In any iteration query, it performs data interaction with the first party based on encrypted path remapping and encrypted aggregation, so that each party obtains a data shard of the new shortest path distance after adding the current shortest path distance to the associated edge weights. The associated edge weights include the associated edge weights in each boundary graph and the associated edge weights between the boundary points of each boundary graph. Next, it performs data interaction with the first party based on privacy comparison, so that each party obtains a data shard of the updated shortest path distances from the source point to each boundary point. Each updated shortest path distance is the minimum value among the corresponding current shortest path distance and several new shortest path distances.

[0184] In one implementation, the device 800 further includes a remaining iteration determination module (not shown in the figure), specifically comprising a distance calculation submodule and a difference calculation submodule (not shown in the figure). The distance calculation submodule is configured to: upon completion of logN iterations of the query process, based on the data fragments of the current shortest path distance from the source point to each boundary point and the data fragments of the second shortest path distance from each boundary point to the destination held by each party, perform a third data interaction with the first party based on privacy comparison, so that each party obtains a data fragment of the actual shortest distance from the source point to the destination in the current iteration and a data fragment of the theoretical shortest distance. The difference calculation submodule is configured to: based on the data fragments of the actual shortest distance and the data fragments of the theoretical shortest distance obtained by each party, perform a fourth data interaction with the first party based on privacy calculation, so that the first party obtains the difference between the actual shortest distance and the theoretical shortest distance.

[0185] In one implementation, the global distance interaction module 820 is specifically configured to: when the destination is located in the subgraph held by the first party, perform a second data interaction with the first party based on privacy computation, based on the data fragments of the first shortest path distance corresponding to each boundary point of the first party held by each party, and the data fragments of the second shortest path distance from each boundary point of the first party to the destination.

[0186] In one implementation, the global distance interaction module 820 is specifically configured to: when the destination is located in the subgraph held by the second party, perform a second data interaction with the first party based on privacy computation, based on the data fragments of the first shortest path distances corresponding to each boundary point of the second party held by each party, and the data fragments of the second shortest path distances from each boundary point of the second party to the destination.

[0187] In one implementation, the global distance interaction module 820 is specifically configured to: perform data interaction with the first party based on privacy summation and privacy comparison, so that each party obtains a data fragment with the minimum value of the shortest path distance sum; then, send the data fragment with the minimum value held by the first party.

[0188] The above-described apparatus embodiments correspond to the method embodiments, and detailed descriptions can be found in the description of the method embodiments section, which will not be repeated here. The apparatus embodiments are derived based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments; detailed descriptions can be found in the corresponding method embodiments.

[0189] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform... Figures 1 to 6 Any one of the methods described.

[0190] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement... Figures 1 to 6 Any one of the methods described.

[0191] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for storage media and computing devices are basically similar to the method embodiments, so they are described more simply; relevant parts can be referred to the descriptions of the method embodiments.

[0192] Those skilled in the art will recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0193] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, or improvements made based on the technical solutions of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for multi-party joint query of shortest path distance with privacy protection, comprising: a first party determining a query node pair comprising a source point and a terminal point; wherein the source point is located in a subgraph held by the first party, and the subgraph is connected to a subgraph held by a second party through edges between respective boundary points; the first party and the second party performing a first data interaction based on secret sharing based on edge weights in respective boundary graphs, so that each party obtains data shards of first shortest path distances of the source point to respective boundary points; wherein a boundary graph of any party takes boundary points in a subgraph held by the party as nodes, and takes shortest path distances between the boundary points in the subgraph held by the party as edge weights; the first party and the second party performing a second data interaction based on privacy computation based on the data shards of the first shortest path distances held by each party and data shards of second shortest path distances of respective boundary points to the terminal point, so that the first party obtains a global shortest path distance of the source point to the terminal point.

2. The method of claim 1, wherein, Any party constructs the party's boundary graph in the following way: determining shortest path distances between respective boundary points of a local subgraph; for any group of boundary points, if a shortest path between the group of boundary points does not pass through other boundary points, adding the shortest path distance between the group of boundary points as an edge weight to the party's boundary graph. 3.The method of claim 1, wherein the step of performing the first data interaction based on secret sharing comprises: the first party querying initial shortest path distances of the source point to respective boundary points of the first party from a local subgraph; the second party initializing initial shortest path distances of the source point to respective boundary points of the second party; the first party and the second party performing a first sub-data interaction based on secret sharing, so that each party obtains data shards of edge weights in all boundary graphs and data shards of initial shortest path distances of the source point to all boundary points; the first party and the second party iteratively performing a second sub-data interaction based on multi-party secure computation based on the data shards of edge weights, the data shards of initial shortest path distances and data shards of edge weights between boundary points of the boundary graphs of each party obtained by each party, so that each party obtains data shards of first shortest path distances of the source point to respective boundary points. 4.The method of claim 3, wherein the step of iteratively performing the second sub-data interaction based on multi-party secure computation comprises: in any iteration query, performing data interaction based on encrypted path remapping and encrypted aggregation, so that each party obtains data shards of new shortest path distances after superimposing current shortest path distances with associated edge weights; wherein the associated edge weights include associated edge weights in respective boundary graphs and associated edge weights between boundary points of respective boundary graphs. The data interaction based on the privacy comparison is performed, so that each party obtains data pieces of updated shortest path distances from the source point to each boundary point; wherein any one of the updated shortest path distances is the minimum value of the corresponding current shortest path distance and a plurality of new shortest path distances.

5. The method of claim 4, wherein, The iterative query is performed N times, and N is the total number of boundary points of each party. The data pieces of the first shortest path distances from the source point to each boundary point obtained by each party are the data pieces of the updated shortest path distances from the source point to each boundary point obtained by each party when the N times of iterative query are performed.

6. The method of claim 4, further comprising: When the logN times of iterative query process are performed, the first party and the second party perform a third data interaction based on privacy comparison, based on the data pieces of the current shortest path distances from the source point to each boundary point held by each party and the data pieces of the second shortest path distances from each boundary point to the terminal point, so that each party obtains data pieces of actual shortest distances and data pieces of theoretical shortest distances from the source point to the terminal point in the current iteration; wherein N is the total number of boundary points of each party. The first party and the second party perform a fourth data interaction based on privacy calculation, based on the data pieces of the actual shortest distances and the data pieces of the theoretical shortest distances obtained by each party, so that the first party obtains a difference value between the actual shortest distance and the theoretical shortest distance. The first party performs differential privacy processing on the difference value to obtain a first value smaller than the current remaining iteration number, and the first value is used as a new remaining iteration number.

7. The method of claim 1, when the terminal point is located in the subgraph held by the first party, the step of performing the second data interaction based on privacy calculation comprises: performing the second data interaction based on privacy calculation based on the data pieces of the first shortest path distances corresponding to each boundary point of the first party held by each party and the data pieces of the second shortest path distances from each boundary point of the first party to the terminal point.

8. The method of claim 1, when the terminal point is located in the subgraph held by the second party, the step of performing the second data interaction based on privacy calculation comprises: performing the second data interaction based on privacy calculation based on the data pieces of the first shortest path distances corresponding to each boundary point of the second party held by each party and the data pieces of the second shortest path distances from each boundary point of the second party to the terminal point.

9. The method of claim 8, the step of performing the second data interaction based on privacy calculation comprises: The first party and the second party perform data interaction based on privacy summation and privacy comparison, so that each party obtains data pieces of the minimum value of the shortest path distance sum; wherein the minimum value of the shortest path distance sum is the minimum value of the sum of the first shortest path distance of each boundary point of the second party and the second shortest path distance of the same boundary point. The first party determines the complete minimum value based on the data fragments of the minimum value sent by the second party and held by the first party, and takes the global shortest path distance from the source point to the terminal point.

10. A method for multi-party joint query of shortest path distance with privacy protection, executed by a first party, comprising: determining a query node pair containing a source point and a terminal point; wherein the source point is located in a subgraph held by the first party, and the subgraph is connected to a subgraph held by a second party through edges between respective boundary points; performing first data interaction based on secret sharing with the second party based on edge weights in the boundary graph held by each party, so that each party obtains data fragments of first shortest path distances from the source point to respective boundary points; wherein the boundary graph of any party takes the boundary points in the subgraph held by the party as nodes, and takes the shortest path distances between the respective boundary points in the subgraph held by the party as edge weights; performing second data interaction based on privacy calculation with the second party based on the data fragments of the first shortest path distances held by each party and the data fragments of second shortest path distances from respective boundary points to the terminal point, so that the first party obtains the global shortest path distance from the source point to the terminal point.

11. A method for multi-party joint query of shortest path distance with privacy protection, executed by a second party, comprising: performing first data interaction based on secret sharing with a first party based on edge weights in the boundary graph held by each party, so that each party obtains data fragments of first shortest path distances from a source point to respective boundary points; wherein a query node pair containing the source point and a terminal point is determined by the first party, the source point is located in a subgraph held by the first party, and the subgraph is connected to a subgraph held by the second party through edges between respective boundary points; the boundary graph of any party takes the boundary points in the subgraph held by the party as nodes, and takes the shortest path distances between the respective boundary points in the subgraph held by the party as edge weights; performing second data interaction based on privacy calculation with the first party based on the data fragments of the first shortest path distances held by each party and the data fragments of second shortest path distances from respective boundary points to the terminal point, so that the first party obtains the global shortest path distance from the source point to the terminal point.

12. An apparatus for multi-party joint query of shortest path distance with privacy protection, deployed in a first party, comprising: a query node determination module configured to determine a query node pair containing a source point and a terminal point; wherein the source point is located in a subgraph held by the first party, and the subgraph is connected to a subgraph held by a second party through edges between respective boundary points; a shortest path query module configured to perform first data interaction based on secret sharing with the second party based on edge weights in the boundary graph held by each party, so that each party obtains data fragments of first shortest path distances from the source point to respective boundary points; wherein the boundary graph of any party takes the boundary points in the subgraph held by the party as nodes, and takes the shortest path distances between the respective boundary points in the subgraph held by the party as edge weights; The global distance determination module is configured to perform, with the second party, a second data interaction based on privacy calculation based on the data shard of the first shortest path distance held by each party and the data shard of the second shortest path distance of each boundary point to the terminal point, so that the first party obtains the global shortest path distance from the source point to the terminal point.

13. An apparatus for multi-party joint query of shortest path distance with privacy protection, deployed in a second party, comprising: The secret interaction query module is configured to perform, with the first party, a first data interaction based on secret sharing based on the edge weight in the boundary graph held by each party, so that each party obtains a data shard of the first shortest path distance from the source point to each boundary point; wherein a query node pair containing the source point and the terminal point is determined by the first party, the source point is located in a subgraph held by the first party, and the subgraph and a subgraph held by the second party are connected to each other through edges between respective boundary points; the boundary graph of any party takes the boundary points in the subgraph held by the party as nodes, and takes the shortest path distance between each boundary point in the subgraph held by the party as edge weight; The global distance interaction module is configured to perform, with the first party, a second data interaction based on privacy calculation based on the data shard of the first shortest path distance held by each party and the data shard of the second shortest path distance of each boundary point to the terminal point, so that the first party obtains the global shortest path distance from the source point to the terminal point.

14. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any one of claims 1-11.

15. A computing device comprising a memory and a processor, the memory having stored therein executable code which, when executed by the processor, implements the method of any one of claims 1-11.