Batch keyword hidden query method and system

By combining bucketing and hash functions with the OPRF protocol (a pseudo-random function), the problem of high computational and communication overhead in batch keyword hidden query in existing technologies is solved, achieving efficient batch keyword query.

CN117992641BActive Publication Date: 2024-11-15SPIDER WEB CLOUD (BEIJING) INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410081096.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2024-11-15
Estimated Expiration
2044-01-19

AI Technical Summary

Technical Problem

Existing methods for batch keyword hidden lookup require multiple hidden lookup operations, resulting in significant computational and communication overhead.

Method used

The method combines bucketing and hash functions, generates a filling matrix by vertically reversing the filling matrix, uses multiple hash functions to bucket the batch of keywords to be queried and initiates a hidden query, and combines the OPRF protocol for unintentional pseudo-random function encryption and decryption.

Benefits of technology

The computational communication overhead of batch keyword hidden query is O(1), which greatly reduces the system's communication overhead and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117992641B_ABST
    Figure CN117992641B_ABST
Patent Text Reader

Abstract

The invention provides a batch keyword concealment query method and system. The method is applied to a client and comprises: determining a matrix to be filled and a number of hash functions according to the number of buckets and the number of batch keywords to be queried; filling the size of the matrix to be filled vertically after binary inversion of the selected bucket number to generate a first filling matrix; performing batch keyword operations respectively by multiple hash functions, obtaining the row and column numbers of the matrix elements to be refilled corresponding to the current operation in the first filling matrix according to the result of each operation and the number of keywords, and refilling the elements of the row and column numbers corresponding to the multiple operations in binary order according to the bucket number to obtain a second filling matrix; sending the second filling matrix, multiple functions and the number of keywords to a server so that the server can classify multiple key-value pairs into buckets with corresponding numbers according to the second filling matrix, and the key-value pairs containing the batch keywords are classified into the bucket with the same bucket number; initiating a batch keyword concealment query for the bucket number to the server to obtain a query result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of privacy computing technology, and in particular to a batch keyword hidden query method and system. Background Art

[0002] Privacy computing is a means to make data available but invisible. Through privacy computing, the security of personal data is guaranteed, while promoting the legitimate use and innovative development of data. Privacy computing is applied in various scenarios, such as medical data analysis and financial risk control. In database query scenarios, due to legal constraints and competition between the querying parties, it is often not possible to directly query the plain text of the database. This requires introducing certain privacy protection for the information of both parties during the query. For example, the problem of multiple loans is an important issue that online micro-loan platforms need to consider when lending. Suppose that Bank B has a potential loan customer A. In order to know more about the credit status of customer A, Bank B wants to inquire about customer A's loan status or credit record from Bank C. However, because it is afraid that Bank C will snatch the customer away, Bank B does not want to disclose the fact that it is querying customer A. At the same time, for the purpose of protecting its own interests, Bank C cannot give all the data of its other customers to Bank B for arbitrary query. Private Information Retrieval (PIR) is a very practical technology in privacy computing, which is used to protect the query privacy of users. Its purpose is to ensure that when a user submits a query request to the server (data source), the query is completed without leaking the user's query information. That is, during the entire query process, the server does not know the user's specific query information and the queried data items.

[0003] There is a privacy keyword query method in the prior art. If a client wants to retrieve the values ​​corresponding to n keywords, it needs to perform n hidden query operations, and the calculation and communication overhead is O(n), resulting in large calculation and communication overhead. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a batch keyword concealment query method and system to eliminate or improve one or more defects in the prior art.

[0005] A first aspect of the present invention provides a batch keyword concealment query method, which is applied to a client and includes:

[0006] Determine the size of the matrix to be filled based on the number of buckets and the number of keywords in the batch keywords to be queried, and determine the number of hash functions based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions;

[0007] The matrix to be filled is vertically filled by inverting the binary representation of the selected bucket number in a vertical reverse filling manner to generate a first filling matrix;

[0008] Using multiple hash functions to perform hash operations on the batch of keywords to be queried respectively, obtaining the row numbers and column numbers of the matrix elements to be refilled corresponding to the current hash operation in the first filling matrix based on the hash operation results obtained by each hash operation and the number of the keywords, and using the binary representation of the bucket number to sequentially refill the matrix elements of the row numbers and column numbers corresponding to multiple hash operations to obtain a second filling matrix;

[0009] Sending the second filling matrix, the multiple hash functions, and the number of the keywords to the server, so that the server determines the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions, and the number of the keywords, and divides the multiple key-value pairs into buckets with corresponding bucket numbers, wherein each key-value pair includes a keyword and corresponding data, and the bucket number corresponding to the key-value pair including the batch keywords to be queried is the same as the selected bucket number;

[0010] A hidden query for the batch keywords to be queried with respect to the selected bucket number is initiated to the server to obtain a query result corresponding to the batch keywords to be queried.

[0011] In some embodiments of the present invention, after initiating a hidden query for the batch keywords to be queried for the selected bucket number to the server, the method may include:

[0012] Receiving encrypted data corresponding to the batch keywords to be queried from the server;

[0013] By executing the oblivious pseudo-random function OPRF protocol, multiple mapping values ​​corresponding to the batch keywords to be queried are obtained, and the encrypted data corresponding to the batch keywords to be queried are decrypted based on the multiple mapping values ​​respectively, and the data that can be successfully decrypted is used as the query result corresponding to the batch keywords to be queried.

[0014] In some embodiments of the present invention, the method further includes: in the event of a hash conflict, randomly selecting a column in the same row that has not been refilled for refilling, so that the number of 0s and 1s in each row of the second filling matrix is ​​the same.

[0015] In some embodiments of the present invention, the refilled number is the number of each position in the binary representation of the bucket number, and the row number of the matrix element to be refilled corresponding to each hash operation in the first filling matrix is ​​the same as the position number of the refilled number.

[0016] In some embodiments of the present invention, the number of rows of the matrix to be filled is the logarithmic value of the number of buckets with base 2 as the number of columns, and the number of columns is twice the number of keywords.

[0017] A second aspect of the present invention provides a batch keyword concealment query method, which is applied to a server and includes:

[0018] Receive a second filling matrix, multiple hash functions and the number of keywords in the batch keywords to be queried from the client, the second filling matrix is ​​obtained by using the binary representation of the bucket number selected by the client to sequentially refill the matrix elements of the row number and column number corresponding to the hash operation results obtained through multiple hash operations and the number of keywords in the first filling matrix respectively obtained, the first filling matrix is ​​generated by vertically reverse filling the binary representation of the bucket number and then vertically filling the matrix to be filled, the size of the matrix to be filled is determined based on the number of buckets and the number of keywords in the batch keywords to be queried, the multiple hash operations are hash operations performed on the batch keywords to be queried respectively using the multiple hash functions, the number of hash functions is determined based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions;

[0019] Determine bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and divide the multiple key-value pairs into buckets corresponding to the bucket numbers, wherein each key-value pair includes a keyword and corresponding data, and the bucket number corresponding to the key-value pair including the batch keywords to be queried is the same as the selected bucket number;

[0020] A hidden query initiated by the client for the batch keywords to be queried with respect to the selected bucket number is received, and a query result corresponding to the batch keywords to be queried is returned to the client.

[0021] In some embodiments of the present invention, after determining bucket numbers corresponding to multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and dividing the multiple key-value pairs into buckets corresponding to the bucket numbers, the method may include:

[0022] Execute an oblivious pseudo-random function (OPRF) protocol on the multiple key-value pairs held by the server to obtain multiple corresponding mapping values, and encrypt data corresponding to multiple keywords in the corresponding multiple key-value pairs based on the multiple mapping values ​​to obtain encrypted data corresponding to the multiple keywords;

[0023] A hidden query for the batch keyword to be queried of the selected bucket number initiated by the client is received, and the encrypted data corresponding to the batch keyword to be queried is returned to the client, so that the client obtains multiple mapping values ​​corresponding to the batch keyword to be queried by executing the oblivious pseudo-random function OPRF protocol, and decrypts the encrypted data corresponding to the batch keyword to be queried based on the multiple mapping values, and uses the data that can be successfully decrypted as the query result corresponding to the batch keyword to be queried.

[0024] In some embodiments of the present invention, encrypting data corresponding to multiple keywords in corresponding multiple key-value pairs based on the multiple mapping values ​​includes:

[0025] Performing XOR operations on the multiple mapping values ​​and the data corresponding to the multiple keywords in the corresponding multiple key-value pairs, respectively, to obtain corresponding multiple XOR results, wherein the character string length of the mapping value is greater than the character string length of the data corresponding to the keyword in the corresponding key-value pair;

[0026] The character string parts that have not been subjected to XOR operation in the multiple mapping values ​​are respectively concatenated with the corresponding character strings of the multiple XOR results to achieve encryption of the data corresponding to the multiple keywords in the multiple key-value pairs.

[0027] The third aspect of the present invention provides a batch keyword hidden query system, which includes: a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, when the computer instructions are executed by the processor, the system implements the steps of the method described in the first aspect, or implements the steps of the method described in the second aspect.

[0028] The fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect, or implements the steps of the method described in the second aspect.

[0029] The method and system for batch keyword hidden query of the present invention propose an innovative bucketing method, which sacrifices a certain security, and the sacrifice is very small, so that the server can divide the data hit by the batch keyword to be retrieved and queried by the client into the same bucket and the bucket specified by the client, so that the client can retrieve the data corresponding to the batch keyword by initiating a hidden query operation for the bucket to the server, thereby realizing the hidden query of batch keywords. Compared with the prior art, the computational communication overhead of this method is only O(1), which is greatly reduced, so that the communication performance of the system is effectively improved.

[0030] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0031] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0033] Figure 1 A flow chart of an implementation method of a batch keyword concealment query method of the present invention;

[0034] Figure 2 A flow chart of another implementation method of the batch keyword concealment query method of the present invention;

[0035] Figure 3 A schematic diagram of an example of a matrix to be filled in a client of the present invention;

[0036] Figure 4 A schematic diagram of an example of a first filling matrix generated by a client of the present invention;

[0037] Figure 5 A schematic diagram of an example of an intermediate process for a client of the present invention to obtain a second filling matrix;

[0038] Figure 6 A schematic diagram of an example of a second filling matrix obtained by a client of the present invention;

[0039] Figure 7 A schematic diagram of an example of a bucketing result obtained by the server of the present invention;

[0040] Figure 8 A schematic diagram of an example of the encrypted bucketing result obtained by the server of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0042] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0043] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0044] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0045] In order to implement concealed query of batch keywords at one time and effectively reduce the large computational and communication overhead existing in the prior art, an embodiment of the present invention provides a method and system for concealed query of batch keywords.

[0046] Figure 1 FIG. 1 is a flow chart of a batch keyword concealment query method according to an embodiment of the present invention. Figure 1 As shown, the batch keyword hidden query method of this embodiment can be applied to a client that wants to query batch keywords and obtain data corresponding to the batch keywords from a server. Correspondingly, the server holds multiple key-value pairs, each key-value pair includes a keyword and corresponding data. The method includes the following steps:

[0047] Step S110, determining the size of the matrix to be filled based on the number of buckets and the number of keywords in the batch keywords to be queried, and determining the number of hash functions based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions.

[0048] Specifically, the number of rows of the matrix to be filled is the logarithmic value of the number of buckets with base 2, and the number of columns is twice the number of keywords. That is, the number of hash functions is also the logarithmic value of the number of buckets with base 2.

[0049] Specifically, assuming that the number of keywords in the batch of keywords to be queried by the client is k = 2, specifically keywords x4 and x7, and the server holds w = 7 key-value pairs, specifically (x1, y1), (x2, y2), ..., (x7, y7), where the keywords x1, ..., x7 and the corresponding data y1, ..., y7 in each key-value pair can be strings of any bits, then the bits occupied by each key-value pair are the sum of the bits of the strings of each keyword and the corresponding data. In addition, assuming that the number of buckets is n = 8, and the buckets are numbered from 0 to 7, the number of hash functions is log 2(n) = 3, which can be H0, H1 and H2 respectively. From this, we can determine that the number of rows and columns of the matrix to be filled is log 2 (n) = 3 and (2*k) = 4, that is, the matrix to be filled is a 3×4 empty matrix to be filled, such as Figure 3 shown.

[0050] Step S120 , vertically fill the matrix to be filled by inverting the binary representation of the selected bucket number in a vertical reverse filling manner to generate a first filling matrix.

[0051] Specifically, a bucket numbered r=2 (0≤r<n) is randomly selected from the eight buckets 0-7. That is, assuming that the client wants the server to divide the batch of keywords and their corresponding data that the client wants to query into bucket numbered 2, the binary representation of the selected bucket number 2 is B(r)=010. The binary representation of the bucket number is inverted and filled vertically into the matrix to be filled in the vertical reverse filling method, that is, 010 is inverted to get 101, and 101 is then filled vertically into the matrix to be filled. Figure 3 In the empty matrix shown, we generate Figure 4 The first filling matrix shown. From a vertical perspective, each column in the first filling matrix is ​​the opposite value of the binary representation of the bucket number r, and the l-th row of each column is filled with the l-th binary number of the binary representation of the bucket number r after the inversion, l = 1, 2, 3, that is, the first row is filled with the first binary number 1 of 101, the second row is filled with the second binary number 0 of 101, and the third row is filled with the third binary number 1 of 101.

[0052] Step S130, use multiple hash functions to perform hash operations on the batch keywords to be queried respectively, obtain the row number and column number of the matrix elements to be refilled corresponding to the current hash operation in the first filling matrix based on the hash operation result obtained by each hash operation and the number of the keywords, and use the binary representation of the bucket number to refill the matrix elements of the row number and column number corresponding to multiple hash operations in turn to obtain a second filling matrix.

[0053] Specifically, in step S130, when there is a hash conflict, a column in the same row that has not been refilled is randomly selected for refilling, so that the number of 0s and 1s in each row of the second filling matrix is ​​the same.

[0054] In step S130, the refilled number is the number of each position in the binary representation of the bucket number, and the row number of the matrix element to be refilled corresponding to each hash operation in the first filling matrix is ​​the same as the position number of the refilled number.

[0055] Specifically, three hash functions H0, H1 and H2 are used to perform two hash operations on the two keywords x4 and x7 to be queried respectively. The first time, the keyword x4 to be queried is hashed to obtain the corresponding hash operation results H0(x4), H1(x4) and H2(x4). Then, based on Hi(x4)%(2*2)=j(0≤i≤2), the results obtained can be H0(x4)%(2*2)=0, H1(x4)%(2*2)=2, H2(x4)%(2*2)=1. 0(x4)%(2*2)=0 obtains that the row number and column number of the matrix element to be refilled corresponding to the current hash operation in the first filling matrix are 0 and 0 respectively, corresponding to the position of the first row and first column in the first filling matrix; similarly, the row number and column number of the matrix element to be refilled in the first filling matrix obtained by H1(x4)%(2*2)=2 and H2(x4)%(2*2)=1 are 1 and 2 and 2 and 1 respectively, corresponding to the positions of the second row and third column and the third row and second column in the first filling matrix respectively. Next, the matrix elements at the three positions are refilled respectively with the binary numbers of the position numbers in the binary representation 010 of the selected bucket number 2 that are the same as the row numbers of the corresponding positions in the first filling matrix. That is to say, the matrix elements at the positions with row number 0 and column number 0 (first row and first column) in the first filling matrix are refilled with 0 with position number 0 (first position) in 010, the matrix elements at the positions with row number 1 and column number 2 (second row and third column) are refilled with 1 with position number 1 (second position) in 010, and the matrix elements at the positions with row number 2 and column number 1 (third row and second column) are refilled with 0 with position number 2 (third position) in 010. At this time, the following is generated: Figure 5 The filled matrix located on the upper side.

[0056] A hash operation is performed on the keyword x7 to be queried for the second time, and the corresponding hash operation results are H0(x7), H1(x7) and H2(x7). Based on Hi(x7)%(2*2)=j(0≤i≤2), the results can be H0(x7)%(2*2)=3, H1(x7)%(2*2)=2, H2(x7)%(2*2)=0. Similarly, the row numbers and column numbers of the matrix elements to be refilled corresponding to the current hash operation in the first filling matrix are 0 and 3, 1 and 2, and 2 and 0, respectively, corresponding to the positions of the first row and fourth column, the second row and third column, and the third row and first column in the first filling matrix. Next, the matrix elements at these three positions are refilled with the binary numbers of the position numbers in the binary representation 010 of the selected bucket number 2 that are the same as the row numbers of the corresponding positions in the first filling matrix, which are position number 0, the first position 0, position number 1, the second position 1, and position number 2, the third position 0. In this way, in the case of Figure 5 Based on the filling matrix on the upper side, we get Figure 5 The filling matrix is ​​located at the lower side.

[0057] From this we can see that Figure 5 As shown, for the keywords x4 and x7 to be queried, the second row and third column of the upper and lower filling matrices are filled with binary number 1 twice, resulting in a hash conflict, that is, H1(x4)%(2*2)=H1(x7)%(2*2)=2. The hash function H1 will randomly select a column in the same row (i.e., the second row) that has not been refilled to refill the binary number 1 to resolve the hash conflict. For example, the matrix element in the second row and second column can be refilled with the binary number 1, and the final result is as follows Figure 6 The second filling matrix shown. This ensures that the number of 0s and 1s filled in each row of the second filling matrix is ​​the same and randomly distributed in each row. Of course, in the case where no hash conflict occurs, the number of 0s and 1s in each row of the second filling matrix finally obtained by performing multiple hash operations and refilling in sequence is also equal and randomly distributed in each row.

[0058] It should be noted that, in the embodiment of the present invention, a hash function with other mapping relationships can also be used to refill the first filling matrix, so as to form a second filling matrix in which 0s and 1s are distributed in other forms in each row and column, and it is not limited to the filling results mentioned in the above example. Of course, the number of keywords k, the number of buckets n, the selected bucket number r, etc. in the batch keywords to be queried are not limited to the values ​​in the above example, and other values ​​that conform to the logical relationship in the technical solution of the present invention can also be taken.

[0059] Step S140, sending the second filling matrix, the multiple hash functions and the number of the keywords to the server, so that the server determines the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and divides the multiple key-value pairs into buckets with corresponding bucket numbers, wherein each key-value pair contains a keyword and corresponding data, and the bucket number corresponding to the key-value pair containing the batch keywords to be queried is the same as the selected bucket number.

[0060] Specifically, Figure 6 The second filling matrix, the three hash functions H0, H1 and H2 and the number of keywords in the batch of keywords to be queried are sent to the server, so that the server can calculate the number of keywords in the batch of keywords according to the second filling matrix, the hash functions H0, H1 and H2 and the number of keywords in the batch of keywords to be queried according to Hi(keyword)%(2*k)=j(0≤i≤log 2 (n)-1) divides the 7 key-value pairs (x1, y1), (x2, y2), ..., (x7, y7) it holds into different buckets, among which the key-value pairs (x4, y4) and (x7, y7) containing the keywords x4 and x7 to be queried are divided into the same bucket, and the bucket is the bucket numbered 2 selected by the client, such as Figure 7 shown.

[0061] For the server, looking at the second filling matrix horizontally, since the number of 0s and 1s filled in each row in the second filling matrix is ​​the same and randomly distributed in each row, the server cannot infer any information about the content that the client wants to query (the batch keywords to be queried). Looking at the second filling matrix vertically, the server also cannot infer any information about the bucket number randomly selected by the client, which can protect the query privacy of the client user.

[0062] Step S150, initiating a hidden query of the batch keywords to be queried for the selected bucket number to the server, and obtaining a query result corresponding to the batch keywords to be queried.

[0063] Specifically, the client initiates a request to the server for Figure 7 In the hidden query of the bucket numbered 2 selected by the client as shown in the right figure, data y4 and y7 corresponding to the two keywords x4 and x7 to be queried can be obtained at one time, that is, the query results corresponding to the batch keywords to be queried.

[0064] It should be noted that when hash functions with different mapping relationships are used for hash operations, there are many possibilities for the seven key-value pairs in the example to be divided into buckets with different numbers, and they are not limited to Figure 7However, no matter how many possibilities there are, the key-value pairs (x4, y4) and (x7, y7) containing the keywords x4 and x7 to be queried will be divided into the bucket numbered 2 specified by the client. In addition, the bucket numbered 2 in the example may also store other key-value pairs besides the key-value pairs (x4, y4) and (x7, y7) containing the keywords x4 and x7 to be queried. This situation is allowed in the scenario where the security of the data stored on the server does not need to be guaranteed (protecting the privacy of the server).

[0065] In another embodiment of the present invention, after initiating a hidden query for the batch keywords to be queried of the selected bucket number to the server, the batch keyword hidden query method applied to the client may include the following steps:

[0066] Step S160, receiving encrypted data corresponding to the batch keywords to be queried from the server.

[0067] Specifically, the client initiates a request to the server for Figure 8 After the hidden query of the query keywords x4 and x7 with bucket number 2 selected by the client as shown in the right figure, the encrypted data corresponding to the query keywords x4 and x7 received from the server are obtained by the server executing the oblivious pseudo-random function OPRF protocol to encrypt the data y1, y2, ..., y7 corresponding to the keywords x1, x2, ..., x7 in the key-value pairs it holds to obtain [y1], [y2], ..., [y7], as shown in Figure 8 As shown, the encrypted data [y4] and [y7] in bucket number 2 are returned to the client. In other words, the data obtained after the client initiates the hidden query is (x4, [y4]) and (x7, [y7]), where x4, x7, y4, y7 and [y4], [y7] can be strings of any bit and any length.

[0068] Step S170, by executing the oblivious pseudo-random function OPRF protocol, multiple mapping values ​​corresponding to the batch keywords to be queried are obtained, and the encrypted data corresponding to the batch keywords to be queried are decrypted based on the multiple mapping values ​​respectively, and the data that can be successfully decrypted is used as the query result corresponding to the batch keywords to be queried.

[0069] Specifically, after the client executes the oblivious pseudo-random function OPRF protocol, it obtains two mapping values ​​corresponding to the query keywords x4 and x7, which can be t4 and t7 respectively. The string length of the mapping value t4 is greater than the string length of the encrypted data [y4], and the string length of the mapping value t7 is greater than the string length of the encrypted data [y7]. The encrypted data [y4] and [y7] are decrypted by using [y4] XOR t4 and [y7] XOR t7. For example, if t4 and t7 each occupy 64 bits, then [y4] and [y7] also each occupy 64 bits. If the first 32 bits of the two decryption results are all 0, the decryption is successful. At this time, the two pieces of data of the last 32 bits are the query results corresponding to the query keywords x4 and x7, that is, the data corresponding to the keywords x4 and x7 in the key-value pair. If the decryption fails, the last 32 bits of data are random garbled codes, which can ensure that the client cannot know any other additional information of the server, thereby ensuring the data security of the server.

[0070] In this embodiment, the client needs to participate in the execution of the oblivious pseudo-random function OPRF protocol, that is, the server needs to agree to get the mapping value. Even if the randomly selected bucket numbered 2 stores other key-value pairs (x4, y4) and (x7, y7) containing the keywords x4 and x7 to be queried, such as (x3, y3), etc., after the data corresponding to the keywords are encrypted, the bucket numbered 2 stores encrypted data corresponding to other keywords except the keywords x4 and x7 to be queried, and the client cannot decrypt the encrypted data corresponding to other non-queried keywords obtained by initiating a hidden query on the bucket numbered 2, so that the data information held by the server is leaked, and the privacy of the data stored by the server can be protected.

[0071] Figure 2 FIG. 1 is a flow chart of a method for batch keyword concealment query according to another embodiment of the present invention. Figure 2 As shown, the batch keyword hidden query method of this embodiment can be applied to a server holding multiple key-value pairs, wherein each key-value pair includes a keyword and corresponding data, which can be used by the client to obtain the data corresponding to the batch keywords to be queried. The method includes the following steps:

[0072] Step S210, receiving a second filling matrix, multiple hash functions and the number of keywords in the batch keywords to be queried from the client, the second filling matrix is ​​obtained by using the binary representation of the bucket number selected by the client to sequentially refill the matrix elements of the corresponding row numbers and column numbers in the first filling matrix obtained by the hash operation results obtained through multiple hash operations and the number of keywords, the first filling matrix is ​​generated by vertically reverse filling the binary representation of the bucket number and then vertically filling the matrix to be filled, the size of the matrix to be filled is determined based on the number of buckets and the number of keywords in the batch keywords to be queried, the multiple hash operations are hash operations performed on the batch keywords to be queried using the multiple hash functions, the number of hash functions is determined based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions.

[0073] Step S220, determine the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and divide the multiple key-value pairs into buckets with corresponding bucket numbers, wherein each key-value pair contains a keyword and corresponding data, and the bucket number corresponding to the key-value pair containing the batch keywords to be queried is the same as the selected bucket number.

[0074] Specifically, the server is based on the following information from the client: Figure 6 The second filling matrix and the three hash functions H0, H1 and H2 shown in the figure and the number of keywords in the batch keywords to be queried k=2, and according to Hi(keyword)%(2*k)=j(0≤i≤log 2(n)-1) The 7 key-value pairs (x1, y1), (x2, y2), ..., (x7, y7) held by the server are divided into buckets with corresponding bucket numbers. Specifically, for the key-value pair (x4, y4), according to the relationship H0(x4)%(2*2)=0, H1(x4)%(2*2)=2, H2(x4)%(2*2)=1, the 0 in the first row and first column, the 1 in the second row and third column, and the 0 in the third row and second column of the second filling matrix are taken in sequence, and the combination is obtained to obtain the bucket number 2 corresponding to the binary representation 010, that is, the key-value pair (x4, y4) is divided into the bucket number 2; for the key-value pair (x7, y7), according to the relationship H0(x7)%(2*2)=3, H1(x7)%(2*2)=2, H2(x7)%(2*2)=0, the 0 in the first row and fourth column of the second filling matrix are taken in sequence. 0, 1 in the second row and third column, and 0 in the third row and first column, that is, the key-value pair (x7, y7) is also divided into the bucket numbered 2; similarly, for other key-value pairs such as (x1, y1), the corresponding bucket numbers can be obtained according to the mapping relationship of hash functions H0, H1 and H2 and k. Assume that H0(x1)%(2*2)=1, H1(x1)%(2*2)=0, H2(x1)%(2*2)=3, and accordingly, take 1 in the first row and second column, 0 in the second row and first column, and 1 in the third row and fourth column in the second filling matrix, that is, the key-value pair (x1, y1) is divided into the bucket numbered 5, and other key-value pairs can be deduced in the same way. The final bucketing result is as follows: Figure 7 As shown in the right figure of . It can be seen that the key-value pairs (x4, y4) and (x7, y7) containing the query keywords x4 and x7 are divided into the same bucket numbered 2 specified by the client. In other words, this embodiment divides the keywords and corresponding data hit by the client's retrieval of the server into the bucket specified by the client.

[0075] Step S230, receiving a hidden query initiated by the client for the batch keywords to be queried with respect to the selected bucket number, and returning query results corresponding to the batch keywords to be queried to the client.

[0076] Specifically, the server receives a request initiated by the client for Figure 7 In the figure on the right, the client selects a hidden query for two keywords x4 and x7 in the bucket numbered 2, and returns the data y4 and y7 corresponding to the keywords x4 and x7 in the key-value pairs (x4, y4) and (x7, y7) to the client, which is the query result.

[0077] In another embodiment of the present invention, after determining the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and dividing the multiple key-value pairs into buckets corresponding to the bucket numbers, the batch keyword concealment query method applied to the server may include the following steps:

[0078] Step S240, execute the oblivious pseudo-random function OPRF protocol on the multiple key-value pairs held by the server to obtain the corresponding multiple mapping values, and encrypt the data corresponding to the multiple keywords in the corresponding multiple key-value pairs based on the multiple mapping values ​​to obtain the encrypted data corresponding to the multiple keywords.

[0079] Specifically, in step S240, encrypting the data corresponding to the multiple keywords in the corresponding multiple key-value pairs based on the multiple mapping values ​​respectively includes the following steps:

[0080] Step S242, performing an XOR operation on the plurality of mapping values ​​and the data corresponding to the plurality of keywords in the corresponding plurality of key-value pairs, respectively, to obtain a plurality of corresponding XOR results, wherein the character string length of the mapping value is greater than the character string length of the data corresponding to the keyword in the corresponding key-value pair;

[0081] Step S243, concatenating the character string parts of the multiple mapping values ​​that have not been subjected to the XOR operation with the corresponding character strings of the multiple XOR results respectively, so as to encrypt the data corresponding to the multiple keywords in the multiple key-value pairs.

[0082] Specifically, the server holds the mapping function of the oblivious pseudo-random function OPRF protocol, and can locally calculate the mapping of the keywords of multiple key-value pairs held by the server. For key-value pairs of arbitrary length (x1, y1), (x2, y2), ..., (x7, y7), the server executes the oblivious pseudo-random function OPRF protocol to obtain the corresponding 7 mapping values, which are t1, ..., t7 of arbitrary lengths, respectively, wherein the string lengths of the mapping values ​​t1, ..., t7 are respectively greater than the string lengths of the data corresponding to the keywords in the corresponding key-value pairs. Take the key-value pair (x1, y1) as an example, for example, the data y1 occupies 32 bits, and the mapping value t1 occupies 64 bits. First, the last 32 bits of the mapping value t1 and the 32 bits of the data y1 are XORed to obtain a 32-bit XOR result, and then the first 32 bits of the mapping value t1 and the 32-bit XOR result are spliced ​​to encrypt the data y1, and the 64-bit encrypted data [y1] can be obtained. Similarly, the same processing is performed on other key-value pairs, and finally the encrypted data corresponding to the keywords in the multiple key-value pairs held by the server are obtained, such as Figure 8 As shown in the right figure.

[0083] Step S250, receiving a hidden query initiated by the client for the batch keyword to be queried with respect to the selected bucket number, and returning the encrypted data corresponding to the batch keyword to be queried to the client, so that the client obtains multiple mapping values ​​corresponding to the batch keyword to be queried by executing the oblivious pseudo-random function OPRF protocol, and decrypts the encrypted data corresponding to the batch keyword to be queried based on the multiple mapping values, and uses the data that can be successfully decrypted as the query result corresponding to the batch keyword to be queried.

[0084] The batch keyword hidden query method of the embodiment of the present invention uses a certain degree of security in bucketing to optimize the bucketing results of the server. Next, a brief analysis of this security is made. For example, the batch keywords to be queried by the client are x1, ..., x7, and the server also happens to hold 7 key-value pairs containing x1, ..., x7. In extreme cases, the server can also divide the key-value pairs (x1, y1), ..., (x7, y7) into the same bucket. The probability of such a situation is very small in the case of random bucketing. At this time, after bucketing, the server will find that these 7 key-value pairs are all in the same bucket, which can explain to a certain extent that the client wants to query the data information in the bucket, so that the server can infer the query content that the client wants. The leakage of this client query information exists with a certain probability, but it has been verified that the leakage probability is extremely low.

[0085] The batch keyword hidden query method of the present invention proposes an innovative bucketing method, which sacrifices a certain security, and the sacrifice is very small, so that the server can divide the data hit by the batch keyword to be retrieved by the client into the same bucket and the bucket specified by the client, so that the client can retrieve the data corresponding to the batch keyword by initiating a hidden query operation for the bucket to the server, thereby realizing the hidden query of batch keywords. Compared with the prior art, the computational communication overhead of this method is only O(1), which is greatly reduced, so that the communication performance of the system is effectively improved.

[0086] Corresponding to the above method, a batch keyword hidden query system of an embodiment of the present invention includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps of the above-mentioned batch keyword hidden query method.

[0087] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned batch keyword concealment query method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0088] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0089] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0090] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0091] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A batch keyword concealment query method, characterized in that: The method is applied to a client, and the method comprises: Determine the size of the matrix to be filled based on the number of buckets and the number of keywords in the batch keywords to be queried, and determine the number of hash functions based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions; The matrix to be filled is vertically filled by inverting the binary representation of the selected bucket number in a vertical reverse filling manner to generate a first filling matrix; Using multiple hash functions to perform hash operations on the batch keywords to be queried respectively, based on the hash operation results obtained by each hash operation and the number of the keywords, the row number and column number of the matrix element to be refilled corresponding to the current hash operation in the first filling matrix are obtained, and the binary representation of the bucket number is used to sequentially refill the matrix elements of the row number and column number corresponding to multiple hash operations to obtain a second filling matrix; the refilled number is the number of each position in the binary representation of the bucket number, and the row number of the matrix element to be refilled corresponding to each hash operation in the first filling matrix is ​​the same as the position number of the refilled number; in the case of a hash conflict, a column in the same row that has not been refilled is randomly selected for refilling, so that the number of 0s and 1s in each row of the second filling matrix is ​​the same; Sending the second filling matrix, the multiple hash functions, and the number of the keywords to the server, so that the server determines the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions, and the number of the keywords, and divides the multiple key-value pairs into buckets with corresponding bucket numbers, wherein each key-value pair includes a keyword and corresponding data, and the bucket number corresponding to the key-value pair including the batch keywords to be queried is the same as the selected bucket number; A hidden query for the batch keywords to be queried with respect to the selected bucket number is initiated to the server to obtain a query result corresponding to the batch keywords to be queried.

2. The method according to claim 1, characterized in that After initiating a hidden query for the batch keywords to be queried for the selected bucket number to the server, the method further includes: Receiving encrypted data corresponding to the batch keywords to be queried from the server; By executing the oblivious pseudo-random function OPRF protocol, multiple mapping values ​​corresponding to the batch keywords to be queried are obtained, and the encrypted data corresponding to the batch keywords to be queried are decrypted based on the multiple mapping values ​​respectively, and the data that can be successfully decrypted is used as the query result corresponding to the batch keywords to be queried.

3. The method according to claim 1 or 2, characterized in that: The number of rows of the matrix to be filled is the logarithmic value of the number of buckets with base 2 as the number of columns, and the number of columns is twice the number of keywords.

4. A batch keyword concealment query method, characterized in that: The method is applied to the server, and the method includes: Receive a second filling matrix, multiple hash functions and the number of keywords in the batch keywords to be queried from the client, the second filling matrix is ​​obtained by using the binary representation of the bucket number selected by the client to sequentially refill the matrix elements of the row number and column number corresponding to the hash operation results obtained through multiple hash operations and the number of keywords in the first filling matrix respectively obtained, the first filling matrix is ​​generated by vertically reverse filling the binary representation of the bucket number and then vertically filling the matrix to be filled, the size of the matrix to be filled is determined based on the number of buckets and the number of keywords in the batch keywords to be queried, the multiple hash operations are hash operations performed on the batch keywords to be queried respectively using the multiple hash functions, the number of hash functions is determined based on the number of buckets, wherein the number of rows of the matrix to be filled is equal to the number of hash functions; Determine the bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and divide the multiple key-value pairs into buckets corresponding to the bucket numbers, wherein each key-value pair includes a keyword and corresponding data, and the bucket number corresponding to the key-value pair including the batch keywords to be queried is the same as the selected bucket number; perform hash operations on each keyword held by the server using multiple hash functions to obtain multiple hash operation results, determine the row numbers and column numbers of the filled numbers taken in sequence from the second filling matrix according to the multiple hash operation results corresponding to each keyword held by the server and the number of keywords in the batch keywords to be queried, take the corresponding numbers from the second filling matrix in sequence according to the determined row numbers and column numbers, and the numbers taken in sequence form the binary representation of the bucket numbers corresponding to the key-value pairs corresponding to each keyword held by the server from low to high, thereby obtaining each bucket number; A hidden query initiated by the client for the batch keywords to be queried with respect to the selected bucket number is received, and a query result corresponding to the batch keywords to be queried is returned to the client.

5. The method according to claim 4, characterized in that After determining bucket numbers corresponding to the multiple key-value pairs held by the server according to the second filling matrix, the multiple hash functions and the number of the keywords, and dividing the multiple key-value pairs into buckets corresponding to the bucket numbers, the method further includes: Execute an oblivious pseudo-random function (OPRF) protocol on the multiple key-value pairs held by the server to obtain multiple corresponding mapping values, and encrypt data corresponding to multiple keywords in the corresponding multiple key-value pairs based on the multiple mapping values ​​to obtain encrypted data corresponding to the multiple keywords; A hidden query for the batch keyword to be queried of the selected bucket number initiated by the client is received, and the encrypted data corresponding to the batch keyword to be queried is returned to the client, so that the client obtains multiple mapping values ​​corresponding to the batch keyword to be queried by executing the oblivious pseudo-random function OPRF protocol, and decrypts the encrypted data corresponding to the batch keyword to be queried based on the multiple mapping values, and uses the data that can be successfully decrypted as the query result corresponding to the batch keyword to be queried.

6. The method according to claim 5, characterized in that Encrypting data corresponding to a plurality of keywords in a plurality of corresponding key-value pairs based on the plurality of mapping values ​​respectively includes: Performing XOR operations on the multiple mapping values ​​and the data corresponding to the multiple keywords in the corresponding multiple key-value pairs, respectively, to obtain corresponding multiple XOR results, wherein the character string length of the mapping value is greater than the character string length of the data corresponding to the keyword in the corresponding key-value pair; The character string parts that have not been subjected to XOR operation in the multiple mapping values ​​are respectively concatenated with the corresponding character strings of the multiple XOR results to achieve encryption of the data corresponding to the multiple keywords in the multiple key-value pairs.

7. A batch keyword hidden query system, comprising a processor and a memory, characterized in that: The memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps of the method as described in any one of claims 1 to 3, or implements the steps of the method as described in any one of claims 4 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the program implements the steps of the method according to any one of claims 1 to 3, or implements the steps of the method according to any one of claims 4 to 6.