Privacy algorithm construction method, device, electronic device and readable storage medium
By converting the original function into the target polynomial, the problem of low calculation efficiency of complex functions in secure multi-party calculations is solved, the calculation amount is reduced and the efficiency is improved, while the accuracy of the polynomial is improved.
Patent Information
- Application Number
- CN202210745439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In the safe multi-party calculation process, the use of complex convention functions leads to large calculation volume and low calculation efficiency.
By determining the initial polynomial of the original function in the target value interval, and using the expansion coefficient and compression coefficient to represent the polynomial coefficients, a target polynomial with a relatively low computational load is obtained to replace the original function for privacy calculations.
The calculation amount in the privacy calculation process is reduced, the calculation efficiency is improved, and the accuracy of the calculation results is enhanced through more accurate polynomial representation.
Smart Images

Figure CN115081021B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of decentralized computing technology, and more specifically, to a privacy algorithm construction method, device, electronic device, and readable storage medium. Background Art
[0002] Secure Multi-Party Computation is mainly aimed at realizing the secure calculation of an agreed function without a trusted third party. In order to ensure the security of data of all parties, the process of secure multi-party computing usually adopts privacy computing to realize the processing of multi-party data. Therefore, in the process of secure multi-party computing, if the agreed function used is a relatively complex function, the amount of calculation is large and the calculation efficiency is often unacceptable. Summary of the invention
[0003] The purpose of this application is to provide a privacy algorithm construction method, device, electronic device and readable storage medium, which can improve the problem of low computational efficiency of privacy computing in the secure multi-party computing process, thereby improving the computational efficiency of privacy computing.
[0004] In a first aspect, the present invention provides a privacy algorithm construction method, comprising:
[0005] According to the original function, an initial polynomial is determined in the target numerical interval;
[0006] The coefficients of the initial polynomial are represented by expansion coefficients and compression coefficients to obtain a target polynomial, wherein the size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient. The target polynomial is used to replace the original function for privacy computing, and the input parameters of the target polynomial include confidential data for privacy computing.
[0007] In an optional implementation manner, the step of expressing each coefficient of the initial polynomial using an expansion coefficient and a compression coefficient to obtain a target polynomial includes:
[0008] Determine the initial expansion coefficient and the initial compression coefficient corresponding to each coefficient of the initial polynomial according to the fixed-point number configuration parameter and each coefficient of the initial polynomial to obtain an updated polynomial, wherein the fixed-point number configuration parameter is used to characterize the value range of the input data or the output data of the target polynomial;
[0009] The update polynomial is supplemented according to a residual function between the original function and the update polynomial to obtain a target polynomial.
[0010] In an optional implementation, the fixed-point number configuration parameters include: fixed-point number integer length and fixed-point number precision length; the initial expansion coefficient and initial compression coefficient corresponding to each coefficient of the initial polynomial are determined according to the fixed-point number configuration parameters and each coefficient of the initial polynomial to obtain an updated polynomial, including:
[0011] For a first coefficient of the initial polynomial, a fixed-point lower limit value is calculated according to the fixed-point number precision length, wherein the first coefficient is any coefficient of the initial polynomial;
[0012] Calculate the minimum unoverflowed coefficient according to the fixed-point integer length, the fixed-point precision length and the order corresponding to the first coefficient;
[0013] Determining an initial compression coefficient corresponding to the first coefficient according to a larger value between the fixed point lower limit value and the minimum unoverflowed coefficient;
[0014] Determine the initial expansion coefficient corresponding to the first coefficient according to the first coefficient and the initial compression coefficient, and determine the initial compression coefficient and initial expansion coefficient corresponding to each coefficient in the initial polynomial through the above steps;
[0015] The coefficients of each item in the initial polynomial are expressed using the corresponding initial compression coefficient and the initial expansion coefficient to obtain an updated polynomial.
[0016] In an optional implementation manner, determining the initial expansion coefficient corresponding to the first coefficient according to the first coefficient and the initial compression coefficient includes:
[0017] Obtaining a pre-expansion coefficient by dividing the first coefficient by the initial compression coefficient;
[0018] If the pre-expansion coefficient is greater than a fixed-point upper limit value, determining the fixed-point upper limit value as an initial expansion coefficient corresponding to the first coefficient;
[0019] If the pre-expansion coefficient is less than the fixed point lower limit value, determining the specified value as the initial expansion coefficient corresponding to the first coefficient;
[0020] If the number of significant digits of the value contained in the pre-expansion coefficient is greater than the fixed-point precision length, the value after the decimal point fixed-point precision length in the pre-expansion coefficient is set to zero to obtain the initial expansion coefficient corresponding to the first coefficient.
[0021] In an optional implementation, the step of supplementing the update polynomial according to a residual function between the original function and the update polynomial to obtain a target polynomial includes:
[0022] Calculate a current residual function according to the original function and a first current polynomial, wherein when this step is performed for the first time, the first current polynomial is the updated polynomial;
[0023] Performing polynomial fitting on the current residual function to obtain a current residual polynomial, wherein the current residual polynomial is a current order;
[0024] Aggregating the current residual polynomial and the first current polynomial to obtain a second current polynomial;
[0025] Compare a first error between the first current polynomial and the original function with a second error between the second current polynomial and the original function;
[0026] If the first error is greater than the second error, the second current polynomial is used as the first current polynomial, and the current order is updated, and the above steps are repeated until the current order of the current residual function is the specified order;
[0027] The final second current polynomial is used as the target polynomial of the initial polynomial.
[0028] In an optional implementation, the aggregating the current residual polynomial and the first current polynomial to obtain a second current polynomial includes:
[0029] Merging the current residual polynomial with the first current polynomial by similar terms to obtain an initial merged polynomial;
[0030] The coefficients of each term in the initial combined polynomial are converted into fixed-point coefficients to obtain a second current polynomial.
[0031] In an optional implementation, the converting each coefficient in the initial combined polynomial into a fixed-point coefficient to obtain a second current polynomial includes:
[0032] According to the fixed-point number configuration parameters and the coefficients of the initial combined polynomial, the expansion coefficient and the compression coefficient corresponding to the coefficients of the initial combined polynomial are determined to obtain a second current polynomial.
[0033] In a second aspect, the present invention provides a privacy algorithm construction device, comprising:
[0034] A polynomial determination module, used to determine an initial polynomial in a target numerical interval according to the original function;
[0035] A polynomial updating module is used to represent each coefficient of the initial polynomial using an expansion coefficient and a compression coefficient to obtain a target polynomial, wherein the size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient. The target polynomial is used to replace the original function for privacy computing, and the input parameters of the target polynomial include confidential data for privacy computing.
[0036] In a third aspect, the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in any of the aforementioned embodiments.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any of the aforementioned embodiments are executed.
[0038] The beneficial effects of the embodiments of the present application include at least: by replacing the original function of the smooth nonlinear function used for privacy computing with a function composed of a polynomial with relatively low computational complexity, the computational complexity in the privacy computing process can be reduced, and the efficiency of privacy computing can be improved. Furthermore, by using two numbers to represent the polynomial coefficients, the accuracy of the coefficients in the polynomial can be better expressed, and the determined polynomial can better express the original function, so that the calculation process of the privacy computing can also be more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic diagram of the operating environment of the secure multi-party computing system provided in an embodiment of the present application;
[0041] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;
[0042] Figure 3 A flowchart of a privacy algorithm construction method provided in an embodiment of the present application;
[0043] Figure 4 An optional flow chart of step 220 of the privacy algorithm construction method provided in an embodiment of the present application;
[0044] Figure 5 An optional flow chart of step 221 of the privacy algorithm construction method provided in an embodiment of the present application;
[0045] Figure 6 An optional flow chart of step 222 of the privacy algorithm construction method provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the functional modules of the privacy algorithm construction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.
[0048] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0049] Secure Multi-Party Computation (SMC) is mainly aimed at realizing the secure calculation of an agreed function without a trusted third party. SMC is the cryptographic basis for many applications such as electronic elections, threshold signatures, and electronic auctions.
[0050] The inventor of this application has found that in order to protect the security of data in the platforms of all parties during secure multi-party computing, the calculation is performed based on the secret data provided by the platforms of all parties. This will make the calculation of nonlinear functions very difficult during secure multi-party computing and require huge R&D costs. Generally speaking, the secure computing service provider will provide some basic nonlinear functions, such as e x , For other more complex nonlinear functions, they are expanded into basic operations. For example, the ciphertext variable x is calculated The calculation method is: first calculate the ciphertext y = e -x , and then calculate the ciphertext result This solution requires the continuous calculation of two basic nonlinear functions: e exponentiation and division. This calculation method has at least the following problems: 1) High cost: Since the basic nonlinear function requires large computing resources, the computational cost of other nonlinear functions is basically equivalent to the serial execution of each basic nonlinear function. The cost is proportional to the complexity of the expression, which ultimately leads to a very large amount of calculation and the computational efficiency is often unacceptable; 2) Low precision: In the scenario of secure multi-party computing, fixed-point numbers are generally used to represent real numbers, that is, an n-bit integer is used. Multiply by a certain resolution factor 2 -f To represent any real number v, The precision limit of each fixed-point number is 2 -f , which is much smaller than the floating point number commonly used in plain text. When performing operations, there is a certain error in each step of the calculation. When calculating nonlinear functions, the error will accumulate layer by layer with the calculation steps, resulting in a large difference between the final calculation result and the true value.
[0051] Therefore, the inventor of the present application has proposed a method to use polynomials to represent complex nonlinear functions. When solving a polynomial that minimizes the maximum approximation error in a closed interval, the representation range and representation accuracy of the numerical value are usually very high, and are generally implemented by double-precision floating-point numbers. However, in the environment of secure multi-party computing, fixed-point numbers are usually used to represent real numbers, and there may be some limitations on the representation range and representation accuracy. Constructing a k-order fixed-point polynomial that minimizes the maximum error in a closed interval [a, b] is equivalent to an NP-complete integer programming problem, and there is no solution algorithm in polynomial time. In order to reduce the impact of the precision of the fixed-point number as a polynomial, the embodiment of the present application represents a coefficient by two numbers, so that a coefficient with higher precision can be represented to improve the precision of the polynomial. Based on the above research, the present application provides a privacy algorithm construction method, which converts the nonlinear function used for secure multi-party computing into a piecewise polynomial to reduce the computational complexity, improve the computational efficiency, and also improve the precision of the polynomial. The privacy algorithm construction method provided by the present application is described below through some embodiments.
[0052] To facilitate understanding of this embodiment, the operating environment for executing the privacy computing method disclosed in the embodiment of this application is first introduced.
[0053] The privacy computing method may be used in a secure multi-party computing system 10, which may include a multi-party electronic device 110. Figure 1 As shown, the electronic device 110 may be a network server, a database server, etc.; it may also be a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc.
[0054] Any electronic device 110 in the secure multi-party computing system 10 can process data through privacy computing without obtaining plaintext data from other electronic devices 110.
[0055] Each electronic device 110 may store a target polynomial for privacy computing. The target polynomial may be constructed by any electronic device 110 , or may be constructed by an electronic device that can communicate with each electronic device 110 in the secure multi-party computing system 10 .
[0056] like Figure 2 , which is a block diagram of an electronic device. The electronic device 110 may include a memory 111 and a processor 113. A person skilled in the art may understand that Figure 2 The structure shown is only for illustration and does not limit the structure of the electronic device 110. For example, the electronic device 110 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 The electronic device 110 shown may be Figure 1 Any electronic device 110 in the secure multi-party computing system 10 shown.
[0057] The memory 111 and the processor 113 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The processor 113 is used to execute the executable module stored in the memory.
[0058] The memory 111 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 113 executes the program after receiving the execution instruction. The method executed by the electronic device 110 defined by the process disclosed in any embodiment of the present application can be applied to the processor 113, or implemented by the processor 113.
[0059] The processor 113 may be an integrated circuit chip with signal processing capability. The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0060] The electronic device 110 in this embodiment can be used to execute each step in each method provided in the embodiments of the present application. The implementation process of the privacy algorithm construction method is described in detail below through several embodiments.
[0061] See also Figure 3 , is a flowchart of the privacy algorithm construction method provided in the embodiment of the present application. Figure 3 The specific process shown is described in detail.
[0062] Step 210, determining an initial polynomial in the target numerical interval according to the original function.
[0063] Exemplarily, a plurality of points of the original function in the target numerical interval may be obtained first, and the number of the plurality of points may be greater than the highest order of the initial polynomial that needs to be constructed.
[0064] The number of points in the target value interval [a, b] can be expressed as:
[0065]
[0066] Wherein, N represents the number of multiple points determined in the target numerical interval; f represents the fixed-point number precision length limited by the construction of the polynomial; MS represents a preset threshold. The preset threshold can be a relatively large value, for example, the preset threshold can be 500, 700, 1000, 1300, etc.
[0067] For example, if the highest order of the initial polynomial to be constructed is k, the number of multiple points of the original function to be obtained in the target numerical interval is greater than k.
[0068] Exemplarily, multiple points of the original function in the target numerical interval may be fitted to obtain an initial polynomial.
[0069] Optionally, an algorithm such as a Lagrange interpolation algorithm or a Chebyshev interpolation algorithm may be used to fit multiple points of the original function in the target numerical interval to obtain an initial polynomial.
[0070] Step 220: The coefficients of each item of the initial polynomial are expressed using an expansion coefficient and a compression coefficient to obtain a target polynomial.
[0071] The target polynomial is used to replace the original function for privacy computing, and the input parameters of the target polynomial include secret data for privacy computing.
[0072] Exemplarily, when the original function corresponds to multiple numerical intervals, the original function can be represented by target polynomials corresponding to the multiple numerical intervals.
[0073] The size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient, and the expansion coefficient and the corresponding compression coefficient of each coefficient are both within the numerical range defined by the fixed-point number configuration parameter.
[0074] The initial polynomial can be expressed as:
[0075] Among them, c i Represents the coefficient of the i-th order term of the initial polynomial.
[0076] Should in, represents the expansion coefficient, represents the compression factor;
[0077] Therefore, the target polynomial can be expressed as:
[0078] Among them, the expansion coefficient Compression factor They are all fixed-point numbers that meet the requirements of pre-configured fixed-point number configuration parameters.
[0079] Exemplarily, the preconfigured fixed-point number configuration parameters may include a fixed-point number integer length n and a fixed-point number precision length f. The maximum fixed-point number that can be represented by the preconfigured fixed-point number configuration parameters is 2 n-f-1 ; The minimum fixed-point number that can be represented by this pre-configured fixed-point configuration parameter 2 -f .
[0080] Therefore, the above expansion coefficient And the compression factor Both are located at 2 n-f-1 with 2-f between.
[0081] In the method provided in the embodiment of the present application, by replacing the original function used for privacy computing with a function composed of polynomials with relatively low computational complexity, the computational complexity in the privacy computing process can be reduced and the efficiency of privacy computing can be improved. Furthermore, by using two numbers to represent the polynomial coefficients, the accuracy of the polynomial can be better represented, and the determined polynomial can also better express the original function.
[0082] In order to improve the accuracy of the obtained target polynomial, the obtained polynomial can also be compensated to improve the accuracy of the polynomial. Based on this requirement, Figure 4 As shown, step 220 may include step 221 and step 222 .
[0083] Step 221, according to the fixed-point number configuration parameters and the coefficients of the initial polynomial, determine the initial expansion coefficient and the initial compression coefficient corresponding to the coefficients of the initial polynomial to obtain an updated polynomial.
[0084] The fixed-point number configuration parameter is used to characterize the value range of the input data or output data of the target polynomial.
[0085] The magnitudes of the initial expansion coefficient and the initial compression coefficient are also within the numerical range defined by the fixed-point number configuration parameters.
[0086] Step 222: supplement the update polynomial according to the residual function between the original function and the update polynomial to obtain a target polynomial.
[0087] The residual function may be equal to the difference between the original function and the update polynomial.
[0088] Exemplarily, the current residual polynomial corresponding to the residual function may be determined by polynomial fitting, wherein the highest order of the current residual polynomial may not be greater than the highest order of the update polynomial.
[0089] Furthermore, each coefficient in the current residual polynomial can also be represented by its corresponding expansion coefficient and its corresponding compression coefficient, and then the current residual polynomial is combined with the update polynomial to obtain the target polynomial.
[0090] By supplementing the update polynomial with the residual function, the determined target polynomial can more accurately represent the original function.
[0091] In some implementations, the first coefficient of any coefficient in the initial polynomial can be calculated by following steps 2211 to 2214, such as Figure 5As shown, step 221 may include the following steps.
[0092] Step 2211, calculate the fixed-point lower limit value according to the fixed-point number precision length.
[0093] Exemplarily, the fixed point lower limit value can be expressed as
[0094] Where f represents the fixed-point number precision length.
[0095] Step 2212, calculate the minimum non-overflow coefficient according to the fixed-point integer length, the fixed-point precision length and the order corresponding to the first coefficient.
[0096] Exemplarily, the initial un-overflow coefficient can be expressed as:
[0097] Among them, the represents the characteristic input of the polynomial corresponding to the original function, c k Represents the coefficients of the kth order of the initial polynomial.
[0098] Then the fixed-point number closest to the initial unoverflowed coefficient is taken as the minimum unoverflowed coefficient.
[0099] For example, if the initial un-overflow coefficient If the minimum overflow coefficient is greater than the fixed-point upper limit, the fixed-point upper limit is determined as the fixed-point upper limit. The fixed-point upper limit can be expressed as: n-f-1 .
[0100] For example, if the initial un-overflow coefficient If it is less than the fixed-point lower limit, the minimum unoverflowed coefficient is determined to be zero.
[0101] Exemplarily, if the initial non-overflow coefficient is between the fixed-point lower limit value and the fixed-point upper limit value, but the initial non-overflow coefficient has a higher precision and has exceeded the number of digits that can be expressed by the fixed-point number, for example, the number of decimal places of the initial non-overflow coefficient has exceeded the fixed-point number precision length f, then the decimal places in the decimal point of the initial non-overflow coefficient that exceed the fixed-point number precision length f can be returned to zero, and the value obtained after returning the decimal places in the decimal point of the initial non-overflow coefficient that exceed the fixed-point number precision length f to zero is used as the minimum non-overflow coefficient.
[0102] Step 2213, determining the initial compression coefficient corresponding to the first coefficient according to the larger value of the fixed-point lower limit value and the minimum unoverflowed coefficient.
[0103] by represents the minimum unoverflowed coefficient, Represents the initial compression factor.
[0104] For example, if the minimum unsaturated coefficient and the initial compression coefficient are both less than 1, the larger value of the fixed point lower limit value and the minimum unsaturated coefficient can be used as the initial compression coefficient corresponding to the first coefficient. The initial compression coefficient corresponding to the first coefficient can be expressed as:
[0105] Exemplarily, if both the minimum unoverflowed coefficient and the initial compression coefficient are numbers greater than 1, 1 can be used as the initial compression coefficient corresponding to the first coefficient.
[0106] Therefore, the initial compression coefficient corresponding to the first coefficient can be expressed as:
[0107] Step 2214: Determine an initial expansion coefficient corresponding to the first coefficient based on the first coefficient and the initial compression coefficient.
[0108] Through the above steps 2211 to 2214, the initial compression coefficient and the initial expansion coefficient corresponding to each coefficient in the initial polynomial can be determined.
[0109] The pre-expansion coefficient is obtained by dividing the first coefficient by the initial compression coefficient. The pre-expansion coefficient can be expressed as: Here, c represents the first coefficient.
[0110] Exemplarily, if the pre-expansion coefficient is greater than a fixed-point upper limit value, the fixed-point upper limit value is determined as the initial expansion coefficient corresponding to the first coefficient.
[0111] Exemplarily, if the pre-expansion coefficient is less than the fixed point lower limit, a specified value is determined as the initial expansion coefficient corresponding to the first coefficient. The specified value may be zero.
[0112] Exemplarily, if the number of significant digits of the value contained in the pre-expansion coefficient is greater than the fixed-point precision length, the value after the decimal point fixed-point precision length in the pre-expansion coefficient is set to zero to obtain the initial expansion coefficient corresponding to the first coefficient.
[0113] The number of significant digits of the numerical value included in the pre-expansion coefficient may represent all digits after the decimal point of the pre-expansion coefficient.
[0114] Taking the above example, if the fixed-point number precision length is f, the value after the f-digit decimal point in the pre-expansion coefficient can be set to zero and the value obtained is used as the initial expansion coefficient corresponding to the first coefficient.
[0115] Step 2215, expressing each coefficient in the initial polynomial using the corresponding initial compression coefficient and the initial expansion coefficient to obtain an updated polynomial.
[0116] Exemplarily, each coefficient may be represented by the product of the corresponding initial compression coefficient and the initial expansion coefficient, and then an updated polynomial may be obtained.
[0117] Through the above steps 2211 to 2215, the coefficients in the initial polynomial can be replaced by two coefficients with higher precision, thereby improving the precision of the updated polynomial.
[0118] Considering that converting the coefficients of the polynomial into fixed-point representation may result in a partial loss of the polynomial's accuracy, the residual function of the original function and the updated polynomial can be used to improve the accuracy of the final polynomial. Based on this requirement, Figure 6 As shown, step 222 may include steps 2221 to 2225.
[0119] Step 2221, calculate the current residual function according to the original function and the first current polynomial.
[0120] Wherein, the first current polynomial is the updated polynomial when the step 2221 is performed for the first time. Exemplarily, the difference between the original function and the first current polynomial can be used as the current residual function.
[0121] During the loop execution from step 2221 to step 2225, the first current polynomial may also be updated at any time.
[0122] Among them, the first current polynomial can be expressed as: The original function can be expressed as: F(x), and the current residual function can be expressed as: R(x). Therefore,
[0123] Step 2222: Perform polynomial fitting on the current residual function to obtain a current residual polynomial.
[0124] The current residual polynomial is the current order k′.
[0125] Optionally, a Chebyshev interpolation algorithm may be used to interpolate multiple points of the current residual function in the target numerical interval to determine the current residual polynomial.
[0126] Optionally, a Lagrange interpolation algorithm may be used to interpolate multiple points of the current residual function in the target numerical interval to determine the current residual polynomial.
[0127] Optionally, when fitting the current residual function for the first time, the highest order of fitting is k-1, where k represents the highest order of the update polynomial.
[0128] Optionally, when the current residual function is fitted for the first time, the highest order of the fitting may be 1.
[0129] Step 2223, aggregate the current residual polynomial and the first current polynomial to obtain a second current polynomial.
[0130] Exemplarily, the second current polynomial can be expressed as:
[0131] Optionally, the current residual polynomial and the first current polynomial may be firstly combined by combining similar terms to obtain an initial combined polynomial; and each coefficient in the initial combined polynomial may be converted into fixed-point coefficients to obtain a second current polynomial.
[0132] Exemplarily, according to the fixed-point number configuration parameters and the coefficients of the initial merged polynomial, the expansion coefficient and the compression coefficient corresponding to the coefficients of the initial merged polynomial are determined to obtain the second current polynomial.
[0133] The expansion coefficient and compression coefficient of each coefficient of the initial merged polynomial are determined in the same manner as the expansion coefficient and compression coefficient of each coefficient of the above-mentioned update polynomial. Therefore, the process of determining the expansion coefficient and compression coefficient of each coefficient of the initial merged polynomial can refer to the detailed description of the process of determining the expansion coefficient and compression coefficient of each coefficient of the above-mentioned update polynomial.
[0134] Optionally, the current residual polynomial and the first current polynomial may be firstly combined by combining similar terms to obtain a combined polynomial; and then the coefficients in the combined polynomial may be converted into fixed-point coefficients to obtain a second current polynomial.
[0135] The combined polynomial can be expressed as:
[0136] Here, k′ represents the highest order of the current residual polynomial. Therefore, when merging similar terms, the k′+1th to kth order of the first current polynomial do not need to be merged with the current residual polynomial.
[0137] Therefore, since the k′+1th to kth order of the first current polynomial are still in the original state, the second current polynomial can be expressed as:
[0138] Step 2224, comparing a first error between the first current polynomial and the original function with a second error between the second current polynomial and the original function.
[0139] Optionally, multiple points can be selected in the target numerical interval, and the distances between the first current polynomial and the original function at the multiple points can be calculated, and the first error can be determined based on each distance; the distances between the second current polynomial and the original function at the multiple points can be calculated, and the second error can be determined based on each distance.
[0140] Optionally, the maximum distance determined at multiple points can be selected as the error between the two functions. Optionally, the average value determined at multiple points can be selected as the error between the two functions.
[0141] Step 2225: If the first error is greater than the second error, the second current polynomial is used as the first current polynomial, and the current order is updated.
[0142] If the first error is not greater than the second error, the first current polynomial is kept unchanged. After each execution of step 2221 to step 2225, the current order is updated, and the above steps are repeated until the current order of the current residual function is the specified order.
[0143] If the order of the current residual polynomial is k-1 when fitting for the first time, the current order k′=k′-1 is updated each time after step 2225, and then the above steps 2221 to 2225 are repeated. In this example, the specified order can be 0. Therefore, in this example, until k′=0, the loop of the above steps 2221 to 2225 ends.
[0144] If the order of the current residual polynomial is 0 when fitting for the first time, the current order k′=k′+1 is updated each time after step 2225, and then the above steps 2221 to 2225 are repeated. In this example, the specified order may be k-1. Therefore, in this example, until k′=k-1, the loop of the above steps 2221 to 2225 ends.
[0145] The last second current polynomial is taken as the target polynomial of the initial polynomial.
[0146] Through the method in the embodiment of the present application, the representation accuracy of the fixed-point polynomial can be improved, so that the high-precision calculation of the obtained fixed-point polynomial can be achieved.
[0147] The implementation process of the privacy algorithm construction method of the present application is described below through an embodiment:
[0148] Exemplarily, the above steps 210 to 220 may be performed by a first-party device in a secure multi-party computing system to construct a target polynomial for privacy computing.
[0149] After determining the target polynomial, the first electronic device sends the target polynomial to other electronic devices in the secure multi-party computing system for use by the other electronic devices.
[0150] During use, multiple electronic devices can receive confidential data transmitted by other electronic devices; after obtaining the confidential data of other parties, multiple electronic devices can use the stored target polynomial to calculate their own local data and the confidential data of other parties.
[0151] After the target polynomial obtains the calculation result, the calculation result can be returned to the other electronic devices of the secure multi-party computing system.
[0152] Based on the same application concept, the embodiment of the present application also provides a privacy algorithm construction device corresponding to the privacy algorithm construction method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to that of the aforementioned privacy algorithm construction method embodiment, the implementation of the device in this embodiment can refer to the description in the embodiment of the above method, and the repeated parts will not be repeated.
[0153] See also Figure 7 , is a functional module diagram of the privacy algorithm construction device provided in the embodiment of the present application. Each module in the privacy algorithm construction device in this embodiment is used to execute each step in the above method embodiment. The privacy algorithm construction device includes: a polynomial determination module 310 and a polynomial update module 320; wherein the contents of each module are as follows:
[0154] The polynomial determination module 310 is used to determine an initial polynomial in a target value interval according to the original function;
[0155] The polynomial update module 320 is used to represent each coefficient of the initial polynomial using an expansion coefficient and a compression coefficient to obtain a target polynomial. The size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient. The target polynomial is used to replace the original function for privacy computing. The input parameters of the target polynomial include confidential data for privacy computing.
[0156] In a possible implementation, the polynomial updating module 320 includes: a construction unit and a supplementation unit:
[0157] A construction unit, used to determine the initial expansion coefficient and the initial compression coefficient corresponding to each coefficient of the initial polynomial according to the fixed-point configuration parameter and each coefficient of the initial polynomial, so as to obtain an updated polynomial, wherein the fixed-point configuration parameter is used to characterize the value range of the input data or the output data of the target polynomial;
[0158] The supplementing unit is used to supplement the update polynomial according to the residual function between the original function and the update polynomial to obtain the target polynomial.
[0159] In a possible implementation, the fixed-point number configuration parameters include: fixed-point number integer length and fixed-point number precision length; a construction unit is used to:
[0160] For the first coefficient of the initial polynomial, a fixed-point lower limit value is calculated according to the fixed-point number precision length, and the first coefficient is any coefficient of the initial polynomial;
[0161] Calculate the minimum unoverflowed coefficient according to the fixed-point integer length, the fixed-point precision length and the order corresponding to the first coefficient;
[0162] Determining an initial compression coefficient corresponding to the first coefficient according to a larger value between the fixed point lower limit value and the minimum unoverflowed coefficient;
[0163] According to the first coefficient and the initial compression coefficient, an initial expansion coefficient corresponding to the first coefficient is determined, and the initial compression coefficient and initial expansion coefficient corresponding to each coefficient in the initial polynomial are determined through the above steps;
[0164] Each coefficient in the initial polynomial is represented by using the corresponding initial compression coefficient and the initial expansion coefficient to obtain an updated polynomial.
[0165] In a possible implementation manner, the construction unit is further used for:
[0166] Obtaining a pre-expansion coefficient by dividing the first coefficient by the initial compression coefficient;
[0167] If the pre-expansion coefficient is greater than the fixed-point upper limit value, the fixed-point upper limit value is determined as the initial expansion coefficient corresponding to the first coefficient;
[0168] If the pre-expansion coefficient is less than the fixed point lower limit value, the specified value is determined as the initial expansion coefficient corresponding to the first coefficient;
[0169] If the number of significant digits of the value contained in the pre-expansion coefficient is greater than the fixed-point precision length, the value after the decimal point fixed-point precision length in the pre-expansion coefficient is set to zero to obtain the initial expansion coefficient corresponding to the first coefficient.
[0170] In a possible implementation manner, the supplementing unit is used to:
[0171] Calculate a current residual function according to the original function and the first current polynomial, wherein when this step is performed for the first time, the first current polynomial is the updated polynomial;
[0172] Performing polynomial fitting on the current residual function to obtain a current residual polynomial, where the current residual polynomial is a current order;
[0173] Aggregating the current residual polynomial with the first current polynomial to obtain a second current polynomial;
[0174] Compare a first error between the first current polynomial and the original function with a second error between the second current polynomial and the original function;
[0175] If the first error is greater than the second error, the second current polynomial is used as the first current polynomial, and the current order is updated, and the above steps are repeated until the current order of the current residual function is the specified order;
[0176] The last second current polynomial is taken as the target polynomial of the initial polynomial.
[0177] In a possible implementation manner, the supplementing unit is further used for:
[0178] Merging the current residual polynomial with the first current polynomial by similar terms to obtain an initial merged polynomial;
[0179] The coefficients of each term in the initial combined polynomial are converted into fixed-point coefficients to obtain a second current polynomial.
[0180] In a possible implementation manner, the supplementing unit is further used for:
[0181] According to the fixed-point number configuration parameters and the coefficients of the initial combined polynomial, the expansion coefficient and the compression coefficient corresponding to the coefficients of the initial combined polynomial are determined to obtain a second current polynomial.
[0182] In addition, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the privacy algorithm construction method described in the above method embodiment are executed.
[0183] The computer program product of the privacy algorithm construction method provided in the embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the privacy algorithm construction method described in the above method embodiment. Please refer to the above method embodiment for details, which will not be repeated here.
[0184] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0185] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0186] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, the elements defined by the sentence "includes..." do not exclude the presence of other identical elements in the process, method, article or apparatus that includes the elements.
[0187] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0188] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A privacy algorithm construction method, characterized in that: include: According to the original function, an initial polynomial is determined in the target numerical interval; The coefficients of the initial polynomial are expressed by using an expansion coefficient and a compression coefficient to obtain a target polynomial, including: for a first coefficient of the initial polynomial, a fixed-point lower limit value is calculated according to the fixed-point number precision length, the first coefficient is any coefficient of the initial polynomial; according to the fixed-point integer length, the fixed-point number precision length and the order corresponding to the first coefficient, the minimum non-overflow coefficient is calculated, including: the fixed-point number closest to the initial non-overflow coefficient is used as the minimum non-overflow coefficient; the initial non-overflow coefficient is expressed as: ; represents the characteristic input of the polynomial corresponding to the primitive function, represents the k-th order coefficient of the initial polynomial, n represents the fixed-point integer length, and f represents the fixed-point precision length; according to the larger value of the fixed-point lower limit value and the minimum unoverflowed coefficient, determine the compression coefficient corresponding to the first coefficient; according to the first coefficient and the compression coefficient, determine the expansion coefficient corresponding to the first coefficient, and determine the compression coefficient and expansion coefficient corresponding to each coefficient in the initial polynomial through the above steps; each coefficient in the initial polynomial is represented by the corresponding compression coefficient and the expansion coefficient to obtain an updated polynomial; according to the residual function of the original function and the updated polynomial, the updated polynomial is supplemented to obtain a target polynomial; the size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient, and the target polynomial is used to replace the original function for privacy computing, and the input parameters of the target polynomial include secret data for privacy computing; Among them, the expansion coefficient corresponding to the first coefficient is determined according to the first coefficient and the compression coefficient, including: obtaining a pre-expansion coefficient by dividing the first coefficient by the compression coefficient; if the pre-expansion coefficient is greater than a fixed-point upper limit value, determining the fixed-point upper limit value as the expansion coefficient corresponding to the first coefficient; if the pre-expansion coefficient is less than a fixed-point lower limit value, determining a specified value as the expansion coefficient corresponding to the first coefficient; if the number of significant digits of the value contained in the pre-expansion coefficient is greater than the fixed-point number precision length, setting the value after the decimal point fixed-point number precision length in the pre-expansion coefficient to zero, so as to obtain the expansion coefficient corresponding to the first coefficient.
2. The method according to claim 1, characterized in that The step of supplementing the update polynomial according to the residual function between the original function and the update polynomial to obtain a target polynomial includes: Calculate a current residual function according to the original function and a first current polynomial, wherein when this step is performed for the first time, the first current polynomial is the updated polynomial; Performing polynomial fitting on the current residual function to obtain a current residual polynomial, wherein the current residual polynomial is a current order; Aggregating the current residual polynomial and the first current polynomial to obtain a second current polynomial; Compare a first error between the first current polynomial and the original function with a second error between the second current polynomial and the original function; If the first error is greater than the second error, the second current polynomial is used as the first current polynomial, and the current order is updated, and the above steps are repeated until the current order of the current residual function is the specified order; The final second current polynomial is used as the target polynomial of the initial polynomial.
3. The method according to claim 2, characterized in that The step of aggregating the current residual polynomial and the first current polynomial to obtain a second current polynomial includes: Merging the current residual polynomial with the first current polynomial by similar terms to obtain an initial merged polynomial; The coefficients of each term in the initial combined polynomial are converted into fixed-point coefficients to obtain a second current polynomial.
4. The method according to claim 3, characterized in that The step of converting each coefficient in the initial combined polynomial into a fixed-point coefficient to obtain a second current polynomial includes: According to the fixed-point number configuration parameters and the coefficients of the initial combined polynomial, the expansion coefficient and the compression coefficient corresponding to the coefficients of the initial combined polynomial are determined to obtain a second current polynomial.
5. A privacy algorithm construction device, characterized in that: include: A polynomial determination module, used to determine an initial polynomial in a target numerical interval according to the original function; A polynomial updating module, used to represent each coefficient of the initial polynomial using an expansion coefficient and a compression coefficient to obtain a target polynomial, wherein the size of each coefficient is between its corresponding expansion coefficient and its corresponding compression coefficient, and the target polynomial is used to replace the original function for privacy computing, and the input parameters of the target polynomial include secret data for privacy computing; The polynomial updating module is further used for: calculating a fixed-point lower limit value for a first coefficient of the initial polynomial according to the fixed-point number precision length, the first coefficient being any coefficient of the initial polynomial; calculating a minimum non-overflow coefficient according to the fixed-point integer length, the fixed-point number precision length and the order corresponding to the first coefficient, including: taking the fixed-point number closest to the initial non-overflow coefficient as the minimum non-overflow coefficient; the initial non-overflow coefficient is expressed as: ; represents the characteristic input of the polynomial corresponding to the primitive function, represents the coefficient of the kth order of the initial polynomial, n represents the fixed-point integer length, and f represents the fixed-point precision length; according to the larger value of the fixed-point lower limit value and the minimum unoverflowed coefficient, determine the compression coefficient corresponding to the first coefficient; according to the first coefficient and the compression coefficient, determine the expansion coefficient corresponding to the first coefficient, and determine the compression coefficient and expansion coefficient corresponding to each coefficient in the initial polynomial through the above steps; each coefficient in the initial polynomial is represented by the corresponding compression coefficient and the expansion coefficient to obtain an updated polynomial; according to the residual function of the original function and the updated polynomial, supplement the updated polynomial to obtain a target polynomial; Among them, the expansion coefficient corresponding to the first coefficient is determined according to the first coefficient and the compression coefficient, including: obtaining a pre-expansion coefficient by dividing the first coefficient by the compression coefficient; if the pre-expansion coefficient is greater than a fixed-point upper limit value, determining the fixed-point upper limit value as the expansion coefficient corresponding to the first coefficient; if the pre-expansion coefficient is less than a fixed-point lower limit value, determining a specified value as the expansion coefficient corresponding to the first coefficient; if the number of significant digits of the value contained in the pre-expansion coefficient is greater than the fixed-point number precision length, setting the value after the decimal point fixed-point number precision length in the pre-expansion coefficient to zero, so as to obtain the expansion coefficient corresponding to the first coefficient.
6. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of any one of the methods described in claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are executed.
Citation Information
Patent Citations
Privacy calculation method and device, electronic equipment and readable storage medium
CN115062342A
Privacy algorithm construction method and device, electronic equipment and readable storage medium
CN115081020A