Homomorphic encryption method, system, device and storage medium based on federal factorization machine

By using homomorphic encryption of federated factorization machines, computation and decryption are performed on the ciphertext, solving the problem of data privacy leakage during factorization machine model training and achieving data protection and efficient model training under trusted third parties.

CN114491590BActive Publication Date: 2025-12-16PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210051734.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-17
Publication Date
2025-12-16
Estimated Expiration
2042-01-17

AI Technical Summary

Technical Problem

Existing technologies cannot train and predict factorization machine models without compromising data privacy, especially when there are multiple data sources, as data privacy is easily leaked to the model training side.

Method used

A homomorphic encryption method based on federated factorization machine is adopted. The computation is performed on the ciphertext through additive homomorphic encryption. The intermediate results are calculated using public key and multi-user training data. The results are then decrypted and integrated at a trusted third party to realize the training and prediction of the factorization machine model.

Benefits of technology

The training and prediction of the factorization machine model were realized while protecting data privacy, which expanded the application scenarios of the factorization machine algorithm, enhanced the model's fitting ability, and enabled it to solve more complex problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491590B_ABST
    Figure CN114491590B_ABST
Patent Text Reader

Abstract

The application discloses a homomorphic encryption method, system and device based on a federal factorization machine and a storage medium, wherein in a training process of the federal factorization machine, multiplication operations between data from different data parties can be eliminated through reasonable linear approximation, and only addition is performed between the data, thereby meeting an application scenario of additive homomorphic encryption. Through application of the additive homomorphic encryption, the privacy of the data can be protected in a calculation process. The application realizes training of the factorization machine under the condition of protecting the data privacy, expands an application scenario of the factorization machine algorithm and an algorithm implementation supported by federal learning, and enables more industries needing to apply the federal learning. In the application, the homomorphic encryption technology is applied to the training process of the factorization machine, data exchanged between each participant of the federal learning and a trusted third party is desensitized, and privacy information of the data cannot be obtained from the data after decryption, thereby effectively avoiding leakage of the data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of encryption algorithm, and relates to a homomorphic encryption method, system, device and storage medium based on a federated factorization machine. BACKGROUND

[0002] In recent years, the factorization machine algorithm is widely applied to regression and classification problems represented by a recommendation system. Compared with the classic linear regression algorithm which respectively considers each feature, the factorization machine takes the cross information between different features into the model, so that a more accurate model can be constructed. However, in actual application, data often contains privacy information from individual citizens, and in the traditional factorization machine model construction method, the modeler must master all the data. In the case of data from multiple different data sources, data privacy will be leaked to the model training party. Therefore, the data users need to apply the vertical federated learning method to construct the factorization machine model for the protection of user data privacy. The prior art cannot decrypt and integrate the intermediate results of each participant by a trusted third party, so that the training and prediction of the factorization machine model cannot be realized without leaking data privacy. SUMMARY

[0003] The purpose of the application is to solve the problems in the prior art, and provide a homomorphic encryption method, system, device and storage medium based on a federated factorization machine. By applying additive homomorphic encryption to the intermediate calculation results, each participant can perform calculation on the ciphertext, and the trusted third party can decrypt and integrate the intermediate results of each participant, so that the training and prediction of the factorization machine model can be realized without leaking data privacy.

[0004] To achieve the above purpose, the application adopts the following technical solutions:

[0005] The homomorphic encryption method based on the federated factorization machine comprises the following steps:

[0006] The intermediate results of each user are calculated by using the public key and the training data of multiple users, and the intermediate results of all users are aggregated to obtain the prediction label.

[0007] The mean square error of the prediction label and the true label in the training data is calculated, and if the mean square error value decreases, the prediction label is clipped.

[0008] The prerequisite degree and the second-order prerequisite degree of each user are calculated according to the clipped prediction label, and the gradient of each user is calculated according to the second-order prerequisite degree of each user.

[0009] The gradient of each user is optimized, and the training data of each user is updated according to the optimized gradient.

[0010] The further improvement of the present application is that:

[0011] The intermediate result of each user includes WX, V k X, (V k X) 2 and V k,j (X j ) 2 , wherein W is a first-order parameter, X is a feature, V k represents the jth parameter V, j is a certain dimension of the parameter V, V k,j represents the jth parameter V of the jth dimension, j represents a certain dimension of the feature X, X j represents the jth feature X.

[0012] The intermediate results of all users are aggregated to obtain the predicted label The method is as follows:

[0013] The intermediate result WX:

[0014] WX=(WX) s +(WX) p

[0015] , wherein (WX) s represents the first-order coupling degree of the initiator, (WX) p represents the first-order coupling degree of the acceptor;

[0016] The intermediate result (V k X) 2 :

[0017]

[0018] The intermediate result V k,j (X j ) 2 :

[0019] V k,j (X j ) 2 =(V k,j (X j ) 2 ) s +(V k,j (X j ) 2 ) p

[0020] The predicted label is as follows:

[0021]

[0022] The method for clipping the predicted label is as follows:

[0023]

[0024] wherein, denotes the clipped predicted label.

[0025] The calculating the premise degree and the second-order premise degree of each user according to the clipped predicted label comprises:

[0026] The calculating the front gradient according to the clipped predicted label comprises:

[0027]

[0028]

[0029] wherein, G logistic denotes the logistic regression, Y denotes the regression label, G logistic denotes the linear regression.

[0030] The calculating the second-order premise degree FGVX according to the front gradient comprises:

[0031] FGVX logistic = outer(G logistic , V k X)

[0032] FGVX linear = outer(G linear , V k X)

[0033] wherein, outer() denotes outer multiplication; FGVX logistic denotes the logistic regression second-order premise degree; FGVX linear denotes the linear regression second-order premise degree.

[0034] The calculating the gradient of each user according to the second-order premise degree of each user comprises:

[0035] G w = G logistic X

[0036] G v = FGVX·X-G linear V(X) 2

[0037] wherein, G w denotes the gradient of the parameter w, G v denotes the gradient of the parameter v, and V is the parameter.

[0038] The optimizing the gradient of each user and updating the training data of each user according to the optimized gradient comprises:

[0039] deltaW = g oPT (G)

[0040] wherein deltaW represents the change amount of the parameter W, g OPT () represents a gradient optimization function, and G is a gradient.

[0041] The specific method for updating the training data of each user according to the optimized gradient is as follows:

[0042] W0 = W1 - deltaW

[0043] wherein W0 represents an initial parameter, and W1 represents an updated parameter.

[0044] A federated factor decomposition machine system based on homomorphic encryption comprises:

[0045] A first calculation module is configured to calculate intermediate results of each user according to a public key and training data of multiple users, and aggregate the intermediate results of all users to obtain a predicted label.

[0046] A second calculation module is configured to calculate a mean square error of the predicted label and a true label in the training data, and if the mean square error value decreases, the predicted label is clipped.

[0047] A third calculation module is configured to calculate a first-order premise and a second-order premise of each user according to the clipped predicted label, and calculate a gradient of each user according to the second-order premise of each user.

[0048] A fourth calculation module is configured to optimize the gradient of each user, and update the training data of each user according to the optimized gradient.

[0049] A terminal device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.

[0050] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the above method.

[0051] Compared with the prior art, the present application has the following beneficial effects:

[0052] The application can eliminate the multiplication operation between data from different data parties in the training process of the federal factor decomposition machine through reasonable linear approximation, only add between the data, so as to meet the application scene of additive homomorphic encryption. Through the application of additive homomorphic encryption, the privacy of data can be protected in the calculation process. The application realizes the training of the factor decomposition machine under the condition of protecting the privacy of data, expands the application scene of the factor decomposition machine algorithm and the algorithm implementation supported by the federal learning, and enables more industries that need to apply the federal learning. The application applies the homomorphic encryption technology to the training process of the factor decomposition machine, and the data exchanged between each participant of the federal learning and the trusted third party are desensitized, and the trusted third party can decrypt, but since the exchanged data is the intermediate result of calculation, the privacy information of the data cannot be obtained after decryption, so that the leakage of data privacy is effectively avoided. Finally, the application applies the factor decomposition machine modeling, which has stronger fitting ability than the linear model and better effect, and can solve more complex practical problems. BRIEF DESCRIPTION OF DRAWINGS

[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0054] Figure 1 The flowchart of the method of the present application.

[0055] Figure 2 The principle diagram of the system of the present application.

[0056] Figure 3 The flowchart of one embodiment of the present application.

[0057] Figure 4 The flowchart of another embodiment of the present application.

[0058] Figure 5 The principle diagram of the system of one embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0060] Therefore, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application claimed, but merely represents selected embodiments of the application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the application without creative labor fall within the scope of the application.

[0061] It should be noted that similar reference 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 subsequent drawings.

[0062] In the description of the embodiments of the application, it should be noted that if the terms such as "upper", "lower", "horizontal", "inner" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship when the product of the application is used, only for the convenience of describing the application and simplifying the description, and it is not intended to indicate or imply that the device or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the application. In addition, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0063] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly inclined. For example, "horizontal" only means that its direction is relatively more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly inclined.

[0064] In the description of the embodiments of the application, it should also be noted that unless otherwise explicitly specified and limited, if the terms "set", "mount", "connected", "connected" appear, they should be understood in a broad sense. For example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the communication between the two elements inside. For those of ordinary skill in the art, the specific meaning of the above terms in the application can be understood according to the specific circumstances.

[0065] The application will be further described in detail below in conjunction with the drawings:

[0066] Referring to Figure 1 , the homomorphic encryption method based on the federal factorization machine of the application comprises the following steps:

[0067] S1, calculating the intermediate result of each user according to the public key and the training data of multiple users, and aggregating the intermediate results of all users to obtain the predicted label;

[0068] The intermediate result of each user includes WX, V kX, (V k X) 2 and V k,j (X j ) 2 where W is a first-order parameter, X is a feature, V k represents the jth parameter V, j is a certain dimension of the parameter V, V k,j represents the jth parameter V in the jth dimension, j represents a certain dimension of the feature X, X j represents the jth feature X.

[0069] Aggregate the intermediate results of all users to obtain the predicted label The method is as follows:

[0070] Intermediate result WX:

[0071] WX = (WX) s + (WX) p

[0072] where (WX) s represents the first-order coupling degree of the initiator, (WX) p represents the first-order coupling degree of the acceptor;

[0073] Intermediate result (V k X) 2 :

[0074]

[0075] Intermediate result V k,j (X j ) 2 :

[0076] V k,j (X j ) 2 = (V k,j (X j ) 2 ) s + (V k,j (X j ) 2 ) p

[0077] Then the predicted label is as follows:

[0078]

[0079] S2, calculate the mean square error of the predicted label and the true label in the training data, if the mean square error value decreases, then clip the predicted label;

[0080] The method of clipping the predicted label is as follows:

[0081]

[0082] wherein, denotes the clipped predicted label.

[0083] S3, calculating premise degree and second-order premise degree of each user according to the clipped predicted label; and calculating gradient of each user according to the second-order premise degree of each user;

[0084] calculating premise degree and second-order premise degree of each user according to the clipped predicted label, comprising:

[0085] calculating the front gradient according to the clipped predicted label:

[0086]

[0087]

[0088] wherein, G logistic denotes logistic regression, Y denotes regression label, G logistic denotes linear regression.

[0089] calculating second-order premise degree FGVX according to the front gradient:

[0090] FGVX logistic = outer(G logistic , V k X)

[0091] FGVX linear = outer(G linear , V k X)

[0092] wherein, outer() denotes outer multiplication; FGVX logistic denotes logistic regression second-order premise degree; FGVX linear denotes linear regression second-order premise degree.

[0093] calculating gradient of each user according to the second-order premise degree of each user, comprising:

[0094] G w = G logistic X

[0095] G v = FGVX·X-G linear V(X) 2

[0096] wherein, G w denotes gradient of parameter w, G v denotes gradient of parameter v, and V is a parameter.

[0097] S4, optimizing the gradient of each user, and updating the training data of each user according to the optimized gradient.

[0098] δW = g OPT (G)

[0099] Wherein, δW represents the change amount of parameter W, g OPT () represents the gradient optimization function, and G is the gradient.

[0100] The specific method of updating the training data of each user according to the optimized gradient is as follows:

[0101] W0 = W1- δW

[0102] Wherein, W0 represents the initial parameter, and W1 represents the updated parameter.

[0103] As Figure 2 shown, the embodiment of the application discloses a kind of federal factor decomposition machine systems based on homomorphic encryption, comprising:

[0104] First computing module, for calculating the intermediate result of each user according to public key and the training data of multiple users, and aggregating the intermediate result of all users to obtain predicted label;

[0105] Second computing module, for calculating the mean square error of predicted label and real label in training data, if the mean square error value drops, then the predicted label is clipped;

[0106] Third computing module, for calculating the premise degree and second-order premise degree of each user according to the predicted label after clipping;And the gradient of each user is calculated according to the second-order premise degree of each user;

[0107] Fourth computing module, for optimizing the gradient of each user, and updating the training data of each user according to the optimized gradient.

[0108] As Figure 3 shown, in a possible embodiment, the embodiment also discloses a kind of homomorphic encryption methods based on federal factor decomposition machine, comprising the following steps:

[0109] S01, generate public key, send public key to first user and second user;

[0110] S02, according to public key and the training data of first user and second user, calculate the intermediate result of first user and second user, and send the intermediate result of second user to first user after encryption;The intermediate result of first user and second user includes WX, V k X, (V k X) 2 And V k,j (Xj ) 2 where W is a first-order parameter, X is a feature, V k represents the jth parameter V, j is a certain dimension of the parameter V, V k,j represents the jth parameter V in the jth dimension, j represents a certain dimension of the feature X, X j represents the jth feature X.

[0111] In this embodiment, the encryption of the intermediate result is an encryption operation using additive homomorphism encryption. Specifically, the plaintext is subjected to addition and multiplication operations on a ring and then encrypted, and the corresponding operation is performed on the ciphertext after encryption, and the results are equivalent. Therefore, a third party can be commissioned to process data without revealing information. The encryption function with homomorphism property is an encryption function that satisfies where En is an encryption operation, Dec is a decryption operation, and ⊙, respectively correspond to the operations on the plaintext and ciphertext domains. When represents addition, the encryption is called additive homomorphism encryption: when represents multiplication, the encryption is called multiplicative homomorphism encryption. If there exists an effective algorithm or holds, and x and y are not leaked.

[0112] S03, aggregates the intermediate results of the first user and the second user to obtain a predicted label; the method for the initiator to aggregate the intermediate results is as follows:

[0113] WX=(WX) s +(WX) p

[0114]

[0115] V k,j (X j ) 2 =(V k,j (X j ) 2 ) s +(V k,j (X j ) 2 ) p

[0116]

[0117] where (WX) s represents the first-order coupling degree of the initiator, (WX) p represents the first-order coupling degree of the acceptor, represents the predicted label.

[0118] S04, calculate the mean square error of the predicted label and the true label in the training data, if the mean square error value decreases, execute S05; if the mean square error value does not decrease, end;

[0119] S05, clip the predicted label, and feed back the clipped predicted label to the first user; the third party clips the intermediate result in the following specific method:

[0120]

[0121] S06, calculate the front gradient according to the clipped predicted label, and send the front gradient to the second user; the initiator calculates the front gradient according to the clipped intermediate result in the following specific method:

[0122]

[0123]

[0124] Wherein, G logistic represents logistic regression, Y represents regression label, G logistic represents linear regression.

[0125] S07, calculate the second order premise degree FGVX of the first user and the second user according to the front gradient, and send the second order premise degree FGVX of the first user to the second user, and send the second order premise degree FGVX of the second user to the first user; the initiator and the acceptor calculate FGVX according to the front gradient in the following specific method:

[0126] FGVX=outer(G logistic , V k X)

[0127] Wherein, Fouter() represents outer multiplication.

[0128] S08, calculate the gradient of the second user according to the second order premise degree FGVX of the first user, and calculate the gradient of the first user according to the second order premise degree FGVX of the second user; the first user and the second user respectively calculate the gradient according to the second order premise degree FGVX of the other party in the following specific method:

[0129] G w =G logistic X

[0130] G v =FGVX·X-G linear V(X) 2

[0131] Wherein, G w represents the gradient of parameter w, G v represents the gradient of parameter v, and V is a parameter.

[0132] S09, optimizing the gradient of the first user and the second user, and feeding back the optimized gradient of the first user to the first user and the optimized gradient of the second user to the second user; the specific method of the third party for optimizing calculation of the gradient is as follows:

[0133] δW = g OPT (G)

[0134] wherein, δW represents the change of parameter W, g OPT () represents the gradient optimization function, and G is the gradient.

[0135] S10, updating the training data of the first user according to the optimized gradient of the first user and updating the training data of the second user according to the optimized gradient of the second user, and then returning to S02; the specific method of the initiator and the acceptor for updating the model according to the optimized gradient is as follows:

[0136] W0 = W1 - δW

[0137] As Figure 4 shown, in another possible embodiment, the embodiment discloses another homomorphic encryption method based on federal factor decomposition machine, comprising the following steps:

[0138] Step 1, the third party generates a public key and sends it to the initiator and the acceptor;

[0139] Step 2, the initiator and the acceptor calculate intermediate results, including WX, V k X, (V k X) 2 , V k,j (X j ) 2 , and the acceptor sends the encrypted intermediate results to the initiator; wherein the initiator and the acceptor calculate the intermediate results according to the training data;

[0140] Step 3, the initiator calculates WX = (WX) s +(WX) p , V k,j (X j ) 2 =(V k,j (X j ) 2 ) s +(V k,j (X j ) 2 ) p , send the predicted label Y to the third party;

[0141] Step 4, calculate the loss function, if the loss function value is reduced, then execute step 5; if the loss function value is not reduced, end. Wherein the loss function is the mean square error of the predicted label and the real label in the training data.

[0142] Step 5, for the logistic regression problem, the third party calculates Send to the initiator;

[0143] Step 6, the initiator calculates the front gradient, for the logistic regression For regression Send to the acceptor;

[0144] Step 7, the initiator and the acceptor calculate FGVX=outer(G loaistic , V k X) respectively sent to each other;

[0145] Step 8, the initiator and the acceptor calculate the gradient G w =G logistic X, G v =FGVX·X-G linear V(X) 2 , send to the third party;

[0146] Step 9, the third party calculates δW=g OPT (G) according to the selected optimization r;

[0147] Step 10, the initiator and the acceptor calculate W0=W1-δW, update the model; then return to step 2.

[0148] As Figure 5 shown, in one possible embodiment, the embodiment discloses a homomorphic encryption-based federated factorization machine system, comprising:

[0149] A public key generation module, the public key generation module is used for generating a public key, sending the public key to a first user and a second user;

[0150] A predicted label calculation module, the predicted label calculation module calculates intermediate results of the first user and the second user according to the public key and training data of the first user and the second user;

[0151] An aggregation calculation module, the aggregation calculation module aggregates the intermediate results of the first user and the second user to obtain a predicted label;

[0152] A loss function calculation module, the loss function calculation module is used for calculating the mean square error of the predicted label and the real label in the training data to obtain the predicted label;

[0153] A clipping calculation module, the clipping calculation module is used for clipping the predicted label;

[0154] a pre-gradient calculation module, the gradient calculation module being configured to calculate a pre-gradient according to the clipped predicted label;

[0155] a second-order pre-graduation FGVX calculation module, the second-order pre-graduation FGVX calculation module being configured to calculate a second-order pre-graduation FGVX of the first user and the second user according to the pre-gradient;

[0156] a gradient calculation module, the gradient calculation module being configured to calculate a gradient of the second user according to the second-order pre-graduation FGVX of the first user, and calculate a gradient of the first user according to the second-order pre-graduation FGVX of the second user;

[0157] a gradient optimization module, the gradient optimization module being configured to optimize the gradients of the first user and the second user;

[0158] a model updating module, the model updating module being configured to update training data of the first user according to the optimized gradient of the first user, and update training data of the second user according to the optimized gradient of the second user.

[0159] Specifically, the application can track business customers, wherein the feature X is a customer feature, such as age, income, etc., and the label Y is whether there is a purchase intention, and Y=1 if there is a purchase intention, and Y=0 if there is no purchase intention, and the application algorithm can output a predicted label Y according to the input feature X.

[0160] The application also discloses a terminal device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the following method when executing the computer program:

[0161] Step 1, generating a public key and sending the public key to the first user and the second user;

[0162] Step 2, calculating intermediate results of the first user and the second user according to the public key and the training data of the first user and the second user, and sending the intermediate result of the second user to the first user after encryption;

[0163] Step 3, aggregating the intermediate results of the first user and the second user to obtain a predicted label;

[0164] Step 4, calculating a mean square error of the predicted label and a real label in the training data, and if the mean square error value decreases, executing Step 5, and if the mean square error value does not decrease, ending;

[0165] Step 5, clipping the predicted label, and feeding back the clipped predicted label to the first user;

[0166] Step 6, calculating a pre-gradient according to the clipped predicted label, and sending the pre-gradient to the second user;

[0167] Step 7, calculating the second-order foreground degree FGVX of the first user and the second user according to the previous gradient, and sending the second-order foreground degree FGVX of the first user to the second user and sending the second-order foreground degree FGVX of the second user to the first user;

[0168] Step 8, calculating the gradient of the second user according to the second-order foreground degree FGVX of the first user and calculating the gradient of the first user according to the second-order foreground degree FGVX of the second user;

[0169] Step 9, optimizing the gradient of the first user and the second user, and feeding back the optimized gradient of the first user to the first user and feeding back the optimized gradient of the second user to the second user;

[0170] Step 10, updating the training data of the first user according to the optimized gradient of the first user and updating the training data of the second user according to the optimized gradient of the second user, and then returning to step 2.

[0171] The terminal device of the above embodiment comprises a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor implements the steps in each of the above method embodiments when executing the computer program. Alternatively, the processor implements the functions of each module / unit in each of the above device embodiments when executing the computer program.

[0172] The computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present application.

[0173] The terminal device can be a desktop computer, a notebook, a palm computer, a cloud server, and other computing devices. The terminal device can include, but is not limited to, a processor and a memory.

[0174] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0175] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the terminal device by running or executing the computer program and / or modules stored in the memory, and calling the data stored in the memory.

[0176] The application further discloses a computer readable storage medium, which stores a computer program, and the computer program is characterized in that the computer program realizes the steps of the following method when executed by a processor.

[0177] Step 1, generating a public key, and sending the public key to the first user and the second user;

[0178] Step 2, calculating the intermediate results of the first user and the second user according to the public key and the training data of the first user and the second user, and sending the intermediate result of the second user to the first user after encryption;

[0179] Step 3, aggregating the intermediate results of the first user and the second user to obtain a predicted label;

[0180] Step 4, calculating the mean square error of the predicted label and the true label in the training data, if the mean square error value decreases, executing step 5, if the mean square error value does not decrease, ending;

[0181] Step 5, clipping the predicted label, and feeding back the clipped predicted label to the first user;

[0182] Step 6, calculating the front gradient according to the clipped predicted label, and sending the front gradient to the second user;

[0183] Step 7, calculating the second-order premise degree FGVX of the first user and the second user according to the front gradient, and sending the second-order premise degree FGVX of the first user to the second user, and sending the second-order premise degree FGVX of the second user to the first user;

[0184] Step 8, calculating the gradient of the second user according to the second-order premise degree FGVX of the first user, and calculating the gradient of the first user according to the second-order premise degree FGVX of the second user;

[0185] Step 9, optimizing the gradients of the first user and the second user, and feeding back the optimized gradient of the first user to the first user, and feeding back the optimized gradient of the second user to the second user;

[0186] Step 10, updating the training data of the first user according to the optimized gradient of the first user, and updating the training data of the second user according to the optimized gradient of the second user, and then returning to step 2.

[0187] The modules / units integrated in the terminal device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0188] The above only is the preferred embodiment of the present application, and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A homomorphic encryption method based on a federal factorization machine, characterized in that, The method comprises the following steps: calculating an intermediate result of each user according to the public key and the training data of the multiple users, and aggregating the intermediate results of all users to obtain a predicted label; calculating the mean square error of the predicted label and the real label in the training data, and clipping the predicted label if the mean square error value decreases; the clipping method of the predicted label is as follows: wherein, represents a predicted label, represents a cropped predicted label; calculating the premise degree and the second-order premise degree of each user according to the clipped predicted label, and calculating the gradient of each user according to the second-order premise degree of each user; the calculation of the premise degree and the second-order premise degree of each user according to the clipped predicted label comprises: calculating the first gradient according to the clipped predicted label: wherein, represents a logistic regression, represents a regression label, represents a linear regression; The initiator and the acceptor calculate according to the previous gradient The specific method is as follows: wherein, denotes outer multiplication; denotes logistic regression second order premise degree; denotes linear regression second order premise degree; is a feature, denotes the th parameter , is a certain dimension of the parameter ; The specific method for calculating the gradient of the first user and the second user according to the second-order premise degree FGVX of the other party is as follows: wherein denotes the gradient of the parameter , denotes the gradient of the parameter ; optimizing the gradient of each user, and updating the training data of each user according to the optimized gradient.

2. The homomorphic encryption method based on a federated factorization machine according to claim 1, characterized in that, The intermediate result for each user comprises , , and wherein is a first order parameter, denotes the th parameter of the th dimension , denotes a certain dimension of a feature , denotes the th feature . 3.The homomorphic encryption method based on a federated factorization machine according to claim 1, wherein, The optimization of the gradient of each user and the updating of the training data of each user according to the optimized gradient comprise: wherein, denotes a parameter a change in the parameter, denotes a gradient optimization function, is a gradient; The specific method for updating the training data of each user according to the optimized gradient is as follows: wherein, denotes the initial parameter, denotes the updated parameter.

4. A homomorphic encryption based federated factorization machine system for implementing the method of claim 1, characterized in that, comprise: a first calculation module configured to calculate an intermediate result of each user according to the public key and the training data of the multiple users, and aggregate the intermediate results of all users to obtain a predicted label; a second calculation module configured to calculate the mean square error of the predicted label and the real label in the training data, and clip the predicted label if the mean square error value decreases; a third calculation module configured to calculate the premise degree and the second-order premise degree of each user according to the clipped predicted label; and calculate the gradient of each user according to the second-order premise degree of each user; a fourth calculation module configured to optimize the gradient of each user, and update the training data of each user according to the optimized gradient.

5. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the method according to any one of claims 1-3.

6. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 5. The computer program is executed by the processor to realize the steps of the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Model training method and system for privacy protection

    CN113011587A

  • Federal learning privacy protection method based on homomorphic encryption

    CN113434873A