Encrypted graph quality constraint shortest path query method and device based on tree decomposition and computer readable storage medium
By tree decomposing and encrypting the graph structure data and generating encrypted indexes, the data leakage and security vulnerabilities faced by users when storing data on third-party servers are solved, and a safe and accurate shortest path query is achieved in the cloud environment.
Patent Information
- Application Number
- CN202510078470.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Users face the risk of data breaches and security breaches when storing data on third-party servers, especially when shortest path queries, where the server may access or steal data without authorization.
The shortest path query method for encrypted graph quality constraints based on tree decomposition is adopted. By tree decomposing and encrypting the graph structure data, an encrypted index is generated, and the shortest path query that meets specific quality constraints is performed on this encrypted index.
While protecting user data privacy, it can accurately calculate the shortest path, ensure data security, and provide a reliable solution for data security and efficient computing in cloud environments.
Smart Images

Figure CN119989410A_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 of encrypted graphs based on tree decomposition. Background Art
[0002] With the development of big data and artificial intelligence, knowledge graphs, as a technical method, are widely used in all walks of life. It describes entities and their relationships through graph structures, realizing deep association and intelligent reasoning of information. The nodes in the knowledge graph represent entities, such as people, places, organizations, etc., and the edges represent the relationships or attributes between entities, such as name, date of birth, friends, spouse, etc., thus revealing the complex connections between entities.
[0003] The shortest path query is a common operation in knowledge graphs, which is used to find the shortest path and distance between two nodes. It not only improves the efficiency of information retrieval, but also plays an important role in practical applications, especially when processing large-scale data sets, it can significantly shorten the data retrieval time. Therefore, the shortest path query is widely used in search engines, intelligent question-answering systems, data mining, machine learning and other fields.
[0004] The constrained shortest path problem is a special form of the shortest path query, which aims to find the shortest path that satisfies specific constraints. Constraints usually include node and path restrictions, while the present invention focuses on the quality attributes of edges, such as the carrying capacity of roads in logistics distribution or the load limit of lines in power transmission. The core of the quality-constrained shortest path query is to verify whether each edge on the path meets the quality requirements before calculating the shortest path. Only qualified paths are selected to ensure that the final path meets the quality constraints.
[0005] Chinese patent document CN116028682A discloses a method for querying the shortest path of a temporal road network based on tree decomposition, comprising establishing a temporal graph according to 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 are widely used in fields such as road traffic, network routing, and social networks due to their high organization and flexibility. As the scale of applications expands, the storage demand for graph data continues to grow, and local storage may not be able to bear it, so outsourcing data to the cloud platform becomes a feasible solution. However, data storage on third-party servers may bring leakage and security risks, especially cloud servers may 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 defect of the above-mentioned prior art and provide a tree decomposition-based encrypted graph quality-constrained shortest path query method to solve the problem that the user's data is stored on a third-party server, which may bring the risk of data leakage and security vulnerabilities. When the user needs to use the server to calculate the shortest path, in order to prevent the server from stealing the index information, the present invention uses encryption technology to encrypt the tree decomposition index after calculating it, so as to protect the privacy of user data while still accurately calculating the shortest path.
[0008] The invention also discloses a device loaded with an encrypted graph quality-constrained shortest path query method based on tree decomposition.
[0009] The detailed technical scheme of the present invention is 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 the ciphertext index θ G Send to cloud platform;
[0013] S3. When a user queries the 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;
[0014] 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.
[0015] The authorization token contains a hash map of 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 maps the original value to the storage location of its hash value through a hash function 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 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), i.e., 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 node, 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 under the subgraph with quality i must be greater than or equal to i, and eliminate the 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 that represents graph data as a tree structure, which aims to decompose the structure of complex graphs in order to simplify computational problems. Through tree decomposition, complex problems on graphs can be efficiently processed by using the simple structure of the tree while retaining the basic properties of the graph. Compared with traditional methods for calculating the shortest distance, such as the Dijkstra algorithm, the Floyd-Warshall algorithm, and the 2HCL index algorithm, tree decomposition can be used not only to calculate the distance of the shortest path, but also to find each intermediate node in the shortest path, which is its advantage.
[0025] S23, through each tree The structure of constructing 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), select the node v with the smallest degree 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 neighbor nodes. The tree node X(u) corresponding to the first node u eliminated in the neighbor 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); the hash function is an algorithm that can convert input data of any length into output data of fixed length, and the 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 value 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). This generates an index entry corresponding to the tree node X(v): 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 make the tree 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 )'s index entry.
[0044] S63, loop through the query start and end points H(v s ) and H(v t )'s index entry, i.e., the parent node, until the common ancestor of the two is found, i.e., the lowest common ancestor H(v z ), the lowest common ancestor refers to the nearest common ancestor node of two nodes in the tree, that is, the common ancestor closest to the two nodes.
[0045] S64, query the nodes 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, i.e. 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, i.e. 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, node H(v s ) to node H(v z ) and the shortest distance d(m) between 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 t) 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, enables 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, and 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 method for querying the shortest path based on tree decomposition of an encrypted graph with quality constraints. The method generates an encrypted index by performing tree decomposition and encryption processing on graph structure data, and can execute the shortest path query that meets specific quality constraints on the 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 execute the quality constrained shortest path query on the encrypted data according to specific application requirements, thereby providing a reliable solution for data security and efficient computing in a cloud environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic flow chart 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 Embodiment 1;
[0060] Figure 4This is a schematic diagram of the 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] Fig. 9 The ciphertext index described in Example 1 Schematic diagram;
[0066] Fig.10 The ciphertext index described in Example 1 Schematic diagram;
[0067] Fig.11 The ciphertext index described in Example 1 Schematic diagram;
[0068] Fig.12 This is a schematic diagram of the query process described in Example 1. DETAILED DESCRIPTION
[0069] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0070] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those 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 also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0072] In the absence of conflict, the embodiments in the present disclosure and the features in the embodiments 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 based on tree decomposition of an encrypted graph with quality constraints, 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 the ciphertext index θ G Send to cloud platform;
[0078] Specifically, the S2 specifically includes:
[0079] S21, decompose the graph data G into different subgraphs according to different quality values, where 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, 1 represents the distance value from node v1 to node v5 is 1, and 3 represents the quality value from node v1 to node v5 is 3;
[0080] The graph data G is decomposed into three subgraphs G1, G2 and G3 with quality values of 1, 2 and 3. The decomposed subgraphs are as follows Figure 3 to Figure 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 (v6) = add edges between {v5} so that the neighbor nodes of node v6 form a bag in the 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 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(v 10 )={v8,v 10}.
[0086] S225, for trees Each tree node X(v) in the tree includes node v and its neighbor nodes. The tree node X(u) corresponding to the first node u eliminated in the neighbor 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 constructing 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 neighbor nodes: the node v9 and its neighbor 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 make the tree 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 Fig. 9 shown.
[0092] S234, the remaining trees And Tree Repeat S231-S233 to generate the corresponding ciphertext index and like Fig.10 and Fig.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 the graph data G, the user makes 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. When 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 the authorization token 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 that needs to be queried in the authorization token is taken, and the calculation results are combined into a triple (H(v2), H(v7), ρ1), that 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, it includes:
[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 of the starting point H(v2) is H(v2)→H(v3)→H(v5); the search process of the end point H(v7) is H(v7)→H(v5).
[0102] S64, respectively query the shortest distances from node H(v2) and node H(v7) to their lowest common ancestor node H(v5). The query process is as follows: Fig.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 from node H(v2) to node H(v5), H(v2)→H(v3)→H(v5) and H(v2)→H(v1)→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). Because 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, enables 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, the electronic device may include, but is 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 encrypted graph quality-constrained shortest path query method based on tree decomposition as described above.
[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 realize the function 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 (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), 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] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, 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 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 flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 flowchart and / or block diagram. 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 capable of directing a computer or other programmable data processing device to operate 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 A 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0124] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution 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 in the protection scope 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 (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; S2. The data owner constructs the graph data G as a ciphertext index θ G , and the ciphertext index θ G Send to cloud platform; S3. When a user queries the 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; 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 (1→ρ1, 2→ρ2...n→ρ n ) and decryption key sk; 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 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), i.e., the query token, the user will query the token (H(v s ), H(v t ), ρ1) is sent to the cloud platform; 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 node, and obtains the quality-constrained shortest distance of the query and the intermediate nodes of the shortest path; 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 demand, 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, 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 under the subgraph with quality i must be greater than or equal to i, and eliminate the edges with quality less than i, i = 1, 2...n; S22, each subgraph G generated i (i=1,2…n) perform tree decomposition; S23, through each tree The corresponding ciphertext index is constructed by 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.
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 G i The degree of each node in (i=1,2…n), select the node v with the smallest degree 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; S222: For the selected node v, all its neighboring nodes N G (v) Add edges between nodes so that the neighbor nodes of node v form a clique in graph G, i.e., a complete graph. In a complete graph, there is an edge between any two different nodes. S223, node v and its neighbor node N G (v) forming a tree node X(v) in the tree TG; S224, repeat S221-S223 until all nodes in the graph data G are eliminated; S225, for trees Each tree node X(v) in the tree contains node v and its neighbor nodes. The tree node X(u) corresponding to the first node u eliminated in the neighbor 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 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 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: Calculate the node v and its neighbor node w using the hash function sha256 algorithm to obtain their corresponding hash values H(v) and H(w); The distance value x from node v to node w is calculated using homomorphic encryption to obtain d(x), and the encryption process uses the encryption key pk; 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). Thus, an index entry corresponding to the tree node X(v) is generated: H(v)→→H(v)||d(x)||H(w); S232, repeat S231 until all index entries of the tree node are constructed; S233, repeat S231-S232, and make the tree All tree nodes generate corresponding index entries; 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 .
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. Find the corresponding ciphertext index according to the quality threshold ρ1 in the query token S62, in the ciphertext index Find the query start and end points H(v s ) and H(v t )'s index entry; S63, loop through the query start and end points H(v s ) and H(v t )'s 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; S64, query the nodes H(v s ) and node H(v t ) to its lowest common ancestor node H(v z )'s shortest distance; S65, node H(v s ) to node H(v z ) and the shortest distance d(m) between 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 t ) is calculated as follows: d min (v s ,v t )=d(m)+d(n)=d(k) (1); S66. The cloud platform sends the calculated shortest distance d(k) and the intermediate nodes of the path 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 machine to perform the encrypted graph quality-constrained shortest path query method based on tree decomposition as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Graph encryption shortest path query method and system supporting k disordered nodes
CN114707012A
Timing sequence road network shortest path query method based on tree decomposition
CN116028682A
Ciphertext retrieval method and system supporting hierarchical access control and user revocation
CN117763592A
Quality constraint shortest path query method and device for encrypted graph and computer readable storage medium
CN118410067A
Cited By
Multi-attribute fusion shortest path verifiable query method and device
CN121000374A
A multi-attribute fusion shortest path verifiable query method and device
CN121000374B