Data query method, device and electronic equipment

By introducing a data query method in the retrieval system, determining the query method based on the query information entered by the user, and conducting anonymous query in the data holder server, the privacy data leakage problem caused by the visible data query information in the prior art is solved, and the data is secure, accurate and flexible.

CN119739909APending Publication Date: 2025-04-01AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411920479.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

During the data query process, it is difficult for the existing technology to realize anonymous query of data, resulting in the risk of private data or important data leakage of data holders, and it is unable to adapt to the user's flexible and changeable query needs.

Method used

By introducing a data query method in the retrieval system, the query method is determined based on the query information input by the user. If it is the first query method, an anonymous query will be performed directly; if not, the location of the data in the server will be determined, and the data will be obtained using the anonymous query method. The method includes obtaining an index list, encrypting the index information, obtaining the encrypted data from the data holder server and decrypting it to obtain the original data.

Benefits of technology

It realizes the security of data query information while ensuring the accuracy and availability of data, adapting to multiple user query methods, and improving the security of data between the retrieval system and user equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739909A_ABST
    Figure CN119739909A_ABST
Patent Text Reader

Abstract

The present application provides a data query method, device and electronic device, which relates to the field of data security technology and is used to improve the security of data. The method is applied to a first server in a retrieval system, and the first server is any server in the retrieval system; the method includes: according to the query information input by the user, determining whether the query method indicated by the query information is the first query method, and the query information is also used to indicate the acquisition of the first data; if the query method is the first query method, querying the first data according to the first query method and the first position indicated by the query information, and acquiring the first data from the second server, the second server is the data holder of the first data in the retrieval system; if the query method is not the first query method, determining the first position of the first data in the second server according to the query information, and querying the first data according to the first position and the first query method, and acquiring the first data from the second server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data security technology, and in particular to a data query method, device and electronic device. Background Art

[0002] With the rapid development of Internet technology, the importance of information security has become increasingly prominent. Especially in the field of data query, when using common data query methods to query data, the data query information is visible to the data holder. In the fields of business, technology, etc., data sharing between various institutions can easily lead to improper commercial competition when the data query information is visible. In particular, when the data query information involves the user's private data or important data, there is also a risk of private data or important data leakage.

[0003] Therefore, anonymous data query is particularly important. Among them, anonymous query can protect the security of data query information while ensuring the accuracy and availability of data by anonymizing the query information, and data sharing between institutions is also safer. However, in the retrieval system, in order to meet the flexible and changeable query needs of users, a variety of query methods are provided, and the simple anonymous query method is not applicable in the retrieval system. Summary of the invention

[0004] The present application provides a data query method, device and electronic device for improving data security.

[0005] In a first aspect, an embodiment of the present application provides a data query method, which is applied to a first server in a retrieval system, wherein the first server is any server in the retrieval system; the method comprises: determining, based on query information input by a user, whether the query method indicated by the query information is a first query method, and the query information is also used to indicate the acquisition of first data; if the query method is the first query method, performing an anonymous query on the first data according to the first query method and the first position indicated by the query information, and acquiring the first data from a second server, which is the data holder of the first data in the retrieval system; if the query method is not the first query method, determining, based on the query information, the first position of the first data in the second server, and performing an anonymous query on the first data according to the first position and the first query method, and acquiring the first data from the second server.

[0006] In an embodiment of the present application, the first server can determine whether it is the first query method based on the query information input by the user. If it is the first query method, an anonymous query can be performed directly. If it is not the first query method, after determining the first location based on the query information, the anonymous query is performed using the first query method and the first location, so that the anonymous query can be applicable to multiple query methods of the user, thereby improving the security of the data between the retrieval system and the user device.

[0007] In a possible implementation, an anonymous query is performed on the first data according to the first position and the first query method, and the first data is obtained from the second server, including: obtaining an index list corresponding to the first data according to the query information; encrypting each index information in the index list based on a preset homomorphic encryption algorithm to obtain a first encryption vector, wherein the encryption element of the first index information is different from the encryption element of other index information in the index list, and the first index information is the index information corresponding to the first position in the index list; sending the first encryption vector to the second server; receiving first encrypted data from the second server, the first encrypted data being the result of an operation of the first encryption vector and the second encryption vector, and the second encryption vector being obtained by the second server encrypting the retrieval result corresponding to each index information in the index list using the homomorphic encryption algorithm; decrypting the first encrypted data based on a pre-stored key to obtain the first data.

[0008] In a possible implementation, the query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data; determining the first position of the first data in the second server according to the query information includes: sending the file name to the second server; receiving a first string of multiple identifiers from the second server, the first string being concatenated from a second string and a third string, the second string being a partial hash string of an identifier, and the third string being obtained by performing cryptographic hash function processing on the remaining hash string of the identifier; determining a candidate identifier matching the second string with a fourth string from the multiple identifiers, the fourth string being a part of the hash string of the first identifier, and the fourth string having the same length as the second string; performing cryptographic hash function processing on a fifth string based on a verification factor carried in the third string to obtain a sixth string, the fifth string being a string in the hash string of the first identifier excluding the fourth string; determining, according to the sixth string, a target identifier matching the third string with the sixth string from the candidate identifiers; and determining the arrangement position of the target identifier in the multiple identifiers as the first position.

[0009] In a possible implementation, the query information is also used to indicate the query conditions of the first data; based on the query information, determining the first position of the first data in the second server includes: determining that the query conditions of the first data correspond to a first number of obfuscation conditions that need to be generated based on a correspondence between pre-stored query conditions and quantities, the first number being related to a security level of the query conditions; generating the first number of obfuscation conditions based on a query field in the query conditions; inserting the query conditions into the first number of obfuscation conditions, and recording the first position of the query conditions in all conditions, the all conditions including the query conditions and the first number of obfuscation conditions.

[0010] In a possible implementation, generating a first number of obfuscation conditions based on a query field in the query condition includes: sending the query field to the second server; receiving the mean, variance, maximum value, and minimum value of the data corresponding to the query field sent from the second server; judging whether the query condition meets the query range based on the maximum value and the minimum value; if the query condition meets the query range, generating the first number of random numbers based on the mean, the variance, the maximum value, and the minimum value; randomly generating the first number of relational operators; generating the first number of obfuscation conditions based on the query field, the first number of random numbers, and the first number of relational operators.

[0011] In a second aspect, an embodiment of the present application provides a data query device, which is applied to a first server of a retrieval system, wherein the first server is any server in the retrieval system; the device comprises: a determination module, which is used to determine, based on query information input by a user, whether the query method indicated by the query information is a first query method, and the query information is also used to indicate the acquisition of first data; a query module, which is used to, if the query method is the first query method, perform an anonymous query on the first data according to the first query method and the first position indicated by the query information, and acquire the first data from a second server, wherein the second server is the data holder of the first data in the retrieval system; the query module is also used to determine, if the query method is not the first query method, the first position of the first data in the second server according to the query information, and perform an anonymous query on the first data according to the first position and the first query method, and acquire the first data from the second server.

[0012] In a possible implementation, the query module is specifically used to: obtain an index list corresponding to the first data according to the query information; encrypt each index information in the index list based on a preset homomorphic encryption algorithm to obtain a first encryption vector, wherein the encryption element of the first index information is different from the encryption element of other index information in the index list, and the first index information is the index information corresponding to the first position in the index list; send the first encryption vector to the second server; receive first encrypted data from the second server, the first encrypted data is the operation result of the first encryption vector and the second encryption vector, and the second encryption vector is obtained by the second server using the homomorphic encryption algorithm to encrypt the retrieval result corresponding to each index information in the index list; decrypt the first encrypted data based on a pre-stored key to obtain the first data.

[0013] In a possible implementation, the query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data; the query module is specifically used to: send the file name to the second server; receive a first string of multiple identifiers from the second server, the first string is concatenated by a second string and a third string, the second string is a partial hash string of an identifier, and the third string is obtained by performing cryptographic hash function processing on the remaining hash string of the identifier; determine a candidate identifier that matches the second string with a fourth string from the multiple identifiers, the fourth string is a part of the hash string of the first identifier, and the fourth string has the same length as the second string; perform cryptographic hash function processing on the fifth string based on the verification factor carried in the third string to obtain a sixth string, the fifth string is a string in the hash string of the first identifier except the fourth string; determine, based on the sixth string, a target identifier that matches the third string with the sixth string from the candidate identifiers; and determine the arrangement position of the target identifier in the multiple identifiers as the first position.

[0014] In a possible implementation, the query information is also used to indicate the query conditions of the first data; the query module is specifically used to: determine, based on a correspondence between pre-stored query conditions and quantities, that the query conditions of the first data correspond to a first number of obfuscation conditions that need to be generated, wherein the first number is related to a security level of the query conditions; generate the first number of obfuscation conditions based on a query field in the query conditions; insert the query conditions into the first number of obfuscation conditions, and record the first position of the query conditions in all conditions, wherein all conditions include the query conditions and the first number of obfuscation conditions.

[0015] In a possible implementation, the query module is specifically used to: send the query field to the second server; receive the mean, variance, maximum value and minimum value of the data corresponding to the query field sent from the second server; determine whether the query condition meets the query range based on the maximum value and the minimum value; if the query condition meets the query range, generate the first number of random numbers based on the mean, the variance, the maximum value and the minimum value; randomly generate the first number of relational operators; generate the first number of obfuscation conditions based on the query field, the first number of random numbers and the first number of relational operators.

[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method described in the first aspect and any possible implementation manner by executing the instructions stored in the memory.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed on a computer, the computer executes the method described in the first aspect and any possible implementation manner.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed on a computer, enables the method described in the first aspect and any possible implementation method to be implemented.

[0019] The beneficial effects of the second to fifth aspects can be referred to the contents described in the first aspect above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of an application scenario of a data query method provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of a data query method provided in an embodiment of the present application Figure 1 ;

[0022] Figure 3 A schematic diagram of a data query method provided in an embodiment of the present application Figure 2 ;

[0023] Figure 4 A schematic diagram of a data query method provided in an embodiment of the present application Figure 3 ;

[0024] Figure 5 A schematic diagram of a data query method provided in an embodiment of the present application Figure 4 ;

[0025] Figure 6 A schematic diagram of the structure of a data query device provided in an embodiment of the present application;

[0026] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0028] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0029] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0030] The following is an explanation of some of the terms involved in the embodiments of the present application.

[0031] 1. Anonymous query, also known as private information retrieval (PIR), is a query method in secure multi-party computing technology. It was proposed by Chor B et al. in 1955 to protect the privacy of user queries. The purpose is to obtain target data from the data holder under the premise of ensuring the confidentiality of the query conditions of the query party. That is, for the data holder, the correct query results can be returned without knowing the query conditions of the query party.

[0032] Please refer to Figure 1 , is a schematic diagram of an application scenario of a data query method provided in an embodiment of the present application. Figure 1 As shown, the schematic diagram includes a retrieval system 110 and a user device 120, and the retrieval system 110 includes at least a first server 111 and a second server 112. The first server 111 and the second server 112 can perform wired or wireless communication, and the first server 111 and the second server 112 can perform wired or wireless communication with the user device 120.

[0033] The user device 110 may refer to a terminal device or server used by a user to initiate a data query request, and the terminal device includes but is not limited to a mobile phone, a personal computer (PC), a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal device in industrial control, a wireless terminal device in unmanned driving, a wireless terminal device in a smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc. The retrieval system 110 may be a server cluster with data storage capabilities and data retrieval capabilities. The retrieval system 110 is, for example, a file retrieval system, wherein the file retrieval system is an application system based on multiple servers, and each data holder has an independent application server. It should be understood that each server in the retrieval system 110 can be either a data holder or a data queryer. In particular, in the embodiment of the present application, the first server 111 is a data queryer and the second server 112 is a data holder.

[0034] It should be noted that in the embodiments of the present application, Figure 1The retrieval system 110 is illustrated as including a first server 111 and a second server 112 , but in fact the retrieval system 110 may also include a greater number of servers, which is not limited in the embodiments of the present application.

[0035] Exemplarily, a user may input query information in the user device 120. The user device 120 obtains the query information input by the user and sends it to the first server 111 in the retrieval system 110. The first server 111 determines whether the query method indicated by the query information is the first query method based on the query information. If it is the first query method, an anonymous query is performed on the first data based on the first query method and the first position indicated by the query information, and then the first data is obtained from the second server 112, which is the data holder of the first data. If it is not the first query method, the first position of the first data in the second server 112 is determined based on the query information, and then an anonymous query is performed on the first data based on the first position and the first query method, and the first data is obtained from the second server 112. The specific implementation method of the first server 111 obtaining the first data will be described in detail below.

[0036] Please refer to Figure 2 , is a flow chart of a data query method provided in an embodiment of the present application. The following is a flowchart of a first server in a retrieval system executing Figure 2 The steps shown are described in detail, and the retrieval system is, for example, Figure 1 The retrieval system 110 shown in FIG. 1 includes a first server such as Figure 1 The first server 111 shown, Figure 2 The second server involved is, for example, Figure 1 A second server 112 is shown.

[0037] S201, determining, based on query information input by a user, whether a query mode indicated by the query information is a first query mode, where the query information is also used to indicate obtaining first data.

[0038] The query information may be sent by the user to the first server via a user device, such as Figure 1 The user device 120 is shown. The query method includes but is not limited to: index query, keyword / word query, condition query, etc. The first query method is a query method based on location query, such as index query.

[0039] After the first server obtains the query information, the query method indicated by the query information can be determined according to the query information. Specifically, the first server can determine the query method according to the query condition included in the query information. For example, if the query information is the index number of the first data, it can be determined that the query method indicated by the query information is an index query. If the query information is the data identifier of the first data, it can be determined that the query method indicated by the query information is a keyword query. If the query information is a query condition including a relational operator, it can be determined that the query method indicated by the query information is a conditional query.

[0040] Based on this, the first server can determine whether the query method indicated by the query information is the first query method. If the first server determines that the query method indicated by the query information is the first query method, S202 is executed; if the first server determines that the query method indicated by the query information is not the first query method, S203 is executed.

[0041] S202, performing an anonymous query on the first data according to the first query method and the first location indicated by the query information, and obtaining the first data from the second server, which is the data holder of the first data in the retrieval system.

[0042] Since the first query method is a location-based query method, when the query method indicated by the query information is the first query method, the first server can perform an anonymous query on the first data based on the first location and the first query method indicated in the query information.

[0043] The following describes a specific implementation method of the first server querying the first data according to the first location indicated by the query information.

[0044] The first server obtains an index list corresponding to the first data according to the query information. In this implementation, the index list stores metadata information of the data stored in the second server, or in other words, in this case, the index list here is a metadata list of the data stored in the second server, and the metadata list includes information such as file name, file description, number of rows, number of columns, field name, field data type, etc. The index list is sent by the second server to the first server.

[0045] Exemplarily, taking the retrieval system as a file retrieval system, when a user uploads file data to the second server for storage, the second server needs to read metadata information from the file data and send the metadata information to other servers (including the first server) of the file retrieval system. After receiving the metadata information, the other servers save it to the database and record the source of the data. Correspondingly, the second server encrypts the file data uploaded by the user and stores it in the database through the pre-stored user key and symmetric encryption algorithm. The file data can be unstructured data or structured data, such as csv, excel, etc.

[0046] The first position indicated in the query information is the position of the first index information included in the query information in the index list. Exemplarily, when a user queries data, the index list can be viewed in the display interface of the user device, and the user can select the first index information of the first data to be queried in the index list, and the position of the first index information in the index list is the first position.

[0047] Further, the first server encrypts each index information in the index list according to a preset homomorphic encryption algorithm to obtain a first encryption vector. When encrypting the first index information in the index list, the first server uses an encryption element different from other index information in the index list, that is, the encryption element of the first index information is different from the encryption element of other index information in the index list. For example, the first server uses the function E in the homomorphic encryption algorithm to encrypt the index list, and the index list includes n index information, wherein the first index information is the i-th one, then the dimension of the encryption vector is n, and the number 1 is used to represent the encryption element of the first index information, and the number 0 is used to represent the encryption element of other index information, then the first index information of the i-th dimension can be represented as E(1), and the other index information can be represented as E(0), that is, the first server encrypts the numbers 0 and 1, and the first index information corresponds to the value encrypted to 1, and the other index information corresponds to the value encrypted to 0. The first encryption vector can be exemplified as {E(0), ..., E(0), E(1), E(0), ... E(0)}, wherein E(1) is located in the i-th dimension of the encryption vector. It should be noted that homomorphic encryption can produce different results for the same integer, i.e., the encrypted values ​​for 0 are different. The second server or other device cannot determine which is the first index information from the encrypted vector.

[0048] The first server sends the first encryption vector to the second server. Correspondingly, the second server receives the first encryption vector from the first server. The second server can obtain a pre-stored index list, and according to the arrangement order of the index information in the index list, obtain the search result of each index information from the database in turn and decrypt the search result using the pre-stored user key, and homomorphically encrypt the decrypted search result in turn according to the arrangement order of the index information through a preset homomorphic encryption algorithm to obtain a second encryption vector.

[0049] Exemplarily, after receiving the first encryption vector, the second server copies the file corresponding to each metadata in the metadata list to a temporary directory in the order of the metadata list, decrypts the file using the pre-stored user key, and then reads the binary data of the file into the memory, which is represented by a vector (F1, ..., F i ,…F n ), after encrypting the file vector using the homomorphic encryption algorithm and the pre-stored public key, the second encrypted vector is obtained, which can be expressed as {E(F1),…,E(F i ),…E(F n )}. The public key is sent by the first server to the second server.

[0050] The second server operates the first encryption vector and the second encryption vector, specifically, it can calculate the scalar product of the first encryption vector and the second encryption vector to obtain the first encrypted data. For example, based on the properties of homomorphic encryption, the scalar product of the first encryption vector and the second encryption vector can be expressed as follows:

[0051] ∑E i E(F i )=E(0)E(F1)+…+E(1)E(F i )+…+E(0)E(F n )

[0052] =E(0×F1+…+1×F i +…+0×F n )=E(F i )

[0053] The second server sends the first encrypted data to the first server. Correspondingly, the first server receives the first encrypted data from the second server. The first server can decrypt the first encrypted data based on the pre-stored key to obtain the first data. It should be noted that the key used to encrypt data between the second server and the first server is a pair of asymmetric keys (public key and private key), and is generated by the first server. Specifically, before querying the first data, the first server temporarily generates a pair of public and private keys, and sends the public key to the second server, so that the second server obtains the first encrypted data based on the public key, and then the first server can use the pre-stored private key to decrypt the first encrypted data. In an embodiment of the present application, the key pre-stored by the first server is the private key generated by the first server.

[0054] In a possible implementation, after the first server obtains the first data from the second server, the first data may be encrypted and stored, so that the user can decrypt, download, and view the first data at any time from the first server through a user device.

[0055] S203: Determine a first location of the first data in the second server according to the query information, perform an anonymous query on the first data according to the first location and the first query method, and obtain the first data from the second server.

[0056] When the query method indicated by the query information is not the first query method, it is necessary to first determine the first location of the first data in the second server according to the query information, and then use the first query method to perform an anonymous query on the first data. There may be multiple query methods indicated by the query information. For example, when a user wants to query the data corresponding to an identity document (ID) in a certain file, the query method is a keyword query, which can be specifically referred to as an ID query method. When a user wants to query data that meets certain conditions (such as age greater than 18 years old and less than 50 years old), the query method is a conditional query.

[0057] Of course, different query methods have different specific implementations for the first server to determine the first position. The following takes the two query methods of ID query and condition query in keyword query as examples to illustrate the specific implementations of the first server determining the first position of the first data in the second server.

[0058] 1. ID query.

[0059] In this implementation, the query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data. The first identifier is, for example, a code that uniquely identifies a piece of data, such as an ID number, a mobile phone number, or a taxpayer identification code. In other words, the first identifier is a unique identification number for each piece of data in the first file.

[0060] Specifically, the first server sends the file name of the first file to the second server to inform the second server that the first data belongs to the first file. Correspondingly, the second server receives the file name from the first server. The second server obtains the first file from the database based on the file name, and sorts the data in the first file according to the identifier of each data, and reads the identifier of each data in the first file in sequence from the sorted first file to obtain multiple identifiers. The hash value of each identifier in the multiple identifiers is calculated, that is, the hash string of each identifier is obtained. In order to further improve the security of the hash string of each identifier, for example, to reduce the risk of rainbow table brute force cracking hash values, the second server selects a string of a preset length from the hash string of each identifier from left to right as the second string, wherein the preset length can be set according to actual needs, for example, 5≤k≤10, k is a preset length, k is a positive integer, and the specific length is randomly generated, which is not limited in the embodiment of the present application. The second server processes the hash string of each identifier from the remaining strings except the second string using a preset cryptographic hash function to obtain a third string, and the cryptographic hash function is, for example, a Bcrypt algorithm. The second character string and the third character string are concatenated to obtain the first character string of each identifier, and further to obtain the first character strings of multiple identifiers.

[0061] In a possible implementation, since each piece of data in the first file has multiple identifiers that can uniquely identify each piece of data, in this case, the first server also needs to send the query field corresponding to the first identifier to the second server so that the second server can accurately process multiple identifiers.

[0062] It should be noted that in the embodiment of the present application, the multiple identifiers read by the second server and the first strings of the multiple identifiers obtained by subsequent processing all have an arrangement order, and the arrangement order is the order in which the second server reads the identifier of each data from the sorted first file.

[0063] The second server sends the first character string of the multiple identifiers to the first server. Correspondingly, the first server receives the first character string of the multiple identifiers from the second server.

[0064] In order to prevent the first strings of the multiple identifiers from being disordered due to network communication reasons, the second server may generate the first strings of the multiple identifiers into a string list according to the arrangement order, and send the string list to the first server.

[0065] The first server can calculate the hash string of the first identifier according to the first identifier of the first data indicated by the query information. After the first server receives the first string of multiple identifiers from the second server, it can determine the candidate identifier that matches the second string and the fourth string from the multiple identifiers. The fourth string is a part of the hash string of the first identifier, and the length of the fourth string is the same as that of the second string. Furthermore, the first server performs a cryptographic hash function on the fifth string according to the verification factor carried in the third string to obtain the sixth string. The fifth string is the string in the hash string of the first identifier except the fourth string. Then, the first server determines the target identifier that matches the third string and the sixth string from the candidate identifiers according to the sixth string, and determines the arrangement position of the target identifier in the multiple identifiers as the first position. For example, if the target identifier is located at the 4th position among the multiple identifiers, the first position is the serial number 4.

[0066] Exemplarily, the string of each of the multiple identifiers can be represented as (h1+h2), and the hash string of the first identifier can be represented as (h3+h4). The first server can first match h3 with h1, and use the successfully matched identifier as a candidate identifier. Further, the first server extracts the verification factor from h2, and uses the verification factor to perform a cryptographic hash function on h4 to obtain h5. The first server matches h5 with h2 in the candidate identifier, and the identifier corresponding to the successfully matched string is the target identifier.

[0067] 2. Conditional query.

[0068] In this implementation, the query information is also used to indicate the query condition of the first data, and the query condition includes a relational operator, and the relational operator may include five types: greater than, less than, equal to, greater than or equal to, and less than or equal to. The query condition may include one or more relational operators, and multiple relational operators may be connected using conjunctions and or or.

[0069] Exemplarily, the user can select the file to be queried in the user device according to the pre-stored metadata list, and select the query field to be acted on by the relational operator, such as age, years of work, etc., and enter a value to generate a query condition. For example, the query condition is to query users who are older than 18 years old and younger than 50 years old, which can be expressed as Y>18 years old and Y<50 years old, where Y represents age.

[0070] Specifically, the first server determines that the query condition of the first data corresponds to the first number of obfuscation conditions that need to be generated based on the correspondence between the pre-stored query conditions and the quantity, and the first number is related to the security level of the query condition. Among them, multiple security levels are pre-configured in the first server, and different security levels correspond to different numbers of obfuscation conditions that need to be generated. For example, if the security level is 1, 9999 obfuscation conditions are generated, and if the security level is 2, 99999 obfuscation conditions are generated. The security level of the query condition can be determined based on the correspondence between the preset query condition and the security level, or the security level of the query condition can be determined based on the correspondence between the file to be queried corresponding to the query condition and the security level, and the embodiments of the present application do not limit this.

[0071] The first server may generate a first number of obfuscation conditions according to the query fields in the query conditions. Specifically, the specific method of generating the obfuscation conditions is as follows:

[0072] The first server may send a query field to the second server. Correspondingly, the second server receives the query field sent from the first server.

[0073] For example, taking the first file as an Excel file and the query field as age as an example, the data corresponding to the query field is illustrated. The Excel file is shown in Table 1 below.

[0074] Table 1

[0075] ID number Name age …… XXXXXX1 open** 25 …… XXXXXX2 plum** 13 …… XXXXXX3 king** 47 …… …… …… …… ……

[0076] As shown in Table 1 above, the values ​​corresponding to the query field "age" are {25, 13, 47, ...}.

[0077] The second server calculates the mean, variance, maximum value and minimum value corresponding to the query field based on the data corresponding to the query field. Among them, the second server calculates the mean and variance corresponding to the query field based on the data and the corresponding reference to the existing mean and variance calculation method, which will not be repeated in the embodiments of the present application. The maximum value in the data corresponding to the query field is such as "47" in Table 1, and the minimum value in the data corresponding to the query field is such as "13" in Table 1.

[0078] The second server sends the mean, variance, maximum and minimum values ​​corresponding to the query field to the first server. Correspondingly, the first server receives the mean, variance, maximum and minimum values ​​corresponding to the query field.

[0079] The first server determines whether the query condition meets the query range according to the maximum value and the minimum value. If it is determined that the query condition does not meet the query range, a prompt message is generated and fed back to the user device, and the prompt message indicates that the first data does not exist. If it is determined that the query condition meets the query range, a first number of random numbers is generated according to the mean, the variance, the maximum value and the minimum value.

[0080] For example, continuing to take the above Table 1 as an example, if the query condition indicates to query users under the age of 12, the minimum value in Table 1 is 13, 13>12, therefore, the first server determines that the query condition does not meet the query range, and can generate a prompt message to prompt the query personnel that the user data queried does not exist. For another example, the query condition indicates to query users between the ages of 18 and 45, the minimum value in Table 1 is 13, and the maximum value is 47. The first server determines that 13<18<47, 13<45<47, based on which, it can be determined that the query condition meets the query range.

[0081] When determining that the query condition meets the query range, the first server may calculate the query condition based on the mean μ, variance σ 2 , the maximum value ν and the minimum value ξ, generate a first number of random numbers. Specifically, the first server can generate a random number that satisfies the normal distribution (μ, σ) within the range of (ξ, ν). 2 ) to generate a first number of random numbers r. Further, the first server randomly generates a first number of relational operators, and the relational operators may include "=", ">", "<", "≥", and "≤". Finally, the first server may generate a first number of obfuscation conditions based on the query field, the first number of random numbers, and the first number of relational operators. Exemplarily, the query field is represented as f, the relational operator is represented as op, and the random number is represented as r, then the obfuscation condition may be represented as f-op-r, such as amount>1000.

[0082] After the first server generates the first number of obfuscation conditions, it can insert the query condition into the first number of obfuscation conditions and record the first position of the query condition in all conditions, which first position represents the first position of the subsequent query of the first data. It should be understood that all conditions here include the query condition and the first number of obfuscation conditions. Exemplarily, the obfuscation condition is expressed as {a1, a2, ..., an}, and the query condition is expressed as b. After the query condition is inserted into the obfuscation condition, all conditions can be expressed as {a1, a2, ..., b, ..., an}. At this time, the number of all conditions is n+1.

[0083] In other words, in the case of ID query, the index list is the list of serial numbers corresponding to multiple identifiers received by the first server, and the first position is the position of the target identifier in the list of serial numbers. In the case of condition query, the index list is the list of serial numbers corresponding to all conditions generated by the first server, and the first position is the position of the query condition in all conditions.

[0084] After determining the first location, the first server can query the first data according to the first location and the first query method. The way in which the first server queries the first data according to the first location and the first query method can correspond to the content recorded in the above step S202, which will not be repeated here.

[0085] In a possible implementation, after the first server obtains the first data from the second server, the first data may be encrypted and stored, so that the user can decrypt, download, and view the first data at any time from the first server through a user device.

[0086] Combine the following Figure 3 , Figure 4 and Figure 5 , respectively illustrate the data query methods of index query, ID query, and condition query. Among them, index query is such as the first query method described in step S202 above. ID query is such as the ID query described in step S203 above. Condition query is such as the condition query described in step S203 above.

[0087] Example 1: Index query.

[0088] Please refer to Figure 3 , which is a flow chart of a data query method provided in an embodiment of the present application Figure 2 .in, Figure 3 The user equipment shown is, for example, Figure 1 The user equipment 120 shown, Figure 3 The retrieval system shown is, for example, Figure 1 The retrieval system 110 shown, Figure 3 The first server shown is, for example, Figure 1 The first server 111 shown, Figure 3 The second server shown is, for example, Figure 1 The second server 112 is shown. Alternatively, Figure 3 The retrieval system shown is, for example, Figure 2 The retrieval system, Figure 3 The first server shown is, for example, Figure 2 the first server, Figure 3 The second server shown is, for example, Figure 2 The second server.

[0089] S301: A user equipment sends query information to a first server, where the query information is used to indicate a first location of first data.

[0090] Correspondingly, the first server receives query information from the user equipment.

[0091] The specific content of the query information may correspond to the content described in the above step S202.

[0092] S302: The first server obtains an index list corresponding to the first data according to the query information.

[0093] The specific method for the first server to obtain the index list and the related content of the index list may correspond to the content described in step S202.

[0094] S303: The first server encrypts each piece of index information in the index list based on a homomorphic encryption algorithm to obtain a first encryption vector.

[0095] The encrypted element of the first index information indicated by the first position is different from the encrypted elements of other index information in the index list.

[0096] The specific manner in which the first server encrypts to obtain the first encryption vector may correspond to the content described in the above step S202.

[0097] S304: The first server sends a first encryption vector to the second server.

[0098] Correspondingly, the second server receives the first encryption vector from the first server.

[0099] S305: The second server obtains the search result of each index information from the database in sequence according to the pre-stored index list and the arrangement order of the index information in the index list.

[0100] The specific manner in which the second server obtains the search result of each index information may correspond to the content described in the above step S202.

[0101] S306: The second server homomorphically encrypts the decrypted search results in sequence according to the order of the index information in the index list using a homomorphic encryption algorithm to obtain a second encryption vector.

[0102] The specific method in which the second server calculates the second encryption vector may correspond to the content described in the above step S202.

[0103] S307: The second server operates the first encryption vector and the second encryption vector to obtain first encrypted data.

[0104] The specific method in which the first server calculates and obtains the first encrypted data may correspond to the content described in the above step S202.

[0105] S308: The second server sends the first encrypted data to the first server.

[0106] Correspondingly, the first server receives the first encrypted data from the second server.

[0107] S309: The first server decrypts the first encrypted data based on a pre-stored key to obtain first data.

[0108] The key and the first data decrypted by the first server may correspond to the content described in the above step S202.

[0109] S310: The first server sends first data to the user equipment.

[0110] Correspondingly, the user equipment receives the first data from the first server.

[0111] Example 2, ID query.

[0112] Please refer to Figure 4 , which is a flow chart of a data query method provided in an embodiment of the present application Figure 3 .in, Figure 4 The user equipment shown is, for example, Figure 1 The user equipment 120 shown, Figure 4 The retrieval system shown is, for example, Figure 1 The retrieval system 110 shown, Figure 4 The first server shown is, for example, Figure 1 The first server 111 shown, Figure 4 The second server shown is, for example, Figure 1 The second server 112 is shown. Alternatively, Figure 4 The retrieval system shown is, for example, Figure 2 The retrieval system, Figure 4 The first server shown is, for example, Figure 2 the first server, Figure 4 The second server shown is, for example, Figure 2 The second server.

[0113] S401: A user device sends query information to a first server, where the query information is used to indicate a first identifier of first data and a file name of a first file where the first data is located.

[0114] Correspondingly, the first server receives query information from the user equipment.

[0115] The content of the query information in this example may correspond to the content of the query information in the ID query method in step S203 above.

[0116] S402: The first server sends the file name of the first file to the second server.

[0117] Correspondingly, the second server receives the file name of the first file from the first server.

[0118] S403: The second server obtains the first file from the database according to the file name, and reads multiple identifiers from the first file.

[0119] The contents of the multiple identifiers obtained by the second server may correspond to the contents described in the above step S203.

[0120] S404: The second server determines a first character string of multiple identifiers.

[0121] The specific manner in which the second server determines the first character strings of the multiple identifiers may correspond to the content described in the above step S203.

[0122] S405: The second server sends a first character string of multiple identifiers to the first server.

[0123] Correspondingly, the first server receives the first character strings of the multiple identifiers from the second server.

[0124] S406: The first server determines a target identifier from the multiple identifiers according to the first character strings of the multiple identifiers and the hash character strings of the first identifiers.

[0125] The specific manner in which the first server determines the target identifier from the multiple identifiers may correspond to the content described in the above step S203.

[0126] S407: The first server determines the arrangement position of the target identifier among the multiple identifiers as the first position.

[0127] S408: The first server obtains first data from the second server according to the first location.

[0128] The first server obtains the first data from the second server according to the first location, which may correspond to the content described in step S202 or Figure 3 The data query method shown.

[0129] S409: The first server sends first data to the user equipment.

[0130] Correspondingly, the user equipment receives the first data sent from the first server.

[0131] Example 3, conditional query.

[0132] Please refer to Figure 5 , which is a flow chart of a data query method provided in an embodiment of the present application Figure 4 .in, Figure 5 The user equipment shown is, for example, Figure 1 The user equipment 120 shown, Figure 5 The retrieval system shown is, for example, Figure 1 The retrieval system 110 shown, Figure 5 The first server shown is, for example, Figure 1 The first server 111 shown, Figure 5 The second server shown is, for example, Figure 1 The second server 112 is shown. Alternatively, Figure 5 The retrieval system shown is, for example, Figure 2 The retrieval system, Figure 5 The first server shown is, for example, Figure 2 the first server, Figure 5 The second server shown is, for example, Figure 2 The second server.

[0133] S501: A user device sends query information to a first server, where the query information is used to indicate a query condition for first data.

[0134] Correspondingly, the first server receives query information from the user equipment.

[0135] The content of the query information in this example may correspond to the content of the query information in the conditional query mode in step S203 above.

[0136] S502: The first server sends a query field in the query condition to the second server.

[0137] Correspondingly, the second server receives the query field from the first server.

[0138] The content of the query field may correspond to the content described in the above step S203.

[0139] S503: The second server determines the mean, variance, maximum value and minimum value of the data corresponding to the query field.

[0140] The specific manner in which the second server determines the mean, variance, maximum value and minimum value of the data corresponding to the query field may correspond to the content described in the above step S203.

[0141] S504: The second server sends the mean, variance, maximum value, and minimum value of the data corresponding to the query field to the first server.

[0142] Correspondingly, the first server receives the mean, variance, maximum value and minimum value of the data corresponding to the query field from the second server.

[0143] S505: The first server determines whether the query condition meets the query range according to the maximum value and the minimum value.

[0144] If the first server determines that the query condition meets the query range, step S506 is performed. If the first server determines that the query condition does not meet the query range, the query process ends.

[0145] The specific method in which the first server determines whether the query condition meets the query range may correspond to the content described in the above step S203.

[0146] S506: The first server generates a first number of obfuscation conditions according to the query field, the mean, the variance, the maximum value, and the minimum value.

[0147] The specific manner in which the first server generates the first number of obfuscation conditions may correspond to the content described above.

[0148] S507: The first server inserts the query condition into the first number of obfuscated conditions, and records the first position of the query condition in all conditions.

[0149] S508: The first server obtains first data from the second server according to the first location.

[0150] The first server obtains the first data from the second server according to the first location, which may correspond to the content described in step S202 or Figure 3 The data query method shown.

[0151] S509: The first server sends first data to the user equipment.

[0152] Correspondingly, the user equipment receives the first data sent from the first server.

[0153] Based on the same inventive concept, an embodiment of the present application provides a data query device, which is used to implement any of the above data query methods, for example Figures 2 to 5 Any of the data query methods shown, and the device can also implement the function of the first server mentioned above.

[0154] Please refer to Figure 6 , is a schematic diagram of the structure of a data query device provided in an embodiment of the present application. Figure 6As shown, the data query device 600 may include a determination module 601 and a query module 602. The data query device 600 may be applied to a first server of a retrieval system, and the first server is any server in the retrieval system.

[0155] Exemplarily, determination module 601 is used to determine, based on query information input by a user, whether the query method indicated by the query information is a first query method, and the query information is also used to indicate the acquisition of first data; query module 602 is used to, if the query method is the first query method, perform an anonymous query on the first data according to the first query method and the first position indicated by the query information, and acquire the first data from a second server, where the second server is the data holder of the first data in the retrieval system; query module 602 is also used to determine, if the query method is not the first query method, the first position of the first data in the second server according to the query information, and perform an anonymous query on the first data according to the first position and the first query method, and acquire the first data from the second server.

[0156] In one possible implementation, the query module 602 is specifically used to: obtain an index list corresponding to the first data based on the query information; encrypt each index information in the index list based on a preset homomorphic encryption algorithm to obtain a first encryption vector, wherein the encryption element of the first index information is different from the encryption element of other index information in the index list, and the first index information is the index information corresponding to the first position in the index list; send the first encryption vector to the second server; receive first encrypted data from the second server, the first encrypted data is the operation result of the first encryption vector and the second encryption vector, and the second encryption vector is obtained by the second server using the homomorphic encryption algorithm to encrypt the retrieval result corresponding to each index information in the index list; decrypt the first encrypted data based on a pre-stored key to obtain the first data.

[0157] In a possible implementation, the query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data; the query module 602 is specifically used to: send the file name to the second server; receive a first string of multiple identifiers from the second server, the first string is concatenated from a second string and a third string, the second string is a partial hash string of an identifier, and the third string is obtained by performing a cryptographic hash function on the remaining hash string of an identifier; determine a candidate identifier that matches the second string with the fourth string from the multiple identifiers, the fourth string is a part of the hash string of the first identifier, and the length of the fourth string is the same as that of the second string; perform a cryptographic hash function on the fifth string based on the verification factor carried in the third string to obtain a sixth string, the fifth string is a string in the hash string of the first identifier except the fourth string; determine a target identifier that matches the third string with the sixth string from the candidate identifiers based on the sixth string; and determine the arrangement position of the target identifier in the multiple identifiers as the first position.

[0158] In a possible implementation, the query information is also used to indicate the query conditions of the first data; the query module 602 is specifically used to: determine, based on the correspondence between the pre-stored query conditions and quantities, that the query conditions of the first data correspond to the need to generate a first number of obfuscation conditions, the first number being related to the security level of the query conditions; generate the first number of obfuscation conditions based on the query fields in the query conditions; insert the query conditions into the first number of obfuscation conditions, and record the first position of the query conditions in all conditions, where all conditions include the query conditions and the first number of obfuscation conditions.

[0159] In one possible implementation, the query module 602 is specifically used to: send a query field to a second server; receive a mean, a variance, a maximum value, and a minimum value of data corresponding to the query field sent from the second server; determine whether the query condition meets the query range based on the maximum value and the minimum value; if the query condition meets the query range, generate a first number of random numbers based on the mean, the variance, the maximum value, and the minimum value; randomly generate a first number of relational operators; and generate a first number of obfuscation conditions based on the query field, the first number of random numbers, and the first number of relational operators.

[0160] Based on the same inventive concept, an embodiment of the present application provides an electronic device, which is used to implement any of the above data query methods, for example Figures 2 to 5 Any of the data query methods shown, and the device can also implement the function of the first server mentioned above.

[0161] Please refer to Figure 7 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7As shown, the electronic device 700 includes at least one processor 701 and a memory 702 communicatively connected to the at least one processor 701 .

[0162] The processor 701 may be a general-purpose processor or a dedicated processor. The processor 701 may include, for example, a baseband processor or a central processing unit. The baseband processor may be used to process communication protocols and communication data. The central processing unit may be used to control the electronic device 700, execute software programs and / or process data. Different processors may be independent devices or may be arranged in one or more processing circuits, for example, integrated in one or more dedicated integrated circuits.

[0163] In one embodiment, the memory 702 stores instructions that can be executed by at least one processor 701. The at least one processor 701 implements the functions of the first server as described above by executing the instructions stored in the memory 702. Accordingly, the steps performed by the first server as described above can also be implemented.

[0164] In this embodiment, the electronic device 700 can also implement the functions of the previous context data query device 600, and at least one processor 701 in the electronic device 700 can also implement the functions of the previous context determination module 601 and the query module 602.

[0165] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes any of the data query methods described above, for example, Figures 2 to 5 Any of the data query methods shown.

[0166] Based on the same inventive concept, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed on a computer, enables any of the above-mentioned data query methods, for example, Figures 2 to 5 Any of the data query methods shown is implemented.

[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0171] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data query method, characterized in that: The method is applied to a first server in a retrieval system, wherein the first server is any server in the retrieval system; the method comprises: Determining, according to query information input by a user, whether a query mode indicated by the query information is a first query mode, wherein the query information is also used to indicate obtaining first data; If the query method is the first query method, an anonymous query is performed on the first data according to the first query method and the first location indicated by the query information, and the first data is obtained from a second server, where the second server is the data holder of the first data in the retrieval system; If the query method is not the first query method, determine the first position of the first data in the second server based on the query information, perform an anonymous query on the first data based on the first position and the first query method, and obtain the first data from the second server.

2. The method according to claim 1, characterized in that Performing an anonymous query on the first data according to the first location and the first query method, and obtaining the first data from the second server, includes: According to the query information, obtaining an index list corresponding to the first data; Based on a preset homomorphic encryption algorithm, encrypt each index information in the index list to obtain a first encryption vector, wherein an encryption element of the first index information is different from an encryption element of other index information in the index list, and the first index information is the index information corresponding to the first position in the index list; sending the first encryption vector to the second server; receiving first encrypted data from the second server, where the first encrypted data is a calculation result of the first encryption vector and the second encryption vector, and the second encryption vector is obtained by the second server encrypting a search result corresponding to each index information in the index list by using the homomorphic encryption algorithm; The first encrypted data is decrypted based on a pre-stored key to obtain the first data.

3. The method according to claim 1, characterized in that The query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data; determining the first location of the first data in the second server according to the query information includes: Sending the file name to the second server; Receive a first string of multiple identifiers from the second server, where the first string is formed by concatenating a second string and a third string, where the second string is a partial hash string of one identifier, and the third string is obtained by performing cryptographic hash function processing on a remaining hash string of the one identifier; Determine a candidate identifier for matching the second character string with a fourth character string from the multiple identifiers, the fourth character string being a portion of a hash character string of the first identifier, and the fourth character string having the same length as the second character string; Performing cryptographic hash function processing on a fifth character string based on the verification factor carried in the third character string to obtain a sixth character string, wherein the fifth character string is a character string in the hash character string of the first identifier excluding the fourth character string; According to the sixth character string, determining a target identifier from the candidate identifiers, in which the third character string matches the sixth character string; The arrangement position of the target identifier among the multiple identifiers is determined as the first position.

4. The method according to claim 1, characterized in that: The query information is also used to indicate a query condition for the first data; Determining, according to the query information, a first location of the first data in the second server includes: Determining, according to a correspondence between a pre-stored query condition and a quantity, that a query condition of the first data corresponds to a first number of obfuscation conditions that need to be generated, wherein the first number is related to a security level of the query condition; generating the first number of obfuscation conditions according to the query fields in the query conditions; The query condition is inserted into the first number of obfuscated conditions, and the first position of the query condition among all conditions is recorded, where all conditions include the query condition and the first number of obfuscated conditions.

5. The method according to claim 4, characterized in that Generating a first number of obfuscation conditions according to the query fields in the query conditions includes: sending the query field to the second server; receiving a mean, a variance, a maximum value, and a minimum value of the data corresponding to the query field sent by the second server; According to the maximum value and the minimum value, determining whether the query condition meets the query range; If the query condition meets the query range, generating the first number of random numbers according to the mean, the variance, the maximum value and the minimum value; randomly generating the first number of relational operators; The first number of obfuscation conditions are generated according to the query field, the first number of random numbers, and the first number of relational operators.

6. A data query device, characterized in that: A first server applied to a retrieval system, wherein the first server is any server in the retrieval system; the device comprises: A determination module, configured to determine, based on query information input by a user, whether a query mode indicated by the query information is a first query mode, wherein the query information is further configured to indicate acquisition of first data; a query module, configured to, if the query method is the first query method, perform an anonymous query on the first data according to the first query method and the first location indicated by the query information, and obtain the first data from a second server, where the second server is the data holder of the first data in the retrieval system; The query module is also used to determine the first position of the first data in the second server according to the query information if the query method is not the first query method, and perform an anonymous query on the first data according to the first position and the first query method to obtain the first data from the second server.

7. The device according to claim 6, characterized in that The query module is specifically used for According to the query information, obtaining an index list corresponding to the first data; Based on a preset homomorphic encryption algorithm, encrypt each piece of index information in the index list to obtain a first encryption vector, wherein an encryption element of the first index information is different from an encryption element of other index information in the index list; sending the first encryption vector to the second server; receiving first encrypted data from the second server, where the first encrypted data is a calculation result of the first encryption vector and the second encryption vector, and the second encryption vector is obtained by the second server encrypting a search result corresponding to each index information in the index list by using the homomorphic encryption algorithm; The first encrypted data is decrypted based on a pre-stored key to obtain the first data.

8. The device according to claim 6, characterized in that The query information is also used to indicate the file name of the first file where the first data is located and the first identifier of the first data; the query module is specifically used to: Sending the file name to the second server; Receive a first string of multiple identifiers from the second server, where the first string is formed by concatenating a second string and a third string, where the second string is a partial hash string of one identifier, and the third string is obtained by performing cryptographic hash function processing on a remaining hash string of the one identifier; Determine a candidate identifier for matching the second character string with a fourth character string from the multiple identifiers, the fourth character string being a portion of a hash character string of the first identifier, and the fourth character string having the same length as the second character string; Performing cryptographic hash function processing on a fifth character string based on the verification factor carried in the third character string to obtain a sixth character string, wherein the fifth character string is a character string in the hash character string of the first identifier excluding the fourth character string; According to the sixth character string, determining a target identifier from the candidate identifiers, in which the third character string matches the sixth character string; The arrangement position of the target identifier among the multiple identifiers is determined as the first position.

9. The device according to claim 6, characterized in that The query information is also used to indicate the query condition of the first data; the query module is specifically used to: Determining, according to a correspondence between a pre-stored query condition and a quantity, that a query condition of the first data corresponds to a first number of obfuscation conditions that need to be generated, wherein the first number is related to a security level of the query condition; generating the first number of obfuscation conditions according to the query fields in the query conditions; The query condition is inserted into the first number of obfuscated conditions, and the first position of the query condition among all conditions is recorded, where all conditions include the query condition and the first number of obfuscated conditions.

10. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the method according to any one of claims 1 to 5 by executing the instructions stored in the memory.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 5.

12. A computer program product, characterized in that The invention comprises computer instructions, which, when executed on a computer, enable the method according to any one of claims 1 to 5 to be implemented.