A method, device and computer-readable storage medium for querying quality-constrained shortest paths in encrypted graphs based on tree decomposition
By tree decomposing and encrypting the graph data and generating ciphertext indexes, the security risks of third-party servers when storing graph data are solved, and efficient and secure quality constraint shortest path query is achieved in the cloud environment.
Patent Information
- Application Number
- CN202510078470.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-01-17
AI Technical Summary
When storing graph data on third-party servers, there are data breaches and security risks, especially cloud servers that have unauthorized access or steal data, threatening user privacy and security.
The graph data is encrypted using tree decomposition technology, generated ciphertext index, and performed quality constraint shortest path query on the encrypted index, protecting data privacy through key distribution, authorization tokens and homomorphic encryption technologies, while ensuring the accuracy of the query.
While protecting user data privacy, it can accurately calculate the shortest path, providing data security and efficient computing solutions, ensuring data security and efficient query in cloud environments.
Smart Images

Figure CN119989410B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information retrieval, and more specifically, relates to a method, device and computer-readable storage medium for querying quality-constrained shortest paths in encrypted graphs based on tree decomposition. Background Art
[0002] With the development of big data and artificial intelligence, knowledge graphs, as a technical approach, are widely used across industries. They describe entities and their relationships through a graph structure, enabling deep information association and intelligent reasoning. Nodes in a knowledge graph represent entities, such as people, places, and organizations, while edges represent relationships or attributes between entities, such as name, date of birth, friends, and spouse, thereby revealing the complex connections between entities.
[0003] Shortest path queries are a common operation in knowledge graphs, used to find the shortest path and distance between two nodes. They not only improve information retrieval efficiency but also play a vital role in practical applications, significantly reducing data retrieval time when processing large datasets. Consequently, shortest path queries are widely used in search engines, intelligent question-answering systems, data mining, and machine learning.
[0004] The constrained shortest path problem is a special form of the shortest path query, aiming to find the shortest path that satisfies specific constraints. While constraints typically include node and path restrictions, this method focuses on the quality attributes of edges, such as the carrying capacity of roads in logistics distribution or the load limits of power lines in power transmission. The core of the quality-constrained shortest path query is to verify that each edge on the path meets the quality requirements before calculating the shortest path. Only qualified paths are selected, ensuring that the final path meets the quality constraints.
[0005] Chinese patent document CN116028682A discloses a tree-decomposition-based shortest path query method for a temporal road network. The method includes establishing a temporal graph based on acquired temporal road network data; creating packages based on the temporal graph and connecting all created packages to construct a temporal tree decomposition; constructing a TD-H2H index based on the temporal tree decomposition; constructing a TD-OAI query algorithm based on the TD-H2H index, and substituting the acquired shortest path query problem into the TD-OAI query algorithm to obtain the shortest travel time and its corresponding path.
[0006] In summary, graph data structures, due to their high degree of organization and flexibility, are widely used in fields such as road traffic, network routing, and social networks. As applications scale, the storage requirements for graph data continue to grow, and local storage may be unable to accommodate them. Therefore, outsourcing data to cloud platforms has become a viable solution. However, storing data on third-party servers can pose data leakage and security risks. In particular, cloud servers can potentially access or steal data without authorization, threatening user privacy and security. Summary of the Invention
[0007] The present invention aims to overcome at least one of the shortcomings of the aforementioned prior art by providing a quality-constrained shortest path query method for encrypted graphs based on tree decomposition. This method addresses the risk of data leakage and security vulnerabilities associated with storing user data on third-party servers. When a user requires the server to calculate the shortest path, the present invention uses encryption technology to encrypt the tree decomposition index after calculating it, to prevent the server from stealing the index information. This method protects user data privacy while still accurately calculating the shortest path.
[0008] The present invention also discloses a device loaded with an encrypted graph quality-constrained shortest path query method based on tree decomposition.
[0009] The detailed technical solutions of the present invention are as follows:
[0010] A quality-constrained shortest path query method for an encrypted graph based on tree decomposition, the method comprising:
[0011] S1. The key distribution agency sends the key pair (sk, pk) to the data owner and the key pk to the user. The key will be used to encrypt and decrypt related information such as the distance between nodes in the graph.
[0012] S2. The data owner constructs the graph data G as a ciphertext index θ G , and index the ciphertext θ G Send to the cloud platform;
[0013] S3. When a user queries the graph data G, the user submits a query request to the data owner and sends the digital signature with identity authentication to the data owner;
[0014] S4. After receiving the user's digital signature, the data owner decrypts the digital signature and confirms the user's identity. After proving the security of the user's identity, the authorization token is sent to the user through a secure channel.
[0015] The authorization token contains the hash map of the graph data nodes, their quality and their corresponding hash values (1→ρ1, 2→ρ2...n→ρ n ) and decryption key sk, the data owner sends the authorization token to the user;
[0016] The hash map is a data structure that uses a hash function to map the original value to the storage location of its hash value to achieve fast search. The authorization token has a time limit, after which the authorization token automatically expires.
[0017] S5. After receiving the authorization token, the user starts to query the graph data G. The user uses the sha256 hash function to convert the starting point v s , end point v t Calculate and get H(v s ), H(v t ), take the quality threshold ρ1 that needs to be queried in the authorization token, and combine the calculation results into a triple (H(v s ), H(v t ), ρ1), that is, the query token, the user will query the token (H(v s ), H(v t ), ρ1) is sent to the cloud platform;
[0018] S6. The cloud platform executes the query algorithm: After receiving the query token, the cloud platform first converts the query token triple (H(v s ), H(v t ),ρ1) is decomposed to obtain H(v s ), H(v t ), ρ1;
[0019] S7. After receiving the query result sent by the cloud platform, the user uses the homomorphic encryption decryption key sk to decrypt the distance value d(k), and uses the hash mapping table of the graph data node to obtain the final query result for the intermediate nodes, and obtains the quality-constrained shortest distance of the query and the intermediate nodes of the shortest path;
[0020] S8. After the authorization token reaches the limit time, the user will lose the query permission for the graph data G. If there is a query requirement, the user will resubmit the query request to the data owner.
[0021] Specifically, the S2 specifically includes:
[0022] S21. Decompose the graph data G into different subgraphs according to different quality values, and divide n different quality values in the graph data G into n subgraphs; the quality of all edges in the subgraph with quality i must be greater than or equal to i, and eliminate edges with quality less than i, i = 1, 2...n;
[0023] S22, each subgraph G generated i (i=1,2…n) perform tree decomposition;
[0024] Tree decomposition is a technique for representing graph data as a tree structure, aiming to decompose the structure of complex graphs to simplify computational problems. Tree decomposition allows efficient processing of complex graph problems by leveraging the tree's simple structure while preserving the graph's essential properties. Compared to traditional shortest distance calculation methods such as the Dijkstra algorithm, the Floyd-Warshall algorithm, and the 2HCL indexing algorithm, tree decomposition offers the advantage of not only being able to calculate the shortest path distance but also identifying each intermediate node in the shortest path.
[0025] S23, through each tree The structure of building the corresponding ciphertext index
[0026] S24, ciphertext index θ G After generation, the user indexes each sub-ciphertext corresponding to the hash value ρ of its quality Then the ciphertext index θ G Upload to the cloud platform;
[0027] Furthermore, the S22 specifically includes:
[0028] S221, calculation subgraph G i The degree of each node in (i=1,2…n) is selected, and the node v with the smallest degree is selected to start elimination. Degree is a basic concept in graph theory, which refers to the number of edges connecting a node to other nodes in the graph;
[0029] S222. For the selected node v, all its neighboring nodes N G (v) so that the neighbor nodes of node v form a clique in graph G, that is, a complete graph. In a complete graph, there is an edge between any two different nodes.
[0030] S223, node v and its neighbor node N G (v) Forming a tree T G A tree node X(v) in ;
[0031] S224, repeat S221 to S223 until all nodes in the graph data G are eliminated;
[0032] S225, for trees Each tree node X(v) in the tree contains node v and its neighboring nodes. The tree node X(u) corresponding to the first node u eliminated in the neighboring nodes is used as the parent node of the tree node X(v) to construct the tree edge. The parent node represents the node in the previous layer of the tree. After all the tree edges are constructed, the subgraph G i Decomposed into corresponding trees
[0033] Furthermore, the S23 specifically includes:
[0034] S231, select tree For a tree node X(v) = {v, w}, construct an index entry for the edges corresponding to the node v and each of its neighbor nodes:
[0035] The node v and its neighbor node w are calculated using the hash function sha256 algorithm to obtain their corresponding hash values H(v) and H(w); a hash function is an algorithm that can convert input data of any length into output data of fixed length, and this process is irreversible. Using the hash function to calculate the node can prevent the cloud platform from stealing node information without affecting its query process.
[0036] The distance x from node v to node w is calculated using homomorphic encryption to obtain d(x). The encryption process uses the encryption key pk. Homomorphic encryption is a special encryption technology that allows calculations to be performed directly on encrypted data without decrypting the data. This means that the cloud platform can perform specific operations on encrypted data without knowing the original data, ensuring that the encrypted information is not exposed to the cloud platform.
[0037] Take H(v) as the index item of the index entry, connect H(w) with the encrypted distance value d(x) and the hash value of the node w corresponding to the parent node X(w) of the tree node X(v), and obtain the content of the index entry H(v)||d(x)||H(w). At this point, an index entry corresponding to the tree node X(v) is generated: H(v)→H(v)||d(x)||H(w).
[0038] S232, repeat S231 until all index entries of the tree node are constructed;
[0039] S233, repeat S231-S232, and All tree nodes generate corresponding index entries;
[0040] S234. Repeat steps S231-S233 for the remaining trees to generate the corresponding ciphertext index. After completion, the ciphertext index θ corresponding to the graph data G is generated. G .
[0041] Furthermore, the S6 specifically includes:
[0042] S61. Find the corresponding ciphertext index according to the quality threshold ρ1 in the query token.
[0043] S62, in the ciphertext index Find the query start and end points H(v s ) and H(vt ) index entry.
[0044] S63, loop through the query start and end points H(v s ) and H(v t ) in the index entry, that is, the parent node, until the common ancestor of the two is found, that is, the lowest common ancestor H(v z ), the lowest common ancestor refers to the most recent common ancestor node of two nodes in the tree, that is, the common ancestor closest to the two nodes.
[0045] S64, query the node H (v s ) and node H(v t ) to its lowest common ancestor node H(v z ), including:
[0046] S641, query node H (v s ) to node H(v z ):Traverse the shortest distance between node H(v s ) related index entries, find the node H(v s ) to node H(v t ), calculate the distance values of all paths according to the second item in the index entry, that is, the distance value, and select the smallest distance d(m) as the node H(v s ) to node H(v z ) and record the path node corresponding to the shortest distance.
[0047] S642, query node H (v t ) to node H(v z ):Traverse the shortest distance between node H(v t ) related index entries, find the node H(v t ) to node H(v z ), calculate the distance values of all paths according to the second item in the index entry, that is, the distance value, and select the smallest distance d(n) as the node H(v t ) to node H(v z ) and record the path node corresponding to the shortest distance.
[0048] S65, the node H(v s ) to node H(v z )’s shortest distance d(m) to node H(v t ) to node H(v z ) is added to get the shortest distance d(n) of node H(v s ) to node H(v tThe shortest distance d(k) is calculated as follows:
[0049] d min (v s , V t )=d(m)+d(n)=d(k) (1);
[0050] S66. The cloud platform sends the calculated shortest distance d(k) and the intermediate nodes of the path to the user.
[0051] In another aspect of the present invention, a device for implementing a tree decomposition-based encrypted graph quality-constrained shortest path query method is provided, the device comprising:
[0052] at least one processor; and
[0053] A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to execute the encrypted graph quality-constrained shortest path query method based on tree decomposition as described above.
[0054] In another aspect of the present invention, a computer-readable storage medium is provided, which stores executable instructions. When the instructions are executed, the machine executes the encrypted graph quality-constrained shortest path query method based on tree decomposition as described above.
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] The present invention provides a tree-decomposition-based encrypted graph quality-constrained shortest path query method. The method generates an encrypted index by performing tree decomposition and encryption processing on graph structure data, and can perform shortest path queries that meet specific quality constraints on this encrypted index. Through the present invention, users can encrypt sensitive graph data and outsource it to a cloud server, which not only ensures the security of the data, but also can perform quality-constrained shortest path queries on encrypted data according to specific application requirements, thereby providing a reliable solution for data security and efficient computing in cloud environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 Schematic diagram of the method of the present invention;
[0058] Figure 2 This is a schematic diagram of the graph data G described in Example 1;
[0059] Figure 3 This is a schematic diagram of the subgraph G1 with a quality value of 1 described in Example 1;
[0060] Figure 4This is a schematic diagram of subgraph G2 with a quality value of 2 described in Example 1;
[0061] Figure 5 This is a schematic diagram of subgraph G3 with a quality value of 3 described in Example 1;
[0062] Figure 6 The tree decomposition corresponding to the subgraph G1 described in Example 1 is Schematic diagram;
[0063] Figure 7 The tree decomposition corresponding to the subgraph G2 described in Example 1 is Schematic diagram;
[0064] Figure 8 The tree decomposition corresponding to the subgraph G3 described in Example 1 is Schematic diagram;
[0065] Figure 9 This is the ciphertext index described in Example 1 Schematic diagram;
[0066] Figure 10 This is the ciphertext index described in Example 1 Schematic diagram;
[0067] Figure 11 This is the ciphertext index described in Example 1 Schematic diagram;
[0068] Figure 12 This is a schematic diagram of the query process described in Example 1. DETAILED DESCRIPTION
[0069] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0070] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present disclosure belongs.
[0071] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0072] In the absence of conflict, the embodiments of the present disclosure and the features thereof may be combined with each other.
[0073] The following is a further description of the encrypted graph quality-constrained shortest path query method and device based on tree decomposition of the present invention in conjunction with specific embodiments.
[0074] Example 1
[0075] Ginseng Figure 1 This embodiment provides a method for querying the shortest path with quality constraints on an encrypted graph based on tree decomposition, the method comprising:
[0076] S1. The key distribution agency sends the key pair (sk, pk) to the data owner and the key pk to the user. The key will be used to encrypt and decrypt related information such as the distance between nodes in the graph.
[0077] S2. The data owner constructs the graph data G as a ciphertext index θ G , and index the ciphertext θ G Send to the cloud platform;
[0078] Specifically, the S2 specifically includes:
[0079] S21. Decompose the graph data G into different subgraphs according to different quality values. A quality of 1 means that the quality of all edges under the subgraph must be greater than or equal to 1. A quality of 2 means that the quality of all edges under the subgraph must be greater than or equal to 2, and so on. Figure 2 As shown, v1, v2…v in the node 10 Represents the node name. Each edge has two attribute values. For example, the edge (1, 3) from node v1 to node v5 has 1, and 3 represents the quality value from node v1 to node v5.
[0080] Decompose the graph data G into three subgraphs G1, G2 and G3 with quality values of 1, 2 and 3. The decomposed subgraphs are as follows Figures 3 to 5 shown.
[0081] S22, each subgraph G generated i (i=1, 2…n) performs tree decomposition; taking the tree decomposition of subgraph G1 as an example, subgraph G1 is decomposed into a tree, and the specific steps of decomposition are as follows:
[0082] S221, subgraph G1 Figure 3 As shown, the degree of each node is as follows: deg(v1)=2, deg(v2)=2, deg(v3)=3, deg(v4)=3, deg(v5)=4, deg(v6)=1, deg(v7)=2, deg(v8)=3, deg(v9)=1, deg(v 10 )=1, deg represents the degree of the node, and the node v6 with the smallest degree in the subgraph G1 is selected to start elimination.
[0083] S222: For the selected node v6, all its neighboring nodes N C Add an edge between (v6)={v5} so that the neighbor nodes of node v6 form a bag in subgraph G1, that is, a complete graph is generated.
[0084] S223, node v6 and its neighbor node N G (v6) = {v5} forms a tree A tree node X(v6) = {v5, v6} in .
[0085] S224. Repeat S221-S223 until all nodes in the subgraph G1 are eliminated, and all generated tree nodes are X(v1)={v1, v2, v5}, X(v2)={v2, v3}, X(v3)={v3, v5}, X(v4)={v3, V4, v7}, X(v5)={v5}, X(v6)={v5, v6}, X(v7)={v5, v7}, X(v8)={V4, v8}, X(v9)={v8, v9}, X(v10)={v11, v12}, X(v11)={v12, v13}, X(v12)={v13, v14}, X(v13)={v14, v15}, X(v14)={v15, v16}, X(v15)={v16, v17}, X(v16)={v17, v18}, X(v17)={v18, v19}, X(v18)={v19, v10} 10 )={v8,v 10}.
[0086] S225, for trees Each tree node X(v) in the tree contains node v and its neighboring nodes. The tree node X(u) corresponding to the first node u eliminated among the neighboring nodes is used as the parent node of the tree node X(v) to construct the tree edge. For example, in the tree node X(v4) = {v3, V4, v7}, node v7 is eliminated before node v3, so the tree node X(v7) is used as the parent node of the tree node X(v4). After all the tree edges are constructed, the subgraph G1 has been decomposed into the corresponding tree edges. Tree The specific structure of Figure 6 As shown, the dark grid represents the tree node, and the white grid represents the neighboring nodes of the tree node in the graph data;
[0087] Repeat S22 for the remaining subgraphs G2 and G3 to construct their corresponding trees and Convert all subgraphs into corresponding trees, and The specific structure of Figure 7 、 Figure 8 shown.
[0088] S23, through each tree The structure of building the corresponding ciphertext index
[0089] S231, select tree For a tree node X(v9)={v8,v9}, an index entry is constructed for the edges corresponding to the node v9 and each of its neighboring nodes: the node v9 and its neighboring node v8 are calculated using the hash function sha256 algorithm to obtain their corresponding hash values H(v9) and H(v8), and the distance value 3 from the node v9 to the node v8 is calculated using homomorphic encryption to obtain d(3); H(v9) is used as the index item of the index entry, and H(v8) is connected with the encrypted distance value d(3) and the hash value of the node v8 corresponding to the parent node X(v8) of the tree node X(v9) to obtain the content of the index entry H(v8)||d(3)‖‖H(v8), thereby generating an index entry corresponding to the tree node X(v9): H(v9)→H(v8)||d(3)||H(v8).
[0090] S232. Repeat S231 until all index entries of the tree node are constructed. Node v9 has only one neighbor node v8, so the index entry of the tree node X (v9) is constructed.
[0091] S233, repeat S231-S232, and All tree nodes generate corresponding index entries, and the tree All index entries generated are as follows: H(v1)→H(v2)||d(2)||H(v2), H(v1)→H(v5)||d(1)||H(v2), H(v2)→H(v3)||d(3)||H(v3), H(v3)→H(v5)||d(4)||H(v5), H(v4)→H(v3)||d(2)||H(v7), H(v4)→H(v7)||d(4)||H(v7), H(v6)→H(v5)||d(2)||H(v5), H(v7)→H(v5)||d(2)||H(v5), H(v8)→H(v4)||d(2)||H(v4), H(v9)→H(v8)||d(3)||H(v8), H(V 10 )→H(v8)||d(3)||H(v8), tree Generate the corresponding ciphertext index like Figure 9 shown.
[0092] S234, the remaining trees Heshu Repeat S231-S233 to generate the corresponding ciphertext index and As shown in Figure 10 and Figure 11 As shown, after completion, the ciphertext index corresponding to the graph data G is generated
[0093] S24, ciphertext index θ G After generation, the user indexes each sub-ciphertext The hash value corresponding to its quality Then the ciphertext index θ G Upload to the cloud platform.
[0094] S3. When a user queries graph data G, the user submits a query request to the data owner and sends a digital signature with identity authentication to the data owner; a digital signature is a mathematical scheme used to verify the authenticity, integrity and identity of the signer of the data, and is mainly used here to determine the user's identity.
[0095] S4. After the data owner receives the user's digital signature, he decrypts the digital signature and confirms the user's identity. After proving the security of the user's identity, he sends the authorization token to the user through a secure channel. The authorization token contains the hash mapping table of the graph data nodes, the quality and its corresponding hash value (1→ρ1, 2→ρ2, 3→ρ3) and the decryption key sk. The data owner sends the authorization token to the user. The authorization token has a time limit and will automatically expire after the time limit.
[0096] S5. After receiving the authorization token, the user starts to query the graph data G. The user uses the sha256 hash function to calculate the starting point v2 and the ending point v7 to obtain H(v2) and H(v7). The quality threshold ρ1 required for query in the authorization token is taken, and the calculation results are combined into a triple (H(v2), H(v7), ρ1), which is the query token. The user sends the query token (H(v2), H(v7), ρ1) to the cloud platform.
[0097] S6. The cloud platform executes the query algorithm: After receiving the query token, the cloud platform first decomposes the query token triple (H(v2), H(v7), ρ1) to obtain H(v2), H(v7), ρ1; specifically, the following steps are performed:
[0098] S61. Find the corresponding ciphertext index according to the quality threshold ρ1 in the query token.
[0099] S62, in the ciphertext index Find the index entries H(v2)→H(v3)||d(3)||H(v3) and H(v7)→H(v5)||d(2)||H(v5) for the query start and end points H(v2) and H(v7).
[0100] S63. Loop through the last item in the index entries of the query start and end points H(v2) and H(v7), that is, the parent node, until the common ancestor of the two is found, that is, the lowest common ancestor H(v5).
[0101] The search process for the starting point H(v2) is H(v2)→H(v3)→H(v5); the search process for the end point H(v7) is H(v7)→H(v5).
[0102] S64, respectively query the shortest distances between node H(v2) and node H(v7) and their lowest common ancestor node H(v5). The query process is as follows: Figure 12 As shown, specifically including:
[0103] S641. Query the shortest distance from node H(v2) to node H(v5): traverse the index entries related to node H(v2), find the two paths H(v2)→H(v3)→H(v5) and H(v2)→H(v1)→H(v5) from node H(v2) to node H(v5), and calculate the distances of the two paths based on the second item in the index entry, i.e., the distance value: the distance of the path H(v2)→H(v3)→H(v5) is d(3)+d(4)=d(7); the distance of the path H(v2)→H(v1)→H(v5) is d(1)+d(2)=d(3). Since the distance d(7)>d(3), the shortest distance from node H(v2) to node H(v5) is d(3). The calculation formula is as follows: min (v2, v5)=min(d(H(v2)→H(v3)→H(v5), H(v2)→H(v1)→H(v5)))=min(d(3)+d(4), d(2)+d(1))=d(3).
[0104] S642. Query the shortest distance from node H(v7) to node H(v5): traverse the index entries related to node H(v7), find a path H(v7)→H(v5) from node H(v7) to node H(v5), and calculate the distance value of the path based on the second item in the index entry, that is, the distance value: the distance of the path H(v7)→H(v5) is d(2), so the shortest distance from node H(v7) to node H(v5) is d(2).
[0105] S65. Add the shortest distance d(3) from node H(v2) to node H(v5) and the shortest distance d(2) from node H(v7) to node H(v5) to obtain the shortest distance d(5) from node H(v2) to node H(v7). The calculation formula is as follows:
[0106] d min (V2, V7) = d min (H(v2)→H(v5))+d min (H(v7)→H(v5))=d(3)+d(2)=d(5).
[0107] S66. The cloud platform sends the calculated shortest distance d(5) and the intermediate nodes H(v1) and H(v5) of the path to the user.
[0108] S7. After the user receives the query result sent by the cloud platform, he uses the homomorphic encryption decryption key sk to decrypt the distance value d(5), and uses the hash mapping table of the graph data node to obtain the final query result for the intermediate nodes H(v1) and H(v5). The quality constraint shortest distance of the query is 5, and the intermediate nodes of the shortest path are v1 and v5.
[0109] S8. After the authorization token reaches the limit time, the user will lose the query permission for the graph data G. If there is a query requirement, the user will resubmit the query request to the data owner.
[0110] Example 2
[0111] This embodiment provides a device for implementing a tree decomposition-based encrypted graph quality-constrained shortest path query method, the device comprising:
[0112] at least one processor; and
[0113] A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to execute the encrypted graph quality-constrained shortest path query method based on tree decomposition as described above.
[0114] In this embodiment, electronic devices may include, but are not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronic devices, and the like.
[0115] Example 3
[0116] This embodiment also provides a computer-readable storage medium storing executable instructions, which, when executed, enable the machine to execute the above-described encrypted graph quality-constrained shortest path query method based on tree decomposition.
[0117] Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can read and execute instructions stored in the readable storage medium.
[0118] In this case, the program code itself read from the machine-readable medium can implement the functions of any one of the above embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute part of this specification.
[0119] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, DVD-RWs), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.
[0120] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0121] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0122] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0124] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A quality-constrained shortest path query method for encrypted graphs based on tree decomposition, characterized in that: The method comprises: S1. The key distribution agency sends the key pair Sent to the data owner, the key The key is sent to the user and will be used to encrypt and decrypt information related to the distance between nodes in the graph. S2. The data owner will Constructed as a ciphertext index , and index the ciphertext Send to the cloud platform; S3. When the user uses the graph data When making a query, the user submits a query request to the data owner and sends a digital signature with identity authentication to the data owner; S4. After receiving the digital signature of the user, the data owner decrypts the digital signature and confirms the user's identity. After proving the security of the user's identity, the authorization token is sent to the user through a secure channel; the authorization token contains the hash map of the graph data node, the quality and its corresponding hash value. and decryption key ; S5. After receiving the authorization token, the user starts to access the graph data. To query, the user uses the sha256 hash function to convert the starting point to the end point of the query. , end point Calculate and get , get the quality threshold that needs to be queried in the authorization token , combine the calculation results into triples , that is, query token, the user will query the token Send to the cloud platform; S7. After the user receives the query result sent by the cloud platform, he uses the homomorphic encryption decryption key Distance value Decrypt and use the hash map of the graph data nodes to obtain the final query results for the intermediate nodes, and obtain the quality-constrained shortest distance of the query and the intermediate nodes of the shortest path; S8. When the authorization token reaches the time limit, the user will lose access to the graph data. If there is a query requirement, the query request will be submitted to the data owner again.
2. The encrypted graph quality-constrained shortest path query method based on tree decomposition according to claim 1 is characterized in that: The S2 specifically includes: S21, the graph data Decompose the graph data into different subgraphs according to different quality values. middle Different quality values are divided into subgraphs; the quality of all edges under the subgraph with quality i must be greater than or equal to i, and the edges with quality less than i are eliminated. ; S22, each subgraph generated Perform tree decomposition; S23, through each tree The structure of building the corresponding ciphertext index ; S24, Ciphertext Index After generation, the user indexes each sub-ciphertext with a hash value of its quality Corresponding , then the ciphertext index Upload to the cloud platform.
3. The encrypted graph quality-constrained shortest path query method based on tree decomposition according to claim 2 is characterized in that: The S22 specifically includes: S221, calculation subgraph The degree of each node in the , select the node with the smallest degree Start eliminating. Degree is a basic concept in graph theory, which refers to the number of edges connecting a node to other nodes in the graph; S222. For the selected node , for all its neighbor nodes Add edges between nodes so that The neighbor nodes of A clique is formed in the graph, which is a complete graph. In a complete graph, there is an edge between any two different nodes. S223, the node and its neighboring nodes Forming a tree A tree node in ; S224, repeat S221-S223 until the graph data All nodes in are eliminated; S225, for trees Each tree node , containing nodes and its neighboring nodes, the first node to be eliminated among the neighboring nodes Corresponding tree node , as a tree node The parent node of the node is used to construct the tree edge. The parent node represents the node in the tree. After all the tree edges are constructed, the subgraph Decomposed into corresponding trees .
4. The encrypted graph quality-constrained shortest path query method based on tree decomposition according to claim 3 is characterized in that: The S23 specifically includes: S231, select tree A tree node , the node Construct an index entry for each edge corresponding to its neighbor node: The node Its neighboring nodes Use the hash function sha256 algorithm to calculate and get its corresponding hash value and ; The node To Node The distance value Calculated using homomorphic encryption , the encryption process uses the encryption key ; Will As the index item of this index entry, Distance value from encryption and tree nodes Its parent node Corresponding node The hash value is connected to get the content of the index entry , so far the tree node The corresponding index entry: ; S232, repeat S231 until all index entries of the tree node are constructed; S233, repeat S231-S232, and All tree nodes generate corresponding index entries; S234, repeat steps S231-S233 for the remaining trees to generate the corresponding ciphertext index, and the graph data is generated after completion. Corresponding ciphertext index .
5. The encrypted graph quality-constrained shortest path query method based on tree decomposition according to claim 4 is characterized in that: The S6 specifically includes: S61. Based on the quality threshold in the query token Find the corresponding ciphertext index ; S62, in the ciphertext index Find the query start and end points and Index entries for S63, loop through the query start and end points and The last item in the index entry of the parent node; until the common ancestor of the two is found, that is, the lowest common ancestor ; The lowest common ancestor refers to the most recent common ancestor node of two nodes in the tree, that is, the common ancestor closest to the two nodes; S64. Query nodes separately and nodes To its lowest common ancestor node The shortest distance; S65, the node To Node The shortest distance With node To Node The shortest distance Add together to get the node To Node The shortest distance , the calculation formula is as follows: (1); S66, the cloud platform calculates the shortest distance , and the intermediate nodes of the path are sent to the user.
6. A device for implementing a tree decomposition-based encrypted graph quality-constrained shortest path query method, characterized in that: The device comprises: at least one processor; and A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to execute the encrypted graph quality-constrained shortest path query method based on tree decomposition as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores executable instructions, which, when executed, enable the processor to execute the encrypted graph quality-constrained shortest path query method based on tree decomposition according to any one of claims 1 to 5.
Citation Information
Patent Citations
Timing sequence road network shortest path query method based on tree decomposition
CN116028682A
Graph encryption shortest path query method and system supporting k disordered nodes
CN114707012A
Quality constraint shortest path query method and device for encrypted graph and computer readable storage medium
CN118410067A