Homomorphic encryption adaptive scaling factor adjustment method based on real-time precision estimation

CN122513074BActive Publication Date: 2026-10-27NORTHKING INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611007712.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-10-27
Estimated Expiration
2046-07-08

AI Technical Summary

Technical Problem

但是上述方式无法适应不同计算阶段误差累积的实际速度,导致早期精度冗余,而后期误差快速放大;在乘法密集型计算中,容易造成累积相对误差增大;对于数据分布不均匀场景,难以实现精度与误差权衡,影响后续计算准确率和效率

Benefits of technology

[0023]根据本发明的另一方面,提供了一种计算机程序产品,包括计算机程序,该计算机程序在被处理器执行时实现如本发明任一实施例所述的基于实时精度估算的全同态加密自适应缩放因子调节方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122513074B_ABST
    Figure CN122513074B_ABST
Patent Text Reader

Abstract

The application discloses a full-homomorphic encryption adaptive scaling factor adjusting method based on real-time precision estimation. The method comprises the following steps: obtaining first homomorphic encryption data by processing the obtained to-be-processed data based on an initial scaling factor and random noise; processing the first homomorphic encryption data to determine noise estimation data; when the noise estimation data does not satisfy a preset condition, taking the first homomorphic encryption data as the to-be-processed data, repeatedly executing the homomorphic encryption and noise estimation processes, so that when the noise estimation data satisfies the preset condition, determining a target scaling factor based on the noise estimation data and a scaling factor determination function; when a scaling factor adjusting instruction is received, processing the first homomorphic encryption data based on the target scaling factor to obtain second homomorphic encryption data; and performing homomorphic encryption processing based on the second homomorphic encryption data and the target scaling factor to obtain target homomorphic encryption data. The application improves the precision and accuracy of homomorphic encryption processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, and in particular to a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation. Background Technology

[0002] With the rapid development of cloud computing, artificial intelligence, and cross-domain data collaboration, sensitive data is typically encrypted using full homomorphic encryption to ensure its security. Full homomorphic encryption refers to encrypting the original plaintext data to generate ciphertext, allowing a third-party platform to directly perform arbitrary calculations on the ciphertext. The resulting ciphertext, after decryption, is completely identical to the result of the direct calculation on the plaintext, without requiring decryption of the original ciphertext or revealing any plaintext information.

[0003] Currently, existing fully homomorphic encryption methods primarily employ fixed or static scaling factors. However, these methods cannot adapt to the actual rate of error accumulation at different computational stages, leading to early precision redundancy followed by rapid error amplification in later stages. In multiplication-intensive computations, this easily results in increased cumulative relative error. Furthermore, for scenarios with uneven data distribution, it is difficult to achieve a trade-off between precision and error, impacting the accuracy and efficiency of subsequent calculations. Therefore, existing fully homomorphic encryption methods cannot guarantee the precision and accuracy of homomorphic encryption. Summary of the Invention

[0004] This invention provides a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation. By dynamically adjusting the scaling factor, it achieves effective control over noise growth and improves the accuracy and precision of homomorphic encryption processing.

[0005] According to one aspect of the present invention, a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation is provided, the method comprising:

[0006] Acquire data to be processed, wherein the data to be processed is business data associated with the target business;

[0007] In response to the event that the homomorphic encryption parameters have been initialized, the data to be processed is homomorphically encrypted based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain the first homomorphically encrypted data.

[0008] The first homomorphic encrypted data is subjected to precision estimation processing to determine the noise estimation data corresponding to the first homomorphic encrypted data; wherein the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data;

[0009] When the noise estimation data does not meet the preset conditions, the first homomorphic encrypted data is taken as the data to be processed, and the process of determining the first homomorphic encrypted data and the noise estimation data is repeated, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function.

[0010] In response to receiving a scaling factor adjustment instruction, based on the target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled and rescaled to obtain the second homomorphic encrypted data;

[0011] Homomorphic encryption is performed based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, thereby obtaining the target homomorphic encrypted data corresponding to the data to be processed.

[0012] According to another aspect of the present invention, a fully homomorphic encryption adaptive scaling factor adjustment device based on real-time accuracy estimation is provided, the device comprising:

[0013] The data acquisition module is used to acquire data to be processed, wherein the data to be processed is business data related to the target business.

[0014] The first homomorphic encrypted data determination module is used to perform homomorphic encryption processing on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters in response to the event that the homomorphic encryption parameters are initialized, so as to obtain the first homomorphic encrypted data.

[0015] The precision estimation module is used to perform precision estimation processing on the first homomorphic encrypted data to determine the noise estimation data corresponding to the first homomorphic encrypted data; wherein the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data.

[0016] The target scaling factor determination module is used to, when the noise estimation data does not meet the preset conditions, take the first homomorphic encrypted data as the data to be processed, and repeatedly execute the process of determining the first homomorphic encrypted data and the noise estimation data, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function.

[0017] The second homomorphic encrypted data determination module is used to respond to an event of receiving a scaling factor adjustment instruction, and based on the target scaling factor, to perform scale rescaling on the first homomorphic encrypted data corresponding to the target scaling factor to obtain the second homomorphic encrypted data.

[0018] The target homomorphic encrypted data determination module is used to perform homomorphic encryption processing based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, thereby obtaining the target homomorphic encrypted data corresponding to the data to be processed.

[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0020] At least one processor; and a memory communicatively connected to said at least one processor; wherein,

[0021] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation as described in any embodiment of the present invention.

[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation as described in any embodiment of the present invention.

[0023] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation as described in any embodiment of the present invention.

[0024] The technical solution of this invention involves acquiring data to be processed, and in response to an event indicating the completion of homomorphic encryption parameter initialization, performing homomorphic encryption on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain first homomorphically encrypted data. Precision estimation processing is then performed on the first homomorphically encrypted data to determine noise estimation data corresponding to it. If the noise estimation data does not meet preset conditions, the first homomorphically encrypted data is used as the data to be processed, and the process of determining the first homomorphically encrypted data and noise estimation data is repeated. When the noise estimation data meets preset conditions, a target scaling factor is obtained based on the noise estimation data that meets the preset conditions and the scaling factor. In response to an event indicating the receipt of a scaling factor adjustment command, the first homomorphically encrypted data corresponding to the target scaling factor is rescaled based on the target scaling factor to obtain second homomorphically encrypted data. Homomorphic encryption processing is then performed based on the second homomorphically encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, resulting in target homomorphically encrypted data corresponding to the data to be processed. This invention solves the problem that the scaling factor is usually a fixed value in the prior art, which cannot guarantee the accuracy of homomorphic encrypted data and has large errors that affect the accuracy and efficiency of subsequent calculations. By dynamically adjusting the scaling factor, the invention achieves effective control of noise growth and improves the accuracy and precision of homomorphic encryption processing.

[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation provided by an embodiment of the present invention;

[0028] Figure 2 This is a flowchart illustrating the scaling factor adjustment provided in an embodiment of the present invention;

[0029] Figure 3 This is a flowchart of a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation provided by an embodiment of the present invention;

[0030] Figure 4This is a schematic diagram of a fully homomorphic encryption adaptive scaling factor adjustment device based on real-time accuracy estimation provided in an embodiment of the present invention;

[0031] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation according to the embodiments of the present invention. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0035] Example 1

[0036] Figure 1 This is a flowchart of a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where plaintext business data is subjected to fully homomorphic encryption processing based on dynamically adjusted scaling factors. This method can be executed by a fully homomorphic encryption adaptive scaling factor adjustment device based on real-time accuracy estimation. This device can be implemented in hardware and / or software and can be configured in electronic devices such as mobile phones, computers, or servers. Figure 1 As shown, the method includes:

[0037] S110. Obtain the data to be processed, wherein the data to be processed is business data related to the target business.

[0038] The target business can be any business that requires fully homomorphic encryption of its corresponding business data. For example, if the current business system needs to send a user's acquired credit limit information to a third-party platform, then to ensure data security, the user's acquired credit limit information can be used as data to be processed, and this plaintext business data of the user's acquired credit limit information can be fully homomorphically encrypted.

[0039] It should be noted that fully homomorphic encryption means that after plaintext data is encrypted to generate ciphertext, a third-party platform can directly perform arbitrary calculations on the ciphertext. The ciphertext result obtained after decryption is completely consistent with the result of direct calculation on the plaintext data. The entire process does not require decryption of the original ciphertext and does not disclose any plaintext information.

[0040] Specifically, based on the business requirements corresponding to the target business, obtain the business data associated with the target business and treat this business data as data to be processed.

[0041] S120. In response to the event that the homomorphic encryption parameter initialization is completed, homomorphic encryption is performed on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameter to obtain the first homomorphic encrypted data.

[0042] The homomorphic encryption parameters can be parameters used to perform fully homomorphic encryption on the data. Optionally, the homomorphic encryption parameters may include an initial scaling factor, random noise, and adjustment coefficients and offset coefficients mentioned later. The initial scaling factor can be a pre-set fixed scaling factor used to amplify decimal or floating-point numbers in the plaintext data to integers.

[0043] It should be noted that, in this embodiment of the invention, the initial scaling factor applies to the plaintext business data, i.e., the data to be processed in the first iteration. Since the scaling factor needs to be dynamically adjusted in this embodiment, subsequent scaling factors apply to the encrypted data that matches the homomorphic encryption processing order.

[0044] Random noise can be obtained by random sampling based on a discrete Gaussian distribution or a uniform distribution. It should be noted that the random noise applied in each homomorphic encryption process is different. For the first homomorphic encryption process, the initial random noise in the homomorphic encryption parameters can be applied. Correspondingly, the first homomorphically encrypted data can be the ciphertext data obtained by homomorphically encrypting the data to be processed based on the initial scaling factor and random noise. It should be noted that the first homomorphically encrypted data is carried by ciphertext polynomials; that is, the first homomorphically encrypted data includes one or more ciphertext polynomials.

[0045] Specifically, upon receiving data to be processed, the homomorphic encryption parameters are initialized to determine the initial scaling factor and random noise within the parameters once initialization is complete. Based on the initial scaling factor, the data to be processed is scaled to convert it into integer business data suitable for homomorphic encryption. Then, full homomorphic encryption is performed on the integer business data adapted for homomorphic encryption and the random noise to obtain the first homomorphically encrypted data.

[0046] S130. Perform precision estimation processing on the first homomorphic encrypted data to determine the noise estimation data corresponding to the first homomorphic encrypted data.

[0047] To quantify the accuracy of the current encrypted data in real time, noise estimation data corresponding to the first homomorphic encrypted data can be determined. The noise estimation data characterizes the noise level of the current first homomorphic encrypted data. The noise estimation data is negatively correlated with the accuracy of the first homomorphic encrypted data; that is, the higher the noise estimation data, the lower the accuracy of the first homomorphic encrypted data.

[0048] Specifically, the accuracy of the first homomorphic encrypted data is estimated based on the noise estimation function to determine the noise estimation data corresponding to the first homomorphic encrypted data, so as to characterize the accuracy of the first homomorphic encrypted data through the noise estimation data.

[0049] Optionally, the accuracy of the first homomorphic encrypted data can also be estimated based on the statistical variance method of the auxiliary slots. Specifically, this process can involve: collecting multiple sets of independent noise sample data based on the auxiliary slots (redundant coding bits / redundant polynomial coefficients) reserved in the ciphertext polynomial corresponding to the first homomorphic encrypted data. The noise variance or noise standard deviation is then calculated based on these multiple sets of independent noise sample data to determine the noise estimation data corresponding to the first homomorphic encrypted data.

[0050] In this embodiment of the invention, the first homomorphic encrypted data can be subjected to precision estimation processing in the following manner: based on the ciphertext polynomial corresponding to the first homomorphic encrypted data, the target coefficients in the ciphertext polynomial are determined; based on the noise estimation function, the target coefficients and the scaling factor that matches the current homomorphic encryption processing order are processed to determine the noise estimation data.

[0051] Among them, the target coefficient is the polynomial coefficient with the largest absolute value. It can be understood that the target coefficient is the polynomial coefficient with the largest absolute value among all the polynomial coefficients of the ciphertext polynomial corresponding to the first homomorphic encrypted data.

[0052] The noise estimation function is expressed as:

[0053] ;

[0054] in, This represents noise estimation data. This represents the scaling factor that matches the current homomorphic encryption processing order. It can be understood that, since the scaling factor is dynamically adjusted in this embodiment of the invention, this is the initial scaling factor when the scaling factor is not adjusted; after subsequent adjustments, this is the adjusted scaling factor that matches the corresponding homomorphic encryption processing order. This represents the number of polynomial coefficients corresponding to the first homomorphic encrypted data. Indicates the first polynomial coefficients The corresponding absolute value, Represents the target coefficient. This represents the offset coefficient in the homomorphic encryption parameters, typically... The value range is [4,7].

[0055] Specifically, for the first precision estimation process, the absolute values ​​of all polynomial coefficients are determined based on the ciphertext polynomial corresponding to the first homomorphic encrypted data. Based on the absolute values ​​of all polynomial coefficients, the polynomial coefficient with the largest absolute value is determined, i.e., the target coefficient. The target coefficient and the initial scaling factor are then substituted into the noise estimation function to obtain the noise estimation data. Here, the target coefficient corresponds to... Alternatively, by substituting all polynomial coefficients and the initial scaling factor into the noise estimation function above, the noise estimation data can be obtained. Here, the polynomial coefficients correspond to... .

[0056] For the precision estimation process after adjusting the scaling factor, the absolute values ​​of all polynomial coefficients are determined based on the ciphertext polynomial corresponding to the first homomorphic encryption data in the current homomorphic encryption processing order. Based on the absolute values ​​of all polynomial coefficients, the polynomial coefficient with the largest absolute value is determined, which is the target coefficient corresponding to the current homomorphic encryption processing order. The target coefficient and the scaling factor corresponding to the current homomorphic encryption processing order are then substituted into the noise estimation function to obtain the noise estimation data.

[0057] S140. When the noise estimation data does not meet the preset conditions, the first homomorphic encrypted data is used as the data to be processed, and the process of determining the first homomorphic encrypted data and the noise estimation data is repeated, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function.

[0058] Optionally, if the noise estimation data exceeds a preset noise threshold, the noise estimation data is determined to meet the preset conditions; if the noise estimation data does not exceed the preset noise threshold, the noise estimation data is determined to not meet the preset conditions.

[0059] The preset noise threshold can be a pre-set standard value for the noise estimation data, used to characterize the acceptable or maximum tolerable noise level, in bits. The scaling factor determination function is used to determine the adjusted scaling factor, i.e., the target scaling factor. This can be understood as follows: when the noise estimation data exceeds the preset noise threshold, it indicates that the data precision of the homomorphic encryption data is low, and the noise factor can be dynamically adjusted to determine the target scaling factor for the next homomorphic encryption process.

[0060] Specifically, when the noise estimation data does not exceed the preset noise threshold, the first homomorphic encrypted data is used as the data to be processed, and the process of homomorphic encryption processing of the data to be processed and noise estimation processing based on the first homomorphic encrypted data is repeated. When it is determined that the obtained noise estimation data exceeds the preset noise threshold, the noise estimation data exceeding the preset noise threshold is substituted into the scaling factor determination function to obtain the target scaling factor, so as to apply the target scaling factor to the next homomorphic encryption process.

[0061] For example, see Figure 2 , Figure 2This is a flowchart illustrating the scaling factor adjustment process. After acquiring the data to be processed and initializing the homomorphic encryption parameters, the process enters a homomorphic encryption processing loop to perform multiple full homomorphic encryption processes on the data. During each homomorphic encryption process, noise estimation data for the corresponding homomorphic encrypted data is calculated. When the noise estimation data exceeds a preset noise threshold, the scaling factor determination timing is determined, i.e., the preset conditions are met. At this point, based on the noise estimation data exceeding the preset noise threshold and the corresponding scaling factor determination function, the target scaling factor usable for the next homomorphic encryption process is obtained.

[0062] In this embodiment of the invention, the method for determining the target scaling factor based on noise estimation data that meets preset conditions and the scaling factor determination function can be as follows: the noise estimation data that meets preset conditions, the preset noise threshold, the initial scaling factor, and the preset remaining multiplication depth value are substituted into the scaling factor determination function to obtain the target scaling factor.

[0063] The pre-set remaining multiplication depth value can be understood as the predetermined number of remaining multiplication operations. It should be noted that when the first homomorphically encrypted data is the input data of a neural network model, the remaining multiplication depth value is related to the model depth of the neural network. In other words, when the first homomorphically encrypted data is used as the input data of a neural network model that matches the business requirements, the remaining multiplication depth value can be set to match the model depth of the neural network.

[0064] The scaling factor determination function is expressed as follows:

[0065] ;

[0066] in, Indicates the target scaling factor. This represents the initial scaling factor (a fixed initial value that does not change with the order of homomorphic encryption). This represents the adjustment coefficient in the homomorphic encryption parameters, which can be determined by fitting multiple historical experiments beforehand and is used to control and adjust the sensitivity. This represents noise estimation data that meets preset conditions. Indicates the preset noise threshold. This represents the pre-set remaining multiplication depth value. This represents the logarithmic function, used to calculate the logarithm with a preset base. The base of the logarithmic function is related to an adjustment coefficient. Optionally, the preset base can be the natural constant e or 2; correspondingly, the logarithmic function can be... or . By adding a small constant, we can avoid the situation where the remaining multiplication depth is 0 and the logarithm is invalid.

[0067] Specifically, the noise estimation data that meets the preset conditions, the preset noise threshold, the initial scaling factor, and the preset remaining multiplication depth value are substituted into the scaling factor determination function to obtain the target scaling factor that can be applied to the next homomorphic encryption process.

[0068] For example, see [link to previous article] Figure 2 When it is determined that the scaling factor has been determined, the target scaling factor corresponding to the current time is determined.

[0069] S150. In response to receiving a scaling factor adjustment instruction, based on the target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled and rescaled to obtain the second homomorphic encrypted data.

[0070] The scaling factor adjustment command can be issued by the user through a corresponding control on the display interface, used to apply the target scaling factor to the next homomorphic encryption process. The first homomorphic encrypted data corresponding to the target scaling factor can be understood as the first homomorphic encrypted data corresponding to the noise estimation data used to calculate the target scaling factor. The second homomorphic encrypted data can be the first homomorphic encrypted data after scale rescaling.

[0071] Specifically, since the current noise estimation data exceeds the preset noise threshold, that is, the noise level of the first homomorphic encrypted data corresponding to the current noise estimation data does not meet the preset conditions, in order to improve the homomorphic encryption accuracy, the first homomorphic encrypted data corresponding to the current noise estimation data can be scaled based on the target scaling factor to obtain the second homomorphic encrypted data, so as to continue the next homomorphic encryption process based on the second homomorphic encrypted data.

[0072] For example, see [link to previous article] Figure 2 Upon receiving a scaling factor adjustment instruction, the system determines that the scaling factor update is timely and can apply the target scaling factor for subsequent homomorphic encryption processing. However, before performing subsequent homomorphic encryption, the system can first adaptively scale the first homomorphic encrypted data corresponding to the noise estimation data that does not currently meet the preset conditions to obtain second homomorphic encrypted data. This second homomorphic encrypted data will then be used to continue the next homomorphic encryption process. It should be noted that if no scaling factor adjustment instruction is received, the scaling factor will not be updated, and homomorphic encryption processing will continue based on the previous scaling factor.

[0073] S160. Perform homomorphic encryption processing based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches the preset number, and obtain the target homomorphic encrypted data corresponding to the data to be processed.

[0074] The preset number of operations can be a pre-set total number of homomorphic encryption processes. Optionally, the preset number of operations can be dynamically adjusted according to actual needs. The target homomorphically encrypted data can be the final encrypted data obtained by performing multiple full homomorphic encryption processes on the data to be processed.

[0075] Specifically, homomorphic encryption is performed based on the second homomorphic encrypted data and the target scaling factor, so that when the number of homomorphic encryption processes reaches a preset number, the homomorphic encrypted data at this time is used as the target homomorphic encrypted data corresponding to the data to be processed.

[0076] For example, see [link to previous article] Figure 2 Based on the second homomorphic encrypted data and the target scaling factor, the next homomorphic encryption process is performed until the number of homomorphic encryption processes reaches a preset number, at which point the homomorphic encryption process loop ends and the target homomorphic encrypted data is obtained.

[0077] The technical solution of this embodiment acquires the data to be processed. In response to the event indicating that the homomorphic encryption parameters have been initialized, homomorphic encryption is performed on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain first homomorphically encrypted data. Precision estimation is performed on the first homomorphically encrypted data to determine noise estimation data corresponding to it. If the noise estimation data does not meet preset conditions, the first homomorphically encrypted data is used as the data to be processed, and the process of determining the first homomorphically encrypted data and noise estimation data is repeated. When the noise estimation data meets the preset conditions, a target scaling factor is obtained based on the noise estimation data that meets the preset conditions and the scaling factor. In response to receiving a scaling factor adjustment command, the first homomorphically encrypted data corresponding to the target scaling factor is rescaled based on the target scaling factor to obtain second homomorphically encrypted data. Homomorphic encryption is then performed based on the second homomorphically encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, resulting in the target homomorphically encrypted data corresponding to the data to be processed. This invention solves the problem that the scaling factor is usually a fixed value in the prior art, which cannot guarantee the accuracy of homomorphic encrypted data and has large errors that affect the accuracy and efficiency of subsequent calculations. By dynamically adjusting the scaling factor, the invention achieves effective control of noise growth and improves the accuracy and precision of homomorphic encryption processing.

[0078] Example 2

[0079] Figure 3 This is a flowchart of a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation, provided in Embodiment 2 of the present invention. This embodiment is a preferred embodiment of the above embodiments. For specific implementation details, please refer to the technical solution of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here. Figure 3As shown, the method includes:

[0080] S210. Obtain the data to be processed, wherein the data to be processed is business data related to the target business.

[0081] S220. In response to the event that the homomorphic encryption parameter initialization is complete, homomorphic encryption is performed on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameter to obtain the first homomorphic encrypted data.

[0082] S230. Perform precision estimation processing on the first homomorphic encrypted data to determine the noise estimation data corresponding to the first homomorphic encrypted data.

[0083] Among them, the noise estimation data is negatively correlated with the accuracy data of the first homomorphic encryption data.

[0084] S240. When the noise estimation data does not meet the preset conditions, the first homomorphic encrypted data is used as the data to be processed, and the process of determining the first homomorphic encrypted data and the noise estimation data is repeated, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function.

[0085] S250. In response to receiving a scaling factor adjustment instruction, based on the target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled and rescaled to obtain the second homomorphic encrypted data.

[0086] Optionally, the first homomorphic encrypted data can be scaled by dividing the first homomorphic encrypted data corresponding to the target scaling factor by the target scaling factor to obtain the first data; and then rounding the first data to obtain the second homomorphic encrypted data; wherein the rounding is low-order truncation or rounding.

[0087] Here, the first data can be understood as the ratio of the first homomorphic encrypted data corresponding to the target scaling factor to the target scaling factor. Low-order truncation (discarding low-order bits) can mean retaining only specified valid bits and removing redundant low-order data. Rounding can mean rounding to the nearest integer value based on the next digit after the retained bits.

[0088] Specifically, the ratio of the first homomorphic encrypted data corresponding to the target scaling factor to the target scaling factor is determined as the first data. The first data is then truncated or rounded to balance the error, resulting in the second homomorphic encrypted data.

[0089] S260. The second homomorphic encrypted data is used as the data to be processed in the next homomorphic encryption process, and the target scaling factor is used as the scaling factor in the next homomorphic encryption process. The process of determining the first homomorphic encrypted data, determining the noise estimation data, determining the target scaling factor, and determining the second homomorphic encrypted data is repeated in sequence, so as to obtain the target homomorphic encrypted data when the number of homomorphic encryption processes reaches a preset number.

[0090] Specifically, the second homomorphically encrypted data is used as the data to be processed in the next homomorphic encryption process, and the target scaling factor is used as the scaling factor applied in the next homomorphic encryption process. The process of determining the first homomorphically encrypted data, determining the noise estimation data, determining the target scaling factor, and determining the second homomorphically encrypted data is repeated until a preset number of homomorphic encryption processes is detected, at which point the homomorphically encrypted data is used as the target homomorphically encrypted data. Specifically:

[0091] Based on the scaling factor and random noise applied in the next homomorphic encryption process, homomorphic encryption is performed on the data to be processed in the next homomorphic encryption process to obtain the corresponding first homomorphic encrypted data. When the noise estimation data corresponding to the first homomorphic encrypted data exceeds a preset noise threshold, the noise estimation data exceeding the preset noise threshold, the preset noise threshold, the initial scaling factor, and the preset remaining multiplication depth value are substituted into the scaling factor determination function to obtain the target scaling factor. Upon receiving a scaling factor adjustment instruction, the first homomorphic encrypted data corresponding to the target scaling factor is scaled according to the target scaling factor to obtain the second homomorphic encrypted data. The second homomorphic encrypted data is used as the data to be processed in the next homomorphic encryption process, and the target scaling factor is used as the scaling factor applied in the next homomorphic encryption process. The above process is repeated until the number of homomorphic encryption processes reaches a preset number to obtain the target homomorphic encrypted data corresponding to the data to be processed.

[0092] Optionally, embodiments of the present invention further include: performing business processing on the target homomorphically encrypted data in relation to the target business to determine the data application feedback result corresponding to the target homomorphically encrypted data; adjusting the homomorphic encryption parameters based on the data application feedback result, so as to perform homomorphic encryption processing on the next data to be processed based on the adjusted homomorphic encryption parameters.

[0093] Among them, the data application feedback results are used to characterize the data processing effect of applying homomorphically encrypted data of the application target for business processing.

[0094] Specifically, the target homomorphically encrypted data undergoes business processing related to the target business to determine the data application feedback result corresponding to the target homomorphically encrypted data. Based on the data application feedback result, the homomorphic encryption parameters are adjusted, and the next data to be processed is then homomorphically encrypted based on the adjusted parameters. This satisfies the different precision requirements of data homomorphic encryption processing under different business scenarios, improving the flexibility and universality of fully homomorphic encryption processing.

[0095] It should be noted that the accuracy estimation processing and scaling factor adjustment processing applied in the embodiments of the present invention can all be implemented through algorithms, and the corresponding algorithms can be seamlessly integrated into the required system.

[0096] The technical solution of this embodiment acquires the data to be processed. In response to the event that the homomorphic encryption parameters are initialized, it performs homomorphic encryption on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain first homomorphically encrypted data. It then performs precision estimation on the first homomorphically encrypted data to determine noise estimation data corresponding to it. If the noise estimation data does not meet preset conditions, the first homomorphically encrypted data is used as the data to be processed, and the process of determining the first homomorphically encrypted data and the noise estimation data is repeated. When the noise estimation data meets the preset conditions, a target scaling factor is obtained based on the noise estimation data that meets the preset conditions and the scaling factor determination function. In response to a received scaling factor adjustment instruction, based on a target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled again to obtain second homomorphic encrypted data. The second homomorphic encrypted data is then used as the data to be processed in the next homomorphic encryption process, and the target scaling factor is used as the scaling factor for the next homomorphic encryption process. This process of determining the first homomorphic encrypted data, determining noise estimation data, determining the target scaling factor, and determining the second homomorphic encrypted data is repeated sequentially until a preset number of homomorphic encryption processes is detected, at which point the target homomorphic encrypted data is obtained. This invention solves the problem in existing technologies where the scaling factor is usually a fixed value, leading to a lack of guaranteed accuracy in homomorphic encrypted data and significant errors that affect the accuracy and efficiency of subsequent calculations. By dynamically adjusting the scaling factor, effective control of noise growth is achieved, and computational overhead is effectively reduced. In scenarios with multiple multiplication depths, deeper homomorphic computation is supported, reducing accumulated relative errors. It supports increasing multiplication depth under the same accuracy requirements, reducing the frequency of pre-guided refreshes, thereby improving the practicality and efficiency of the fully homomorphic encryption CKKS scheme in privacy-preserving computations such as federated learning and encrypted AI inference. In addition, in scenarios with a large data range, it can reduce the loss of precision and improve the precision and accuracy of homomorphic encryption processing.

[0097] Example 3

[0098] Figure 4 This is a schematic diagram of a fully homomorphic encryption adaptive scaling factor adjustment device based on real-time accuracy estimation, provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a data acquisition module 310, a first homomorphic encrypted data determination module 320, a precision estimation module 330, a target scaling factor determination module 340, a second homomorphic encrypted data determination module 350, and a target homomorphic encrypted data determination module 360.

[0099] A data acquisition module 310 is used to acquire data to be processed, wherein the data to be processed is business data associated with a target business; a first homomorphic encrypted data determination module 320 is used to, in response to an event indicating that the homomorphic encryption parameter initialization is complete, perform homomorphic encryption processing on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain first homomorphic encrypted data; a precision estimation module 330 is used to perform precision estimation processing on the first homomorphic encrypted data to determine noise estimation data corresponding to the first homomorphic encrypted data; wherein the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data; a target scaling factor determination module 340 is used to, when the noise estimation data does not meet a preset condition, reduce the first homomorphic encrypted data... The data is used as the data to be processed, and the process of determining the first homomorphic encrypted data and noise estimation data is repeatedly executed. When the noise estimation data meets the preset conditions, a target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function. The second homomorphic encrypted data determination module 350 is used to respond to the event of receiving a scaling factor adjustment instruction, and to perform scale rescaling processing on the first homomorphic encrypted data corresponding to the target scaling factor based on the target scaling factor to obtain the second homomorphic encrypted data. The target homomorphic encrypted data determination module 360 ​​is used to perform homomorphic encryption processing based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processing reaches a preset number, to obtain the target homomorphic encrypted data corresponding to the data to be processed.

[0100] The technical solution of this embodiment acquires the data to be processed. In response to the event indicating that the homomorphic encryption parameters have been initialized, homomorphic encryption is performed on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain first homomorphically encrypted data. Precision estimation is performed on the first homomorphically encrypted data to determine noise estimation data corresponding to it. If the noise estimation data does not meet preset conditions, the first homomorphically encrypted data is used as the data to be processed, and the process of determining the first homomorphically encrypted data and noise estimation data is repeated. When the noise estimation data meets the preset conditions, a target scaling factor is obtained based on the noise estimation data that meets the preset conditions and the scaling factor. In response to receiving a scaling factor adjustment command, the first homomorphically encrypted data corresponding to the target scaling factor is rescaled based on the target scaling factor to obtain second homomorphically encrypted data. Homomorphic encryption is then performed based on the second homomorphically encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, resulting in the target homomorphically encrypted data corresponding to the data to be processed. This invention solves the problem that the scaling factor is usually a fixed value in the prior art, which cannot guarantee the accuracy of homomorphic encrypted data and has large errors that affect the accuracy and efficiency of subsequent calculations. By dynamically adjusting the scaling factor, the invention achieves effective control of noise growth and improves the accuracy and precision of homomorphic encryption processing.

[0101] Based on the above embodiments, optionally, the precision estimation module is used to determine target coefficients in the ciphertext polynomial according to the ciphertext polynomial corresponding to the first homomorphic encrypted data; wherein, the target coefficients are polynomial coefficients with the largest absolute value; and to process the target coefficients and a scaling factor matching the current homomorphic encryption processing order based on a noise estimation function to determine noise estimation data; wherein, the noise estimation function is expressed as:

[0102] ;

[0103] in, This represents the noise estimation data. This represents a scaling factor that matches the current homomorphic encryption processing order. This represents the number of polynomial coefficients corresponding to the first homomorphic encrypted data. Indicates the first polynomial coefficients The corresponding absolute value, Represents the target coefficient. This represents the offset coefficient in the homomorphic encryption parameters.

[0104] Optionally, whether the noise estimation data meets the preset conditions is determined in the following way: when the noise estimation data exceeds a preset noise threshold, the noise estimation data is determined to meet the preset conditions; when the noise estimation data does not exceed the preset noise threshold, the noise estimation data is determined not to meet the preset conditions.

[0105] Optionally, the target scaling factor determination module includes a scaling factor calculation unit, used to substitute noise estimation data that meets preset conditions, a preset noise threshold, the initial scaling factor, and a preset remaining multiplication depth value into the scaling factor determination function to obtain the target scaling factor; wherein, the scaling factor determination function is expressed as:

[0106] ;

[0107] in, Indicates the target scaling factor. Indicates the initial scaling factor. This represents the adjustment coefficient in the homomorphic encryption parameters. This represents noise estimation data that meets preset conditions. Indicates the preset noise threshold. This represents the pre-set remaining multiplication depth value. The logarithmic function is used to calculate the logarithm with a preset base, and the base of the logarithmic function is related to the adjustment coefficient.

[0108] Optionally, when the first homomorphic encrypted data is the input data of a neural network model, the remaining multiplication depth value is related to the model depth of the neural network model.

[0109] Optionally, the second homomorphic encrypted data determination module is used to divide the first homomorphic encrypted data corresponding to the target scaling factor and the target scaling factor to obtain the first data; and to perform a rounding operation on the first data to obtain the second homomorphic encrypted data; wherein the rounding operation is low-order truncation or rounding.

[0110] Optionally, the target homomorphic encrypted data determination module is used to use the second homomorphic encrypted data as the data to be processed in the next homomorphic encryption process, and to use the target scaling factor as the scaling factor in the next homomorphic encryption process. The process of determining the first homomorphic encrypted data, determining the noise estimation data, determining the target scaling factor, and determining the second homomorphic encrypted data is repeated in sequence, so as to obtain the target homomorphic encrypted data when the number of homomorphic encryption processes reaches a preset number.

[0111] Optionally, the device further includes: a homomorphic encryption parameter adjustment module, used to perform business processing on the target homomorphic encrypted data in association with the target service, so as to determine the data application feedback result corresponding to the target homomorphic encrypted data; and to adjust the homomorphic encryption parameter based on the data application feedback result, so as to perform homomorphic encryption processing on the next data to be processed based on the adjusted homomorphic encryption parameter.

[0112] The fully homomorphic encrypted adaptive scaling factor adjustment device based on real-time accuracy estimation provided in the embodiments of the present invention can execute the fully homomorphic encrypted adaptive scaling factor adjustment method based on real-time accuracy estimation provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.

[0113] Example 4

[0114] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0115] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory 12 or a random access memory 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 12 or a computer program loaded from storage unit 18 into the random access memory 13. The random access memory 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, read-only memory 12, and random access memory 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0116] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0117] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a fully homomorphic cryptographic adaptive scaling factor adjustment method based on real-time accuracy estimation.

[0118] In some embodiments, the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by processor 11, one or more steps of the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation by any other suitable means (e.g., by means of firmware).

[0119] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0120] Computer programs for implementing the fully homomorphic encrypted adaptive scaling factor adjustment method based on real-time accuracy estimation of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0121] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from read-only memory 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of the embodiments of the present invention.

[0122] Example 5

[0123] Embodiment 5 of the present invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation, the method comprising:

[0124] Acquire data to be processed, wherein the data to be processed is business data associated with the target business;

[0125] In response to the event that the homomorphic encryption parameters have been initialized, the data to be processed is homomorphically encrypted based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain the first homomorphically encrypted data.

[0126] The first homomorphic encrypted data is subjected to precision estimation processing to determine the noise estimation data corresponding to the first homomorphic encrypted data; wherein the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data;

[0127] When the noise estimation data does not meet the preset conditions, the first homomorphic encrypted data is taken as the data to be processed, and the process of determining the first homomorphic encrypted data and the noise estimation data is repeated, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function.

[0128] In response to receiving a scaling factor adjustment instruction, based on the target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled and rescaled to obtain the second homomorphic encrypted data;

[0129] Homomorphic encryption is performed based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, thereby obtaining the target homomorphic encrypted data corresponding to the data to be processed.

[0130] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0132] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0133] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0134] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation as provided in any embodiment of this application.

[0135] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider). This program product belongs to the same inventive concept as the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation disclosed in the embodiments of this application, and therefore will not be described further here.

[0136] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0137] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation, characterized in that, include: Acquire data to be processed, wherein the data to be processed is business data associated with the target business; In response to the event that the homomorphic encryption parameters have been initialized, the data to be processed is homomorphically encrypted based on the initial scaling factor and random noise in the homomorphic encryption parameters to obtain the first homomorphically encrypted data. The first homomorphic encrypted data is subjected to precision estimation processing to determine noise estimation data corresponding to the first homomorphic encrypted data; wherein, the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data, the noise estimation data is used to characterize the noise level of the first homomorphic encrypted data, and the larger the noise estimation data is, the lower the precision of the first homomorphic encrypted data. When the noise estimation data does not meet the preset conditions, the first homomorphic encrypted data is taken as the data to be processed, and the process of determining the first homomorphic encrypted data and the noise estimation data is repeated, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function. In response to receiving a scaling factor adjustment instruction, based on the target scaling factor, the first homomorphic encrypted data corresponding to the target scaling factor is scaled and rescaled to obtain the second homomorphic encrypted data; Homomorphic encryption processing is performed based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processing reaches a preset number, thereby obtaining the target homomorphic encrypted data corresponding to the data to be processed. The step of performing precision estimation processing on the first homomorphic encrypted data to determine the noise estimation data corresponding to the first homomorphic encrypted data includes: determining the target coefficients in the ciphertext polynomial based on the ciphertext polynomial corresponding to the first homomorphic encrypted data; wherein the first homomorphic encrypted data includes one or more ciphertext polynomials, and the target coefficients are polynomial coefficients with the largest absolute value, and the target coefficients are the polynomial coefficients with the largest absolute value among all polynomial coefficients of the ciphertext polynomial corresponding to the first homomorphic encrypted data; and processing the target coefficients and a scaling factor matching the current homomorphic encryption processing order based on the noise estimation function to determine the noise estimation data. The noise estimation function is expressed as follows: ; in, This represents the noise estimation data. This represents the scaling factor that matches the current homomorphic encryption processing order. Without adjusting the scaling factor, This represents the initial scaling factor. After adjusting the scaling factor, This represents the adjusted scaling factor that matches the corresponding homomorphic encryption processing order. Indicates the first polynomial coefficients The corresponding absolute value, This represents the target coefficient. This represents the offset coefficient in the homomorphic encryption parameters; Whether the noise estimation data meets the preset conditions is determined in the following way: when the noise estimation data exceeds the preset noise threshold, the noise estimation data is determined to meet the preset conditions; when the noise estimation data does not exceed the preset noise threshold, the noise estimation data is determined not to meet the preset conditions. The step of determining the target scaling factor based on noise estimation data that meets preset conditions and a scaling factor determination function includes: substituting the noise estimation data that meets preset conditions, a preset noise threshold, the initial scaling factor, and a preset remaining multiplication depth value into the scaling factor determination function to obtain the target scaling factor; The scaling factor determination function is expressed as follows: ; in, This represents the target scaling factor, which is the scaling factor applied in the next homomorphic encryption process. Indicates the initial scaling factor. The initial value is fixed and does not change with the order of homomorphic encryption. This represents the adjustment coefficient in the homomorphic encryption parameters. This represents noise estimation data that meets preset conditions. Indicates the preset noise threshold. This represents the pre-set remaining multiplication depth value. The logarithmic function is used to calculate the logarithm with a preset base, and the base of the logarithmic function is related to the adjustment coefficient.

2. The method according to claim 1, characterized in that, When the first homomorphic encrypted data is the input data of a neural network model, the remaining multiplication depth value is related to the model depth of the neural network model.

3. The method according to claim 1, characterized in that, The step of scaling the first homomorphic encrypted data corresponding to the target scaling factor to obtain the second homomorphic encrypted data based on the target scaling factor includes: Divide the first homomorphic encrypted data corresponding to the target scaling factor with the target scaling factor to obtain the first data; The first data is rounded to obtain the second homomorphic encrypted data; wherein the rounding is low-order truncation or rounding.

4. The method according to claim 1, characterized in that, The process of performing homomorphic encryption based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processes reaches a preset number, to obtain target homomorphic encrypted data corresponding to the data to be processed, includes: The second homomorphic encrypted data is used as the data to be processed in the next homomorphic encryption process, and the target scaling factor is used as the scaling factor in the next homomorphic encryption process. The process of determining the first homomorphic encrypted data, determining the noise estimation data, determining the target scaling factor, and determining the second homomorphic encrypted data is repeated in sequence, so that the target homomorphic encrypted data is obtained when the number of homomorphic encryption processes reaches a preset number.

5. The method according to claim 1, characterized in that, Also includes: Perform business processing related to the target service on the target homomorphic encrypted data to determine the data application feedback result corresponding to the target homomorphic encrypted data; Based on the feedback results of the data application, the homomorphic encryption parameters are adjusted so that the next data to be processed can be homomorphically encrypted based on the adjusted homomorphic encryption parameters.

6. A fully homomorphic encrypted adaptive scaling factor adjustment device based on real-time accuracy estimation, characterized in that, include: The data acquisition module is used to acquire data to be processed, wherein the data to be processed is business data related to the target business. The first homomorphic encrypted data determination module is used to perform homomorphic encryption processing on the data to be processed based on the initial scaling factor and random noise in the homomorphic encryption parameters in response to the event that the homomorphic encryption parameters are initialized, so as to obtain the first homomorphic encrypted data. The precision estimation module is used to perform precision estimation processing on the first homomorphic encrypted data to determine the noise estimation data corresponding to the first homomorphic encrypted data; wherein, the noise estimation data is negatively correlated with the precision data of the first homomorphic encrypted data, the noise estimation data is used to characterize the noise level of the first homomorphic encrypted data, and the larger the noise estimation data, the lower the precision of the first homomorphic encrypted data. The target scaling factor determination module is used to, when the noise estimation data does not meet the preset conditions, take the first homomorphic encrypted data as the data to be processed, and repeatedly execute the process of determining the first homomorphic encrypted data and the noise estimation data, so that when the noise estimation data meets the preset conditions, the target scaling factor is determined based on the noise estimation data that meets the preset conditions and the scaling factor determination function. The second homomorphic encrypted data determination module is used to respond to an event of receiving a scaling factor adjustment instruction, and based on the target scaling factor, to perform scale rescaling on the first homomorphic encrypted data corresponding to the target scaling factor to obtain the second homomorphic encrypted data. The target homomorphic encrypted data determination module is used to perform homomorphic encryption processing based on the second homomorphic encrypted data and the target scaling factor until the number of homomorphic encryption processing reaches a preset number, thereby obtaining the target homomorphic encrypted data corresponding to the data to be processed. The precision estimation module is used to determine target coefficients in the ciphertext polynomial based on the ciphertext polynomial corresponding to the first homomorphic encrypted data; wherein the first homomorphic encrypted data includes one or more ciphertext polynomials, and the target coefficients are polynomial coefficients with the largest absolute value, wherein the target coefficients are the polynomial coefficients with the largest absolute value among all polynomial coefficients of the ciphertext polynomial corresponding to the first homomorphic encrypted data; and to determine noise estimation data by processing the target coefficients and a scaling factor matching the current homomorphic encryption processing order based on a noise estimation function; wherein the noise estimation function is expressed as: ; in, This represents the noise estimation data. This represents the scaling factor that matches the current homomorphic encryption processing order. Without adjusting the scaling factor, This represents the initial scaling factor. After adjusting the scaling factor, This represents the adjusted scaling factor that matches the corresponding homomorphic encryption processing order. Indicates the first polynomial coefficients The corresponding absolute value, Represents the target coefficient. This represents the offset coefficient in the homomorphic encryption parameters; Whether the noise estimation data meets the preset conditions is determined in the following way: when the noise estimation data exceeds the preset noise threshold, the noise estimation data is determined to meet the preset conditions; when the noise estimation data does not exceed the preset noise threshold, the noise estimation data is determined not to meet the preset conditions. The target scaling factor determination module includes a scaling factor calculation unit, used to substitute noise estimation data that meets preset conditions, a preset noise threshold, the initial scaling factor, and a preset remaining multiplication depth value into the scaling factor determination function to obtain the target scaling factor; wherein, the scaling factor determination function is expressed as: ; in, This represents the target scaling factor, which is the scaling factor applied in the next homomorphic encryption process. Indicates the initial scaling factor. The initial value is fixed and does not change with the order of homomorphic encryption. This represents the adjustment coefficient in the homomorphic encryption parameters. This represents noise estimation data that meets preset conditions. Indicates the preset noise threshold. This represents the pre-set remaining multiplication depth value. The logarithmic function is used to calculate the logarithm with a preset base, and the base of the logarithmic function is related to the adjustment coefficient.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fully homomorphic encryption adaptive scaling factor adjustment method based on real-time accuracy estimation as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data processing method and device, chip, medium, product and electronic equipment

    CN122293298A

  • RNS-based CKKS variant with minimal rescaling error

    US20230012099A1

  • Management of accurate scales in fully-homomorphic encryption schemes

    US20240039691A1