A PM# tree-based encrypted database approximate nearest neighbor join optimization method
By optimizing the approximate nearest neighbor connection method for encrypted databases using PM# trees, and utilizing hash projection and locality-sensitive hash functions to reduce the dimensionality of high-dimensional datasets, a PM# tree index is constructed and the index file is protected in a trusted execution environment. This solves the problems of low efficiency and insecurity in high-dimensional data retrieval, and achieves efficient and secure approximate nearest neighbor connections.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2023-07-11
- Publication Date
- 2026-07-03
Smart Images

Figure CN116702179B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of approximate nearest neighbor connection optimization technology for encrypted databases, and in particular to an approximate nearest neighbor connection optimization method for encrypted databases based on PM# trees. Background Technology
[0002] With the rapid development of internet and communication technologies, the scale of data is growing at an unprecedented rate, and the forms in which data exists are constantly changing. In recent years, multimedia data such as digital images and videos have exploded. This data is often represented as high-dimensional data. Due to concerns about data security, high-dimensional data involving user privacy is often stored in encrypted form. How to efficiently process and analyze encrypted high-dimensional data has become a challenge in the research field.
[0003] The nearest neighbor join, first proposed by Boehm and Krebs, completes the nearest neighbor query for a set of data in a single computation. Research on nearest neighbor joins was inspired by the fact that calculating the nearest neighbors of all query points at once significantly improves retrieval efficiency compared to calculating a single nearest neighbor. The introduction of nearest neighbor joins has helped improve the performance of many applications and algorithms, such as k-means clustering, outlier detection, and missing value computation. Nearest neighbor join methods can be mainly divided into three categories: I / O-based methods, main memory-based methods, and parallel distributed methods. Existing optimization schemes for approximate nearest neighbor joins in high-dimensional data mainly focus on traditional plaintext database scenarios. However, as more and more applications and systems begin to use high-dimensional data, secure retrieval of high-dimensional data has gradually become a problem that urgently needs to be solved. Summary of the Invention
[0004] This invention provides an optimization method for approximate nearest neighbor connections in encrypted databases based on PM# trees, which solves the problems of low retrieval efficiency and insecure retrieval process in existing technologies. It achieves encryption of high-dimensional datasets while reducing computational load, thereby accelerating retrieval speed and improving retrieval quality.
[0005] This invention provides an approximate nearest neighbor connection optimization method for encrypted databases based on PM# trees, the method comprising:
[0006] Hash projection is used to project a high-dimensional dataset into a low-dimensional space to obtain a low-dimensional dataset; wherein the number of features of each data point in the low-dimensional dataset is less than the number of features of each data point in the high-dimensional dataset.
[0007] The high-dimensional dataset is encrypted to obtain an encrypted high-dimensional dataset;
[0008] Redundant nodes generated during node splitting in the PM tree are deleted to obtain the PM# tree. The PM# tree is then used to create an index for the high-dimensional dataset, resulting in an index file.
[0009] The index file is encrypted to obtain an encrypted index;
[0010] Based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset, an approximate nearest neighbor join query is performed on the high-dimensional dataset to obtain the query result; wherein, during the query, the encrypted index is loaded into a trusted execution environment.
[0011] In one possible implementation, the step of using hash projection to project a high-dimensional dataset into a low-dimensional space to obtain a low-dimensional dataset specifically includes:
[0012] Multiple locality-sensitive hash functions are initialized, and multiple normal random values are generated using a standard normal distribution; wherein, the multiple locality-sensitive hash functions correspond one-to-one with the multiple normal random values;
[0013] Based on the plurality of locality-sensitive hash functions and the plurality of normal random values, a plurality of stable locality-sensitive hash functions are obtained;
[0014] The high-dimensional dataset is calculated based on the multiple stable local hash sensitivity functions to obtain the coordinates of the projected data points corresponding to each data point in the high-dimensional dataset;
[0015] Based on the coordinates of the projected data points, the position of each data point in the high-dimensional dataset in the low-dimensional space is determined, thereby obtaining the low-dimensional dataset.
[0016] In one possible implementation, both the high-dimensional dataset and the index file are encrypted using the AES algorithm.
[0017] In one possible implementation, the step of using the PM# tree to index the high-dimensional dataset to obtain an index file includes:
[0018] Determine the number N of pivot points in the index file;
[0019] K sets of preset pivot points are randomly selected from the high-dimensional dataset, wherein each set of preset pivot points includes N nodes;
[0020] Calculate the multiple Euclidean distances between any two nodes in the K sets of preset pivot points, and sum the multiple Euclidean distances to obtain the K Euclidean distances of the K sets of preset pivot points;
[0021] Obtain the maximum value among the K Euclidean distances, and obtain the preset pivot point set corresponding to the maximum value. Use the preset pivot point set corresponding to the maximum value as the pivot point set in the index file.
[0022] The nodes in the pivot set of the index file are used as the non-leaf nodes of the index file;
[0023] The index file is constructed using non-leaf nodes and leaf nodes.
[0024] In one possible implementation, encrypting the index file to obtain an encrypted index includes:
[0025] The encrypted index is obtained in the untrusted execution environment, and the encrypted index is decrypted in the trusted execution environment to obtain the index file in the trusted execution environment. The untrusted execution environment is in the public memory, and the trusted execution environments are all in the private memory.
[0026] The index file in the trusted execution environment is processed by nodes, and then the processed index file is encrypted using the AES algorithm to obtain the encrypted index file in the trusted execution environment.
[0027] The encrypted index file in the trusted execution environment is written to the private memory to obtain the encrypted index.
[0028] In one possible implementation, the step of performing an approximate nearest neighbor join query on the high-dimensional dataset based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset includes:
[0029] The encrypted index is loaded into a trusted execution environment, the key in the trusted execution environment is obtained, and the non-leaf nodes in the encrypted index are decrypted according to the key to obtain the index file in the trusted execution environment;
[0030] For each data point in the dataset to be queried, obtain the M nearest neighbors in the low-dimensional dataset, and merge the M nearest neighbors to obtain the merged result;
[0031] Based on the merged result, the index in the trusted execution environment is queried to obtain encrypted high-dimensional data, and the encrypted high-dimensional data is decrypted according to the key to obtain the query result.
[0032] In one possible implementation, obtaining the M nearest neighbors of each data point in the low-dimensional data within the dataset to be queried specifically includes:
[0033] The spherical cover query method is used to query the low-dimensional data in the low-dimensional dataset to obtain multiple query points;
[0034] Determine whether the plurality of query points are projected into the high-dimensional dataset with a constant probability;
[0035] If so, then the M nearest neighbor data points are obtained using the multiple query points;
[0036] If not, the query parameters of the spherical cover query method are changed and the query continues until the multiple query points are projected onto the high-dimensional dataset with a constant probability, and the corresponding M nearest neighbor data are obtained using the multiple query points.
[0037] In one possible implementation, after obtaining the query results, the following is also included:
[0038] The high-dimensional dataset is modified to preserve the relationship between the low-dimensional dataset and the encrypted index.
[0039] In one possible implementation, the high-dimensional dataset corresponds one-to-one with the low-dimensional dataset.
[0040] One or more technical solutions provided in this invention have at least the following technical effects or advantages:
[0041] This invention employs an approximate nearest neighbor connection optimization method for encrypted databases based on PM# trees. This method includes: projecting a high-dimensional dataset into a low-dimensional space using hash projection to obtain a low-dimensional dataset; wherein the number of features for each data point in the low-dimensional dataset is less than the number of features for each data point in the high-dimensional dataset; using a locality-sensitive hash function to preserve distance characteristics and reduce the overall computational load; encrypting the high-dimensional dataset to obtain an encrypted high-dimensional dataset; encrypting the high-dimensional data to protect its data security; deleting redundant nodes generated during node splitting in the PM# tree to obtain a PM# tree, and using the PM# tree to index the high-dimensional dataset to obtain an index file; and deleting redundant nodes during node splitting... This approach overcomes the drawback of storing the same data multiple times in PM trees, reducing storage overhead and improving retrieval and routing efficiency. It encrypts the index file to obtain an encrypted index, ensuring runtime data security. Based on the encrypted index, low-dimensional dataset, and encrypted high-dimensional dataset, it performs an approximate nearest neighbor join query on the high-dimensional dataset to obtain the query results. During the query, the encrypted index is loaded into a trusted execution environment. Approximate nearest neighbor joins are performed in the low-dimensional space to improve retrieval efficiency. This effectively solves the problems of low retrieval efficiency and insecurity, thereby achieving encryption of the high-dimensional dataset while reducing computational load, accelerating retrieval speed, and improving retrieval quality. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 A flowchart illustrating the steps of the approximate nearest neighbor connection optimization method for encrypted databases based on PM# trees provided in this embodiment of the invention.
[0044] Figure 2A This is a time graph of index construction on different datasets provided in the embodiments of the present invention;
[0045] Figure 2B This is a time graph of retrieval on different datasets provided in an embodiment of the present invention;
[0046] Figure 3A This is a diagram illustrating the impact of the size of k on query time in an Audio dataset, provided as an embodiment of the present invention.
[0047] Figure 3B This is a diagram illustrating the impact of the size of k on query time in the DEEP dataset, provided as an embodiment of the present invention.
[0048] Figure 4A The diagram showing the effect of the size of k on the recall rate in the Audio dataset provided in this embodiment of the invention;
[0049] Figure 4B The diagram showing the effect of the size of k on the recall rate in the DEEP dataset provided in this embodiment of the invention;
[0050] Figure 5A A graph showing the effect of the size of k on the overall ratio in the Audio dataset provided in this embodiment of the invention;
[0051] Figure 5B A graph showing the effect of the size of k on the overall ratio in the DEEP dataset provided in this embodiment of the invention;
[0052] Figure 6A A comparison diagram of the storage space of the PM tree and PM# tree index structures in the Audio dataset provided in this embodiment of the invention;
[0053] Figure 6B This is a comparison diagram of the storage space of the PM tree and PM# tree index structures in the DEEP dataset provided in this embodiment of the invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0055] This invention provides an approximate nearest neighbor connection optimization method for encrypted databases based on PM# trees, such as... Figure 1 As shown, the method includes the following steps S101 to S105.
[0056] S101, using hash projection, the high-dimensional dataset is projected into a low-dimensional space to obtain a low-dimensional dataset; wherein the number of features for each data point in the low-dimensional dataset is less than the number of features for each data point in the high-dimensional dataset. There is a one-to-one correspondence between the high-dimensional and low-dimensional datasets.
[0057] In step S101, hash projection is used to project the high-dimensional dataset into a low-dimensional space to obtain a low-dimensional dataset, specifically including:
[0058] (1) Initialize multiple locality-sensitive hash functions and generate multiple normal random values using a standard normal distribution; wherein, each locality-sensitive hash function corresponds one-to-one with a normal random value.
[0059] (2) Based on multiple local sensitive hash functions and multiple normal random values, multiple stable local hash sensitive functions are obtained.
[0060] (3) Calculate the coordinates of the projected data points corresponding to each data point in the high-dimensional dataset by using multiple stable local hash sensitivity functions.
[0061] (4) Based on the coordinates of the projected data points, determine the position of each data point in the high-dimensional dataset in the low-dimensional space, and then obtain the low-dimensional dataset.
[0062] In a specific embodiment of the present invention, the high-dimensional dataset has a dimension of d. Mapping the high-dimensional dataset to an m-dimensional space requires initializing m locality-sensitive hash functions, generating a d-dimensional vector for each locality-sensitive hash function. a i This is a random value from a standard normal distribution. For each data point in the high-dimensional dataset, its hash value is calculated using m locality-sensitive hash functions, generating m hash values as its low-dimensional coordinates. Multiple low-dimensional coordinates are generated for multiple data points in the high-dimensional dataset. Hash projection is used to modify the high-dimensional dataset into a low-dimensional dataset, reducing the data dimensionality and computational cost.
[0063] S102, encrypt the high-dimensional dataset to obtain an encrypted high-dimensional dataset.
[0064] The high-dimensional dataset is divided into multiple groups of plaintext to be encrypted, each group consisting of 128 bits. A key is used to encrypt each plaintext group separately, resulting in multiple ciphertext groups. The encryption operations specifically include byte substitution, row shifting, column obfuscation, and round key addition. These ciphertext groups are then concatenated to obtain the encrypted high-dimensional dataset and the encrypted index. This method effectively prevents hackers from altering the data, maximizing the protection against data tampering and providing enhanced security for mobile data, preventing increased leakage risks due to changes in location.
[0065] S103, redundant nodes generated during node splitting in the PM tree are deleted to obtain the PM# tree. The PM# tree is then used to index the high-dimensional dataset, resulting in an index file. After dimensionality reduction of the high-dimensional dataset, to further improve its retrieval efficiency, this invention employs an optimized central measure tree (PM#-tree), denoted as PM# tree, as the index structure in the projection space. Simultaneously, to protect the data security of the index structure and prevent attackers from stealing distance features of low-dimensional data through memory snapshot attacks, the scheme in this section encrypts and stores the PM# tree index file. Furthermore, during the construction and retrieval of the PM# tree, the encrypted index structure is loaded into the SGX Enclave for processing, ensuring runtime data security.
[0066] PM trees are an extension of M trees, introducing a global pivot point to optimize routing and pruning strategies, thereby improving retrieval efficiency. They are a data structure used for retrieving high-dimensional data points. PM# trees, based on PM trees, overcome the limitation of PM trees in storing the same data multiple times by removing redundant nodes during node splitting, reducing storage overhead and improving retrieval and routing efficiency. PM# trees make certain modifications to the construction and retrieval algorithms of PM trees, but their data structure is the same as that of PM trees.
[0067] In step S103, an index is built on the high-dimensional dataset using a PM# tree to obtain an index file, including:
[0068] (1) Determine the number of pivot points N in the index file.
[0069] (2) Randomly select K sets of preset pivot points from the high-dimensional dataset, where each set of preset pivot points includes N nodes.
[0070] (3) Calculate the multiple Euclidean distances between any two nodes in the K sets of preset pivot points, and sum the multiple Euclidean distances to obtain the K Euclidean distances of the K sets of preset pivot points.
[0071] (4) Obtain the maximum value among the K Euclidean distances, and obtain the preset pivot point set corresponding to the maximum value. Use the preset pivot point set corresponding to the maximum value as the pivot point set in the index file.
[0072] (5) Use the nodes in the pivot set of the index file as non-leaf nodes of the index file.
[0073] (6) Use non-leaf nodes and leaf nodes to build an index file.
[0074] S104, encrypt the index file to obtain an encrypted index, specifically including:
[0075] (1) Obtain the encrypted index in the untrusted execution environment, and decrypt the encrypted index in the trusted execution environment to obtain the index file in the trusted execution environment. The untrusted execution environment is in public memory, and the trusted execution environments are all in private memory.
[0076] (2) Perform node processing on the index file in the trusted execution environment, and then use the AES algorithm to encrypt the processed index file to obtain the encrypted index file in the trusted execution environment.
[0077] (3) Write the encrypted index file in the trusted execution environment to private memory to obtain the encrypted index.
[0078] Both the high-dimensional dataset and the index file are encrypted using the AES algorithm. SGX allows applications to allocate a protected region within their own memory, creating a secure container (Enclave) within it to house the code and sensitive data requiring protection. SGX provides an isolated runtime environment for the data and code within the Enclave, protecting them from attacks by malware with special privileges or malicious system administrators, thus ensuring data security during runtime.
[0079] SGX performs integrity verification on applications before execution. After loading the application code and data into the Enclave, the processor calculates a digest of all content in the Enclave and compares it with the digest provided by the developer. Application deployment is only completed if the two match. In Intel architectures supporting SGX, the system pre-configures a set of registers via the BIOS to allocate a segment of encrypted memory (PRM) for SGX use. The PRM consists of the Enclave Page Cache (EPC) and dedicated hardware memory. The EPC stores SGX metadata and all Enclave pages. EPC allocation and deallocation are managed by the operating system. However, because the operating system is untrusted, SGX has designed separate instructions for EPC allocation and deallocation. When the operating system performs EPC allocation and deallocation, the CPU performs security checks, rejecting allocation instructions that might compromise SGX security. Data in the CPU buffer is encrypted by the memory encryption unit before being written to the EPC; the operating system cannot see the plaintext data.
[0080] S105: Based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset, perform an approximate nearest neighbor join query on the high-dimensional dataset to obtain the query result; wherein, the encrypted index is loaded into the trusted execution environment during the query.
[0081] In step S105, based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset, an approximate nearest neighbor join query is performed on the high-dimensional dataset, including:
[0082] (1) Load the encrypted index into the trusted execution environment, obtain the key in the trusted execution environment, and decrypt the non-leaf nodes in the encrypted index according to the key to obtain the index file in the trusted execution environment.
[0083] (2) Obtain the M nearest neighbors of each data in the dataset to be queried in the low-dimensional dataset, merge the M nearest neighbors, and obtain the merged result.
[0084] Specifically, obtaining the M nearest neighbors of each data point in the low-dimensional data for each data point in the dataset to be queried includes:
[0085] (2.1) Use the spherical cover query method to query the low-dimensional data in the low-dimensional dataset to obtain multiple query points.
[0086] (2.2) Determine whether multiple query points are projected into the high-dimensional dataset with constant probability.
[0087] (2.3) If so, then use multiple query points to obtain the corresponding M nearest neighbor data.
[0088] (2.4) If not, change the query parameters of the spherical cover query method and continue the query until multiple query points are projected onto the high-dimensional dataset with constant probability, and use the multiple query points to obtain the corresponding M nearest neighbor data.
[0089] In a specific embodiment of the present invention, a nearest neighbor data query is completed by initiating a set of spherical queries. Let the dataset to be retrieved be R, the size be n, the query point be q, and the projection of the query point be q'. By setting a reasonable parameter β and t, a spherical cover query is performed in the PM# tree in the low-dimensional space to retrieve at least βn+1 points, which can guarantee that the points of B(q,r) are projected into B(q,tr) with a constant probability.
[0090] Since the distance between a query point in a high-dimensional dataset and its precise k-nearest neighbor cannot be predicted in advance, a sufficiently large candidate set must be set to find points that meet the conditions in the low-dimensional space. Analysis shows that retrieving at least βn+k points in the PM# tree guarantees a nearest neighbor query with a constant probability.
[0091] (3) Based on the merged result, query the index in the trusted execution environment to obtain encrypted high-dimensional data, and decrypt the encrypted high-dimensional data according to the key to obtain the query result.
[0092] After obtaining the query results, the process also includes modifying the high-dimensional dataset to preserve the relationship between the low-dimensional dataset and the encrypted index.
[0093] In a specific embodiment of the present invention, the rationality of the proposed method is verified by using different control groups.
[0094] (1) As shown in Table 1, this is a hardware and software configuration table.
[0095] Table 1 System Configuration Table
[0096] Configuration items parameter operating system Windows 10 64-bit Professional Edition CPU Intel Core™ i5-12400F Memory 16GB 3200HZ harddisk 1TB SSD Intel SGX Driver 2.6 Intel SGX SDK 2.6 MySQL 5.7.30
[0097] (2) Datasets and Queries
[0098] The examples used four datasets: Audio, Deep, MNIST, and NUS. These datasets are widely used in evaluating algorithms for high-dimensional data querying and joining. Table 2 details the relevant information for these datasets, including size, dimension, relative ratio, and intrinsic dimension. Size refers to the number of data entries in the dataset, dimension refers to the dimension of each data entry, and relative ratio and intrinsic dimension describe the overall distribution of the dataset. When the relative ratio is small and the intrinsic dimension is large, the data distribution is denser, making it more difficult to perform precise nearest neighbor operations.
[0099] Table 2 Dataset Parameter Table
[0100] Dataset <![CDATA[Scale (×10 3 )]]> Dimension In comparison Inherent Dimensions Audio 54 192 2.92 5.5 Deep 1000 256 1.96 12.1 MNIST 60 784 2.38 6.5 NUS 269 500 1.67 14.5
[0101] In the near nearest neighbor connection experiment, 50 points were randomly selected from each dataset and added to dataset R, while the other points were used as dataset S. Nearest neighbor connections were performed on datasets R and S, and each experiment was repeated 20 times.
[0102] (3) Control group setup
[0103] This invention uses PM# trees as the index structure in low-dimensional space. To analyze the overhead caused by introducing the trusted execution environment SGX, experiments were conducted to perform kNN joins using both encrypted and unencrypted indexes. In the following text, the scheme using encrypted indexes will be referred to as the SGX-PM#LSH-Join scheme, and the scheme using unencrypted indexes will be referred to as the PM#LSH-Join scheme. Furthermore, to analyze the performance of the PM# tree index structure, the experiments also compared the scheme presented in this chapter with the following kNN join algorithms: 1) QALSH-Join: using a B-tree as the index structure. 2) RLSH-Join: using an R-tree as the index structure. 3) PMLSH-Join: using a PM-tree as the index structure.
[0104] (4) Evaluation indicators
[0105] This section's experiments used five metrics to evaluate the performance of the solution: query time, index structure size, indexing time, recall, and overall ratio. Index structure size and index building time evaluate the performance of the index structure, while query time, overall ratio, and recall evaluate query efficiency and precision. Let the datasets to be joined be R = {r1, r2, ..., r...} m} and S={s1,s2,…,s n For an element r in R, i Let S be its k nearest neighbors. i =S={s i1 ,s i2 ,…,s ik The algorithm returns k approximate nearest neighbors S'. i ={s i '1,s i '2,…,s i ' k The formulas for calculating Recall and Ratio are as follows:
[0106]
[0107]
[0108] (5) The experimental results are shown in Table 3.
[0109] Table 3 shows the algorithm performance under default parameters.
[0110]
[0111] As shown in the table above, PM#LSH-Join outperforms other algorithms in query time across all datasets, achieving an average improvement of 28% in query time compared to PMLSH-Join. Regarding overall ratio and recall, since PMLSH-Join and PM#-Join differ only in index construction and retrieval processes, their fundamental principles are similar, resulting in comparable performance, with both outperforming other algorithms. It can be observed that all algorithms have relatively high query times on the NUS dataset, due to the inherently high dimensionality of the NUS dataset compared to its relatively low dimensionality. Furthermore, in PM tree-based algorithms, query time is less affected by dimensionality because high-dimensional data undergoes dimensionality reduction using the LSH function, allowing the algorithm to perform indexing and queries on the same dimension.
[0112] To analyze the additional overhead caused by introducing SGX, indexes based on PM#LSH-Join and SGX-PM#LSH-Join were built on all datasets respectively, and 100 nearest neighbor queries (k=20) were executed. The corresponding time was recorded, and the experimental results are as follows: Figure 2A and Figure 2B As shown in the figure, SGX introduces an average of 50% time overhead during the indexing phase and 34% time overhead during the retrieval phase.
[0113] The Audio and DEEP datasets were selected for experiments. By adjusting the value of k in the interval [1, 100], the impact of the number of approximate nearest neighbors k on the algorithm was analyzed. The experimental results are as follows: Figure 3A and Figure 3B As shown.
[0114] Regarding query time, PM-tree based algorithms are less affected by the number of nodes (k) because these algorithms require retrieving βn+k points, and βn is often very large, making them insensitive to changes in k. PM#LSH-Join outperforms all other algorithms in query time. Compared to PMLSH-Join, PM#trees do not have duplicate nodes, have smaller index files, require fewer disk accesses, and have more efficient routing nodes, thus achieving higher retrieval efficiency. Even after introducing SGX, the SGX-PM#LSH-Join algorithm still outperforms QALSH-Join in query time, with the performance loss within an acceptable range.
[0115] The QALSH-Join algorithm is based on hash bucketing technology. Its performance is related to the data size and data dimensionality. It can be observed that QALSH-Join's query efficiency is close to that of RLSH-Join on the Audio dataset. However, on the DEEP dataset, its query efficiency is significantly lower than that of other algorithms.
[0116] Depend on Figure 4A , Figure 4B , Figure 5A and Figure 5B It can be seen that on both datasets, as k increases, the recall rate of all algorithms decreases, while the overall ratio increases. This is because the increased number of nearest neighbors to retrieve leads to the accumulation of errors from multiple elements, resulting in a decrease in overall accuracy. Among these, PM#LSH-Join's recall and overall ratio are close to those of PMLSH-Join, outperforming all other algorithms.
[0117] Using the Audio dataset (54000x192) and the DEEP dataset (1000000x256) as input, this study compares the storage space usage of PM tree and PM# tree index structures based on different disk page sizes. The experimental results are as follows: Figure 6A and Figure 6B As shown, PM trees have smaller index files on small datasets, while PM# trees have smaller index files on large datasets.
[0118] By reducing the dimensionality of high-dimensional data and constructing a PM# tree index, we can efficiently complete approximate nearest neighbor joins while ensuring data security. Experimental results show that our proposed solution achieves a 28% performance improvement compared to the baseline solution without introducing a trusted execution environment. With the introduction of a trusted execution environment, we achieve secure approximate nearest neighbor join queries with an average performance loss of 34%.
[0119] This invention introduces an optimization method for approximate nearest neighbor connections in encrypted databases based on PM# trees. Combining a trusted execution environment, this invention designs an optimization method for approximate nearest neighbor connections in encrypted databases based on PM# trees. Through dimensionality reduction of high-dimensional data and the construction of PM# tree indexes, it can efficiently complete approximate nearest neighbor connections while ensuring data security.
[0120] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this invention can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0121] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present invention.
Claims
1. A method for optimizing approximate nearest neighbor join in encrypted databases based on PM#-tree, characterized in that, include: Hash projection is used to project a high-dimensional dataset into a low-dimensional space to obtain a low-dimensional dataset; wherein the number of features of each data point in the low-dimensional dataset is less than the number of features of each data point in the high-dimensional dataset. The high-dimensional dataset is encrypted to obtain an encrypted high-dimensional dataset; Redundant nodes generated during node splitting in the PM tree are deleted to obtain the PM# tree. The PM# tree is then used to create an index for the high-dimensional dataset, resulting in an index file. The index file is encrypted to obtain an encrypted index; Based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset, an approximate nearest neighbor join query is performed on the high-dimensional dataset to obtain the query result; wherein, during the query, the encrypted index is loaded into a trusted execution environment; wherein, the step of performing an approximate nearest neighbor join query on the high-dimensional dataset based on the encrypted index, the low-dimensional dataset, and the encrypted high-dimensional dataset includes: loading the encrypted index into the trusted execution environment, obtaining the key in the trusted execution environment, decrypting the non-leaf nodes in the encrypted index according to the key, obtaining the index file in the trusted execution environment; obtaining each data in the dataset to be queried from the low-dimensional dataset. The nearest neighbor data, merged The nearest neighbor data is used to obtain the merged result; here, the step of obtaining each data in the dataset to be queried is performed on the low-dimensional data. The nearest neighbor data specifically includes: querying the low-dimensional data in the low-dimensional dataset using a spherical cover query method to obtain multiple query points; determining whether the multiple query points are projected onto the high-dimensional dataset with a constant probability; if so, using the multiple query points to obtain the corresponding nearest neighbor data. If no nearest neighbor is found, the query parameters of the spherical cover query method are changed and the query continues until the multiple query points are projected onto the high-dimensional dataset with a constant probability, and the corresponding nearest neighbor is obtained using the multiple query points. The nearest neighbor data; Based on the merged result, the index in the trusted execution environment is queried to obtain encrypted high-dimensional data, and the encrypted high-dimensional data is decrypted according to the key to obtain the query result.
2. The method according to claim 1, characterized in that, The method of using hash projection to project a high-dimensional dataset into a low-dimensional space to obtain a low-dimensional dataset specifically includes: Multiple locality-sensitive hash functions are initialized, and multiple normal random values are generated using a standard normal distribution; wherein, the multiple locality-sensitive hash functions correspond one-to-one with the multiple normal random values; Based on the plurality of locality-sensitive hash functions and the plurality of normal random values, a plurality of stable locality-sensitive hash functions are obtained; The high-dimensional dataset is calculated based on the multiple stable local hash sensitivity functions to obtain the coordinates of the projected data points corresponding to each data point in the high-dimensional dataset; Based on the coordinates of the projected data points, the position of each data point in the high-dimensional dataset in the low-dimensional space is determined, thereby obtaining the low-dimensional dataset.
3. The method according to claim 1, characterized in that, Both the high-dimensional dataset and the index file are encrypted using the AES algorithm.
4. The method according to claim 1, characterized in that, The process of using the PM# tree to index the high-dimensional dataset to obtain an index file includes: Determine the number of pivot points in the index file. ; Randomly selected from the high-dimensional dataset A set of preset pivot points, wherein each set of preset pivot points includes One node; Calculate the above respectively The set of preset pivot points is used to determine the multiple Euclidean distances between any two nodes, and these multiple Euclidean distances are summed to obtain the result. The set of pre-set central points One European distance; Obtain the The maximum value among the Euclidean distances, and the preset pivot point set corresponding to the maximum value, and the preset pivot point set corresponding to the maximum value as the pivot point set in the index file; The nodes in the pivot set of the index file are used as the non-leaf nodes of the index file; The index file is constructed using non-leaf nodes and leaf nodes.
5. The method according to claim 1, characterized in that, The step of encrypting the index file to obtain an encrypted index includes: The encrypted index is obtained in the untrusted execution environment, and the encrypted index is decrypted in the trusted execution environment to obtain the index file in the trusted execution environment. The untrusted execution environment is in public memory, and the trusted execution environments are all in private memory. The index file in the trusted execution environment is processed by nodes, and then the processed index file is encrypted using the AES algorithm to obtain the encrypted index file in the trusted execution environment. The encrypted index file in the trusted execution environment is written to the private memory to obtain the encrypted index.
6. The method according to claim 1, characterized in that, After obtaining the query results, it also includes: The high-dimensional dataset is modified to preserve the relationship between the low-dimensional dataset and the encrypted index.
7. The method according to claim 1, characterized in that, The high-dimensional dataset corresponds one-to-one with the low-dimensional dataset.