A K-step reachable query method, device and medium thereof

By generating BFSI indexes and using encryption algorithms to process key values ​​in the graph, the problem of implementing K-step reachable query while ensuring the privacy of the graph is solved, and an efficient and secure query process is achieved.

CN115033749BActive Publication Date: 2025-04-04QINGDAO UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210784240.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-04-04
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

The prior art is difficult to implement K-step reach query while ensuring the privacy of the graph.

Method used

By generating a BFSI index, encrypting the min value and post value using the unsequence encryption algorithm, and encrypting the TLE value using the Paillier homomorphic encryption algorithm, so as to determine whether the K step between the two nodes can be reached under the premise of ensuring privacy.

Benefits of technology

It realizes that on the premise of ensuring the privacy of the graph, it is possible to accurately determine whether the K-step can be reached between the two nodes in the graph, which enhances the applicability and security of the K-step can be reached query method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033749B_ABST
    Figure CN115033749B_ABST
Patent Text Reader

Abstract

The present application discloses a K-step reachable query method, device and medium thereof, which relates to the field of computer technology and is used to query whether two nodes in a graph are K-step reachable. In view of the problem that the current K-step reachable method cannot take into account data privacy, a K-step reachable query method is provided, which encrypts the min value and the post value through a sequence-revealing encryption algorithm, and can still achieve the size comparison of the min value and the post value between two points under the premise of ensuring the privacy of the min value and the post value; and encrypts the TLE value through a Paillier homomorphic encryption algorithm, and can still achieve addition and subtraction calculations under the premise of ensuring the privacy of the TLE value; thereby, the BFSI index generated by the graph is used to determine whether the two nodes in the graph are K-step reachable. Under the premise of achieving the K-step reachable query, the privacy of the data is taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a K-step reachable query method, device and medium thereof. Background Art

[0002] As an important data structure, graphs can be used to represent various entities in data and the relationships between entities. They are widely used in many disciplines. For example, one of the applications of graphs is K-step reachability query, which is used to query whether it takes K steps from a node u in the graph to reach another node v in the graph.

[0003] As the scale of graph data grows, data owners need to spend a lot of money to store and query such large-scale graph data. With the development of information technology, cloud services have the advantages of providing huge storage space and powerful computing power. Therefore, data owners want to outsource graphs to cloud servers to store and query graph data on behalf of data owners. However, cloud service providers are not completely trustworthy to data owners. Data owners need to encrypt graphs, which brings challenges to implementing K-step reachable queries.

[0004] Therefore, technicians in this field are in urgent need of a K-step reachable query method to implement the K-step reachable query while ensuring the privacy of the graph. Summary of the invention

[0005] The purpose of the present application is to provide a K-step reachable query method, device and medium thereof, so as to solve the problem that it is currently impossible to query whether two points are reachable in K steps while ensuring graph privacy.

[0006] In order to solve the above technical problems, the present application provides a K-step reachable query method, comprising:

[0007] Receive and parse the query request to obtain the first node, the second node and the number of constraint steps;

[0008] According to the BFSI index, determine whether the first node and the second node are reachable under the constraint number of steps, and generate a query result;

[0009] Among them, the BFSI index includes each node and the ternary array corresponding to the node, which is obtained by dividing the graph into several breadth-first directed trees through breadth traversal in advance; the min value and post value in the ternary array are encrypted in advance by the decryption encryption algorithm, and the TLE value is encrypted in advance by the Paillier homomorphic encryption algorithm;

[0010] Returns the query results.

[0011] Preferably, determining whether the first node and the second node are reachable under the constraint number of steps according to the BFSI index, and generating the query result includes:

[0012] Determine whether the first node and the second node are in the same breadth-directed tree. If so, determine the number of encryption steps according to the TLE values ​​of the first node and the second node, and return the number of encryption steps as the query result.

[0013] Preferably, after determining whether the first node and the second node are in the same breadth-directed tree, the method further includes:

[0014] If not, determine whether there are non-tree edges between the first node and its child nodes;

[0015] If it does not exist, the first node and the second node are unreachable and are returned as the query result;

[0016] If it exists, the reachability of the first node and the second node is determined according to the adjacency list. If it is satisfied, the number of encryption steps is determined according to the TLE values ​​of the first node and the second node, and the number of encryption steps is returned as the query result. If it is not satisfied, the first node and the second node are unreachable, and the query result is returned;

[0017] The adjacency list includes the edges in the graph that are not in the breadth-first tree.

[0018] Preferably, judging the reachability of the first node and the second node according to the adjacency linked list includes:

[0019] Determine whether the adjacency linked list contains an edge with the first node as the head node;

[0020] If included, determining the number of encryption steps according to the TLE values ​​of the first node and the second node includes:

[0021] The non-tree node corresponding to the first node is determined according to the adjacency linked list, and the number of encryption steps is determined according to the TLE values ​​of the non-tree node and the second node.

[0022] Preferably, after determining whether the adjacency linked list contains an edge with the first node as the head node, the method further includes:

[0023] If not included, determine all child nodes of the first node according to the BFSI index;

[0024] Determine whether there is an edge with a child node as the head node in the adjacency list;

[0025] If so, determining the number of encryption steps according to the TLE values ​​of the first node and the second node includes:

[0026] The corresponding non-tree node is determined according to the child node, and the number of encryption steps is determined according to the TLE value of the non-tree node and the second node, and the number of encryption steps is returned as the query result.

[0027] Preferably, each point in the graph is encrypted by a pseudo-random permutation function.

[0028] Preferably, the query request further includes a trapdoor.

[0029] In order to solve the above technical problems, the present application also provides a K-step reachable query device, comprising:

[0030] A parsing module, used for receiving and parsing a query request to obtain a first node, a second node and a constraint step number;

[0031] A query module is used to determine whether the first node and the second node are reachable under the constraint number of steps according to the BFSI index, and generate a query result; wherein the BFSI index includes each point and a ternary array corresponding to the point, which is obtained by dividing the graph into a number of breadth-first directed trees by breadth-first traversal in advance; the min value and post value in the ternary array are encrypted in advance by the decryption encryption algorithm, and the TLE value is encrypted in advance by the Paillier homomorphic encryption algorithm;

[0032] Return module, used to return query results.

[0033] In order to solve the above technical problems, the present application also provides a K-step reachable query device, comprising:

[0034] Memory for storing computer programs;

[0035] A processor is used to implement the steps of the K-step reachable query method as described above when executing a computer program.

[0036] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the K-step reachable query method as described above are implemented.

[0037] The present application provides a K-step reachable query method, which realizes the determination of whether the two nodes in the graph are reachable within the constraint step number K through the BFSI index generated by the graph. The specific determination process is that if two nodes u and v satisfy min(u)≤min(v), post(u)>post(v), then we can conclude that u can reach v. If u can reach v and TLE(v)-TLE(u)≤k, then u to v satisfies k-step reachability, thereby realizing K-step reachable query. In addition, the present application encrypts the min value and post value by the sequence-revealing encryption algorithm, and the size comparison of the min value and post value between the two points can still be realized under the premise of ensuring the privacy of the min value and the post value. The TLE value is encrypted by the Paillier homomorphic encryption algorithm, and the addition and subtraction calculation can still be realized under the premise of ensuring the privacy of the TLE value to determine whether the two nodes are reachable in K steps. Therefore, under the premise of ensuring privacy, the present application does not interfere with the determination of K-step reachability based on the BFSI index, and enhances the applicability and security of the K-step reachable query method.

[0038] The K-step reachable query device and computer-readable storage medium provided in the present application correspond to the above method and have the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 A flowchart of a K-step reachable query method provided by the present invention;

[0041] Figure 2 A schematic diagram of a small- to medium-scale diagram provided by the present invention;

[0042] Figure 3 Based on Figure 2 A schematic diagram of a BFSI index;

[0043] Figure 4 Based on Figure 2 A schematic diagram of an adjacency linked list;

[0044] Figure 5 A flowchart of another K-step reachable query method provided by the present invention;

[0045] Figure 6 A structural diagram of a K-step reachable query device provided by the present invention;

[0046] Figure 7 A structural diagram of another K-step reachable query device provided by the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] The core of this application is to provide a K-step reachable query method, device and medium thereof.

[0049] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0050] As an important data structure, graphs have different applications in many fields. Among them, one important application is K-step reachable query. K-step reachable query can be used to represent the influence strength of one entity on another entity, and has been widely used in many applications. For example, in wireless sensor networks, the number of steps between sensors will affect the transmission strength of information. When the number of steps between the transmitter and the receiver is large, it means that the transmission strength of the information is weak, and the receiver may not receive the complete transmission information. In social networks, K-step reachable query can represent the familiarity between two people. The fewer the steps between two people, the more familiar they are. In addition, there are many different applications, which will not be elaborated here.

[0051] It should be noted that the graph mentioned in this application refers to the graph in graph theory, rather than the images, pictures, etc. seen in daily life. It is a graph composed of a number of given points and lines connecting two points. This kind of graph is usually used to describe a certain specific relationship between certain things, with points representing things and lines connecting two points representing the relationship between the corresponding two things.

[0052] As the scale of graphs grows, storing such large-scale graphs and performing query calculations puts a huge burden on data owners. Therefore, current data owners store graph data on cloud servers and let the cloud servers complete query operations.

[0053] However, the cloud server is not completely trustworthy to the data owner, so the data owner has the need to protect the privacy of the graph. Based on this need, the data owner proposes an application scenario that meets their needs: the data owner encrypts the graph and then sends it to the cloud server. When the data queryer sends a query request, the cloud server can implement a K-step reachable query on the encrypted graph and return the query result to the data queryer.

[0054] However, currently, K-step reachable queries are performed on unencrypted graphs, and there is no mature solution for how to perform K-step reachable queries on encrypted graphs. Based on this, the present application provides a K-step reachable query method, such as Figure 1 As shown, including:

[0055] S10: Receive and parse the query request to obtain the first node, the second node and the number of constraint steps.

[0056] Specifically, a query request sent by a data queryer is received, which includes at least a pair of queried points (a first node u, a second node v) and a constraint step number K.

[0057] It is easy to understand that the application scenario targeted by this application is to meet the data owner's requirements for data privacy. For this reason, in order to avoid data leakage from query requests, the first node, the second node and the constraint step number need to be encrypted. The encrypted first node, the second node and the constraint step number are represented by u e 、v e and k e express.

[0058] Therefore, the data queryer and the data owner should have the same key. Specifically, the data queryer can receive the key sent by the data owner after passing the data owner's identity authentication. The key is the key for encrypting the graph.

[0059] S20: Determine, according to the BFSI index, whether the first node and the second node are reachable within a constrained number of steps, and generate a query result.

[0060] Among them, the BFSI index includes each point and the ternary array corresponding to the point, which is obtained according to the breadth-first tree after the graph is divided into several breadth-directed trees through breadth-first traversal in advance; the min value and post value in the ternary array are pre-encrypted by the decryption algorithm, and the TLE value is pre-encrypted by the Paillier homomorphic encryption algorithm.

[0061] Paillier algorithm: It is a homomorphic encryption algorithm that satisfies addition and multiplication homomorphism, so that the above TLE value can still be added and subtracted in the ciphertext state.

[0062] It should be noted that the process of pre-encrypting the data in the graph is completed by the data owner, and the encrypted graph and related data are uploaded to the cloud server for data query.

[0063] To further illustrate this method, the process of establishing the BFSI index is described in detail below with examples:

[0064] like Figure 2 As shown, there is a small-scale graph whose corresponding nodes and corresponding relationships are as follows Figure 2 shown. Figure 2 In the graph, the node with in-degree 0 is called the root node. By traversing each root node in turn, the graph is decomposed into several breadth-directed trees. Among them, there is no edge connecting any two breadth-directed trees, that is, each breadth-directed tree is independent, and each point in the graph only appears in one breadth-directed tree.

[0065] At this point, the BFSI index can be generated according to the above-mentioned breadth-directed trees. The BFSI index includes each point on the breadth-directed tree and the corresponding triple array (min, post, TLE) of the point.

[0066] Among them, the min value represents the minimum value of the min field in the child nodes of the node, that is, the smallest min value among all the child nodes of the node; the post value represents the sequence number of the post-order traversal, that is, the node is the point at which the visit ends

[0067] The min value and post value can be obtained by traversing the root nodes of each breadth-directed tree and assigning a value to each node. The specific assignment process can be shown as follows:

[0068] The min and post values ​​of each node are assigned through a counter. The initial value of the counter is 1. When a point is assigned the post value, the value of the counter increases by one. Starting from the root node, recursively visit its child nodes, find the leaf node (that is, the node without child nodes), then assign the min and post values ​​to the leaf node, assign the value of the counter at this time to min and post, and increase the value of the counter by one. When a node is a leaf node, its min value is equal to the post value, otherwise, its min value is the smallest min value among all the child nodes of the node. After a node is assigned, return to its parent node and continue the depth traversal until all the child nodes of the parent node are visited, then assign the min and post values ​​to its parent node.

[0069] The min value and post value are used to determine whether two nodes are in the same breadth directed tree and are reachable. The specific determination method is shown in the following formula:

[0070] min(u)≤min(v),post(u)>post(v)

[0071] Among them, min(u) represents the min value of the first node u, min(v) represents the min value of the second node v, post(u) represents the post value of the first node u, and post(v) represents the post value of the second node v.

[0072] When both conditions of the above formula are met at the same time, it means that the first node and the second node are located in the same breadth-directed tree and are reachable from each other.

[0073] The TLE value represents the height of the node in the breadth-directed tree. The height of the root node of the first breadth-directed tree is 1, and the height of its direct child node is 2, that is, the TLE value of a node is equal to the TLE value of its direct parent node plus 1. In order to ensure that the TLE value of each node in the graph is different, a preferred implementation is:

[0074] The TLE value of the root node of each breadth-directed tree is different.

[0075] The TLE value of the root node of the n-th breadth directed tree is greater than the maximum TLE value of the n-1-th breadth directed tree. Generally speaking, the TLE value of the root node of the n-th breadth directed tree = the maximum TLE value of the n-1-th breadth directed tree + 1.

[0076] If the first node and the second node are reachable, the number of steps between them can be determined by the TLE values ​​of the two points, and then it can be determined whether they are reachable in K steps, as shown in the following formula:

[0077] TLE(v)-TLE(u)≤K

[0078] Wherein, TLE(v) represents the TLE value of the second node v, TLE(u) represents the TLE value of the first node u, and K represents the number of constraint steps.

[0079] TLE(v)-TLE(u) is the number of steps between the first node and the second node.

[0080] Through the above operations, the BFSI index is generated based on Figure 2 The generated BFSI index is as follows Figure 3 The BFSI index can be used to determine whether two nodes are in the same breadth-directed tree and whether the two nodes are reachable. If the above conditions are met, it can also be used to get the number of steps between the two nodes.

[0081] S30: Return the query result.

[0082] According to the above steps, it is possible to determine whether the first node and the second node are reachable in K steps through the BFSI index, and return the result as the query result to the data queryer, thus ending the query process.

[0083] It is easy to understand that if the data queryer performs K-step reachability queries on multiple pairs of nodes in a query process, the K-step reachability query results are determined for each pair of nodes using the above method, and the query results are returned to the data queryer in the form of a result set.

[0084] In addition, it should be noted that since the data owner has the need to protect the privacy of the graph, the graph needs to be encrypted during the data query process.

[0085] In this application, the min value and post value of the ternary array in the BFSI index are encrypted using a sequence-revealing encryption algorithm, so that the min value and post value can still be judged in the above-mentioned size relationship in the ciphertext state. For the TLE value, it is encrypted using the Paillier homomorphic encryption algorithm. As can be seen from the above, the Paillier homomorphic encryption algorithm can make the TLE value satisfy the addition and multiplication homomorphism, so that the TLE value can still be added and subtracted in the ciphertext state. In addition, the node can also be encrypted. The encryption method is not limited in this application, and it can be performed by hash calculation and other methods, but a preferred implementation scheme is provided:

[0086] Each point in the graph is encrypted using a pseudo-random permutation function.

[0087] By encrypting each node in the graph through a pseudo-random permutation function, the privacy of the graph is further guaranteed, which better meets the needs of data owners and avoids data leakage.

[0088] After the data in the graph is encrypted using the above encryption method, the cloud server can only perform a K-step reachability query on the graph in the encrypted state, and cannot obtain the specific data content. In addition, whether two nodes meet the K-step reachability requirement is determined by comparing the number of steps between the two nodes and the number of constraint steps, and this part of the data is unknown to the cloud server. Therefore, for application scenarios after data encryption, the query results returned by the cloud server should include the number of steps between the two nodes, which is encrypted and is called the encrypted number of steps.

[0089] For data queryers, it is easy to know that they can only query the data in the graph after obtaining authorization from the data owner. That is, data queryers can obtain keys through identity authentication and other methods, decrypt the query results returned by the cloud server based on the key, and then determine whether the two nodes are reachable within K steps.

[0090] The present application provides a K-step reachable query method, which uses BFSI index and other methods to determine whether two nodes in a graph are reachable in K steps, and encrypts the min value and post value in the BFSI index ternary array through a sequence-revealing encryption algorithm, so that the reachability between the two nodes can still be determined by the encrypted min value and post value under the premise of ensuring data privacy; the TLE value in the ternary array is also encrypted through the Paillier homomorphic encryption algorithm, which ensures data privacy without affecting the addition, subtraction, and multiplication homomorphism of the TLE value, and the number of steps between the two nodes can still be determined by the TLE value, thereby determining whether the two nodes are reachable in K steps. Through the method provided by the present application, while meeting the query needs of data inquirers and using the powerful computing power and sufficient storage space of cloud servers to realize the storage and query of graphs, it also takes into account the privacy needs of data owners for data, adapts to practical application needs, and better realizes the query of K-step reachable nodes in the graph.

[0091] To further illustrate a K-step reachable query method provided by the present application, this embodiment further illustrates the query process:

[0092] After the data owner encrypts the graph using the method of the above embodiment and sends it to the cloud server, the cloud server can perform corresponding query operations according to the query request sent by the data inquirer.

[0093] Specifically, Figure 5 As shown, according to the BFSI index, it is determined whether the first node and the second node are reachable under the constraint number of steps, and the query results are generated, including:

[0094] S21: Determine whether the first node and the second node are in the same breadth-directed tree. If so, go to step S22.

[0095] S22: Determine the number of encryption steps according to the TLE values ​​of the first node and the second node, and return the number of encryption steps as a query result.

[0096] The method for determining whether the first node and the second node are in the same breadth directed tree has been clearly described in the above embodiment, which is implemented by min(u)≤min(v), post(u)>post(v). However, considering that the data on the cloud server side are all encrypted data, the above formula becomes:

[0097] Emin(u e )≤Emin(v e ),Epost(u e )>Epost(v e )

[0098] Among them, Emin represents the min value after encryption, and Epost represents the post value after encryption.

[0099] Satisfying the two conditions of the above formula means that the first node and the second node are in the same breadth directed tree and are reachable. Thereafter, the number of steps between the first node and the second node can be determined according to TLE(v)-TLE(u) in the above embodiment.

[0100] Similarly, the TLE value on the cloud server side is also encrypted ciphertext data, so the number of steps determined is the number of encryption steps, as shown in the following formula:

[0101] R=ETLE(v e )-ETLE(u e )

[0102] Among them, R represents the number of encryption steps, and ETLE represents the encrypted TLE value.

[0103] The above step S22 can realize the K-step reachability calculation between two nodes that are located in the same breadth-directed tree and are reachable. For other situations, this embodiment further provides a preferred implementation scheme, which, after determining whether the first node and the second node are in the same breadth-directed tree, further includes:

[0104] If not, go to step S23.

[0105] That is, step S21 is: determine whether the first node and the second node are in the same breadth-directed tree, if so, go to step S22, if not, go to step S23.

[0106] S23: Determine whether there are non-tree edges between the first node and its child nodes. If not, go to step S24; if yes, go to step S25.

[0107] S24: The first node and the second node are unreachable, and the result is returned as a query result.

[0108] If the first node and the second node are not in the same breadth directed tree and are reachable, and there are no non-tree edges between the first node and its child nodes, it means that there is no path that allows the first node to reach the second node. At this time, the first node and the second node do not meet the K-step reachability requirement, and this is returned as the query result.

[0109] If there are non-tree edges between the first node and its child nodes, it means that the first node may still reach the second node through the non-tree edge. Based on this, this embodiment provides a further judgment method:

[0110] S25: Determine whether the first node and the second node meet the reachability according to the adjacency linked list. If so, go to step S26; if not, go to step S24.

[0111] S26: Determine the number of encryption steps according to the TLE values ​​of the first node and the second node, and return the number of encryption steps as a query result.

[0112] The adjacency list includes the edges in the graph that are not in the breadth-first tree.

[0113] In the process of generating a breadth-directed tree, whenever an edge in the graph is added to the breadth-directed tree, the edge is deleted from the graph. Finally, when all breadth-directed trees are established, the remaining edges in the graph are non-tree edges, which are stored in the adjacency linked list.

[0114] based on Figure 2 , Figure 3 The adjacency list of Figure 4 As shown. The adjacency list is used to assist in determining whether the first node and the second node meet the reachability. In addition, the adjacency list can also be encrypted to protect the privacy of the graph.

[0115] It should be noted that the above-mentioned determination of the reachability of the first node and the second node according to the adjacency linked list may further be:

[0116] S251: Determine whether the adjacency linked list contains an edge with the first node as the head node. If so, step S26 includes:

[0117] S26-a: Determine the non-tree node corresponding to the first node according to the adjacency linked list, and determine the number of encryption steps according to the TLE values ​​of the non-tree node and the second node.

[0118] Specifically, if step S251 finds an edge with the first node as the head node from the encrypted adjacency list, it means that the first node u e There are non-tree edges (u e , α e ),u e Its non-tree node α can be reached in one step through the non-tree edge e .

[0119] Then, the non-tree node α can be determined by step S26-a. e Whether k is satisfied e -1 step can reach the second node, and the judgment method is the same as above.

[0120] Further, based on the above step S251, another implementation scheme for determining the reachability between the first node and the second node is:

[0121] S252: Determine all child nodes of the first node according to the BFSI index, and determine whether there is an edge with the child node as the head node in the adjacency linked list. If so, step S26 includes:

[0122] S26-b: Determine the corresponding non-tree node according to the child node, and determine the number of encryption steps according to the TLE values ​​of the non-tree node and the second node, and return the number of encryption steps as the query result.

[0123] Specifically, if step S252 determines that there is a child node γ of the first node in the adjacency list, e As the edge of the head node, it means that the child node γ e There are non-tree edges (γ e , α e ). Then the first node u e Reaching a child node e The number of steps should be (ETLE(γ e )-ETLE(u e )), and the child node γ e Reach non-tree node α through its non-tree edges e The number of steps is only one step.

[0124] Therefore, the subsequent step S26-b determines whether the distance between the first node and the second node is K steps away, and only needs to determine the child node γ e and non-tree node α e Whether it satisfies (k e -(ETLE(γ e )-ETLE(u e ))-1 step to reach.

[0125] It should be noted that the relationship between steps S251 and S252 is: when the condition in S251 is not met, go to step S252. If the condition in step S252 is still not met, that is, the reachability between the first node and the second node is not met, according to step S25, it can be seen that the process should go to step S24.

[0126] The specific implementation plan for the data query process provided in this embodiment distinguishes in detail the situations that may occur in the K-step reachable query process, and makes a K-step reachable judgment for each situation, covering most situations in the K-step reachable query process, meeting the query needs of data queryers, making the K-step reachable query results more accurate, and facilitating the practical application of K-step reachable queries.

[0127] As can be seen from the above, the above has clearly and in detail explained how this application implements K-step reachable queries while ensuring data privacy. However, in actual application scenarios, when a user such as a data queryer accesses a cloud server, it is usually necessary to obtain authorization through identity authentication and other means in order to read or query the data in the cloud server.

[0128] However, for the application scenario of K-step reachable query targeted by this application, the query result obtained by the data queryer is encrypted, and the decryption key needs to be obtained from the data owner in advance through identity authentication and other methods. That is, the data queryer has already performed an identity authentication operation, and the data owner is trustworthy. Therefore, when the data queryer sends a K-step reachable query request to the cloud server, it is also trustworthy because it only queries the graph belonging to the data owner. At this point, it is not so necessary to repeat the identity authentication process, and it will affect the query efficiency to a certain extent.

[0129] Based on the above problems, this embodiment further provides a preferred implementation scheme on the basis of the above embodiments: the query request also includes a trapdoor.

[0130] It is easy to know that a trapdoor is a "mechanism" set in a system or a file that allows security policies to be violated when specific input data is provided. For example, a login processing subsystem allows a specific user identification code to be processed to bypass the usual password check.

[0131] If a login processing system allows a specific user identification code, the usual password check can be bypassed through this identification code. Intuitively, it is possible to log in with a special user name and password to modify the system. This security risk is called a trapdoor, also known as unauthorized access.

[0132] Therefore, the preferred solution provided in this embodiment, through a query request containing a trapdoor, can enable the data queryer to bypass the identity authentication and other steps of the cloud server, and directly query from the encrypted graph whether the two nodes are reachable in K steps, thereby simplifying the process steps required for the K-step reachable query, thereby improving the query efficiency, reducing the waiting time of the data queryer, and avoiding the cloud server from wasting resources in unnecessary identity authentication steps, which is more suitable for practical applications.

[0133] In the above embodiment, a K-step reachable query method is described in detail, and the present application also provides an embodiment corresponding to a K-step reachable query device. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware.

[0134] Based on the functional module perspective, such as Figure 6 As shown, this embodiment provides a K-step reachable query device, including:

[0135] A parsing module 31 is used to receive and parse the query request to obtain the first node, the second node and the number of constraint steps;

[0136] The query module 32 is used to determine whether the first node and the second node are reachable under the constraint number of steps according to the BFSI index, and generate a query result; wherein the BFSI index includes each point and a ternary array corresponding to the point, which is obtained by dividing the graph into a plurality of breadth-first directed trees by breadth-first traversal in advance; the min value and the post value in the ternary array are encrypted in advance by the decryption encryption algorithm, and the TLE value is encrypted in advance by the Paillier homomorphic encryption algorithm;

[0137] The return module 33 is used to return the query result.

[0138] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.

[0139] The K-step reachable query device provided in this embodiment uses BFSI index and other methods to query whether two nodes in the graph are reachable in K steps, and encrypts the min value and post value in the BFSI index ternary array through the sequence-revealing encryption algorithm, so that the encrypted min value and post value can still judge the reachability between the two nodes; the TLE value in the ternary array is encrypted through the Paillier homomorphic encryption algorithm, which does not affect the addition, subtraction and multiplication homomorphism of the TLE value, and the number of steps between the two nodes can still be judged by the TLE value, and then determine whether the two nodes are reachable in K steps. While meeting the query needs of data inquirers and using the powerful computing power and sufficient storage space of cloud servers to realize graph storage and query, the data owner's privacy needs for data are also taken into account, which meets the needs of practical applications.

[0140] Figure 7 A structural diagram of a K-step reachable query device provided in another embodiment of the present application is shown as follows: Figure 7 As shown, a K-step reachable query device comprises: a memory 40, for storing a computer program;

[0141] The processor 41 is used to implement the steps of a K-step reachable query method in the above embodiment when executing a computer program.

[0142] The K-step reachable query device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0143] Among them, the processor 41 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 41 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 41 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 41 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 41 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0144] The memory 40 may include one or more computer-readable storage media, which may be non-transitory. The memory 40 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 40 is at least used to store the following computer program 401, wherein, after the computer program is loaded and executed by the processor 41, it can implement the relevant steps of a K-step reachable query method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 40 may also include an operating system 402 and data 403, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 402 may include Windows, Unix, Linux, etc. Data 403 may include but is not limited to a K-step reachable query method, etc.

[0145] In some embodiments, a K-step reachable query device may further include a display screen 42 , an input / output interface 43 , a communication interface 44 , a power supply 45 , and a communication bus 46 .

[0146] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on a K-step reachable query device, and may include more or less components than those shown in the figure.

[0147] A K-step reachable query device provided in an embodiment of the present application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a K-step reachable query method.

[0148] The K-step reachable query device provided in this embodiment realizes the query whether two nodes in the graph meet the K-step reachability through BFSI index and other methods, and encrypts the min value and post value in the BFSI index ternary array through the sequence-revealing encryption algorithm, so that the encrypted min value and post value can still judge the reachability between the two nodes; the TLE value in the ternary array is encrypted through the Paillier homomorphic encryption algorithm, which does not affect the addition, subtraction and multiplication homomorphism of the TLE value, and the number of steps between the two nodes can still be determined through the TLE value, and then judge whether the two nodes are K-step reachable. The realization not only meets the query needs of data queryers, and uses the powerful computing power and sufficient storage space of cloud servers to realize the storage and query of graphs, but also takes into account the privacy needs of data owners for data, and meets the needs of practical applications.

[0149] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0150] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0151] The computer-readable storage medium provided in this embodiment can query whether two nodes in a graph are reachable in K steps by using BFSI index and other methods when the computer program stored therein is executed, and encrypt the min value and post value in the BFSI index ternary array by using the sequence-revealing encryption algorithm, so that the encrypted min value and post value can still determine the reachability between the two nodes; and encrypt the TLE value in the ternary array by using the Paillier homomorphic encryption algorithm, which does not affect the addition, subtraction and multiplication homomorphism of the TLE value, so that the number of steps between the two nodes can be determined by the encrypted TLE value, and then determine whether the two nodes are reachable in K steps. While meeting the query needs of data queryers and using the powerful computing power and sufficient storage space of cloud servers to realize the storage and query of graphs, the data owner's privacy needs for data are also taken into account, which meets the needs of practical applications.

[0152] The above is a detailed introduction to a K-step reachable query method, device and medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0153] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A K-step reachable query method, characterized in that: include: Receive and parse the query request to obtain the first node, the second node and the number of constraint steps; Determine whether the first node and the second node are in the same breadth-directed tree; If yes, determine the number of encryption steps according to the TLE values ​​of the first node and the second node, and return the number of encryption steps as the query result; If not, determine whether the first node and its child nodes have non-tree edges; If not, the first node and the second node are unreachable, and the query result is returned; If so, determining the reachability of the first node and the second node based on whether the adjacency linked list contains an edge with the first node as the head node; If satisfied, determining the number of encryption steps according to the TLE values ​​of the first node and the second node, and returning the number of encryption steps as a query result; If not, the first node and the second node are unreachable, and the query result is returned; Wherein, the adjacency linked list includes edges in the graph that are not in the breadth-directed tree; The BFSI index includes each node and a ternary array corresponding to the node, which is obtained by dividing the graph into a plurality of breadth-directed trees by breadth-based traversal in advance, and then according to the breadth-directed trees; the min value and the post value in the ternary array are encrypted in advance by the decryption encryption algorithm, and the TLE value is encrypted in advance by the Paillier homomorphic encryption algorithm; Returns the query result.

2. The K-step reachable query method according to claim 1, characterized in that: Determining the number of encryption steps according to the TLE values ​​of the first node and the second node includes: The non-tree node corresponding to the first node is determined according to the adjacency linked list, and the number of encryption steps is determined according to the TLE values ​​of the non-tree node and the second node.

3. The K-step reachable query method according to claim 2, characterized in that: After determining whether the adjacency linked list contains an edge with the first node as the head node, the method further includes: If not included, determining all child nodes of the first node according to the BFSI index; Determine whether there is an edge with the child node as the head node in the adjacency linked list; If so, determining the number of encryption steps according to the TLE values ​​of the first node and the second node includes: The corresponding non-tree node is determined according to the child node, and the number of encryption steps is determined according to the TLE values ​​of the non-tree node and the second node, and the number of encryption steps is returned as a query result.

4. The K-step reachable query method according to claim 1, characterized in that: Each point in the graph is encrypted by a pseudo-random permutation function.

5. The K-step reachable query method according to any one of claims 1 to 4, characterized in that: The query request also includes a trapdoor.

6. A K-step reachable query device, characterized in that: include: A parsing module, used for receiving and parsing a query request to obtain a first node, a second node and a constraint step number; A query module, used for determining whether the first node and the second node are in the same breadth-directed tree; If yes, determine the number of encryption steps according to the TLE values ​​of the first node and the second node, and return the number of encryption steps as the query result; if no, determine whether there are non-tree edges between the first node and its child nodes; If not, the first node and the second node are unreachable, and the query result is returned; If so, determining the reachability of the first node and the second node based on whether the adjacency linked list contains an edge with the first node as the head node; If satisfied, determining the number of encryption steps according to the TLE values ​​of the first node and the second node, and returning the number of encryption steps as a query result; If not satisfied, the first node and the second node are unreachable and are returned as query results; wherein the adjacency list includes edges in the graph that are not in the breadth-directed tree; wherein the BFSI index includes each point and a ternary array corresponding to the point, which is obtained by dividing the graph into a number of breadth-directed trees by breadth traversal in advance and then according to the breadth-directed tree; the min value and post value in the ternary array are encrypted in advance by the decryption encryption algorithm, and the TLE value is encrypted in advance by the Paillier homomorphic encryption algorithm; The return module is used to return the query result.

7. A K-step reachable query device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the K-step reachable query method as claimed in any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the K-step reachable query method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Merkle tree structure-based space inquiring integrity verification method

    CN104750784A

  • Verifiable encrypted image retrieval method supporting dynamic updating

    CN113569280A