Data query method, device, system, equipment and medium
The proposed method enhances data processing efficiency by using a same-tape processing machine to handle encrypted data within a database, reducing the load on application programs and improving processing speed through direct database and processing machine interaction.
Patent Information
- Application Number
- CN202210066959.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-01-20
AI Technical Summary
Current methods using Java programs to handle large volumes of encrypted data result in low data processing efficiency, making them unsuitable for direct use in processing data.
Implementing a data querying method that utilizes a same-tape processing machine to receive interface calls from a target database, perform same-tape computations on encrypted data, and return decrypted results, eliminating the need for direct interaction between the application program and the same-tape processing machine by establishing an HTTP connection between the database and the processing machine.
This approach significantly improves data processing efficiency by reducing the load on the application program and enabling direct interaction between the database and same-tape processing machine, bypassing the need for JDBC connections and intermediate processing steps.
Smart Images

Figure CN114490728B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of blockchain and database technology, and in particular to a data query method, device, system, equipment and medium based on a homomorphic encryption algorithm. Background Art
[0002] With the rapid development of computer and communication technology, the Internet has been popularized in all aspects of people's daily life. Data storage is the core component of the Internet and the heart of the entire Internet. Existing relational databases and non-relational databases provide many conveniences for data storage of Internet companies.
[0003] The inventors realize that in some schemes, the homomorphic encryption algorithm is used to encrypt numbers into ciphertext strings to realize data operations, and the digital ciphertext encryption is realized by calling the homomorphic processor through the Java program. However, as the amount of ciphertext recorded data increases, the amount of data directly processed by the Java program calling the homomorphic processor is huge, which will lead to low data processing efficiency and is no longer suitable for directly using the Java program to call the homomorphic processor to process data. Summary of the invention
[0004] The embodiments of the present application provide a data query method, apparatus, system, device and medium based on a homomorphic encryption algorithm, which are used to solve the technical problem of low data processing efficiency of traditional solutions.
[0005] A data query method based on a homomorphic encryption algorithm, the method comprising:
[0006] The homomorphic processor receives an interface call request sent by the target database through the decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by the application program end;
[0007] The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content;
[0008] The homomorphic processor performs homomorphic calculation on the ciphertext data and then decrypts the ciphertext data to obtain decrypted data;
[0009] The homomorphic processor feeds back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end.
[0010] In one implementation, before the homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content, the method further includes:
[0011] The homomorphic processor receives a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information;
[0012] The homomorphic processor selects the to-be-encrypted field from the plaintext data according to the encryption field indication information;
[0013] The homomorphic processor encrypts the to-be-encrypted field in the plaintext data to obtain the ciphertext data;
[0014] The homomorphic processor stores the ciphertext data in a ciphertext database.
[0015] In one embodiment, the data upload request further includes a homomorphic computing method; the homomorphic processor responds to the interface call request to obtain the ciphertext data corresponding to the data request content, including:
[0016] The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content from the ciphertext database;
[0017] The homomorphic processor performs homomorphic calculation on the ciphertext data according to the homomorphic calculation method and then decrypts the ciphertext data to obtain the decrypted data.
[0018] In one embodiment, the ciphertext database is a blockchain database.
[0019] In one implementation, the homomorphic processor receives an interface call request sent by the target database through a decrypted interface address, including:
[0020] The homomorphic processor establishes an HTTP connection channel with the target database;
[0021] The homomorphic processor receives, through the HTTP connection channel, an interface call request sent by the target database through the decrypted interface address, where the interface call request is an HTTP request.
[0022] A data query method based on a homomorphic encryption algorithm, the method comprising:
[0023] The application side generates a data processing request, wherein the data processing request includes a decryption interface address of the homomorphic processor and data request content;
[0024] The application terminal sends the data processing request to the target database, so that the target database sends an interface call request to the homomorphic processor through the decryption interface address, and the interface call request includes the data request content;
[0025] The application end receives the decrypted data fed back by the target database, wherein the decrypted data is the data decrypted after the homomorphic processor performs ciphertext homomorphic calculation on the ciphertext in response to the interface call request.
[0026] A data query system based on a homomorphic encryption algorithm, the data query system comprising an application end, a target database and a homomorphic processor:
[0027] The application generates a data processing request, wherein the data processing request includes a decryption interface address of the homomorphic processor and data request content;
[0028] The target database is used to respond to the data processing request and send an interface call request to the homomorphic processor through the decryption interface address, wherein the interface call request includes the data request content;
[0029] The homomorphic processor is used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data;
[0030] The target database is also used to receive the decrypted data sent by the homomorphic processor and send the decrypted data to the application end.
[0031] A data query device based on a homomorphic encryption algorithm, the method comprising:
[0032] A receiving module, used for receiving an interface call request sent by a target database through a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program end;
[0033] A processing module, used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data;
[0034] The sending module is used to feed back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end.
[0035] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data query method based on the homomorphic encryption algorithm when executing the computer program.
[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned data query method based on the homomorphic encryption algorithm.
[0037] In the scheme provided by the data query method, device, system, computer equipment and storage medium based on the homomorphic encryption algorithm, the homomorphic processor receives the interface call request sent by the target database through the decryption interface address, and the interface call request includes the data request content; the interface call request is sent by the target database in response to the data processing request sent by the application end; the homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content; the homomorphic processor performs homomorphic calculation on the ciphertext data and then decrypts it to obtain the decrypted data; the homomorphic processor feeds back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end. The application end does not interact with the homomorphic encryption machine, and realizes the direct interconnection and data interaction between the target database and the homomorphic encryption machine, effectively reducing the pressure of carrying a large amount of data due to the JDBC connection, and can effectively improve the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 This is a system framework diagram of a data query system based on a homomorphic encryption algorithm in one embodiment of the present application;
[0040] Figure 2 This is a flow chart of a data query method based on a homomorphic encryption algorithm in one embodiment of the present application;
[0041] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S102;
[0042] Figure 4 is another flow chart of a data query method based on a homomorphic encryption algorithm in one embodiment of the present application;
[0043] Figure 5 It is a structural diagram of a data query device based on a homomorphic encryption algorithm in one embodiment of the present application;
[0044] Figure 6It is another structural schematic diagram of a data query device based on a homomorphic encryption algorithm in one embodiment of the present application;
[0045] Figure 7 is a structural schematic diagram of a computer device in one embodiment of the present application;
[0046] Figure 8 It is another structural schematic diagram of a computer device in one embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] The data query method based on the homomorphic encryption algorithm provided in the embodiment of the present application can be applied to Figure 1 In a data query system based on a homomorphic encryption algorithm, the data query system includes an application end, a homomorphic processor, a target database, and may also include a ciphertext database, wherein the application end generates a data processing request, the data processing request includes the decryption interface address of the homomorphic processor and the data request content; the target database is used to respond to the data processing request, and send an interface call request to the homomorphic processor through the decryption interface address, the interface call request includes the data request content; the homomorphic processor is used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain the decrypted data; the target database is also used to receive the decrypted data sent by the homomorphic processor, and send the decrypted data to the application end. The above-mentioned application end may include but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The same encryption machine can be implemented with an independent server or a server cluster consisting of multiple servers.
[0049] The inventors have discovered that the homomorphic encryption algorithm can be used to encrypt numbers into ciphertext strings to implement data operations, and digital ciphertext encryption can be achieved by calling the homomorphic processor from the application side. However, as the amount of ciphertext recorded data increases, the amount of data that can be processed directly by the application segment calling the homomorphic processor is huge, which will lead to low data processing efficiency. It is no longer suitable to directly use the application segment to call the homomorphic processor to process data. Based on this, the applicant provides a new data query method based on the homomorphic encryption algorithm, which are explained below.
[0050] In one embodiment, if Figure 2 As shown, a data query method based on homomorphic encryption algorithm is provided, and this method is applied in Figure 1 The homomorphic processor in is used as an example to illustrate, including the following steps:
[0051] S101: The homomorphic processor receives an interface call request sent by a target database via a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program.
[0052] S102: The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content.
[0053] S103: The homomorphic processor performs homomorphic calculation on the ciphertext data and then decrypts the ciphertext data to obtain decrypted data.
[0054] S104: The homomorphic processor feeds back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end.
[0055] For step S101, the application end refers to a terminal device with an application installed. Exemplarily, the application is a JAVA application. In some embodiments, the application end can establish a communication relationship with a target database. Exemplarily, the application end can interact with the target database through Java Database Connection Technology (JDBC). Exemplarily, the above-mentioned target database can be an Oracle database.
[0056] Among them, the homomorphic processor is a server that can encrypt plaintext data and perform homomorphic operations and decryption on ciphertext data. It should be noted that in many application scenarios, the data between the application end and certain storage servers is required to be confidential. In the current practice, it is usually directly used by the application end to call the homomorphic processor to realize the encryption of plaintext data and operations such as output and storage. However, with the increase in the amount of data, this method has obvious limitations.
[0057] Therefore, in the embodiment of the present invention, when the application side needs to obtain the ciphertext data stored in the ciphertext database, the application side will send a data processing request to the target database, and the data processing request includes the decryption interface address of the homomorphic processor and the data request content. The data request content is also used to request the content of the ciphertext data stored in the ciphertext database, and the decryption interface address is an interface that can call the homomorphic processor to perform decryption processing and homomorphic operations. It can also be seen from here that the difference between this step and the traditional solution is that the application side in this solution does not directly call the homomorphic processor.
[0058] It should be noted that there may be a variety of ways for the application end to send the above data processing request to the Oracle database, and there are no specific limitations.
[0059] Exemplarily, taking Oracle database as an example, in some embodiments, the application side executes the constructed custom function through JDBC to send a data processing request to the Oracle database. Exemplarily, the application side sends a custom function tl_resp for HTTP request for the above data request content to the Oracle database, and the parameter passed during the call can be of clob type. Among them, the decryption interface address of the homomorphic encryption machine is: / opt / api / decrypt / BatchDouble, the format of the transmitted data can be {"enData":[""]}, and the requested data content type is application / json.
[0060] For step S101, continuing to take the target database as an Oracle database as an example, after receiving the data processing request sent by the application side, the Oracle database will respond to the data processing request of the application side, and send an interface call request to the decryption interface of the homomorphic processor through the decryption interface address, and the interface call request includes the data request content.
[0061] In one embodiment, step S101, that is, the homomorphic processor receives the interface call request sent by the target database through the decrypted interface address, specifically includes the following steps:
[0062] S1011: The homomorphic processor establishes an HTTP connection channel with the target database;
[0063] S1022: The homomorphic processor receives, through the HTTP connection channel, an interface call request sent by the target database through the decrypted interface address, where the interface call request is an HTTP request.
[0064] In this embodiment, in some embodiments, the Oracle database system can be connected to the external network through the Hypertext Transfer Protocol (HTTP) to communicate and interact with the homomorphic processor. That is to say, the Oracle database can send an HTTP type call request to the decryption interface of the homomorphic processor through the decryption interface address, that is, the Oracle database can send an HTTP request to the homomorphic encryption machine.
[0065] Specifically, in one embodiment, the Oracle database can call the UTL_HTTP package and use SQL (Structured Query Language) or PL / SQL (Procedural Query Language) to perform relevant annotations of the Hypertext Transfer Protocol (HTTP) to access the homomorphic processor. It should be noted that when the Oracle database calls the UTL_HTTP package and uses HTTPS to obtain data from a Web site (homomorphic encryption machine), it can be created through the Oracle Wallet Manager or the orapki utility.
[0066] It should be noted that Oracle database uses the UTL_HTTP package in a way that allows the use of PL / SQL programs, and the UTL_HTTP package contains functions that can be used in SQL queries. The UTL_HTTP package also supports HTTP over the Secure Sockets Layer (SSL), also known as HTTPS, which provides the necessary implementation conditions for the implementation of the solution.
[0067] It can be understood that the HTTP 1.1 protocol is one of the versions of the HTTP protocol. According to the HTTP 1.1 protocol specification, when the Oracle database uses the PL / SQL record type to indicate that the HTTP request is completed, the same processor and TCP / IP port of the persistent network connection can be maintained. Among them, the persistent network connection can be reused for subsequent HTTP requests to the same host and port, which can effectively avoid network connection delays. Therefore, subsequent HTTP requests can be completed faster. In this embodiment, the request response efficiency of the implementation process of this solution can be further guaranteed.
[0068] In some embodiments, for a direct HTTP persistent connection to a homomorphic processor, the proxy_ and proxy_port fields in the HTTP request may directly contain the host name and TCP / IP port number of the homomorphic encryption machine to facilitate the generation of the above interface call request
[0069] In some embodiments, the proxy_host and proxy_port fields are not set. Specifically, in the embodiments of the present application, the homomorphic processor can also be accessed through a proxy server. It should be noted that for the HTTP persistent network connection used by the Oracle database to connect to a proxy server, the proxy_host and proxy_port fields of the HTTP request corresponding to the persistent network connection at this time contain the host name and TCP / IP port number of the proxy server. If the proxy_host and proxy_port fields are not set, this means that when connected to this proxy server, the corresponding persistent connection is not bound to any specific homomorphic processor, and the persistent network connection with the proxy server can be used to access any homomorphic processor using the proxy. It can also be seen in this embodiment that the above scheme further expands the technical adaptability and implementation possibility of this scheme, ensuring the feasibility of the scheme.
[0070] It should be noted that in some embodiments, the field settings will be different when the Secure Sockets Layer (SSL) is being used in the persistent connection between the Oracle database and the homomorphic processor. If it is an HTTP request issued through the SSL field, that is, an HTTPS request, for an HTTPS (SSL) persistent network connection using a proxy connection, the proxy_host and proxy_port fields contain the host name and TCP / IP port number of the target homomorphic processor, and the above fields will always be set. It is understandable that the HTTPS persistent connection using the proxy server can only be reused to send another HTTP request to the same target homomorphic processor.
[0071] It can be seen from the above description that the Oracle database sends an HTTP call request to the decryption interface of the homomorphic processor through the decryption interface address, and the HTT call request contains the data request content.
[0072] For steps S20-S30, after receiving the above-mentioned interface call request, the homomorphic processor will respond to the above-mentioned interface call request, obtain the ciphertext data corresponding to the data request content from the ciphertext database, and perform homomorphic calculation on the obtained ciphertext data to perform corresponding decryption to obtain the decrypted data.
[0073] In one embodiment, before step S102, that is, before the homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content, the method further includes the following steps:
[0074] S105: The homomorphic processor receives a data upload request, where the data upload request includes plaintext data and encrypted field indication information;
[0075] S106: The homomorphic processor selects the to-be-encrypted field from the plaintext data according to the encryption field indication information;
[0076] S107: The homomorphic processor encrypts the to-be-encrypted field in the plaintext data to obtain the ciphertext data;
[0077] S108: The homomorphic processor stores the ciphertext data in a ciphertext database.
[0078] In one embodiment, if Figure 3 As shown, the data upload request also includes a homomorphic computing method; in step S102, the homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content, which specifically includes the following steps:
[0079] S1021: The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content from the ciphertext database;
[0080] S1022: The homomorphic processor performs homomorphic calculation on the ciphertext data according to the homomorphic calculation method and then decrypts the ciphertext data to obtain the decrypted data.
[0081] It should be noted that the above process includes several aspects, and it is necessary to make some explanations. In the first process, when the data upload end stores ciphertext data in the ciphertext database, it will use the homomorphic processor to encrypt the plaintext data to obtain the ciphertext data, and then place the ciphertext data in the ciphertext database. Among them, the homomorphic processor receives a data upload request, and the data upload request includes plaintext data and encryption field indication information. According to the encryption field indication information, after filtering out the to-be-encrypted fields from the plaintext data, the to-be-encrypted fields in the plaintext data are encrypted to obtain the ciphertext data and store it in the ciphertext database. In some application scenarios, the data upload request also includes a homomorphic computing method, so that when the subsequent application segment calls the ciphertext data, the homomorphic processor is triggered to perform homomorphic computing according to this homomorphic computing method.
[0082] Specifically, exemplarily, the homomorphic processor has a public key and a private key of a homomorphic encryption algorithm A. The homomorphic processor can use the public key to encrypt the plaintext data to obtain the ciphertext E(m). For the ciphertext database, it can only know the above public key and cannot decrypt the ciphertext data to obtain the ciphertext data, which ensures the security of the data stored in the ciphertext database. When it is necessary to perform some calculations on certain plaintext data based on certain business scenarios, the application side will request the calculation results of certain plaintext data, which will trigger the above interface call request to the homomorphic processor. After receiving it, the homomorphic processor executes the second process: it will obtain the ciphertext data corresponding to the data request content from the ciphertext database. In the third process, the homomorphic processor will perform homomorphic calculations on the obtained ciphertext data according to the homomorphic calculation method indicated by the application side, and use the homomorphic private key to perform corresponding decryption to obtain the decrypted data.
[0083] It should be noted that the process of homomorphic encryption calculation depends on the specific application scenario and the application requirements, which will not be explained here. For example, homomorphic calculation generally includes summing, averaging, taking maximum and minimum values, sorting, and other operations on ciphertext data.
[0084] In some embodiments, the above-mentioned ciphertext database can be a blockchain database. The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database. It is a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer. It can be further seen from this embodiment that the security and non-tamperability of ciphertext data can be further guaranteed through blockchain technology.
[0085] For step S104, after obtaining the above-mentioned decrypted data, the homomorphic processor feeds back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end. In this way, the application end obtains the decrypted data that is finally calculated and decrypted by the homomorphic processor.
[0086] In one embodiment, after the homomorphic processor obtains the above-mentioned decrypted data, it will not directly feed back to the application end, because this will undoubtedly increase the workload of the application end carrying more data, but will feed back the decrypted data to the Oracle database, and the Oracle database obtains the response result corresponding to the data processing request based on the decrypted data, and feeds back the response result to the application end. Among them, the decrypted data obtained by the homomorphic processor is only the data after decrypting the ciphertext data after homomorphic calculation. The Oracle database obtains the response result corresponding to the data processing request based on the decrypted data, such as filtering, encapsulating, compressing and other operations on the decrypted data to obtain the above-mentioned response result, and then feeds back to the application end. At this point, the application end has obtained the response data corresponding to the request and performs subsequent business operations.
[0087] Through the above scheme, it can be seen that this scheme provides a data query method based on the homomorphic encryption algorithm. Compared with the traditional scheme, the application side does not implement JDBC interaction with the homomorphic processor, and realizes direct Internet data interaction between the Oracle database and the homomorphic processor, which effectively reduces the pressure of JDBC carrying large amounts of data; because it is the interaction between the Oracle database and the homomorphic processor to realize homomorphic calculation, decryption and other processes, the intermediate processing links brought by the process of the application side backend calling the homomorphic encryption machine are omitted, which reduces the burden on the application side; it realizes direct calculation between encrypted ciphertext data from the database level, which is a new technical means.
[0088] In one embodiment, if Figure 2 As shown, a data query method based on homomorphic encryption algorithm is provided, and this method is applied in Figure 1 The homomorphic processor in is used as an example to illustrate, including the following steps:
[0089] S201: The application generates a data processing request, wherein the data processing request includes a decryption interface address of a homomorphic processor and data request content;
[0090] S202: The application terminal sends the data processing request to a target database, so that the target database sends an interface call request to the homomorphic processor through the decrypted interface address, wherein the interface call request includes the data request content;
[0091] S203: The application terminal receives the decrypted data fed back by the target database, wherein the decrypted data is the data obtained by the homomorphic processor in response to the interface call request and decrypting the ciphertext data corresponding to the data request content after performing ciphertext homomorphic calculation.
[0092] For steps S201-S203, the application side is the content. When the application side needs to obtain the ciphertext data stored in the ciphertext database, the application side will send a data processing request to the target database, and the data processing request includes the decryption interface address of the homomorphic processor and the data request content. The data request content is also the content used to request the ciphertext data stored in the ciphertext database. The decryption interface address is an interface that can call the homomorphic processor to perform decryption processing and homomorphic operation. After receiving the data processing request sent by the application side, the target database will respond to the data processing request of the application side, and send an interface call request to the decryption interface of the homomorphic processor through the decryption interface address, and the interface call request includes the data request content. After receiving the above interface call request, the homomorphic processor will respond to the above interface call request, obtain the ciphertext data corresponding to the data request content from the ciphertext database, and perform homomorphic calculation on the obtained ciphertext data to perform corresponding decryption, obtain decrypted data, and then feed the decrypted data back to the target database, so that the target database feeds the decrypted data back to the application side.
[0093] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0094] In one embodiment, a data query system based on a homomorphic encryption algorithm is also provided, including:
[0095] The application generates a data processing request, wherein the data processing request includes a decryption interface address of the homomorphic processor and data request content;
[0096] The target database is used to respond to the data processing request and send an interface call request to the homomorphic processor through the decryption interface address, wherein the interface call request includes the data request content;
[0097] The homomorphic processor is used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data;
[0098] The target database is also used to receive the decrypted data sent by the homomorphic processor and send the decrypted data to the application end.
[0099] Among them, more details of the above-mentioned application end, target database and the homomorphic processor can be found in the corresponding description of the aforementioned method embodiment, and will not be repeated here.
[0100] In one embodiment, the data query system based on the homomorphic encryption algorithm may also include a ciphertext database, which is used to store the above-mentioned ciphertext data.
[0101] In one embodiment, the ciphertext database is a blockchain database. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer. It can be further seen from this embodiment that the security and non-tamperability of ciphertext data can be further guaranteed through blockchain technology.
[0102] In one embodiment, the target database is an Oracle database. In one embodiment, an HTTP channel can be established between the Oracle database and the homomorphic processor to perform HTTP interaction.
[0103] Through the above scheme, it can be seen that this scheme provides a data query system based on the homomorphic encryption algorithm. Compared with the traditional scheme, the application side does not implement JDBC interaction with the homomorphic processor, and realizes direct Internet data interaction between the Oracle database and the homomorphic processor, which effectively reduces the pressure of JDBC carrying large amounts of data; because it is the interaction between the Oracle database and the homomorphic processor to realize homomorphic calculation, decryption and other processes, the intermediate processing links brought by the process of the application side backend calling the homomorphic encryption machine are omitted, which reduces the burden on the application side; it realizes direct calculation between encrypted ciphertext data from the database level, which is a new technical means.
[0104] In one embodiment, a data query device based on a homomorphic encryption algorithm is provided, and the data query device based on a homomorphic encryption algorithm corresponds one-to-one to the homomorphic processor in the data query method based on a homomorphic encryption algorithm in the above embodiment. Figure 5 As shown, the data query device based on the homomorphic encryption algorithm includes a receiving module 101, a processing module 102 and a sending module 103. Each functional module is described in detail as follows:
[0105] The receiving module 101 is used to receive an interface call request sent by a target database through a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program end;
[0106] The processing module 102 is used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data;
[0107] The sending module 103 is used to feed back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end.
[0108] In one embodiment, the receiving module is further used to receive a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information;
[0109] The processing module 102 is further configured to:
[0110] According to the encryption field indication information, filter out the field to be encrypted from the plaintext data;
[0111] Encrypting the to-be-encrypted field in the plaintext data to obtain the ciphertext data;
[0112] The ciphertext data is stored in a ciphertext database.
[0113] In one embodiment, the processing module 102 is further configured to:
[0114] In response to the interface call request, obtaining the ciphertext data corresponding to the data request content from the ciphertext database;
[0115] According to the homomorphic computing method, the ciphertext data is homomorphically computed and then decrypted to obtain the decrypted data.
[0116] In one embodiment, the ciphertext database is a blockchain database.
[0117] In one embodiment, the receiving module 101 is further configured to:
[0118] Establishing an HTTP connection channel with the target database;
[0119] An interface call request sent by the target database through the decrypted interface address is received through the HTTP connection channel, wherein the interface call request is an HTTP request.
[0120] In one embodiment, a data query device based on a homomorphic encryption algorithm is provided, and the data query device based on a homomorphic encryption algorithm corresponds one-to-one to the application end in the data query method based on a homomorphic encryption algorithm in the above embodiment. Figure 6 As shown, the data query device based on the homomorphic encryption algorithm includes a processing module 201, a sending module 202 and a receiving module 203. Each functional module is described in detail as follows:
[0121] The processing module 201 is used to generate a data processing request, wherein the data processing request includes a decryption interface address of a homomorphic processor and data request content;
[0122] A sending module 202, configured to send the data processing request to a target database, so that the target database sends an interface call request to the homomorphic processor through the decryption interface address, wherein the interface call request includes the data request content;
[0123] The receiving module 203 is used to receive the decrypted data fed back by the target database, wherein the decrypted data is the data obtained by the homomorphic processor responding to the interface call request and decrypting the ciphertext data corresponding to the data request content after performing ciphertext homomorphic calculation.
[0124] For the specific limitations on the data query device based on the homomorphic encryption algorithm, please refer to the limitations on the corresponding homomorphic processor or application program in the data query method based on the homomorphic encryption algorithm mentioned above, which will not be repeated here. Each module in the above-mentioned data query device based on the homomorphic encryption algorithm can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0125] In one embodiment, a computer device is provided. The computer device may be a homomorphic processor, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external target database through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of a homomorphic processor in a data query method based on a homomorphic encryption algorithm.
[0126] In one embodiment, a computer device is provided. The computer device may be an application terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with the target database through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of the application end in a data query method based on a homomorphic encryption algorithm.
[0127] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0128] Receiving an interface call request sent by a target database through a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program end;
[0129] Responding to the interface call request, obtaining the ciphertext data corresponding to the data request content;
[0130] Decrypting the ciphertext data after performing homomorphic calculation to obtain decrypted data;
[0131] The decrypted data is fed back to the target database, so that the target database feeds the decrypted data back to the application end.
[0132] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0133] Receiving an interface call request sent by a target database through a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program end;
[0134] Responding to the interface call request, obtaining the ciphertext data corresponding to the data request content;
[0135] Decrypting the ciphertext data after performing homomorphic calculation to obtain decrypted data;
[0136] The decrypted data is fed back to the target database, so that the target database feeds the decrypted data back to the application end.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0138] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0139] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data query method based on homomorphic encryption algorithm, characterized in that: The method comprises: The homomorphic processor receives an interface call request sent by the target database through the decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by the application program end; The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content; The homomorphic processor performs homomorphic calculation on the ciphertext data and then decrypts the ciphertext data to obtain decrypted data; The homomorphic processor feeds back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end; Before the homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content, the method further includes: The homomorphic processor receives a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information; The homomorphic processor selects the to-be-encrypted field from the plaintext data according to the encryption field indication information; The homomorphic processor encrypts the to-be-encrypted field in the plaintext data to obtain the ciphertext data; The homomorphic processor stores the ciphertext data in a ciphertext database.
2. The data query method based on the homomorphic encryption algorithm according to claim 1, characterized in that: The data upload request also includes a homomorphic computing method; the homomorphic processor responds to the interface call request to obtain the ciphertext data corresponding to the data request content, including: The homomorphic processor responds to the interface call request and obtains the ciphertext data corresponding to the data request content from the ciphertext database; The homomorphic processor performs homomorphic calculation on the ciphertext data according to the homomorphic calculation method and then decrypts the ciphertext data to obtain the decrypted data.
3. The data query method based on homomorphic encryption algorithm according to claim 1, characterized in that: The ciphertext database is a blockchain database.
4. The data query method based on homomorphic encryption algorithm according to claim 1, characterized in that: The homomorphic processor receives an interface call request sent by the target database through a decrypted interface address, including: The homomorphic processor establishes an HTTP connection channel with the target database; The homomorphic processor receives, through the HTTP connection channel, an interface call request sent by the target database through the decrypted interface address, where the interface call request is an HTTP request.
5. A data query method based on homomorphic encryption algorithm, characterized in that: The method comprises: The application side generates a data processing request, wherein the data processing request includes a decryption interface address of the homomorphic processor and data request content; The application terminal sends the data processing request to the target database, so that the target database sends an interface call request to the homomorphic processor through the decryption interface address, and the interface call request includes the data request content; The application terminal receives the decrypted data fed back by the target database, wherein the decrypted data is the data obtained by the homomorphic processor in response to the interface call request and decrypting the ciphertext data corresponding to the data request content after performing ciphertext homomorphic calculation; The target database is obtained by the homomorphic processor through the following processing: The homomorphic processor receives a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information; The homomorphic processor selects the to-be-encrypted field from the plaintext data according to the encryption field indication information; The homomorphic processor encrypts the to-be-encrypted field in the plaintext data to obtain the ciphertext data; The homomorphic processor stores the ciphertext data in a ciphertext database.
6. A data query system based on homomorphic encryption algorithm, characterized in that: The data query system includes an application terminal, a target database and a homomorphic processor: The application generates a data processing request, wherein the data processing request includes a decryption interface address of the homomorphic processor and data request content; The target database is used to respond to the data processing request and send an interface call request to the homomorphic processor through the decryption interface address, wherein the interface call request includes the data request content; The homomorphic processor is used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data; The target database is further used to receive the decrypted data sent by the homomorphic processor and send the decrypted data to the application end; The homomorphic processor is also used for: receiving a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information; According to the encryption field indication information, filter out the field to be encrypted from the plaintext data; Encrypting the to-be-encrypted field in the plaintext data to obtain the ciphertext data; The ciphertext data is stored in a ciphertext database.
7. A data query device based on a homomorphic encryption algorithm, characterized in that: The device comprises: A receiving module, used for receiving an interface call request sent by a target database through a decrypted interface address, wherein the interface call request includes data request content; the interface call request is sent by the target database in response to a data processing request sent by an application program end; A processing module, used to respond to the interface call request, obtain the ciphertext data corresponding to the data request content, perform homomorphic calculation on the ciphertext data and then decrypt it to obtain decrypted data; A sending module, used for feeding back the decrypted data to the target database, so that the target database feeds back the decrypted data to the application end; Before responding to the interface call request and obtaining the ciphertext data corresponding to the data request content, the device is further used to: receiving a data upload request, wherein the data upload request includes plaintext data and encrypted field indication information; According to the encryption field indication information, filter out the field to be encrypted from the plaintext data; Encrypting the to-be-encrypted field in the plaintext data to obtain the ciphertext data; The ciphertext data is stored in a ciphertext database.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data query method based on the homomorphic encryption algorithm as described in any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data query method based on the homomorphic encryption algorithm as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Frequentness measuring method and system for security and privacy protection facing cloud data issuing
CN106534313A
Quasi-fully homomorphic ciphertext data operation method and system
CN107592195A