Longitudinal logistic regression training method and device and electronic equipment

Through a vertical logistic regression training method that encrypts the predicted values ​​of the logistic regression model under the federated learning framework, the problem of data privacy protection in federated learning is solved, and the security and effectiveness of data privacy are achieved.

CN119623668APending Publication Date: 2025-03-14AISINO CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411650565.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Under the federated learning framework, how to protect the data privacy of all participants has become an urgent problem.

Method used

Through a vertical logistic regression training method, the model predicted values ​​are encrypted using the respective public keys of the aggregation party and the participant, and the ciphertext is generated, and mathematical operations are performed without decryption to obtain gradient information, thereby performing model iteration.

Benefits of technology

It ensures that information will not be tampered with or leaked during data transmission, ensures data privacy and significantly enhances the security of private data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623668A_ABST
    Figure CN119623668A_ABST
Patent Text Reader

Abstract

The invention discloses a longitudinal logistic regression training method and device and electronic equipment, relates to the technical field of data processing, and is used for improving data privacy security in a longitudinal logistic regression training process. The method comprises the following steps: obtaining a first model prediction value obtained by an aggregation party according to a first data set corresponding to the aggregation party, and obtaining second model prediction values obtained by N participants according to second data sets corresponding to the participants; encrypting the first model predicted value by using a first public key corresponding to the aggregation party to obtain a first ciphertext, and encrypting the second model predicted value by using second public keys corresponding to the N participants to obtain a second ciphertext; and obtaining a first gradient according to the first ciphertext and the second ciphertext, and carrying out iteration on the model according to the first gradient until the iteration of the model is completed. Through the method, the data can be encrypted and transmitted during data transmission, and the operation can be completed without decrypting the data, so that the data cannot be leaked or tampered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a longitudinal logistic regression training method, device and electronic equipment. Background Art

[0002] Logistic regression is a commonly used machine learning model that is widely used in various fields. However, due to privacy security, industry competition and other reasons, the data used for model training is often scattered among various organizations, thus forming "data islands" and limiting the use and value of data. Based on this, the birth of Federated Machine Learning enables data exchange between multiple data sources, thereby avoiding the creation of "data islands".

[0003] Furthermore, under the federated learning framework, the application of logistic regression models becomes possible. Logistic regression models can be trained based on the federated learning framework using data provided by all parties. However, under the federated learning framework, how to protect the data privacy of all participants has become an urgent problem that needs to be solved. Summary of the invention

[0004] The embodiments of the present application provide a longitudinal logistic regression training method, device and electronic device to improve the privacy data security of each participant in the longitudinal logistic regression training and ensure that the model prediction value and gradient information during the training process will not be easily leaked.

[0005] In a first aspect, the present application provides a longitudinal logistic regression training method, the method comprising:

[0006] Obtain the first model prediction value obtained by the aggregator according to the first data set corresponding to itself, and the second model prediction value obtained by each of the N participants according to the second data set corresponding to itself; wherein N is a positive integer greater than or equal to 1;

[0007] The first model prediction value is encrypted using a first public key corresponding to the aggregator to obtain a first ciphertext, and the second model prediction value is encrypted using second public keys corresponding to the N participating parties to obtain a second ciphertext;

[0008] A first gradient is obtained according to the first ciphertext and the second ciphertext, and the model is iterated according to the first gradient until the model iteration is completed.

[0009] Through the above method, when each participant interacts with the aggregator, they use the encrypted intermediate calculation results and do not involve the decryption process, thereby ensuring that the information will not be tampered with or leaked during data transmission, thereby ensuring data privacy and security.

[0010] In an optional implementation, before obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself and the second model prediction values ​​obtained by each of the N participants according to the second data set corresponding to itself, it also includes:

[0011] Determine the model training method based on the preset IP array;

[0012] If the number of IP addresses in the IP array is 2, then two-way longitudinal logistic regression training is performed;

[0013] If the number of IP addresses in the IP array is greater than 2, multi-party longitudinal logistic regression training is performed.

[0014] In an optional implementation, obtaining a first gradient according to the first ciphertext and the second ciphertext includes:

[0015] If the model training method is multi-party longitudinal logistic regression training, perform the following operations:

[0016] Divide the second model prediction values ​​corresponding to each of the N participants into first shard values ​​and second shard values ​​respectively;

[0017] Obtain a first aggregate value according to the first shard values ​​corresponding to each of the N participants, and obtain a second aggregate value according to the second shard values ​​corresponding to each of the N participants;

[0018] Obtain a second ciphertext according to the first aggregate value and the second aggregate value;

[0019] A first gradient is obtained according to the first ciphertext and the second ciphertext.

[0020] Through the above method, during multi-party logistic longitudinal regression training, the model prediction values ​​of each N participant are transmitted in segments, ensuring that the model prediction values ​​of each N participant cannot be easily obtained or inferred, significantly enhancing the security of privacy data.

[0021] In an optional implementation, after obtaining the first gradient according to the first ciphertext and the second ciphertext, the method further includes:

[0022] Encrypting the first gradient using the second public keys corresponding to the N participants to obtain a first gradient ciphertext;

[0023] The first gradient ciphertext is sent to the N participants respectively, so that the N participants use their own corresponding first private keys to decrypt the first gradient ciphertext to obtain the first gradient.

[0024] Through the above method, the gradient is encrypted using the second public key corresponding to each of the N participants, so that the confidentiality of the gradient information is further enhanced, and the encrypted gradient value cannot be easily obtained.

[0025] In a second aspect, the present application provides a longitudinal logistic regression training device, the device comprising:

[0026] An acquisition module, used to acquire a first model prediction value obtained by the aggregator according to its corresponding first data set, and a second model prediction value obtained by each of the N participants according to its corresponding second data set; wherein N is a positive integer greater than or equal to 1;

[0027] An encryption module, used to encrypt the first model prediction value using a first public key corresponding to the aggregator to obtain a first ciphertext, and to encrypt the second model prediction value using a second public key corresponding to the N participating parties to obtain a second ciphertext;

[0028] The processing module is used to obtain a first gradient according to the first ciphertext and the second ciphertext, and iterate the model according to the first gradient until the model iteration is completed.

[0029] In an optional implementation, before obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself and the second model prediction values ​​obtained by each of the N participants according to the second data set corresponding to itself, the processing module is further used to:

[0030] Determine the model training method based on the preset IP array;

[0031] If the number of IP addresses in the IP array is 2, then two-way longitudinal logistic regression training is performed;

[0032] If the number of IP addresses in the IP array is greater than 2, multi-party longitudinal logistic regression training is performed.

[0033] In an optional implementation, when obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module is further configured to:

[0034] If the model training method is multi-party longitudinal logistic regression training, perform the following operations:

[0035] Divide the second model prediction values ​​corresponding to each of the N participants into first shard values ​​and second shard values ​​respectively;

[0036] Obtain a first aggregate value according to the first shard values ​​corresponding to each of the N participants, and obtain a second aggregate value according to the second shard values ​​corresponding to each of the N participants;

[0037] Obtain a second ciphertext according to the first aggregate value and the second aggregate value;

[0038] A first gradient is obtained according to the first ciphertext and the second ciphertext.

[0039] In an optional implementation, after obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module is further configured to:

[0040] The first gradient is encrypted using the second public keys corresponding to the N participants to obtain a first gradient ciphertext;

[0041] The first gradient ciphertext is sent to N participants respectively, so that the N participants use their own corresponding first private keys to decrypt the first gradient ciphertext to obtain the first gradient.

[0042] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the longitudinal logistic regression training method described in the first aspect above.

[0043] In a fourth aspect, the present application provides a computer-readable storage medium comprising a program code. When the program code is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the longitudinal logistic regression training method described in the first aspect above.

[0044] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the longitudinal logistic regression training method as described in the first aspect.

[0045] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0047] Figure 1 A schematic diagram of an implementation flow of a longitudinal logistic regression training method provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of the structure of a longitudinal logistic regression training device provided in an embodiment of the present application;

[0049] Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0051] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A and B are connected, which can represent two situations: A and B are directly connected and A and B are connected through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0052] In addition, the collection, dissemination, and use of data in the technical solution of this application comply with the requirements of relevant national laws and regulations.

[0053] The following is a brief introduction to the design concept of the embodiment of the present application:

[0054] Logistic regression is a commonly used machine learning model that is widely used in various fields. However, due to privacy security, industry competition and other reasons, the data used for model training is often scattered among various organizations, thus forming "data islands" and limiting the use and value of data. Based on this. The birth of federated learning enables data exchange from multiple data sources, thereby avoiding the creation of "data islands".

[0055] Furthermore, under the federated learning framework, the application of logistic regression models becomes possible. Logistic regression models can be trained based on the federated learning framework using data provided by all parties. However, under the federated learning framework, how to protect the data privacy of all participants has become an urgent problem that needs to be solved.

[0056] In view of this, the present application provides a longitudinal logistic regression training method, which includes: first, obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself, and the second model prediction value obtained by each of the N participants according to the second data set corresponding to itself; wherein N is a positive integer greater than or equal to 1; then, encrypting the first model prediction value using the first public key corresponding to the aggregator to obtain the first ciphertext, and encrypting the second model prediction value using the second public key corresponding to the N participants to obtain the second ciphertext; finally, obtaining the first gradient according to the first ciphertext and the second ciphertext, and iterating the model according to the first gradient until the model iteration is completed. Through the above method, mathematical operations can be performed on the encrypted data without decryption, so that each participant can perform model prediction and gradient calculation without exposing the original data, thereby ensuring the privacy and security of the data.

[0057] The longitudinal logistic regression training method provided by the exemplary embodiment of the present application is described below with reference to the accompanying drawings.

[0058] See also Figure 1 As shown, it is a schematic diagram of the implementation process of a longitudinal logistic regression training method provided in an embodiment of the present application. The specific implementation process of the method is as follows:

[0059] S1: Obtain a first model prediction value obtained by the aggregator according to its corresponding first data set, and a second model prediction value obtained by each of the N participants according to its corresponding second data set.

[0060] In the embodiment of the present application, N is a positive integer greater than or equal to 1. For example, when N is 1, this training is a two-way longitudinal logistic regression training, and when N is 2 or more, this training is a multi-way longitudinal logistic regression training.

[0061] In an optional implementation, first, a training method of the model is determined according to a preconfigured IP array.

[0062] Specifically, the IP addresses of all participants in this logistic regression training are stored in the IP array. Therefore, if the number of IP addresses in the IP array is 2, a two-party longitudinal logistic regression training is performed this time; if the number of IP addresses in the IP array is greater than 2, for example, 3 IP addresses are stored in the IP array, a multi-party longitudinal logistic regression training is performed this time.

[0063] When conducting multi-party longitudinal logistic regression training, the first participant needs to communicate with all other participants. Therefore, the IP addresses of all participants except the first participant are added to the IP array to achieve communication between the first participant and other participants. The second participant needs to communicate with the aggregator and the third participant, so the IP addresses of the aggregator and the third participant are added to the IP array corresponding to the second participant. In addition, there is a third participant who needs to communicate with the first participant, so the IP address of the first participant is added to the IP array corresponding to the third participant.

[0064] Furthermore, in an embodiment of the present application, first, a first model prediction value obtained by the aggregator according to its corresponding first data set is obtained.

[0065] Specifically, when performing the first round of longitudinal logistic regression training, the aggregator and each participant first create a blank initial model parameter record W. Then, the first round of longitudinal logistic regression training is performed. According to the initially generated global model parameters, the aggregator and each participant use their own local data sets to train the model, thereby obtaining their own gradients. Furthermore, the gradients of the aggregator and each participant are aggregated to obtain an aggregated gradient. For example, the federated average algorithm can be used to aggregate the gradients of the aggregator and each participant to obtain an aggregated gradient.

[0066] When performing non-first round training, the aggregator and each participant use the aggregated gradient to update their own model parameters.

[0067] Specifically, in the embodiment of the present application, the following formula can be used to calculate when updating the model parameters:

[0068] Where W represents the global model parameter, ω represents the learning rate, represents the aggregation gradient.

[0069] Through the above calculation formula, the model parameters can be updated in each round of model training.

[0070] In the embodiment of the present application, when the aggregator obtains the first model prediction value according to the first data set corresponding to itself, the aggregator can apply the global model parameters to the local model after receiving the global model parameters, thereby obtaining an updated local model. At this time, the aggregator can use the updated local model, input the first data set into the updated local model, and apply the forward propagation algorithm of the model to calculate the first model prediction value, thereby outputting the first model prediction value W1X1.

[0071] Similarly, each of the N participants inputs its own corresponding second data into the updated local model, and applies the model's forward propagation algorithm to calculate the second model prediction value, thereby outputting the second model prediction value W2X2 corresponding to each of the N participants.

[0072] S2: Use the first public key corresponding to the aggregating party to encrypt the first model prediction value to obtain a first ciphertext, and use the second public keys corresponding to the N participating parties to encrypt the second model prediction value to obtain a second ciphertext.

[0073] In the embodiment of the present application, the encryption method adopted is a homomorphic encryption method, so as to realize data interaction and calculation between the aggregator and N participating parties in the form of ciphertext, which can ensure longitudinal logistic regression training and also ensure the security of data during the training process.

[0074] Therefore, the aggregator generates a first public key and a first private key, and the N participants generate a second public key and a second private key respectively. In addition, the first public key corresponding to the aggregator needs to be sent to the N participants respectively, and the second public keys corresponding to the N participants need to be sent to the aggregator respectively.

[0075] Furthermore, the aggregator uses its own corresponding first public key to encrypt the first model prediction value to obtain a first ciphertext ‖W1X1‖, and then sends the first ciphertext to the N participants respectively.

[0076] Furthermore, the second public key pairs corresponding to the N participants are used to encrypt the second model prediction values ​​corresponding to the N participants respectively, so as to obtain the second ciphertext ‖W2X2‖ corresponding to the N participants.

[0077] S3: Obtain a first gradient according to the first ciphertext and the second ciphertext, and iterate the model according to the first gradient until the model iteration is completed.

[0078] In an embodiment of the present application, after obtaining the first ciphertext corresponding to the aggregating party and the second ciphertext corresponding to each of the N participating parties, a homomorphic encryption algorithm (e.g., the Paillier algorithm) is used to perform ciphertext aggregation on the first ciphertext corresponding to the aggregating party and the second ciphertext corresponding to each of the N participating parties. The Paillier algorithm has the properties of additive homomorphism and multiplicative homomorphism, and can perform ciphertext aggregation on encrypted data, and obtain their sum without decrypting a single predicted value, thereby realizing aggregate calculation of encrypted data while protecting data privacy.

[0079] In the embodiment of the present application, the aggregation result of the first ciphertext and the second ciphertext is recorded as ‖Z‖. Further, the aggregator decrypts ‖Z‖ with its corresponding first private key to obtain a plaintext result, and uses the plaintext result and the local true value for gradient descent training.

[0080] Specifically, during gradient descent training, the decrypted plaintext result and the local true value are used to calculate the loss function, and the gradient is calculated according to the loss function to obtain the first gradient Then, the second public key corresponding to each of the N participants is used to Encryption is performed to obtain the encrypted first gradient Then the encrypted second gradient Sent to N participants, each of whom receives the second gradient When the second gradient Decryption is performed so that each of the N participants obtains the final first gradient

[0081] In an optional implementation, if the model is trained using multi-party longitudinal logistic regression training, the following operations are performed:

[0082] First, the second model prediction values ​​corresponding to each of the N participants are divided into first shard values ​​and second shard values;

[0083] Then, a first aggregate value is obtained according to the first shard values ​​corresponding to each of the N participants, and a second aggregate value is obtained according to the second shard values ​​corresponding to each of the N participants;

[0084] Secondly, obtain a second ciphertext according to the first aggregate value and the second aggregate value;

[0085] Finally, a first gradient is obtained according to the first ciphertext and the second ciphertext.

[0086] Specifically, in the embodiment of the present application, the second data corresponding to the N participants are respectively input into the updated local model, and the forward propagation algorithm of the model is applied to calculate the second model prediction value, thereby outputting the second model prediction value W2X2 corresponding to each of the N participants. Then, the second model prediction value corresponding to each of the N participants is divided into the first fragment value W 1 X 1 and the second fragment value W 2 X 2 .

[0087] Specifically, when dividing the second model prediction value, the second model prediction value can be divided into the first slice value and the second slice value by random division. For example, if the second model prediction value is 3, the first slice value is randomly divided into 1.2 and the second slice value is 1.8, so that the sum of the first slice value and the second slice value is equal to the second model prediction value.

[0088] Then, the first participant other than the aggregator will assign its corresponding first shard value Sent to the aggregator, and the second fragment value Send to the next participant.

[0089] Shard aggregator 1 first creates an empty record Z part1 , then the first slice value With Z part1 Merge and get the updated Z part1 .

[0090] Similarly, the second participant will set its corresponding first shard value Sent to the aggregator, after receiving the second shard value sent by the first participant When the second fragment value of itself Merge to get And send it to the next participant. At the same time, shard aggregator 1 merges the first shard value The updated Z obtained last time part1 , and get the updated Z again part1 , which is the first aggregation value in the embodiment of the present application.

[0091] Furthermore, shard aggregator 2 sets the first shard value corresponding to itself Send it to the aggregator and send its second shard value and Merge to obtain and will Recorded as Z part2 , which is the second aggregation value in the embodiment of the present application.

[0092] Furthermore, the last updated Z part1 With Z part2 The first ciphertext is obtained by encrypting the first model prediction value obtained by the aggregator according to the first data set corresponding to the aggregator.

[0093] After obtaining the first ciphertext and the second ciphertext, the first ciphertext and the second ciphertext can be aggregated to obtain the aggregated result Z. Then, the aggregated result Z is used with the local true value for gradient descent training to obtain the first gradient

[0094] In an optional implementation, after obtaining the first gradient, the first gradient may be encrypted using the second public key corresponding to each of the N participants to obtain the first gradient ciphertext Then the encrypted first gradient ciphertext can be Sent to N participants, each of whom receives the first gradient ciphertext When the first gradient ciphertext is Decryption is performed so that each of the N participants obtains the final first gradient

[0095] The model is iterated through the first gradient until the model iteration is completed. When performing model iteration, corresponding training termination conditions can be set, such as the model achieving the desired effect, reaching a preset number of iterations, or reaching the longest training time.

[0096] Further, based on the same technical concept, the embodiment of the present application provides a longitudinal logistic regression training device, which is used to implement the above method flow of the embodiment of the present application. Figure 2 As shown, the device includes: an acquisition module 201, an encryption module 202, and a processing module 203, wherein:

[0097] The acquisition module 201 is used to acquire the first model prediction value obtained by the aggregator according to the first data set corresponding to itself, and the second model prediction value obtained by each of the N participants according to the second data set corresponding to itself; wherein N is a positive integer greater than or equal to 1;

[0098] The encryption module 202 is used to encrypt the first model prediction value using the first public key corresponding to the aggregator to obtain a first ciphertext, and to encrypt the second model prediction value using the second public keys corresponding to the N participating parties to obtain a second ciphertext;

[0099] The processing module 203 is used to obtain a first gradient according to the first ciphertext and the second ciphertext, and iterate the model according to the first gradient until the model iteration is completed.

[0100] In an optional implementation, in an optional implementation, before obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself and the second model prediction values ​​obtained by each of the N participants according to the second data set corresponding to itself, the processing module 203 is further used to:

[0101] Determine the model training method based on the preset IP array;

[0102] If the number of IP addresses in the IP array is 2, then two-way longitudinal logistic regression training is performed;

[0103] If the number of IP addresses in the IP array is greater than 2, multi-party longitudinal logistic regression training is performed.

[0104] In an optional implementation, when obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module is further configured to:

[0105] If the model training method is multi-party longitudinal logistic regression training, perform the following operations:

[0106] Divide the second model prediction values ​​corresponding to each of the N participants into first shard values ​​and second shard values ​​respectively;

[0107] Obtain a first aggregate value according to the first shard values ​​corresponding to each of the N participants, and obtain a second aggregate value according to the second shard values ​​corresponding to each of the N participants;

[0108] Obtain a second ciphertext according to the first aggregate value and the second aggregate value;

[0109] A first gradient is obtained according to the first ciphertext and the second ciphertext.

[0110] In an optional implementation, after obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module 203 is further configured to:

[0111] The first gradient is encrypted using the second public keys corresponding to the N participants to obtain a first gradient ciphertext;

[0112] The first gradient ciphertext is sent to N participants respectively, so that the N participants use their own corresponding first private keys to decrypt the first gradient ciphertext to obtain the first gradient.

[0113] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which can implement the longitudinal logistic regression training method provided in the above embodiment of the present application. In one embodiment, the electronic device can be a server, or a terminal device or other electronic device. Figure 3 As shown, the electronic device may include:

[0114] At least one processor 301, and a memory 302 connected to the at least one processor 301. The specific connection medium between the processor 301 and the memory 302 is not limited in the embodiment of the present application. Figure 3 In the example, the processor 301 and the memory 302 are connected via the bus 300. The bus 300 is Figure 3 The bus 300 is represented by a bold line, and the connection between other components is only for schematic illustration and is not intended to be limiting. The bus 300 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 301 can also be called a controller, and there is no limitation on the name.

[0115] In the embodiment of the present application, the memory 302 stores instructions that can be executed by at least one processor 301. The at least one processor 301 can execute a longitudinal logistic regression training method discussed above by executing the instructions stored in the memory 302. The processor 301 can implement Figure 2 The functions of each module in the device shown.

[0116] Among them, the processor 301 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 302 and calling data stored in the memory 302, the various functions of the device and process data, the device can be monitored as a whole.

[0117] In one possible design, the processor 301 may include one or more processing units, and the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 301. In some embodiments, the processor 301 and the memory 302 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0118] Processor 301 can be a general-purpose processor, such as a CPU, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of a longitudinal logistic regression training method disclosed in the embodiments of the present application can be directly embodied as a hardware processor execution, or a combination of hardware and software modules in the processor.

[0119] The memory 302 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 302 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 302 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 302 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0120] By programming the processor 301, the code corresponding to the frequency offset estimation method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 1 The steps of a longitudinal logistic regression training method in the embodiment shown are as follows: How to design and program the processor 301 is a technique known to those skilled in the art and will not be described in detail here.

[0121] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes a longitudinal logistic regression training method discussed above.

[0122] In some possible embodiments, the present application also provides various aspects of a longitudinal logistic regression training method, which can also be implemented in the form of a program product, which includes a program code. When the program product is run on an apparatus, the program code is used to enable the control device to execute the steps of a longitudinal logistic regression training method according to various exemplary embodiments of the present application described above in this specification.

[0123] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0124] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0125] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0126] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a server, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] Program code for performing the operations of the present application may be written using any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0129] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A longitudinal logistic regression training method, characterized in that: The method comprises: Obtain the first model prediction value obtained by the aggregator according to the first data set corresponding to itself, and the second model prediction value obtained by each of the N participants according to the second data set corresponding to itself; wherein N is a positive integer greater than or equal to 1; Encrypting the first model prediction value using the first public key corresponding to the aggregator to obtain a first ciphertext, and encrypting the second model prediction value using the second public keys corresponding to the N participating parties to obtain a second ciphertext; A first gradient is obtained according to the first ciphertext and the second ciphertext, and a model is iterated according to the first gradient until the model iteration is completed.

2. The method according to claim 1, characterized in that Before obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself and the second model prediction values ​​obtained by each of the N participants according to the second data set corresponding to itself, the method further includes: Determine the model training method based on the preset IP array; If the number of IP addresses in the IP array is 2, then two-way longitudinal logistic regression training is performed; If the number of IP addresses in the IP array is greater than 2, multi-party longitudinal logistic regression training is performed.

3. The method according to claim 1, characterized in that The obtaining a first gradient according to the first ciphertext and the second ciphertext includes: If the model training method is multi-party longitudinal logistic regression training, perform the following operations: Divide the second model prediction values ​​corresponding to each of the N participants into first shard values ​​and second shard values ​​respectively; Obtaining a first aggregate value according to the first shard values ​​corresponding to the N participants, and obtaining a second aggregate value according to the second shard values ​​corresponding to the N participants; Obtaining the second ciphertext according to the first aggregate value and the second aggregate value; The first gradient is obtained according to the first ciphertext and the second ciphertext.

4. The method according to claim 1, characterized in that After obtaining the first gradient according to the first ciphertext and the second ciphertext, the method further includes: Encrypting the first gradient using the second public keys corresponding to the N participants to obtain a first gradient ciphertext; The first gradient ciphertext is sent to N participants respectively, so that the N participants use their own corresponding first private keys to decrypt the first gradient ciphertext to obtain the first gradient.

5. A longitudinal logistic regression training device, characterized in that: The device comprises: An acquisition module, used to acquire a first model prediction value obtained by the aggregator according to its corresponding first data set, and a second model prediction value obtained by each of the N participants according to its corresponding second data set; wherein N is a positive integer greater than or equal to 1; An encryption module, configured to encrypt the first model prediction value using a first public key corresponding to the aggregator to obtain a first ciphertext, and to encrypt the second model prediction value using second public keys corresponding to the N participating parties to obtain a second ciphertext; A processing module is used to obtain a first gradient according to the first ciphertext and the second ciphertext, and iterate the model according to the first gradient until the model iteration is completed.

6. The device according to claim 5, characterized in that Before obtaining the first model prediction value obtained by the aggregator according to the first data set corresponding to itself and the second model prediction values ​​obtained by each of the N participants according to the second data set corresponding to itself, the processing module is further used to: Determine the model training method based on the preset IP array; If the number of IP addresses in the IP array is 2, then two-way longitudinal logistic regression training is performed; If the number of IP addresses in the IP array is greater than 2, multi-party longitudinal logistic regression training is performed.

7. The device according to claim 5, characterized in that When obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module is further used for: If the model training method is multi-party longitudinal logistic regression training, perform the following operations: Divide the second model prediction values ​​corresponding to each of the N participants into first shard values ​​and second shard values ​​respectively; Obtaining a first aggregate value according to the first shard values ​​corresponding to the N participants, and obtaining a second aggregate value according to the second shard values ​​corresponding to the N participants; Obtaining the second ciphertext according to the first aggregate value and the second aggregate value; The first gradient is obtained according to the first ciphertext and the second ciphertext.

8. The device according to claim 5, characterized in that After obtaining the first gradient according to the first ciphertext and the second ciphertext, the processing module is further used for: Encrypting the first gradient using the second public keys corresponding to the N participants to obtain a first gradient ciphertext; The first gradient ciphertext is sent to N participants respectively, so that the N participants use their own corresponding first private keys to decrypt the first gradient ciphertext to obtain the first gradient.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.