A method for generating encrypted hybrid index trees and privacy-preserving spatiotemporal contact queries
The construction of an encrypted hybrid index tree through Hilbert curve encoding and Bloom filter solves the problem of inefficient spatiotemporal contact query in the existing technology, realizes privacy protection and efficient spatiotemporal data query, which is suitable for flow investigation work.
Patent Information
- Application Number
- CN202210999099.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-08-19
AI Technical Summary
The existing technology cannot effectively carry out space-time contact inquiries for privacy protection, especially when facing large-scale data, which is inefficient and cannot meet the needs of mobile investigation work.
The original spatial position data is encoded by Hilbert curve, a mixed index tree is generated, and an encrypted index tree is constructed through prefix encoding and a Bloom filter, and a decryption key is generated in combination with security parameters for querying, realizing privacy protection and efficient query of spatiotemporal data.
It realizes spatiotemporal data query under sublinear time complexity, improves query efficiency, reduces data retrieval time loss, and is suitable for flow investigation work.
Smart Images

Figure CN115391803B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular relates to a method for generating an encrypted hybrid index tree and a privacy-protected spatiotemporal contact query. Background Art
[0002] As attack methods against cloud servers become increasingly systematic and structured, lowering the barrier to entry, concerns about data privacy leaks within cloud servers are growing. Performing spatiotemporal contact queries can even more easily expose user itineraries. However, faced with such a large volume of spatiotemporal data, achieving this task securely and efficiently is paramount. Currently, no solution exists for performing spatiotemporal contact queries that balances efficiency and security.
[0003] The closest existing solution to the present invention is a privacy-preserving spatial text keyword search problem. Wang et al. proposed a solution based on grayscale and bitmap encoding, called PBRQ. However, PBRQ has the following disadvantages:
[0004] 1) Unable to support privacy-preserving spatiotemporal intersection queries: It only performs spatial keyword searches and is powerless when the dataset contains both temporal and spatial information.
[0005] 2) Inefficiency with Large-Scale Data: PBRQ responds slowly to massive data requests, failing to meet the efficiency requirements for flow investigation. Specifically, PBRQ takes 3.14 seconds to retrieve query results from 1*10^5 ciphertext objects, making it inefficient and unsuitable for large datasets. Summary of the Invention
[0006] To address the aforementioned issues in related technologies, the present invention provides a method for generating an encrypted hybrid index tree and performing privacy-preserving spatiotemporal contact queries. The technical issues addressed by the present invention are achieved through the following technical solutions:
[0007] The present invention provides a method for generating an encrypted hybrid index tree, comprising:
[0008] Acquire multiple sets of original spatiotemporal data of multiple objects; each set of original spatiotemporal data includes original spatial position data and original time data corresponding to the original spatial position data;
[0009] Using a Hilbert curve, the original spatial position data is encoded to obtain multiple groups of spatiotemporal processing data including spatial encoding data and the original time data;
[0010] Performing prefix coding on the spatially coded data in each set of spatiotemporally processed data to generate a prefix coding family for each set of spatiotemporally processed data;
[0011] By taking each group of spatiotemporal processing data and the prefix coding family of each group of spatiotemporal processing data as a leaf node of a hybrid index tree, a plurality of leaf nodes are obtained;
[0012] By merging different prefix code families, non-leaf nodes are generated layer by layer from bottom to top; each non-leaf node corresponds to a merged code family, each non-leaf node is at least one leaf node or at least one parent node of a non-leaf node, and the merged code family corresponding to each parent node contains the prefix code families or merged code families of all child nodes of the parent node;
[0013] Generate a Bloom filter for each leaf node based on the prefix code family corresponding to each leaf node, and generate a Bloom filter for each non-leaf node based on the merged code family corresponding to each non-leaf node, to obtain a hybrid index tree; wherein the Bloom filters of different leaf nodes have the same length, and the Bloom filters of non-leaf nodes at different layers have different lengths;
[0014] Each Bloom filter is symmetrically encrypted to obtain an encrypted hybrid index tree.
[0015] The present invention also provides a privacy-preserving spatiotemporal contact query method, comprising:
[0016] Obtaining a query request including query data; the query data including: query spatial location data and query time data corresponding to the query spatial location data;
[0017] Using a Hilbert curve, encoding the query spatial location data in the query data to obtain query processing data including query encoding data and the query time data;
[0018] Performing prefix encoding on the query coded data to generate a prefix coding family for the query coded data;
[0019] Obtaining, according to the prefix code family, prefix codes corresponding to each layer of the encrypted hybrid index tree, and prefix codes that do not contain wildcards in the prefix codes corresponding to each layer;
[0020] Generate a decryption key for each layer according to a preset security parameter, a prefix code corresponding to each layer, and a prefix code that does not contain a wildcard in the prefix code corresponding to each layer;
[0021] Generate a corresponding Bloom filter according to the decryption key of each layer, and encrypt the generated Bloom filter to obtain a plurality of query Bloom filters corresponding one-to-one to the plurality of layers of the encrypted hybrid index tree;
[0022] The multiple query Bloom filters are used as query tokens, and the query tokens are used to perform data query from the encrypted hybrid index tree to obtain query results.
[0023] The present invention has the following beneficial technical effects:
[0024] In the hybrid index tree generated by the present invention, non-leaf nodes contain data obtained after Hilbert curve processing and prefix coding processing of spatial position data, and leaf nodes contain not only data obtained after Hilbert curve processing and prefix coding processing of spatial position data, but also original time data corresponding to the spatial position data. Moreover, each leaf node or non-leaf node corresponds to a Bloom filter, and each Bloom filter is organized in a tree structure. Therefore, on the one hand, when the data to be checked is spatiotemporal data containing time data and spatial data (for example, containing time and a location corresponding to the time), it is possible to query spatiotemporal data, which is more suitable for flow investigation work; on the other hand, it can meet the query process with sublinear time complexity, and when performing data query, a dynamically pruned search space can be obtained, thereby improving the efficiency of linear data structure search and greatly reducing the time loss of data retrieval.
[0025] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 An optional flowchart of a method for generating an encrypted hybrid index tree provided by an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of an exemplary method of encoding multiple sets of original spatiotemporal data using a Hilbert curve provided in an embodiment of the present invention;
[0028] Figure 3A A schematic diagram of a three-dimensional hybrid index tree generated exemplarily according to an embodiment of the present invention;
[0029] Figure 3B A schematic diagram of a hybrid index tree generated exemplarily according to an embodiment of the present invention;
[0030] Figure 4 An optional flowchart of the privacy-preserving spatiotemporal contact query method provided by an embodiment of the present invention;
[0031] Figure 5 A schematic diagram of an exemplary process of performing data query based on a query token provided by an embodiment of the present invention;
[0032] Figure 6A flowchart of an exemplary method for generating an encrypted hybrid index tree and a privacy-preserving spatiotemporal contact query method provided in an embodiment of the present invention;
[0033] Figure 7 An application scenario diagram of an exemplary privacy-preserving spatiotemporal contact query system provided by an embodiment of the present invention;
[0034] Figure 8A A schematic diagram illustrating how the time required to generate a query token using the method of the present invention varies with the amount of data provided in an exemplary embodiment of the present invention;
[0035] Figure 8B An exemplary query time comparison diagram of using the method of the present invention to query spatiotemporal data and using the PBRQ solution to query spatiotemporal data is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.
[0037] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0038] In the description of this specification, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification.
[0039] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art can understand and implement other variations of the disclosed embodiments by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0040] Figure 1 This is an optional flow chart of a method for generating an encrypted hybrid index tree provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes the following steps:
[0041] S101. Acquire multiple groups of original spatiotemporal data of multiple objects; each group of original spatiotemporal data includes original spatial position data and original time data corresponding to the original spatial position data.
[0042] In the embodiment of the present invention, the multiple objects may be multiple different people. Each set of raw spatiotemporal data may include a time data (e.g., 16:30) and a corresponding location data (e.g., longitude and latitude information or place name information) of a certain object, to indicate when and where the object was.
[0043] S102: Using the Hilbert curve, encode the original spatial position data to obtain multiple groups of spatiotemporal processing data including spatial encoding data and original time data.
[0044] In an embodiment of the present invention, the Hilbert curve is used to encode the original spatial position data in each group of original spatiotemporal data to obtain spatial coding data corresponding to the original spatial position data in each group of original spatiotemporal data. Thus, the spatial coding data corresponding to the original spatial position data in the group of original spatiotemporal data and the original time data in the group of original spatiotemporal data constitute a group of spatiotemporal processing data.
[0045] Here, the Hilbert curve has clustering properties.
[0046] For example, Figure 2 Table 1 is a schematic diagram of encoding multiple sets of original spatiotemporal data O1 to O6 using the Hilbert curve. Table 1 shows multiple sets of spatiotemporal processed data obtained by encoding the original spatial position data in the multiple sets of original spatiotemporal data O1 to O6 using the Hilbert curve.
[0047] Object Hilbert coding Raw time data <![CDATA[O1]]> 9 t1 <![CDATA[O2]]> 11 t2 <![CDATA[O3]]> 34 t3 <![CDATA[O4]]> 35 t4 <![CDATA[O5]]> 52 t5 <![CDATA[O6]]> 55 t6
[0048] Table 1
[0049] As shown in Table 1, multiple groups of original spatiotemporal data O1~O6 are called multiple groups of objects, "9" is the spatially coded data obtained after encoding the original spatial position data in O1, and "t1" is the original time data in O1, that is, "9" and "t1" are a group of spatiotemporal processing data; similarly, "11" is the spatially coded data obtained after encoding the original spatial position data in O2, and "t2" is the original time data in O2, and so on. The same applies to other data.
[0050] S103 , performing prefix coding on the spatially coded data in each group of spatiotemporally processed data to generate a prefix coding family for each group of spatiotemporally processed data.
[0051] In an embodiment of the present invention, when one spatially coded data in any group of spatiotemporal processing data is ω-bit data, one spatially coded data in the any group of spatiotemporal processing data can be prefix coded to generate ω+1 prefix codes, and the ω+1 prefix codes are used as a prefix coding family for one spatially coded data in the any group of spatiotemporal processing data.
[0052] Assume a data item Y = b1b2...b ω , its prefix coding family is a set Y={b1b2...b ω-1 *,...,*...*}, where the i-th prefix in the set is encoded as b1b2...b ω+1-i *...*. For example, the prefix code family of 000111 is ******, 0*****, 00****, 000***, 0001**, 00011*, 000111.
[0053] Here, the prefix encoding matching rule is: given a range [y min ,y max ], query S[y min ,y max ] is the coverage [y min ,y max ] is the minimum set of prefix encodings. For any data item Y and query range [y min ,y max ], if and only if F(Y)∩S[y min ,y max ], Y∈[y min ,y max ].
[0054] S104 , obtaining multiple leaf nodes by taking each group of spatiotemporal processing data and the prefix coding family of each group of spatiotemporal processing data as a leaf node of the hybrid index tree.
[0055] S105. Non-leaf nodes are generated layer by layer from bottom to top by merging different prefix coding families; wherein each non-leaf node corresponds to a merged coding family, each non-leaf node is at least one leaf node or the parent node of at least one non-leaf node, and the merged coding family corresponding to each parent node contains the prefix coding families or merged coding families of all child nodes of the parent node.
[0056] S106. Generate a Bloom filter for each leaf node based on the prefix coding family corresponding to each leaf node, and generate a Bloom filter for each non-leaf node based on the merged coding family corresponding to each non-leaf node, to obtain a hybrid index tree; wherein, the lengths of the Bloom filters of different leaf nodes are the same, and the lengths of the Bloom filters of non-leaf nodes of different layers are different.
[0057] In the embodiment of the present invention, the lengths of the Bloom filters corresponding to the nodes in the same layer are the same, and the lengths of the Bloom filters corresponding to the nodes in different layers are different.
[0058] In an embodiment of the present invention, the prefix code families or merged code families of all nodes on the BH-Tree are correspondingly stored in a Bloom filter. With the help of the Bloom filter, it is easy to determine whether a data range contains all the query target spatial information, that is, to determine whether a single tree node belongs to a certain range.
[0059] In one embodiment, for each leaf node V=(s1, s2, ..., s n )The principle of generating a Bloom filter is as follows:
[0060] 1) The Bloom filter is initialized to a P-bit binary vector B; P is a preset value that can be set according to actual needs, for example, 6 or 8;
[0061] 2) Select t independent hash functions {H i} 1≤i≤t , the value range of each hash function is [1, P], and these t independent hash functions are used to perform hash calculation on each data s∈V to obtain all the indexes of each data {H i (s)} 1≤i≤t ; t is the preset value, which can also be set according to actual needs; s1, s2, ..., s n is the n data in the leaf node;
[0062] 3) For each data, all the indexes of the data are {H i (s)} 1≤i≤t The bit is set to 1.
[0063] For example, Figure 3A This is a three-dimensional schematic diagram of a hybrid index tree (BH-Tree) generated based on the data after Hilbert processing and prefix coding of multiple sets of original spatiotemporal data O1 to O6; Figure 3B This is a schematic diagram of a hybrid index tree (BH-Tree) generated by performing Hilbert processing and prefix coding on multiple sets of original spatiotemporal data O1 to O6. Figure 3B As shown, N0 is the parent node of N1, N2 and N3 (i.e., N1, N2 and N3 are child nodes of N0), N1 is the parent node of N4 (i.e., N4 is the child node of N1), N2 is the parent node of N5 (i.e., N5 is the child node of N2), N3 is the parent node of N6 (i.e., N6 is the child node of N3), N4 is the parent node of O1 and O2 (i.e., O1 and O2 are the child nodes of N4), N5 is the parent node of O3 and O4 (i.e., O3 and O4 are the child nodes of N5), and N6 is the parent node of O5 and O6 (i.e., O5 and O6 are the child nodes of N6). N0 is in the first layer of the BH-Tree, N1, N2 and N3 are in the second layer of the BH-Tree, N4, N5 and N6 are in the third layer of the BH-Tree, O1, O2, O3, O4, O5 and O6 are in the fourth layer of the BH-Tree; and O1, O2, O3, O4, O5 and O6 are 6 different leaf nodes of the BH-Tree respectively, and N0, N1, N2, N3, N4, N5 and N6 are 7 different non-leaf nodes of the BH-Tree respectively.
[0064] S107: Perform symmetrical encryption on each Bloom filter to obtain an encrypted hybrid index tree.
[0065] In an embodiment of the present invention, security parameters may be first obtained, and a first key may be generated based on the security parameters. Thereafter, each Bloom filter may be encrypted using a symmetric key latent vector using the first key to obtain an encrypted hybrid index tree.
[0066] In some embodiments, a security parameter λ may be obtained, a payload message space M = {' True'} may be defined, and the formula A first key msk is calculated, where M represents the message space range, and is used to indicate that data within a range not exceeding M is encrypted using msk.
[0067] In some embodiments, the encryption process may use formula c l =F(msk,"true",x l ||l) and c=({c l} l∈[m] ) implementation, where l represents any Bloom filter, x lRepresents the data stored in any Bloom filter, c l represents any encrypted Bloom filter, c represents the set of encrypted Bloom filters (i.e., encrypted hybrid index tree), i.e., c=(c1,c2,...,c n ); m represents the set of Bloom filters corresponding to all nodes in the hybrid index tree, m=(l1,l2,...,l n ), for example, l1 represents the Bloom filter corresponding to the first node of the first layer, and the same applies to the others; x represents the set of data stored in all Bloom filters, x=(x1,x2,...,x n ), for example, x1 represents the data stored in the Bloom filter corresponding to the first node of the first layer.
[0068] In the hybrid index tree generated by the present invention, non-leaf nodes contain spatial position data that have been processed by the Hilbert curve and prefix coding, while leaf nodes contain not only spatial position data that have been processed by the Hilbert curve and prefix coding, but also the original time information corresponding to the spatial position data. Moreover, each leaf node or non-leaf node corresponds to a Bloom filter, and each Bloom filter is organized in a tree structure. Therefore, on the one hand, when the data to be searched is spatiotemporal information containing time information and spatial information (for example, containing time and a location corresponding to the time), it is possible to query spatiotemporal information, which is more suitable for flow investigation work; on the other hand, it can meet the query process with sublinear time complexity, and when performing data query, it can obtain a dynamically pruned search space, thereby improving the efficiency of linear data structure search and greatly reducing the time loss of data retrieval.
[0069] In some embodiments, the above S105 can be implemented through S1051 to S1056:
[0070] S1051. Merge different prefix coding families corresponding to multiple leaf nodes to obtain a first merged coding family corresponding to each leaf node, and use the first merged coding family as the first parent node of the corresponding leaf node; wherein each leaf node is a child node of the corresponding first parent node.
[0071] S1052: Use the leaf node as the ωth layer of the hybrid index tree, and use the first parent node as the ω-1th layer of the hybrid index tree.
[0072] S1053. Merge the first merged coding families corresponding to the multiple first parent nodes to obtain a second merged coding family corresponding to each first parent node, and use the second merged coding family as the second parent node of the corresponding first parent node; wherein each first parent node is a child node of the corresponding second parent node.
[0073] S1054: Use the second parent node as the ω-2th layer of the hybrid index tree.
[0074] S1055. Merge the second merged coding families corresponding to the multiple second parent nodes to obtain a third merged coding family corresponding to each second parent node, and use the third merged coding family as the third parent node of the corresponding second parent node; wherein each second parent node is a child node of the corresponding third parent node.
[0075] S1056. Use the third parent node as the ω-3th layer of the hybrid index tree until a node of the ω-wth layer of the hybrid index tree is obtained; where w is ω-1.
[0076] For example, when ω is 6, the constructed hybrid index tree has 6 layers.
[0077] In some embodiments, the first combined code family includes: a first original code and a first sub-code; based on this, the above S1051 can be implemented as follows:
[0078] The prefix codes in different prefix code families corresponding to multiple leaf nodes are compared bit by bit to determine at least two first prefix code families with the same first ω-1 bit code value and different ω-th bit code value. When there are at least two first prefix code families, the ω-th bit code value of the prefix codes that do not contain wildcards in the at least two first prefix code families is set as a wildcard to obtain a first original code; the ω-1th bit code value of the first original code is set as a wildcard to obtain a corresponding first sub-code; the ω-2th bit code value of the first original code is set as a wildcard to obtain a corresponding first sub-code, until the ω-wth bit code value of the first original code is set as a wildcard to obtain at least one first sub-code; w is ω-1; the first original code and the at least one first sub-code are used as the first parent node of the leaf nodes corresponding to the at least two first prefix code families.
[0079] Here, the wildcard character is "*", which means "1" or "0".
[0080] Here, when there are not at least two first prefix code families, the prefix codes in different prefix code families corresponding to multiple leaf nodes are compared bit by bit to determine at least two second prefix code families with the same first ω-2 bit code value and different ω-1 bit code value. When there are at least two second prefix code families, the ω-1 and ω-th code values of the prefix codes that do not contain wildcards in the at least two second prefix code families are set to wildcards to obtain a third original code; the code value of the ω-2 bit of the third original code is set to a wildcard to obtain a corresponding third sub-code; the code value of the ω-3 bit of the third original code is set to a wildcard to obtain a corresponding third sub-code, until the code value of the ω-w bit of the third original code is set to a wildcard, and at least one third sub-code is obtained; w is ω-1; the third original code and the at least one third sub-code are used as the first parent node of the leaf nodes corresponding to the at least two second prefix code families.
[0081] For example, as mentioned above Figure 3B As shown, ω is 6. Since there are no two or more prefix code families with the same first 5-bit code value and different sixth-bit code value in the prefix code families of the six leaf nodes O1, O2, O3, O4, O5 and O6, we continue to determine which leaf nodes' prefix code families have prefix codes with the same first 4-bit code value and different fifth-bit code value from the prefix code families of the six leaf nodes O1, O2, O3, O4, O5 and O6, and obtain the prefix codes in the prefix code family between O1 and O2 with the same first 4-bit code value (i.e., "0010") and different fifth-bit code value, the prefix codes in the prefix code family between O3 and O4 with the same first 4-bit code value (i.e., "1000") and different fifth-bit code value, and the prefix codes in the prefix code family between O5 and O6 with the same first 4-bit code value (i.e., "1101") and different fifth-bit code value, thus For O1 and O2, the 5th and 6th code values of "001001" which does not contain a wildcard can be set to the wildcard "*" to obtain "0010**" (the first original code), so that according to "0010**", "001***", "00****", "0*****", and "******" can be obtained in sequence; "0010**, 001***, 00****, 0*****, ******" or N4 is used as the first parent node of O1 and O2. For O3 and O4, as well as O5 and O6, the same principle can be used to obtain the first parent node N5 and the first parent node N6.
[0082] In some embodiments, the second combined code family includes: a second original code and a second sub-code, and when there are at least two first prefix code families, the above S1053 can be implemented in the following manner:
[0083] The codes in different first merged code families are compared bit by bit to determine at least two merged code families with the same first ω-2 code values and different ω-1 code values. When there are at least two merged code families, the code values from the ω-1 to the ω-th code values of the code with the least wildcards in the at least two merged code families are set as wildcards to obtain a second original code; the code value of the ω-2th code of the second original code is set as a wildcard to obtain a corresponding second sub-code; the code value of the ω-3th code of the second original code is set as a wildcard to obtain a corresponding second sub-code, until the code value of the ω-wth code of the second original code is set as a wildcard, thereby obtaining at least one second sub-code; w is ω-1; the second original code and the at least one second sub-code are used as the second parent node of the first parent node corresponding to the at least two merged code families.
[0084] In some embodiments, when there are no at least two first prefix code families and there are at least two second prefix code families, the above S1053 may be implemented in the following manner:
[0085] The codes in different first merged code families are compared bit by bit to determine at least two merged code families with the same first ω-3 code values and different ω-2 code values. When there are at least two merged code families, the code values from the ω-2th to the ω-th bits of the code containing the least wildcards in the at least two merged code families are all set as wildcards to obtain a second original code; the code value of the ω-3th bit of the second original code is set as a wildcard to obtain a corresponding second sub-code; the code value of the ω-4th bit of the second original code is set as a wildcard to obtain a corresponding second sub-code, until the code value of the ω-wth bit of the second original code is set as a wildcard, and at least one second sub-code is obtained; w is ω-1; the second original code and the at least one second sub-code are used as the second parent node of the first parent node corresponding to the at least two merged code families.
[0086] In the embodiment of the present invention, the implementation principle of S1055 is the same as the implementation principle of S1053 described above, and the construction of the hybrid index tree is completed until the first-level node of the hybrid index tree is obtained through the principle described in S1053.
[0087] In the embodiment of the present invention, when constructing a hybrid index tree, the prefix code families of different leaf nodes (the ωth layer of the hybrid index tree) are merged to obtain the first parent node of each leaf node (the ω-1th layer of the hybrid index tree), and the first merged code family corresponding to each first parent node. Then, by merging the first merged code families corresponding to different first parent nodes, the second parent node of each first parent node (the ω-2th layer of the hybrid index tree) and the second merged code family corresponding to each second parent node are obtained. Then, by merging the second merged code families corresponding to different second parent nodes, the third parent node of each second parent node (the ω-2th layer of the hybrid index tree) is obtained. ω-3 layers), and the third merged code family corresponding to each third parent node, until the w-th parent node (the first layer of the hybrid index tree) is obtained, and the w-th merged code family corresponding to the w-th parent node is a prefix code composed of ω wildcards, it ends; wherein, when constructing the nodes of the N-th layer, continue to merge one code value forward on the code corresponding to the node of the N+1 layer to obtain the merged code corresponding to the node of the N-th layer, and when continue to merge one code value forward on the code corresponding to the node of the N+1 layer and the parent node of the N-th layer cannot be obtained, merge two code values forward on the code corresponding to the node of the N+1 layer until the parent node of the N-th layer can be obtained.
[0088] In the hybrid index tree established in the above manner, the range of data corresponding to each node gradually decreases from the first layer to the ωth layer of the hybrid index tree. This is beneficial to reducing the amount of data search during data query, thereby improving data query efficiency.
[0089] The embodiment of the present invention also provides a privacy-protected spatiotemporal contact query method, such as Figure 4 As shown, the method includes:
[0090] S201. Obtain a query request including query data; the query data includes: query spatial location data and query time data corresponding to the query spatial location data.
[0091] S202: Using the Hilbert curve, perform encoding processing on the query spatial location data in the query data to obtain query processing data including query encoding data and query time data.
[0092] S203: Perform prefix coding on the query coded data to generate a prefix coding family of the query coded data.
[0093] S204 . Obtain, according to the prefix code family, prefix codes corresponding to each layer of the encrypted hybrid index tree, and prefix codes that do not contain wildcards in the prefix codes corresponding to each layer.
[0094] In some embodiments, the principle used to generate nodes at each layer of the hybrid index tree can be used to obtain prefix codes corresponding to each layer of the encrypted hybrid index tree; that is, the same principle as S S1051 to S1056 above is used to obtain prefix codes corresponding to each layer of the encrypted hybrid index tree.
[0095] S205 . Generate a decryption key for each layer according to a preset security parameter, a prefix code corresponding to each layer, and a prefix code excluding wildcards in the prefix code corresponding to each layer.
[0096] In some embodiments, security parameters can be obtained, a second key can be generated based on the security parameters, and a sampling value can be generated based on the security parameters; a decryption key for each layer can be generated based on the security parameters, the second key, the sampling value, the prefix code corresponding to each layer, and the prefix code corresponding to each layer that does not contain a wildcard.
[0097] Exemplarily, the security parameter is λ, the second key may be the first key msk, and the decryption key J of any layer may be calculated by the following formula:
[0098]
[0099] d1=Sym.Enc(K,0 λ+logλ );
[0100] J = (d0, d1, S);
[0101] Where J represents the decryption key of any layer, d0 is the first intermediate value of any layer, d1 is the second intermediate value of any layer; K is the sampling value of any layer, and the sampling value of each layer is the same. is the jth prefix code in the prefix code corresponding to the lth level of the hybrid index tree, l j and j∈[|S|] are query code data corresponding to the prefix code that does not contain any wildcards in the prefix code corresponding to the lth level of the hybrid index tree, and when there is no prefix code that does not contain any wildcards in the prefix code corresponding to the lth level of the hybrid index tree, j and j∈[|S|] is 0; F0(.) represents the prefix encoding function, Represents an OR operation; S represents the set of query encoding data corresponding to the prefix encoding corresponding to all layers of the hybrid index tree that does not contain the wildcard "*"; Sym.Enc represents the encryption process of the IND-CPA secure symmetric encryption scheme.
[0102] S206 . Generate a corresponding Bloom filter according to the decryption key of each layer, and encrypt the generated Bloom filter to obtain multiple query Bloom filters corresponding one-to-one to multiple layers of the encrypted hybrid index tree.
[0103] S207: Use multiple query Bloom filters as query tokens, and use the query tokens to perform data query from the encrypted hybrid index tree to obtain query results.
[0104] In the embodiment of the present invention, each query Bloom filter obtained can be placed in T Q Thus, we get the query token T Q .
[0105] In some embodiments, the encrypted hybrid index tree includes an ω layer, each layer includes at least one node, and each node corresponds to an encrypted Bloom filter; the query token includes: ω query Bloom filters corresponding one-to-one to the ω layer; ω is an integer greater than 1; based on this, the above-mentioned S207 uses the query token to query data from the encrypted hybrid index tree to obtain the query result, which can be implemented through S1 to S4:
[0106] S1. Use the jth query Bloom filter corresponding to the jth layer to perform decryption calculations on the encrypted Bloom filters corresponding to each node in the jth layer to obtain a first decryption result corresponding to each node; j is 1.
[0107] S2. When the first decryption result corresponding to the i-th node in the j-th layer indicates that the decryption is successful and the i-th node has a first child node, the j+1-th query Bloom filter corresponding to the j+1-th layer is used to perform decryption calculation on the encrypted Bloom filter corresponding to the first child node to obtain a second decryption result.
[0108] Exemplarily, the process of using the j-th query Bloom filter corresponding to the j-th layer to perform decryption calculation on the encrypted Bloom filter corresponding to each node N in the j-th layer is as follows:
[0109]
[0110] μ'=Sym.Dec(K',d1);
[0111] Where d0 and d1 are the first and second intermediate values in the j-th query Bloom filter; K' is the intermediate decrypted value, c jNrepresents the Bloom filter corresponding to the Nth node of the jth layer in the encrypted hybrid index tree; N∈[|S|] represents the spatially encoded data corresponding to the prefix encoding that does not contain wildcards in the Bloom filter corresponding to the Nth node of the jth layer; μ' represents the first decryption result obtained; Sym.Dec represents the decryption process of the IND-CPA secure symmetric decryption scheme.
[0112] For example, when μ'=0 λ+logλ When , the first decryption result indicates that the decryption is successful.
[0113] S3. When it is determined that the second decryption result corresponding to the first child node indicates that the decryption is successful and the first child node has a child node, the j+2th query Bloom filter corresponding to the j+2th layer is used to perform decryption calculations on the encrypted Bloom filter corresponding to the child node of the first child node, until the obtained decryption result indicates that the decryption is successful and the target node corresponding to the decryption result indicating that the decryption is successful has no child node, then the query time data corresponding to the ωth query Bloom filter is used to match and compare with the original time data corresponding to the target node.
[0114] S4. When there is data in the original time data corresponding to the target node that successfully matches the query time data, the data that successfully matches the query time data is used as the query result.
[0115] In an embodiment of the present invention, when the decryption result corresponding to a node is represented successfully, the node is added to the search path, and the decryption calculation of the node's child nodes is continued. When the decryption result corresponding to a node fails, no processing is performed (i.e., pruning); for the leaf node that has been added to the search path, the query time data in the query token can be used to match the original time data in the leaf node. If the match is successful, it is added to the result queue, otherwise it is not processed, and the result queue is the final return result.
[0116] For example, Figure 5Schematic diagram of the process of data query based on query token. After the spatial location data in the query data is encoded using the Hilbert curve, the query encoding data obtained are [32,33] and [52,57], and the query time data in the query data is t5; the four query encoding data 32, 33, 52 and 57 are prefix encoded respectively to generate a prefix encoding family for each query encoding data, and the prefix encoding corresponding to the first layer of the encrypted hybrid index tree obtained according to the prefix encoding family is "******", the prefix encoding corresponding to the second layer of the encrypted hybrid index tree is "1*****", the prefix encoding corresponding to the third layer of the encrypted hybrid index tree is "1101**, 1110**, 1000**", and the prefix encoding corresponding to the fourth layer of the encrypted hybrid index tree is "1101**, 11100*, 10000*"; then, the prefix encoding corresponding to each layer is used to generate the decryption key J for each layer; then, as shown in Figure 5 As shown, the first-layer decryption key J is used to decrypt the node N0 (i.e., the prefix code "******" is matched in the Bloom filter corresponding to N1). When the decryption is successful, the second-layer decryption key J is used to decrypt the nodes N1, N2, and N3 in turn, and the nodes are pruned when the decryption of N1 fails. When the decryption of N2 and N3 is successful (i.e., the prefix code "1*****" is matched in the Bloom filters corresponding to N2 and N3), the third-layer decryption key J is used to decrypt N5 and N6 respectively, and the nodes are pruned when the decryption of N5 fails. When N6 is decrypted successfully (i.e., the prefix code "1101**" is matched in the Bloom filter corresponding to N6), the query time data t5 is matched with the original time data t5 in the leaf node O5, and with the original time data t6 in O6, respectively, so as to determine that the original time data t5 in the leaf node O5 matches the query time data t5, so that the original time data t5 and the original spatial position data corresponding to the "1101**" corresponding to the original time data t5 in the Bloom filter of the leaf node O5 can be used as the query results.
[0117] Figure 6 The flowchart of the method for generating an encrypted hybrid index tree and the privacy-preserving spatiotemporal contact query method provided by the embodiment of the present invention is shown in FIG. Figure 6As shown, a BH-tree is established for personal spatiotemporal information, and a variable-length key is generated based on the BH-tree to obtain a key set. The BH-tree is then encrypted using the key set to obtain an encrypted database (encrypted BH-tree). When querying spatiotemporal data from the encrypted database, a tracing key (Token, i.e., query token) is first generated based on the spatiotemporal tracing request (query request), and the tracing key is used to perform a query, and an encrypted query result is obtained, thereby obtaining a tracing result.
[0118] Figure 7 An application scenario diagram of the privacy-protected spatiotemporal contact query system provided by an embodiment of the present invention. Figure 7 As shown, relevant units (for example, epidemic prevention units) collect citizens' travel data through legal channels, extract key travel data, and encrypt the travel data to obtain personal spatiotemporal data, and upload the personal spatiotemporal data to the cloud platform for storage. The cloud platform uses a method of generating an encrypted hybrid index tree to securely store personal spatiotemporal data to provide ciphertext data for privacy-protected spatiotemporal contact queries; when a case occurs in a certain area and the relevant agency needs to query the relevant contact population, the relevant agency sends a query request to the cloud platform, and the cloud platform uses the above-mentioned privacy-protected spatiotemporal contact query method to query the spatiotemporal data, and queries the relevant encrypted data, and returns the relevant encrypted data to the relevant agency. The relevant agency uses the shared key between the relevant agency and the relevant unit to decrypt the obtained encrypted data to obtain the plaintext data required for the query.
[0119] In order to further illustrate the technical effects of the present invention, the following is an illustration of a comparison diagram obtained through simulation.
[0120] Figure 8A Schematic diagram showing how the time required to generate a query token using the method of the present invention varies with the amount of data; Figure 8A It can be seen that the time it takes for the present invention to generate a query token is in the order of milliseconds among tens of thousands of data. Figure 8B This is a comparison chart of query time when using the method of the present invention to query spatiotemporal data and when using the PBRQ solution to query spatiotemporal data. Figure 8B As can be seen, the query time of this method is significantly different from that of PBRQ. For queries with a scale of 10,000, the query time is much shorter than that of PBRQ. Furthermore, it scales sublinearly over time, demonstrating a significant response time advantage. Specifically, for a dataset with 150,000 items, query token generation takes only 291.3ms, and data querying takes only 38.22ms. This demonstrates high efficiency and is suitable for widespread use in real-world scenarios.
[0121] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.
Claims
1. A method for generating an encrypted hybrid index tree, characterized in that: include: Obtain multiple sets of original spatiotemporal data of multiple objects; Each set of original spatiotemporal data includes original spatial position data and original time data corresponding to the original spatial position data; Using a Hilbert curve, the original spatial position data is encoded to obtain multiple groups of spatiotemporal processing data including spatial encoding data and the original time data; Performing prefix coding on the spatially coded data in each set of spatiotemporally processed data to generate a prefix coding family for each set of spatiotemporally processed data; By taking each group of spatiotemporal processing data and the prefix coding family of each group of spatiotemporal processing data as a leaf node of a hybrid index tree, a plurality of leaf nodes are obtained; By merging different prefix code families, non-leaf nodes are generated layer by layer from bottom to top; each non-leaf node corresponds to a merged code family, each non-leaf node is at least one leaf node or at least one parent node of a non-leaf node, and the merged code family corresponding to each parent node contains the prefix code families or merged code families of all child nodes of the parent node; Generate a Bloom filter for each leaf node based on the prefix code family corresponding to each leaf node, and generate a Bloom filter for each non-leaf node based on the merged code family corresponding to each non-leaf node, to obtain a hybrid index tree; wherein the Bloom filters of different leaf nodes have the same length, and the Bloom filters of non-leaf nodes at different layers have different lengths; Each Bloom filter is symmetrically encrypted to obtain an encrypted hybrid index tree.
2. The method for generating an encrypted hybrid index tree according to claim 1, wherein: The combined coding family includes: a first combined coding family, a second combined coding family and a third combined coding family; each prefix code includes The code value of the bit; the non-leaf nodes are generated layer by layer from bottom to top by merging different prefix coding families, including: Merging different prefix code families corresponding to the multiple leaf nodes to obtain the first merged code family corresponding to each leaf node, and using the first merged code family as the first parent node of the corresponding leaf node; wherein each leaf node is a child node of the corresponding first parent node; The leaf node is used as the first Layer, the first parent node is used as the first -1st floor; Merging first merged code families corresponding to multiple first parent nodes to obtain the second merged code family corresponding to each first parent node, and using the second merged code family as the second parent node of the corresponding first parent node; wherein each first parent node is a child node of the corresponding second parent node; The second parent node is used as the first parent node of the hybrid index tree. -2nd floor; Merging the second merged code families corresponding to the plurality of second parent nodes to obtain the third merged code family corresponding to each second parent node, and using the third merged code family as the third parent node of the corresponding second parent node; wherein each second parent node is a child node of the corresponding third parent node; The third parent node is used as the first parent node of the hybrid index tree. -3 layers, until the hybrid index tree is obtained. -w layer nodes; where w is -1.
3. The method for generating an encrypted hybrid index tree according to claim 2, wherein: The first combined code family includes: a first original code and a first sub-code; The step of merging different prefix code families corresponding to the multiple leaf nodes to obtain the first merged code family corresponding to each leaf node, and using the first merged code family as the first parent node of the corresponding leaf node includes: Compare the prefix codes in different prefix code families corresponding to the multiple leaf nodes bit by bit to determine the prefix -1 bit code value is the same, and the At least two first prefix code families with different bits, when there are at least two first prefix code families, the first prefix code that does not contain a wildcard in the at least two first prefix code families The bit code value is set to a wildcard to obtain the first original code; The first original code The code value of -1 is set as a wildcard, and the first sub-code is obtained. The code value of the -2 bit is set as a wildcard, and the first sub-code is obtained correspondingly, until the first original code is When the code value of the -w position is set to a wildcard, at least one first subcode is obtained; w is -1; The first original code and the at least one first sub-code are used as the first parent nodes of the leaf nodes corresponding to the at least two first prefix code families.
4. The method for generating an encrypted hybrid index tree according to claim 3, wherein: The method further comprises: When the at least two first prefix code families do not exist, the prefix codes in the different prefix code families corresponding to the multiple leaf nodes are compared bit by bit to determine the prefix code. -2 digits with the same code value, and - At least two second prefix code families with different 1-bit code values, when there are at least two second prefix code families, the prefix code that does not contain a wildcard in the at least two second prefix code families -1st and The bit code values are all set to wildcards to obtain the third original code; The third original code The code value of -2 is set as a wildcard, and the corresponding third sub-code is obtained. The code value of the -3 bit is set as a wildcard, and the corresponding third sub-code is obtained until the first When the code value of the -w position is set to a wildcard, at least one third subcode is obtained; w is -1; The third original code and the at least one third sub-code are used as the first parent node of the leaf nodes corresponding to the at least two second prefix code families.
5. The method for generating an encrypted hybrid index tree according to claim 3, wherein: The second combined code family includes: a second original code and a second sub-code; When there are at least two first prefix code families, the step of merging first merged code families corresponding to multiple first parent nodes to obtain the second merged code family corresponding to each first parent node, and using the second merged code family as the second parent node of the corresponding first parent node includes: Compare the codes in different first combined code families bit by bit to determine the previous -2 digits have the same code value and -1 At least two merged code families with different code values, when there are at least two merged code families, the code containing the least wildcards in the at least two merged code families -1st to The bit code values are all set to wildcards to obtain the second original code; The second original code The code value of -2 is set as a wildcard, and the corresponding second sub-code is obtained. The code value of the -3 bit is set as a wildcard, and the second sub-code is obtained correspondingly, until the second original code is When the code value of the -w position is set to a wildcard, at least one second sub-code is obtained; w is -1; The second original code and the at least one second sub-code are used as the second parent node of the first parent node corresponding to the at least two merged code families.
6. The method for generating an encrypted hybrid index tree according to claim 1, wherein: A spatially encoded data in any set of spatiotemporal processing data is When the spatially coded data in each group of spatiotemporal processed data is prefix coded, generating a prefix coding family for each group of spatiotemporal processed data, comprises: Perform prefix encoding on one spatially coded data in any set of spatiotemporal processing data to generate prefix codes; The A prefix code is used as a prefix code family of a spatially coded data in any group of spatiotemporal processed data.
7. The method for generating an encrypted hybrid index tree according to claim 1, wherein: The step of symmetric encryption of each Bloom filter to obtain an encrypted hybrid index tree includes: Get security parameters; generating a first key according to the security parameter; Each Bloom filter is symmetrically encrypted using the first key to obtain the encrypted hybrid index tree.
8. A privacy-preserving spatiotemporal contact query method, characterized in that: include: Get the query request containing the query data; The query data includes: query spatial location data, and query time data corresponding to the query spatial location data; Using a Hilbert curve, encoding the query spatial location data in the query data to obtain query processing data including query encoding data and the query time data; Performing prefix encoding on the query coded data to generate a prefix coding family for the query coded data; Obtaining, based on the prefix code family, prefix codes corresponding to each layer of the encrypted hybrid index tree, and prefix codes that do not contain wildcards in the prefix codes corresponding to each layer; wherein the encrypted hybrid index tree is generated using the method of any one of claims 1 to 7 above; Generate a decryption key for each layer according to a preset security parameter, a prefix code corresponding to each layer, and a prefix code that does not contain a wildcard in the prefix code corresponding to each layer; Generate a corresponding Bloom filter according to the decryption key of each layer, and encrypt the generated Bloom filter to obtain a plurality of query Bloom filters corresponding one-to-one to the plurality of layers of the encrypted hybrid index tree; The multiple query Bloom filters are used as query tokens, and the query tokens are used to perform data query from the encrypted hybrid index tree to obtain query results.
9. The privacy-preserving spatiotemporal contact query method according to claim 8, characterized in that: The encrypted hybrid index tree consists of a parent node and a child node, and the encrypted hybrid index tree includes Layers, each layer includes at least one node, and each node corresponds to an encrypted Bloom filter; The query token includes: Layer one-to-one correspondence query Bloom filter; is an integer greater than 1; The query token is used to query data from the encrypted hybrid index tree to obtain a query result, including: Using the j-th query Bloom filter corresponding to the j-th layer, perform decryption calculations on the encrypted Bloom filters corresponding to each node in the j-th layer to obtain a first decryption result corresponding to each node; j is 1; When the first decryption result corresponding to the i-th node in the j-th layer indicates successful decryption and the i-th node has a first child node, using the j+1-th query Bloom filter corresponding to the j+1-th layer to perform a decryption calculation on the encrypted Bloom filter corresponding to the first child node to obtain a second decryption result; When it is determined that the second decryption result corresponding to the first child node indicates that the decryption is successful, and the first child node has a child node, the j+2th query Bloom filter corresponding to the j+2th layer is used to perform decryption calculations on the encrypted Bloom filter corresponding to the child node of the first child node, until the obtained decryption result indicates that the decryption is successful, and the target node corresponding to the decryption result indicating that the decryption is successful has no child node, the j+2th query Bloom filter corresponding to the j+2th layer is used. Match and compare the query time data corresponding to the query Bloom filter with the original time data corresponding to the target node; When there is data that successfully matches the query time data in the original time data corresponding to the target node, the data that successfully matches the query time data is used as the query result.
10. The privacy-preserving spatiotemporal contact query method according to claim 8, characterized in that: The generating of the decryption key for each layer according to the preset security parameter, the prefix code corresponding to each layer, and the prefix code not containing a wildcard in the prefix code corresponding to each layer includes: Get security parameters; generating a second key according to the security parameter; generating a sampling value according to the security parameter; A decryption key for each layer is generated according to the security parameter, the second key, the sample value, the prefix code corresponding to each layer, and the prefix code that does not contain a wildcard in the prefix code corresponding to each layer.
Citation Information
Patent Citations
Space text query method and device
CN113158087A
Efficient, flexible and verifiable multi-attribute range retrieval method and system in cloud environment
CN114416720A