A third-party privacy computing under longitudinal logistic regression model training method
By employing privacy-preserving computation methods that eliminate the need for third parties, and utilizing homomorphic encryption and salting, the security risks of data leakage during the training of the longitudinal logistic regression model are resolved. This enables secure and efficient data exchange and computation, avoiding reliance on trusted third parties.
Patent Information
- Application Number
- CN202210650114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-09
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-06-09
AI Technical Summary
In existing technologies, longitudinal logistic regression algorithms based on trusted third parties and two-party logistic regression methods that do not fully protect intermediate steps have significant security risks such as data leakage, making it difficult to effectively protect data security.
A privacy-preserving computation method without third parties is adopted. Data computation and exchange are performed using exchangeable homomorphic encryption. Salting is used to ensure the security of intermediate steps and prevent data leakage. The two parties involved in the computation exchange data directly, eliminating the dependence on a trusted third party.
It reduces the risk of data leakage, avoids the waste of computing power, improves data security and computing efficiency, and ensures the security and privacy of data exchange.
Smart Images

Figure CN115130121B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a third-party-removed privacy computing longitudinal logistic regression model training method. BACKGROUND
[0002] In the current era of "artificial intelligence" and "data technology", data, as one of the most important production factors, has a large amount of circulation and fusion needs. At present, when multiple institutions carry out data cooperation, the plaintext data of each party needs to be collected in one place (which can be collected in one of the institutions or in a separate third-party platform), and then centralized quantitative modeling or analysis work is carried out. Data has the need for opening and fusion, but on the other side, there are increasingly strict requirements for data security and protection, and the need for each institution to protect its own commercial data also makes the operation of "out-of-warehouse" of institutional plaintext data increasingly impracticable.
[0003] In the prior art, in order to solve the contradiction between data circulation and data security protection, the following methods are usually used: a longitudinal logistic regression algorithm based on a "trusted third party" under a federated learning framework, and a two-party logistic regression method that does not completely protect the intermediate step. However, these methods greatly simplify the difficulty of implementing a longitudinal logistic regression algorithm under federated learning, and if the "trusted third party" does not collude with any party, the security can be guaranteed, and the two-party manufacturer believes that the Z value of the intermediate step has been processed and does not expose too much information. However, these conditions are ideal, and in actual situations, both the trusted third-party solution and the two-party solution that does not protect the intermediate step may have major security risks such as data leakage. SUMMARY
[0004] Therefore, the embodiments of the present application provide a third-party-removed privacy computing longitudinal logistic regression model training method to solve the technical problem that the existing technology uses a longitudinal logistic regression algorithm based on a "trusted third party" under a federated learning framework and a two-party logistic regression method that does not completely protect the intermediate step to solve the problem of data circulation and data security protection, which may have major security risks such as data leakage.
[0005] The technical solution of the present application is as follows:
[0006] The first aspect of the embodiment of the present application provides a longitudinal logistic regression model training method under third-party privacy calculation, which comprises the following steps: obtaining first user feature data in privacy calculation and calculating corresponding first data values according to the first user feature data; receiving first encrypted data values sent by a data source party, wherein the first encrypted data values are obtained by the data source party from second user feature data corresponding to a data use request initiated by a data demand party, by preprocessing and encrypting the second user feature data according to the data use request; calculating corresponding target encrypted data values according to the first data values and the first encrypted data values; calculating corresponding first ciphertext prediction values of the target encrypted data values by using a preset longitudinal logistic regression algorithm based on federated learning; calculating first ciphertext data values for gradient calculation in the longitudinal logistic regression algorithm according to the first ciphertext prediction values and target label variables, and calculating corresponding first ciphertext update gradient values from the first ciphertext data values; updating corresponding first gradients in the longitudinal logistic regression algorithm after salt processing of the first ciphertext update gradient values; and encrypting the first ciphertext data values according to a preset first homomorphic key to obtain corresponding second encrypted data values and sending the second encrypted data values to the data source party, so that the data source party decrypts the second encrypted data values by using the preset first homomorphic key.
[0007] Optionally, updating the corresponding first gradient in the longitudinal logistic regression algorithm after salt processing of the first ciphertext update gradient values comprises: combining the first ciphertext update gradient values and a first preset random number, and sending the combination to the data source party to make the data source party decrypt the combination of the first ciphertext update gradient values and the first preset random number to obtain corresponding first decrypted data values; processing the first decrypted data values to obtain corresponding first gradient values and updating the corresponding first gradient in the longitudinal logistic regression algorithm according to the first gradient values.
[0008] Optionally, the step of calculating the corresponding first ciphertext prediction values of the target encrypted data values by using the preset longitudinal logistic regression algorithm based on federated learning comprises: fitting an activation function in the longitudinal logistic regression algorithm by using a preset polynomial function to obtain a corresponding preset longitudinal logistic regression algorithm based on federated learning; and calculating the corresponding first ciphertext prediction values of the target encrypted data values by using the preset longitudinal logistic regression algorithm based on federated learning.
[0009] The second aspect of the embodiment of the present application provides a longitudinal logistic regression model training method under third-party privacy calculation, which comprises the following steps: when a data use request sent by a data demander is acquired, pre-processing second user feature data corresponding to the data use request to obtain corresponding second data values; encrypting the second data values according to a preset second homomorphic key to obtain corresponding first encrypted data values and sending the first encrypted data values to the corresponding data demander; receiving second encrypted data values sent by the data demander, the second encrypted data values being obtained by encrypting first ciphertext data values used for gradient calculation in a longitudinal logistic regression algorithm in the data demander according to a preset first homomorphic encryption public key, the first ciphertext data values being obtained by processing the first encrypted data values by the data demander; decrypting the second encrypted data values by using the preset first homomorphic key to obtain corresponding second decrypted data values; calculating corresponding second ciphertext update gradient values according to the second decrypted data values and the user feature data, and updating corresponding second gradients in the longitudinal logistic regression algorithm after salt processing of the second ciphertext update gradient values.
[0010] Optionally, updating the corresponding second gradient in the longitudinal logistic regression algorithm after salt processing of the second ciphertext update gradient value comprises: calculating corresponding second ciphertext update gradient values according to the second decrypted data values and the user feature data; combining the second ciphertext update gradient values and a second preset random number and sending the combination to the data demander to enable the data demander to decrypt the combination of the second ciphertext update gradient values and the second preset random number to obtain corresponding third decrypted data values; processing the third decrypted data values to obtain corresponding second gradient values and updating the corresponding second gradient in the longitudinal logistic regression algorithm according to the second gradient values.
[0011] A third aspect of this invention provides a training apparatus for a longitudinal logistic regression model under privacy-free computation without third-party intervention. This apparatus includes: a first acquisition module, configured to acquire first user feature data in the privacy computation and calculate a corresponding first data value based on the first user feature data; a first receiving module, configured to receive a first encrypted data value sent by a data source, wherein the first encrypted data value is obtained by the data source preprocessing and encrypting second user feature data corresponding to a data usage request initiated by a data user; a first calculation module, configured to calculate a corresponding target encrypted data value based on the first data value and the first encrypted data value; and a second calculation module, configured to utilize a preset longitudinal logistic regression model based on federated learning. The algorithm calculates the corresponding first ciphertext prediction value for the target encrypted data value; the third calculation module is used to calculate the first ciphertext data value for gradient calculation in the longitudinal logistic regression algorithm based on the first ciphertext prediction value and the target label variable, and calculate the corresponding first ciphertext update gradient value for the first ciphertext data value; the first processing module is used to add salt to the first ciphertext update gradient value and update the corresponding first gradient in the longitudinal logistic regression algorithm; the second processing module is used to encrypt the first ciphertext data value according to the preset first homomorphic key after updating the first gradient to obtain the corresponding second encrypted data value and send the second encrypted data value to the data source so that the data source can decrypt the second encrypted data value using the preset first homomorphic key.
[0012] Optionally, the first processing module includes: a first calculation submodule, configured to calculate a corresponding first ciphertext update gradient value based on the first ciphertext data value; a first decryption submodule, configured to combine the first ciphertext update gradient value and a first preset random number and send them to the data source so that the data source can decrypt the combination formed by the first ciphertext update gradient value and the first preset random number to obtain a corresponding first decrypted data value; and a first update submodule, configured to process the first decrypted data value to obtain a corresponding first gradient value and update the corresponding first gradient in the longitudinal logistic regression algorithm based on the first gradient value.
[0013] The fourth aspect of the embodiment of the present application provides a longitudinal logistic regression model training device under third-party privacy calculation, the longitudinal logistic regression model training device under third-party privacy calculation comprises: a third processing module, used for when data demander sent data use request is acquired, the second user feature data corresponding to the data use request is preprocessed to obtain the corresponding second data value; a first encryption module, used for according to the preset second homomorphic key, the second data value is encrypted to obtain the corresponding first encrypted data value and the first encrypted data value is sent to the corresponding data demander; a second receiving module, used for receiving the second encrypted data value sent by the data demander, the second encrypted data value is obtained by the data demander according to the preset first homomorphic encryption public key, the first ciphertext data value for gradient calculation in the longitudinal logistic regression algorithm in the data demander is encrypted, and the first ciphertext data value is obtained by the data demander processing the first encrypted data value; a second decryption module, used for using the preset first homomorphic key to decrypt the second encrypted data value to obtain the corresponding second decrypted data value; an updating module, used for calculating the corresponding second ciphertext update gradient value according to the second decrypted data value and the user feature data, and updating the corresponding second gradient in the longitudinal logistic regression algorithm after salt processing the second ciphertext update gradient value.
[0014] The fifth aspect of the embodiment of the present application provides a computer readable storage medium, the computer readable storage medium stores computer instructions, the computer instructions are used to make the computer execute the longitudinal logistic regression model training method under third-party privacy calculation as described in the first aspect of the embodiment of the present application and any one of the first aspect, or the longitudinal logistic regression model training method under third-party privacy calculation as described in the second aspect of the embodiment of the present application and any one of the second aspect.
[0015] The sixth aspect of the embodiment of the present application provides an electronic device, comprising: a memory and a processor, the memory and the processor are mutually communicated and connected, the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the longitudinal logistic regression model training method under third-party privacy calculation as described in the first aspect of the embodiment of the present application and any one of the first aspect, or the longitudinal logistic regression model training method under third-party privacy calculation as described in the second aspect of the embodiment of the present application and any one of the second aspect.
[0016] The technical scheme provided by the present application has the following effects:
[0017] The method for training a longitudinal logistic regression model under privacy calculation without a third party provided by the embodiment of the present application comprises the following steps: obtaining first user feature data in privacy calculation and calculating corresponding first data values according to the first user feature data; receiving first encrypted data values sent by a data source party, the first encrypted data values being obtained by the data source party from second user feature data corresponding to a data use request initiated by a data demand party by preprocessing and encrypting the second user feature data according to the data use request; calculating corresponding target encrypted data values according to the first data values and the first encrypted data values; calculating corresponding first ciphertext prediction values by using a preset longitudinal logistic regression algorithm based on federated learning to calculate the target encrypted data values; calculating first ciphertext data values for gradient calculation in the longitudinal logistic regression algorithm according to the first ciphertext prediction values and target label variables and calculating corresponding first ciphertext update gradient values from the first ciphertext data values; updating corresponding first gradients in the longitudinal logistic regression algorithm after salt processing of the first ciphertext update gradient values; and encrypting the first ciphertext data values according to a preset first homomorphic key to obtain corresponding second encrypted data values and sending the second encrypted data values to the data source party so that the data source party decrypts the second encrypted data values by using the preset first homomorphic key. The method uses the exchangeable homomorphic encryption means to successfully remove the requirement of a “trusted third party”, solves the security problems caused by the potential collusion risk of the third party, and the two parties participating in the calculation are the two parties actually owning the data, so that the cost required for implementing the calculation can be better estimated, and the waste of computing power and the like can be avoided. Therefore, by using the exchangeable homomorphic encryption means to perform the calculation and the exchange of numerical values in the intermediate steps, the risk of data leakage is reduced, and the non-leakage of the intermediate steps is ensured by using the salt means. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the following description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0019] Figure 1 is a flowchart of the method for training a longitudinal logistic regression model under privacy calculation without a third party according to the embodiment of the present application;
[0020] Figure 2 is a flowchart of the method for training a longitudinal logistic regression model under privacy calculation without a third party according to the embodiment of the present application;
[0021] Figure 3is a structural block diagram of a longitudinal logistic regression model training device under third-party privacy calculation according to an embodiment of the present application;
[0022] Figure 4 is a structural block diagram of a longitudinal logistic regression model training device under third-party privacy calculation according to an embodiment of the present application;
[0023] Figure 5 is a structural schematic diagram of a computer readable storage medium provided according to an embodiment of the present application;
[0024] Figure 6 is a structural schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0026] The embodiments of the present application provide a longitudinal logistic regression model training method under third-party privacy calculation, as shown in Figure 1 The method comprises the following steps:
[0027] Step S101: Obtain first user feature data in privacy calculation and calculate corresponding first data values according to the first user feature data. Specifically, federated learning is a machine learning framework that can effectively help multiple institutions to use data and build machine learning models under the requirements of user privacy protection and data security. In federated learning, there are two participants including a data demander and a data source, both of which have corresponding user feature data, wherein the data demander (A) also has corresponding labels. According to the first user feature data owned by the data demander (A), the corresponding first data values can be calculated.
[0028] Specifically, the calculation is performed by the following formula:
[0029] Z A =np.dot(X A ,w A )+b…………………………………(1)
[0030] Wherein, Z A represents the first data value; X AThis represents the first user feature data, which can be numerical, character, etc. No specific limitation is made in this invention, as long as it helps predict the corresponding label; w A This represents the model coefficients, initially set to 0. The model is trained over many rounds, with two gradient values obtained in each round. and Then use the gradient on w a and w b Update:
[0031]
[0032]
[0033] Here, alpha is the learning rate set by the user before model training, such as 0.3.
[0034] w a and w b After the update is complete, the training process is repeated again and again to obtain new results. and Update w in this way a and w b until model training is complete; b represents the intercept.
[0035] Step S102: Receive the first encrypted data value sent by the data source party. The first encrypted data value is obtained by the data source party preprocessing and encrypting the second user feature data corresponding to the data usage request initiated by the data requester. Specifically, the data source party (B) is the party without tag data but possesses user feature data. When the data source party receives the data usage request initiated by the data requester, it first obtains the corresponding second user feature data according to the data usage request and preprocesses the user feature data:
[0036] Z B =np.dot(X B ,w B (2)
[0037] Among them, Z B This represents the processed value after preprocessing user feature data; X B This represents the second user characteristic data, which can serve as supplementary content to the first user characteristic data in the data requester's data. It can be numerical, character, etc., and is not specifically limited in this invention; w B This represents a parameter, initially set to 0.
[0038] Secondly, the data source generates homomorphic encryption keys (pk, sk) that satisfy the commutative property. B;
[0039] Finally, the key pk B The pre-processed processing value Z B is encrypted to obtain a first encrypted data value And the first encrypted data value is sent to the corresponding data demander.
[0040] Step S103: According to the first data value and the first encrypted data value, a corresponding target encrypted data value is calculated. Specifically, since the encrypted under the homomorphic encryption system, the target encrypted data value under the homomorphic encryption is directly obtained by the following formula:
[0041]
[0042] Step S104: The target encrypted data value is calculated by using a preset federated learning-based longitudinal logistic regression algorithm to obtain a corresponding first ciphertext prediction value. Specifically, in the federated learning-based longitudinal logistic regression algorithm, the activation function cannot be calculated in the ciphertext form due to its nonlinear characteristics, therefore, a preset federated learning-based longitudinal logistic regression algorithm that can be calculated in the ciphertext is obtained by pre-processing, wherein the pre-processing method in the present application is not limited, as long as the processing result meets the calculation requirement.
[0043] Finally, the target encrypted data value is calculated by using the finally obtained algorithm to obtain a corresponding first ciphertext prediction value:
[0044]
[0045] wherein, represents the first ciphertext prediction value; sigmoid() represents the preset federated learning-based longitudinal logistic regression algorithm; represents the target encrypted data value.
[0046] Step S105: According to the first ciphertext prediction value and the target label variable, a first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm is calculated and the first ciphertext data value is calculated to obtain a corresponding first ciphertext update gradient value. Specifically, according to the longitudinal logistic regression algorithm, the data demander calculates the first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm by using the first ciphertext prediction value and the target label variable through the following formula:
[0047]
[0048] wherein, represents the first ciphertext data value; Y represents a target label variable, represents a variable determined according to the first user feature data for evaluating a label, and takes a value of 0 (bad label) or 1 (good label).
[0049] The first ciphertext update gradient value is calculated by the following formula:
[0050]
[0051] wherein, represents the first ciphertext update gradient value; m represents a sample size; represents the transposition processing on X A .
[0052] Step S106: updating the corresponding first gradient in the longitudinal logistic regression algorithm after salt processing of the first ciphertext update gradient value. Specifically, the first ciphertext update gradient value is used for gradient update in the longitudinal logistic regression algorithm, and the first ciphertext update gradient value obtained in step S105 is an encrypted numerical value, which needs to be sent to the data source side for decryption. In order to ensure that the data is not obtained by the data source side, the first ciphertext update gradient value is salted and processed, and the processing result is used to update the corresponding first gradient in the longitudinal logistic regression algorithm.
[0053] Step S107: after updating the first gradient, the first ciphertext data value is encrypted according to a preset first homomorphic key to obtain a corresponding second encrypted data value, and the second encrypted data value is sent to the data source side so that the data source side decrypts the second encrypted data value using the preset first homomorphic key. Specifically, after updating the corresponding gradient, the data demand side generates a preset first homomorphic encryption key (pk, sk) A of its own, and uses the key to encrypt the first ciphertext data value twice to obtain a second encrypted data value Then the second encrypted data value is sent to the data source side. Since the homomorphic encryption method used is interchangeable, the data source side can decrypt the second encrypted data value to obtain a corresponding decrypted value wherein the is the result of simply encrypting the key of the data demand side.
[0054] The method for training a longitudinal logistic regression model under privacy calculation without a third party provided by the embodiment of the present application uses a commutative homomorphic encryption means, successfully removes the requirement of a "trusted third party", solves the security hidden danger caused by the potential collusion risk of the third party, and the like; both parties participating in the calculation are the two parties actually owning the data, the cost required for implementing the calculation can be better estimated, and the waste of computing power and the like is avoided. Therefore, by using the real-time present application, the commutative homomorphic encryption means is used to perform the calculation and the exchange of values in the intermediate steps, the risk of data leakage is reduced; the salted means is also used to ensure the non-leakage of the intermediate steps.
[0055] As an optional implementation manner of the embodiment of the present application, step S104 comprises: obtaining a corresponding preset federated learning-based longitudinal logistic regression algorithm by fitting an activation function in the longitudinal logistic regression algorithm by using a preset polynomial function; and obtaining a corresponding first ciphertext prediction value by calculating the target encrypted data value by using the preset federated learning-based longitudinal logistic regression algorithm.
[0056] Specifically, the activation function (sigmoid function) in the federated learning-based longitudinal logistic regression algorithm is a nonlinear function for logistic regression, which cannot be calculated in the ciphertext form. The polynomial level operation can be performed on the ciphertext, therefore, a polynomial function F is used to fit the sigmoid function, at this time, formula (4) is changed into the following form:
[0057]
[0058] Wherein, e represents a constant; a1, a2, a3 represent the coefficients before encryption.
[0059] As an optional implementation manner of the embodiment of the present application, step S106 comprises: combining the first ciphertext update gradient value and a first preset random number, and then sending the combination to the data source party to enable the data source party to decrypt the combination formed by the first ciphertext update gradient value and the first preset random number to obtain a corresponding first decrypted data value; processing the first decrypted data value to obtain a corresponding first gradient value, and updating a corresponding first gradient in the longitudinal logistic regression algorithm according to the first gradient value.
[0060] Specifically, the first ciphertext update gradient value is subjected to salt processing: Wherein, r represents a random number known only by the data demand party, the random number r is added to the first ciphertext update gradient value dw to obtain dw A +r, then the data demand party receives the dw A +r, removes the random number r, and obtains a corresponding gradient value dw A , and simultaneously uses the gradient value dwA updating the corresponding first gradient w in the longitudinal logistic regression algorithm A .
[0061] The embodiment of the present application also provides a longitudinal logistic regression model training method under third-party privacy calculation, as shown in the formula (1), the method comprises the following steps: Figure 2
[0062] Step S201: When the data use request sent by the data demand party is acquired, the second user feature data corresponding to the data use request is preprocessed to obtain the corresponding second data value. The specific implementation process refers to the process of pre-processing the second user feature data in step S102, which will not be repeated here. Wherein, the second data value is Z B .
[0063] Step S202: According to the preset second homomorphic key, the second data value is encrypted to obtain the corresponding first encrypted data value, and the first encrypted data value is sent to the corresponding data demand party. The specific implementation process refers to the encryption process in step S102, which will not be repeated here. Wherein, the preset second homomorphic key is (pk, sk) B .
[0064] Step S203: Receive the second encrypted data value sent by the data demand party, the second encrypted data value is obtained by encrypting the first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm in the data demand party according to the preset first homomorphic encryption public key, and the first ciphertext data value is obtained by processing the first encrypted data value by the data demand party. Specifically, the process of obtaining the first ciphertext data value from the first encrypted data value refers to the implementation process of steps S103 to S105; the process of obtaining the second encrypted data value from the first ciphertext data value refers to the encryption process of step S107; here will not be repeated.
[0065] Step S204: The second encrypted data value is decrypted by using the preset first homomorphic key to obtain the corresponding second decrypted data value. The specific decryption process refers to the decryption process in step S107, which will not be repeated here. Wherein, the obtained in step S107 is the second decrypted data value.
[0066] Step S205: According to the second decrypted data value and the user feature data, the corresponding second ciphertext update gradient value is calculated, and the second ciphertext update gradient value is salted and processed to update the corresponding second gradient in the longitudinal logistic regression algorithm.
[0067] Specifically, according to formula (6), the corresponding second ciphertext update gradient value is calculated by the following formula:
[0068]
[0069] in, This indicates that the second ciphertext updates the gradient value; m represents the sample size. Indicates X B Perform transpose processing.
[0070] The method for training a longitudinal logistic regression model with third-party privacy computation provided in this invention utilizes exchangeable homomorphic encryption to successfully eliminate the requirement of a "trusted third party," thus resolving security risks caused by potential collusion from third parties. Since both parties involved in the computation actually possess the data, the cost of performing the computation can be better estimated, avoiding wasted computing power. Therefore, by using exchangeable homomorphic encryption for intermediate computation steps and value exchange in real time, this invention reduces the risk of data leakage.
[0071] As an optional implementation of this invention, step S205 includes: combining the second ciphertext update gradient value and the second preset random number and sending it to the data requester so that the data requester decrypts the combination formed by the second ciphertext update gradient value and the second preset random number to obtain the corresponding third decrypted data value; processing the third decrypted data value to obtain the corresponding second gradient value and updating the corresponding second gradient in the longitudinal logistic regression algorithm according to the second gradient value.
[0072] Specifically, the gradient value of the second ciphertext is salted: Where r1 represents a random number known only to the data source. Send it to the corresponding data requester for decryption to obtain dw B +r1, then the data requester receives the dw B After adding r1, removing the random number r1 yields the corresponding gradient value dw. B And simultaneously utilize this gradient value dw B Update the second gradient w in the longitudinal logistic regression algorithm. B By using salt, the leakage prevention of intermediate steps was ensured.
[0073] This invention also provides a training device for a longitudinal logistic regression model with privacy-preserving computation without third-party intervention, such as... Figure 3 As shown, the device includes:
[0074] The first obtaining module 301 is configured to obtain first user feature data in privacy calculation and calculate a corresponding first data value according to the first user feature data. For details, refer to the related description of step S101 in the method embodiments.
[0075] The first receiving module 302 is configured to receive a first encrypted data value sent by a data source party. The first encrypted data value is obtained by the data source party by preprocessing and encrypting second user feature data corresponding to a data use request initiated by a data demand party according to the data use request. For details, refer to the related description of step S102 in the method embodiments.
[0076] The first computing module 303 is configured to calculate a corresponding target encrypted data value according to the first data value and the first encrypted data value. For details, refer to the related description of step S103 in the method embodiments.
[0077] The second computing module 304 is configured to calculate a corresponding first ciphertext prediction value by using a preset longitudinal logistic regression algorithm based on federated learning on the target encrypted data value. For details, refer to the related description of step S104 in the method embodiments.
[0078] The third computing module 305 is configured to calculate a first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm according to the first ciphertext prediction value and a target label variable, and calculate a corresponding first ciphertext update gradient value according to the first ciphertext data value. For details, refer to the related description of step S105 in the method embodiments.
[0079] The first processing module 306 is configured to update a corresponding first gradient in the longitudinal logistic regression algorithm after salt processing of the first ciphertext update gradient value. For details, refer to the related description of step S106 in the method embodiments.
[0080] The second processing module 307 is configured to, after updating the first gradient, encrypt the first ciphertext data value according to a preset first homomorphic key to obtain a corresponding second encrypted data value, and send the second encrypted data value to the data source party so that the data source party decrypts the second encrypted data value by using the preset first homomorphic key. For details, refer to the related description of step S107 in the method embodiments.
[0081] The longitudinal logistic regression model training device under privacy calculation without a third party provided by the embodiment of the present application successfully removes the requirement of a "trusted third party" by using the commutative homomorphic encryption means, solves the security hidden dangers caused by the potential collusion risks of the third party, and the like; both parties participating in the calculation are the two parties actually owning the data, the cost required for implementing the calculation can be better estimated, and the waste of computing power and the like is avoided. Therefore, by using the real-time present application, the commutative homomorphic encryption means is used for the calculation and exchange of values in the intermediate steps, the risk of data leakage is reduced; the salted means is also used to ensure the non-leakage of the intermediate steps.
[0082] As an optional implementation manner of the embodiment of the present application, the first processing module comprises: a first decryption submodule, configured to combine the first ciphertext update gradient value and a first preset random number, and send the combination to the data source party, so that the data source party decrypts the combination formed by the first ciphertext update gradient value and the first preset random number to obtain a corresponding first decryption data value; and a first updating submodule, configured to process the first decryption data value to obtain a corresponding first gradient value, and update a corresponding first gradient in the longitudinal logistic regression algorithm according to the first gradient value.
[0083] As an optional implementation manner of the embodiment of the present application, the second calculation module comprises: a fitting module, configured to fit an activation function in the longitudinal logistic regression algorithm by using a preset polynomial function to obtain a corresponding preset federated learning-based longitudinal logistic regression algorithm; and a first calculation submodule, configured to calculate the target encrypted data value by using the preset federated learning-based longitudinal logistic regression algorithm to obtain a corresponding first ciphertext prediction value.
[0084] The function description of the longitudinal logistic regression model training device under privacy calculation without a third party provided by the embodiment of the present application is described in detail in the method for training a longitudinal logistic regression model under privacy calculation without a third party described in the above embodiment.
[0085] The embodiment of the present application further provides a longitudinal logistic regression model training device under privacy calculation without a third party, as shown in Figure 4 The device comprises:
[0086] The third processing module 401 is configured to, when the data usage request sent by the data demand party is acquired, pre-process the second user feature data corresponding to the data usage request to obtain a corresponding second data value; for details, refer to the related description of step S201 in the method embodiment.
[0087] The first encryption module 402 is configured to encrypt the second data value according to a preset second homomorphic key to obtain a corresponding first encrypted data value, and send the first encrypted data value to a corresponding data demander. For details, refer to the related description of step S202 in the method embodiment.
[0088] The second receiving module 403 is configured to receive a second encrypted data value sent by the data demander, where the second encrypted data value is obtained by encrypting a first ciphertext data value used for gradient calculation in the vertical logistic regression algorithm by the data demander according to a preset first homomorphic encryption public key, and the first ciphertext data value is obtained by processing the first encrypted data value by the data demander. For details, refer to the related description of step S203 in the method embodiment.
[0089] The second decryption module 404 is configured to decrypt the second encrypted data value by using the preset first homomorphic key to obtain a corresponding second decrypted data value. For details, refer to the related description of step S204 in the method embodiment.
[0090] The updating module 405 is configured to calculate a corresponding second ciphertext update gradient value according to the second decrypted data value and the user feature data, and update a corresponding second gradient in the vertical logistic regression algorithm after salt processing of the second ciphertext update gradient value. For details, refer to the related description of step S205 in the method embodiment.
[0091] The vertical logistic regression model training device under privacy calculation without a third party provided by the embodiment of the application successfully removes the requirement of a "trusted third party" by using the exchangeable homomorphic encryption means, solves the security hidden dangers caused by the potential collusion risks of the third party, and the like, and both parties participating in the calculation are the two parties actually owning the data, so that the cost required for implementing the calculation can be better estimated, and the waste of computing power and the like can be avoided. Therefore, by using the real-time application, the exchangeable homomorphic encryption means is used for the calculation and exchange of numerical values in the intermediate steps, and the risk of data leakage is reduced.
[0092] As an optional implementation manner of the embodiment of the application, the updating module includes: a second decryption submodule configured to combine the second ciphertext update gradient value and a second preset random number, and send the combination to the data demander, so that the data demander decrypts the combination of the second ciphertext update gradient value and the second preset random number to obtain a corresponding third decrypted data value; and a second updating submodule configured to process the third decrypted data value to obtain a corresponding second gradient value, and update a corresponding second gradient in the vertical logistic regression algorithm according to the second gradient value.
[0093] The function description of the device for training a longitudinal logistic regression model under third-party privacy calculation provided by the embodiments of the present application is described in detail in the method for training a longitudinal logistic regression model under third-party privacy calculation described in the above embodiments.
[0094] The embodiments of the present application also provide a storage medium, such as Figure 5 as shown, which stores a computer program 501, and the instructions are executed by a processor to implement the steps of the method for training a longitudinal logistic regression model under third-party privacy calculation described in the above embodiments. The storage medium also stores audio and video stream data, feature frame data, interactive request signaling, encrypted data, and a preset data size, etc. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above types of memories.
[0095] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above types of memories.
[0096] The embodiments of the present application also provide an electronic device, such as Figure 6 as shown, which can include a processor 61 and a memory 62, wherein the processor 61 and the memory 62 can be connected by a bus or other means, Figure 6 for example, by a bus connection.
[0097] Processor 61 can be a central processing unit (CPU). Processor 61 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0098] The memory 62, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the corresponding program instructions / modules in the embodiments of the present invention. The processor 61 executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory 62, thereby implementing the longitudinal logistic regression model training method under privacy-preserving computation without third parties in the above method embodiments.
[0099] The memory 62 may include a program storage area and a data storage area. The program storage area may store applications required for operating the device and at least one function; the data storage area may store data created by the processor 61, etc. Furthermore, the memory 62 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 62 may optionally include memory remotely located relative to the processor 61, and these remote memories may be connected to the processor 61 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0100] The one or more modules are stored in the memory 62, and when executed by the processor 61, they perform the following: Figure 1 -2 shows the method for training a longitudinal logistic regression model with privacy-preserving computation without third-party intervention.
[0101] For specific details regarding the aforementioned electronic devices, please refer to the relevant documentation. Figures 1-2 The relevant descriptions and effects in the illustrated embodiments are for understanding purposes only and will not be repeated here.
[0102] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for training a longitudinal logistic regression model with privacy-preserving computation without third-party intervention, characterized in that, Includes the following steps: Obtain the first user feature data in the privacy calculation and calculate the corresponding first data value based on the first user feature data; The first encrypted data value is received from the data source party. The first encrypted data value is obtained by the data source party preprocessing and encrypting the second user feature data corresponding to the data use request based on the data use request initiated by the data request party. The corresponding target encrypted data value is calculated based on the first data value and the first encrypted data value; The target encrypted data value is calculated using a preset federated learning-based longitudinal logistic regression algorithm to obtain the corresponding first ciphertext prediction value. The preset federated learning-based longitudinal logistic regression algorithm is obtained by fitting the activation function in the longitudinal logistic regression algorithm with a preset polynomial function. The first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm is calculated based on the first ciphertext prediction value and the target label variable, and the corresponding first ciphertext update gradient value is calculated based on the first ciphertext data value. After salting the gradient value of the first ciphertext, update the corresponding first gradient in the longitudinal logistic regression algorithm; After the first gradient is updated, the first ciphertext data value is encrypted according to the preset first homomorphic key to obtain the corresponding second encrypted data value, and the second encrypted data value is sent to the data source so that the data source can decrypt the second encrypted data value using the preset first homomorphic key. The step of updating the first gradient in the longitudinal logistic regression algorithm after salting the first ciphertext gradient value includes: The first ciphertext update gradient value and the first preset random number are combined and sent to the data source so that the data source can decrypt the combination formed by the first ciphertext update gradient value and the first preset random number to obtain the corresponding first decrypted data value. The first preset random number is a random number that only the data requester knows. The first decrypted data value is processed to obtain the corresponding first gradient value, and the corresponding first gradient in the longitudinal logistic regression algorithm is updated according to the first gradient value.
2. The method according to claim 1, characterized in that, The step of using a preset longitudinal logistic regression algorithm based on federated learning to calculate the corresponding first ciphertext prediction value for the target encrypted data value includes: By fitting the activation function in the longitudinal logistic regression algorithm with a pre-defined polynomial function, the corresponding pre-defined longitudinal logistic regression algorithm based on federated learning is obtained. The first ciphertext prediction value is calculated by using the preset longitudinal logistic regression algorithm based on federated learning to the target encrypted data value.
3. A method for training a longitudinal logistic regression model with privacy-preserving computation without third-party intervention, characterized in that, Includes the following steps: When a data usage request is received from a data requester, the second user feature data corresponding to the data usage request is preprocessed to obtain the corresponding second data value. The second data value is encrypted according to the preset second homomorphic key to obtain the corresponding first encrypted data value, and the first encrypted data value is sent to the corresponding data requester. The system receives a second encrypted data value sent by the data requester. The second encrypted data value is obtained by encrypting a first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm by the data requester using a preset first homomorphic key. The first ciphertext data value is used for gradient calculation in the longitudinal logistic regression algorithm and is calculated by the data requester based on the first ciphertext prediction value and the target label variable. The first ciphertext prediction value is calculated by using a preset federated learning-based longitudinal logistic regression algorithm to calculate the target encrypted data value corresponding to the first encrypted data value. The preset federated learning-based longitudinal logistic regression algorithm is obtained by fitting the activation function in the longitudinal logistic regression algorithm with a preset polynomial function. The second encrypted data value is decrypted using the preset first homomorphic key to obtain the corresponding second decrypted data value; The corresponding second ciphertext update gradient value is calculated based on the second decrypted data value and the user feature data. After salting the second ciphertext update gradient value, the corresponding second gradient in the longitudinal logistic regression algorithm is updated. The step of updating the second gradient in the longitudinal logistic regression algorithm after salting the gradient value of the second ciphertext includes: The second ciphertext update gradient value and the second preset random number are combined and sent to the data requester so that the data requester can decrypt the combination formed by the second ciphertext update gradient value and the second preset random number to obtain the corresponding third decrypted data value. The third decrypted data value is processed to obtain the corresponding second gradient value, and the corresponding second gradient in the longitudinal logistic regression algorithm is updated according to the second gradient value.
4. A training device for a longitudinal logistic regression model with privacy-preserving computation without third-party intervention, characterized in that, include: The first acquisition module is used to acquire first user feature data in privacy computing and calculate the corresponding first data value based on the first user feature data. The first receiving module is used to receive a first encrypted data value sent by the data source party. The first encrypted data value is obtained by the data source party preprocessing and encrypting the second user feature data corresponding to the data use request based on the data use request initiated by the data request party. The first calculation module is used to calculate the corresponding target encrypted data value based on the first data value and the first encrypted data value. The second calculation module is used to calculate the corresponding first ciphertext prediction value by using a preset longitudinal logistic regression algorithm based on federated learning to calculate the target encrypted data value. The preset longitudinal logistic regression algorithm based on federated learning is obtained by fitting the activation function in the longitudinal logistic regression algorithm with a preset polynomial function. The third calculation module is used to calculate the first ciphertext data value for gradient calculation in the longitudinal logistic regression algorithm based on the first ciphertext prediction value and the target label variable, and to calculate the corresponding first ciphertext update gradient value based on the first ciphertext data value. The first processing module is used to update the first gradient in the longitudinal logistic regression algorithm after salting the first ciphertext update gradient value. The second processing module is used to, after updating the first gradient, encrypt the first ciphertext data value according to the preset first homomorphic key to obtain the corresponding second encrypted data value, and send the second encrypted data value to the data source so that the data source can decrypt the second encrypted data value using the preset first homomorphic key. The first processing module includes: The first decryption submodule is used to combine the first ciphertext update gradient value and the first preset random number and send them to the data source so that the data source can decrypt the combination formed by the first ciphertext update gradient value and the first preset random number to obtain the corresponding first decrypted data value. The first preset random number is a random number that only the data requester knows. The first update submodule is used to process the first decrypted data value to obtain the corresponding first gradient value and update the corresponding first gradient in the longitudinal logistic regression algorithm according to the first gradient value.
5. The apparatus according to claim 4, characterized in that, The first processing module includes: The first calculation submodule is used to calculate the corresponding first ciphertext update gradient value based on the first ciphertext data value. The first decryption submodule is used to combine the first ciphertext update gradient value and the first preset random number and send them to the data source so that the data source can decrypt the combination formed by the first ciphertext update gradient value and the first preset random number to obtain the corresponding first decrypted data value. The first update submodule is used to process the first decrypted data value to obtain the corresponding first gradient value and update the corresponding first gradient in the longitudinal logistic regression algorithm according to the first gradient value.
6. A training device for a longitudinal logistic regression model under privacy-preserving computation without third-party intervention, characterized in that, include: The third processing module is used to preprocess the second user feature data corresponding to the data usage request to obtain the corresponding second data value when a data usage request is received from the data requester. The first encryption module is used to encrypt the second data value according to the preset second homomorphic key to obtain the corresponding first encrypted data value and send the first encrypted data value to the corresponding data requester; The second receiving module is used to receive the second encrypted data value sent by the data requester. The second encrypted data value is obtained by the data requester encrypting the first ciphertext data value used for gradient calculation in the longitudinal logistic regression algorithm according to the preset first homomorphic key. The first ciphertext data value is used for gradient calculation in the longitudinal logistic regression algorithm and is calculated by the data requester based on the first ciphertext prediction value and the target label variable. The first ciphertext prediction value is calculated by the data requester using the preset longitudinal logistic regression algorithm based on federated learning to calculate the target encrypted data value corresponding to the first encrypted data value. The preset longitudinal logistic regression algorithm based on federated learning is obtained by fitting the activation function in the longitudinal logistic regression algorithm with a preset polynomial function. The second decryption module is used to decrypt the second encrypted data value using the preset first homomorphic key to obtain the corresponding second decrypted data value; The update module is used to calculate the corresponding second ciphertext update gradient value based on the second decrypted data value and the user feature data, and to update the corresponding second gradient in the longitudinal logistic regression algorithm after salting the second ciphertext update gradient value. The update module includes: The second decryption submodule is used to combine the second ciphertext update gradient value and the second preset random number and send them to the data requester so that the data requester can decrypt the combination formed by the second ciphertext update gradient value and the second preset random number to obtain the corresponding third decrypted data value. The second update submodule is used to process the third decrypted data value to obtain the corresponding second gradient value and update the corresponding second gradient in the longitudinal logistic regression algorithm according to the second gradient value.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the longitudinal logistic regression model training method under privacy-free computation as described in any one of claims 1-3.
8. An electronic device, characterized in that, include: The system includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the longitudinal logistic regression model training method under privacy-free computation as described in any one of claims 1-3.
Citation Information
Patent Citations
Security federated learning logistic regression algorithm
CN112613618A