Data query method, system, device, computer readable medium and electronic device

Generating and processing encrypted data through dual-end encryption, solving the problem of low security in plain text data in data queries, realizing ciphertext-based data query, ensuring data privacy and improving query efficiency.

CN114090893BActive Publication Date: 2024-12-27CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111421273.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2024-12-27
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

During the data query process in the existing encryption method, the query data is plain text, resulting in low security and the inability to effectively protect the data security and privacy of the server and user side.

Method used

The dual-end encryption method for the server and the user side is adopted to generate encrypted data through preset parameters, data query keys and random numbers, and double encryption is performed on the encrypted data to generate query identifiers to realize ciphertext-based data query. The specific steps include generating the first encrypted data and the second encrypted data, sending it to the server for encryption processing, and determining the query identifier based on the encrypted data and the key, and finally generating a set of query results.

Benefits of technology

It realizes data query based on ciphertext, improves data security and privacy between the server and the user side, and supports simultaneous query of multiple data, improving data query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114090893B_ABST
    Figure CN114090893B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a data query method, device, computer-readable medium and electronic device, which relate to the field of computer technology; including: generating first encrypted data and second encrypted data according to preset parameters, data query key, first random number and data set to be queried; sending the first encrypted data and second encrypted data to a server; wherein the server is used to encrypt the first encrypted data and second encrypted data by a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; determining a query identifier based on the third encrypted data, fourth encrypted data and data query key; sending the query identifier to the server; wherein the server is also used to generate a query result set according to the query identifier and feed back the query result set to the user end. In this way, data security and data privacy in the data query process can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data query method, device, computer-readable medium, and electronic device. Background Art

[0002] During the data transmission process, it is usually necessary to encrypt the data to ensure the security of data transmission. The existing encryption method is usually that the sender encrypts the data with an encryption key, and the receiver receives the encrypted data and decrypts the data with a decryption key corresponding to the encryption key. However, when this encryption method is applied to data query, the queried data is plaintext data for both the encryption and decryption parties, and the security is relatively low.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] The purpose of the embodiments of the present disclosure is to provide a data query method, a data query device, a computer-readable medium and an electronic device, which can provide a two-end encryption method for the server and the user, so that the data query between the server and the user is implemented as a ciphertext-based data query, which can ensure the data security and data privacy of the server and the user.

[0005] A first aspect of an embodiment of the present disclosure provides a data query method, including:

[0006] Generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried;

[0007] Sending the first encrypted data and the second encrypted data to the server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by using the second random number to obtain the third encrypted data corresponding to the first encrypted data and the fourth encrypted data corresponding to the second encrypted data;

[0008] receiving the third encrypted data and the fourth encrypted data sent by the server, and determining the query identifier based on the third encrypted data, the fourth encrypted data and the data query key;

[0009] The query identifier is sent to the server; wherein the server is also used to generate a query result set according to the query identifier and feed the query result set back to the user end.

[0010] In an exemplary embodiment of the present disclosure, the data query key includes a corresponding first key and a second key, and the first encrypted data and the second encrypted data are generated according to preset parameters, the data query key, a first random number, and a data set to be queried, including:

[0011] Determine preset parameters according to the elliptic curve algorithm;

[0012] Encrypting the query data set by using the second key and the first random number to obtain first encrypted data;

[0013] The second encrypted data is generated according to the preset parameters and the first random number.

[0014] In an exemplary embodiment of the present disclosure, determining preset parameters according to an elliptic curve algorithm includes:

[0015] Determine an elliptic curve according to an elliptic curve algorithm and preset algorithm parameters;

[0016] Select a target point from the elliptic curve based on a preset rule;

[0017] The preset parameters are determined according to the coordinates of the target point.

[0018] In an exemplary embodiment of the present disclosure, determining a query identifier based on the third encrypted data, the fourth encrypted data, and the data query key includes:

[0019] determining an intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key;

[0020] Calculate the hash function value corresponding to the intermediate parameter;

[0021] At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

[0022] In an exemplary embodiment of the present disclosure, after sending the query identifier to the server, the method further includes:

[0023] Receive query result set;

[0024] Compare the query identifier with each query result in the query result set in sequence;

[0025] If there is a query result matching the query identifier, a message to be fed back is generated according to the query result matching the query identifier and the message to be fed back is output.

[0026] A second aspect of the embodiments of the present disclosure provides a data query system, the system comprising a user end and a server end, wherein:

[0027] The user end is used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; and send the first encrypted data and the second encrypted data to the server end;

[0028] The server is configured to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; and send the third encrypted data and the fourth encrypted data to the client;

[0029] The user end is further used to receive the third encrypted data and the fourth encrypted data sent by the server end, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key; and send the query identifier to the server end;

[0030] The server is also used to generate a query result set according to the query identifier and feed the query result set back to the user.

[0031] In an exemplary embodiment of the present disclosure, the server generates a query result set according to the query identifier, including:

[0032] The server calculates a hash value corresponding to each stored data in the stored data set based on the second random number to obtain a set of hash values ​​corresponding to the stored data set;

[0033] The server compares the query identifier with each hash value in the hash value set in sequence;

[0034] If there is at least one target hash value matching the query identifier in the hash value set, the server generates a query result set according to the at least one target hash value.

[0035] A third aspect of an embodiment of the present disclosure provides a data query device, the device comprising: an encrypted data generating unit, an encrypted data sending unit, a query identifier determining unit, and a query identifier sending unit, wherein:

[0036] An encrypted data generating unit, used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried;

[0037] An encrypted data sending unit, used to send the first encrypted data and the second encrypted data to the server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data;

[0038] A query identifier determination unit, configured to receive the third encrypted data and the fourth encrypted data sent by the server, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key;

[0039] The query identifier sending unit is used to send the query identifier to the server; wherein the server is also used to generate a query result set according to the query identifier and feed back the query result set to the user end.

[0040] In an exemplary embodiment of the present disclosure, the data query key includes a corresponding first key and a second key, and the encrypted data generation unit generates the first encrypted data and the second encrypted data according to preset parameters, the data query key, the first random number, and the data set to be queried, including:

[0041] Determine preset parameters according to the elliptic curve algorithm;

[0042] Encrypting the query data set by using the second key and the first random number to obtain first encrypted data;

[0043] The second encrypted data is generated according to the preset parameters and the first random number.

[0044] In an exemplary embodiment of the present disclosure, the encryption data generation unit determines preset parameters according to the elliptic curve algorithm, including:

[0045] Determine an elliptic curve according to an elliptic curve algorithm and preset algorithm parameters;

[0046] Select a target point from the elliptic curve based on a preset rule;

[0047] The preset parameters are determined according to the coordinates of the target point.

[0048] In an exemplary embodiment of the present disclosure, the query identifier determination unit determines the query identifier based on the third encrypted data, the fourth encrypted data and the data query key, including:

[0049] determining an intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key;

[0050] Calculate the intermediate parameter value; the hash function corresponding to the number

[0051] At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

[0052] In an exemplary embodiment of the present disclosure, the above-mentioned device further includes:

[0053] The message feedback unit is used to receive a query result set after the query identifier sending unit sends the query identifier to the server; compare the query identifier with each query result in the query result set in turn; if there is a query result matching the query identifier, generate a message to be fed back based on the query result matching the query identifier and output the message to be fed back.

[0054] According to a third aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the data query method as described in the first aspect of the above embodiment is implemented.

[0055] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the data query method as described in the first aspect of the above embodiment.

[0056] According to a fifth aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.

[0057] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0058] In the technical solutions provided by some embodiments of the present disclosure, first encrypted data and second encrypted data can be generated according to preset parameters, data query keys, first random numbers, and data sets to be queried; the first encrypted data and second encrypted data are sent to the server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by the second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; receive the third encrypted data and the fourth encrypted data sent by the server, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key; send the query identifier to the server; wherein the server is also used to generate a query result set according to the query identifier and feed the query result set back to the user. By implementing the embodiments of the present disclosure, on the one hand, a two-end encryption method for the server and the user can be provided, so that the data query between the server and the user is implemented as a data query based on ciphertext, which can ensure the data security and data privacy of the server and the user. On the other hand, it can realize the simultaneous query of multiple data, which can improve the efficiency of data query.

[0059] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0061] Figure 1 A schematic diagram schematically shows an exemplary system architecture of a data query method and device to which the embodiments of the present disclosure can be applied;

[0062] Figure 2 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown;

[0063] Figure 3 A flowchart of a data query method according to an embodiment of the present disclosure is schematically shown;

[0064] Figure 4 A sequence diagram of a data query system according to an embodiment of the present disclosure is schematically shown;

[0065] Figure 5 A flowchart of a data query method according to an embodiment of the present disclosure is schematically shown;

[0066] Figure 6 The structural block diagram of a data query device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0067] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0068] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0069] Figure 1 The following is a schematic diagram schematically showing an exemplary system architecture of a data query method and device to which the embodiments of the present disclosure can be applied.

[0070] like Figure 1 As shown, the system architecture 100 may include one or more of the user terminals 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the user terminals 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The user terminals 101, 102, 103 may be various electronic devices with display screens, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of user terminals, networks, and servers in the figure is only for illustration. Any number of user terminals, networks, and servers may be provided according to implementation requirements.

[0071] For example, one or more of the user terminals 101, 102, and 103 can execute: generating first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; and sending the first encrypted data and the second encrypted data to the server. The server 105 can execute: encrypting the first encrypted data and the second encrypted data by a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data. One or more of the user terminals 101, 102, and 103 can execute: receiving the third encrypted data and the fourth encrypted data sent by the server, and determining a query identifier based on the third encrypted data, the fourth encrypted data, and the data query key; and sending the query identifier to the server. The server 105 can execute: generating a query result set according to the query identifier and feeding back the query result set to the user terminal.

[0072] Figure 2 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.

[0073] It should be noted that Figure 2The computer system 200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0074] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 202 or the program loaded from the storage part 208 to the random access memory (RAM) 203. In the (RAM) 203, various programs and data required for system operation are also stored. The (CPU) 201, the (ROM) 202 and the (RAM) 203 are connected to each other through a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0075] The following components are connected to the (I / O) interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the (I / O) interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.

[0076] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from a removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, various functions defined in the method and apparatus of the present application are executed.

[0077] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0078] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0079] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0080] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following method. Figure 3 The various steps shown, etc.

[0081] This example embodiment provides a data query method. Figure 3 As shown, the data query method may include the following steps S310 to S340, specifically:

[0082] Step S310: Generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried.

[0083] Step S320: Send the first encrypted data and the second encrypted data to the server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data.

[0084] Step S330: receiving the third encrypted data and the fourth encrypted data sent by the server, and determining the query identifier based on the third encrypted data, the fourth encrypted data and the data query key.

[0085] Step S340: Send the query identifier to the server; wherein the server is also used to generate a query result set according to the query identifier and feed back the query result set to the user end.

[0086] Specifically, when the user terminal has a query demand, a data set to be queried can be determined; wherein the data set to be queried may include one or more data to be queried, and the data set to be queried can be expressed as {M i}; wherein i is used to represent the i-th data to be queried in the data set to be queried. Furthermore, the user terminal can generate the first encrypted data and the second encrypted data according to the preset parameters, the data query key, the first random number, and the data set to be queried; wherein the preset parameters can be expressed as numerical values, the values ​​of the preset parameters and the first random number can be the same or different, and the data query key can include an asymmetric first key (such as a public key) and a second key (such as a private key). In addition, the first encrypted data and the second encrypted data can be expressed as numerical values, strings, etc., which are not limited in the embodiments of the present application.

[0087] As an optional embodiment, the data query key includes a corresponding first key and a second key, and the first encrypted data and the second encrypted data are generated according to the preset parameters, the data query key, the first random number, and the data set to be queried, including: determining the preset parameters according to the elliptic curve algorithm; encrypting the data set to be queried by the second key and the first random number to obtain the first encrypted data; and generating the second encrypted data according to the preset parameters and the first random number. In this way, the preset parameters can be determined according to the elliptic curve algorithm to improve the randomness of the preset parameters, thereby improving the security of the encrypted data.

[0088] Specifically, the preset parameters determined according to the elliptic curve cryptography (ECC) algorithm can be provided to the user end and the server end for sharing. In addition, optionally, after the preset parameters are determined according to the elliptic curve algorithm, the above method may also include: determining the second key P in the data query key according to the preset parameters G and the first key d, and the first key corresponding to the second key can be a preset value. The data query key can be expressed as (d, P). Specifically, the implementation method of encrypting the data set to be queried by the second key and the first random number to obtain the first encrypted data can be: obtaining the first random number k based on a random number generator A , the second key P and the first random number k A Enter the expression C A1 =M i +k A P, to calculate the first encrypted data C A1 Based on this, the implementation method of generating the second encrypted data according to the preset parameter and the first random number can be: the preset parameter G and the first random number k A Enter the expression C A2 =k A G, to calculate the second encrypted data C A2 .

[0089] Further optionally, determining the preset parameters according to the elliptic curve algorithm includes: determining the elliptic curve according to the elliptic curve algorithm and the preset algorithm parameters; selecting the target point from the elliptic curve based on the preset rules; and determining the preset parameters according to the coordinates of the target point. This can improve the security of data encryption to protect the privacy of both ends of data interaction.

[0090] Specifically, the preset parameter can be expressed as G (i.e., the target point), and G can correspond to any point in the elliptic curve. In addition, the preset rule can be used to limit the selection method of the target point, and the preset rule can be expressed as a string, text information, etc., which is not limited in the embodiment of the present application. The coordinates of the target point can be expressed as (x, y).

[0091] Furthermore, the user end may also send the first encrypted data and the second encrypted data to the server end. The server end may use the second random number k B Encrypt the first encrypted data C A1 and the second encrypted data C A2 , get the first encrypted data C A1 The third encrypted data C B1 and corresponds to the second encrypted data C A2 The fourth encrypted data C B2 Specifically, the server uses the second random number k B Encrypt the first encrypted data C A1 and the second encrypted data C A2 , get the first encrypted data C A1 The third encrypted data C B1 and corresponds to the second encrypted data C A2 The fourth encrypted data C B2 The method can be: the server is based on expression C B1 =k B C A1 Calculate the first encrypted data C A1 The third encrypted data C B1 ; Based on the expression C B2 =k B C A2 Calculate the value corresponding to the second encrypted data C A2 The fourth encrypted data C B2 .

[0092] Furthermore, the server may send the third encrypted data and the fourth encrypted data to the client, so that the client receives the third encrypted data and the fourth encrypted data sent by the server, and determines the query identifier based on the third encrypted data, the fourth encrypted data and the data query key.

[0093] As an optional embodiment, determining the query identifier based on the third encrypted data, the fourth encrypted data and the data query key includes: determining the intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key; calculating the hash function value corresponding to the intermediate parameter; intercepting at least one digit from the hash function value as the query identifier based on a preset interception rule. This can help improve the data confidentiality level, and both ends of the data interaction can achieve data query while ensuring the privacy of the data through two encryptions. In addition, by intercepting the hash function value, the occupation of network resources can be reduced on the basis of further improving data security.

[0094] Specifically, the method in which the user terminal determines the intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key may be: the user terminal converts the third encrypted data C B1 , the fourth encrypted data C B2 and the first key d is entered into the expression C A =C B1 -dC B2 , to calculate the intermediate parameter C A Based on this, the method for calculating the hash function value corresponding to the intermediate parameter can be: based on the intermediate parameter and the hash function expression Q i =Hash(C A ) Calculate the hash function value Q corresponding to the intermediate parameter i Based on this, the method of intercepting at least one digit of the value from the hash function value as the query identifier based on the preset interception rule can be: based on the preset interception rule, extract at least one digit of the value from the hash function value Q as the query identifier i Extract at least one digit from the query as the query identifier Q i (n). The preset interception rule is used to limit the number of digits of the query identifier.

[0095] Furthermore, the user terminal can also use the query identifier Q i (n) is sent to the server; wherein the server is also used to i (n) Generate a query result set and feed the query result set back to the user end.

[0096] The server uses the query identifier Q i (n) The query result set may be generated by: B Calculate the stored data set {M j} corresponding to the hash value D of each stored data j =Hash(k B M j ), and the query is marked as Q i (n) and hash value set D jEach hash value in the set is compared in turn. If there is at least one target hash value matching the query identifier in the hash value set, a query result set Sub{D j}.

[0097] As an optional embodiment, after sending the query identifier to the server, the method further includes: receiving a query result set; sequentially comparing the query identifier with each query result in the query result set; if there is a query result matching the query identifier, generating a message to be fed back according to the query result matching the query identifier and outputting the message to be fed back. In this way, the data query result can be determined by double encryption at both ends of the data interaction to determine whether the data set to be queried is stored on the server.

[0098] Specifically, the query identifier Q i (n) and the query result set Sub{D j} are compared in turn. If there is a query result that matches the query identifier, a message to be fed back is generated based on the query result that matches the query identifier and the message to be fed back is output; wherein, the message to be fed back may include the query result that matches the query identifier, and the message to be fed back may be represented as a character string, text information, chart, etc., which is not limited in the embodiments of the present application.

[0099] It can be seen that implementation Figure 3 The method shown can provide a double-end encryption method for the server and the user, so that the data query between the server and the user is realized as a ciphertext-based data query, which can ensure the data security and data privacy of the server and the user. In addition, it can also realize the simultaneous query of multiple data, which can improve the data query efficiency.

[0100] In addition, the present application also discloses a Figure 3 The data query system corresponding to the method shown may include: a user end and a server end, wherein:

[0101] The user end is used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; and send the first encrypted data and the second encrypted data to the server end;

[0102] The server is configured to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; and send the third encrypted data and the fourth encrypted data to the client;

[0103] The user end is further used to receive the third encrypted data and the fourth encrypted data sent by the server end, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key; and send the query identifier to the server end;

[0104] The server is also used to generate a query result set according to the query identifier and feed the query result set back to the user.

[0105] Among them, optionally, the server generates a query result set based on the query identifier, including: the server calculates the hash value corresponding to each stored data in the stored data set based on the second random number, and obtains a hash value set corresponding to the stored data set; the server compares the query identifier with each hash value in the hash value set in sequence; if there is at least one target hash value in the hash value set that matches the query identifier, the server generates a query result set based on the at least one target hash value.

[0106] It should be noted that, during each data query, the first random number corresponding to the client and the second random number corresponding to the server are different from the first random number and the second random number used in the previous data query.

[0107] Please refer to Figure 4 , Figure 4 What is shown is a sequence diagram corresponding to the data query system, which specifically includes: step S410 to step S490.

[0108] Step S410: The user terminal generates first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried.

[0109] Step S420: The client sends the first encrypted data and the second encrypted data to the server.

[0110] Step S430: The server encrypts the first encrypted data and the second encrypted data by using the second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data.

[0111] Step S440: The server sends the third encrypted data and the fourth encrypted data to the client.

[0112] Step S450: The user end receives the third encrypted data and the fourth encrypted data sent by the server end, determines the intermediate parameters according to the third encrypted data, the fourth encrypted data and the first key, calculates the hash function value corresponding to the intermediate parameters, and then intercepts at least one digit from the hash function value as a query identifier based on a preset interception rule.

[0113] Step S460: The user end sends the query identifier to the server end.

[0114] Step S470: The server calculates the hash value corresponding to each stored data in the stored data set based on the second random number, obtains a hash value set corresponding to the stored data set, and compares the query identifier with each hash value in the hash value set in turn. If there is at least one target hash value in the hash value set that matches the query identifier, a query result set is generated based on the at least one target hash value.

[0115] Step S480: The server feeds back the query result set to the user.

[0116] Step S490: the user terminal compares the query identifier with each query result in the query result set in sequence. If there is a query result matching the query identifier, a message to be fed back is generated according to the query result matching the query identifier and the message to be fed back is output.

[0117] It can be seen that implementation Figure 4 The system shown can provide a double-end encryption method for the server and the user, so that the data query between the server and the user is realized as a ciphertext-based data query, which can ensure the data security and data privacy of the server and the user. In addition, it can also realize the simultaneous query of multiple data, which can improve the efficiency of data query.

[0118] In addition, the present application also discloses a Figure 3 The steps and the corresponding data query method of the embodiment are shown. Figure 5 As shown, the data query method may include: steps S510 to S590.

[0119] Step S510: The user terminal determines preset parameters according to the elliptic curve algorithm.

[0120] Step S520: The user end encrypts the data set to be queried using the second key and the first random number to obtain first encrypted data.

[0121] Step S530: The user terminal generates second encrypted data according to the preset parameters and the first random number.

[0122] Step S540: the user end sends the first encrypted data and the second encrypted data to the server end; wherein the server end is used to encrypt the first encrypted data and the second encrypted data by a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data.

[0123] Step S550: the user end receives the third encrypted data and the fourth encrypted data sent by the server end, and determines the intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key.

[0124] Step S560: The user terminal calculates the hash function value corresponding to the intermediate parameter; and extracts at least one digit from the hash function value as a query identifier based on a preset interception rule.

[0125] Step S570: the user end sends the query identifier to the server end; wherein the server end is further used to generate a query result set according to the query identifier and feed back the query result set to the user end.

[0126] Step S580: The user terminal receives the query result set, and sequentially compares the query identifier with each query result in the query result set.

[0127] Step S590: If there is a query result matching the query identifier, the user terminal generates a message to be fed back according to the query result matching the query identifier and outputs the message to be fed back.

[0128] In addition, it should be noted that steps S510 to S590 are Figure 3 The steps and their embodiments shown correspond to each other. For the specific implementation of steps S510 to S590, please refer to Figure 3 The steps and embodiments shown are not described in detail here.

[0129] It can be seen that implementation Figure 5 The method shown can provide a double-end encryption method for the server and the user, so that the data query between the server and the user is realized as a ciphertext-based data query, which can ensure the data security and data privacy of the server and the user. In addition, it can also realize the simultaneous query of multiple data, which can improve the data query efficiency.

[0130] Furthermore, in this exemplary embodiment, a data query device is also provided. Figure 6 As shown, the data query device 600 may include: an encrypted data generating unit 601, an encrypted data sending unit 602, a query identifier determining unit 603, and a query identifier sending unit 604, wherein:

[0131] The encrypted data generating unit 601 is used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried;

[0132] The encrypted data sending unit 602 is used to send the first encrypted data and the second encrypted data to the server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by using the second random number to obtain the third encrypted data corresponding to the first encrypted data and the fourth encrypted data corresponding to the second encrypted data;

[0133] A query identifier determination unit 603, configured to receive the third encrypted data and the fourth encrypted data sent by the server, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key;

[0134] The query identifier sending unit 604 is used to send the query identifier to the server; wherein the server is also used to generate a query result set according to the query identifier and feed back the query result set to the user end.

[0135] It can be seen that implementation Figure 6 The device shown can provide a double-end encryption method for the server and the user, so that the data query between the server and the user is realized as a ciphertext-based data query, which can ensure the data security and data privacy of the server and the user. In addition, it can also realize the simultaneous query of multiple data, which can improve the data query efficiency.

[0136] In an exemplary embodiment of the present disclosure, the data query key includes a corresponding first key and a second key, and the encrypted data generation unit 601 generates the first encrypted data and the second encrypted data according to preset parameters, the data query key, the first random number, and the data set to be queried, including:

[0137] Determine preset parameters according to the elliptic curve algorithm;

[0138] Encrypting the query data set by using the second key and the first random number to obtain first encrypted data;

[0139] The second encrypted data is generated according to the preset parameters and the first random number.

[0140] It can be seen that by implementing this optional embodiment, the preset parameters can be determined according to the elliptic curve algorithm to improve the randomness of the preset parameters, thereby improving the security of the encrypted data.

[0141] In an exemplary embodiment of the present disclosure, the encrypted data generation unit 601 determines preset parameters according to the elliptic curve algorithm, including:

[0142] Determine an elliptic curve according to an elliptic curve algorithm and preset algorithm parameters;

[0143] Select a target point from the elliptic curve based on a preset rule;

[0144] The preset parameters are determined according to the coordinates of the target point.

[0145] It can be seen that implementing this optional embodiment can improve the security of data encryption to protect the privacy of both ends of data interaction.

[0146] In an exemplary embodiment of the present disclosure, the query identifier determination unit 603 determines the query identifier based on the third encrypted data, the fourth encrypted data and the data query key, including:

[0147] determining an intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key;

[0148] Calculate the hash function value corresponding to the intermediate parameter;

[0149] At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

[0150] It can be seen that the implementation of this optional embodiment can be beneficial to improving the data confidentiality level. Both ends of the data interaction can ensure the privacy of the data while realizing data query through double encryption.

[0151] In an exemplary embodiment of the present disclosure, the above-mentioned device further includes:

[0152] The message feedback unit (not shown) is used to receive the query result set after the query identifier sending unit 604 sends the query identifier to the server; compare the query identifier with each query result in the query result set in turn; if there is a query result that matches the query identifier, generate a message to be fed back based on the query result that matches the query identifier and output the message to be fed back.

[0153] It can be seen that by implementing this optional embodiment, the data query result can be determined by double encryption of data interaction at both ends to determine whether the data set to be queried is stored on the server.

[0154] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0155] Since the functional modules of the data query device of the exemplary embodiment of the present disclosure correspond to the steps of the exemplary embodiment of the data query method described above, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the data query method described above in the present disclosure.

[0156] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0157] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data query method, characterized in that: include: Generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; Sending the first encrypted data and the second encrypted data to a server; wherein the server is used to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; receiving the third encrypted data and the fourth encrypted data sent by the server, and determining a query identifier based on the third encrypted data, the fourth encrypted data and the data query key; Sending the query identifier to the server; wherein the server is further configured to generate a query result set according to the query identifier and feed the query result set back to the user end; The first encrypted data and the second encrypted data are generated according to the preset parameters, the data query key, the first random number, and the data set to be queried, including: Determine the preset parameters according to the elliptic curve algorithm; The to-be-queried data set is encrypted by using the second key in the data query key and the first random number to obtain the first encrypted data; Generate the second encrypted data according to the preset parameter and the first random number; Determining a query identifier based on the third encrypted data, the fourth encrypted data, and the data query key includes: Determine an intermediate parameter according to the third encrypted data, the fourth encrypted data and a first key in the data query key; Calculating a hash function value corresponding to the intermediate parameter; At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

2. The method according to claim 1, characterized in that Determining the preset parameters according to the elliptic curve algorithm includes: Determine an elliptic curve according to the elliptic curve algorithm and preset algorithm parameters; Selecting a target point from the elliptic curve based on a preset rule; The preset parameters are determined according to the coordinates of the target point.

3. The method according to claim 1, characterized in that After sending the query identifier to the server, the method further includes: Receiving the query result set; Compare the query identifier with each query result in the query result set in sequence; If there is a query result matching the query identifier, a message to be fed back is generated according to the query result matching the query identifier and the message to be fed back is output.

4. A data query system, characterized in that: The system includes a user end and a server end, wherein: The user end is used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; and send the first encrypted data and the second encrypted data to the server end; The server is configured to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; and send the third encrypted data and the fourth encrypted data to the client; The user end is further used to receive the third encrypted data and the fourth encrypted data sent by the server end, and determine the query identifier based on the third encrypted data, the fourth encrypted data and the data query key; and send the query identifier to the server end; The server is further configured to generate a query result set according to the query identifier and feed the query result set back to the user end; The first encrypted data and the second encrypted data are generated according to the preset parameters, the data query key, the first random number, and the data set to be queried, including: Determine the preset parameters according to the elliptic curve algorithm; Encrypting the to-be-queried data set by using a second key and the first random number to obtain the first encrypted data; Generate the second encrypted data according to the preset parameter and the first random number; Determining a query identifier based on the third encrypted data, the fourth encrypted data, and the data query key includes: determining an intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key; Calculating a hash function value corresponding to the intermediate parameter; At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

5. The system according to claim 4, characterized in that The server generates a query result set according to the query identifier, including: The server calculates a hash value corresponding to each stored data in the stored data set based on the second random number to obtain a set of hash values ​​corresponding to the stored data set; The server compares the query identifier with each hash value in the hash value set in sequence; If there is at least one target hash value matching the query identifier in the hash value set, the server generates a query result set according to the at least one target hash value.

6. A data query device, characterized in that: include: An encrypted data generating unit, used to generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried; an encrypted data sending unit, configured to send the first encrypted data and the second encrypted data to a server; wherein the server is configured to encrypt the first encrypted data and the second encrypted data by using a second random number to obtain third encrypted data corresponding to the first encrypted data and fourth encrypted data corresponding to the second encrypted data; a query identifier determination unit, configured to receive the third encrypted data and the fourth encrypted data sent by the server, and determine a query identifier based on the third encrypted data, the fourth encrypted data and the data query key; A query identifier sending unit, used to send the query identifier to the server; wherein the server is further used to generate a query result set according to the query identifier and feed the query result set back to the user end; Generate first encrypted data and second encrypted data according to preset parameters, a data query key, a first random number, and a data set to be queried, including: Determine the preset parameters according to the elliptic curve algorithm; Encrypting the to-be-queried data set by using a second key and the first random number to obtain the first encrypted data; Generate the second encrypted data according to the preset parameter and the first random number; Determining a query identifier based on the third encrypted data, the fourth encrypted data, and the data query key includes: determining an intermediate parameter according to the third encrypted data, the fourth encrypted data and the first key; Calculating a hash function value corresponding to the intermediate parameter; At least one numerical value is intercepted from the hash function value based on a preset interception rule as a query identifier.

7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data query method according to any one of claims 1 to 3 is implemented.

8. An electronic device, characterized in that: include: one or more processors; A storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the data query method according to any one of claims 1 to 3.