Efficient ciphertext database multi-table connection query method and device

By processing only the first occurrence of the connection attribute value pairs corresponding to the attribute value pairs in each data table in the first encrypted data structure of the encrypted database, the calculation result is generated using pseudo-random values ​​and added to the data structure. , solves the high storage overhead and computational complexity problems of existing encrypted databases during multi-table connection queries, and realizes efficient and secure multi-table equal-value connection queries.

CN119442265AActive Publication Date: 2025-02-14XIDIAN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411395827.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-02-14
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

Existing encrypted databases have high storage overhead and computational complexity problems when querying multi-table connections. At the same time, they cannot support equivalent connection queries, and leak the frequency of connection attribute values ​​and the query's connection attribute names.

Method used

By processing only the first occurrence of the connection attribute value pairs corresponding to the attribute value pairs in each data table in the first encrypted data structure, the calculation result is generated using pseudo-random values ​​and added to the data structure, and the encryption is constructed Database to support multi-table connection queries.

Benefits of technology

It optimizes storage overhead and calculation overhead, supports multi-table equivalent value connection query, improves query efficiency and security, and avoids the leakage of connection attribute value frequency and query attribute name.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442265A_ABST
    Figure CN119442265A_ABST
Patent Text Reader

Abstract

The invention discloses an efficient ciphertext database multi-table connection query method and device, and the method comprises the steps: carrying out the operation of each attribute value pair in each data table and a pseudo-random value of a connection attribute value pair appearing for the first time to obtain a first calculation result, and adding the first calculation result into a first data structure of the data table; adding the first data structure into the first encrypted data structure; adding second calculation results respectively calculated for the connection attribute value pair appearing for the first time and the connection attribute value pair not appearing for the first time into a second data structure of the data table, and adding the second data structure into a second encrypted data structure; encrypting the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext, adding the ciphertext into a third data structure of the data table, and adding the third data structure into a third encrypted data structure by taking the second calculation result as an index of the ciphertext to obtain an encrypted database, and efficient and safe multi-table connection query is realized on the basis of an encrypted database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of cloud computing security technology, and in particular relates to an efficient ciphertext database multi-table connection query method and device. Background Art

[0002] In 2000, Song et al. proposed the concept of symmetric searchable encryption, which allows the server to search encrypted data based on keywords while ensuring data and query privacy. Many subsequent studies have made various progress in enhancing the security of searchable encryption, enriching the query functions of searchable encryption, and optimizing its performance. However, although searchable encryption can achieve efficient search of encrypted documents, it is still challenging to apply it to encrypted relational databases for secure query.

[0003] Hacigümüs et al. first studied querying in encrypted relational databases, where each attribute domain is mapped to a series of non-overlapping data buckets and all entries of the corresponding bucket need to be returned. Therefore, it incurs high communication overhead and leaks the exact range of the queried data. Popa et al. proposed a practical encrypted relational database system through attribute-preserving encryption, such as deterministic encryption and order-preserving encryption, where each column in the data table is encrypted using a combination of different types of attribute-preserving encryption schemes. To perform a query, the server decrypts the combined ciphertext layer by layer until it reaches the corresponding layer. However, constructions based on attribute-preserving encryption leak the underlying data ordering and frequency information. Therefore, it is still crucial to study queries on relational encrypted databases while leaking as little information as possible.

[0004] In order to design a relational encrypted database with less leakage, Kamara et al. proposed a new query scheme based on structural encryption, in which all possible connections are pre-computed and stored in the encrypted database through heuristic paradigm representation. Although this scheme leaks less information than the construction of attribute-preserving encryption, it inevitably brings considerable storage overhead due to the need to pre-compute all possible connections. Later, Cash et al. introduced a method of partially pre-computing connections, transferring some connection operations to the client. Subsequently, Shafieinejad et al. further designed a secure equi-join query scheme based on function-hidden inner product encryption, which only leaks the sum of the leakage of each query. However, due to the high-overhead public key operations, this method has a performance bottleneck.

[0005] In 2022, Jutla et al. extended the single-table multi-keyword searchable encryption scheme OXT proposed by Cash et al. to support join queries across two tables, and proposed a new join query scheme JXT that does not require join pre-computation. More specifically, in this scheme, the server performs single-keyword searches on the two query tables respectively, and checks whether the combination of the data record identifier matched by the first table and the join attribute value pair of the second table exists in the encrypted database of the first table. This approach requires a lot of computational overhead. Specifically, its computational complexity is the product of the number of data records matched by the single-key search performed on the two tables, and the scheme only supports natural joins between the two tables, and does not support equivalent join queries, that is, the join attribute names of the two tables must be the same. Summary of the invention

[0006] In order to solve the above problems existing in the prior art, the present invention provides an efficient method and device for querying multiple tables in a ciphertext database.

[0007] The technical problem to be solved by the present invention is achieved through the following technical solutions:

[0008] In a first aspect, the present invention provides an efficient method for querying multiple tables in a ciphertext database, the method comprising:

[0009] Calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to the first encrypted data structure;

[0010] For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed according to the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value to obtain the second calculation result of the connection attribute value pair; for the connection attribute value pair that does not appear for the first time, a sixth pseudo-random value is generated based on the count value, and an XOR operation is performed according to the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value to obtain the second calculation result of the connection attribute value pair; all the second calculation results are added to the second data structure of the data table, and the second data structure is added to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;

[0011] Encrypting the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, adding the ciphertext to the third data structure of the data table, and using the second calculation result as the index of the ciphertext; adding the third data structure of each data table to the third encrypted data structure;

[0012] An encrypted database is obtained according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and a multi-table join query is implemented based on the encrypted database.

[0013] Optionally, performing an XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and adding the first calculation result to a first data structure of the data table includes:

[0014] For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

[0015] Optionally, encrypting the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain the ciphertext includes:

[0016] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

[0017] Optionally, the third data structure of each data table is added to the third encrypted data structure, including:

[0018] The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

[0019] Optionally, implementing a multi-table connection query based on the encrypted database includes:

[0020] Receive query trapdoor information sent by the client;

[0021] After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result;

[0022] Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table;

[0023] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.

[0024] In a second aspect, the present invention provides an efficient ciphertext database multi-table connection query device, the ciphertext database multi-table connection query device comprising:

[0025] A first encrypted data structure determination module is used to calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to the first encrypted data structure;

[0026] A second encrypted data structure determination module is used to obtain a second calculation result of a connection attribute value pair by performing an XOR operation on the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table according to the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value; for a connection attribute value pair that does not appear for the first time, generate a sixth pseudo-random value based on the count value, and obtain a second calculation result of the connection attribute value pair by performing an XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value; add all the second calculation results to the second data structure of the data table, and add the second data structure to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;

[0027] A third encrypted data structure determination module is used to encrypt the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, add the ciphertext to the third data structure of the data table, and use the second calculation result as the index of the ciphertext; add the third data structure of each data table to the third encrypted data structure;

[0028] A query module is used to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement multi-table connection query based on the encrypted database.

[0029] Optionally, the first encrypted data structure determination module uses the first pseudo-random value and the second pseudo-random value to perform an XOR operation to obtain a first calculation result, and adds the first calculation result to the first data structure of the data table, including:

[0030] For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

[0031] Optionally, the third encrypted data structure determination module uses a seventh pseudo-random value calculated based on each attribute value pair in each data table to encrypt the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext, including:

[0032] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

[0033] Optionally, the third encrypted data structure determination module adds the third data structure of each data table to the third encrypted data structure, including:

[0034] The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

[0035] Optionally, the query module implements multi-table connection query based on the encrypted database, including:

[0036] Receive query trapdoor information sent by the client;

[0037] After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result;

[0038] Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table;

[0039] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.

[0040] The present invention provides an efficient multi-table connection query method for a ciphertext database, which supports multi-table connection query on an encrypted database. In the first encrypted data structure, only the connection attribute value pairs corresponding to the attribute value pairs in each data table that appear for the first time are processed, that is, in the first data structure, only one copy of the data records with the same attribute value pairs and connection attribute value pairs is stored, thereby greatly optimizing the storage overhead and the calculation overhead, and the frequency of the connection attribute values ​​in the connection attribute value pairs and the connection attribute names of the queries will not be disclosed, thereby improving the efficiency and security of the query. In addition, based on the separate encryption of each data table in the ciphertext database constructed by the present invention, there is no need to pre-calculate the data that may be successfully connected, which further reduces the calculation overhead.

[0041] The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flowchart of an efficient ciphertext database multi-table connection query method provided by an embodiment of the present invention;

[0043] Figure 2 is a schematic diagram of a plaintext database including two data tables provided in an embodiment of the present invention;

[0044] Figure 3 is a schematic diagram of a system using an encrypted database provided by an embodiment of the present invention;

[0045] Figure 4 This is a comparative diagram of the single table storage overhead as the number of different connection attributes changes;

[0046] Figure 5 is a comparative diagram of the search overhead as the number of matches of the first data structure varies;

[0047] Figure 6 is a comparative schematic diagram of the search overhead as the number of identical matches of the first data structure changes;

[0048] Figure 7 It is a comparative diagram of the search overhead as the number of different retrieval tables changes;

[0049] Figure 8 It is a structural schematic diagram of an efficient ciphertext database multi-table connection query device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0051] In order to solve the problem that the existing encrypted database does not support equi-join and multi-table join query, has large storage overhead and leaks the connection attribute value pair, the embodiment of the present invention provides an efficient ciphertext database multi-table join query method, see Figure 1 , Figure 1 The present invention provides an efficient method for querying multiple tables in a ciphertext database, which specifically includes the following steps:

[0052] Step S101, calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, and use the first pseudo-random value and the second pseudo-random value to perform an XOR operation to obtain a first calculation result, add the first calculation result to the first data structure of the data table, and add the first data structure to the first encrypted data structure.

[0053] First, initialize the data structure of each data table in the plaintext database; the data structure includes the first data structure, the second data structure and the third data structure. Initialize the data structure of each data table in the plaintext database, as follows:

[0054] In the embodiment of the present invention, the first key k is selected z , the second key k w , the third key k z′ , the fourth key k r , the fifth key k c , the sixth key k T and the seventh key k enc , Among them, {0,1} λ It refers to a set of bit strings of length λ, where λ is a preset security parameter. It means to select an element from a set.

[0055] In the embodiment of the present invention, the plaintext database DB={Tab i ,W i} i∈[N] Refers to a database containing N data tables, each of which is represented by a Tab. i Indicates that Tab i is the i-th data table, W i It is the combination of all attribute names and corresponding attribute values ​​in the table (referred to as attribute-value pairs), where the symbol [N] represents the integer set {0, 1, …, N}.

[0056] See also Figure 2 , Figure 2It is a schematic diagram of a plaintext database including two data tables provided by an embodiment of the present invention, and each row of each data table represents a data record, such as T1, 01 / 2022, China, 6F0X1 represents a data record, and similarly, the rows where T2, T3, T4, T5, T6, L1, L2, L3 and L4 are located all represent different data records. In Table1 (data table Tab1), the column where ID-1 is located is the identifier of the data record, and Table1 includes three attributes, namely attribute 1, attribute 2 and attribute 3, wherein attribute 1 is Date, attribute 2 is Country, and attribute 3 is Transaction ID. In Table2 (data table Tab2), the column where ID-2 is located is the identifier of the data record, and Table2 includes two attributes, namely attribute 1 and attribute 2, wherein attribute 1 is Location, and attribute 2 is Transaction ID2. An attribute value pair is a combination of an attribute name and a corresponding attribute value. In Table 1, the attribute value pair may include Date||01 / 2022, Country||US, and Transaction ID||2C3W3, etc. In Table 2, the attribute value pair may include Location||China and Transaction ID2||4S9T6, etc.

[0057] In the embodiment of the present invention, according to the plaintext database DB={Tab i ,W i} i∈[N] , initialize three data structures for each table, including initializing the first data structure T i is an empty array array, initializes the second data structure XSet[i] to an empty set set, and initializes the third data structure M i An empty map.

[0058] In the embodiment of the present invention, N data tables DB = {Tab i ,W i} i∈[N] Generate a first encrypted data structure TSet, calculate a first pseudo-random value for each attribute value pair in each data table, calculate a second pseudo-random value for the first occurrence of a connection attribute value pair in the corresponding data record, and further perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to the first data structure of the data table, and generate the first data structures T1, T2, ..., TSet of all data tables. N All are added to the first encrypted data structure TSet of the encrypted database.

[0059] The record identifier of the data record in the data table is id, the attribute value pair contained in the data record entry is w, and the connection attribute name contained is attr * and the connection attribute value is w * See also Figure 2 , set the connection of the two attributes Transaction ID in Table1 and Transaction ID2 in Table2, and these two attributes are called connection attributes. On this basis, the connection attribute name in Table1 is Transaction ID, the connection attribute name in Table2 is TransactionID2, and the attribute value under the connection attribute name is the connection attribute value, such as 6F0X1, 5S4D2, etc. That is, the connection attribute name and connection attribute value are included in the general attribute name and attribute value.

[0060] In one implementation, performing an XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and adding the first calculation result to a first data structure of the data table includes:

[0061] For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

[0062] In the embodiment of the present invention, for each data table Tab i Each attribute-value pair w∈W in i , calculate the first pseudo-random value F(k z ,w), where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, k z is the first key.

[0063] In the embodiment of the present invention, for the attribute value pair w∈W i Each corresponding data record and its connection attribute name attr * and the connection attribute value w * , repeatability check, if the connection attribute value is attr * ||w * The first occurrence, calculate the second pseudo-random value F(k w ,w * ), where k w is the second key; using the first pseudo-random value F(k z ,w) and the second pseudo-random value F(k w,w * ) to obtain the first calculation result If the connection attribute value pair attr * ||w * If it appears multiple times, it only needs to be counted once.

[0064] In the embodiment of the present invention, the first calculation result y is added to the data table Tab i The first data structure T i When adding, the attribute value pair and the connection attribute name w||attr * is the index, that is, T i [w||attr * ]←y.

[0065] In the embodiment of the present invention, the first data structures T1, T2, ..., T N After that, they are all added to the first encrypted data structure TSet of the encrypted database. Specifically, the encrypted multi-finger mapping structure disclosed by the general result is used. At this time, the encrypted multi-finger mapping establishment algorithm TSetSetup disclosed by the result is called to generate the first encrypted data structure TSet, that is, (TSet, k T )←TSetSetup(1 λ ,T1||T2||…||T N ), where k T The sixth key.

[0066] Step S102, for the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, perform an XOR operation on the third pseudo-random value, the second pseudo-random value, the fourth pseudo-random value and the fifth pseudo-random value of the connection attribute value pair to obtain a second calculation result of the connection attribute value pair; for the connection attribute value pair that does not appear for the first time, generate a sixth pseudo-random value based on the count value, and perform an XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value and the fourth pseudo-random value of the connection attribute value pair to obtain a second calculation result of the connection attribute value pair; add all the second calculation results to the second data structure of the data table, and add the second data structure to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair.

[0067] In the embodiment of the present invention, N data tables DB = {Tab i ,W i} i∈[N] Generate a second encrypted data structure XSet, calculate a third pseudo-random value for each attribute value pair in each data table, and calculate a fourth pseudo-random value, a fifth pseudo-random value, and a sixth pseudo-random value for each attribute value pair that appears for the first time in the data record corresponding to the attribute value pair.

[0068] For the connection attribute value pair that appears for the first time, an XOR operation is performed according to the second pseudo-random value, the third pseudo-random value, the fourth pseudo-random value and the fifth pseudo-random value to obtain a second calculation result of the connection attribute value pair that appears for the first time.

[0069] For a connection attribute value pair that does not appear for the first time, a sixth pseudo-random value is generated based on the count value, and an exclusive OR operation is performed on the sixth pseudo-random value, the second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value to obtain a second calculation result of the connection attribute value pair that does not appear for the first time. The second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value of the connection attribute value pair that does not appear for the first time can be obtained based on the second pseudo-random value, the third pseudo-random value, and the fourth pseudo-random value of the connection attribute value pair that appears for the first time.

[0070] The second calculation results of the connection attribute value pairs that appear for the first time and the second calculation results of the connection attribute value pairs that do not appear for the first time are added to the second data structure of the data table, and the second data structures XSet[1], XSet[2], …, XSet[N] of all the generated data tables are merged to construct the second encrypted data structure XSet of the encrypted database.

[0071] In the embodiment of the present invention, for each data table Tab i Each attribute-value pair w∈W in i , calculate the third pseudo-random value F(k z′ ,w), where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, k z′ is the third key.

[0072] In the embodiment of the present invention, for the attribute value pair w∈W i Each corresponding data record and its connection attribute name attr * and the connection attribute value w * , repeatability check, if the connection attribute value is attr * ||w * The first occurrence, calculate the fourth pseudo-random value F(k r ,attr * ) and the fifth pseudo-random value F(k c ,1), where k r is the fourth key, k c Is the fifth key. Using the second pseudo-random value F(k w ,w * ), the third pseudo-random value F(k z′ ,w), the fourth pseudo-random value F(k r ,attr* ) and the fifth pseudo-random value F(k c ,1) Get the second calculation result If the connection attribute value pair attr * ||w * Appears multiple times, each time from the set {1,2,…,L max [i][attr * ]} arbitrarily and without repetition, select an integer cnt, i.e., the count value, and calculate the sixth pseudo-random value F(k c ,cnt), and get the second calculation result Where L max [i][attr * ] is the data table Tab i The connection attribute name attr * The corresponding connection attribute value w * The maximum number of occurrences.

[0073] See also Figure 2 , the maximum number of times the connection attribute value corresponding to the connection attribute name Transaction ID in the data table Table1 appears L max [1][Transaction ID] = 2, where 6F0X1 appears once, 4J9T6 appears once, 2C3W3 appears once, 8P7A5 appears once, and 5S4D2 appears twice, so the maximum number of times is L max [1][Transaction ID] = 2. The maximum number of times the connection attribute value corresponding to the connection attribute name Transaction ID2 in the data table Table2 appears L max [2][TransactionID2] = 1, where 5S4D2 appears once, 4S9T6 appears once, 6F8T9 appears once, and 3D8M9 appears once, so the maximum number of times is L max [2][Transaction ID2]=1.

[0074] In the embodiment of the present invention, the second calculation result xtag is added to the data table Tab i In the second data structure XSet[i], the second data structures XSet[1], XSet[2], ..., XSet[N] of all data tables are further merged to obtain the second encrypted data structure XSet. The second data structure XSet may be essentially a set, or a data structure that provides a member determination function, such as a Bloom filter.

[0075] Step S103, use the seventh pseudo-random value calculated based on each attribute value pair in each data table to encrypt the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext, add the ciphertext to the third data structure of the data table, and use the second calculation result as the index of the ciphertext; add the third data structure of each data table to the third encrypted data structure.

[0076] In the embodiment of the present invention, N data tables DB = {Tab i ,W i} i∈[N] Generate a third encrypted data structure CSet, calculate the seventh pseudo-random value for each attribute value pair in each data table, use the seventh pseudo-random value as the encryption key, use a symmetric encryption algorithm to encrypt the identifier of each data record corresponding to the attribute value pair to obtain a ciphertext, add the ciphertext to the third data structure of the data table, and obtain the third encrypted data structure of the data table. Combine the third encrypted data structures CSet[1], CSet[2], …, CSet[N] of all generated data tables to construct the third encrypted data structure CSet of the encrypted database.

[0077] In one implementation, the identifier of the data record corresponding to each attribute value pair is encrypted using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain the ciphertext, including:

[0078] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

[0079] In the embodiment of the present invention, for each data table Tab i Each attribute-value pair w∈W in i , calculate the seventh pseudo-random value F(k enc ,w), where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, k enc The seventh pseudo-random value F(k enc ,w) is also called the encryption key of the encrypted data record identifier.

[0080] In the embodiment of the present invention, for the attribute value pair w∈W i The identifier id of each corresponding data record is encrypted to obtain the ciphertext C←Enc(F(k enc,w),id), where the encryption algorithm Enc(·,·) is a secure symmetric encryption algorithm, specifically AES (Advanced Encryption Standard) encryption algorithm, etc. The encryption key is the seventh pseudo-random value F(k enc ,w).

[0081] In the embodiment of the present invention, the ciphertext C is added to the data table Tab. i The third data structure M i When adding, the second calculation result xtag mentioned above is used as the index, that is, M i [xtag]←C. And it is the third data structure M i Construct the corresponding third encrypted data structure CSet[i].

[0082] Finally, the third encrypted data structures CSet[1], CSet[2], ..., CSet[N] of all data tables are merged to obtain the third encrypted data structure CSet.

[0083] In one implementation, adding the third data structure of each data table to the third encrypted data structure includes:

[0084] The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

[0085] In the embodiment of the present invention, for the data table Tab i , is the third data structure M i There are two example methods for constructing the corresponding third encrypted data structure CSet[i], including a general filling method and a member-based data structure filling method. The following further describes the two methods:

[0086] (a) The general filling method is to fill in a set of attribute value pairs w∈W i , connection attribute name attr * and the connection attribute value w * The corresponding number of ciphertexts is filled to the maximum value L max [i][attr * Specifically, from the set {1,2,…,L max [i][attr * ]} arbitrarily and without repetition select an integer cnt that has never been selected, and recalculate the sixth pseudo-random value F(k c ,cnt), and get the second calculation result filled Then randomly select a virtual value D as the virtual filling ciphertext and add it to the data table Tabi The third data structure M i , when adding, the second calculation result xtag filled in is used as the index, that is, M i [xtag]←D, the third data structure M after filling i It is the third encrypted data structure CSet[i].

[0087] (b) The filling method based on the member determination data structure refers to using the member determination data structure with high storage and computation efficiency to store the ciphertext. Specifically, the data table Tab i The third data structure M i All elements in are added to the member determination data structure, such as Xor Filter, Binary Fuse Filter, etc. These member determination structures themselves have a filling function, so the corresponding third encryption data structure CSet[i] can be constructed, and efficient storage and computing performance can be achieved.

[0088] In the embodiment of the present invention, by filling the third data structure storing the ciphertext, the information of the intermediate query results in the multi-table connection query can be hidden, thereby improving the query security of the database.

[0089] Step S104, obtaining an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implementing a multi-table connection query based on the encrypted database.

[0090] In the embodiment of the present invention, the server stores an encrypted database generated by the above-mentioned method for constructing an encrypted database. Figure 3 , Figure 3 This is a schematic diagram of a system using an encrypted database provided by an embodiment of the present invention. The system involves a client and a server, and includes two processes: encryption and search. The encrypted database includes a first encrypted data structure TSet, a second encrypted data structure XSet, and a third encrypted data structure CSet. In the multi-table connection query process, the client selects the query data table, the query attribute value pair, and the connection attribute name, calculates the retrieval trap, and the server uses the trap to retrieve the calculated Figure 3 The encrypted identifier in is also the encrypted query result, that is, the ciphertext, which is returned to the client. The client decrypts the ciphertext to obtain the plaintext query result.

[0091] In the embodiment of the present invention, only the first-appearing connection attribute value pair corresponding to the attribute value pair in each data table is processed in the first encrypted data structure, that is, only one copy of the data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, thereby greatly optimizing the storage overhead and computing overhead and not leaking the frequency of the connection attribute value in the connection attribute value pair and the connection attribute name of the query, thereby improving the efficiency and security of the query. Based on the separate encryption of each data table in the ciphertext database constructed by the present invention, there is no need to pre-calculate the data that may be successfully connected, which further reduces the computing overhead.

[0092] In addition, the ciphertext database multi-table connection query method provided in the embodiment of the present invention allows the connection attribute name on each table to be different. By separating the connection attribute name and the connection attribute value to calculate the corresponding pseudo-random value, multi-table equal-value connection query is implemented, and the connection of any attribute is supported, including low-entropy attributes.

[0093] The ciphertext database constructed based on the present invention is filled in the third encrypted data structure, hiding the frequency of the connection attribute value and eliminating the subquery leakage, that is, the query results of any two tables will not be leaked.

[0094] In one implementation, a multi-table join query is implemented based on an encrypted database, including:

[0095] Receive query trapdoor information sent by the client;

[0096] After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result;

[0097] Determine whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table;

[0098] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain the plaintext multi-table connection query result.

[0099] In an embodiment of the present invention, based on an encrypted database containing three encrypted data structures, the client and the server perform a multi-table connection query. The client first sends query trap information to the server, including the queried data table index, the query token for querying attribute value pairs on each table, and the query trap for querying connection attributes; the server first executes an attribute value pair query of a single table based on the query trap information, finds a matching result from the first encrypted data structure of the data table, that is, the corresponding first calculation result, and then uses the query matching result of the table to perform calculations to obtain the target calculation result, and uses the target calculation result to perform a judgment query in the second encrypted data structure of the remaining data tables. After passing, the final multi-table connection ciphertext result is found from the third encrypted data structure and returned to the client; the client decrypts the query result to obtain the plaintext multi-table connection query result, which is as follows:

[0100] The client selects k data tables to be queried The query attribute value pairs w1,w2,…,w on each table k , and the query connection attribute name on each data table The encrypted multi-finger mapping tag generation algorithm TSetGetTag disclosed by the client call result generates the query token of the query attribute value pair with the lowest frequency (assuming the first query attribute value pair w1), that is, where k T is the sixth key. The client indexes the data table {t1.t2,…,t k} and the query token stag of the attribute value pair is sent to the server.

[0101] In the embodiment of the present invention, the client further generates a query trap for the connection query, that is, calculates where 1≤i≤k and k z is the first key, k z′ is the third key, k r is the fourth key, k c The client sends the query trap xjointoken to query the connection attributes.

[0102] In the embodiment of the present invention, the server end sends the data table index {t1.t2,…,t k} and the query token stag of the attribute value pair obtains the attribute value pair matching result on the corresponding first data table from the first encrypted data structure TSet, specifically by calling the encrypted multi-finger mapping retrieval algorithm TSetRetrieve revealed by the result to obtain the first data table The attribute value pair w1 and the connection attribute value pair The matching result is According to the data sheet The corresponding first data structure The structure, Contains multiple first calculation results

[0103] In the embodiment of the present invention, the server uses the first calculation result y cnt ,in Calculate the first index associated with the remaining k-1 data tables Where 2≤i≤k, determine whether the first index xtoken[i][1] is in the data table The corresponding second encrypted data structure XSet[t i ]. If k-1 first indices xtoken[2][1],…,xtoken[k][1] all belong to the second encrypted data structure XSet[t i ], the server calculates the second index Where 1≤j≤k and 1≤c≤|xjointoken[j]|; otherwise, use the next first calculation result y cnt The above operation is performed repeatedly until a set of first indexes that have all been judged to be passed is found. The server uses the second indexes that have been judged to be passed to index the corresponding ciphertext from the third encrypted structure data CSet of the encrypted database, and uses the ciphertext as the query result. Specifically, k second indexes xtoken[1][c],…,xtoken[k][c] are used in each data table in the k data tables being queried. The corresponding third encrypted structure data CSet[t j ] to find a set of ciphertexts (C1[c], C2[c],…, C k [c]). Finally, the server returns all ciphertexts {(C1,C2,…,C k )} to the client.

[0104] In the embodiment of the present invention, the client receives the ciphertext query result returned by the server and decrypts it to obtain the plaintext query result. Each query attribute value pair w in i , calculate the seventh pseudo-random value F(k enc ,w i ) to get the decryption key, where F:{0,1} λ ×{0,1} * →{0,1} λ is a cryptographically secure pseudo-random function, k enc is the seventh key. For a set of ciphertext query results (C1[c], C2[c],…, C k [c]), the client decrypts and obtains the plaintext result, namely Res[i][c]←Dec(F(kenc ,w i ),C i [c]), where 1≤i≤k and 1≤c≤|C i |. The decryption algorithm Dec(·,·) is a decryption algorithm of a secure symmetric encryption algorithm.

[0105] In the embodiment of the present invention, multi-table connection query on the encrypted database is supported, that is, connection query of more than two data tables; and the connection attribute name on each table can be different. By separating the connection attribute name and the connection attribute value to calculate the corresponding pseudo-random value, multi-table equal connection query is realized, and the connection of any attribute, including low entropy attributes, is supported. In addition, the encrypted database structure of multi-table connection query provided by the embodiment of the present invention realizes the separate encryption of each data table, without pre-calculating the data that may be successfully connected.

[0106] In the embodiment of the present invention, in the first encrypted data structure TSet, only the data tables Tab i The attribute-value pair w∈W i The corresponding first occurrence of the connection attribute value pair attr * ||w * Processing is performed, that is, only one copy of the data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, thereby greatly optimizing the storage overhead and computing overhead and not leaking the frequency of the connection attribute value and the queried connection attribute name, thereby improving the efficiency and security of the query.

[0107] In an embodiment of the present invention, filling is performed in the third encrypted data structure CSet, which hides the frequency of the connection attribute value and eliminates subquery leakage, that is, the query results of any two tables will not be leaked. For example, a connection query on three data tables will not leak the query results of the first table and the second table, the query results of the first table and the third table, etc.

[0108] During the query process, it is only necessary to perform a single keyword search in the first encrypted data structure of a single table, and then perform a judgment query in the second encrypted data structure of the remaining query data table, and finally retrieve the ciphertext result from the third encrypted data structure. Therefore, the retrieval complexity of the embodiment of the present invention is O(R w Lmax), with lower retrieval complexity, where R w Indicates the number of valid data record entries matched in the first encrypted data structure of a single table (when there are records with the same attribute value pairs and the same connection attribute values, only one data record is stored in the first encrypted data structure), Lmax is the number of valid data record entries matched in the first encrypted data structure of a single table (when there are records with the same attribute value pairs and the same connection attribute values, only one data record is stored in the first encrypted data structure), Connection property name The corresponding connection attribute value w * The maximum number of occurrences.

[0109] Based on an efficient multi-table join query method for encrypted databases provided by an embodiment of the present invention, simulation experiments are conducted. The specific simulation experiments are divided into the following three aspects: (1) Comparison of encrypted database storage overhead performance between an efficient multi-table join query method for encrypted databases provided by an embodiment of the present invention and a join query scheme (JXT) for encrypted databases without pre-calculation; (2) Comparison of search performance between an efficient multi-table join query method for encrypted databases provided by an embodiment of the present invention and a join query scheme (JXT) for encrypted databases without pre-calculation in the case of two data table join query; (3) Comparison of search performance between an efficient multi-table join query method for encrypted databases provided by an embodiment of the present invention and a join query scheme (MJXT) for encrypted databases without pre-calculation in the case of multiple data table join query. Among them, the MJXT scheme is extended from the JXT scheme by using the method provided by an embodiment of the present invention from two table query.

[0110] For a comparison of encrypted database storage costs, see Figure 4 , Figure 4 1 is a comparative diagram of the change of single table storage overhead with the number of different connection attributes. The unit of storage overhead is MB. The encryption method provided by the embodiment of the present invention greatly reduces the storage overhead because it simplifies the storage of repeated record entries in the first encrypted data structure.

[0111] For a comparison of search performance when querying two tables, see Figure 5 and Figure 6 . Figure 5 It is a comparative schematic diagram of the search overhead changing with different matching numbers of the first data structure, specifically, a comparison of the search overhead when the numbers of single keyword search matching results are different but all meet the connection query condition. Figure 6 1 is a comparative diagram of the search cost changing with the same number of matches of the first data structure, specifically, the search cost comparison when the number of single keyword search matching results is the same, but some of them meet the connection query conditions. The total number of search results is 1000, and the search time cost unit is ms.

[0112] For a comparison of search performance when querying multiple tables, see Figure 7 , Figure 7 : is a comparative diagram of the search overhead as the number of different retrieval tables changes. Compared with the prior art, the encrypted database structure provided by the embodiment of the present invention can achieve better retrieval performance while having higher security. The horizontal axis represents the number of query data tables, and the vertical axis represents the search time overhead, in ms.

[0113] The search performance of an efficient ciphertext database multi-table connection query method provided by the embodiment of the present invention is better than the prior art in both the cases of connecting two data tables and connecting multiple data tables, because the encrypted database construction and search method provided by the embodiment of the present invention only requires one retrieval of attribute-value pairs on a single table, while JXT or MJXT requires two or more retrievals of attribute-value pairs on a single table, and its retrieval complexity is O(l1l2) or where l1,…,l k They are the number of results for the retrieval of attribute-value pairs on a single table.

[0114] Based on the same inventive concept, the embodiment of the present invention also provides an efficient ciphertext database multi-table connection query device, see Figure 8 , Figure 8 1 is a schematic diagram of a structure of an efficient ciphertext database multi-table connection query device provided by an embodiment of the present invention, the ciphertext database multi-table connection query device comprising:

[0115] A first encrypted data structure determination module 801 is used to calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to the first data structure of the data table, and add the first data structure to the first encrypted data structure;

[0116] The second encrypted data structure determination module 802 is used for obtaining a second calculation result of a connection attribute value pair by performing an XOR operation on the third pseudo-random value, the second pseudo-random value, the fourth pseudo-random value and the fifth pseudo-random value for the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table; generating a sixth pseudo-random value based on the count value for a connection attribute value pair that does not appear for the first time, and obtaining a second calculation result of the connection attribute value pair by performing an XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value and the fourth pseudo-random value for the connection attribute value pair; adding all the second calculation results to the second data structure of the data table, and adding the second data structure to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair;

[0117] The third encrypted data structure determination module 803 is used to encrypt the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, add the ciphertext to the third data structure of the data table, and use the second calculation result as the index of the ciphertext; add the third data structure of each data table to the third encrypted data structure;

[0118] The query module 804 is used to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement multi-table connection query based on the encrypted database.

[0119] In the embodiment of the present invention, only the first-appearing connection attribute value pair corresponding to the attribute value pair in each data table is processed in the first encrypted data structure, that is, only one copy of the data record with the same attribute value pair and connection attribute value pair is stored in the first data structure, thereby greatly optimizing the storage overhead and computing overhead and not leaking the frequency of the connection attribute value in the connection attribute value pair and the connection attribute name of the query, thereby improving the efficiency and security of the query. Based on the separate encryption of each data table in the ciphertext database constructed by the present invention, there is no need to pre-calculate the data that may be successfully connected, which further reduces the computing overhead.

[0120] Optionally, the first encrypted data structure determination module uses the first pseudo-random value and the second pseudo-random value to perform an XOR operation to obtain a first calculation result, and adds the first calculation result to the first data structure of the data table, including:

[0121] For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

[0122] Optionally, the third encrypted data structure determination module uses a seventh pseudo-random value calculated based on each attribute value pair in each data table to encrypt the identifier of the data record corresponding to each attribute value pair to obtain a ciphertext, including:

[0123] The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

[0124] Optionally, the third encrypted data structure determination module adds the third data structure of each data table to the third encrypted data structure, including:

[0125] The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

[0126] Optionally, the query module implements multi-table connection query based on the encrypted database, including:

[0127] Receive query trapdoor information sent by the client;

[0128] After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result;

[0129] Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table;

[0130] If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.

[0131] It should be noted that the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention.

[0132] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features 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 representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.

[0133] 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 changes to the disclosed embodiments by viewing the drawings and the disclosed content. In the description of the present invention, the term "comprising" does not exclude other components or steps, "one" or "an" does not exclude multiple situations, and "multiple" means two or more, unless otherwise clearly and specifically limited. In addition, certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.

[0134] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. An efficient multi-table connection query method for a ciphertext database, characterized in that: The ciphertext database multi-table connection query method comprises: Calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to the first encrypted data structure; For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed according to the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value to obtain the second calculation result of the connection attribute value pair; for the connection attribute value pair that does not appear for the first time, a sixth pseudo-random value is generated based on the count value, and an XOR operation is performed according to the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value to obtain the second calculation result of the connection attribute value pair; all the second calculation results are added to the second data structure of the data table, and the second data structure is added to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair; Encrypting the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, adding the ciphertext to the third data structure of the data table, and using the second calculation result as the index of the ciphertext; adding the third data structure of each data table to the third encrypted data structure; An encrypted database is obtained according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and a multi-table join query is implemented based on the encrypted database.

2. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Performing an XOR operation on the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, and adding the first calculation result to a first data structure of the data table, including: For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

3. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: The identifier of the data record corresponding to each attribute value pair is encrypted using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, including: The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

4. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Add the third data structure of each data table to the third encrypted data structure, including: The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

5. The method for querying multiple tables in a ciphertext database according to claim 1, characterized in that: Implementing multi-table connection query based on the encrypted database includes: Receive query trapdoor information sent by the client; After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result; Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table; If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.

6. An efficient multi-table connection query device for a ciphertext database, characterized in that: The ciphertext database multi-table connection query device comprises: A first encrypted data structure determination module is used to calculate a first pseudo-random value for each attribute value pair of each data table, calculate a second pseudo-random value for the connection attribute value pair that first appears in the data record corresponding to each attribute value pair, perform an XOR operation using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result, add the first calculation result to a first data structure of the data table, and add the first data structure to the first encrypted data structure; A second encrypted data structure determination module is used to obtain a second calculation result of a connection attribute value pair by performing an XOR operation on the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table according to the third pseudo-random value, the second pseudo-random value of the connection attribute value pair, the fourth pseudo-random value and the fifth pseudo-random value; for a connection attribute value pair that does not appear for the first time, generate a sixth pseudo-random value based on the count value, and obtain a second calculation result of the connection attribute value pair by performing an XOR operation on the sixth pseudo-random value, the third pseudo-random value, the second pseudo-random value of the connection attribute value pair and the fourth pseudo-random value; add all the second calculation results to the second data structure of the data table, and add the second data structure to the second encrypted data structure; the third pseudo-random value is calculated for each attribute value pair; A third encrypted data structure determination module is used to encrypt the identifier of the data record corresponding to each attribute value pair using the seventh pseudo-random value calculated based on each attribute value pair in each data table to obtain a ciphertext, add the ciphertext to the third data structure of the data table, and use the second calculation result as the index of the ciphertext; add the third data structure of each data table to the third encrypted data structure; A query module is used to obtain an encrypted database according to the first encrypted data structure, the second encrypted data structure and the third encrypted data structure, and implement multi-table connection query based on the encrypted database.

7. The ciphertext database multi-table connection query device according to claim 6, characterized in that: The first encrypted data structure determination module uses the first pseudo-random value and the second pseudo-random value to perform an XOR operation to obtain a first calculation result, and adds the first calculation result to the first data structure of the data table, including: For the connection attribute value pair that appears for the first time in the data record corresponding to each attribute value pair in each data table, an XOR operation is performed using the first pseudo-random value and the second pseudo-random value to obtain a first calculation result; the first calculation result is added to the first data structure of the data table, and the attribute value pair and the connection attribute name are used as indexes of the first calculation result.

8. The ciphertext database multi-table connection query device according to claim 6, characterized in that: The third encrypted data structure determination module uses the seventh pseudo-random value calculated based on each attribute value pair in each data table to encrypt the identifier of the data record corresponding to each attribute value pair to obtain the ciphertext, including: The seventh pseudo-random value is calculated for each attribute value pair in each data table, and the seventh pseudo-random value is used as an encryption key for encrypting the identifier of the data record corresponding to each attribute value pair to perform an encryption operation to obtain a ciphertext.

9. The ciphertext database multi-table connection query device according to claim 6, characterized in that: The third encrypted data structure determination module adds the third data structure of each data table to the third encrypted data structure, including: The third data structure of each data table is filled using a general filling method or a member-based data structure filling method, and the filled third data structure is added to the third encrypted data structure.

10. The multi-table connection query device for a ciphertext database according to claim 6, characterized in that: The query module implements multi-table connection query based on the encrypted database, including: Receive query trapdoor information sent by the client; After determining the data table based on the data table index in the query trapdoor information, searching for a corresponding first calculation result from a first data structure of the data table according to the query trapdoor information, and performing calculation according to the first calculation result to obtain a target calculation result; Determining whether the target calculation result is a second calculation result in a second data structure of another data table other than the data table; If the judgment result is yes, the corresponding ciphertext is indexed from the third data structure according to the target calculation result, and the ciphertext is returned to the client as the query result, so that the client decrypts the query result to obtain a plaintext multi-table connection query result.

Citation Information

Patent Citations

  • Ciphertext data range query method and system based on comparison index

    CN115168909A

  • Static connection keyword ciphertext retrieval method and system based on XOR filter and OXT protocol

    CN118673518A

  • Data query interface system in an event historian

    US20160171055A1

  • Method for approximate processing of complex join queries

    US20190005094A1

  • Multi-user ciphertext search method capable of preventing forgery

    WO2020133032A1