Data query method and data query system

By dividing the database into sub-databases and hybrid sub-databases, and utilizing a trusted third party to generate random query data vectors, the problem of information leakage during data querying is solved, thus achieving secure data querying.

CN115168906BActive Publication Date: 2026-04-14SHANGHAI ICEKREDIT INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI ICEKREDIT INC
Filing Date
2022-08-23
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing data query methods pose a risk that the data query end may use brute-force searches to crack the query information, leading to information leakage.

Method used

By dividing the database into multiple sub-databases and hybrid sub-databases, and using a trusted third-party terminal to generate random query data vectors, it is ensured that the sub-databases cannot communicate with each other, and queries are only performed through a portion of the random query data vectors, thus preventing information leakage.

Benefits of technology

It ensures information security during the data query process, prevents brute-force search methods from obtaining data other than the query data, and guarantees information security for both the data query end and the data provider end.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168906B_ABST
    Figure CN115168906B_ABST
Patent Text Reader

Abstract

The data query method and the data query system provided by the embodiments of the present application relate to the technical field of data processing. First, a data providing end divides a database into multiple sub-databases and forms multiple mixed sub-databases, and the sub-databases and the mixed sub-databases cannot communicate with each other; then, multiple random query data vectors generated based on a query data vector are respectively sent to the multiple sub-databases and the multiple mixed sub-databases; then, the data providing end calculates a query return value based on the received multiple random query data vectors; finally, a data querying end judges whether there is to-be-queried data in the data providing end based on the query return value. Compared with the prior art, different sub-databases or mixed sub-databases cannot communicate, and any one of them can only obtain part of the random query data vectors forming the query data vector, so that the information security between the data querying end and the data providing end in the data query process can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and more specifically, to a data query method and a data query system. Background Technology

[0002] In existing technologies, data queries involve an interactive process. The data being queried by the querying party must be retrieved without being leaked, while other private information from the data provider must also be protected. This means that both parties can only obtain the information they want, without knowing anything else. This ensures data confidentiality while enabling interaction. However, while existing query methods encrypt the queried data, there is a possibility that the querying party could use a brute-force search to crack the ciphertext and obtain the queried information. Summary of the Invention

[0003] In order to at least overcome the above-mentioned deficiencies in the prior art, the purpose of this application is to provide a data query method and a data query system to solve the above-mentioned technical problems.

[0004] In a first aspect, embodiments of this application provide a data query method applied to a data query system, the data query system including a data query terminal connected via communication, a trusted third-party terminal, and a data provider terminal, the method comprising:

[0005] The data query terminal sends the hash value of the data to be queried to the trusted third party.

[0006] The data provider divides the database into multiple sub-databases, forms multiple hybrid sub-databases with the same number of sub-databases, and sends the hash range of the multiple sub-databases to the trusted third party. The multiple sub-databases and the multiple hybrid sub-databases cannot communicate with each other.

[0007] The trusted third party matches the multiple sub-databases based on the hash value of the data to be queried, and generates a query data vector;

[0008] The trusted third party will send multiple random query data vectors generated based on the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases in the data provider, respectively.

[0009] The data provider calculates the query return value based on the received multiple random query data vectors and sends the query return value to the trusted third party.

[0010] The trusted third party will return the query value to the data query terminal.

[0011] The data query terminal determines whether the data to be queried exists in the data provider based on the received query return value.

[0012] The above solution involves several steps. First, the data provider divides the database into multiple sub-databases and hybrid sub-databases, preventing communication between them. Next, a trusted third party matches the hash value of the data to be queried against the sub-databases and generates a query data vector. This third party then sends multiple random query data vectors generated from the query data vectors to the sub-databases and hybrid sub-databases, respectively. The data provider then calculates the query return value based on the received random query data vectors. Finally, the data querying end determines whether the data to be queried exists in the data provider's database based on the query return value. Compared to existing technologies, the inability of different sub-databases or hybrid sub-databases to communicate, and the fact that each sub-database can only obtain a portion of the random query data vectors that form the query data vector, not the complete query data vector, ensures information security between the data querying end and the data provider during the data query process. Even using brute-force search methods, no data other than the query data can be obtained.

[0013] In one possible implementation, the step of the data provider dividing the database into multiple sub-databases, forming multiple hybrid sub-databases equal in number to the number of sub-databases, and sending the hash range of the multiple sub-databases to the trusted third party includes:

[0014] The data provider calculates the hash value of each piece of data in the database and sorts the data in the database based on the hash values;

[0015] The data provider divides the sorted database into four sub-databases, and then performs pairwise intersection processing on the four sub-databases to obtain four hybrid sub-databases, wherein each sub-database is either a 0-sub-database or a 1-sub-database.

[0016] Calculate the hash range of each of the four sub-databases and send the hash range of each of the four sub-databases to the trusted third party.

[0017] In one possible implementation, the data provider divides the sorted database into four equal sub-databases, and the step of intersecting the four sub-databases pairwise to obtain four hybrid sub-databases includes:

[0018] The data provider divides the sorted database into four sub-databases arranged in sequence;

[0019] The intersection of the first and second sub-databases yields the fifth-ranked hybrid sub-database.

[0020] The intersection of the second and third sub-databases yields the sixth-ranked mixed sub-database.

[0021] The intersection of the third and fourth sub-databases yields the seventh-ranked mixed sub-database; and

[0022] The intersection of the fourth sub-database and the first sub-database yields the eighth mixed sub-database.

[0023] In one possible implementation, the step of the trusted third party matching the multiple sub-databases based on the hash value of the data to be queried and generating a query data vector includes:

[0024] The trusted third party determines the target sub-database corresponding to the hash range of the hash value of the data to be queried;

[0025] The hash value of the data to be queried is set to 1 at the matching position in the target sub-database and to 0 at the non-matching position to obtain the query data vector.

[0026] Three random query data vectors are generated based on the query data vector, namely a first random query data vector, a second random query data vector, and a third random query data vector, wherein the query data vector is the intersection of the three random query data vectors.

[0027] In one possible implementation, the step of the trusted third party sending multiple random query data vectors generated based on the query data vector to the multiple sub-databases and the multiple hybrid sub-databases in the data provider includes:

[0028] Send the first random query data vector to the target sub-database;

[0029] The second random query data vector is sent to the first sub-database and the fourth sub-database after the target sub-database.

[0030] The third random query data vector is sent to the first sub-database ranked before the target sub-database and the third sub-database ranked after the target sub-database.

[0031] In one possible implementation, the step of the data provider calculating a query return value based on the received plurality of random query data vectors and sending the query return value to the trusted third party includes:

[0032] The first random query data vector is multiplied by the target sub-database to obtain the first query return value;

[0033] The second random query data vector is multiplied by the first sub-database and the fourth sub-database after the target sub-database, respectively, to obtain the second query return value and the third query return value.

[0034] The third random query data vector is multiplied by the first sub-database sorted before the target sub-database and the third sub-database sorted after the target sub-database, respectively, to obtain the fourth query return value and the fifth query return value.

[0035] In one possible implementation, the step of the data query terminal determining whether the data to be queried exists in the data provider based on the received query return value includes:

[0036] The query result parameters are calculated based on the first query return value, the second query return value, the third query return value, the fourth query return value, and the fifth query return value;

[0037] If the query result parameter is 1, it is determined that the data to be queried exists in the data provider; if the query result parameter is 0, it is determined that the data to be queried does not exist in the data provider.

[0038] Secondly, embodiments of this application also provide a data query system, which includes a data query terminal, a trusted third-party terminal, and a data provider terminal connected by communication.

[0039] The data query terminal is used to send the hash value of the data to be queried to the trusted third party terminal;

[0040] The data provider is configured to divide the database into multiple sub-databases, form multiple hybrid sub-databases with the same number of sub-databases based on the multiple sub-databases, and send the hash range of the multiple sub-databases to the trusted third party, wherein the multiple sub-databases and the multiple hybrid sub-databases cannot communicate with each other;

[0041] The trusted third-party terminal is used to match the multiple sub-databases based on the hash value of the data to be queried, and to generate a query data vector;

[0042] The trusted third-party terminal is used to send multiple random query data vectors generated based on the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases in the data provider terminal, respectively.

[0043] The data provider is configured to calculate a query return value based on the received multiple random query data vectors, and send the query return value to the trusted third party.

[0044] The trusted third-party terminal is used to return the query value to the data query terminal;

[0045] The data query terminal is used to determine whether the data to be queried exists in the data provider based on the received query return value.

[0046] In one possible implementation, the data provider is used for:

[0047] Calculate the hash value of each piece of data in the database, and sort the data in the database based on the hash values;

[0048] The sorted database is divided into four sub-databases, and then the four sub-databases are intersected pairwise to obtain four mixed sub-databases, wherein each sub-database is either a 0-sub-database or a 1-sub-database.

[0049] Calculate the hash range of each of the four sub-databases and send the hash range of each of the four sub-databases to the trusted third party.

[0050] In one possible implementation, the data provider is further specifically used for:

[0051] The sorted database is divided into four sub-databases arranged in sequence;

[0052] The intersection of the first and second sub-databases yields the fifth-ranked hybrid sub-database.

[0053] The intersection of the second and third sub-databases yields the sixth-ranked mixed sub-database.

[0054] The intersection of the third and fourth sub-databases yields the seventh-ranked mixed sub-database; and

[0055] The intersection of the fourth sub-database and the first sub-database yields the eighth mixed sub-database.

[0056] Based on any of the above aspects, firstly, the data provider divides the database into multiple sub-databases and multiple hybrid sub-databases, preventing communication between the sub-databases and hybrid sub-databases. Next, a trusted third party matches the hash value of the data to be queried against the multiple sub-databases and generates a query data vector. This third party then sends multiple random query data vectors generated from the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases, respectively. Next, the data provider calculates the query return value based on the received random query data vectors. Finally, the data querying end determines whether the data to be queried exists in the data provider's database based on the query return value. Compared to existing technologies, since different sub-databases or hybrid sub-databases cannot communicate, and each of them can only obtain a portion of the random query data vectors that form the query data vector, information security between the data querying end and the data provider can be ensured during the data query process. Even using brute-force search methods, no data other than the query data can be obtained. Attached Figure Description

[0057] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings required in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 A flowchart illustrating the data query method provided in this application embodiment;

[0059] Figure 2 This is a structural block diagram of the data query system provided in an embodiment of this application. Detailed Implementation

[0060] The present application will now be described in detail with reference to the accompanying drawings. The specific operation methods in the method embodiments can also be applied to the device embodiments or system embodiments.

[0061] To overcome the shortcomings mentioned in the background art, the inventors provide the following solutions, please refer to... Figure 1 , Figure 1 This is a flowchart illustrating the data query method provided in an embodiment of this application. Figure 2This is a structural block diagram of the data query system provided in this embodiment. The data query method provided in this embodiment is applied to the data query system 10. The data query system 10 may include a data query terminal 100, a trusted third-party terminal 200, and a data provider terminal 300 connected by communication. The data query terminal 100 can be a client (such as a smartphone or computer), the trusted third-party terminal 200 can be a server managed by a third-party monitoring platform, and the data provider terminal 300 can be a single server or multiple servers. The following is a combination of... Figure 1 and Figure 2 This application provides a detailed description of the data query methods provided.

[0062] In step S11, the data query terminal 100 sends the hash value of the data to be queried to the trusted third party terminal 200.

[0063] The data query terminal 100 calculates the hash value H(x) of the data to be queried x, and sends the calculated hash value H(x) to the trusted third party terminal 200.

[0064] In step S12, the data provider 300 divides the database into multiple sub-databases, forms multiple hybrid sub-databases with the same number of sub-databases, and sends the hash range of the multiple sub-databases to the trusted third party 200.

[0065] In this embodiment, multiple sub-databases and multiple hybrid sub-databases cannot communicate with each other. Step S12 can be implemented in the following way.

[0066] First, the data provider 300 calculates the hash value of each piece of data in the database and sorts the data in the database based on the hash values.

[0067] Next, the data provider 300 divides the sorted database into four equal sub-databases, and then performs pairwise intersection processing on the four sub-databases to obtain four mixed sub-databases, where each sub-database is either a 0-sub-database or a 1-sub-database. Specifically, the data provider 300 can divide the sorted database into four sequentially arranged sub-databases, find the intersection of the first and second sub-databases to obtain the fifth mixed sub-database, find the intersection of the second and third sub-databases to obtain the sixth mixed sub-database, find the intersection of the third and fourth sub-databases to obtain the seventh mixed sub-database, and find the intersection of the fourth and first sub-databases to obtain the eighth mixed sub-database.

[0068] Then, the hash range of each of the four sub-databases is calculated, and the hash range of the four sub-databases is sent to the trusted third party 200.

[0069] In step S13, the trusted third-party terminal 200 matches multiple sub-databases based on the hash value of the data to be queried and generates a query data vector.

[0070] In this embodiment, step S13 can be implemented in the following way.

[0071] First, the trusted third party determines the target sub-database corresponding to the hash range of the hash value of the data to be queried.

[0072] Next, the hash value of the data to be queried is set to 1 at the matching position in the target sub-database and 0 at the non-matching position to obtain the query data vector.

[0073] Then, three random query data vectors are generated based on the query data vector. The three random query data vectors are the first random query data vector, the second random query data vector, and the third random query data vector, wherein the query data vector is the intersection of the three random query data vectors.

[0074] In step S14, the trusted third party 200 sends multiple random query data vectors generated based on the query data vectors to multiple sub-databases and multiple hybrid sub-databases in the data provider 300.

[0075] Specifically, this can be achieved through the following steps: sending the first random query data vector to the target sub-database, sending the second random query data vector to the first sub-database and the fourth sub-database after the target sub-database, and sending the third random query data vector to the first sub-database before the target sub-database and the third sub-database after the target sub-database.

[0076] In step S15, the data provider 300 calculates the query return value based on the received multiple random query data vectors and sends the query return value to the trusted third party 200.

[0077] Specifically, the first random query data vector is multiplied by the target sub-database to obtain the first query return value; the second random query data vector is multiplied by the first sub-database and the fourth sub-database after the target sub-database to obtain the second and third query return values; and the third random query data vector is multiplied by the first sub-database before the target sub-database and the third sub-database after the target sub-database to obtain the fourth and fifth query return values.

[0078] Step S16: The trusted third-party terminal 200 returns the query value to the data query terminal 100.

[0079] Step S17: The data query terminal 100 determines whether the data to be queried exists in the data provider terminal 300 based on the received query return value.

[0080] In this step, a query result parameter is calculated based on the first query return value, the second query return value, the third query return value, the fourth query return value, and the fifth query return value. If the query result parameter is 1, it is determined that the data to be queried exists in the data provider. If the query result parameter is 0, it is determined that the data to be queried does not exist in the data provider.

[0081] The above solution will be explained below with specific examples.

[0082] The data provider 300 divides the database into four equal-sized sub-databases C1, C2, C3, and C4. The database is a 0 / 1 database, meaning that the values ​​in the database are either 0 or 1. Then, the sub-databases are intersected pairwise to obtain mixed sub-databases C5, C6, C7, and C8, where C5 = C1⊕C2, C6 = C2⊕C3, C7 = C3⊕C4, and C8 = C1⊕C4.

[0083] The data query terminal 100 needs to know which sub-database the data to be queried is in (that is, one of C1, C2, C3, and C4). Assuming the data to be queried is in C1, a query data vector Q is generated. The result to be queried is A = C1 * Q, where * is the query data vector multiplication. Since the data provider terminal 300 cannot know the data to be queried, Q can be decomposed into Q1, Q2, and Q3, such that Q satisfies Q = Q1⊕Q2⊕Q3 with Q, Q1, Q2, and Q3. Based on the query results, we can deduce that A = C1 * Q = C1 * (Q1⊕Q2⊕Q3). Since x⊕y⊕ = x, A = C1 * Q = C1 * (Q1⊕Q2⊕Q3) = C1 * (Q1⊕Q2⊕Q3)⊕C2 * Q2⊕C2 * Q2⊕C4 * Q3⊕C4 * Q3 = C1 * Q1⊕C2 * Q2⊕(C1⊕C2)*Q2⊕C4 * Q3⊕(C1⊕C4)*Q3. Based on the above equation, we know that Q1 needs to be sent to the first sub-database C1, Q2 to the second sub-database C2 and the fifth sub-database C5, and Q3 to the fourth sub-database C4 and the eighth sub-database C8. XORing the resulting values ​​will give the desired result. For messages from other sub-databases, one message can be randomly selected from Q1, Q2, and Q3. Generally, if the queried database is on sub-database Cx, then...

[0084] A=Cx*Q=Cx*(Q1⊕Q2⊕Q3)=Cx*(Q1⊕Q2⊕Q3)⊕C(x+1)*Q2⊕C(x+1)*Q2⊕C(x-1)*Q3⊕ C(x-1)*Q3=Cx*Q1⊕C(x+1)*Q2⊕(Cx⊕C(x+1))*Q2⊕C(x-1)*Q3⊕(C(x-1)⊕Cx)*Q3

[0085] If x takes values ​​in the range of (1 to 4) and is polled, x+i = (x+i+4)%4+1. To obtain the value for the x-th sub-database, simply send Q1 to the x-th sub-database, Q2 to the (x+1)-th and (x+4)-th sub-databases, and Q3 to the (x-1)-th and (x+3)-th sub-databases. Then, XOR the obtained values ​​to get the desired result. For messages in other sub-databases, one message can be randomly selected from Q1, Q2, and Q3.

[0086] The data provider 300 calculates that the return value of the xth sub-database is Mx = Cx * Q1, the return value of the (x+1)th sub-database is M(x+1) = C(x+1) * Q2, the return value of the (x+4)th sub-database is M(x+4) = C(x+4) * Q2, the return value of the (x-1)th sub-database is M(x-1) = C(x-1) * Q3, and the return value of the (x+3)th sub-database is M(x+3) = C(x+3) * Q3.

[0087] The data query terminal 100 can calculate the query result parameter m based on the formula, m=Mx⊕M(x+1)⊕M(x+4)⊕M(x-1)⊕M(x+3). When m is 1, it means that there is data to be queried in the data provider terminal 300. If m is 0, it means that there is no data to be queried in the data provider terminal.

[0088] Please refer to this again. Figure 2 This application also provides a data query system 10, which includes a data query terminal 100, a trusted third-party terminal 200, and a data provider terminal 300 connected by communication.

[0089] Data query terminal 100 is used to send the hash value of the data to be queried to trusted third party terminal 200.

[0090] The data query terminal 100 calculates the hash value H(x) of the data to be queried x, and sends the calculated hash value H(x) to the trusted third party terminal 200.

[0091] The data provider 300 is used to divide the database into multiple sub-databases, form multiple hybrid sub-databases with the same number of sub-databases based on the multiple sub-databases, and send the hash range of the multiple sub-databases to the trusted third party. The multiple sub-databases and the multiple hybrid sub-databases cannot communicate with each other.

[0092] In this embodiment, the data providing end 300 is specifically used for:

[0093] First, calculate the hash value of each piece of data in the database, and then sort the data in the database based on the hash values;

[0094] Next, the sorted database is divided into four equal sub-databases. Then, the intersections of each of the four sub-databases are performed pairwise to obtain four mixed sub-databases, where each sub-database is either a 0-sub-database or a 1-sub-database. Specifically, the data provider 300 can divide the sorted database into four sequentially arranged sub-databases. The intersection of the first and second sub-databases yields the fifth mixed sub-database, the intersection of the second and third sub-databases yields the sixth mixed sub-database, the intersection of the third and fourth sub-databases yields the seventh mixed sub-database, and the intersection of the fourth and first sub-databases yields the eighth mixed sub-database.

[0095] Then, the hash range of each of the four sub-databases is calculated, and the hash range of the four sub-databases is sent to the trusted third party 200.

[0096] A trusted third-party terminal 200 is used to match the multiple sub-databases based on the hash value of the data to be queried, and generate a query data vector.

[0097] In this embodiment, the trusted third-party terminal 200 is specifically used for:

[0098] First, a trusted third party determines the target sub-database corresponding to the hash range of the data to be queried;

[0099] Next, the hash value of the data to be queried is set to 1 at the matching position in the target sub-database and 0 at the non-matching position to obtain the query data vector;

[0100] Then, three random query data vectors are generated based on the query data vector. The three random query data vectors are the first random query data vector, the second random query data vector, and the third random query data vector, wherein the query data vector is the intersection of the three random query data vectors.

[0101] A trusted third-party terminal 200 is used to send multiple random query data vectors generated based on the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases in the data provider terminal, respectively.

[0102] In this embodiment, the trusted third-party terminal 200 is specifically used to: send the first random query data vector to the target sub-database, send the second random query data vector to the first sub-database and the fourth sub-database after the target sub-database, and send the third random query data vector to the first sub-database before the target sub-database and the third sub-database after the target sub-database.

[0103] The data provider 300 is used to calculate the query return value based on the received multiple random query data vectors, and send the query return value to the trusted third party 200.

[0104] In this embodiment, the data provider 300 is specifically configured to: multiply the first random query data vector by the target sub-database to obtain a first query return value; multiply the second random query data vector by the first sub-database and the fourth sub-database after the target sub-database respectively to obtain a second query return value and a third query return value; and multiply the third random query data vector by the first sub-database before the target sub-database and the third sub-database after the target sub-database respectively to obtain a fourth query return value and a fifth query return value.

[0105] A trusted third-party terminal 200 is used to feed back the query return value to the data query terminal.

[0106] The data query terminal 100 is used to determine whether the data to be queried exists in the data provider based on the received query return value.

[0107] In this embodiment, the data query terminal 100 is specifically used to: calculate query result parameters based on the first query return value, the second query return value, the third query return value, the fourth query return value, and the fifth query return value; if the query result parameter is 1, it is determined that the data to be queried exists in the data provider terminal; if the query result parameter is 0, it is determined that the data to be queried does not exist in the data provider terminal.

[0108] In summary, the data query method and system provided in this application firstly divide a database into multiple sub-databases and multiple hybrid sub-databases, preventing communication between the sub-databases and hybrid sub-databases. Next, a trusted third party matches the hash value of the data to be queried against the multiple sub-databases and generates a query data vector. This third party then sends multiple random query data vectors generated from the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases, respectively. Then, the data provider calculates the query return value based on the received random query data vectors. Finally, the data querying end determines whether the data to be queried exists in the data provider's database based on the query return value. Compared to existing technologies, different sub-databases or hybrid sub-databases cannot communicate, and each can only obtain a portion of the random query data vectors that form the query data vector. Therefore, information security between the data querying end and the data provider can be ensured during the data query process, and even brute-force search methods cannot obtain data other than the query data.

[0109] The embodiments described above are merely some, not all, of the embodiments of this application. The components of the embodiments of this application typically described and illustrated in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of protection of this application, but merely to illustrate selected embodiments of this application. Based on this, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data query method, characterized in that, Applied to a data query system, the data query system including a data query terminal with communication connections, a trusted third-party terminal, and a data provider terminal, the method includes: The data query terminal sends the hash value of the data to be queried to the trusted third party. The data provider divides the database into multiple sub-databases, forms multiple hybrid sub-databases with the same number of sub-databases, and sends the hash range of the multiple sub-databases to the trusted third party. The hybrid sub-databases are obtained by finding the intersection of each pair of the multiple sub-databases, and the multiple sub-databases and the multiple hybrid sub-databases cannot communicate with each other. The trusted third party matches the multiple sub-databases based on the hash value of the data to be queried, and generates a query data vector; The trusted third party will send multiple random query data vectors generated based on the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases in the data provider, respectively. The data provider calculates the query return value based on the received multiple random query data vectors and sends the query return value to the trusted third party. The trusted third party will return the query value to the data query terminal. The data query terminal determines whether the data to be queried exists in the data provider based on the received query return value; The steps of the data provider dividing the database into multiple sub-databases, forming multiple hybrid sub-databases equal in number to the number of sub-databases, and sending the hash ranges of the multiple sub-databases to the trusted third party include: The data provider calculates the hash value of each piece of data in the database and sorts the data in the database based on the hash values; The data provider divides the sorted database into four sub-databases, and then performs pairwise intersection processing on the four sub-databases to obtain four hybrid sub-databases. The sub-databases are either 0 sub-databases or 1 sub-databases; the 0 sub-databases or 1 sub-databases refer to sub-databases in which the data values ​​stored are only 0 or 1. Calculate the hash range of each of the four sub-databases and send the hash range of each of the four sub-databases to the trusted third party. The data provider divides the sorted database into four sub-databases, and the step of intersecting each of the four sub-databases pairwise to obtain four hybrid sub-databases includes: The data provider divides the sorted database into four sub-databases arranged in sequence; The intersection of the first and second sub-databases yields the fifth-ranked hybrid sub-database. The intersection of the second and third sub-databases yields the sixth-ranked mixed sub-database. The intersection of the third and fourth sub-databases yields the seventh-ranked mixed sub-database. The intersection of the fourth sub-database and the first sub-database is used to obtain the eighth mixed sub-database.

2. The data query method as described in claim 1, characterized in that, The step of the trusted third party matching the multiple sub-databases based on the hash value of the data to be queried and generating a query data vector includes: The trusted third party determines the target sub-database corresponding to the hash range of the hash value of the data to be queried; The hash value of the data to be queried is set to 1 at the matching position in the target sub-database and to 0 at the non-matching position to obtain the query data vector. Three random query data vectors are generated based on the query data vector, namely a first random query data vector, a second random query data vector, and a third random query data vector, wherein the query data vector is the intersection of the three random query data vectors.

3. The data query method as described in claim 2, characterized in that, The step of the trusted third party sending multiple random query data vectors generated based on the query data vector to the multiple sub-databases and the multiple hybrid sub-databases in the data provider includes: Send the first random query data vector to the target sub-database; The second random query data vector is sent to the first sub-database and the fourth sub-database after the target sub-database. The third random query data vector is sent to the first sub-database ranked before the target sub-database and the third sub-database ranked after the target sub-database.

4. The data query method as described in claim 3, characterized in that, The step of the data provider calculating the query return value based on the received multiple random query data vectors and sending the query return value to the trusted third party includes: The first random query data vector is multiplied by the target sub-database to obtain the first query return value; The second random query data vector is multiplied by the first sub-database and the fourth sub-database after the target sub-database, respectively, to obtain the second query return value and the third query return value. The third random query data vector is multiplied by the first sub-database sorted before the target sub-database and the third sub-database sorted after the target sub-database, respectively, to obtain the fourth query return value and the fifth query return value.

5. The data query method as described in claim 4, characterized in that, The step of determining whether the data to be queried exists in the data provider based on the received query return value includes: The query result parameters are calculated based on the first query return value, the second query return value, the third query return value, the fourth query return value, and the fifth query return value; If the query result parameter is 1, it is determined that the data to be queried exists in the data provider; if the query result parameter is 0, it is determined that the data to be queried does not exist in the data provider.

6. A data query system, characterized in that, The data query system includes a data query terminal with communication connections, a trusted third-party terminal, and a data provider terminal; The data query terminal is used to send the hash value of the data to be queried to the trusted third party terminal; The data provider is used to divide the database into multiple sub-databases, form multiple hybrid sub-databases with the same number of sub-databases, and send the hash range of the multiple sub-databases to the trusted third party. The hybrid sub-databases are obtained by finding the intersection of each pair of the multiple sub-databases, and the multiple sub-databases and the multiple hybrid sub-databases cannot communicate with each other. The trusted third-party terminal is used to match the multiple sub-databases based on the hash value of the data to be queried, and to generate a query data vector; The trusted third-party terminal is used to send multiple random query data vectors generated based on the query data vectors to the multiple sub-databases and the multiple hybrid sub-databases in the data provider terminal, respectively. The data provider is configured to calculate a query return value based on the received multiple random query data vectors, and send the query return value to the trusted third party. The trusted third-party terminal is used to return the query value to the data query terminal; The data query terminal is used to determine whether the data to be queried exists in the data provider based on the received query return value; The data provider is used for: Calculate the hash value of each piece of data in the database, and sort the data in the database based on the hash values; The sorted database is divided into four sub-databases, and then the four sub-databases are intersected pairwise to obtain four hybrid sub-databases. The sub-databases are either 0 sub-databases or 1 sub-databases; the 0 sub-databases or 1 sub-databases refer to the sub-databases in which the data values ​​stored are only 0 or 1. Calculate the hash range of each of the four sub-databases and send the hash range of each of the four sub-databases to the trusted third party. The data provider is also specifically used for: The sorted database is divided into four sub-databases arranged in sequence; The intersection of the first and second sub-databases yields the fifth-ranked hybrid sub-database. The intersection of the second and third sub-databases yields the sixth-ranked mixed sub-database. The intersection of the third and fourth sub-databases yields the seventh-ranked mixed sub-database. The intersection of the fourth sub-database and the first sub-database is used to obtain the eighth mixed sub-database.

Citation Information

Patent Citations

  • Method and system for access of universal encrypted database in cloud environment

    CN107370725A

  • Block chain index storage method and apparatus, computer device and medium

    WO2022143540A1