Privacy computing method, device, electronic device and readable storage medium

By dividing the original smooth nonlinear functions and building a polynomial objective function, the problem of low computational efficiency of complex functions in safe multi-party calculations is solved, and the calculation amount and efficiency are reduced.

CN115062342BActive Publication Date: 2025-04-11HUAKONG TSINGJIAO INFORMATION SCI BEIJING LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210745435.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-27
Publication Date
2025-04-11
Estimated Expiration
2042-06-27

AI Technical Summary

Technical Problem

In the safe multi-party calculation process, the use of complex nonlinear functions leads to large calculation amounts and low calculation efficiency.

Method used

By dividing the original smooth nonlinear function into multiple numerical intervals and determining a polynomial in each interval, the objective function is constructed to replace the original function for privacy calculations.

Benefits of technology

This reduces the amount of calculations in the privacy calculation process, improves the calculation efficiency, and maintains the accuracy of calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115062342B_ABST
    Figure CN115062342B_ABST
Patent Text Reader

Abstract

The present application provides a privacy computing method, device, electronic device and readable storage medium, wherein the method includes: dividing the current numerical interval of the original function into N numerical intervals; the original function is a smooth nonlinear function used for privacy computing, and when the numerical interval is divided for the first time, the current numerical interval is the value range of the original function; according to the original function, a polynomial is determined in each numerical interval of the N numerical intervals to obtain N polynomials; the original function is compared with the N polynomials to determine the first error between each polynomial and the original function; if there is a first error that is not less than a set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above steps are repeated to construct a new polynomial; if the first errors are all less than the set threshold, a target function is constructed according to the currently obtained polynomial set, and the target function is used to replace the original function for privacy computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of privacy computing technology, and specifically, to a privacy computing 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 computing method, device, electronic device and readable storage medium, which can improve the problem of low computing efficiency in the privacy computing process of secure multi-party computing, so as to improve the computing efficiency of privacy computing.

[0004] In a first aspect, the present invention provides a privacy computing method, comprising:

[0005] Divide the current numerical interval of the original function into N numerical intervals; the original function is a smooth nonlinear function used for privacy computing. When the numerical interval is divided for the first time, the current numerical interval is the value range of the original function, and N is a positive integer greater than 1;

[0006] According to the primitive function, determining a polynomial in each of the N numerical intervals to obtain N polynomials;

[0007] Comparing the original function with the N polynomials to determine a first error between each polynomial and the original function;

[0008] If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above steps are repeated to construct a new polynomial;

[0009] If the first errors of all polynomials are less than a set threshold, an objective function is constructed according to the current set of polynomials. The objective function is used to replace the original function for privacy computing.

[0010] In an optional implementation manner, comparing the original function with the N polynomials to determine a first error between each polynomial and the original function includes:

[0011] For a target polynomial, calculating the distance between the original function and a plurality of points of the target polynomial in a target numerical interval, wherein the target numerical interval is a numerical interval corresponding to the target polynomial, and the target polynomial is any polynomial in the N polynomials;

[0012] A first error between the original function and the target polynomial is determined according to distances of the plurality of points.

[0013] In the above implementation, the distance between the two functions at multiple points can be determined to determine the error between the two functions, which can improve the accuracy of error determination.

[0014] In an optional implementation, the calculating the distance between the primitive function and the target polynomial at a plurality of points in a target numerical interval includes:

[0015] For a target point among the multiple points in the target numerical interval, if the value of the primitive function at the target point is within a first threshold interval, then calculating the absolute distance between the primitive function and the target polynomial at the target point, the target point being any one of the multiple points in the target numerical interval;

[0016] If the value of the primitive function at the target point is within a second threshold interval, then the relative distance between the primitive function and the target polynomial at the target point is calculated, the second threshold interval does not intersect the first threshold interval, and the first threshold interval includes a zero point.

[0017] In the above implementation, different distances between the original function and the polynomial may be determined based on the value of the original function to better characterize the distance between the original function and the polynomial, and the error may be accurately represented.

[0018] In an optional embodiment, before calculating the distance between the original function and the target polynomial at multiple points in the target numerical interval, the method further includes: determining multiple points in the target numerical interval according to the length of the target numerical interval.

[0019] In an optional implementation manner, determining a plurality of points in the target numerical interval according to the length of the target numerical interval includes:

[0020] Calculate a first value according to two endpoints of the target value;

[0021] Comparing the first value with a preset threshold value to determine a smaller target value between the first value and the preset threshold value;

[0022] A target number of points are selected from the target value interval.

[0023] In the above implementation, different numbers of points can be selected based on numerical intervals of different lengths, so that the determined error can better characterize the error between the original function and the polynomial, and the amount of calculation required to calculate the error can be adaptively adjusted to improve the efficiency of error calculation.

[0024] In an optional embodiment, determining a polynomial in each of N numerical intervals according to the original function to obtain N polynomials includes: for a target numerical interval, obtaining multiple numerical points of the original function in the target numerical interval, and the target numerical interval is any numerical interval among the N numerical intervals; fitting the multiple numerical points to obtain the polynomial corresponding to the target numerical interval.

[0025] In an optional embodiment, constructing the objective function according to the currently obtained polynomial set includes: constructing a new polynomial corresponding to a new numerical interval formed by the i-th numerical interval and the i+1-th numerical interval, wherein the value range of the i-th polynomial in the currently obtained polynomial set is the i-th numerical interval, the value range of the i+1-th polynomial in the currently obtained polynomial set is the i+1-th numerical interval, and the value of i is greater than or equal to 1 and less than or equal to the number of polynomials in the currently obtained polynomial set; comparing the original function with the new polynomial to determine a second error between the new polynomial and the original function; if the second error is not less than the set threshold, updating the value of i until the value of i is equal to the number of polynomials in the currently obtained polynomial set; if the second error is less than the set threshold, replacing the i-th polynomial and the i+1-th polynomial with the new polynomial to update the currently obtained polynomial set.

[0026] In the above implementation, it is also possible to determine whether any two adjacent polynomials can be merged, so that the number of polynomials can be reduced while ensuring that the polynomial can better approximate the original function.

[0027] In a second aspect, the present invention provides a privacy computing device, comprising:

[0028] An interval division module, used to divide the current numerical interval of the original function into N numerical intervals; the original function is a smooth nonlinear function used for privacy computing, when the numerical interval is divided for the first time, the current numerical interval is the value range of the original function, and N is a positive integer greater than 1;

[0029] A polynomial determination module, configured to determine a polynomial in each of the N numerical intervals according to the primitive function, so as to obtain N polynomials;

[0030] An error determination module, configured to compare the original function with the N polynomials to determine a first error between each polynomial and the original function;

[0031] If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above modules are repeatedly executed to construct a new polynomial;

[0032] A function construction module is used to construct an objective function based on the current set of polynomials if the first errors of all polynomials are less than a set threshold. The objective function is used to replace the original function for privacy computing.

[0033] 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.

[0034] 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.

[0035] The beneficial effects of the embodiments of the present application include at least: replacing the original smooth nonlinear function used for privacy computing with a function composed of polynomials with relatively low computational complexity, and the computation of the polynomial is relatively lower than that of the original smooth nonlinear function, which can reduce the computational complexity in the privacy computing process and improve the efficiency of privacy computing. Furthermore, after determining the error comparison between the polynomial that replaces the original function and the original function, a polynomial that is relatively more capable of representing the original function can be selected, so that the accuracy of privacy computing can be maintained while improving the computational efficiency of privacy computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] 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.

[0037] Figure 1 A schematic diagram of the operating environment of the secure multi-party computing system provided in an embodiment of the present application;

[0038] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application;

[0039] Figure 3 A flowchart of a privacy computing method provided in an embodiment of the present application;

[0040] Figure 4 An optional flow chart of step 230 of the privacy computing method provided in an embodiment of the present application;

[0041] Figure 5 An optional flow chart of step 240 of the privacy computing method provided in an embodiment of the present application;

[0042] Figure 6 A schematic diagram of the functional modules of a privacy computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] 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.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] Based on the above research, this application provides a privacy computing method, which converts the nonlinear function used for secure multi-party computing into a piecewise polynomial to reduce the computational complexity and improve the computational efficiency. The following describes some embodiments.

[0048] 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.

[0049] 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.

[0050] 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.

[0051] Each electronic device 110 may store an objective function for privacy computing. The objective function 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 .

[0052] 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 The electronic device 110 may be Figure 1 Any electronic device in the secure multi-party computing system 10 shown.

[0053] 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.

[0054] 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.

[0055] 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.

[0056] 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 computing method is described in detail below through several embodiments.

[0057] See also Figure 3 , is a flowchart of the privacy computing method provided by the embodiment of the present application. Figure 3 The specific process shown is described in detail.

[0058] Step 210, dividing the current numerical interval of the original function into N numerical intervals.

[0059] The primitive function is a smooth nonlinear function used for privacy computing. For example, the primitive function can be an exponential function, a logarithmic function, a square root function, or a combination of various complex functions.

[0060] When the numerical interval is divided for the first time, the current numerical interval is the value range of the original function. When the step 210 is performed for the second time or more, the current numerical interval is a subset interval of the value range of the original function, and the subset interval is the numerical interval that needs to be further divided.

[0061] The above N is a positive integer greater than 1. Exemplarily, the value of N can be 2, 3, etc.

[0062] Optionally, the current numerical interval may be equally divided into N numerical intervals, or the current numerical interval may be unequally divided into N numerical intervals. Specifically, whether to equally divide the numerical interval may be determined according to actual usage scenarios.

[0063] Step 220: Determine a polynomial in each of the N numerical intervals according to the primitive function to obtain N polynomials.

[0064] For example, if the value of N is 2, the current numerical interval can be divided into two numerical intervals in step 210. A polynomial for approximating the original function is determined in each numerical interval, and a two-term polynomial can be obtained.

[0065] Step 230 : Compare the original function with the N-term polynomial to determine a first error between each polynomial and the original function.

[0066] If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above steps 210 to 230 are repeated to construct a new polynomial.

[0067] The set threshold value may be a smaller value, for example, 0.1, 0.01, 0.05, etc.

[0068] If the first errors of all polynomials are smaller than the set threshold, step 240 is executed.

[0069] In order to avoid endless division of the value range of the original function, an interval number threshold can be pre-set. If the value range has been divided into the number of value intervals of the interval number threshold, the construction of the polynomial can be interrupted. If the value range of the original function has been divided into m value intervals, and the current m is greater than the set interval number threshold, step 240 can be performed. The interval number threshold can be set as needed, for example, the interval number threshold can be 20, 30, 50, 100, 1000, etc.

[0070] For any polynomial, the error between the polynomial and the original function can be determined according to the degree of approximation between the polynomial and the original function.

[0071] Step 240: construct an objective function based on the currently obtained polynomial set.

[0072] The objective function is used to replace the original function for privacy computing. When the objective function is used, the input parameters of the objective function include confidential data.

[0073] The objective function may be stored in multi-party devices of secure multi-party computing. When in use, any device receives secret data from other devices, and the objective function may calculate the secret data.

[0074] Optionally, each polynomial in the currently obtained polynomial set may be connected to form a polynomial function whose value range is the same as that of the original function.

[0075] Through the above steps, the original function used for privacy computing can be replaced with a function composed of polynomials with relatively low computational complexity, which can reduce the amount of computation in the privacy computing process and improve the efficiency of privacy computing.

[0076] In some embodiments, the polynomial of each numerical interval can be determined in the following manner, therefore, step 220 can be implemented in the following manner: for a target numerical interval, obtaining multiple numerical points of the original function in the target numerical interval; fitting the multiple numerical points to obtain the polynomial corresponding to the target numerical interval.

[0077] The target numerical interval is any numerical interval among the N numerical intervals.

[0078] The number of points in the target value interval [a, b] can be expressed as:

[0079]

[0080] Among them, Ns represents the number of multiple points determined in the target numerical interval; f represents the fixed-point number limit length limited by constructing the polynomial; Ms represents the preset threshold.

[0081] The preset threshold may be a relatively large value, for example, the preset threshold may be 500, 700, 1000, 1300, or the like.

[0082] Curve fitting can be performed on the Ns numerical points to determine a polynomial of the target numerical interval.

[0083] The highest order k of the polynomial corresponding to the fitted target numerical interval may be preset.

[0084] The error between two functions cannot be directly determined based on the polynomial and the original function, but the error between the polynomial and the original function can be determined by the difference between the value of the polynomial and the value of the original function at multiple points in the value range corresponding to the polynomial and the original function. Based on this study, Figure 4 As shown, step 230 may include step 232 and step 234 .

[0085] Step 232, for the target polynomial, calculate the distance between the original function and the target polynomial at multiple points in the target numerical range.

[0086] The target numerical interval is a numerical interval corresponding to the target polynomial, and the target polynomial is any polynomial in the N-term polynomials.

[0087] Taking the target numerical interval [a, b] as an example, we can calculate the values ​​of the original function at multiple points in the interval [a, b] and the values ​​of the target polynomial at multiple points in the interval [a, b], and then calculate the distance between the values ​​of the original function at multiple points in the interval [a, b] and the values ​​of the target polynomial at multiple points in the interval [a, b].

[0088] In one embodiment, for any target point among multiple points in the target numerical interval, if the value of the primitive function at the target point is within a first threshold interval, the absolute distance between the primitive function and the target polynomial at the target point is calculated, and the target point is any point among multiple points in the target numerical interval.

[0089] The first threshold interval may be a numerical interval including zero, and the absolute value of the endpoint of the numerical interval is smaller, and the absolute value of the endpoint may be equal to the set value.

[0090] Exemplarily, if the absolute value of the value of the primitive function at the target point is less than a set value, the absolute distance between the primitive function and the target polynomial at the target point can be calculated.

[0091] In another embodiment, if the value of the primitive function at the target point is within a second threshold interval, the relative distance between the primitive function and the target polynomial at the target point is calculated.

[0092] The first threshold interval may be a numerical interval that does not include zero, and the absolute value of the endpoint of the numerical interval is larger, and the absolute value of the endpoint may be greater than the set value.

[0093] Exemplarily, if the absolute value of the value of the primitive function at the target point is greater than a set value, the absolute distance between the primitive function and the target polynomial at the target point can be calculated.

[0094] The distance between the original function and the target polynomial can be expressed as follows:

[0095]

[0096] in, represents the target polynomial, and the target polynomial is a k-order polynomial; F(x) represents the original function; represents a value close to 0; k represents the highest order of the target polynomial; m represents the number of numerical intervals divided by the value range of the original function.

[0097] Step 234, determining a first error between the original function and the target polynomial according to the distances of the multiple points.

[0098] The value with the largest absolute value among the distances of the plurality of points may be determined as the first error between the original function and the target polynomial.

[0099] In order to more accurately determine the error between the target polynomial and the original function, multiple points can be selected from the target value interval as samples to calculate the error between the original function and the target polynomial. Figure 4 As shown, before step 232, the method may further include: step 231, determining a plurality of points in the target numerical interval according to the length of the target numerical interval.

[0100] Optionally, a first value can be calculated based on the two endpoints of the target value; the first value is compared with a preset threshold to determine the smaller target value between the first value and the preset threshold; and the target number of points are selected from the target value interval.

[0101] The first value may be calculated based on two endpoints of the target value and a fixed-point number limited by a polynomial.

[0102] The number of points in the target value interval [a, b] can be expressed as:

[0103]

[0104] Among them, Ns represents the number of multiple points determined in the target numerical interval; f represents the fixed-point number limit length limited by constructing the polynomial; MS represents the preset threshold.

[0105] The preset threshold may be a relatively large value, for example, the preset threshold may be 500, 700, 1000, 1300, or the like.

[0106] Through the above method, the error between the original function and the target polynomial can be calculated by multi-point calculation, and the error between the original function and the target polynomial determined based on the distance of multiple points can more comprehensively characterize the error between the original function and the target polynomial, thereby improving the accuracy of error determination.

[0107] In order to reduce the number of polynomials obtained or the complexity of the final objective function, the polynomial sets obtained based on steps 210 to 230 may be merged and fused again. Figure 5 As shown, step 240 may include step 241 and step 245 .

[0108] Step 241, construct a new polynomial corresponding to a new numerical interval formed by the i-th numerical interval and the (i+1)-th numerical interval.

[0109] Among them, the value range of the i-th polynomial in the current polynomial set is the i-th numerical interval, the value range of the i+1-th polynomial in the current polynomial set is the i+1-th numerical interval, and the value of i is greater than or equal to 1 and less than or equal to the number of polynomials in the current polynomial set.

[0110] Step 242: Compare the original function with the new polynomial to determine a second error between the new polynomial and the original function.

[0111] Step 243, determining whether the second error is less than a set threshold.

[0112] If the second error is not less than the set threshold, step 245 is executed; if the second error is less than the set threshold, step 244 is executed.

[0113] The method for calculating the second error may be the same as the method for calculating the first error, and the method for calculating the second error will not be described in detail herein.

[0114] Step 244: Replace the i-th polynomial and the (i+1)-th polynomial with the new polynomial to update the currently obtained polynomial set.

[0115] The number of polynomials in the updated currently obtained polynomial set is one polynomial less than that in the previous polynomial set.

[0116] Step 245, update the value of i.

[0117] Then return to step 241, re-execute steps 241 and 244, and construct the polynomial of the next two adjacent numerical intervals.

[0118] If the current value of i is less than the number of polynomials in the currently obtained polynomial set minus one, then i+1 is added, and then steps 241 to 245 are re-executed until the value of i is equal to the number of polynomials in the currently obtained polynomial set minus one.

[0119] The final set of polynomials is used as the objective function.

[0120] Through the above-mentioned steps 241 to 245, the amount of calculation of the determined objective function can be smaller than that of the original function, and the number of polynomials obtained can also be relatively smaller.

[0121] Through the above privacy computing method, a k-order piecewise polynomial that meets certain accuracy requirements can be constructed to approximate any smooth and continuous nonlinear function. In the environment of secure multi-party computing, a k-order piecewise polynomial only needs three basic operations: addition, multiplication, and comparison to complete. In actual experiments, it is generally possible to achieve an accuracy threshold of 10 within a 10-order polynomial or a 20-segment polynomial. -3 Compared with the nonlinear function calculation scheme that expands complex functions into basic operations, the use of piecewise polynomials can effectively reduce the accumulation of errors. The errors in actual experiments are basically within 10 -3 Secondly, compared with the continuous calculation of multiple basic nonlinear functions, the use of piecewise polynomials can also greatly improve the computational efficiency. Finally, the time required to generate polynomials using this algorithm is generally relatively short. For example, the construction of polynomials can be achieved within a few seconds. For some target functions that cannot be expanded into a combination of basic nonlinear functions provided by the secure computing platform, such as the gamma function This complex nonlinear function can quickly generate the corresponding fixed-point piecewise polynomial within 2-3 seconds using the algorithm in the embodiment of the present application. For example, in logistic regression, the corresponding sigmoid calculation function is generated. 2 The corresponding distribution function can be generated in the test, and the method in the embodiment of the present application can be used to greatly improve the calculation efficiency while ensuring that the model accuracy is consistent with the plaintext environment; at the same time, it also makes it possible to quickly calculate χ in the ciphertext 2 Verification becomes possible without the need for complex integral operations provided by the secure computing platform.

[0122] The implementation process of the privacy computing method of the present application is described below through an embodiment:

[0123] Exemplarily, the above steps 210 to 240 may be performed by a first-party device in a secure multi-party computing system to construct an objective function composed of multiple sets of polynomials for privacy computing.

[0124] After determining the target function, the first electronic device sends the target function to other electronic devices in the secure multi-party computing system for use by the other electronic devices.

[0125] During use, multiple electronic devices can receive confidential data transmitted by other electronic devices; after obtaining the confidential data of other parties, the multiple electronic devices can use the stored objective function to calculate their own local data and the confidential data of other parties.

[0126] After the objective function obtains the calculation result, the calculation result can be returned to the electronic devices of the multiple parties.

[0127] In some implementations, each electronic device in the secure multi-party computing system can respectively use the steps provided by the above-mentioned privacy algorithm construction method to construct polynomials for a portion of the function used for privacy computing to obtain the function required for the partial privacy computing. Then, each electronic device can send the constructed target function to the designated electronic device, and the designated electronic device can combine the target functions constructed by the electronic devices of each party into the privacy function required for the secure multi-party computing system.

[0128] Based on the same application concept, a privacy computing device corresponding to the privacy computing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to that in the aforementioned privacy computing 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.

[0129] See also Figure 6 , is a functional module diagram of the privacy computing device provided in the embodiment of the present application. Each module in the privacy computing device in this embodiment is used to execute each step in the above method embodiment. The privacy computing device includes: an interval division module 310, a polynomial determination module 320, an error determination module 330 and a function construction module 340; the contents of each module are as follows:

[0130] An interval division module 310 is used to divide the current numerical interval of the original function into N numerical intervals; the original function is a smooth nonlinear function used for privacy computing. When the numerical interval is divided for the first time, the current numerical interval is the value range of the original function, and N is a positive integer greater than 1;

[0131] A polynomial determination module 320 is used to determine a polynomial in each of the N numerical intervals according to the primitive function to obtain N polynomials;

[0132] An error determination module 330 is used to compare the original function with the N-term polynomial to determine a first error between each polynomial and the original function;

[0133] If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above modules are repeatedly executed to construct a new polynomial;

[0134] The function construction module 340 is used to construct a target function according to the currently obtained set of polynomials if the first errors of all polynomials are less than a set threshold. The target function is used to replace the original function for privacy computing.

[0135] In a possible implementation manner, the error determination module 330 includes a distance calculation unit and an error determination unit, as shown below:

[0136] A distance calculation unit, for calculating the distance between the original function and a plurality of points of the target polynomial in a target numerical interval for a target polynomial, wherein the target numerical interval is a numerical interval corresponding to the target polynomial, and the target polynomial is any polynomial in the N-term polynomial;

[0137] The error determination unit is used to determine a first error between the original function and the target polynomial according to distances of a plurality of points.

[0138] In a possible implementation manner, the distance calculation unit is used to:

[0139] For a target point among the multiple points in the target numerical interval, if the value of the primitive function at the target point is within a first threshold interval, then calculating an absolute distance between the primitive function and the target polynomial at the target point, where the target point is any one of the multiple points in the target numerical interval;

[0140] If the value of the primitive function at the target point is within a second threshold interval, then the relative distance between the primitive function and the target polynomial at the target point is calculated, the second threshold interval does not intersect the first threshold interval, and the first threshold interval includes a zero point.

[0141] In a possible implementation, the privacy computing device further includes: a point determination module, configured to determine a plurality of points in the target numerical interval according to the length of the target numerical interval.

[0142] In one possible implementation, a point determination module is used to calculate a first value based on two endpoints of the target value; compare the first value with a preset threshold to determine a smaller target value between the first value and the preset threshold; and select a target number of points from the target value interval.

[0143] In one possible implementation, the polynomial determination module 320 is used to obtain multiple numerical points of the original function in the target numerical interval, where the target numerical interval is any one of the N numerical intervals; and fit the multiple numerical points to obtain a polynomial corresponding to the target numerical interval.

[0144] In a possible implementation, the function construction module 340 is used to:

[0145] Construct a new polynomial corresponding to a new numerical interval formed by the i-th numerical interval and the i+1-th numerical interval, wherein the value range of the i-th polynomial in the currently obtained polynomial set is the i-th numerical interval, the value range of the i+1-th polynomial in the currently obtained polynomial set is the i+1-th numerical interval, and the value of i is greater than or equal to 1 and less than or equal to the number of polynomials in the currently obtained polynomial set;

[0146] Comparing the original function with the new polynomial to determine a second error between the new polynomial and the original function;

[0147] If the second error is not less than the set threshold, the value of i is updated until the value of i is equal to the number of polynomials in the currently obtained polynomial set;

[0148] If the second error is smaller than the set threshold, the new polynomial replaces the i-th polynomial and the (i+1)-th polynomial to update the currently obtained polynomial set.

[0149] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the privacy computing method described in the above method embodiment are executed.

[0150] The computer program product of the privacy computing 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 computing method described in the above method embodiment. Please refer to the above method embodiment for details, which will not be repeated here.

[0151] 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.

[0152] 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.

[0153] 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.

[0154] 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.

[0155] 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 computing method, characterized in that: include: Divide the current numerical interval of the original function into N numerical intervals; The original function is a smooth nonlinear function used for privacy computing. When the numerical interval is divided for the first time, the current numerical interval is the value range of the original function, and N is a positive integer greater than 1; According to the primitive function, determining a polynomial in each of the N numerical intervals to obtain N polynomials; Comparing the original function with the N polynomials to determine a first error between each polynomial and the original function; If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above steps are repeated to construct a new polynomial; If the first errors of all polynomials are less than the set threshold, construct the objective function according to the currently obtained polynomial set, including: constructing a new polynomial corresponding to a new numerical interval formed by the i-th numerical interval and the i+1-th numerical interval, wherein the value range of the i-th polynomial in the currently obtained polynomial set is the i-th numerical interval, the value range of the i+1-th polynomial in the currently obtained polynomial set is the i+1-th numerical interval, and the value of i is greater than or equal to 1 and less than or equal to the number of polynomials in the currently obtained polynomial set; comparing the original function with the new polynomial to determine the new polynomial a second error with the original function; if the second error is not less than the set threshold, updating the value of i until the value of i is equal to the number of polynomials in the currently obtained polynomial set; if the second error is less than the set threshold, replacing the i-th polynomial and the i+1-th polynomial with the new polynomial to update the currently obtained polynomial set, and the objective function is used to replace the original function for privacy computing; wherein the objective function is used to be stored in multi-party devices of secure multi-party computing, and when used, any one device receives confidential data of other devices, and the objective function is used to calculate the confidential data.

2. The method according to claim 1, characterized in that The comparing the original function with the N polynomials to determine a first error between each polynomial and the original function includes: For a target polynomial, calculating the distance between the original function and a plurality of points of the target polynomial in a target numerical interval, wherein the target numerical interval is a numerical interval corresponding to the target polynomial, and the target polynomial is any polynomial in the N polynomials; A first error between the original function and the target polynomial is determined according to distances of the plurality of points.

3. The method according to claim 2, characterized in that The calculating the distance between the primitive function and the target polynomial at a plurality of points in a target numerical interval comprises: For a target point among the multiple points in the target numerical interval, if the value of the primitive function at the target point is within a first threshold interval, then calculating the absolute distance between the primitive function and the target polynomial at the target point, the target point being any one of the multiple points in the target numerical interval; If the value of the primitive function at the target point is within a second threshold interval, then the relative distance between the primitive function and the target polynomial at the target point is calculated, the second threshold interval does not intersect the first threshold interval, and the first threshold interval includes a zero point.

4. The method according to claim 2, characterized in that: Before calculating the distance between the primitive function and the target polynomial at a plurality of points in the target numerical interval, the method further comprises: According to the length of the target numerical interval, a plurality of points are determined in the target numerical interval.

5. The method according to claim 4, characterized in that Determining a plurality of points in the target numerical interval according to the length of the target numerical interval includes: Calculate a first value according to two endpoints of the target value; Comparing the first value with a preset threshold value to determine a smaller target value between the first value and the preset threshold value; A target number of points are selected from the target value interval.

6. The method according to claim 1, characterized in that The step of determining a polynomial in each of the N numerical intervals according to the primitive function to obtain N polynomials comprises: For a target numerical interval, obtaining a plurality of numerical points of the primitive function in the target numerical interval, wherein the target numerical interval is any one of the N numerical intervals; A plurality of numerical points are fitted to obtain a polynomial corresponding to the target numerical interval.

7. A privacy computing device, characterized in that: include: An interval division module, used for dividing the current numerical interval of the original function into N numerical intervals; The original function is a smooth nonlinear function used for privacy computing. When the numerical interval is divided for the first time, the current numerical interval is the value range of the original function, and N is a positive integer greater than 1; A polynomial determination module, configured to determine a polynomial in each of the N numerical intervals according to the primitive function, so as to obtain N polynomials; An error determination module, configured to compare the original function with the N polynomials to determine a first error between each polynomial and the original function; If the first error of any polynomial is not less than the set threshold, the numerical interval corresponding to the polynomial is used as the current numerical interval, and the above modules are repeatedly executed to construct a new polynomial; A function construction module, used for constructing an objective function according to the currently obtained polynomial set if the first errors of all polynomials are less than a set threshold, wherein the objective function is used to replace the original function for privacy computing; wherein the objective function is used to be stored in multi-party devices of secure multi-party computing, and when used, any one device receives secret data of other devices, and the objective function is used to calculate the secret data; The function construction module is also used to construct a new polynomial corresponding to a new numerical interval formed by the i-th numerical interval and the i+1-th numerical interval, wherein the value range of the i-th polynomial in the currently obtained polynomial set is the i-th numerical interval, the value range of the i+1-th polynomial in the currently obtained polynomial set is the i+1-th numerical interval, and the value of i is greater than or equal to 1 and less than or equal to the number of polynomials in the currently obtained polynomial set; the original function is compared with the new polynomial to determine the second error between the new polynomial and the original function; if the second error is not less than the set threshold, the value of i is updated until the value of i is equal to the number of polynomials in the currently obtained polynomial set; if the second error is less than the set threshold, the new polynomial replaces the i-th polynomial and the i+1-th polynomial to update the currently obtained polynomial set.

8. 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 method according to claim 1 to 6.

9. 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 any one of the methods described in claims 1 to 6 are executed.

Citation Information

Patent Citations

  • Privacy computing method based on polynomial fitting

    CN114048519A

  • Wireless communication method, fitting method of nonlinear function, terminal and equipment

    CN114567396A

  • Privacy algorithm construction method and device, electronic equipment and readable storage medium

    CN115081020A

  • Privacy algorithm construction method and device, electronic equipment and readable storage medium

    CN115081021A