A data query method and system
By generating hash values of query information and obfuscated information in the data query system, and calculating specific encrypted values, the information of the queried data can be obtained with only one interaction, solving the problem of long query time in the existing technology. problem, improving query efficiency.
Patent Information
- Application Number
- CN202210105663.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In existing data query methods, the query information requires two interactions in the oblivious transmission protocol, which results in a long query time and affects efficiency.
By generating hash values of query information and obfuscated information on the data query side, and calculating specific encrypted values, it only takes one interaction to generate matching arrays and encrypted values on the data provider side, and the data query side decrypts to obtain the required data.
It reduces the number of interactions and delays, improves query efficiency, and keeps the computational complexity unchanged.
Smart Images

Figure CN114443718B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data query method and system. Background Art
[0002] In the process of the data query end querying data from the data provider end, the query information of the data query end is completed under the condition that it is not leaked, and at the same time other data information of the data provider end must also be protected and not leaked, that is, the data query end can only obtain the queried data information and will know nothing about other data information.
[0003] Taking the anonymous query method of the oblivious transfer protocol as an example, the usual practice is to first generate N-1 fake samples as obfuscated data, assemble the query information and obfuscated information into a list in order and send it to the data provider for data query; then, the data provider generates N pairs of public key-private key pairs, encrypts the query results with different public keys, and sends the results and the corresponding encrypted public keys to the data query end; then, the data query end uses a random number to obtain the private key corresponding to the queried data; finally, the data query end uses the private key to obtain the information of the query data. In the above process, two interactions are required, resulting in a longer query time, affecting the query efficiency. Summary of the invention
[0004] In order to at least overcome the above-mentioned deficiencies in the prior art, the purpose of the present application is to provide a data query method and system for solving the above-mentioned technical problems.
[0005] In a first aspect, an embodiment of the present application provides a data query method, which is applied to a data query system, wherein the data query system includes a data query end and a data provider end that are communicatively connected, wherein the data provider end includes a database, wherein the database stores data to be queried and a hash value corresponding to the data to be queried, and the method includes:
[0006] The data query end generates query information and obfuscation information, and calculates hash values of the query information and the obfuscation information;
[0007] The data query end calculates a specific encryption value, and sends the specific encryption value and a hash value of the query information and the obfuscated information to the data provider end;
[0008] The data provider generates a matching array based on whether there is a hash value in the database that matches the hash value of the query information and the obfuscated information;
[0009] The data provider calculates and obtains the encrypted value of the data to be queried in the database, obtains feedback data based on the encrypted value of the data to be queried and the matching array, and sends the feedback data to the data query end;
[0010] The data query end encrypts the query information based on the feedback data to obtain an encryption result, and determines whether there is data to be queried corresponding to the query information in the database based on the encryption result. If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the required query data.
[0011] The above solution can obtain the information of the queried data with only one interaction. Compared with the existing technology, it reduces the number of interactions while keeping the computational complexity unchanged, and the delay of the whole process is lower and the efficiency is higher.
[0012] In a possible implementation, the step of generating query information and obfuscation information by the data query end, and calculating hash values of the query information and the obfuscation information includes:
[0013] Randomly generate a number of obfuscated information having the same data type as the query information;
[0014] Hash calculations are performed on the query information and the obfuscation information respectively to obtain hash values of the query information and the obfuscation information.
[0015] In a possible implementation, the step of the data query end calculating a specific encryption value and sending the specific encryption value and a hash value of the query information and the obfuscated information to the data provider end includes:
[0016] Calculating a specific encryption value based on the determined random number and the hash value of the query information;
[0017] Sending the determined random number, the specific encryption value, and the query information and the hash value of the obfuscated information to the data provider;
[0018] The determined random numbers include a first random number g, a second random number h, and a third random number r. The formula for calculating the specific encrypted value y is:
[0019] y=g r h α
[0020] α is the hash value of the query information.
[0021] In a possible implementation, the step of generating a matching array by the data provider based on whether there is a hash value in the database that matches the hash value of the query information and the obfuscated information includes:
[0022] A query is made in the database as to whether there is a hash value that matches the hash value of the query information and the obfuscation information, and a matching array is generated, wherein the i-th element in the matching array is 1, indicating that the i-th data to be queried in the database has a hash value that matches the hash value of the query information or the obfuscation information, and the i-th element in the matching array is 0, indicating that the i-th data to be queried in the database does not have a hash value that matches the hash value of the query information or the obfuscation information.
[0023] In a possible implementation, the data provider calculates the encrypted value of the data to be queried in the database, obtains feedback data based on the encrypted value of the data to be queried and the matching array, and sends the feedback data to the data query end, including:
[0024] Calculate the encryption value of each data to be queried in the database in turn;
[0025] Calculate and obtain encryption parameters;
[0026] Sequentially performing XOR processing on the elements in the matching array and the encrypted values of the corresponding data to be queried to obtain a first XOR result;
[0027] The first XOR result and the encryption parameter are sent to the data query end.
[0028] In a possible implementation, the data query end encrypts the query information based on the feedback data to obtain an encryption result, determines whether there is data to be queried corresponding to the query information in the database based on the encryption result, and if there is data to be queried corresponding to the query information, decrypts the data provided by the data provider to obtain the required query data, including:
[0029] The data query end encrypts the query information based on the encryption parameter to obtain an encryption result of the query information;
[0030] Performing XOR processing on the encryption result of the query information and the first XOR result to obtain a second XOR result;
[0031] and determining whether there is data to be queried corresponding to the query information in the database based on the second XOR result;
[0032] If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the data to be queried.
[0033] In a possible implementation, the encryption function f1(x) used by the data query end to encrypt the query information based on the encryption parameter is:
[0034] f1(x)=H((y / h i ) k , i)=H((g r h α / h i ) k , i)
[0035] Wherein H is a hash function, i is a sequence number, k is a fourth random number, the first random number g and the second random number h are generated from a first set, the third random number r and the fourth random number k are generated from a second set, and the first set and the second set are mutually prime sets.
[0036] In a second aspect, an embodiment of the present application further provides a data query system, the data query system comprising a data query end and a data providing end in communication connection, the data providing end comprising a database, the database storing data to be queried and a hash value corresponding to the data to be queried, the data query end comprising an obfuscation and hash module and a first calculation module, the data providing end comprising a storage and query module and a second calculation module;
[0037] The obfuscation and hash module is used to generate query information and obfuscation information, and calculate hash values of the query information and the obfuscation information;
[0038] The first calculation module is used to calculate a specific encryption value, and send the specific encryption value and a hash value of the query information and the obfuscated information to the data provider;
[0039] The storage and query module is used to generate a matching array based on whether there is a hash value matching the query information and the hash value of the obfuscated information in the database;
[0040] The second calculation module is used to calculate the encrypted value of the data to be queried in the database, obtain feedback data based on the encrypted value of the data to be queried and the matching array, and send the feedback data to the data query end;
[0041] The first computing module is further used to encrypt the query information based on the feedback data to obtain an encryption result, and determine whether there is data to be queried corresponding to the query information in the database based on the encryption result; if there is data to be queried corresponding to the query information, decrypt the data provided by the data provider to obtain the required query data.
[0042] In a possible implementation, the obfuscation and hashing module is specifically used to:
[0043] Randomly generate a number of obfuscated information having the same data type as the query information;
[0044] Hash calculations are performed on the query information and the obfuscation information respectively to obtain hash values of the query information and the obfuscation information.
[0045] In a possible implementation manner, the first calculation module is specifically configured to:
[0046] Calculating a specific encryption value based on the determined random number and the hash value of the query information;
[0047] Sending the determined random number, the specific encryption value, and the query information and the hash value of the obfuscated information to the data provider;
[0048] The determined random numbers include a first random number g, a second random number h, and a third random number r. The formula for calculating the specific encrypted value y is:
[0049] y=g r h α
[0050] α is the hash value of the query information.
[0051] The first calculation module is further specifically used for:
[0052] Encrypting the query information based on the encryption parameter to obtain an encryption result of the query information;
[0053] Performing XOR processing on the encryption result of the query information and the first XOR result to obtain an XOR result;
[0054] and determining whether there is data to be queried corresponding to the query information in the database based on the XOR result;
[0055] If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the data to be queried.
[0056] Based on any of the above aspects, first, the data query end generates query information and obfuscation information, calculates the hash values of the query information and obfuscation information, and calculates a specific encryption value, and sends the specific encryption value and the hash values of the query information and obfuscation information to the data provider end; then, the data provider end generates a matching array based on whether there is a hash value matching the hash value of the query information and obfuscation information in the database, calculates the encryption value of the data to be queried in the database, and obtains feedback data based on the encryption value of the data to be queried and the matching array; finally, when there is data to be queried corresponding to the query information, the data query end decrypts the data provided by the data provider end to obtain the required query data. The above scheme only requires one interaction to obtain the information of the queried data. Compared with the prior art, it reduces the number of interactions while keeping the computational complexity unchanged, and the whole process has lower delay and higher efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 A schematic diagram of an application scenario of the data query method provided in an embodiment of the present application;
[0059] Figure 2 A flowchart of a data query method provided in an embodiment of the present application;
[0060] Figure 3 A block diagram of a data query system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The present application is described in detail below in conjunction with the drawings in the specification. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment.
[0062] In order to overcome the deficiencies in the prior art, the present application provides a data query method that can improve query efficiency. Figure 1 , Figure 1 A schematic diagram of an application scenario of the data query method provided in an embodiment of the present application, in Figure 1 The data query system 10 includes a data query terminal 100 and a data provider 200 which are connected in communication. The data provider 200 can provide data information query services for the data query terminal 100.
[0063] In the embodiment of the present application, the data query terminal 100 may be, but is not limited to, a smart phone, a personal digital assistant, a tablet computer, a personal computer, a laptop computer, a virtual reality terminal device, etc. In the specific implementation process, there may be multiple data query terminals 100 connected to the data provider 200. Figure 1 Only two are shown in the figure. The data query end 100 and the data providing end 200 can be connected to each other by communicating via the https protocol.
[0064] In the embodiment of the present application, the data provider 200 may be a single physical server or a server group consisting of multiple physical servers for performing different data processing functions. The server group may be centralized or distributed (for example, the data provider 200 may be a distributed system). In some possible implementations, if the data provider 200 uses a single physical server, different logical server components may be allocated to the physical server based on different business functions.
[0065] Understandably, Figure 1 The data query system 10 shown is only a feasible example. In other feasible embodiments, the data query system 10 may also include only Figure 1 Some of the components shown may also include other components.
[0066] Please refer to Figure 2 , Figure 2 The data query method provided in the embodiment of the present application is illustrated as a flow chart. The data query method provided in the embodiment of the present application can be executed by the data query system 10. In order to facilitate the description of the technical solution of the present application, the following is combined with Figure 2 The process steps of the data query method are described in detail.
[0067] Step S101: the data query terminal 100 generates query information and obfuscation information, and calculates hash values of the query information and the obfuscation information.
[0068] In the embodiment of the present application, step S101 can be implemented in the following manner.
[0069] First, randomly generate several obfuscated information, where the data type of the obfuscated information is the same as the data type of the query information. In one possible scenario, the query information can be the user ID of the user to be queried, and the obfuscated information can be a randomly constructed user ID. For example, if the user ID of the user to be queried is a string of characters, then randomly generate several user IDs with the same data structure as the user ID of the user to be queried as obfuscated information. After generating several obfuscated information, mix the query information with the obfuscated information, and put the query information in the αth position.
[0070] Then, hash calculations are performed on the query information and the obfuscated information respectively to obtain hash values of the query information and the obfuscated information.
[0071] The mixed query information and obfuscation information are hashed to obtain hash values of the query information and the obfuscation information.
[0072] In the embodiment of the present application, before step S101, the process also includes pre-storing the data to be queried and the hash value corresponding to the data to be queried in the database of the data provider 200.
[0073] In step S102 , the data query end 100 calculates a specific encryption value, and sends the specific encryption value and the hash value of the query information and the obfuscated information to the data provider 200 .
[0074] In the embodiment of the present application, step S102 can be implemented in the following manner.
[0075] First, a specific encryption value is calculated based on a determined random number and a hash value of the query information.
[0076] Specifically, the determined random number may include a first random number g, a second random number h, and a third random number r, and the formula for calculating the specific encryption value y is:
[0077] y=g r h α
[0078] α is the hash value of the query information.
[0079] Then, the determined random number, the specific encryption value, and the hash value of the query information and the obfuscated information are sent to the data provider 200 .
[0080] Specifically, the first random number g, the second random number h, the third random number r, and the hash value of the query information and the obfuscated information are sent to the data provider 200 .
[0081] Step S103: the data provider 200 generates a matching array based on whether there is a hash value matching the hash values of the query information and the obfuscated information in the database.
[0082] In an embodiment of the present application, a query is made in a database to determine whether there is a hash value that matches the hash value of the query information and the obfuscation information, and a matching array b[i] is generated, wherein the i-th element in the matching array b[i] is 1, indicating that the i-th data to be queried in the database has a hash value that matches the hash value of the query information or the obfuscation information, and the i-th element in the matching array b[i] is 0, indicating that the i-th data to be queried in the database does not have a hash value that matches the hash value of the query information or the obfuscation information.
[0083] Step S104 , the data provider 200 calculates the encryption value of the data to be queried in the database, obtains feedback data based on the encryption value of the data to be queried and the matching array, and sends the feedback data to the data query terminal 100 .
[0084] In the embodiment of the present application, step S104 can be implemented in the following manner.
[0085] First, the encryption value of each data to be queried in the database is calculated in turn.
[0086] Specifically, the encryption value of each to-be-queried data in the database may be calculated in the following manner. For example, for the ith to-be-queried data in the database, the encryption function of the ith to-be-queried data is:
[0087] f1(i)=H((y / h i ) k , i)=H((g r h α h i ) k , i)
[0088] H is a hash function, i is a sequence number, k is a fourth random number, the first random number g and the second random number h are generated from the first set, the third random number r and the fourth random number k are generated from the second set, wherein the first set and the second set are mutually prime sets, the first set can be a generator set of 64-bit random numbers, and the second set can be a 32-bit set. Among them, the elements in the group can be generated by the product of the minimum number of group elements, and this group of group elements is called the generator of the group, and the number of generators is the rank of the finite group.
[0089] Next, the encryption parameters are calculated.
[0090] Specifically, a suitable fourth random number k is selected and the encryption parameter a is calculated in the following manner: a=g k .
[0091] Then, the elements in the matching array and the encrypted values of the corresponding data to be queried are XORed in turn to obtain a first XOR result.
[0092] Sequentially compare the i-th query data b[i] in the database with the encrypted value H((y / h i ) k , i) perform XOR processing to obtain the first XOR result
[0093] Finally, the first XOR result and the encryption parameter are sent to the data query end 100 .
[0094] In step S105, the data query end 100 encrypts the query information based on the feedback data to obtain an encryption result, and determines whether there is data to be queried corresponding to the query information in the database based on the encryption result. If there is data to be queried corresponding to the query information, the data provided by the data provider 200 is decrypted to obtain the required query data.
[0095] In the embodiment of the present application, step S105 can be implemented in the following manner.
[0096] First, the query information is encrypted based on the encryption parameter to obtain an encryption result of the query information.
[0097] In the embodiment of the present application, the encryption result of the αth query information (ie, the real query information) is H(a r , α).
[0098] Next, the encryption result of the query information is XORed with the first XOR result to obtain a second XOR result.
[0099] H(a r , α) and the first XOR result c i XOR processing is performed to obtain a second XOR result.
[0100] Then, based on the second XOR result, it is determined whether there is data to be queried corresponding to the query information in the database.
[0101] If the second XOR result is 1, it indicates that the to-be-queried data corresponding to the query information exists in the database; if the second XOR result is 0, it indicates that the to-be-queried data corresponding to the query information does not exist in the database.
[0102] Finally, if there is data to be queried corresponding to the query information, the data provided by the data provider 200 is decrypted to obtain the required query data.
[0103] The above method provided in the embodiment of the present application can obtain the information of the queried data with only one interaction. Compared with the existing technology, the number of interactions is reduced while keeping the calculation complexity unchanged, and the delay of the whole process is lower and the efficiency is higher.
[0104] The present application also provides a data query system 10, please refer to Figure 3 The data query system 10 includes a data query terminal 100 and a data providing terminal 200 which are communicatively connected. The data providing terminal 200 includes a database which stores data to be queried and hash values corresponding to the data to be queried. The data query terminal 100 includes an obfuscation and hash module 110 and a first calculation module 120. The data providing terminal 200 includes a storage and query module 210 and a second calculation module 220.
[0105] The obfuscation and hash module 110 is used to generate query information and obfuscation information, and calculate hash values of the query information and the obfuscation information.
[0106] The obfuscation and hash module 110 described in the present application is implemented in the following manner.
[0107] First, randomly generate several obfuscated information, where the data type of the obfuscated information is the same as the data type of the query information. In one possible scenario, the query information can be the user ID of the user to be queried, and the obfuscated information can be a randomly constructed user ID. For example, if the user ID of the user to be queried is a string of characters, then randomly generate several user IDs with the same data structure as the user ID of the user to be queried as obfuscated information. After generating several obfuscated information, mix the query information with the obfuscated information, and put the query information in the αth position.
[0108] Then, hash calculations are performed on the query information and the obfuscated information respectively to obtain hash values of the query information and the obfuscated information.
[0109] The mixed query information and obfuscation information are hashed to obtain hash values of the query information and the obfuscation information.
[0110] The first calculation module 120 is used to calculate a specific encryption value, and send the specific encryption value, the query information, and the hash value of the obfuscated information to the data provider 200.
[0111] In the embodiment of the present application, the first calculation module 120 is specifically implemented in the following manner.
[0112] First, a specific encryption value is calculated based on a determined random number and a hash value of the query information.
[0113] Specifically, the determined random number may include a first random number g, a second random number h, and a third random number r, and the formula for calculating the specific encryption value y is:
[0114] y=g r h α
[0115] α is the hash value of the query information.
[0116] Then, the determined random number, the specific encryption value, and the hash value of the query information and the obfuscated information are sent to the data provider 200 .
[0117] Specifically, the first random number g, the second random number h, the third random number r, and the hash value of the query information and the obfuscated information are sent to the data provider 200 .
[0118] The storage and query module 130 is used to generate a matching array based on whether there is a hash value matching the query information and the hash value of the obfuscated information in the database.
[0119] In the embodiment of the present application, the storage and query module 210 is specifically implemented in the following manner.
[0120] In an embodiment of the present application, a query is made in a database as to whether there is a hash value that matches the hash value of the query information and the obfuscation information, and a matching array is generated, wherein the i-th element b[i] in the matching array is 1, indicating that the i-th data to be queried in the database has a hash value that matches the hash value of the query information or the obfuscation information, and the i-th element b[i] in the matching array is 0, indicating that the i-th data to be queried in the database does not have a hash value that matches the hash value of the query information or the obfuscation information.
[0121] The second calculation module 220 is used to calculate the encryption value of the data to be queried in the database, obtain feedback data based on the encryption value of the data to be queried and the matching array, and send the feedback data to the data query terminal 100.
[0122] In the embodiment of the present application, the second calculation module 220 is specifically implemented in the following manner.
[0123] First, the encryption value of each data to be queried in the database is calculated in turn.
[0124] Specifically, the encryption value of each to-be-queried data in the database may be calculated in the following manner. For example, for the ith to-be-queried data in the database, the encryption function of the ith to-be-queried data is:
[0125] f1(i)=H((y / h i ) k , i)=H((g r h α / h i ) k , i)
[0126] H is a hash function, i is a sequence number, k is a fourth random number, the first random number g and the second random number h are generated from the first set, the third random number r and the fourth random number k are generated from the second set, wherein the first set and the second set are mutually prime sets, the first set can be a generator set of 64-bit random numbers, and the second set can be a 32-bit set. Among them, the elements in the group can be generated by the product of the minimum number of group elements, and this group of group elements is called the generator of the group, and the number of generators is the rank of the finite group.
[0127] Next, the encryption parameters are calculated.
[0128] Specifically, a suitable fourth random number k is selected and the encryption parameter a is calculated in the following manner: a=g k .
[0129] Then, the elements in the matching array and the encrypted values of the corresponding data to be queried are XORed in turn to obtain a first XOR result.
[0130] Sequentially compare the i-th query data b[i] in the database with the encrypted value H((y / h i ) k , i) perform XOR processing to obtain the first XOR result
[0131] Finally, the first XOR result and the encryption parameter are sent to the data query end 100 .
[0132] The first calculation module 150 is also used to encrypt the query information based on the feedback data to obtain an encryption result, and determine whether there is data to be queried corresponding to the query information in the database based on the encryption result. If there is data to be queried corresponding to the query information, the data provided by the data provider 200 is decrypted to obtain the required query data.
[0133] In the embodiment of the present application, the first calculation module 120 is specifically implemented in the following manner.
[0134] First, the query information is encrypted based on the encryption parameter to obtain an encryption result of the query information.
[0135] In the embodiment of the present application, the encryption result of the αth query information (ie, the real query information) is H(a r , α).
[0136] Next, the encryption result of the query information is XORed with the first XOR result to obtain a second XOR result.
[0137] H(a r , α) and the first XOR result c i XOR processing is performed to obtain a second XOR result.
[0138] Then, based on the second XOR result, it is determined whether there is data to be queried corresponding to the query information in the database.
[0139] If the second XOR result is 1, it indicates that the to-be-queried data corresponding to the query information exists in the database; if the second XOR result is 0, it indicates that the to-be-queried data corresponding to the query information does not exist in the database.
[0140] Finally, if there is data to be queried corresponding to the query information, the data provided by the data provider 200 is decrypted to obtain the required query data.
[0141] In summary, the data query method and system provided by the embodiment of the present application, first, the data query end generates query information and obfuscation information, calculates the hash value of the query information and the obfuscation information, and calculates a specific encryption value, and sends the specific encryption value and the hash value of the query information and the obfuscation information to the data provider end; then, the data provider end generates a matching array based on whether there is a hash value matching the hash value of the query information and the obfuscation information in the database, calculates the encryption value of the data to be queried in the database, and obtains feedback data based on the encryption value of the data to be queried and the matching array; finally, when there is data to be queried corresponding to the query information, the data query end decrypts the data provided by the data provider end to obtain the required query data. The above scheme only requires one interaction to obtain the information of the queried data. Compared with the prior art, it reduces the number of interactions while keeping the computational complexity unchanged, and the whole process has lower delay and higher efficiency.
[0142] The embodiments described above are only some embodiments of the present application, rather than all embodiments. The components of the embodiments of the present application generally described and shown in the accompanying drawings can be arranged and designed in various configurations. Therefore, the detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the protection scope of the present application, but merely represents the selected embodiments of the present application. Based on this, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data query method, characterized in that: Applied to a data query system, the data query system includes a data query end and a data provider end in communication connection, the data provider end includes a database, the database stores data to be queried and a hash value corresponding to the data to be queried, the method includes: The data query end generates query information and obfuscation information, and calculates hash values of the query information and the obfuscation information; The data query end calculates a specific encryption value, and sends the specific encryption value and a hash value of the query information and the obfuscated information to the data provider end; The data provider generates a matching array based on whether there is a hash value in the database that matches the hash value of the query information and the obfuscated information; The data provider calculates and obtains the encrypted value of the data to be queried in the database, obtains feedback data based on the encrypted value of the data to be queried and the matching array, and sends the feedback data to the data query end; The data query end encrypts the query information based on the feedback data to obtain an encryption result, and determines whether there is data to be queried corresponding to the query information in the database based on the encryption result. If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the required query data.
2. The data query method according to claim 1, characterized in that: The step of generating query information and obfuscation information by the data query end, and calculating hash values of the query information and the obfuscation information, comprises: Randomly generate a number of obfuscated information having the same data type as the query information; Hash calculations are performed on the query information and the obfuscation information respectively to obtain hash values of the query information and the obfuscation information.
3. The data query method according to claim 2, characterized in that: The step of the data query end calculating a specific encrypted value and sending the specific encrypted value and a hash value of the query information and the obfuscated information to the data provider end comprises: Calculating a specific encryption value based on the determined random number and the hash value of the query information; Sending the determined random number, the specific encryption value, and the query information and the hash value of the obfuscated information to the data provider; The determined random numbers include a first random number g, a second random number h, and a third random number r. The formula for calculating the specific encrypted value y is: y=g r h α α is the hash value of the query information.
4. The data query method according to claim 3, characterized in that: The step of generating a matching array based on whether there is a hash value in the database that matches the hash value of the query information and the obfuscated information comprises: A query is made in the database as to whether there is a hash value that matches the hash value of the query information and the obfuscation information, and a matching array is generated, wherein the i-th element in the matching array is 1, indicating that the i-th data to be queried in the database has a hash value that matches the hash value of the query information or the obfuscation information, and the i-th element in the matching array is 0, indicating that the i-th data to be queried in the database does not have a hash value that matches the hash value of the query information or the obfuscation information.
5. The data query method according to claim 4, characterized in that: The step of the data provider calculating the encrypted value of the data to be queried in the database, obtaining feedback data based on the encrypted value of the data to be queried and the matching array, and sending the feedback data to the data query end includes: Calculate the encryption value of each data to be queried in the database in turn; Calculate and obtain encryption parameters; Sequentially performing XOR processing on the elements in the matching array and the encrypted values of the corresponding data to be queried to obtain a first XOR result; The first XOR result and the encryption parameter are sent to the data query end.
6. The data query method according to claim 5, characterized in that: The data query end encrypts the query information based on the feedback data to obtain an encryption result, determines whether there is data to be queried corresponding to the query information in the database based on the encryption result, and if there is data to be queried corresponding to the query information, decrypts the data provided by the data provider to obtain the data to be queried, including: The data query end encrypts the query information based on the encryption parameter to obtain an encryption result of the query information; Performing XOR processing on the encryption result of the query information and the first XOR result to obtain a second XOR result; and determining whether there is data to be queried corresponding to the query information in the database based on the second XOR result; If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the data to be queried.
7. The data query method according to claim 6, characterized in that: The encryption function f1(i) used by the data query end to encrypt the query information based on the encryption parameter is: f1(i)=H((y / h i ) k ,i)=H((g r h α / h i ) k ,i) Wherein H is a hash function, i is a sequence number, k is a fourth random number, the first random number g and the second random number h are generated from a first set, the third random number r and the fourth random number k are generated from a second set, and the first set and the second set are mutually prime sets.
8. A data query system, characterized in that: The data query system comprises a data query end and a data providing end in communication connection, the data providing end comprises a database, the database stores data to be queried and a hash value corresponding to the data to be queried, the data query end comprises an obfuscation and hash module and a first calculation module, and the data providing end comprises a storage and query module and a second calculation module; The obfuscation and hash module is used to generate query information and obfuscation information, and calculate hash values of the query information and the obfuscation information; The first calculation module is used to calculate a specific encryption value, and send the specific encryption value, the query information and the hash value of the obfuscated information to the data provider; The storage and query module is used to generate a matching array based on whether there is a hash value matching the hash value of the query information and the obfuscated information in the database; The second calculation module is used to calculate the encrypted value of the data to be queried in the database, obtain feedback data based on the encrypted value of the data to be queried and the matching array, and send the feedback data to the data query end; The first computing module is further used to encrypt the query information based on the feedback data to obtain an encryption result, and determine whether there is data to be queried corresponding to the query information in the database based on the encryption result; if there is data to be queried corresponding to the query information, decrypt the data provided by the data provider to obtain the required query data.
9. The data query system according to claim 8, characterized in that: The obfuscation and hashing module is specifically used for: Randomly generate a number of obfuscated information having the same data type as the query information; Hash calculations are performed on the query information and the obfuscation information respectively to obtain hash values of the query information and the obfuscation information.
10. The data query system according to claim 9, characterized in that: The first calculation module is specifically used for: Calculating a specific encryption value based on the determined random number and the hash value of the query information; Sending the determined random number, the specific encryption value, and the query information and the hash value of the obfuscated information to the data provider; The determined random numbers include a first random number g, a second random number h, and a third random number r. The formula for calculating the specific encrypted value y is: y=g r h α α is the hash value of the query information; The first calculation module is further specifically used for: Encrypting the query information based on the encryption parameter to obtain an encryption result of the query information; Performing XOR processing on the encryption result of the query information and the first XOR result to obtain an XOR result; and determining whether there is data to be queried corresponding to the query information in the database based on the XOR result; If there is data to be queried corresponding to the query information, the data provided by the data provider is decrypted to obtain the data to be queried.
