Data processing methods, apparatus and electronic equipment

By determining the binary coefficients in the database server and performing binary addition calculations, the problem of low efficiency in query processing operations of fully homomorphic encryption algorithms is solved, thereby improving the efficiency and quality of data queries.

CN121351095BActive Publication Date: 2026-06-30BEIJING PUSH TIMES TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511307974.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2026-06-30
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

Existing fully homomorphic encryption algorithms are inefficient in query processing operations, resulting in low efficiency in data query processing operations.

Method used

By retrieving information query requests from the database server, querying the target encrypted data and determining the halving coefficient, and using the addition of the halvings to calculate the sum of the encrypted data, the number of accumulation operations is reduced to improve query efficiency.

Benefits of technology

It effectively improves the quality and efficiency of information retrieval, reduces computational complexity, and enhances the practicality of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121351095B_ABST
    Figure CN121351095B_ABST
Patent Text Reader

Abstract

This application provides a data processing method, apparatus, and electronic device. The data processing method includes: obtaining an information query request sent by a requesting end; querying a database server to obtain at least one target encrypted data matching the information query request, wherein the target encrypted data is numerical data, corresponds to slot information, and is encrypted using a fully homomorphic encryption algorithm; determining a binary coefficient for accumulating the at least one target encrypted data; performing binary addition on the at least one target encrypted data based on the binary coefficient to determine the sum of encrypted data matching the information query request; and returning the sum of encrypted data and the quantity information of the at least one target encrypted data to the requesting end. In this application embodiment, the binary addition algorithm is used to implement the data query operation, effectively saving the query time required for the information query operation, thereby improving the data query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus and electronic device. Background Technology

[0002] With the rapid development of new-generation information technology, database technology is widely used to meet the demands of large-scale data processing. Currently, when data holders use third-party database services, they need to encrypt the data before uploading it to prevent privacy leaks. To enable computations to be performed on the encrypted data, a fully homomorphic encryption algorithm is required to encrypt the uploaded data.

[0003] However, when using existing query algorithms to perform query processing operations on encrypted data stored in database servers, the query processing operation is inefficient. Summary of the Invention

[0004] This application provides a data processing method, apparatus, and electronic device that can improve the quality and efficiency of data query operations.

[0005] In a first aspect, embodiments of the present invention provide a data processing method, including:

[0006] Retrieve the information query request sent by the requesting party;

[0007] In the database server, at least one target encrypted data matching the information query request is obtained. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted using a fully homomorphic encryption algorithm.

[0008] Determine the halving coefficients used for the cumulative calculation of the at least one target encrypted data;

[0009] Based on the halving coefficient, the at least one target encrypted data is halved and summed to determine the total amount of encrypted data that matches the information query request;

[0010] The total amount of the encrypted data and the quantity information of the at least one target encrypted data are returned to the requesting end.

[0011] Secondly, embodiments of the present invention provide a data processing apparatus, comprising:

[0012] The first acquisition module is used to acquire information query requests sent by the requesting end.

[0013] The first query module is used to query the database server to obtain at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted using a fully homomorphic encryption algorithm.

[0014] The first determining module is used to determine the halving coefficient used for accumulating the at least one target encrypted data;

[0015] The first determining module is used to perform a binary addition calculation on the at least one target encrypted data based on the binary coefficient to determine the sum of encrypted data that matches the information query request;

[0016] The first sending module is used to return the sum of the encrypted data and the quantity information of the at least one target encrypted data to the requesting end.

[0017] Thirdly, embodiments of the present invention provide a data processing method, including:

[0018] Obtain the numerical information corresponding to each of the multiple data to be encrypted, as well as the maximum value among the multiple numerical information;

[0019] Based on the numerical information and the maximum value information, the plurality of data to be encrypted are encoded into at least one plaintext data;

[0020] The at least one plaintext data is encrypted using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to the plurality of data to be encrypted;

[0021] The at least one encrypted data is sent to a database server for storage.

[0022] Fourthly, embodiments of the present invention provide a data processing apparatus, comprising:

[0023] The second acquisition module is used to acquire the numerical information corresponding to each of the multiple data to be encrypted, as well as the maximum value information among the multiple numerical information;

[0024] The second encoding module is used to encode the plurality of data to be encrypted into at least one plaintext data based on the numerical information and the maximum value information;

[0025] The second encryption module is used to encrypt the at least one plaintext data using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to the plurality of data to be encrypted.

[0026] The second sending module is used to send the at least one encrypted data to a database server for storage.

[0027] Fifthly, embodiments of the present invention provide an electronic device, including: a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the data processing method in the first or third aspect described above.

[0028] In a sixth aspect, embodiments of the present invention provide a computer storage medium for storing a computer program, which, when executed by a computer, implements the data processing method described in the first or third aspect above.

[0029] In a seventh aspect, embodiments of the present invention provide a computer program product, comprising: a computer program that, when executed by a processor of an electronic device, causes the processor to perform the steps in the data processing method described in the first or third aspect above.

[0030] The data processing method, apparatus, and electronic device provided in this invention obtain an information query request sent by a requesting end. Based on the information query request, a database server is queried to obtain at least one target encrypted data of a numerical type that matches the information query request. Since the number of target encrypted data is often multiple, and it is not the final result that the information query request needs to return, in order to further ensure the quality and efficiency of the information query operation, a halving coefficient can be determined for the accumulation calculation of the at least one target encrypted data. Then, based on the halving coefficient, the at least one target encrypted data is calculated by halving and adding it to determine the sum of encrypted data that matches the information query request. Finally, the sum of encrypted data and the quantity information of the at least one target encrypted data are returned to the requesting end. Since the sum of encrypted data is the final result that the information query request needs to return, it is determined by the halving and adding of at least one target encrypted data using a halving algorithm. This effectively reduces the number of accumulation operations required to determine the sum of encrypted data and the time required, thereby reducing computational complexity, effectively improving the quality and efficiency of information query, further improving the practicality of the method, and facilitating market promotion and application. Attached Figure Description

[0031] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0032] Figure 1 A schematic diagram illustrating the principle of a data processing method provided for an exemplary embodiment of this application;

[0033] Figure 2A flowchart illustrating a data processing method provided for an exemplary embodiment of this application;

[0034] Figure 3 A schematic flowchart illustrating the determination of the halving factor provided for an exemplary embodiment of this application;

[0035] Figure 4 A schematic diagram of a process for querying target encrypted data provided in an exemplary embodiment of this application;

[0036] Figure 5 A flowchart illustrating another data processing method provided for an exemplary embodiment of this application;

[0037] Figure 6 A flowchart illustrating a data processing method provided for an exemplary embodiment of this application;

[0038] Figure 7 A flowchart illustrating another data processing method provided for an exemplary embodiment of this application;

[0039] Figure 8 A schematic diagram of the structure of a data processing apparatus provided for an exemplary embodiment of this application;

[0040] Figure 9 A schematic diagram of the structure of an electronic device corresponding to a data processing apparatus provided in an exemplary embodiment of this application;

[0041] Figure 10 A schematic diagram of the structure of another data processing apparatus provided in an exemplary embodiment of this application;

[0042] Figure 11 This is a schematic diagram of the structure of an electronic device corresponding to another data processing apparatus, provided as an exemplary embodiment of this application. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0045] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. “Multiple” generally includes at least two. “” is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character “ / ” in this document generally indicates that the preceding and following related objects are in an “or” relationship.

[0046] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0047] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes that element.

[0048] Terminology definition:

[0049] Fully homomorphic encryption is an encryption technique that allows computations to be performed directly on ciphertext (i.e., encrypted data) without decryption. The final decrypted computation result is identical to the result of performing the same computation directly on the original unencrypted data.

[0050] To facilitate understanding of the data processing methods, apparatus, and electronic devices provided in the embodiments of this application, the relevant technologies are briefly described below:

[0051] In recent years, cloud computing has received widespread attention due to its powerful computing capabilities, enabling users to perform complex calculations. To protect the privacy of user data, fully homomorphic encryption algorithms have emerged. Mathematically, homomorphism can be understood as preserving operations; that is, performing a computation followed by homomorphism yields the same result as performing homomorphism followed by computation. Fully homomorphic encryption is a special encryption scheme that protects the privacy of user data through encryption and allows the server to perform any computable operation on the ciphertext. Computable operations include addition and multiplication, and the result is in ciphertext form, which yields the same result as performing the same operation on the corresponding plaintext.

[0052] Fully homomorphic encryption, as a privacy-preserving computing solution, has been widely used in various industries. However, current fully homomorphic encryption algorithms suffer from low efficiency in homomorphic computation, and the storage space occupied by a single ciphertext is unaffected by the amount of plaintext data, resulting in low storage efficiency in existing fully homomorphic encryption algorithms.

[0053] To address the aforementioned technical problems, embodiments of this application provide a data processing method, apparatus, and electronic device, as detailed in the appendix. Figure 1 As shown, the execution entity of this data processing method can be a database server 200, which can be implemented as a local server, a cloud server, etc. When the database server 200 is implemented as a cloud server, the data processing method can be executed in the cloud. Several computing processes (cloud servers) can be deployed in the cloud, each with computing and storage resources. In the cloud, multiple computing processes can be organized to provide a certain service; of course, a single computing process can also provide one or more services. The cloud can provide this service by providing an external service interface, which users can call to use the corresponding service. Service interfaces include Software Development Kits (SDKs), Application Programming Interfaces (APIs), etc.

[0054] The database server 200 is communicatively connected to the requesting client 100, which sends information query requests to the database server 200. Specifically, the requesting client 100 can be a mobile phone, a personal computer (PC), a tablet computer, a configuration application, etc. Furthermore, the basic structure of the requesting client 100 and the database server 200 may include at least one processor. The number of processors depends on the client's configuration and type. The requesting client 100 and the database server 200 may also include memory, which can be volatile, such as Random Access Memory (RAM), or non-volatile, such as Read-Only Memory (ROM), flash memory, etc., or both types. The memory typically stores the operating system (OS), one or more applications, and may also store program data. In addition to the processing unit and memory, the requesting client 100 also includes some basic configurations, such as a network interface card (NIC) chip, an I / O bus, a display component, and some peripheral devices. Optionally, some peripheral devices may include, for example, a keyboard, a mouse, a stylus, a printer, etc. Other peripheral devices are well known in the art and will not be described in detail here.

[0055] In this embodiment described above, the requesting client 100 and the database server 200 establish a network connection, which can be a wireless or wired network connection. If the requesting client 100 and the database server 200 establish a communication connection, the network standard of the mobile network can be any one of 2G (Global System for Mobile Communications GSM), 2.5G (General Packet Radio Service GPRS), 3G (Wideband Code Division Multiple Access (WCDMA), Time Division Synchronous Code Division Multiple Access (TD-SCDMA), 4G (Long Term Evolution LTE), 4G+ (Enhanced Long Term Evolution LTE+), Global Microwave Access Interoperability (WiMax), 5G, 6G, etc.

[0056] In this embodiment, the requesting end 100 can generate an information query request. Specifically, the requesting end 100 can display a human-computer interaction interface or an information configuration interface. Users can input execution operations on the human-computer interaction interface or configuration operations on the information configuration interface. Based on the obtained execution operations or configuration operations, an information query request can be generated. In order to realize the information query operation, the generated information query request can be sent to the database server 200. After the database server 200 performs the query, the requesting end 100 can receive the total amount of encrypted data and the quantity information of at least one target encrypted data returned by the database server 200. Based on the obtained total amount of encrypted data and the quantity information of at least one target encrypted data, the information query result is determined, thereby completing the information query operation.

[0057] Database server 200 is used to obtain information query requests sent by requesting end 100. Based on the information query request, it queries and obtains at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted by a fully homomorphic encryption algorithm. Then, it determines the halving coefficient used to perform the summation calculation on at least one target encrypted data. Then, it performs a halving summation calculation on at least one target encrypted data based on the halving coefficient to determine the sum of encrypted data that matches the information query request. Finally, it returns the obtained sum of encrypted data and the quantity information of at least one target encrypted data to requesting end 100.

[0058] In this embodiment, the sum of encrypted data is obtained by performing a binary addition operation on at least one target encrypted data using a binary algorithm. This effectively reduces the number of accumulation operations required to determine the sum of encrypted data and the time required, thereby reducing computational complexity and effectively improving the quality and efficiency of information retrieval. This further enhances the practicality of the method and is conducive to its promotion and application in the market.

[0059] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Where there is no conflict between the embodiments, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0060] Figure 2 A schematic flowchart of a data processing method provided for an exemplary embodiment of this application; see attached document. Figure 2As shown, this embodiment provides a data processing method. The execution subject of this method can be a data processing device, which can be implemented as software or a combination of software and hardware. When the data processing device is implemented as hardware, it can specifically be various electronic devices capable of performing data processing operations, including but not limited to personal computers, servers, etc. When the data processing device is implemented as software, it can be installed in the electronic devices exemplified above. For ease of understanding, a database server is used as an example for the following description. Specifically, the data processing method provided in this embodiment may include:

[0061] Step S201: Obtain the information query request sent by the requesting end.

[0062] Step S202: In the database server, query and obtain at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data has corresponding slot information, and the target encrypted data is encrypted by a fully homomorphic encryption algorithm.

[0063] Step S203: Determine the halving coefficients used for accumulating at least one target encrypted data.

[0064] Step S204: Perform a binary summation calculation on at least one target encrypted data based on the binary coefficient to determine the total encrypted data that matches the information query request.

[0065] Step S205: Return the total amount of encrypted data and the quantity information of at least one target encrypted data to the requesting end.

[0066] The specific implementation methods and principles of each of the above steps are explained in detail below:

[0067] Step S201: Obtain the information query request sent by the requesting end.

[0068] The requesting end refers to the terminal device that communicates with the database server, such as a mobile phone, tablet, or desktop computer. An information query request is a request to query encrypted data stored in the database server. The information query request may include the requesting end's identity information and detailed query conditions. Query conditions are used to filter the encrypted data in the database; for example, query conditions may include: age range, specific age information, length of service at the company, department, employee ID range, etc.

[0069] In some instances, the requesting client can generate information query requests based on user configuration or execution operations and send these requests to the database server. Specifically, the requesting client can provide a service interface for information query services. Users can call this service interface through the requesting client to send information query requests to the database server. The database server includes multiple computing nodes. Based on the received information query request, the database server determines the computing node that should respond to the request and uses the processing resources of that computing node to execute the specific information query service operation.

[0070] In other instances, the third device communicates with the database server through the requesting end. In this case, the requesting end can obtain the information query request through the third device and send the obtained information query request to the database server, so that the database server can perform information query operation based on the information query request and send the returned result to the third device through the requesting end.

[0071] Step S202: In the database server, query and obtain at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data has corresponding slot information, and the target encrypted data is encrypted by a fully homomorphic encryption algorithm.

[0072] After receiving an information query request, a data query operation can be performed on the database server based on the request. Since the data stored on the database server is encrypted using a fully homomorphic encryption algorithm (which satisfies both additive and multiplicative homomorphism), the result of the data query operation is at least one target encrypted data matching the information query request. This target encrypted data refers to the encrypted data in the database that matches the query conditions in the information query request, and it is stored in the database as encrypted data.

[0073] Furthermore, the target encrypted data is numerical data, such as salary values, years of service, performance indicators, etc. In addition, since a database server can store multiple ciphertexts, any ciphertext can contain multiple encrypted data, and different ciphertexts can contain different encrypted data, in order to accurately perform data processing operations, the encrypted data in the database server often corresponds to slot information. Slot information refers to the location information of each encrypted data in a ciphertext. For example, assuming a ciphertext contains 4096 encrypted data, then each of the 4096 encrypted data has its own corresponding storage location in the ciphertext, and the slot information is the storage location information of each encrypted data in the ciphertext.

[0074] Furthermore, the encrypted data in the database server is obtained by the data uploader through encrypted uploading. The data uploader can be the aforementioned requester, or the data uploader and the aforementioned requester can be implemented as different devices. In order to enable data query operations, before retrieving at least one target encrypted data matching the information query request, the data uploader can first obtain the data to be uploaded, encrypt all the data to be uploaded based on a fully homomorphic encryption algorithm, obtain the encrypted data to be uploaded, and then upload the encrypted data to be uploaded to the database server for storage, so that the data uploader or different requesters can perform data query or data processing operations.

[0075] Step S203: Determine the halving coefficients used for accumulating at least one target encrypted data.

[0076] Since the at least one target encrypted data obtained from the query is not the query result that the information query request needs to return, and the query result needs to be obtained by accumulating the at least one target encrypted data, in order to improve the quality and efficiency of obtaining the query result, a halving coefficient can be determined for accumulating the at least one target encrypted data.

[0077] In some instances, the requesting client can display an information configuration interface to the user, where the user can input configuration operations for the halving coefficients. Based on this configuration, the halving coefficients used for the cumulative calculation of at least one target encrypted data can be determined. The requesting client can then send the user-configured halving coefficients to the database server, enabling the database server to use these coefficients to perform the cumulative calculation of at least one target encrypted data.

[0078] In other instances, the database server may pre-store the halving coefficients, which are default values. When the database server needs to perform an accumulation calculation on at least one target encrypted data, it can read the pre-stored halving coefficients and use them to perform the accumulation calculation on at least one target encrypted data.

[0079] Step S204: Perform a binary summation calculation on at least one target encrypted data based on the binary coefficient to determine the total encrypted data that matches the information query request.

[0080] Since at least one target encrypted data is not the query result required by the information query request, the query result needs to be obtained by summing at least one target encrypted data. In order to improve the efficiency of determining the query result, the obtained halving coefficient can be used to perform halving summation on at least one target encrypted data to determine the total encrypted data that matches the information query request. At this time, the obtained total encrypted data refers to the sum obtained by summing all the target encrypted data.

[0081] In some instances, the target encrypted data can be represented by the coefficients of a polynomial, which are usually less than or equal to 1. In this case, the sum of the encrypted data is also realized as the sum of the coefficients of a polynomial. That is, the sum of the encrypted data is obtained by accumulating the coefficients of at least one target encrypted data corresponding to the sum of the encrypted data.

[0082] It is important to note that the data format of the ciphertext stored in the database server is related to the data format of the corresponding plaintext data. When the plaintext data is implemented as a polynomial, the ciphertext in the database server can be implemented as the coefficients of the polynomial. In this case, at least one target encrypted data can be implemented as the coefficients of the polynomial. The coefficients of at least one target encrypted data can also be determined by encrypting the coefficients of the data to be uploaded. Specifically, the coefficients of the data to be uploaded can be determined based on the values ​​of each data to be uploaded and the maximum value among all data to be uploaded. Specifically, the ratio of the value of each data to be uploaded to the maximum value can be used as the coefficient of each data to be uploaded. Then, each data to be uploaded is encrypted, and the encrypted data is uploaded to the database server. The database server then performs a query operation on the target encrypted data and performs a binary summation operation on the target encrypted data.

[0083] In other instances, where the ciphertext in the database server can be implemented as a numerical value, at least one target encrypted data obtained can be implemented as numerical information, and the sum of encrypted data can be implemented as a numerical sum greater than 1. In this case, the encrypted data uploaded by the data uploader to the database server is all in numerical form with a value greater than or equal to 1.

[0084] Step S205: Return the total amount of encrypted data and the quantity information of at least one target encrypted data to the requesting end.

[0085] After calculating the sum of encrypted data by performing a binary summation of all target encrypted data based on the binary coefficient, the total encrypted data and the quantity of all target encrypted data are returned to the requesting end. The quantity of target encrypted data can be obtained by the database server marking each retrieved target encrypted data with a sequence number during the query process, or it can be obtained by statistically analyzing all target encrypted data after the database server has retrieved all target encrypted data.

[0086] In some instances, the total number of encrypted data is one. In this case, the at least one target encrypted data obtained can come from the same ciphertext in the database server. For example, a ciphertext may include 4096 encrypted data. Among the 4096 encrypted data, there are 1000 target encrypted data. Since the 1000 target encrypted data come from different slot information in the same ciphertext, a total encrypted data can be obtained by halving and adding the 1000 target encrypted data according to the slot information. Then, the total encrypted data and the number of at least one target encrypted data can be returned to the requesting end.

[0087] In other instances, the total number of encrypted data items can be multiple. In this case, at least one target encrypted data item can be obtained from multiple ciphertexts in the database server. For example, a ciphertext can include 4096 encrypted data items, and the database server can include multiple ciphertexts, namely ciphertext A, ciphertext B, and ciphertext C. A query retrieves 3000 target encrypted data items from the database server. Ciphertext A contains 1500 target encrypted data items that match the information query request, ciphertext B contains 500, and ciphertext C contains 1000. Since these 3000 target encrypted data items come from different ciphertexts, multiple target encrypted data items belonging to the same slot in different ciphertexts can be added together according to slot information to obtain a single ciphertext. Then, all corresponding added encrypted data items in this ciphertext can be halved and added together according to slot information to obtain a total encrypted data item. The total amount of encrypted data and the quantity of the target encrypted data are then returned to the requesting end, so that the requesting end can obtain the total amount of encrypted data and the quantity of the target encrypted data. The ratio between the total amount of encrypted data and the total quantity of the target encrypted data can then be determined as the average encrypted data, thereby effectively realizing the information query operation.

[0088] In a specific application, taking a salary query request as an example and encrypted salary data as the target data, this application embodiment provides a method for querying average salary. The query conditions corresponding to the salary query request are filtering conditions used to determine whether encrypted data in the database is the target encrypted data. For example, query conditions can be: age range, specific age information, length of service at the company, department, employee ID range, etc. Taking a preset age range as an example, the method for querying average salary can include the following steps:

[0089] When the information query request is a salary query request corresponding to a preset age group, the target encrypted data is determined to be the target encrypted salary, and the sum of the encrypted data is the total encrypted salary. The total encrypted salary and the quantity information of the target encrypted salary are returned to the requesting end, so that the requesting end can determine the average salary information that matches the salary query request based on the total encrypted salary and the quantity information.

[0090] Specifically, the requesting client sends a salary query request to the database server, which includes preset age group information. Upon receiving the request, the database server retrieves at least one target encrypted salary that matches the query. Since this target encrypted salary is not the same as the average salary information required by the query (which is calculated by summing the target encrypted salaries), a halving factor is determined for this summation. Based on this factor, all target encrypted salaries are summed to determine the total encrypted salaries matching the query. The database server also needs to count the number of all target encrypted salaries to return the total encrypted salary and the count to the requesting client. After receiving the total encrypted salary and the count, the requesting client can determine the average salary for employees in the preset age group.

[0091] In some instances, where the encrypted salary sum is implemented as a polynomial with coefficients, the requesting party determines the average salary of employees in a preset age group by: decrypting the encrypted salary sum to obtain the decrypted salary sum; dividing the decrypted salary sum by the quantity information of all target encrypted salaries; and multiplying the result by the salary data with the highest salary value among all employees to obtain the average salary information of employees in the preset age group.

[0092] In other instances, where the encrypted salary sum is implemented as a numerical sum, the requesting party determines the average salary of employees in a preset age group by: decrypting the encrypted salary sum to obtain the decrypted salary sum, and then dividing the decrypted salary sum by the quantity information of all target encrypted salaries to obtain the average salary information of employees in the preset age group.

[0093] Based on the above example, when the query conditions are a preset name, preset employee number, or other unique employee information, the database server can directly query the personal salary information of the specified employee.

[0094] The data processing method provided in this embodiment obtains an information query request sent by the requesting end. Based on the information query request, it queries a database server to obtain at least one target encrypted data of a numerical type that matches the information query request. Since the number of target encrypted data is often multiple, and it is not the final result that the information query request needs to return, in order to further ensure the quality and efficiency of the information query operation, a halving coefficient can be determined for the accumulation calculation of the at least one target encrypted data. Then, based on the halving coefficient, the at least one target encrypted data is calculated by halving and adding it to determine the sum of encrypted data that matches the information query request. Finally, the sum of encrypted data and the quantity information of the at least one target encrypted data are returned to the requesting end. Since the sum of encrypted data is the final result that the information query request needs to return, it is determined by the halving and adding of at least one target encrypted data using a halving algorithm. This effectively reduces the number of accumulation operations required to determine the sum of encrypted data and the time required, thereby reducing computational complexity, effectively improving the quality and efficiency of information query, further improving the practicality of the method, and facilitating market promotion and application.

[0095] Figure 3 A flowchart illustrating the determination of the halving factor is provided as an exemplary embodiment of this application; based on the above embodiments, refer to the appendix. Figure 3 As shown, this embodiment provides a scheme for determining the halving factor based on the number of slots. In this embodiment, the method includes:

[0096] Step S301: Determine the number of slots occupied for all target encrypted data. The number of slots occupied will change dynamically as the target encrypted data is halved and added together.

[0097] The number of slots occupied refers to the number of slots occupied by encrypted data in a ciphertext, while the total number of slots refers to the sum of the number of slots in a ciphertext that can hold the target encrypted data. The total number of slots can be obtained by scanning the slot information corresponding to a ciphertext, or by analyzing the attribute information of the ciphertext. For example, if a ciphertext can hold 4096 pieces of encrypted data, the total number of slots is 4096; if a ciphertext can hold 2048 pieces of encrypted data, the total number of slots is 2048.

[0098] Because the halving operation dynamically changes the number of slots occupied, and the halving coefficient is related to the number of slots occupied (for example, after performing a halving addition operation on at least one target encrypted data, the number of slots occupied will be halved with each subsequent halving addition), to accurately implement the halving addition operation, we can first determine the number of slots occupied for all target encrypted data. The slot information for all target encrypted data may not be continuous; however, the total number of slots will not change due to the discontinuity of the slot information. For example, if 300 target encrypted data items match a query request in a ciphertext, these 300 items will occupy only 300 slots in the ciphertext, with the remaining slots empty. Therefore, the total number of slots corresponding to all encrypted data is 4096, while the number of slots occupied is 300.

[0099] Step S302: Determine half of the number of slots occupied as the halving factor used for the cumulative calculation of at least one target encrypted data.

[0100] Specifically, after the database server obtains all target encrypted data and determines the number of slots occupied for each target encrypted data, it can take half of the number of slots occupied as the halving coefficient for the next halving calculation of all target encrypted data. For example, assuming the number of slots occupied for all target encrypted data is 4096, then the halving coefficient for the first halving calculation is 4096 / 2 = 2048. Correspondingly, the halving coefficient for the second halving calculation is 2048 / 2 = 1024, the halving coefficient for the third halving calculation is 1024 / 2 = 512, and so on, until the total encrypted data of all target encrypted data is obtained.

[0101] In this embodiment, by determining half of the number of slots occupied by all target encrypted data as the halving coefficient for accumulating at least one target encrypted data, the accuracy and reliability of determining the halving coefficient are ensured. Then, the halving addition operation can be performed based on the halving coefficient, which effectively reduces the number of times the target encrypted data is accumulated, thereby improving the efficiency of the target encrypted data accumulation calculation.

[0102] Figure 4 This is a schematic diagram of a process for querying target encrypted data provided in an exemplary embodiment of this application; based on any of the above embodiments, refer to the appendix. Figure 4 As shown, for at least one target encrypted data obtained through querying, this embodiment provides an implementation method for quickly querying the target encrypted data using mask information. In this embodiment, querying the database server to obtain at least one target encrypted data matching the information query request may include:

[0103] Step S401: In the database server, query the first type of encrypted data that matches the information query request and the second type of encrypted data that does not match the information query request.

[0104] Specifically, an information query request can include the requester's identity information and detailed query conditions. For example, query conditions could include: age range, specific age information, length of service at the company, department, employee ID range, etc. Therefore, when the database server queries encrypted data stored in the database, encrypted data that matches the query conditions in the information query request is classified as Category 1 encrypted data, while encrypted data that does not match the query conditions is classified as Category 2 encrypted data.

[0105] For example, suppose the database stores encrypted data 1, encrypted data 2, encrypted data 3, encrypted data 4, and encrypted data 5. Among them, encrypted data 2, encrypted data 3, and encrypted data 5 meet the query conditions in the information query request, while encrypted data 1 and encrypted data 4 do not meet the query conditions in the information query request. Therefore, encrypted data 2, encrypted data 3, and encrypted data 5 are classified as the first type of encrypted data, and encrypted data 1 and encrypted data 4 are classified as the second type of encrypted data.

[0106] Step S402: Determine the valid mask information corresponding to the first type of encrypted data and the invalid mask information corresponding to the second type of encrypted data.

[0107] In this process, after the database server retrieves a first type of encrypted data that matches the information query request and a second type of encrypted data that does not, it can verify the validity of the first type of encrypted data by checking its mask information and designating it as a valid mask. Conversely, the database server verifies the validity of the second type of encrypted data by checking its mask information and designating it as an invalid mask. A valid mask indicates that the first type of encrypted data matches the information query request, while an invalid mask indicates that the second type of encrypted data does not match the request. For example, a valid mask can be the value 1, and an invalid mask can be the value 0.

[0108] Step S403: Perform homomorphic computation on the valid mask information and the first type of encrypted data, as well as the invalid mask information and the second type of encrypted data, to obtain at least one target encrypted data that matches the information query request.

[0109] After obtaining the valid and invalid mask information, a homomorphic computation can be performed on the valid mask information, the first type of encrypted data, the invalid mask information, and the second type of encrypted data to obtain at least one target encrypted data. In some instances, the first and second types of encrypted data can be filtered based on the valid and invalid mask information to obtain all the first type of encrypted data; then, all the first type of encrypted data can be homomorphically added according to the slot information to obtain at least one target encrypted data with corresponding slot information.

[0110] In other instances, when the valid mask information is 1 and the invalid mask information is 0, homomorphic computation is performed on the valid mask information with the first type of encrypted data, as well as the invalid mask information and the second type of encrypted data, to obtain at least one target encrypted data matching the information query request. This includes: performing homomorphic multiplication on the valid mask information with the first type of encrypted data, as well as the invalid mask information and the second type of encrypted data, to obtain at least one encrypted data result matching the information query request; and performing homomorphic addition on the at least one encrypted data result according to the slot information to obtain at least one target encrypted data matching the information query request.

[0111] For example, suppose a database server contains three ciphertexts used to encode the original data: ciphertext X, ciphertext Y, and ciphertext Z. The first type of encrypted data is represented by 'a', and the second type by 'b'. Ciphertext X is implemented as [Xa1, Xa2, Xb3, Xa4, Xb5, Xa6], ciphertext Y as [Ya1, Yb2, Yb3, Yb4, Ya5, Ya6], and ciphertext Z as [Zb1, Zb2, Zb3, Za4, Za5, Za6]. Since the effective mask information is 1 and the invalid mask information is 0, and each ciphertext corresponds to a mask vector, the effective mask information is combined with the first type of encrypted data, and the invalid mask information is combined with the second type of encrypted data. The process of performing homomorphic multiplication on the data involves performing homomorphic multiplication on each ciphertext and its corresponding mask vector. In this case, the mask vector for ciphertext X is [1,1,0,1,0,1], for ciphertext Y it's [1,0,0,0,1,1], and for ciphertext Z it's [0,0,0,1,1,1]. The result is ciphertext containing only the target encrypted data. Specifically, the three ciphertexts obtained through homomorphic multiplication are: Ciphertext X: [Xa1,Xa2,0,Xa4,0,Xa6], Ciphertext Y: [Ya1,0,0,0,Ya5,Ya6], and Ciphertext Z: [0,0,0,Za4,Za5,Za6]. This allows us to obtain at least one target encrypted data item. In this case, the number of target encrypted data items is 10.

[0112] In this embodiment, by querying all encrypted data in the database server and filtering the encrypted data based on different mask information, the accuracy of obtaining the target encrypted data is improved.

[0113] Figure 5 A schematic flowchart of another data processing method provided for an exemplary embodiment of this application; see attached diagram. Figure 5 As shown, this embodiment provides another data processing method. The execution subject of this method is a data processing device. It can be understood that the data processing device can be implemented as software, or a combination of software and hardware. When the data processing device is implemented as hardware, it can specifically be various electronic devices capable of data upload operations, including but not limited to personal computers, servers, etc. When the data processing device is implemented as software, it can be installed in the aforementioned electronic devices. In some instances, the data processing device can be implemented as a data upload terminal communicating with a database server. Specifically, the data processing method provided in this embodiment may include:

[0114] Step S501: Obtain the numerical information corresponding to each of the multiple data to be encrypted, as well as the maximum value information among the multiple numerical information.

[0115] The data to be encrypted can be data that needs to be encrypted and stored in a database server. In some scenarios, this data can include employee salary data, employee ID card numbers, employee phone numbers, employee home addresses, employee family member information, project content data for different projects within the company, or various contract data, etc. Correspondingly, the numerical information to be encrypted can be salary values, employee ID card numbers, employee phone numbers, employee home addresses, employee family member information, project content data for different projects within the company, or various contract data, etc. The number of data items to be encrypted can be 4096, 2048, or 1024, and the data uploading end can be flexibly configured according to requirements.

[0116] Specifically, the data uploader obtains multiple data to be encrypted. Since the data to be encrypted is plaintext, the maximum value among the multiple data can be obtained by analyzing and comparing the corresponding numerical information of each data. For example, the maximum salary value, the maximum length of service value, the maximum performance indicator value, etc.

[0117] Step S502: Based on the numerical information and the maximum value information, encode multiple data to be encrypted into at least one plaintext data.

[0118] Because there are multiple pieces of data to be encrypted, directly uploading them to the database would consume a large amount of storage space. Furthermore, the larger the data volume, the higher the computational complexity, leading to reduced computational efficiency and accuracy. Therefore, to solve these technical problems, multiple pieces of data to be encrypted can be encoded into at least one piece of plaintext data. Specifically, encoding operations can be performed on the multiple pieces of data to be encrypted based on numerical information and maximum value information to obtain at least one piece of plaintext data.

[0119] In some instances, the encoding operation of at least one plaintext data can be implemented based on the determined plaintext data quantity. In this case, encoding multiple data to be encrypted into at least one plaintext data based on numerical information and maximum value information may include: determining the plaintext quantity of the plaintext data corresponding to the multiple data to be encrypted; and encoding the multiple data to be encrypted into at least one plaintext data based on the plaintext quantity, numerical information, and maximum value information.

[0120] In some instances, determining the plaintext quantity of plaintext data corresponding to multiple pieces of data to be encrypted includes: determining the data quantity information of the multiple pieces of data to be encrypted and the number of slots in a single piece of ciphertext data; determining the ratio information between the data quantity information and the number of slots; and determining the plaintext quantity of plaintext data based on the ratio information. Since encrypting one piece of plaintext data yields one piece of ciphertext data, there is a one-to-one correspondence between plaintext data and ciphertext data. The plaintext quantity of plaintext data is the same as the ciphertext quantity of ciphertext data. Therefore, the plaintext quantity of plaintext data corresponding to multiple pieces of data to be encrypted can be determined by the ratio information between the data quantity information and the number of slots in a single piece of ciphertext data.

[0121] In other instances, suppose n is used. cipher The number of plaintext data corresponding to multiple pieces of data to be encrypted is represented by n. db This indicates the number of data items to be encrypted, and `slot_count` represents the number of slots in a single ciphertext data item. Based on the data item count and the number of slots in a single ciphertext data item, the plaintext data item corresponding to the multiple data items can be determined using the following formula: n cipher =(n db +slot_count-1) / slot_count effectively ensures the flexibility and reliability of determining the plaintext quantity of the plaintext data corresponding to multiple data to be encrypted.

[0122] According to the method in the above example, the database server encodes multiple data to be encrypted based on the calculated plaintext quantity, the numerical information corresponding to each of the multiple data to be encrypted, and the maximum value information among the multiple numerical information, until the plaintext encoding operation of all data to be encrypted is completed.

[0123] It's important to note that the data uploader can determine the number of encoding iterations based on the amount of plaintext. Specifically, the uploader splits the data to be encrypted into multiple encrypted data sets, with the number of encrypted data sets equal to the number of plaintext sets. Then, encoding is performed on each encrypted data set, along with the numerical information and maximum value of each data set containing the data to be encrypted, to obtain the encoding results for each data set, thus yielding multiple plaintext encoding results.

[0124] In other instances, embodiments of this application provide another scheme for encoding multiple data to be encrypted into at least one plaintext data, including: determining the encoding coefficients of multiple encoding monographs for implementing the encoding operation based on numerical information and maximum value information, wherein the encoding coefficients are the ratio of numerical information to maximum value information; and encoding the multiple data to be encrypted into at least one plaintext data based on the multiple encoding monographs.

[0125] Specifically, after the data uploading end obtains the numerical information corresponding to each of the multiple data to be encrypted, as well as the maximum value among these values, it calculates the ratio of each numerical value to the maximum value. These ratios are then used as encoding coefficients for multiple encoding units to perform the encoding operation. Based on these encoding coefficients, the encoding operation for the multiple data to be encrypted is then performed. Different data to be encrypted correspond to different encoding units, and different encoding units correspond to different encoding coefficients.

[0126] In some instances, multiple data to be encrypted are encoded into at least one plaintext data based on multiple encoding monomials, including: determining the encoding monomial corresponding to each of the multiple data to be encrypted; and accumulating multiple encoding monomials belonging to the same plaintext data to obtain at least one plaintext data.

[0127] Specifically, after calculating the ratio of each numerical information to the maximum value information, the data uploader obtains multiple encoding coefficients, each corresponding to the data to be encrypted. Then, the data uploader compares the plaintext data sequence numbers contained in each encoding coefficient, and accumulates the encoding monomials corresponding to the encoding coefficients containing the same plaintext data sequence number, thereby obtaining at least one plaintext data. For example, the data uploader can determine the ID of each data to be encrypted, and perform a round-robin encoding operation on multiple data to be encrypted according to the ID. The ID can be determined by the formula "id = i * slot_count + j", where slot_count represents the number of slots for a single plaintext or ciphertext data, i represents the i-th plaintext or ciphertext data, and j represents the j-th slot within the plaintext data. Then, the data uploader can encode the original data based on the numerical information, the maximum value information, and the number of slots corresponding to a single plaintext or ciphertext data, thus obtaining at least one encoding monomial. (Using numerical information as salary information...) id The maximum value information refers to the maximum salary information. max For example, the encoded monomial can be implemented as follows:

[0128] After obtaining the encoded monomial, multiple encoded monomials belonging to the same plaintext data can be summed to obtain at least one plaintext data. The obtained at least one plaintext data m i It can be implemented in polynomial form, that is:

[0129]

[0130] In other instances, a large language model can be used to encode multiple pieces of data to be encrypted into plaintext data. Specifically, the data uploader can use a trained coefficient generation model to generate coefficients for each piece of data to be encrypted. After obtaining the encoding coefficients for each piece of data to be encrypted, the data to be encrypted is encoded to obtain at least one piece of plaintext data.

[0131] Step S503: Encrypt at least one plaintext data using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to multiple data to be encrypted.

[0132] Specifically, since encrypting one piece of plaintext data yields one piece of ciphertext data, there is a one-to-one correspondence between plaintext and ciphertext data. Therefore, the number of plaintext data pieces is the same as the number of ciphertext data pieces. The data uploading end encrypts all plaintext data that has undergone encoding operations using a fully homomorphic encryption algorithm, obtaining at least one piece of encrypted data. Because there is a correspondence between ciphertext and plaintext data, there is also a correspondence between at least one piece of ciphertext data and multiple pieces of data to be encrypted.

[0133] In some instances, the data uploader can obtain the public key information of the corresponding database in advance, and then use the public key information to encrypt all plaintext data that has completed the encoding operation based on the fully homomorphic encryption algorithm, so as to obtain at least one ciphertext data corresponding to multiple data to be encrypted.

[0134] Step S504: Send at least one encrypted data to the database server for storage.

[0135] Specifically, after the data uploading end receives at least one encrypted piece of data, it sends the at least one piece of encrypted data to the database server, where the database server stores it.

[0136] In this embodiment, by encoding multiple pieces of data to be encrypted into at least one piece of plaintext data before performing the encryption operation, the space occupied by the stored data is reduced. Furthermore, as the amount of data decreases, the computational complexity required is reduced, thereby improving computational efficiency and accuracy.

[0137] Figure 6 A flowchart illustrating another data processing method provided as an exemplary embodiment of this application; based on any of the above embodiments, refer to the appendix. Figure 6 As shown, after sending at least one encrypted data to the database server for storage, the method in this embodiment may further include:

[0138] Step S601: Based on at least one ciphertext data, determine the first index information and the second index information corresponding to each of the multiple data to be encrypted, wherein the first index information is used to identify the ciphertext data to which the data to be encrypted belongs, and the second index information is used to identify the slot information in the ciphertext data to which the data to be encrypted belongs.

[0139] After all the data to be encrypted is encrypted at the data upload end, to facilitate querying or retrieving the encrypted data in the database server, for at least one piece of encrypted data obtained from the encryption operation, the position or sorting information of each piece of encrypted data and the multiple slot information contained in each piece of encrypted data are determined. Based on this, the position or sorting information of each piece of encrypted data is used as the first index information, and the multiple slot information contained in each piece of encrypted data is used as the second index information. In some instances, different pieces of data to be encrypted may correspond to the same first index information; in this case, the pieces of data to be encrypted with the same first index information belong to the same piece of encrypted data. Different pieces of data to be encrypted may correspond to different first index information; in this case, the pieces of data to be encrypted with different first index information belong to different pieces of encrypted data.

[0140] For example, suppose there are ciphertext 1, ciphertext 2 and ciphertext 3 arranged in order from front to back, and each ciphertext contains slots with serial numbers from 0 to 4095. Then, for the 326th piece of data to be encrypted in ciphertext 2, the first index information corresponding to the data to be encrypted is 2, and the second index information is serial number 325.

[0141] Step S602: Determine the searchable plaintext information corresponding to each of the multiple data to be encrypted.

[0142] In order to enable querying or retrieving encrypted data stored in the database server, the encrypted data in the database server is associated with searchable plaintext information. Therefore, during the process of uploading encrypted data to the database server for storage, the searchable plaintext information associated with the data to be encrypted is also simultaneously uploaded to the database server. For multiple data sets to be encrypted, each data set corresponds to at least one searchable plaintext piece of information. This searchable plaintext information may include, for example, employee name, employee ID, employee department, employee age, employee contact information, or other information related to the data to be encrypted. In some instances, the searchable plaintext information can be obtained through manual configuration, or it can be determined by analyzing and processing the data to be encrypted using a preset mapping relationship.

[0143] Step S603: Associate the searchable plaintext information with the first index information and the second index information and store them in the database server.

[0144] The data uploader uploads searchable plaintext information, along with first and second index information corresponding to each piece of data to be encrypted, to the database server for storage. In some instances, the database server or the data uploader can predefine a structure `row_data` to store the searchable plaintext information, first index information, and second index information. When the database server needs to query or retrieve the searchable plaintext information stored therein, it places the aforementioned structure into a dynamic array `Vector`.<row_data> This is done in v_database to facilitate real-time updates of query or call results obtained from the database server.

[0145] In this embodiment, by uploading searchable plaintext information and first index information and second index information corresponding to each piece of data to be encrypted to the database server, not only can accurate and fast querying of each piece of data to be queried be achieved, but also precise location of the data to be encrypted can be achieved based on the query performed on the database server.

[0146] Figure 7 A flowchart illustrating another data processing method provided as an exemplary embodiment of this application; based on any of the above embodiments, refer to the appendix. Figure 7 As shown, after sending at least one encrypted data to the database server for storage, the method in this embodiment may further include:

[0147] Step S701: Determine the first index information corresponding to at least one ciphertext data, the first index information being used to identify the ciphertext data to which the data to be encrypted belongs.

[0148] After completing the encryption operation on all the data to be encrypted, the data uploading end determines the position or sorting information of each ciphertext data for at least one ciphertext data obtained from the encryption operation, and uses this position or sorting information as the first index information. For example, assuming there are ciphertext X, ciphertext Y, and ciphertext Z arranged in order from front to back, then for ciphertext Y, the first index information corresponding to all encrypted data in ciphertext Y is Y.

[0149] Step S702: Associate the first index information with the corresponding ciphertext data and store it in the database server.

[0150] The data uploader uploads the first index information corresponding to each encrypted data item to the database server, which then stores it. In some instances, the database server or the data uploader can predefine a structure `row_cipher` to store the first index information and the encrypted data. When the database server needs to query or retrieve the encrypted data stored therein, it places the aforementioned structure into a dynamic array `Vector`.<row_cipher> v_cipher is used to update the query or call results obtained from the database server in real time.

[0151] In this embodiment, by uploading the first index information corresponding to each encrypted data to the database server, the accurate location of each encrypted data is achieved, thereby improving the query efficiency of the database.

[0152] In a specific application, taking the example of a requesting client needing to query the average salary of employees aged [age1, age2], with the data to be encrypted being the salary to be encrypted, this application embodiment provides a database homomorphic processing method using a fully homomorphic encryption algorithm. Specifically, the execution entities of this database homomorphic processing method include a database server, a requesting client, and a data uploading client. The requesting client and the data uploading client can be the same or different. The database homomorphic processing method implemented based on the aforementioned database server, requesting client, and data uploading client can include:

[0153] Step 1: Obtain the amount of raw data and the number of slots corresponding to a single plaintext or ciphertext. Based on the number of slots and the amount of data, determine the number of plaintexts or ciphertexts.

[0154] The number of slots corresponding to a single plaintext or a single ciphertext can be configured based on a preset encryption algorithm, with slot_count = 4096. Assuming the original data volume is n... db =2 20 1 data item, id∈[0,2] 20 At this point, it can be based on slot_count and n. db To determine the need for 2 8 The number of ciphertexts / the number of plaintexts can be determined based on slot_count and n. db This is determined by the ratio of the number of ciphertexts to the number of plaintexts = n. db / slot_count.

[0155] In other instances, the ratio of ciphertext to plaintext can be expressed by n. cipher It can be expressed as n, and can be determined by the following formula: cipher =(n db+slot_count-1) / slot_count.

[0156] Step 2: Determine the numerical information and maximum value information corresponding to the original data. Then, the original data can be encoded based on the numerical information, maximum value information, and the number of slots corresponding to a single plaintext or a single ciphertext to obtain at least one plaintext.

[0157] The data uploader can determine the ID of the original data and perform a round-robin encoding operation on multiple original data according to the ID. The ID can be determined by id = i * slot_count + j. Then, the original data can be encoded based on numerical information, maximum value information, and the number of slots corresponding to a single plaintext or ciphertext. This yields at least one encoding monomial, which can be implemented as follows:

[0158] After obtaining the encoded monomial, multiple encoded monomials belonging to the same plaintext data can be summed to obtain at least one plaintext data, m. i It can be implemented in polynomial form, that is Where, m i This represents the i-th plaintext data, where j represents the j-th slot within the plaintext data; i is the first index information, j is the second index information, and salary id This represents the salary value corresponding to the data to be encrypted with the serial number id. max This represents the maximum salary value among all the salary values ​​corresponding to the data to be encrypted, thus effectively enabling the encoding of multiple raw data into a single plaintext data.

[0159] After obtaining at least one plaintext data m i Then, a preset fully homomorphic encryption algorithm can be used to encrypt at least one plaintext data to obtain at least one ciphertext ct corresponding to each of the at least one plaintext data. i Then at least one ciphertext ct can be used. i The data is sent to a database server for storage. A single ciphertext can contain multiple encrypted data items, with each encrypted data item corresponding to one original data item.

[0160] After sending the ciphertext to the database server for storage, index information 1 and index information 2 corresponding to each piece of original data can be determined. Then, the original data is stored according to the original data structure, which can include [identity identifier - id, name - name, age - age, index information 1 - cipher_idx1, index information 2 - cipher_idx2]. Specifically, the data uploader first calculates the number of ciphertexts based on the number of data to be encrypted and the number of slots for each ciphertext, and then creates a dynamic array Vector.<row_data> v_database is used to store the searchable plaintext information corresponding to each piece of data to be encrypted, and is created as a dynamic array Vector.<row_cipher> `v_cipher` is used to store the encrypted data. Then, the `id` of each piece of data to be encrypted is calculated using the first and second index information. The calculated `id`, the corresponding employee name, the corresponding employee age, the first index information, and the second index information are then inserted into the dynamic array `Vector`.<row_data> At the end of v_database. After the data upload end completes the calculation and insertion operations for all data to be encrypted, based on the number of slots in a single plaintext, the salary value corresponding to the data to be encrypted within the i-th plaintext, the maximum salary value among all the salary values ​​corresponding to the data to be encrypted, and the second index information of each data to be encrypted within the plaintext, at least one plaintext data is obtained. This plaintext data is then encrypted using the public key to obtain at least one ciphertext data, the number of which is the same as the number of plaintext data. At this point, at least one ciphertext data and the first index information corresponding to each ciphertext data are inserted into the dynamic array Vector.<row_cipher> The end of v_cipher. Finally, the data uploader will use the dynamic array Vector.<row_data> v_database and dynamic array Vector<row_cipher> v_cipher is uploaded to the database for storage. The aforementioned dynamic array Vector...<row_cipher> The data structure row_cipher contained in v_cipher is a predefined structure in the database server used to store encrypted data. The data structure row_cipher includes [index information 1-cipher_idx1, ciphertext data-ct].

[0161] Step 3: After receiving a query request for information on the average salary of employees aged [age1, age2], the database server retrieves the total salary of employees aged [age1, age2] and the number of employees aged [age1, age2], and then sends the total salary of employees aged [age1, age2] and the number of employees aged [age1, age2] to the requesting end.

[0162] The total salary of employees aged [age1, age2] can be defined as `sum_masked`. After receiving a query request, the database server initializes `sum_masked` before the query process begins, setting the number of employees aged [age1, age2] to 0. Then, the database server creates a dynamic array `vector`. <double>`v_mask(slot_count, 0)` stores the mask information corresponding to each encrypted data item. There is a one-to-one correspondence between the mask information for each encrypted data item and the slot for that data item. In some instances, the mask information corresponding to encrypted data with ages in the range [age1, age2] is valid mask information, which can be implemented as the value 1; the mask information corresponding to encrypted data with ages not in the range [age1, age2] is invalid mask information, which can be implemented as the value 0. In this case, the database server uses a dynamic array vector. <double>In v_mask(slot_count,0), the initial mask information corresponding to all encrypted data is set to 0. The mask information can be automatically configured according to the matching degree between the encrypted data and the information query request. For example, when the encrypted data is the target encrypted data that matches the information query request, the mask information corresponding to the target encrypted data is automatically configured to the value 1; when the encrypted data does not match the information query request, the mask information corresponding to the encrypted data remains unchanged at the value 0.

[0163] To accurately identify the target encrypted data, a round-robin query can be performed on all encrypted data in the database server according to the IDC (idc). The IDC can be determined by `idc = i * slot_count + j`. Specifically, during the encrypted data query process on the database server, if the `age` in the `row_data` structure corresponding to a certain encrypted data's IDC belongs to [age1, age2], it indicates that the encrypted data is a successfully matched target encrypted data. In this case, the mask information corresponding to the target encrypted data is valid mask information, and the database server uses a dynamic array vector... <double>In `v_mask(slot_count,0)`, the mask information for the slot corresponding to the target encrypted data is changed to the value 1. For example, suppose that in the same ciphertext, the age corresponding to the encrypted data in slot 300 belongs to [age1,age2], while the age corresponding to the encrypted data in slot 560 does not belong to [age1,age2]. In this case, the dynamic array changes the mask information of slot 300 in this ciphertext to the value 1, while since the initial mask information of slot 560 is 0, no change is needed.

[0164] Before the database server performs a polling and matching operation on all encrypted data based on the IDC corresponding to the encrypted data, the number of employees with ages in the range [age1, age2] is defined as n_matched = 0. During the polling and matching operation, if the age in the row_data structure corresponding to a certain encrypted data belongs to [age1, age2], it means that the encrypted data is a successfully matched encrypted data, and the value of n_matched is updated at this time. After the database server completes the query operation, the value of n_matched is equal to the sum of the number of valid mask information in all ciphertexts. For example, suppose the database server queries a total of 3 ciphertexts, each containing 4096 slots, where ciphertext 1 contains 1000 valid mask information, ciphertext 2 contains 400 valid mask information, and ciphertext 3 contains 650 valid mask information. Then, the number of employees with ages in the range [age1, age2] returned by the database server to the requesting client is n_matched = 1000 + 400 + 650 = 2050.

[0165] After the database server completes the information query operation and updates the mask information, homomorphic multiplication is performed on the encrypted data of each slot in each ciphertext data and the mask information corresponding to the encrypted data of each slot, to obtain the homomorphic multiplication result of each ciphertext data. Then, the homomorphic multiplication data of the corresponding slot information in each ciphertext data is homomorphically added to obtain the homomorphic sum value of each ciphertext data. In this case, the homomorphic sum value exists in the form of a ciphertext data. Then, the data in each slot of the homomorphic sum value is shifted and halved for addition calculation. The shift step size is half the number of slots in a single ciphertext, for example, 4096 / 2 = 2048, to obtain the halving coefficient, so as to realize the halving addition operation and obtain the total salary of employees with age in [age1, age2]. For example, suppose there are three ciphertexts C1, C2, and C3. The results of homomorphically multiplying each ciphertext with its corresponding mask vector are C11, C22, and C33, respectively. Then, homomorphic addition is performed, resulting in ciphertext C = C11 + C22 + C33. Finally, a binary addition operation is performed on ciphertext C to obtain the encrypted numerical result C0. C0 represents the total salary of employees aged [age1, age2]. Ultimately, the database server sends the total salary of employees aged [age1, age2] and the number of employees aged [age1, age2] to the requesting client.

[0166] Step 4: After receiving the total salary of employees aged [age1, age2] and the number of employees aged [age1, age2], the requesting end decrypts the total salary of employees aged [age1, age2] based on the private key. Then, based on the decrypted total salary of employees aged [age1, age2] (sum_m), the number of employees aged [age1, age2] (n_matched), and the maximum salary value among all the salary values ​​corresponding to the data to be encrypted, the requesting end calculates the salary. max The average salary of employees aged [age1, age2] is calculated as average_salary = (sum_m / n_matched) * salary max .

[0167] The technical solution provided in this application embodiment obtains an average salary query request sent by the requesting end. Based on this average salary query request, it queries the database server to obtain at least one target encrypted salary that matches the average salary query request. Then, it determines a halving coefficient for summing the at least one target encrypted salary, and then performs a halving summation on the at least one target encrypted salary based on the halving coefficient to determine the total encrypted salary that matches the average salary query request. Finally, it returns the total encrypted salary and the quantity information of at least one target encrypted salary to the requesting end. Since the total encrypted salary is the final result that the average salary query request needs to return, it is determined by halving the at least one target encrypted salary through a halving summation operation. This effectively reduces the number of summation operations required to determine the total encrypted salary and the time required, thereby reducing computational complexity, effectively improving the quality and efficiency of salary queries, and further enhancing the practicality of the method.

[0168] Figure 8 A schematic diagram of the structure of a data processing apparatus provided for an exemplary embodiment of this application; see attached drawing. Figure 8 As shown, this embodiment provides a data processing apparatus for performing the above-described... Figure 2 The data processing method shown, specifically, the data processing device may include:

[0169] The first acquisition module 11 is used to acquire the information query request sent by the requesting end;

[0170] The first query module 12 is used to query the database server to obtain at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted by a fully homomorphic encryption algorithm.

[0171] The first determining module 13 is used to determine the halving coefficients used for accumulating at least one target encrypted data;

[0172] The first determining module 13 is also used to perform a binary addition calculation on at least one target encrypted data based on the binary coefficient to determine the total encrypted data that matches the information query request;

[0173] The first sending module 14 is used to return the total amount of encrypted data and the quantity information of at least one target encrypted data to the requesting end.

[0174] In some instances, the first determining module 13 is also used to perform: determining the number of slots occupied for all target encrypted data, wherein the number of slots occupied changes dynamically with the halving and summing operation of the target encrypted data; and determining half of the number of slots occupied as the halving coefficient used for the summation calculation of at least one target encrypted data.

[0175] In some instances, the first query module 12 and the first determination module 13 in this embodiment are used to perform the following steps:

[0176] The first query module 12 is used to query the database server for a first type of encrypted data that matches the information query request and a second type of encrypted data that does not match the information query request.

[0177] The first determining module 13 is used to determine the valid mask information corresponding to the first type of encrypted data and the invalid mask information corresponding to the second type of encrypted data.

[0178] The first determining module 13 is also used to perform homomorphic computation on the valid mask information and the first type of encrypted data, as well as the invalid mask information and the second type of encrypted data, to obtain at least one target encrypted data that matches the information query request.

[0179] In some instances, when the valid mask information is 1 and the invalid mask information is 0, the first determining module 13 is further configured to perform: homomorphic multiplication calculations on the valid mask information and the first type of encrypted data, and on the invalid mask information and the second type of encrypted data, respectively, to obtain at least one encrypted data result that matches the information query request; and homomorphically adding the at least one encrypted data result according to the slot information to obtain at least one target encrypted data that matches the information query request.

[0180] In some instances, the first determining module 13 and the first sending module 14 in this embodiment are used to perform the following steps:

[0181] The first determining module 13 is used to determine the target encrypted data as the target encrypted salary and the sum of the encrypted data as the total encrypted salary when the information query request is a salary query request corresponding to a preset age group.

[0182] The first sending module 14 is used to return the total encrypted salary and the quantity information of the target encrypted salary to the requesting end, so that the requesting end can determine the average salary information that matches the salary query request based on the total encrypted salary and the quantity information.

[0183] Figure 8 The device shown can perform Figures 1-4 For the methods shown in the embodiments, the parts not described in detail in this embodiment can be referred to the following: Figures 1-4 The relevant descriptions of the illustrated embodiments are provided below. For the execution process and technical effects of this technical solution, please refer to [link / reference]. Figures 1-4 The descriptions in the illustrated embodiments will not be repeated here.

[0184] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 11, 12, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0185] In one possible design, Figure 9 The structure of the data processing device shown can be implemented as an electronic device, which can be a controller, personal computer, server, or other similar devices. Figure 9 As shown, the electronic device may include a first processor 21 and a first memory 22. The first memory 22 is used to store data executed by the corresponding electronic device. Figures 1-4 In the data processing method program provided in the illustrated embodiment, the first processor 21 is configured to execute the program stored in the first memory 22.

[0186] The program includes one or more computer instructions, wherein when executed by the first processor 21, the one or more computer instructions can perform the following steps: obtaining an information query request sent by the requesting end; querying the database server to obtain at least one target encrypted data that matches the information query request, wherein the target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted using a fully homomorphic encryption algorithm; determining a halving coefficient for accumulating the at least one target encrypted data; performing a halving summation calculation on the at least one target encrypted data based on the halving coefficient to determine the sum of encrypted data matching the information query request; and returning the sum of encrypted data and the quantity information of the at least one target encrypted data to the requesting end.

[0187] Furthermore, the first processor 21 is also used to perform the aforementioned Figures 1-4 All or part of the steps in the illustrated embodiments.

[0188] The structure of the electronic device may also include a first communication interface 23 for communication between the electronic device and other devices or communication networks.

[0189] Figure 10 A schematic diagram of another data processing apparatus provided as an exemplary embodiment of this application; see attached diagram. Figure 10 As shown, this embodiment provides a data processing apparatus for performing the above-described... Figure 5 The data processing method shown, specifically, the data processing device may include:

[0190] The second acquisition module 31 is used to acquire the numerical information corresponding to each of the multiple data to be encrypted and the maximum value information among the multiple numerical information;

[0191] The second encoding module 32 is used to encode multiple data to be encrypted into at least one plaintext data based on numerical information and maximum value information;

[0192] The second encryption module 33 is used to encrypt at least one plaintext data using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to multiple data to be encrypted.

[0193] The second sending module 34 is used to send at least one encrypted data to a database server for storage.

[0194] In some instances, the second encoding module 32 is also used to perform: determining the number of plaintext data corresponding to multiple data to be encrypted; and encoding the multiple data to be encrypted into at least one plaintext data based on the number of plaintext data, numerical information, and maximum value information.

[0195] Based on numerical information and maximum value information, the coding coefficients of multiple coding monomials used to implement the coding operation are determined. The coding coefficients are the ratios of numerical information and maximum value information. Based on multiple coding monomials, multiple data to be encrypted are encoded into at least one plaintext data.

[0196] Determine the encoding monomial corresponding to each of the multiple data to be encrypted; sum the multiple encoding monomials belonging to the same plaintext data to obtain at least one plaintext data.

[0197] In some instances, after at least one encrypted data is sent to a database server for storage, the second acquisition module 31 and the second sending module 34 in this embodiment are used to perform the following steps:

[0198] The second acquisition module 31 is used to determine, based on at least one ciphertext data, first index information and second index information corresponding to each of the multiple data to be encrypted, wherein the first index information is used to identify the ciphertext data to which the data to be encrypted belongs, and the second index information is used to identify the slot information in the ciphertext data to which the data to be encrypted belongs; and to determine the searchable plaintext information corresponding to each of the multiple data to be encrypted.

[0199] The second sending module 34 is used to associate the searchable plaintext information with the first index information and the second index information and store them in the database server.

[0200] In some instances, after at least one encrypted data is sent to a database server for storage, the second acquisition module 31 and the second sending module 34 in this embodiment are used to perform the following steps:

[0201] The second acquisition module 31 is used to determine the first index information corresponding to at least one ciphertext data, the first index information being used to identify the ciphertext data to which the data to be encrypted belongs;

[0202] The second sending module 34 is used to associate the first index information with the corresponding ciphertext data and store it in the database server.

[0203] Figure 10 The device shown can perform Figures 5-7 For the methods shown in the embodiments, the parts not described in detail in this embodiment can be referred to the following: Figures 5-7 The relevant descriptions of the illustrated embodiments are provided below. For the execution process and technical effects of this technical solution, please refer to [link / reference]. Figures 5-7 The descriptions in the illustrated embodiments will not be repeated here.

[0204] In one possible design, Figure 11 The structure of the data processing device shown can be implemented as an electronic device, which can be a controller, personal computer, server, or other similar devices. Figure 11 As shown, the electronic device may include a second processor 41 and a second memory 42. The second memory 42 is used to store data executed by the corresponding electronic device. Figures 5-7 In the data processing method program provided in the illustrated embodiment, the second processor 41 is configured to execute the program stored in the second memory 42.

[0205] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the second processor 41, they can perform the following steps: obtain the numerical information corresponding to each of the multiple data to be encrypted and the maximum value information among the multiple numerical information; based on the numerical information and the maximum value information, encode the multiple data to be encrypted into at least one plaintext data; encrypt the at least one plaintext data using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to the multiple data to be encrypted; and send the at least one ciphertext data to a database server for storage.

[0206] Furthermore, the second processor 41 is also used to perform the aforementioned Figures 5-7 All or part of the steps in the illustrated embodiments.

[0207] The structure of the electronic device may also include a second communication interface 43 for communication between the electronic device and other devices or communication networks.

[0208] In addition, embodiments of the present invention provide a computer storage medium for storing computer software instructions used by an electronic device, which includes instructions for executing the above-described... Figures 1-7 The data processing method in the illustrated embodiment involves a procedure.

[0209] Furthermore, embodiments of the present invention provide a computer program product, comprising: a computer-readable storage medium storing computer instructions, which, when executed by one or more processors, cause one or more processors to perform the aforementioned... Figures 1-7 The steps in the data processing method shown in the embodiment of the method.

[0210] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the objectives of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0211] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of a necessary general-purpose hardware platform, or by a combination of hardware and software. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0212] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0213] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0214] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0215] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / double> < / double> < / double>

Claims

1. A data processing method, characterized in that, include: Retrieve the information query request sent by the requesting party; In the database server, at least one target encrypted data matching the information query request is obtained. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted using a fully homomorphic encryption algorithm. Determining the halving factor used for accumulating the at least one target encrypted data includes: determining the number of slots occupied for all target encrypted data, wherein the number of slots occupied will change dynamically with the halving addition operation of the target encrypted data; and determining half of the number of slots occupied as the halving factor used for accumulating the at least one target encrypted data. Based on the halving coefficient, the at least one target encrypted data is halved and summed to determine the total amount of encrypted data that matches the information query request; The total amount of the encrypted data and the quantity information of the at least one target encrypted data are returned to the requesting end.

2. The method according to claim 1, characterized in that, In the database server, retrieving at least one target encrypted data that matches the information query request includes: In the database server, query the first type of encrypted data that matches the information query request and the second type of encrypted data that does not match the information query request; Determine the valid mask information corresponding to the first type of encrypted data and the invalid mask information corresponding to the second type of encrypted data; Homomorphic computation is performed on the valid mask information, the first type of encrypted data, the invalid mask information, and the second type of encrypted data to obtain at least one target encrypted data that matches the information query request.

3. The method according to claim 2, characterized in that, The valid mask information is 1, and the invalid mask information is 0; homomorphic computation is performed on the valid mask information, the first type of encrypted data, the invalid mask information, and the second type of encrypted data to obtain at least one target encrypted data matching the information query request, including: The valid mask information is homomorphically multiplied with the first type of encrypted data, the invalid mask information, and the second type of encrypted data to obtain at least one encrypted data result that matches the information query request. The at least one encrypted data result is homomorphically added according to the slot information to obtain at least one target encrypted data that matches the information query request.

4. The method according to claim 1, characterized in that, Returning the sum of the encrypted data and the quantity information of the at least one target encrypted data to the requesting end includes: When the information query request is a salary query request corresponding to a preset age group, the target encrypted data is determined to be the target encrypted salary, and the sum of the encrypted data is the total encrypted salary. The total encrypted salary and the quantity information of the target encrypted salary are returned to the requesting end, so that the requesting end can determine the average salary information that matches the salary query request based on the total encrypted salary and the quantity information.

5. The method according to claim 1, characterized in that, Methods for obtaining encrypted data stored in a database server include: Obtain the numerical information corresponding to each of the multiple data to be encrypted, as well as the maximum value among the multiple numerical information; Based on the numerical information and the maximum value information, the plurality of data to be encrypted are encoded into at least one plaintext data; The at least one plaintext data is encrypted using a fully homomorphic encryption algorithm to obtain at least one ciphertext data corresponding to the plurality of data to be encrypted; The at least one encrypted data is sent to a database server for storage.

6. The method according to claim 5, characterized in that, Based on the numerical information and the maximum value information, the plurality of data to be encrypted are encoded into at least one plaintext data, including: Determine the number of plaintext data corresponding to the plurality of data to be encrypted; Based on the number of plaintexts, the numerical information, and the maximum value information, the plurality of data to be encrypted are encoded into at least one plaintext data.

7. The method according to claim 5, characterized in that, Based on the numerical information and the maximum value information, the plurality of data to be encrypted are encoded into at least one plaintext data, including: Based on the numerical information and the maximum value information, the coding coefficients of multiple coding units used to implement the coding operation are determined, wherein the coding coefficients are the ratio of the numerical information to the maximum value information; Based on the multiple encoding single terms, the multiple data to be encrypted are encoded into at least one plaintext data.

8. The method according to claim 7, characterized in that, Based on the multiple encoding single terms, the multiple data to be encrypted are encoded into at least one plaintext data, including: Determine the encoding single item corresponding to each of the plurality of data to be encrypted; Multiple encoded monomials belonging to the same plaintext data are summed to obtain at least one plaintext data.

9. The method according to any one of claims 5-8, characterized in that, After sending the at least one encrypted data to a database server for storage, the method further includes: Based on the at least one ciphertext data, first index information and second index information corresponding to each of the plurality of data to be encrypted are determined, wherein the first index information is used to identify the ciphertext data to which the data to be encrypted belongs, and the second index information is used to identify the slot information in the ciphertext data to which the data to be encrypted belongs. Determine the searchable plaintext information corresponding to each of the plurality of data to be encrypted; The searchable plaintext information is associated with the first index information and the second index information and stored in the database server.

10. The method according to any one of claims 5-8, characterized in that, After sending the at least one encrypted data to a database server for storage, the method further includes: Determine the first index information corresponding to each of the at least one ciphertext data, wherein the first index information is used to identify the ciphertext data to which the data to be encrypted belongs; The first index information is associated with the corresponding encrypted data and stored in the database server.

11. A data processing apparatus, characterized in that, The device includes: The first acquisition module is used to acquire information query requests sent by the requesting end. The first query module is used to query the database server to obtain at least one target encrypted data that matches the information query request. The target encrypted data is numerical data, the target encrypted data corresponds to slot information, and the target encrypted data is encrypted using a fully homomorphic encryption algorithm. The first determining module is used to determine the halving coefficient for the cumulative calculation of the at least one target encrypted data, including: determining the number of slots occupied corresponding to all target encrypted data, wherein the number of slots occupied will change dynamically with the halving and addition operation of the target encrypted data; and determining half of the number of slots occupied as the halving coefficient for the cumulative calculation of the at least one target encrypted data. The first determining module is used to perform a binary addition calculation on the at least one target encrypted data based on the binary coefficient to determine the sum of encrypted data that matches the information query request; The first sending module is used to return the sum of the encrypted data and the quantity information of the at least one target encrypted data to the requesting end.

12. An electronic device, characterized in that, include: A memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any one of claims 1-10.

13. A computer storage medium, characterized in that, Used to store a computer program that, when executed by a computer, implements the method of any one of claims 1-10.

14. A computer program product, characterized in that, include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the steps of the method of any one of claims 1-10.

Citation Information

Patent Citations

  • Data query method and device

    CN110858251A

  • Data coding method and device applied to homomorphic encryption system

    CN115765966A

  • Data hiding statistical query method and system based on privacy calculation

    CN117494177A

  • Data storage method for database security audit data

    CN119848937A