Homomorphic encryption data layered processing method and readable storage medium
Through homomorphic encrypted data hierarchical processing method and multi-level aggregation technology, the problem of low noise accumulation and computational efficiency of homomorphic encryption systems in large-scale data processing is solved, and efficient data processing and resource optimization are achieved.
Patent Information
- Application Number
- CN202411525902.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-30
AI Technical Summary
When existing homomorphic encryption systems process large-scale data sets, the accumulation and management of noise affects calculation accuracy and efficiency, resulting in frequent ciphertext refresh operations increasing calculation overhead and limiting the processing capability of complex queries.
The homomorphic encrypted data layering method is used to divide the data into multiple sub-data layers according to attributes, and a cache area is established in each data layer. The processing results are stored in the corresponding cache layer, and the cache data is directly called according to business needs. Skip the repeated processing and introduce multi-level aggregation method to optimize the calculation.
It effectively improves computing efficiency, reduces the need for noise accumulation and ciphertext refresh, supports larger-scale and complex data sets and aggregation computing, and optimizes resource utilization.
Smart Images

Figure CN119051836B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a homomorphic encryption data layered processing method and a readable storage medium. Background Art
[0002] With the development of homomorphic encryption technology, the processing capacity of ciphertext data has been significantly improved. However, existing homomorphic encryption systems still face some challenges when dealing with complex aggregation and transformation operations, especially when dealing with large-scale data sets, where the accumulation and management of noise become key factors affecting computational accuracy and efficiency. Traditional aggregation and transformation algorithms often require frequent ciphertext refresh (re-encryption) operations, which increases computational overhead and limits the processing capacity of complex queries. How to simplify the processing of large-scale data is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The purpose of the present invention is to provide a homomorphic encrypted data layered processing method and a readable storage medium, introduce a multi-level processing method, and establish a cache area to achieve layered processing and efficient calling of data.
[0004] To achieve the above-mentioned purpose, the present invention provides a method for layered processing of homomorphically encrypted data, wherein the homomorphically encrypted data includes sub-data of multiple different attributes, and the method for layered processing of homomorphically encrypted data includes the following steps: dividing the homomorphically encrypted data into multiple sub-data according to the attributes; storing each type of the sub-data in a separate storage space to form multiple data layers; each data layer corresponds to a cache layer, and after processing the sub-data of any data layer each time, storing the processing result in the cache layer corresponding to the data layer to form cache data; according to the business needs for the whole or partial processing of the homomorphically encrypted data, selecting several data layers for processing to obtain the business processing sub-result of the data layer, and when the cached data is required by the business needs, directly calling the cached data as the business processing sub-result of the data layer corresponding to the cached data and skipping the data processing of the data layer corresponding to the cached data.
[0005] Optionally, it also includes an aggregation step, which includes: selecting several data layers for processing according to the business requirements for the overall or partial processing of the homomorphically encrypted data; aggregating the business processing sub-results of each selected data layer to form a total business processing result.
[0006] Optionally, aggregating the business processing sub-results of each selected data layer to form a total business processing result specifically includes: converting the business processing sub-results into a matrix form and then aggregating them.
[0007] Optionally, the sub-data remains in a homomorphic encryption state in the data layer.
[0008] Optionally, data features of the sub-data in a homomorphically encrypted state in each of the data layers are extracted, and an optimized processing algorithm for processing the data layer is selected based on the homomorphically encrypted data features.
[0009] Optionally, the sub-data includes a polynomial, and the processing of the sub-data of any data layer specifically includes: extracting the coefficients of each term of the polynomial, establishing time domain data with the position of the term of the coefficient in the polynomial as the horizontal coordinate and the value of the coefficient as the vertical coordinate; performing Fourier transform on the time domain data to convert it into frequency domain data, and processing the sub-data of any data layer based on the frequency domain data; and performing inverse Fourier transform on the processing result to restore the data to a polynomial form.
[0010] Optionally, the processing of the sub-data of any data layer specifically includes: converting the sub-data into binary data; performing bit operations on the binary data; and performing logical operations based on the binary data.
[0011] Optionally, each of the data layers includes multiple sub-data, and the processing of the sub-data of any data layer specifically includes: obtaining an anchor indicator; sorting the sub-data according to the anchor indicator and multiple sub-data in the same data layer, and processing the sub-data in the sorted order.
[0012] Optionally, the processing of the sub-data of any data layer specifically includes: providing different levels of operation rules, specifically including: first level operation: allowing the use of exponential operation and first multiplication operation; second level operation: converting the exponential operation into several second multiplication operations with the same base, and converting the first multiplication operation into several addition operations with the same addends; measuring the encryption noise of the sub-data; if the encryption noise is lower than a first noise threshold, allowing the first level operation to be performed on the sub-data; if the encryption noise is between the first noise threshold and the second noise threshold, allowing the first level operation and the second level operation to be performed on the sub-data; if the encryption noise is higher than the second noise threshold, only allowing the second level operation to be performed on the sub-data.
[0013] To achieve the above-mentioned objectives, the present invention also provides a data layered processing system, including: a division module, used to divide data into multiple sub-data according to attributes; a storage module, used to store each type of sub-data in a separate storage space to form multiple data layers; a cache module, including a cache layer, each data layer corresponds to a cache layer, and each time the sub-data of any data layer is processed, the processing result is stored in the cache layer corresponding to the data layer to form cache data; a business processing module, used to select several of the data layers for processing according to the business needs for the whole or part of the processing of the homomorphic encrypted data to obtain the business processing sub-result of the data layer, and when the cached data is required by the business needs, the cached data is directly called as the business processing sub-result of the data layer corresponding to the cached data and the data processing of the data layer corresponding to the cached data is skipped.
[0014] Optionally, it also includes an aggregation module, which is used to select several data layers for processing according to the business requirements for the overall or partial processing of the homomorphically encrypted data, and aggregate the business processing sub-results of each selected data layer to form an overall business processing result.
[0015] To achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes: a memory storing a computer program; a processor, which is communicatively connected to the memory and executes any one of the above-mentioned homomorphic encryption data layered processing methods when the computer program is called; and a display, which is communicatively connected to the processor and the memory and is used to display a GUI interaction interface related to the homomorphic encryption data layered processing method.
[0016] To achieve the above objectives, the present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned homomorphic encryption data layering processing methods.
[0017] To achieve the above objectives, the present invention also provides a computer program product, which, when executed by a processor, implements any of the above-mentioned homomorphic encryption data layered processing methods.
[0018] The homomorphic encryption data layered processing method and readable storage medium provided by the present invention have the following beneficial effects:
[0019] The present invention provides a method for hierarchical processing of homomorphic encrypted data, wherein the homomorphic encrypted data includes sub-data of multiple different attributes, and the method for hierarchical processing of homomorphic encrypted data includes the following steps: dividing the homomorphic encrypted data into multiple sub-data according to the attributes; storing each sub-data in a separate storage space to form multiple data layers; each data layer corresponds to a cache layer, and after processing the sub-data of any data layer each time, the processing result is stored in the cache layer corresponding to the data layer to form cache data; according to the business requirements for the whole or part of the processing of the homomorphic encrypted data, several data layers are selected for processing to obtain the business processing sub-result of the data layer, and when the cache data is required by the business requirements, the cache data is directly called as the business processing sub-result of the data layer corresponding to the cache data and the data processing of the data layer corresponding to the cache data is skipped. In this way, the present invention adopts a hierarchical strategy, divides and layers according to data attributes, effectively improves the calculation efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the hierarchical calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The introduction of a multi-level aggregation method improves the performance of the homomorphic encryption system when processing complex queries. It can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0020] The present invention also provides a data layered processing system, because the homomorphic encryption data layered processing system is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the homomorphic encryption data layered processing system adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0021] The present invention also provides an electronic device, because the electronic device is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the electronic device adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0022] The present invention also provides a readable storage medium, because the readable storage medium is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the readable storage medium adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0023] The present invention also provides a computer program product, because the computer program product is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the computer program product adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a method for layered processing of homomorphic encrypted data provided in accordance with an embodiment of the present invention.
[0025] Figure 2 A schematic diagram of the block structure of an electronic device provided by an embodiment of the present invention.
[0026] The reference numerals are: 101 - processor; 102 - communication interface; 103 - memory; 104 - communication bus; 105 - display. DETAILED DESCRIPTION
[0027] In order to make the purpose, advantages and features of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and are not drawn to scale, and are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the drawings is often a part of the actual structure. In particular, the emphasis of each drawing is different, and sometimes different scales are used.
[0028] It should be understood that when an element or layer is referred to as "on...", "connected to" other elements or layers, it can be directly on other elements or layers, connected to other elements or layers, or there can be intervening elements or layers. On the contrary, when an element is referred to as "directly on...", "directly connected to" other elements or layers, there is no intervening element or layer. Although the terms first, second, third, etc. can be used to describe various elements, components, regions, layers and / or parts, these elements, components, regions, layers and / or parts should not be limited by these terms. These terms are only used to distinguish an element, component, region, layer or part from another element, component, region, layer or part. Therefore, without departing from the teachings of the present invention, the first element, component, region, layer or part discussed below can be expressed as a second element, component, region, layer or part. Spatial relationship terms such as "under...", "below", "below", "above...", "above", "above", etc., can be used here for the convenience of description to describe the relationship between an element or feature shown in the figure and other elements or features. It should be understood that, in addition to the orientation shown in the figure, the spatial relationship terms are intended to include different orientations of the devices in use and operation. For example, if the device in the accompanying drawings is turned over, then, the elements or features described as "under...", "below", "below" will be oriented to be "on" other elements or features. The device can be oriented in addition (rotated 90 degrees or other orientations) and the spatial descriptors used herein are interpreted accordingly. The purpose of the terms used herein is only to describe specific embodiments and is not intended to be a limitation of the present invention. When used herein, the singular forms of "one", "one" and "said / the" are also intended to include plural forms, unless the context clearly indicates another way. It should also be understood that the term "include" is used to determine the presence of features, steps, operations, elements and / or parts, but does not exclude the presence or addition of one or more other features, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0029] The purpose of the present invention is to provide a homomorphic encrypted data layered processing method and a readable storage medium, introduce a multi-level processing method, and establish a cache area to achieve layered processing and efficient calling of data.
[0030] To achieve the above object, the present invention provides a method for hierarchical processing of homomorphically encrypted data, wherein the homomorphically encrypted data includes sub-data of multiple different attributes, and the method for hierarchical processing of homomorphically encrypted data includes the following steps:
[0031] Dividing the homomorphically encrypted data into a plurality of sub-data according to the attributes; storing each sub-data in a separate storage space to form a plurality of data layers;
[0032] Each data layer corresponds to a cache layer. After processing the sub-data of any data layer each time, the processing result is stored in the cache layer corresponding to the data layer to form cache data;
[0033] According to the business needs for the overall or partial processing of the homomorphically encrypted data, several data layers are selected for processing to obtain the business processing sub-results of the data layer. When the cached data is required by the business needs, the cached data is directly called as the business processing sub-result of the data layer corresponding to the cached data and the data processing of the data layer corresponding to the cached data is skipped.
[0034] Furthermore, it also includes an aggregation step, which includes: selecting several data layers for processing according to the business needs for the overall or partial processing of the homomorphic encrypted data; aggregating the business processing sub-results of each selected data layer to form a total business processing result.
[0035] With such a configuration, the present invention adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculations are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. A multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries. The method can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregate calculations. Using dynamically adjusted layering methods and aggregation paths, the system optimizes the processing process according to real-time query requirements, effectively improving computing efficiency. The intermediate results of the aggregate calculations are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization.
[0036] It should be understood that the sub-data remains in a homomorphic encryption state in the data layer. In an exemplary embodiment, the hierarchical basis for data hierarchical processing can be that the data is divided into multiple levels according to its specific attributes (such as time, geographic location, category, etc.). The hierarchical structure is dynamically determined according to the characteristics of the data and the query requirements to ensure the efficiency of the calculation. For example, in the time dimension, the data is divided into levels such as years, quarters, months, and weeks, and each level exists independently and remains encrypted. Furthermore, the hierarchical structure is that the data in each level exists in the form of independent encrypted data blocks, and these data blocks are independent of each other in physical storage and logical processing. Ensure that the data between the layers is not interfered during the processing process, thereby ensuring the security and accuracy of data processing.
[0037] Furthermore, in the aggregation step, at each layer, homomorphically encrypted aggregation operations (such as addition, summation, etc.) are directly performed on the ciphertext without decrypting the data, ensuring data security. The results of the aggregation operation still exist in the form of ciphertext. After each layer of aggregation operation, the intermediate results are cached in a dedicated storage area. By caching the intermediate results, the same data can be avoided from being repeatedly calculated in subsequent aggregation operations, thereby reducing the consumption of computing resources. The local aggregation results of each level are aggregated layer by layer through homomorphic operations to ensure that the amount of data is gradually reduced during the aggregation calculation process between levels, reducing the overall computational complexity. For example, the aggregation results of quarterly data are further summarized into annual data to achieve efficient cross-layer aggregation processing. In multiple queries, the system directly reuses the aggregation results in the cache to avoid repeated calculations, thereby improving the overall computing efficiency of the system, especially when processing the same or similar query requirements. This setting can improve computing efficiency, reduce data processing volume, and process data on demand. Through layering and aggregation, the system can only process hierarchical data related to the query. For example, when querying quarterly sales data, only the data blocks at the quarterly level are processed, without processing the data of each month. Layering allows calculations to be performed layer by layer, thereby splitting complex calculation tasks into multiple simple calculation tasks, and the calculation results of each layer can be used for calculations on the upper layer.
[0038] Furthermore, the business processing sub-results of each selected data layer are aggregated to form a total business processing result, specifically including: converting the business processing sub-results into a matrix form and then aggregating them. In this way, the system performs format conversion on the ciphertext data, reduces the computational complexity and improves the overall computational efficiency by decomposing complex operations into basic operations.
[0039] Furthermore, the data features of the sub-data in the homomorphically encrypted state in each data layer are extracted, and the optimization processing algorithm for processing the data layer is selected according to the homomorphically encrypted data features. Key features (such as data distribution, importance, etc.) are extracted from the ciphertext data, and these features are used to guide subsequent calculation optimization. These extractions are completed inside the ciphertext and will not leak any plaintext information, thereby ensuring the security of the data.
[0040] In order to adapt to the hierarchical processing of homomorphically encrypted data, and based on the hierarchical processing, to provide a prerequisite for the refined data processing of each data layer, the present invention provides a variety of conversion algorithm designs. For example, the sub-data includes a polynomial, and the processing of the sub-data of any data layer specifically includes:
[0041] Extract the coefficients of each term of the polynomial, take the position of the term where the coefficient is located in the polynomial as the horizontal coordinate, take the value of the coefficient as the vertical coordinate, and establish time domain data;
[0042] Performing Fourier transform on the time domain data to convert it into frequency domain data, and processing the sub-data of any data layer based on the frequency domain data;
[0043] The processed results are inverse Fourier transformed to restore the data to polynomial form.
[0044] In addition to Fourier transform, data conversion can also be performed based on Boolean algebra. Based on this, the present invention further provides the following technical solutions:
[0045] The processing of the sub-data of any data layer specifically includes:
[0046] converting the sub-data into binary data;
[0047] Performing bit operations on the binary data;
[0048] A logical operation is performed based on the binary data.
[0049] Furthermore, priority processing and sorting can be performed at each data layer based on the importance of the data. Based on this, the present invention further provides the following technical solutions:
[0050] Each of the data layers includes a plurality of sub-data, and the processing of the sub-data of any data layer specifically includes:
[0051] Get an anchor indicator;
[0052] The sub-data are sorted according to the anchor indicator and the plurality of sub-data in the same data layer, and the sub-data are processed in the sorted order.
[0053] The specific sorting method can be to obtain the mean, median or variance of multiple sub-data, and the anchor indicator can be the degree of deviation of the sub-data determined based on the mean, the median or the variance, and priority sorting is performed according to the degree of deviation. In an exemplary embodiment, the higher the degree of deviation of the sub-data, the higher the priority is, but it is not limited to this.
[0054] Furthermore, the most appropriate operation conversion rule can be dynamically selected according to the noise level and operation requirements of the current ciphertext. Based on this, the present invention further provides the following technical solutions:
[0055] The processing of the sub-data of any data layer specifically includes:
[0056] Provides different levels of algorithms, including:
[0057] First level operations: Exponential operations and first multiplication operations are allowed;
[0058] Second level operation: converting the exponential operation into a plurality of second multiplication operations with the same base, and converting the first multiplication operation into a plurality of addition operations with the same addends;
[0059] measuring encryption noise of the sub-data;
[0060] If the encryption noise is lower than a first noise threshold, allowing the first level operation to be performed on the sub-data;
[0061] If the encryption noise is between a first noise threshold and a second noise threshold, the first level operation and the second level operation are allowed to be performed on the sub-data;
[0062] If the encryption noise is higher than a second noise threshold, only the second level operation is allowed to be performed on the sub-data.
[0063] This setting can minimize the accumulation of noise.
[0064] To achieve the above-mentioned objectives, the present invention also provides a data layered processing system, including: a division module, used to divide data into multiple sub-data according to attributes; a storage module, used to store each type of sub-data in a separate storage space to form multiple data layers; a cache module, including a cache layer, each data layer corresponds to a cache layer, and each time the sub-data of any data layer is processed, the processing result is stored in the cache layer corresponding to the data layer to form cache data; a business processing module, used to select several of the data layers for processing according to the business needs for the whole or part of the processing of the homomorphic encrypted data to obtain the business processing sub-result of the data layer, and when the cached data is required by the business needs, the cached data is directly called as the business processing sub-result of the data layer corresponding to the cached data and the data processing of the data layer corresponding to the cached data is skipped.
[0065] Optionally, it also includes an aggregation module, which is used to select several data layers for processing according to the business requirements for the overall or partial processing of the homomorphically encrypted data, and aggregate the business processing sub-results of each selected data layer to form an overall business processing result.
[0066] The present invention also provides a data layered processing system, because the homomorphic encryption data layered processing system is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the homomorphic encryption data layered processing system adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0067] Since the data tiered processing system provided by the present invention and the homomorphically encrypted data tiered processing method described above belong to the same inventive concept, the data tiered processing system provided by the present invention has all the advantages of the homomorphically encrypted data tiered processing method described above, and therefore the beneficial effects of the data tiered processing system provided by the present invention will not be described one by one here.
[0068] To achieve the above object, the present invention also provides an electronic device, please refer to Figure 2 , Figure 2 FIG. 1 is a block diagram of an electronic device provided by an embodiment of the present invention. Figure 2 As shown, the electronic device includes:
[0069] A memory 103 storing a computer program;
[0070] A processor 101 is communicatively connected to the memory, and executes any one of the above-mentioned homomorphic encryption data layering processing methods when calling the computer program;
[0071] The display 105 is communicatively connected to the processor and the memory, and is used to display a GUI interaction interface related to the homomorphic encryption data layered processing method.
[0072] like Figure 2 As shown, the electronic device also includes a communication interface 102 and a communication bus 104, wherein the processor 101, the communication interface 102, and the memory 103 communicate with each other through the communication bus 104. The communication bus 104 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 104 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 102 is used for communication between the above-mentioned electronic device and other devices.
[0073] The processor 101 referred to in the present invention may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 101 is the control center of the electronic device, and various interfaces and lines are used to connect various parts of the entire electronic device.
[0074] The memory 103 may be used to store the computer program. The processor 101 implements various functions of the electronic device by running or executing the computer program stored in the memory 103 and calling the data stored in the memory 103 .
[0075] The memory 103 may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0076] Since the electronic device is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the electronic device adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0077] Since the electronic device provided by the present invention and the homomorphic encryption data layered processing method described above belong to the same inventive concept, the electronic device provided by the present invention has all the advantages of the homomorphic encryption data layered processing method described above, and the beneficial effects of the electronic device provided by the present invention will not be described one by one here.
[0078] To achieve the above-mentioned purpose, the present invention provides a readable storage medium storing a computer program, which, when executed by a processor, implements a homomorphic encryption data layered processing method as described in any one of the above. Since the readable storage medium is used to execute any of the homomorphic encryption data layered processing methods described above. Therefore, the readable storage medium adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result caching and reuse mechanism. The intermediate results of the layered calculations are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The introduction of a multi-level aggregation method improves the performance of the homomorphic encryption system when processing complex queries, can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0079] Since the readable storage medium provided by the present invention and the homomorphically encrypted data layered processing method described above belong to the same inventive concept, the readable storage medium provided by the present invention has all the advantages of the homomorphically encrypted data layered processing method described above, and therefore the beneficial effects of the readable storage medium provided by the present invention will not be described one by one here.
[0080] The readable storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer hard disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this article, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0081] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program codes. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0082] The present invention also provides a computer program product, which, when executed by a processor, implements any of the above-mentioned homomorphic encryption data layered processing methods.
[0083] The present invention also provides a computer program product, because the computer program product is used to execute any of the above-mentioned homomorphic encryption data layered processing methods. Therefore, the computer program product adopts a layered strategy, divides and layers according to data attributes, effectively improves the computing efficiency, and introduces an intermediate result cache and reuse mechanism. The intermediate results of the layered calculation are cached in a dedicated storage area and reused in subsequent calculations, reducing repeated calculations and optimizing resource utilization. The multi-level aggregation method is introduced to improve the performance of the homomorphic encryption system when processing complex queries, which can maximize the use of noise margin, reduce noise accumulation by layering, and reduce the need for ciphertext refresh, while supporting larger data sets and more complex aggregation calculations.
[0084] Since the computer program product provided by the present invention and the homomorphic encryption data layered processing method described above belong to the same inventive concept, the computer program product provided by the present invention has all the advantages of the homomorphic encryption data layered processing method described above, and the beneficial effects of the computer program product provided by the present invention will not be described one by one here.
[0085] The technical solution of the present invention is described below in conjunction with embodiments.
[0086] Example: Query the total sales during a specific time period.
[0087] Step 1: Query input.
[0088] User query request: The user wants to query the total sales in the first quarter of 2024.
[0089] Step 2: Query parsing.
[0090] Query parsing: The system parses the query request and determines that the query condition is the time range "first quarter of 2024". The system extracts the specific query time range (for example, from January 1, 2024 to March 31, 2024).
[0091] Step 3: Data stratification.
[0092] Level determination: The system determines the data level that needs to be accessed based on the query time range. In this example, the data needs to be processed at the "quarter" level.
[0093] Data location: Determine which data block to extract data from. Here, the system locates the encrypted data block corresponding to "first quarter of 2024".
[0094] Step 4: Data loading.
[0095] Data Extraction: The system extracts encrypted sales data blocks for the first quarter of 2024 from storage. Assume that these data blocks include sales data for each month (January, February, March).
[0096] Encrypted Data Read: Reads encrypted data blocks for each month without decrypting the data to maintain data security.
[0097] Step 5: Data conversion.
[0098] Transformation preparation: Convert the loaded encrypted sales data blocks into a format suitable for aggregate calculations. For example, convert the sales data into vector form for subsequent calculations.
[0099] Transformation execution: Execute the transformation algorithm on the ciphertext data to convert the encrypted data into a format that can be aggregated (for example, converting the data for each month into a matrix form).
[0100] Step 6: Hierarchical aggregation.
[0101] Local aggregation: Perform local aggregation on the data of each month. For example, calculate the total sales data of January, February and March respectively.
[0102] Total sales in January: ciphertext data 1.
[0103] Total sales in February: ciphertext data 2.
[0104] Total sales in March: ciphertext data 3.
[0105] Cross-level aggregation: Aggregate the total sales of each month to the quarterly level. For example, aggregate the total sales of January, February, and March to get the quarterly sales.
[0106] Step 7: Cache intermediate results.
[0107] Caching strategy: Cache the total sales for each month so that it can be reused in similar queries in the future.
[0108] Cache update: Ensure that the cached data is up to date. For the total sales in the first quarter of 2024, the cache includes the total sales data for January, February, and March.
[0109] Step 8: Optimize results.
[0110] Conversion optimization: Optimize the quarterly total sales results into a more concise format, for example, format the total sales results into a fixed output format.
[0111] Precision correction: Correct the optimized results to ensure the accuracy of total sales calculation. For example, perform floating point correction on the results.
[0112] Step 9: Reuse the results.
[0113] Result query: Check whether the total sales for the first quarter of 2024 is already in the cache. If the result is already cached, use the result in the cache directly.
[0114] Result reuse: Use the cached quarterly sales results to avoid recalculation.
[0115] Step 10: Output the ciphertext result.
[0116] Encrypted result generation: Convert the quarterly total sales calculation results into encrypted form (if further protection is required) to ensure data security.
[0117] Result return: The encrypted total sales result is returned to the user.
[0118] It should be noted that the various embodiments in this specification are described in a progressive manner, and any embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0119] It should also be noted that, although the present invention has been disclosed as a preferred embodiment, the above embodiment is not intended to limit the present invention. For any technician familiar with the art, without departing from the scope of the technical solution of the present invention, the technical content disclosed above can be used to make many possible changes and modifications to the technical solution of the present invention, or modified into equivalent embodiments of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.
[0120] It should also be understood that, unless otherwise specified or indicated, the terms "first", "second", "third", etc. in the specification are merely used to distinguish between the various components, elements, steps, etc. in the specification, and are not used to indicate the logical relationship or sequential relationship between the various components, elements, steps, etc.
[0121] It should also be recognized that the terms described herein are used only to describe specific embodiments and are not intended to limit the scope of the invention. It should be noted that the singular forms "a" and "an" used herein and in the appended claims include plural references unless the context clearly indicates otherwise. For example, a reference to "a step" or "a device" means a reference to one or more steps or devices, and may include secondary steps and secondary devices. All conjunctions used should be understood in the broadest sense. And, the word "or" should be understood to have the definition of a logical "or", rather than a logical "exclusive or", unless the context clearly indicates otherwise. In addition, the implementation of embodiments of the present invention may include performing selected tasks manually, automatically, or in combination.
Claims
1. A method for layered processing of homomorphic encrypted data, characterized in that: The homomorphically encrypted data includes a plurality of sub-data with different attributes, and the homomorphically encrypted data hierarchical processing method includes the following steps: Dividing the homomorphically encrypted data into a plurality of sub-data according to the attributes; storing each type of sub-data in a separate storage space to form multiple data layers; Each data layer corresponds to a cache layer. After processing the sub-data of any data layer each time, the processing result is stored in the cache layer corresponding to the data layer to form cache data; According to the business requirements for the whole or partial processing of the homomorphically encrypted data, several data layers are selected for processing to obtain the business processing sub-results of the data layer; when the cached data is required by the business requirements, the cached data is directly called as the business processing sub-result of the data layer corresponding to the cached data and the data processing of the data layer corresponding to the cached data is skipped; The processing of the sub-data of any data layer specifically includes: Provides different levels of algorithms, including: First level operations: Exponential operations and first multiplication operations are allowed; Second level operation: converting the exponential operation into a plurality of second multiplication operations with the same base, and converting the first multiplication operation into a plurality of addition operations with the same addends; measuring encryption noise of the sub-data; If the encryption noise is lower than a first noise threshold, allowing the first level operation to be performed on the sub-data; If the encryption noise is between a first noise threshold and a second noise threshold, the first level operation and the second level operation are allowed to be performed on the sub-data; If the encryption noise is higher than a second noise threshold, only the second level operation is allowed to be performed on the sub-data.
2. The method for layered processing of homomorphic encrypted data according to claim 1, characterized in that: The polymerization step further comprises: Selecting a number of the data layers for processing according to business requirements for processing the homomorphically encrypted data in whole or in part; The business processing sub-results of each selected data layer are aggregated to form a total business processing result.
3. The method for layered processing of homomorphic encrypted data according to claim 2, characterized in that: Aggregating the business processing sub-results of each selected data layer to form a total business processing result specifically includes: The business processing sub-results are converted into a matrix form and then aggregated.
4. The method for layered processing of homomorphic encrypted data according to claim 1, characterized in that: The sub-data is kept in a homomorphic encryption state in the data layer.
5. The method for layered processing of homomorphic encrypted data according to claim 4, characterized in that: The data features of the sub-data in the homomorphically encrypted state in each of the data layers are extracted, and based on the homomorphically encrypted data features, an optimized processing algorithm for processing the data layer is selected.
6. The method for layered processing of homomorphic encrypted data according to claim 1, characterized in that: The sub-data includes a polynomial, and the processing of the sub-data of any data layer specifically includes: Extract the coefficients of each term of the polynomial, take the position of the term where the coefficient is located in the polynomial as the horizontal coordinate, take the value of the coefficient as the vertical coordinate, and establish time domain data; Performing Fourier transform on the time domain data to convert it into frequency domain data, and processing the sub-data of any data layer based on the frequency domain data; The processed results are inverse Fourier transformed to restore the data to polynomial form.
7. The method for layered processing of homomorphic encrypted data according to claim 1, characterized in that: The processing of the sub-data of any data layer specifically includes: converting the sub-data into binary data; Performing bit operations on the binary data; A logical operation is performed based on the binary data.
8. The method for layered processing of homomorphic encrypted data according to claim 1, characterized in that: Each of the data layers includes a plurality of sub-data, and the processing of the sub-data of any data layer specifically includes: Get an anchor indicator; The sub-data are sorted according to the anchor indicator and the plurality of sub-data in the same data layer, and the sub-data are processed in the sorted order.
9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the homomorphic encryption data layering processing method as described in any one of claims 1 to 8.