Keyword retrieval method, electronic equipment, storage medium and program product
By mapping the search keywords and using pseudo-random value set judgments, the problem of lack of pre-judgment and privacy security protection in the prior art is solved, and an efficient and secure keyword search process is achieved.
Patent Information
- Application Number
- CN202411644874.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
The existing keyword search methods lack pre-judgment before data retrieval, resulting in unoptimized search process, wasted computing and communication resources, and lack of privacy and security protection.
By mapping the search keywords, determining the query conditions with random numbers, calculating the pseudo-random value set, and determining whether the target search data can be obtained based on the mapped values and pseudo-random value sets to avoid leakage of key information.
The search process is optimized, the search efficiency is improved, privacy and security are protected, and invalid search and resource waste are avoided.
Smart Images

Figure CN119598000A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of search technology, and in particular to a keyword search method, electronic equipment, storage medium and program product. Background Art
[0002] With the continuous development of network technology, when a client terminal wants to obtain data on a server, the server searches according to the keywords sent by the client terminal, and then sends the obtained search results to the client terminal. However, the keyword search methods currently used generally lack pre-judgment before data retrieval, that is, before retrieval, it is determined whether the keywords to be retrieved exist in the database on the server side, so as to optimize the retrieval process, filter out invalid searches, avoid wasting computing and communication resources, and improve retrieval efficiency. Therefore, how to efficiently determine whether the retrieved keywords exist in the database on the server side, while protecting privacy and security in this process, is a problem that needs to be solved urgently. Summary of the invention
[0003] The purpose of some embodiments of the present application is to provide a keyword retrieval method, electronic device, storage medium and program product. Through the technical solutions of the embodiments of the present application, it is possible to determine whether target retrieval data corresponding to the retrieval keyword can be obtained, thereby avoiding the leakage of key information, optimizing the retrieval process and improving retrieval efficiency.
[0004] In a first aspect, some embodiments of the present application provide a keyword search method, comprising:
[0005] Obtaining a first search keyword;
[0006] Determining, according to the first search keyword, a first mapping value corresponding to the first search keyword;
[0007] Determine a first query condition according to the first random number and the second random number;
[0008] Sending a first query condition to a server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database;
[0009] It is determined whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set.
[0010] Some embodiments of the present application map the search keywords, and the query conditions are also determined based on random numbers, and then a set of pseudo-random values is calculated. A judgment is made based on the mapping values and the set of pseudo-random values to determine whether the target search data corresponding to the search keywords can be obtained, thereby avoiding leakage of key information, optimizing the search process, and improving search efficiency.
[0011] Optionally, determining whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set includes:
[0012] If the third pseudo-random value set matches the first mapping value, the target search data corresponding to the first search keyword can be obtained;
[0013] If the third pseudo-random value set does not match the first mapping value, the target search data corresponding to the first search keyword cannot be obtained.
[0014] Some embodiments of the present application determine whether the retrieved result contains target retrieval data by comparing the first mapping value with the pseudo-random number in the pseudo-random value set, thereby improving the accuracy of determining whether the target retrieval data exists, while protecting privacy and security during the judgment process.
[0015] Optionally, determining a first mapping value corresponding to the first search keyword according to the first search keyword includes:
[0016] Determine, according to the first search keyword, a second search keyword corresponding to the first search keyword, and send the second search keyword to a server, so that the server determines, according to the second search keyword, a first pseudo-random number corresponding to the second search keyword;
[0017] According to the first pseudo-random number, a first mapping value corresponding to the first pseudo-random number is determined.
[0018] In some embodiments of the present application, due to the use of OPRF, even if the data owner returns a pseudo-random value or a mapping result corresponding to the pseudo-random value, the querying party cannot directly know the original data content, thereby protecting the data privacy of the data owner.
[0019] Optionally, determining, according to the first search keyword, a second search keyword corresponding to the first search keyword includes:
[0020] The first search keyword is blinded by using a preset blinding factor to obtain a second search keyword.
[0021] Some embodiments of the present application perform blind processing on search keywords, thereby protecting the query privacy of the query party and improving the security of the search process.
[0022] Optionally, sending the first query condition to the server so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database includes:
[0023] The first query condition is encrypted using a server-side public key to obtain a second query condition;
[0024] Sending the second query condition to the server, so that the server decrypts the second query condition according to the server-side private key to obtain a third query condition, searching in a pre-stored database according to the third query condition to obtain a first pseudo-random value set corresponding to the third query condition, and encrypting the first pseudo-random value set using the server-side public key to obtain a second pseudo-random value set;
[0025] Receiving a second pseudo-random value set returned by the server;
[0026] The second pseudo-random value set is decrypted using the client terminal private key to obtain a decrypted third pseudo-random value set.
[0027] In some embodiments of the present application, the query conditions are obfuscated, and the query conditions and the set of pseudo-random values returned by the server are also encrypted during transmission, thereby protecting the query privacy of the querying party and ensuring the security of data transmission.
[0028] Optionally, the data in the pre-stored database is stored in the form of a key-value pair, and the key-value pair at least includes a mapping value corresponding to the keyword identifier and data corresponding to the keyword identifier.
[0029] The database in some embodiments of the present application stores mapping values corresponding to keyword identifiers and data corresponding to the keyword identifiers, thereby improving the security of keyword identifier storage and ensuring that the database can support keyword judgment and retrieval processes.
[0030] Optionally, the method further comprises:
[0031] New data is added to the database or original data is deleted.
[0032] Some embodiments of the present application support dynamic updating of the database, including adding, modifying and deleting elements. The data owner only needs to re-preprocess the changed parts and generate pseudo-random values corresponding to the query keywords for the query party, so as to ensure the keyword-based query process on the dynamically changing database.
[0033] In a second aspect, some embodiments of the present application provide a keyword search device, including:
[0034] An acquisition module, used for acquiring a first search keyword;
[0035] A mapping module, configured to determine a first mapping value corresponding to the first search keyword according to the first search keyword;
[0036] A query module, used to determine a first query condition according to the first random number and the second random number;
[0037] a determination module, configured to send the first query condition to a server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database;
[0038] The retrieval module is used to determine whether target retrieval data corresponding to the first retrieval keyword can be obtained according to the first mapping value and the third pseudo-random value set.
[0039] Some embodiments of the present application map the search keywords, and the query conditions are also determined based on random numbers, and then a set of pseudo-random values is calculated. A judgment is made based on the mapping values and the set of pseudo-random values to determine whether the target search data corresponding to the search keywords can be obtained, thereby avoiding leakage of key information, optimizing the search process, and improving search efficiency.
[0040] Optionally, the retrieval module is used to:
[0041] If the third pseudo-random value set matches the first mapping value, the target search data corresponding to the first search keyword can be obtained;
[0042] If the third pseudo-random value set does not match the first mapping value, the target search data corresponding to the first search keyword cannot be obtained.
[0043] Some embodiments of the present application determine whether the retrieved result contains target retrieval data by comparing the first mapping value with the pseudo-random number in the pseudo-random value set, thereby improving the accuracy of determining whether the target retrieval data exists, while protecting privacy and security during the judgment process.
[0044] Optionally, the mapping module is used to:
[0045] Determine, according to the first search keyword, a second search keyword corresponding to the first search keyword, and send the second search keyword to a server, so that the server determines, according to the second search keyword, a first pseudo-random number corresponding to the second search keyword;
[0046] According to the first pseudo-random number, a first mapping value corresponding to the first pseudo-random number is determined.
[0047] In some embodiments of the present application, due to the use of OPRF, even if the data owner returns a pseudo-random value or a mapping result corresponding to the pseudo-random value, the querying party cannot directly know the original data content, thereby protecting the data privacy of the data owner.
[0048] Optionally, the mapping module is used to:
[0049] The first search keyword is blinded by using a preset blinding factor to obtain a second search keyword.
[0050] Some embodiments of the present application perform blind processing on search keywords, thereby protecting the query privacy of the querying party and improving the security of the search process.
[0051] Optionally, the determining module is used to:
[0052] The first query condition is encrypted using a server-side public key to obtain a second query condition;
[0053] Sending the second query condition to the server, so that the server decrypts the second query condition according to the server-side private key to obtain a third query condition, searching in a pre-stored database according to the third query condition to obtain a first pseudo-random value set corresponding to the third query condition, and encrypting the first pseudo-random value set using the server-side public key to obtain a second pseudo-random value set;
[0054] Receiving a second pseudo-random value set returned by the server;
[0055] The second pseudo-random value set is decrypted using the client terminal private key to obtain a decrypted third pseudo-random value set.
[0056] In some embodiments of the present application, the query conditions are obfuscated, and the query conditions and the set of pseudo-random values returned by the server are also encrypted during transmission, thereby protecting the query privacy of the querying party and ensuring the security of data transmission.
[0057] Optionally, the data in the pre-stored database is stored in the form of a key-value pair, and the key-value pair at least includes a mapping value corresponding to the keyword identifier and data corresponding to the keyword identifier.
[0058] The database in some embodiments of the present application stores mapping values corresponding to keyword identifiers and data corresponding to the keyword identifiers, thereby improving the security of keyword identifier storage and ensuring that the database can support keyword judgment and retrieval processes.
[0059] Optionally, the acquisition module is further used to:
[0060] New data is added to the database or original data is deleted.
[0061] Some embodiments of the present application support dynamic updating of the database, including adding, modifying and deleting elements. The data owner only needs to re-preprocess the changed parts and generate pseudo-random values corresponding to the query keywords for the query party, so as to ensure the keyword-based query process on the dynamically changing database.
[0062] In a third aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the keyword retrieval method as described in any embodiment of the first aspect can be implemented.
[0063] In a fourth aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the keyword retrieval method as described in any embodiment of the first aspect.
[0064] In a fifth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, it can implement the keyword retrieval method as described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some 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 paying creative work.
[0066] Figure 1 A flowchart of a keyword search method provided in an embodiment of the present application;
[0067] Figure 2 A functional schematic diagram of an oblivious pseudo-random function OPRF provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of the structure of a keyword search device provided in an embodiment of the present application;
[0069] Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.
[0071] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0072] With the continuous development of network technology, when a client terminal wants to obtain data on a server, the server searches according to the keywords sent by the client terminal, and then sends the obtained search results to the client terminal. However, the keyword search methods currently used generally lack pre-judgment before data retrieval, that is, before retrieval, it is judged whether the keywords to be retrieved exist in the database on the server side, so as to optimize the retrieval process, filter out invalid retrievals, avoid wasting computing and communication resources, and improve retrieval efficiency. Therefore, how to efficiently judge whether there are keywords to be retrieved in the database on the server side, while protecting the privacy security in this process, is a problem that needs to be solved urgently. In view of this, some embodiments of the present application provide a keyword search method, which obtains a first search keyword; determines a first mapping value corresponding to the first search keyword according to the first search keyword; determines a first query condition according to a first random number and a second random number; sends the first query condition to the server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database; determines whether the target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set. In the embodiment of the present application, the search keywords are mapped, and the query conditions are also determined based on random numbers, and then a set of pseudo-random values is calculated. A judgment is made based on the mapping values and the set of pseudo-random values to determine whether the target search data corresponding to the search keywords can be obtained, thereby avoiding leakage of key information, optimizing the search process, and improving search efficiency.
[0073] like Figure 1 As shown, an embodiment of the present application provides a keyword search method, the method comprising:
[0074] S101, obtaining a first search keyword;
[0075] Specifically, when the terminal device wants to query data in the server database, the terminal device obtains the first search keyword.
[0076] S102, determining a first mapping value corresponding to the first search keyword according to the first search keyword;
[0077] Specifically, the terminal device blinds the first search keyword and sends the blinded search keyword to the server. The server calculates a pseudo-random value for the blinded search keyword and sends the obtained pseudo-random value to the terminal device. The terminal device de-blinds the pseudo-random value to obtain a pseudo-random value corresponding to the first search keyword, and then maps the pseudo-random value to obtain a first mapping value.
[0078] S103, determining a first query condition according to the first random number and the second random number;
[0079] Specifically, two random numbers are randomly selected on the terminal device, and the first query condition is obtained according to the two random numbers.
[0080] S104, sending the first query condition to the server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database;
[0081] Specifically, the first query condition is encrypted using the server-side public key to obtain the second query condition, the terminal device sends the second query condition to the server, the server decrypts the second query condition to obtain the third query condition, and queries the pre-stored database based on the third query condition to obtain a third pseudo-random value set corresponding to the third query condition, and sends the third pseudo-random value set to the client terminal.
[0082] S105: Determine whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set.
[0083] The terminal device compares the first mapping value with the pseudo-random value in the third pseudo-random value set. If the first mapping value exists in the third pseudo-random value set, it means that the target retrieval data corresponding to the first search keyword can be further obtained, that is, by further performing an inadvertent keyword retrieval process with the server, the corresponding target retrieval data can be obtained.
[0084] Some embodiments of the present application map the search keywords, and the query conditions are also determined based on random numbers, and then a set of pseudo-random values is calculated. A judgment is made based on the mapped values and the set of pseudo-random values to obtain target search data corresponding to the search keywords, thereby avoiding leakage of key information, optimizing the search process, and improving search efficiency.
[0085] Another embodiment of the present application further supplements the keyword search method provided in the above embodiment.
[0086] Optionally, determining whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set includes:
[0087] If the third pseudo-random value set matches the first mapping value, the target search data corresponding to the first search keyword can be obtained;
[0088] If the third pseudo-random value set does not match the first mapping value, the target search data corresponding to the first search keyword cannot be obtained.
[0089] Some embodiments of the present application determine whether the retrieved result contains target retrieval data by comparing the first mapping value with the pseudo-random number in the pseudo-random value set, thereby improving the accuracy of determining whether the target retrieval data exists, while protecting privacy and security during the judgment process.
[0090] The embodiment of the present application includes a client terminal (Client) and a server (Server). The client terminal acts as the querying party and initiates an anonymous query. The server responds to the query and returns the query result.
[0091] 1. Initialization phase
[0092] (1) The server and client generate public and private key pairs respectively. The public and private key pair of the server is denoted as (sk S ,pk S ), the public and private key pair of the client terminal is recorded as (sk C ,pk C ).
[0093] (2) The client terminal and the server negotiate to determine which oblivious pseudo-random function OPRF to use k (·) protocol, where k is the key corresponding to the oblivious pseudo-random function, and the OPRF protocol needs to have a specific blinding function Blind(·) and deblinding function deBlind(·). Currently, many OPRF protocols define protocol-specific deblinding mechanisms, and this application does not limit which OPRF protocol is used.
[0094] (3) Furthermore, to ensure the efficiency of keyword retrieval, the client terminal and the server negotiate to determine a range mapping function using OPRF k (·) After the pseudo-random value is calculated, the mapping function is used to map it to a value range, which is recorded as Scope.
[0095] To facilitate understanding of the technical solution described in this application, the function of the oblivious pseudo-random function (OPRF) is as follows: Figure 2 shown. Figure 2 In the example, the server inputs the data x it holds, and after OPRF calculation, the server obtains OPRF k(x), the client terminal obtains the key k for calculating the pseudo-random function value (depending on the different implementation methods of OPRF, the key k can also be generated by the client terminal). During this process, the server side does not know the key k held by the client terminal, and the client terminal does not know the calculation result OPRF obtained by the server side. k (x).
[0096] Optionally, determining, according to the first search keyword, a first mapping value corresponding to the first search keyword includes:
[0097] Determine, according to the first search keyword, a second search keyword corresponding to the first search keyword, and send the second search keyword to the server, so that the server determines, according to the second search keyword, a first pseudo-random number corresponding to the second search keyword;
[0098] According to the first pseudo-random number, a first mapping value corresponding to the first pseudo-random number is determined.
[0099] Specifically, assume that the keyword to be searched by the client terminal is q. Before performing the keyword search, the client terminal first communicates with the server to obtain a pseudo-random value r corresponding to q. q , the process is as follows:
[0100] (1) The client terminal selects a blinding factor r, uses the blinding factor to blind the first search keyword q, and then sends the blinded second search keyword Blind(q,r) to the server;
[0101] (2) After receiving the second search keyword Blind(q,r), the server calculates the first pseudo-random value r blind =OPRF k (Blind(q,r)), and the first pseudo-random value r blind Send to the client terminal;
[0102] (3) The client terminal uses the function deBLind(·) to calculate the first pseudo-random value r blind Perform deblinding processing to obtain the second pseudo-random value r corresponding to the search keyword q q .
[0103] Then, the client terminal uses a range mapping function to convert the second pseudo-random value into the first mapping value s q .
[0104] In some embodiments of the present application, due to the use of OPRF, even if the data owner returns a pseudo-random value or a mapping result corresponding to the pseudo-random value, the querying party cannot directly know the original data content, thereby protecting the data privacy of the data owner.
[0105] Optionally, determining, according to the first search keyword, a second search keyword corresponding to the first search keyword includes:
[0106] The first search keyword is blinded using a preset blinding factor to obtain a blinded second search keyword.
[0107] Some embodiments of the present application perform blind processing on search keywords, thereby protecting the query privacy of the query party and improving the security of the search process.
[0108] Optionally, sending the second query condition to the server so that the server determines a third pseudo-random value set corresponding to the third query condition according to the third query condition and a pre-stored database includes:
[0109] The first query condition is encrypted using a server-side public key to obtain a second query condition;
[0110] Sending the second query condition to the server, so that the server decrypts the second query condition according to the server-side private key to obtain a third query condition, searching in a pre-stored database according to the third query condition to obtain a first pseudo-random value set corresponding to the third query condition, and encrypting the first pseudo-random value set using the server-side public key to obtain a second pseudo-random value set;
[0111] Receiving a second pseudo-random value set returned by the server;
[0112] The second pseudo-random value set is decrypted using the client terminal private key to obtain a decrypted third pseudo-random value set.
[0113] (1) In the encryption process, the client terminal selects two random numbers to generate a first query condition. For example, the first random number and the second random number are respectively denoted as a and nonce, satisfying:
[0114]
[0115] Then, the client terminal uses the server public key pk S , encrypt the first random number and the second random number to obtain the encrypted second query condition c q =Enc(pk S ,(a,nonce)), and the second query condition c q Sent to the server.
[0116] (2) Decrypt the query and perform the retrieval: The server uses its own private key sk S Decrypt the second query condition c q , get the third query condition (a, nonce), and then in the preprocessed database D ′Search and find the set of elements that meet the conditions, that is, the first pseudo-random value set:
[0117] S={(s i ,x i )∈D′|s i ∈[a-nonce,a+nonce]}
[0118] (3) Returning a pseudo-random value: The server encrypts each element in the set of elements that meet the conditions using the server public key to obtain a second set of pseudo-random values, c S ={Enc(pk C ,s i )|(s i ,x i )∈S}, and the second pseudo-random value set c s Sent to the client terminal.
[0119] As an optional method, since anonymous query only needs to protect the query privacy of the client terminal, the server can calculate c′ s ={Enc[pk C ,(s i ,x i )]|(s i ,x i )∈S}, and c′ s Sent to the client terminal.
[0120] The client terminal uses its own private key sk C Decrypt the second pseudo-random value set c s , and obtain the third pseudo-random value set {s i}, and check the first mapped value s q ∈{s i} is true, if true, it means that the data that the client terminal wants to query exists in the database on the server side. Otherwise, it means that the data that the client terminal wants to query does not exist in the database on the server side, and the query process ends.
[0121] As an optional method, when only the query privacy of the client terminal needs to be protected (i.e., anonymous query), the client terminal uses its own private key sk C Decrypt c′ s , and obtain a pseudo-random value set {(s i ,x i )}, and check s q ∈{s i} is true, if true, then with s q The corresponding x q Otherwise, it means that the data that the client terminal wants to query does not exist in the server-side database, and the query process ends.
[0122] In some embodiments of the present application, the query conditions are obfuscated, and the query conditions and the set of pseudo-random values returned by the server are also encrypted during transmission, thereby protecting the query privacy of the querying party and ensuring the security of data transmission.
[0123] Optionally, the data in the pre-stored database is stored in the form of a key-value pair, and the key-value pair at least includes a mapping value corresponding to the keyword identifier and data corresponding to the keyword identifier.
[0124] If the original database on the server is not in the form of key-value pairs, first organize the original database into key-value pairs. In this way, the database on the server can be expressed as
[0125] D={(key1,x1),(key2,x2),…,(key n ,x n )}
[0126] On this basis, for each keyword key in database D i , the server side calculates the corresponding pseudo-random function value r i =OPRF k (key i ), and then use the range mapping function to map it to s i ∈Scope. Therefore, after preprocessing, the database on the server side can be organized into a new key-value pair format. The preprocessed database is recorded as
[0127] D′={(s1,x1),(s2,x2),…,(s n ,x n )}
[0128] The database in some embodiments of the present application stores key-value pairs of keyword identifiers and mapping values corresponding to the keyword identifiers, thereby improving the security of data storage.
[0129] Optionally, the method further comprises:
[0130] Add new data to the database or delete original data.
[0131] When database D ′ When dynamic changes occur (such as adding or deleting elements), the server needs to re-preprocess the changed parts in the following way:
[0132] (1) Adding elements: For the newly added element (key new ,x new ), calculate the key new The corresponding pseudo-random value r new=OPRF k (key new ), and further r new Mapping to s new , then (s new ,x new ) is added to the database D′.
[0133] (2) Data change: When an element x in the database D′ i The value of becomes x′ i When changing s directly i The corresponding numerical value is sufficient.
[0134] (3) Delete elements: directly from database D ′ Remove the pseudo-random value pair (s) corresponding to the data element del ,x del ).
[0135] Some embodiments of the present application support dynamic updating of the database, including adding, modifying and deleting elements. The data owner only needs to re-preprocess the changed parts and generate pseudo-random values corresponding to the query keywords for the query party, so as to ensure the keyword-based query process on the dynamically changing database.
[0136] When the client terminal verifies that the data that the client terminal wants to query exists in the server's database, the client terminal uses s q Reuse the existing casual keyword search (OKS) technology to obtain the desired query results. The casual keyword search needs to protect the query privacy of the client terminal and the data privacy of the server. In this application, there is no limitation on which casual keyword search technology is used.
[0137] For example, suppose there is a dynamic medical database containing patients' medical records, and it is hoped that doctors can retrieve specific medical records while protecting the doctor's query privacy and the patient's privacy information. Therefore, it is necessary to use casual keyword retrieval.
[0138] This scenario involves a doctor and the corresponding doctor end, as well as a database administrator and the corresponding database administrator end. Therefore, in order to determine whether the medical records that the doctor wants to retrieve exist in the medical database, the following steps can be taken:
[0139] 1. System initialization: The medical database administrator (data owner) and the doctor (query party) generate their own public and private key pairs locally. O ,pk O ) and (sk Q ,pk Q ).
[0140] 2. Data preprocessing: The medical database contains the medical records of patients. Each record has a unique identifier (i.e., key value, such as patient ID, etc.) and related medical information (i.e., value). The database administrator uses the oblivious pseudo-random function OPRF to process the unique identifier, generate the corresponding pseudo-random value, and then uses the range mapping function to map the pseudo-random value to a range, and associates the mapped data with the corresponding medical information for storage.
[0141] 3. Dynamic update of database: When a new patient's medical record is added to the database, or an existing patient's record is updated, the database administrator inputs the updated content into the database administrator side, and the database administrator side re-performs the OPRF-based preprocessing process as described in the above scheme for these changed parts.
[0142] 4. Query process:
[0143] (1) Doctor-initiated query: When a doctor wants to query the medical records of a specific patient q, he inputs q into the doctor side, which generates a blinding factor r and sends Blind(q,r) to the database administrator side, which calculates the corresponding r blind And send it to the doctor, who will perform deblinding and get r q , and further mapped to s q Then, the doctor selects two random values a and nonce to satisfy s q ∈[a-nonce,a+nonce], which is used to ensure the anonymity of the query. Then, the doctor uses the public key pk O Encrypt the query condition (such as the combination of a and nonce value) to obtain the encrypted query request c q The doctor will c q Sent to the database administrator.
[0144] (2) The database administrator (server) processes the query: The database administrator receives the encrypted query request c q Then, use your own private key sk O Decryption is performed to obtain the query condition (e.g., a and nonce value combination). The database administrator then searches the preprocessed database for the s associated with the query condition. i Values, and use these values with the doctor's public key pk Q The data is encrypted and sent to the doctor.
[0145] 5. Doctors decrypt and obtain records: Doctors receive the encrypted i After the value, use your own private key skQ Decrypt them. Then, the doctor determines the patient s to be queried q Is there any i If the value exists, the corresponding medical record is found and obtained by further performing an inadvertent keyword search process with the database administrator, and finally the medical record is displayed on the doctor's side for the doctor to review.
[0146] The technical effects of the embodiments of the present application are as follows:
[0147] (1) Privacy protection: Use two selected random values to hide the real search keywords, so that the data owner cannot know the query intention of the query party, and protect the query privacy of the query party. Then, the query party determines whether the keyword it wants to query exists in the database of the data owner based on the database returned by the data owner, thereby determining the existence of the query keyword and providing a basis for determining whether to further initiate a keyword-based search process.
[0148] Due to the use of OPRF, even if the data owner returns a pseudo-random value or a mapping result corresponding to the pseudo-random value, the querying party cannot directly know the original data content, thereby protecting the data privacy of the data owner. At the same time, the query conditions are obfuscated and encrypted during transmission, thereby protecting the query privacy of the querying party.
[0149] (2) Database dynamics support: Based on OPRF, the newly added data is processed and the modification and deletion of data in the database are supported, thereby realizing dynamic database updates. On this basis, when judging the existence of keywords, the pseudo-random value of the query party is also generated by the data owner, and then the existing casual keyword retrieval method is reused, thereby realizing a keyword-based retrieval process that supports dynamic database updates.
[0150] The solution supports dynamic updates of the database, including adding, changing, and deleting elements. The data owner only needs to re-preprocess the changed parts and generate pseudo-random values corresponding to the query keywords for the query party, thus ensuring the keyword-based query process on the dynamically changing database.
[0151] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0152] Another embodiment of the present application provides a keyword search device, which is used to execute the keyword search method provided in the above embodiment.
[0153] like Figure 3, which is a schematic diagram of the structure of a keyword search device provided in an embodiment of the present application. The keyword search device includes an acquisition module 301, a mapping module 302, a query module 303, a determination module 304 and a search module 305, wherein:
[0154] The acquisition module 301 is used to acquire a first search keyword;
[0155] The mapping module 302 is used to determine a first mapping value corresponding to the first search keyword according to the first search keyword;
[0156] The query module 303 is used to determine a first query condition according to the first random number and the second random number;
[0157] The determination module 304 is used to send the first query condition to the server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database;
[0158] The search module 305 is used to determine whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set.
[0159] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0160] Some embodiments of the present application map the search keywords, and the query conditions are also determined based on random numbers, and then a set of pseudo-random values is calculated. A judgment is made based on the mapped values and the set of pseudo-random values to obtain target search data corresponding to the search keywords, thereby avoiding leakage of key information, optimizing the search process, and improving search efficiency.
[0161] Another embodiment of the present application further supplements the keyword search device provided in the above embodiment.
[0162] Optionally, a retrieval module is used to:
[0163] If the third pseudo-random value set matches the first mapping value, it is determined that the target search data corresponding to the first search keyword can be obtained;
[0164] If the third pseudo-random value set does not match the first mapping value, the target search data corresponding to the first search keyword cannot be obtained.
[0165] Some embodiments of the present application determine whether the retrieved result contains target retrieval data by comparing the first mapping value with the pseudo-random number in the pseudo-random value set, thereby improving the accuracy of determining whether the target retrieval data exists, while protecting privacy and security during the judgment process.
[0166] Optionally, a mapping module for:
[0167] Determine, according to the first search keyword, a second search keyword corresponding to the first search keyword, and send the second search keyword to the server, so that the server determines, according to the second search keyword, a first pseudo-random number corresponding to the second search keyword;
[0168] According to the first pseudo-random number, a first mapping value corresponding to the first pseudo-random number is determined.
[0169] In some embodiments of the present application, due to the use of OPRF, even if the data owner returns a pseudo-random value or a mapping result corresponding to the pseudo-random value, the querying party cannot directly know the original data content, thereby protecting the data privacy of the data owner.
[0170] Optionally, a mapping module for:
[0171] The first search keyword is blinded by using a preset blinding factor to obtain a second search keyword.
[0172] Some embodiments of the present application perform blind processing on search keywords, thereby protecting the query privacy of the query party and improving the security of the search process.
[0173] Optionally, a module is determined to:
[0174] The first query condition is encrypted using a server-side public key to obtain a second query condition;
[0175] Sending the second query condition to the server, so that the server decrypts the second query condition according to the server-side private key to obtain a third query condition, searching in a pre-stored database according to the third query condition to obtain a first pseudo-random value set corresponding to the third query condition, and encrypting the first pseudo-random value set using the server-side public key to obtain a second pseudo-random value set;
[0176] Receiving a second pseudo-random value set returned by the server;
[0177] The second pseudo-random value set is decrypted using the client terminal private key to obtain a decrypted third pseudo-random value set.
[0178] In some embodiments of the present application, the query conditions are obfuscated, and the query conditions and the set of pseudo-random values returned by the server are also encrypted during transmission, thereby protecting the query privacy of the querying party and ensuring the security of data transmission.
[0179] Optionally, the data in the pre-stored database is stored in the form of a key-value pair, and the key-value pair at least includes a mapping value corresponding to the keyword identifier and data corresponding to the keyword identifier.
[0180] The database in some embodiments of the present application stores mapping values corresponding to keyword identifiers and data corresponding to keyword identifiers, thereby improving the security of keyword identifier storage and ensuring that the database can support keyword judgment and retrieval processes.
[0181] Optionally, the acquisition module is also used to:
[0182] Add new data to the database or delete original data.
[0183] Some embodiments of the present application support dynamic updating of the database, including adding, modifying and deleting elements. The data owner only needs to re-preprocess the changed parts and generate pseudo-random values corresponding to the query keywords for the query party, so as to ensure the keyword-based query process on the dynamically changing database.
[0184] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0185] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0186] The embodiments of the present application further provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the operation of the method corresponding to any embodiment of the keyword search method provided in the above embodiments can be implemented.
[0187] An embodiment of the present application further provides a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, the operation of the method corresponding to any embodiment of the keyword retrieval method provided in the above embodiments can be implemented.
[0188] like Figure 4 As shown, some embodiments of the present application provide an electronic device 400, which includes: a memory 410, a processor 420, and a computer program stored in the memory 410 and executable on the processor 420, wherein the processor 420 can implement a method of any embodiment included in the above-mentioned keyword retrieval method when reading the program from the memory 410 through a bus 430 and executing the program.
[0189] Processor 420 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 420 can be a microprocessor.
[0190] The memory 410 may be used to store instructions executed by the processor 420 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 420 of the disclosed embodiment may be used to execute instructions in the memory 410 to implement the method shown above. The memory 410 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.
[0191] The above are only embodiments of the present application and are not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0192] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0193] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A keyword search method, characterized in that: Applied to a client terminal, the method comprises: Obtaining a first search keyword; Determining, according to the first search keyword, a first mapping value corresponding to the first search keyword; Determine a first query condition according to the first random number and the second random number; Sending the first query condition to a server, so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database; It is determined whether target search data corresponding to the first search keyword can be obtained according to the first mapping value and the third pseudo-random value set.
2. The keyword search method according to claim 1, characterized in that: The determining, based on the first mapping value and the third pseudo-random value set, whether target search data corresponding to the first search keyword can be obtained includes: If the third pseudo-random value set matches the first mapping value, the target search data corresponding to the first search keyword can be obtained; If the third pseudo-random value set does not match the first mapping value, the target search data corresponding to the first search keyword cannot be obtained.
3. The keyword search method according to claim 1, characterized in that: The determining, according to the first search keyword, a first mapping value corresponding to the first search keyword includes: Determine, according to the first search keyword, a second search keyword corresponding to the first search keyword, and send the second search keyword to a server, so that the server determines, according to the second search keyword, a first pseudo-random number corresponding to the second search keyword; According to the first pseudo-random number, a first mapping value corresponding to the first pseudo-random number is determined.
4. The keyword search method according to claim 3, characterized in that: The step of determining, based on the first search keyword, a second search keyword corresponding to the first search keyword includes: The first search keyword is blinded by using a preset blinding factor to obtain a second search keyword.
5. The keyword search method according to claim 1, characterized in that: The sending the first query condition to the server so that the server determines a third pseudo-random value set corresponding to the first query condition according to the first query condition and a pre-stored database, includes: The first query condition is encrypted using a server-side public key to obtain a second query condition; Sending the second query condition to the server, so that the server decrypts the second query condition according to the server-side private key to obtain a third query condition, searching in a pre-stored database according to the third query condition to obtain a first pseudo-random value set corresponding to the third query condition, and encrypting the first pseudo-random value set using the server-side public key to obtain a second pseudo-random value set; Receiving a second pseudo-random value set returned by the server; The second pseudo-random value set is decrypted using the client terminal private key to obtain a decrypted third pseudo-random value set.
6. The keyword search method according to claim 1, characterized in that: The data in the pre-stored database is stored in the form of a key-value pair, and the key-value pair at least includes a mapping value corresponding to a keyword identifier and data corresponding to the keyword identifier.
7. The keyword search method according to claim 6, characterized in that: The method further comprises: New data is added to the database or original data is deleted.
8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the keyword search method described in any one of claims 1 to 7 when executing the program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the program, when executed by a processor, can implement the keyword search method described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, wherein: When the computer program is executed by a processor, it can implement the keyword search method described in any one of claims 1 to 7.