Method and device for jointly processing service data
By using algebraic polynomials and triangular polynomials to process data in multi-party security calculations, the problem of difficulty in computing complex nonlinear functions is solved, the calculation accuracy and efficiency are improved, and the application effectiveness of multi-party security calculations is enhanced.
Patent Information
- Application Number
- CN202411971026.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
Due to the need for privacy protection in multi-party security calculations, complex nonlinear function calculations have high difficulty and complexity, which affect the performance and accuracy of business processing.
By using algebraic polynomials and triangular polynomials to process data, instead of the processing of complex functions, simple safety multiplication and safety addition calculations are used to improve calculation accuracy and efficiency.
Through the combination of algebraic polynomials and triangular polynomials, the calculation overhead is reduced, the accuracy of business processing results and the effectiveness of multi-party security computing applications are improved.
Smart Images

Figure CN119884548A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of secure computing technology, and more particularly, to a method and apparatus for jointly processing business data. Background Art
[0002] Secure Multi-Party Computation (SMPC or MPC), also known as multi-party secure computing, solves the problem of collaborative computing between a group of mutually distrusting parties to protect privacy, such as multiple parties jointly calculating the result of a function without revealing the input data of each party of the function, and the result of the calculation is made public to one or more of the parties. For example, typical applications of secure multi-party computing include privacy intersection and joint learning. Secure multi-party computing allows the participating parties to calculate business processing results such as statistical results and machine learning results based on the joint data of all parties without exposing their original data.
[0003] When multi-party secure computing is applied to business processing in the fields of machine learning and joint prediction, it is often necessary to calculate some complex nonlinear functions, such as the activation function in machine learning (sigmoid(x) = 1 / (1+e -x ),
[0004] Since the computational complexity is increased in multi-party secure computations for privacy protection, these complex computations are difficult and complex. Summary of the invention
[0005] One or more embodiments of this specification describe a method and apparatus for jointly processing business data to solve one or more problems mentioned in the background technology.
[0006] According to a first aspect, a method for jointly processing business data is provided, which is used in a secure calculation performed by multiple participants to process business data x and obtain a corresponding business processing result; the multiple participants include a first party, and the method is performed by the first party, including: jointly determining current data r based on the business data x with other participants, and obtaining a first slice of the data r; based on the first slice of the data r, securely calculating a first polynomial g about the data r with other participants to obtain a first slice of the first result, wherein the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to a complex function K via a predetermined algorithm; based on the first slice of the data r, securely calculating a second polynomial h about the data r with other participants to obtain a first slice of the second result, wherein the second polynomial h is a type of algebraic polynomial and a trigonometric polynomial that is different from the first polynomial g, and each coefficient of the second polynomial h is determined by fitting to the difference between the complex function K and the first polynomial g via a predetermined algorithm; determining the first slice of the business processing result according to the first slice of the first result and the first slice of the second result.
[0007] In one embodiment, the current data r is business data x, or is intermediate data obtained by performing at least one of predetermined processing of business feature extraction and high-order feature fusion on the business data x.
[0008] In one embodiment, the degree of the highest-order terms of the algebraic polynomial and the trigonometric polynomial does not exceed a predetermined degree.
[0009] In one embodiment, for the trigonometric function terms in the trigonometric polynomial, when the trigonometric function includes at least one of a frequency coefficient and a constant coefficient, the first party jointly calculates the processing result of the trigonometric function with other participating parties in the following manner: securely calculates with other participating parties an algebraic linear polynomial consisting of at least one of the frequency coefficient and the constant coefficient and data r to obtain a slice of the linear polynomial result; securely calculates the trigonometric function with other participating parties based on a slice of the linear polynomial result to obtain a first slice of the calculation result of the trigonometric function term.
[0010] In one embodiment, determining the first slice of the business processing result based on the first slice of the first result and the first slice of the second result includes: adding the first slice of the first result and the first slice of the second result to obtain the first slice of the processing result of the data r; and obtaining the first slice of the business processing result based on the first slice of the processing result of the data r.
[0011] In a further embodiment, obtaining the first slice of the business processing result based on the first slice of the processing result of the data r includes: using the first slice of the processing result of the data r as the first slice of the business processing result; or, jointly and securely processing the processing result of the data r with other participants to obtain the first slice of the business processing result.
[0012] According to a second aspect, a device for jointly processing business data is provided, which is used in a security calculation performed by multiple participants to process business data x and obtain corresponding business processing results; the multiple participants include a first party, and the device is provided on the first party, including:
[0013] An acquisition unit, configured to jointly determine the current data r according to the business data x with other participants, and obtain a first fragment of the data r;
[0014] A first calculation unit is configured to securely calculate a first polynomial g about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a first result, wherein the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to a complex function K via a predetermined algorithm;
[0015] A second calculation unit is configured to securely calculate a second polynomial h about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a second result, wherein the second polynomial h is a type of algebraic polynomial or trigonometric polynomial different from the first polynomial g, and each coefficient of the second polynomial h is determined by fitting the difference between the complex function K and the first polynomial g via a predetermined algorithm;
[0016] A determining unit is configured to determine a first slice of the business processing result according to a first slice of the first result and a first slice of the second result.
[0017] In one embodiment, the degree of the highest-order terms of the algebraic polynomial and the trigonometric polynomial does not exceed a predetermined degree.
[0018] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0019] According to a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the executable code, the method of the first aspect is implemented.
[0020] Through the method and device provided in the embodiments of this specification, in the business processing process performed by multiple participants based on secure computing, the processing results of data r by simple algebraic polynomials and trigonometric polynomials are used to add up, replacing the processing results of data r by complex functions, thereby improving the calculation accuracy on the basis of reducing the calculation overhead by performing simpler secure multiplication and secure addition calculations, thereby improving the accuracy of related business processing results and improving the effectiveness of multi-party secure computing applications. . BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0022] Figure 1 A specific example of secure multiplication performed by two parties is shown;
[0023] Figure 2 Another specific example of secure multiplication performed by two parties is shown;
[0024] Figure 3 A flowchart showing a method for jointly processing business data executed by a single participant according to an embodiment of the technical concept of this specification;
[0025] Figure 4 It is a schematic block diagram of an apparatus for jointly processing business data provided at a single participant according to an embodiment. DETAILED DESCRIPTION
[0026] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0027] First, some concepts that may be involved in this specification are described.
[0028] Algebraic polynomial: Algebraic polynomials usually refer to expressions obtained by a finite number of operations on constants, variables, addition, subtraction, multiplication, and non-negative integer powers. Algebraic polynomials can be algebraic expressions composed of the sum (or difference) of one or more monomials. Common polynomials include quadratic polynomials, cubic polynomials, Taylor expansions, etc.
[0029] Trigonometric polynomial: A general term for a class of functions based on trigonometric functions. A trigonometric polynomial can be represented by the sum of a finite number of sine functions sin(nx) and cosine functions cos(nx), where x is a variable and n is a natural number. The coefficients of each term in a trigonometric polynomial can be real or complex. If the coefficients are complex, then the trigonometric polynomial can correspond to a Fourier series.
[0030] It is understandable that multi-party secure computing often involves complex operations when used in application scenarios such as joint training models (such as federated learning) and joint data analysis (such as joint grouping of data tables). Taking federated learning as an example, logistic regression (sigmoid(x) = 1 / (1+e -x )) Since its result interval is between 0 and 1, which is consistent with the probability interval, it is often used as an activation function to map the processing results of actual business data to probability values in the interval from 0 to 1. The GELU function (Gaussian Error Linear Unit), as an activation function based on the Gaussian error function, can smooth the input data through the Gaussian error function to improve the performance of the model, so it is often used as an activation function. In particular, the GELU function performs well in natural language processing (NLP) and computer vision tasks, and is therefore used in model architectures such as natural language processing models and image recognition models, such as BERT, GPT-2 and other models.
[0031] In the multi-party secure computing scenario, the data in the secure computing process can be sharded (e.g., modulo 2 N The data is stored in the form of a share (corresponding to N bits). For example, the input data and intermediate results are held by all participants in a secure form such as sharing, and a single participant holds a single share. In order not to disclose the data privacy of each participant, each participant needs to jointly perform secure computing. Basic operations of secure computing, such as addition and multiplication, are performed in the share state.
[0032] The secure addition operation is relatively simple. For example, a specific example is: the participants in the addition operation of a and b in the shared state locally sum the shares of the two, and each party obtains a share of c = a + b. Take two participants P0 and P1 as an example. P0 holds a shard a0 of a and a shard b0 of b, and P1 holds a shard a1 of a and a shard b1 of b. Then P0 calculates a shard of c c0 = a0 + b0, and P1 calculates another shard of c c1 = a1 + b1, and the sum value c can be obtained in a shared form. Similarly, the subtraction operation of a and b in the shared state is to find the difference between the shares of the two.
[0033] There are usually two types of secure multiplication operations: one is that the multiplier does not split the share, and the other is that the multiplier splits the share. The following describes the process using two participants P0 and P1 as an example.
[0034] In the case where the multiplier is not split into shares, P0 holds multiplier a, P1 holds multiplier b, and the process of calculating the product c = a × b and the shared form (such as including the shard c0 held by P0 and the shard c1 held by P1) is as follows Figure 1 As shown: the semi-trusted server or trusted third party generates random auxiliary parameters u and v, and calculates the product z of u and v, and splits the share to obtain two shards z0 and z1, which are provided to P0 and P1 respectively; P0 calculates the reference value e=au and provides it to P1, and P1 calculates the reference value f=bv and provides it to P0; P0 can calculate uf+z0=c0, and P1 can calculate eb+z1=c1, and it is easy to verify that c0+c1=a×b, and c0 and c1 constitute the sum shared form of the product c.
[0035] In the case of multiplier split share, P0 holds shard a0 of multiplier a and shard b0 of multiplier b, and P1 holds shard a1 of multiplier a and shard b1 of multiplier b. The process of calculating the product c=a×b and the shared form (such as including shard c0 held by P0 and shard c1 held by P1) is as follows Figure 2 As shown: the semi-trusted server or trusted third party generates random numbers u0, v0, u1, v1, where u0 and u1 can be regarded as shares of auxiliary parameter u, and v0 and v1 can be regarded as shares of auxiliary parameter v; the semi-trusted server or trusted third party can calculate z=u×v, and split the shares to obtain z0 and z1, and provide u0, v0, z0 to party P0, and u1, v1, z1 to party P1; party P0 can calculate e0=a0-u0, f0=b0-v0 and provide them to party P1, and party P1 calculates e1=a1-u1, f1=b1-v1 and provides it to party P0, where e0 and e1 are shares of e, and f0 and f1 are shares of f; party P0 and party P1 each determine e and f according to the shares of e and f and calculate e×f, party P0 calculates c0=-ef+a0f+eb0+z0, and party P1 calculates c1=a1f+eb1+z1. It is easy to verify that c0 and c1 are shares of c.
[0036] The above addition and multiplication operations can be extended to matrix operations. The operations involved in the jointly trained model that need to be processed by complex functions can usually be converted into basic operations. For example, the operation of power is multiple multiplication operations. In order to reduce the complexity of processing data through complex functions, conventional technology can fit complex functions with algebraic polynomials and perform algebraic polynomial calculations in a shared form to replace the processing process of complex functions. However, in the case of more complex functions, the number of terms in the algebraic polynomial is large, or the degree of the polynomial is high (such as up to the 16th power), it still affects the performance of business processing.
[0037] In view of this, the present specification provides a technical solution for business processing by using a combination of algebraic polynomials and trigonometric polynomials instead of complex functions. For example, the complex function K is obtained by adding the polynomial a1+b×x and the trigonometric polynomial a2+c×sin(d×(x+e)), then let a1+a2=a, and we can have: K=a1+b×x+a2+c×sin(d×(x+e))=a+b×x+c×sin(d×(x+e)). When the trigonometric polynomial is a cosine polynomial, it can also be: K=a+b×
[0038] x+c×cos(d×(x+e)). Among them, d×(x+e)=dx+de in the trigonometric function term can be regarded as a first-order polynomial with a frequency coefficient of d and a constant term (the constant term in this specification may also be referred to as a constant coefficient) of de.
[0039] Specifically, for the complex function K in actual business (such as federated learning, joint data analysis based on business data tables, etc.), we can first use algebraic polynomials or trigonometric polynomials within a predetermined number of terms to fit a first polynomial g that is as close to the complex function as possible, and then use trigonometric polynomials or algebraic polynomials (different from the previous polynomial g type) to fit a second polynomial h that is as close as possible to the difference between the complex function K and the first polynomial g. Each participant can replace the complex function K to perform business processing and obtain the corresponding calculation results by securely calculating the sum of the first result corresponding to the first polynomial g and the second result corresponding to the second polynomial, thereby determining the final result of the business processing. In this way, the data processing process of the complex function can be replaced by simple algebraic polynomials and trigonometric polynomials, thereby improving the accuracy of the business processing results of the complex function under the multi-party secure computing architecture, thereby improving the effectiveness of multi-party secure business processing.
[0040] Reference below Figure 3 As shown, the technical concept of this specification is described in detail.
[0041] like Figure 3 As shown, it shows the relevant process executed by a single participant in the process of business data processing jointly performed by multiple participants. The execution subject of the process can be any computer, device, or server with certain computing capabilities. Specifically, for example, it is a computing platform used by a single participant to perform secure computing with other participants.
[0042] It can be understood that each participant can hold local data or data obtained during the secure computing process, and jointly process the corresponding data. Since the computer bottom layer represents data through binary numbers described by the switch state, the joint business processing process is refined in the computer as the calculation of various numerical values. When these numerical values have relevant meanings in the actual business field, combined with the processing method of the corresponding function, numerical values with actual business significance can be obtained. For example, in the application scenario of federated learning, the business data that each participant can hold can be sample data, such as business data and business labels from which business features can be extracted. Through the processing of a pre-set business model, the business data can be mapped to probability values on various tasks, thereby obtaining task prediction results. The business model can include, for example, logistic regression (sigmoid activation function), GELU activation function, complex trigonometric function (such as tangent function tanh, etc.) mapping, and other complex functions K processing the corresponding data.
[0043] In this specification, the initial business data of the business processing is recorded as x, then the current processing object can be x, or it can be the intermediate data obtained by further processing of x, which is uniformly recorded as current data r in this specification. Among them, the business data x is related to the specific business scenario. Taking the federated learning scenario as an example, in the prediction scenario of the computing resource flow required in cloud computing, the business data may include, for example: the number of cloud computing access users, the time node (such as whether it is a promotion node), the user type (such as a commercial platform, ordinary enterprise users), etc.; in the power consumption prediction scenario in the smart grid, the business data may include, for example: the time node (such as whether it is a holiday), the user type (such as office, residential, etc.), the user's work and rest habits, etc.; in the logistics capacity prediction scenario, the business data may include, for example: the time node (such as whether it is a promotion node), the item type (such as daily necessities, industrial consumables, etc.), the daily logistics capacity consumption in the recent scheduled time period, etc.
[0044] Assume that any one of the multiple parties that jointly process business data is recorded as the first party, such as Figure 3As shown, the process of jointly performing business data processing performed by the first party may include: step 301, jointly determining the current data r based on the business data x with other participating parties, and obtaining the first slice of the data r; step 302, based on the first slice of the data r, securely calculating the first polynomial g about the data r with other participating parties, and obtaining the first slice of the first result, the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to the complex function K via a predetermined algorithm; step 303, based on the first slice of the data r, securely calculating the second polynomial h about the data r with other participating parties, and obtaining the first slice of the second result, the second polynomial h is a type of algebraic polynomial and trigonometric polynomial that is different from the first polynomial g, and each coefficient of the second polynomial h is determined by fitting to the difference between the complex function K and the first polynomial g via a predetermined algorithm; step 304, determining the first slice of the business processing result according to the first slice of the first result and the first slice of the second result.
[0045] First, in step 301, the current data r is determined based on the business data x in collaboration with other participants, and the first fragment of the data r is obtained.
[0046] It is understandable that the current data r can be the business data x itself, or it can be the intermediate data obtained after the business data is processed in a predetermined manner (such as business feature extraction, high-order feature fusion, etc.). Usually, the current data r can be in a shared form composed of various fragments held by various participants. In the case where the current data r is the business data x itself or the business features extracted from the business data x, the business data x may initially exist in a single participant, or be distributed among various participants. In this case, the holding participant can split the data into shares and other methods to make it constituted and shared among various participants. In the case where the current data r is the intermediate data obtained after the business data is processed in a predetermined manner such as high-order feature extraction and fusion, it is usually already constituted and shared among various participants in the early processing process.
[0047] In the and sharing form, the first party can hold a shard of the current data r.
[0048] Then, on the one hand, according to step 302, based on the first fragment of the data r, a first polynomial g about the data r is securely calculated with other participants to obtain a first fragment of the first result.
[0049] It can be understood that under the technical concept of this specification, in order to avoid the processing of the corresponding data by the complex function K, the processing process of the current data r by the complex function K can be replaced by the processing process of the current data r by a combination of simpler algebraic polynomials and trigonometric polynomials. Here, the complex function can be a function that is difficult to calculate through multi-party security calculation (such as polynomial division containing natural logarithms, etc.), or a function that is difficult to calculate the result (such as the 10th power of x) through interactions within a predetermined number of times (such as 10 times). Common complex functions include, for example, sigmoid function, tanh function, GELU function, etc. The current data r can be data suitable for processing by the complex function K, such as the characterization data obtained after high-order feature fusion to be mapped probabilistically to each classification category through the output layer, and the processing process and results are recorded as K (r). The simpler algebraic polynomial is, for example, a polynomial within a predetermined number of times (such as the 2nd power), and the trigonometric polynomial is a polynomial combination of sine sin and cosine cos. The first polynomial g can be an algebraic polynomial or a trigonometric polynomial.
[0050] In practice, the complex function K can be fitted in advance using an algebraic polynomial or trigonometric polynomial that satisfies the polynomial degree condition (such as within the second power) as the target, thereby determining the coefficients of the polynomial and obtaining the first polynomial g. The fitting process of the polynomial to the complex function K can use a fitting algorithm such as the Remez algorithm and the least squares algorithm.
[0051] The Remez algorithm is mainly used to find the best consistent approximation polynomial of a function on a certain interval. This approximation is widely used in numerical analysis, signal processing, function approximation and other fields. Through the Remez algorithm, a polynomial can be obtained, the error between the polynomial and the original function on the specified interval can be minimized (measured by the consistent norm). The optimization problem solved by the Remez algorithm is to find the best consistent approximation polynomial, that is, to minimize the maximum error between the polynomial and the original function on the specified interval. The idea of the algorithm is: through an iterative process, the polynomial coefficients and selected points are continuously adjusted so that at the selected points, the error between the polynomial and the original function meets the conditions of the staggered point group, thereby achieving a better approximation effect. As a specific example, the steps are as follows: initial point selection, select any n+2 points in the selected interval (such as the interval from 0 to 1) as the initial staggered point group; solve the equation, list n+2 equations according to the definition of the staggered point group, and solve the polynomial coefficients and the error with the original function; reselect points, according to the polynomial obtained in the previous step, reselect n+2 points in the selected interval so that the new point group meets the conditions of the staggered point group; iteration, repeat the above steps until the predetermined number of iterations is reached or the error meets the requirements, and the expression of the sum of the products of the obtained polynomial coefficients (such as 0.5, 0.8) and the corresponding terms (such as the linear term x, the constant term 1, or the sine term sin(x), the cosine term cos(x)) (such as 0.5x+0.8×1, or 0.5sin(x)+0.8cos(x), etc.) is the first polynomial g.
[0052] Least squares fitting is usually a fitting algorithm for the best square approximation in discrete cases. For a given data point {(x i ,y i )}(i=0,1,…m), find p(x)∈Φ in a given function class Φ (such as algebraic function or trigonometric function) so that the sum of the squares of the errors E 2 Minimum, where E 2 =∑[p(x i )-y i ] 2 In geometric terms, it is to find the i ,y i )}(i=0, 1, ..., m) is the smallest sum of the distance squares of the curve y=p(x), the function p(x) is called the fitting function or the least squares solution, and the method for finding the fitting function p(x) is called the least squares method of curve fitting. In this specification, the expression of the fitting function p(x) is the first polynomial g.
[0053] In other embodiments, the expression of the first polynomial g can be obtained by other algorithms, and the fitting target is K, which will not be repeated here. The first polynomial g can be an algebraic polynomial or a trigonometric polynomial. As a specific example, the complex function K is a sigmoid function, which is first fitted by an algebraic polynomial, and the first polynomial obtained is, for example, 0.5+0.12x; the complex function K is a GELU function, which is first fitted by an algebraic polynomial, and the first polynomial obtained is, for example, 0.5x+0.1+0.2x 2 , etc. The polynomials listed here are polynomials about the independent variable x, and the fitting process is the process of determining the polynomial coefficients.
[0054] It is worth noting that the coefficients of the solved algebraic polynomial can be understood as the weighted coefficients of predetermined orders, and the coefficients of the trigonometric polynomial can include amplitude coefficients, frequency coefficients, constant coefficients, etc., such as the amplitude coefficient a, frequency coefficient n, constant coefficient b, etc. in the trigonometric function term asin(nx+b).
[0055] The first party can jointly calculate the first polynomial about the data r with other participating parties (using r as the independent variable value in the polynomial g), determine the corresponding first result, and obtain each fragment of the first result from each participating party. The fragment obtained by the first party is recorded as the first fragment of the first result.
[0056] In the case where the first polynomial g is an algebraic polynomial, the highest order of the polynomial is not greater than a predetermined order, such as 2. Each term in the polynomial can be predetermined, and the data to be processed r is determined by the current business data x, so the calculation process is performed around the current data r (corresponding to the independent variable x in the previous fitting process), and the coefficients can be disclosed to each participating party. During the calculation process of the first polynomial by the first party: for the first-order term, the first slice of the first-order term can be obtained by multiplying the coefficient of the first-order term by the first slice of the data r; for the quadratic term, it can be obtained by performing secure multiplication with other parties (refer to Figure 1 , Figure 2 ) to get the second power of r (r 2), and then locally calculate the product of the coefficient of the quadratic term and a slice of the square of r as the corresponding slice of the quadratic term; for any higher-order terms that may exist, it can be split into multiple secure multiplications, and the first party obtains the corresponding first slice. In particular, the constant term is the zero-order term, which is the corresponding coefficient itself. The first party can negotiate with other parties on the weighting method of the constant term. For example, if the constant term is split into a shared form, each party holds a slice, or one of the parties holds the constant term, and the other parties do not consider the constant term (in this case, the party that does not consider the constant term can also be regarded as holding the constant term slice 0). Afterwards, the first party can add up the first slices of each item (including the constant term when the first party holds the constant term or its slice) as the first slice of the first result.
[0057] When the first polynomial g is a trigonometric polynomial, the first party can interact with other parties in combination with the secure calculation method of the sine and cosine trigonometric functions to obtain the first shard of the corresponding first result. Among them, the secure calculation of the trigonometric functions sin and cos can be converted to: calculating sin and cos in plain text and calculating addition and multiplication in a secret state. Taking two participants as an example, when the data r is held by the first party P0 and the second party P1 respectively in a shard r1 and r2, without considering the coefficients, the sine function can be converted to: sin(r0+r1)=sin(r0)cos(r1)+cos(r0)sin(r1), and the cosine function cos(r0+r1)=cos(r0)cos(r1)-sin(r0)sin(r1). Among them, sin(r0) and cos(r0) can be calculated locally by the first party P0, and cos(r1) and sin(r1) can be calculated locally by the second party P1. Then, for the sine function, the first party and the second party calculate sin(r0)cos(r1) and cos(r0)sin(r1) through two safe multiplications, and obtain two slices corresponding to the two safe multiplications on the first party, and the sum of the two slices is a slice of the result of sin(r). For the cosine function, the first party and the second party calculate cos(r0)(r1) and -sin(r0)sin(r1) through two safe multiplications, and obtain two slices corresponding to the two safe multiplications on the first party, and the sum of the two slices is a slice of the result of cos(r).
[0058] In the case where the trigonometric function includes at least one of a frequency coefficient and a constant coefficient, such as sin(nr+b), where n and b are coefficients predetermined in the fitting process, nr+b can be regarded as an algebraic first-order polynomial about r, and the first party and other participating parties securely calculate a slice of the first-order polynomial result, and then perform secure calculation of the trigonometric function based on the slice of the first-order polynomial result to obtain a first slice of the first result.
[0059] In summary, the first party can obtain a first fragment of the first result of the first polynomial g about r through secure computation with other parties. The first fragment and other fragments obtained by other parties constitute a shared form of the first result.
[0060] On the other hand, through step 303, based on the first fragment of the data r, a second polynomial h about the data r is securely calculated with other participants to obtain the first fragment of the second result.
[0061] It can be understood that the second polynomial h is one of an algebraic polynomial and a trigonometric polynomial, and its type is different from the first polynomial g. That is to say, when the first polynomial g is an algebraic polynomial, the second polynomial h is a trigonometric polynomial, and conversely, when the first polynomial g is a trigonometric polynomial, the second polynomial h is an algebraic polynomial. The coefficients of each term of the second polynomial h can also be determined by fitting the difference between the complex function K and the first polynomial g via a predetermined algorithm (such as the Remez algorithm, the least squares algorithm, etc.). The specific fitting process is similar to the previous description, and the fitting target is Kg, which will not be repeated here.
[0062] As a specific example, the second polynomial h can be a polynomial obtained by further fitting the difference (Kg) between the sigmoid function (complex function K) and the first polynomial obtained by algebraic polynomial fitting through trigonometric polynomial fitting, for example: h = Kg = 0.14 × sin (π / 4 × x). As another specific example, the second polynomial h can be a polynomial obtained by further fitting the GELU function (complex function K) through trigonometric polynomial fitting on the basis of algebraic polynomial fitting, for example: h = Kg = -0.15 × cos (1.9934 × x), etc. Here, the polynomials listed are all polynomials about x, and the fitting process is the process of determining the polynomial coefficients.
[0063] Similarly, the second polynomial h is a polynomial whose independent variable is r, and r is used as the specific value of x in the above polynomial. Regardless of whether it is an algebraic polynomial or a trigonometric polynomial, the first party can use the corresponding method described above to securely interact with other parties to perform calculations to obtain the corresponding second result, and the first party obtains the first fragment of the second result.
[0064] Next, in step 304, the first slice of the business processing result is determined according to the first slice of the first result and the first slice of the second result.
[0065] It can be understood that the sum of the first result and the second result is used to replace the processing result of the complex function K on the data r. The first party obtained the first slice of the first result and the first slice of the second result in the previous steps. Therefore, the first party can sum the first slice of the first result and the first slice of the second result as the first slice of the processing result of the data r.
[0066] The business processing result here can be the processing result of the data r, or it can be other results determined based on the processing result of the data r, which is not limited here. As a specific example, in a federated learning application: in the prediction scenario of the computing resource flow required in cloud computing, the processing result of the data r can be used as the business processing result of the computing resource flow prediction; in the power consumption prediction scenario in the smart grid, the processing result of the data r can be used as the business processing result of the power consumption prediction in the smart grid; in the logistics capacity prediction scenario, the processing result of the data r can be used as the business processing result of the logistics capacity prediction; and so on. In these examples, the processing result based on the data r can be directly used as the business processing result. In other embodiments, the business processing result can also be other results determined on the processing result of the data r. For example, in a classification task, the processing result of the data r can be the probability of predicting each classification category, and the business processing result can be the output result of several classification categories with higher probabilities.
[0067] Looking back at the above process, in the business processing process performed by multiple participants based on secure computing, the sum of the processing results of data r by simple algebraic polynomials and trigonometric polynomials replaces the processing results of data r by complex functions, thereby improving the calculation accuracy while reducing the calculation overhead through simpler secure multiplication and secure addition calculations, thereby improving the accuracy of related business processing results and improving the effectiveness of multi-party secure computing applications.
[0068] Experiments have shown that the processing result of the data r under the above technical solution is closer to the processing result of the original complex function. Taking the sigmoid function as an example, the cubic polynomial 0.5+0.2166026×r-0.00660366×r is approximated by the better square. 3In the case of substitution, two safe multiplications need to be calculated, and the maximum approximation error near 0 exceeds 0.05. When the four-term Fourier series 0.5+0.61727893×sin(2r×π / 32)-0.03416704×\sin(4r×π / 32)+0.16933091×sin(6r×π / 32) is used for substitution, when the value of r is near 0 (such as less than 1), the maximum approximation error can be near 0.04. When the algebraic polynomials 0.5+0.12r and 0.14×sin(π / 4×r) in the above embodiment are used for substitution, when the value of r is near 0 (such as less than 1), the maximum approximation error is near 0.01. When the GELU function is replaced by algebraic polynomials and trigonometric polynomials, when the value of r is near 0 (such as less than 1), the maximum approximation error can also reach about 0.045. The business processing accuracy under the technical conception of this specification is greatly improved.
[0069] According to another embodiment, a device for jointly processing business data that can be set at a single participant is also provided. The device for jointly processing business data provided in this specification is used in a secure calculation performed by multiple participants to process business data x and obtain corresponding business processing results. Assuming that any one of the multiple participants is the first party, the device for jointly processing business data set at the first party is as follows: Figure 4 shown.
[0070] The device 400 for jointly processing business data provided at the first party may include:
[0071] An acquisition unit 401 is configured to jointly determine the current data r according to the business data x with other participants, and obtain a first fragment of the data r;
[0072] The first calculation unit 402 is configured to securely calculate a first polynomial g about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a first result, wherein the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to the complex function K via a predetermined algorithm;
[0073] The second calculation unit 403 is configured to securely calculate a second polynomial h about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a second result, wherein the second polynomial h is a type of algebraic polynomial or trigonometric polynomial different from the first polynomial g, and each coefficient of the second polynomial h is determined by fitting the difference between the complex function K and the first polynomial g via a predetermined algorithm;
[0074] The determining unit 404 is configured to determine the first slice of the business processing result according to the first slice of the first result and the first slice of the second result.
[0075] The highest order of the algebraic polynomial and the trigonometric polynomial does not exceed a predetermined order.
[0076] It is worth mentioning that Figure 4 The device 400 shown is Figure 3 The illustrated method embodiment corresponds, therefore, Figure 3 The corresponding description in the method embodiment can also be applied to Figure 4 The device 400 shown is not described in detail here.
[0077] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 3 The method described by et al.
[0078] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 3 The method described by et al.
[0079] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of this specification can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0080] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the technical concept of this specification. It should be understood that the above description is only the specific implementation method of the technical concept of this specification, and is not used to limit the protection scope of the technical concept of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of this specification should be included in the protection scope of the technical concept of this specification.
Claims
1. A method for jointly processing business data, used in a secure computation performed by multiple parties, to process business data x and obtain corresponding business processing results; The plurality of parties include a first party, and the method is performed by the first party, comprising: Combine with other participants to determine the current data r based on the business data x, and obtain the first shard of data r; Based on the first fragment of the data r, securely calculate with other participants a first polynomial g about the data r to obtain a first fragment of a first result, wherein the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to a complex function K via a predetermined algorithm; Based on the first slice of data r, securely calculate with other participants a second polynomial h about data r to obtain a first slice of a second result, wherein the second polynomial h is a type different from the first polynomial g among algebraic polynomials and trigonometric polynomials, and each coefficient of the second polynomial h is determined by fitting the difference between the complex function K and the first polynomial g through a predetermined algorithm; The first slice of the business processing result is determined according to the first slice of the first result and the first slice of the second result.
2. The method of claim 1, wherein: The current data r is the business data x, or is intermediate data obtained by performing at least one of predetermined processing of business feature extraction and high-order feature fusion on the business data x.
3. The method of claim 1, wherein: The highest order terms of the algebraic polynomial and trigonometric polynomial do not exceed a predetermined order.
4. The method of claim 1, wherein: For the trigonometric function terms in the trigonometric polynomial, when the trigonometric function includes at least one of a frequency coefficient and a constant coefficient, the first party calculates the processing result of the trigonometric function together with other participating parties in the following manner: Securely calculate with other participants an algebraic linear polynomial consisting of at least one of the frequency coefficient and the constant coefficient and the data r, and obtain a slice of the linear polynomial result; A secure calculation of trigonometric functions is performed with other participants based on a slice of the linear polynomial result to obtain a first slice of the calculation result of the trigonometric function term.
5. The method of claim 1, wherein: Determining the first fragment of the business processing result according to the first fragment of the first result and the first fragment of the second result includes: Add the first slice of the first result and the first slice of the second result to obtain the first slice of the processing result of the data r; Based on the first slice of the processing result of the data r, a first slice of the business processing result is obtained.
6. The method of claim 5, wherein: The first slice of the business processing result obtained based on the first slice of the processing result of the data r includes: The first slice of the processing result of data r is used as the first slice of the business processing result; or Jointly and securely process the processing results of data r with other participants to obtain the first shard of the business processing results.
7. A device for jointly processing business data, used in a secure computation performed by multiple participants, to process business data x and obtain corresponding business processing results; The multiple parties include a first party, and the device is provided at the first party, including: An acquisition unit, configured to jointly determine the current data r according to the business data x with other participants, and obtain a first fragment of the data r; A first calculation unit is configured to securely calculate a first polynomial g about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a first result, wherein the first polynomial g is one of an algebraic polynomial and a trigonometric polynomial, and each coefficient of the first polynomial g is determined by fitting to a complex function K via a predetermined algorithm; A second calculation unit is configured to securely calculate a second polynomial h about the data r based on the first fragment of the data r with other participants to obtain a first fragment of a second result, wherein the second polynomial h is a type of algebraic polynomial or trigonometric polynomial different from the first polynomial g, and each coefficient of the second polynomial h is determined by fitting the difference between the complex function K and the first polynomial g via a predetermined algorithm; A determining unit is configured to determine a first slice of the business processing result according to a first slice of the first result and a first slice of the second result.
8. The device according to claim 7, wherein: The highest order terms of the algebraic polynomial and trigonometric polynomial do not exceed a predetermined order.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.
10. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 6 is implemented.