Data processing method, device, equipment and storage medium

By encrypting the training results and exchanging feature vectors in the vertical federated learning of the two parties, the problem of participant B data leakage was solved, and the effect of improving the security of participant B data was achieved.

CN113297602BActive Publication Date: 2025-04-11WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110675494.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-17
Publication Date
2025-04-11
Estimated Expiration
2041-06-17

AI Technical Summary

Technical Problem

In both vertical federated learning, participant B’s data (classified tags) were leaked to participant A, resulting in less security in participant B’s data.

Method used

By generating a first random sequence, encrypting the first training result, a first feature vector is obtained, and a second feature vector sent by the second client terminal is received. According to the label information corresponding to the first feature vector, the second feature vector and the first training sample, the intermediate result is determined and the intermediate result is sent to the second client terminal.

Benefits of technology

Since the second client terminal cannot obtain the first random sequence, the intermediate results cannot be decrypted to obtain the tag information and the first training sample, thereby avoiding data leakage in the first client terminal to the second client terminal, and improving the data security of the first client terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113297602B_ABST
    Figure CN113297602B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device, equipment and storage medium, the method comprising: generating a first random sequence, encrypting a first training result according to the first random sequence to obtain a first feature vector; receiving a second feature vector sent by a second client terminal; obtaining an intermediate result according to the first feature vector, the second feature vector and the label information corresponding to the first training sample, and sending the intermediate result to the second client terminal. The data processing method, device, equipment and storage medium disclosed in the present invention can be used to prevent data in a first client terminal from being leaked to a second client terminal, thereby improving the data security of the first client terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology (especially artificial intelligence, federated learning, machine learning, and asynchronous computing), and in particular to a data processing method, device, equipment, and storage medium. Background Art

[0002] Currently, in two-party vertical federated learning, two parties (e.g., including participant A and participant B) can jointly train the model.

[0003] In the related technology, training samples are stored in participant A, and classification labels are stored in participant B. In the process of participants A and B jointly training the model, participant B homomorphically encrypts the classification labels to obtain encrypted classification labels, and sends the encrypted classification labels to participant A. Participant A calculates encrypted gradient values ​​according to the encrypted classification labels, and sends the encrypted gradient values ​​to participant B. Participant B decrypts the encrypted gradient values ​​to obtain gradient values, and sends the gradient values ​​to participant A. Participant A uses the gradient values ​​to update the parameters of the model to achieve joint training of the model.

[0004] In the above training process, if participant A receives the encrypted classification label and then sends it to participant B, participant B uses the private key generated by it to decrypt the encrypted classification label, obtains the classification label, and sends the classification label to participant A, causing participant B's data (classification label) to be leaked to participant A, making participant B's data security lower. Summary of the invention

[0005] The main purpose of the present invention is to provide a data processing method, device, equipment and storage medium, aiming to solve the problem that the data (classification label) of participant B is leaked to participant A, resulting in low data security of participant B.

[0006] To achieve the above-mentioned purpose, the present invention provides a data processing method, which is applied to a first client terminal, and the data processing method includes: generating a first random sequence, encrypting a first training result according to the first random sequence to obtain a first feature vector; the first training result is obtained by processing the first training sample through a first local model of the first client terminal; receiving a second feature vector sent by a second client terminal; the second feature vector is obtained by encrypting the second training result by the second client terminal through a second random sequence, and the second training result is obtained by processing the second training sample through a second local model of the second client terminal; obtaining an intermediate result according to the first feature vector, the second feature vector and the label information corresponding to the first training sample, and sending the intermediate result to the second client terminal; the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result.

[0007] Optionally, an intermediate result is obtained based on the first eigenvector, the second eigenvector and the label information corresponding to the first training sample, including: determining the sum of the first eigenvector and the second eigenvector; determining the difference between the product of the first preset ratio and the sum and the product of the second preset ratio and the label information, and determining it as the intermediate result.

[0008] Optionally, encrypting the first training result according to the first random sequence to obtain the first feature vector includes: determining the sum of the first random sequence and the first training result as the first feature vector.

[0009] Optionally, the method also includes: determining gradient information based on the intermediate results and the first training sample; updating the model parameters of the first local model based on the gradient information to obtain an updated first local model; judging whether the updated first local model converges; if the updated first local model is in a converged state, determining the updated first local model as the final result of the model training.

[0010] Optionally, the method also includes: if the updated first local model is in an unconverged state, repeating the following steps until the first local model converges: regenerating the first random sequence, determining a new first eigenvector based on the regenerated first random sequence, and obtaining a new second eigenvector from the second client terminal, and determining a new intermediate result based on the new first eigenvector and the new second eigenvector to continue updating the parameters of the first local model.

[0011] Optionally, determining the gradient information according to the intermediate result and the first training sample includes: determining the product of the intermediate result and the first training sample as the gradient information.

[0012] Optionally, the first random sequence is a Laplace noise sequence with a mean value of 0, or a Gaussian white noise sequence with a mean value of 0.

[0013] The present invention also provides a data processing device, which is applied to a first client terminal, and the device includes: a generating module, a processing module, a receiving module and a sending module; wherein the generating module is used to generate a first random sequence; the processing module is used to encrypt the first training result according to the first random sequence to obtain a first feature vector; the first training result is obtained by processing the first training sample through the first local model of the first client terminal; the receiving module is used to receive a second feature vector sent by a second client terminal; the second feature vector is obtained by encrypting the second training result by the second client terminal through the second random sequence, and the second training result is obtained by processing the second training sample through the second local model of the second client terminal; the processing module is also used to obtain an intermediate result according to the first feature vector, the second feature vector and the label information corresponding to the first training sample; the sending module is used to send the intermediate result to the second client terminal; the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result.

[0014] Optionally, the processing module is further specifically used to: determine the sum of the first eigenvector and the second eigenvector; determine the difference between the product of the first preset ratio and the sum and the product of the second preset ratio and the label information, and determine it as an intermediate result.

[0015] Optionally, the processing module is specifically used to: determine the sum of the first random sequence and the first training result as the first feature vector.

[0016] Optionally, the processing module is also specifically used to: determine gradient information based on the intermediate results and the first training sample; update the model parameters of the first local model based on the gradient information to obtain an updated first local model; determine whether the updated first local model converges; if the updated first local model is in a converged state, determine the updated first local model as the final result of the model training.

[0017] Optionally, the processing module is also specifically used to: if the updated first local model is in an unconverged state, repeat the following steps until the first local model converges: regenerate the first random sequence, determine a new first eigenvector based on the regenerated first random sequence, obtain a new second eigenvector from the second client terminal, and determine a new intermediate result based on the new first eigenvector and the new second eigenvector to continue updating the parameters of the first local model.

[0018] Optionally, the processing module is further specifically configured to: determine the product of the intermediate result and the first training sample as gradient information.

[0019] Optionally, the first random sequence is a Laplace noise sequence with a mean value of 0, or a Gaussian white noise sequence with a mean value of 0.

[0020] The present invention provides a data processing device, which includes: a memory, a processor, and a data processing program stored in the memory and executable on the processor. When the data processing program is executed by the processor, the steps of any of the above-mentioned data processing methods are implemented.

[0021] The present invention provides a computer-readable storage medium, on which a data processing program is stored. When the data processing program is executed by a processor, the steps of any of the above-mentioned data processing methods are implemented.

[0022] The present invention provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned data processing methods when executed by a processor.

[0023] The data processing method, device, equipment and storage medium provided by the present invention determine the intermediate result by using the first feature vector obtained by encryption processing of the first random sequence, the second feature vector obtained by encryption processing of the second random sequence and the label information corresponding to the first training sample, so that the intermediate result becomes the information obtained by encrypting the label information and the first training sample by the first random sequence and the second random sequence. Furthermore, after the first client terminal sends the intermediate result to the second client terminal, since the second client terminal cannot obtain the first random sequence, it is impossible to decrypt the intermediate result to obtain the label information and the first training sample, thereby avoiding the leakage of data in the first client terminal to the second client terminal, and improving the data security of the first client terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of two-party vertical federated learning provided for an embodiment of the present application;

[0025] Figure 2 Schematic diagram of the data processing method provided in the embodiment of the present application Figure 1 ;

[0026] Figure 3 Schematic diagram of the data processing method provided in the embodiment of the present application Figure 2 ;

[0027] Figure 4 Schematic diagram of the data processing method provided in the embodiment of the present application Figure 3 ;

[0028] Figure 5 A schematic diagram of the structure of a data processing device provided by an embodiment of the present invention;

[0029] Figure 6 A structural schematic diagram of a data processing device provided by an embodiment of the present invention.

[0030] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0031] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0032] Figure 1 A schematic diagram of a two-party vertical federated learning provided in an embodiment of the present application. Figure 1 As shown, it includes: participant A and participant B. Participant A and participant B are different client terminals. Participant A stores training samples. Participant B stores classification labels.

[0033] In the two-party vertical federated learning process, participant B generates a public key and a private key for homomorphic encryption, and uses the public key to homomorphically encrypt the classification label to obtain the encrypted classification label, and sends the encrypted classification label to participant A. Participant A sends the encrypted classification label to participant B, instead of calculating the encrypted gradient value based on the encrypted classification label and sending the encrypted gradient value to participant B. Participant B uses the private key to decrypt the encrypted classification label to obtain the classification label, and sends the classification label to participant A.

[0034] In the above process, participant A sends an encrypted classification label to participant B, so that participant B uses his private key to decrypt the encrypted classification label to obtain the classification label, and sends the classification label to participant A, causing participant B's data (i.e., the classification label) to be leaked to participant A, making participant B's data less secure.

[0035] In the present application, in order to improve the data security of participant B, participant B in the present application receives the feature information sent by participant A after being encrypted by a random sequence, determines the intermediate result based on the feature information and the marking information (equivalent to the classification label), and sends the intermediate result to participant AFASONG. The intermediate result is equivalent to the information encrypted by the random sequence generated by participant A and the random sequence generated by participant B. Since participant A cannot obtain the random sequence generated by participant B, it is also impossible to decode the intermediate result to obtain the marking information, thereby avoiding the leakage of participant B's data to participant A and improving the data security of participant B.

[0036] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0037] Figure 2 Schematic diagram of the data processing method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the method includes:

[0038] S201. Generate a first random sequence, and encrypt a first training result according to the first random sequence to obtain a first feature vector, where the first training result is obtained by processing a first training sample through a first local model of a first client terminal.

[0039] Optionally, the execution subject of the embodiment of the present application is the first client terminal, or it may be a data processing device set in the first client terminal, and the data processing device may be implemented by a combination of software and / or hardware. The first client terminal is usually a client terminal storing label information (equivalent to a label) and a small amount of data, and the small amount of data includes a first training sample.

[0040] Exemplarily, the first random sequence may be generated by a random function, wherein the random function includes a quantity parameter, and the quantity parameter is equal to the total quantity of the multiple random numbers included in the first random sequence.

[0041] Exemplarily, the first random sequence is a Laplace noise sequence with a mean value of 0, or a Gaussian white noise sequence with a mean value of 0.

[0042] In a possible design, the sum of the first random sequence and the first training result is determined as the first feature vector.

[0043] Exemplarily, the first eigenvector is obtained by the following formula 1.

[0044] WX_g=W A X A +R1 Formula 1;

[0045] Among them, WX_g is the first eigenvector, W A X A is the first training result, and R1 is the first random sequence. A X A In, X A is the first training sample, W A are the model parameters (ie, weights) of the first local model.

[0046] Exemplarily, the first local model may be a logistic regression model.

[0047] S202, receiving a second feature vector sent by a second client terminal, where the second feature vector is obtained after the second client terminal encrypts a second training result through a second random sequence, and the second training result is obtained after processing a second training sample through a second local model of the second client terminal.

[0048] The second client terminal is usually a client terminal in which a large amount of data is stored. The large amount of data includes a second training sample. It should be noted that the second training sample and the first training sample are different training samples of the same user.

[0049] Exemplarily, the second client terminal obtains the second feature vector through the following formula 2.

[0050] WX_h=W B X B +R2 Formula 2;

[0051] Among them, WX_h is the second eigenvector, W B X B is the second training result, and R2 is the second random sequence. B X B In, X B is the second training sample, W B are the model parameters (weights) of the second local model.

[0052] Exemplarily, the second random sequence is a Laplace noise sequence with an average value of 0, or a Gaussian white noise sequence with an average value of 0. It should be noted that when the first random sequence is a Laplace noise sequence with an average value of 0, the second random sequence is a Laplace noise sequence with an average value of 0; when the first random sequence is a Gaussian white noise sequence with an average value of 0, the second random sequence is a Gaussian white noise sequence with an average value of 0.

[0053] Exemplarily, the second local model may be a logistic regression model.

[0054] S203. Obtain an intermediate result based on the first feature vector, the second feature vector and the label information corresponding to the first training sample, and send the intermediate result to the second client terminal, where the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result.

[0055] In one possible design, the sum of the first eigenvector and the second eigenvector is determined; the difference between the product of the first preset ratio and the sum and the product of the second preset ratio and the label information is determined as an intermediate result.

[0056] Exemplarily, the sum value is determined by the following formula 3:

[0057] W X=WX_g+WX_h Formula 3;

[0058] Among them, W X is the sum of the first eigenvector and the second eigenvector.

[0059] Exemplarily, the intermediate result is determined by the following formula 4:

[0060] d=α*W X -β*Y formula 4;

[0061] Wherein, d is the intermediate result, α is the first preset ratio, β is the second preset ratio, and Y is the label information. Exemplarily, α is 1 / 4, and β is 1 / 2.

[0062] It should be noted that when α is 1 / 4 and β is 1 / 2, the above formulas 1, 2 and 3 are substituted into formula 4 to obtain the following formula 5:

[0063]

[0064] From the above formula 5, it can be seen that the intermediate result d is obtained by the first random sequence R1 and the second random sequence R2 on the label information Y and the first training sample X A After the first client terminal sends the intermediate result d to the second client terminal, since the second client terminal cannot obtain the first random sequence R1, it is unable to decrypt the intermediate result d to obtain the label information Y and the first training sample X A , thereby preventing data in the first client terminal from being leaked to the second client terminal, and improving the data security of the first client terminal.

[0065] exist Figure 2 In the data processing method provided in the embodiment, the intermediate result is determined by the first feature vector obtained by the first random sequence encryption process, the second feature vector obtained by the second random sequence encryption process, and the label information corresponding to the first training sample, so that the intermediate result becomes the information obtained by encrypting the label information and the first training sample by the first random sequence and the second random sequence. Furthermore, after the first client terminal sends the intermediate result to the second client terminal, since the second client terminal cannot obtain the first random sequence, it is impossible to decrypt the intermediate result to obtain the label information and the first training sample, thereby avoiding the leakage of data in the first client terminal to the second client terminal, and improving the data security of the first client terminal.

[0066] Based on the above embodiments, Figure 3 The data processing method provided in the embodiment of the present application is further explained in detail.

[0067] Figure 3Schematic diagram of the data processing method provided in the embodiment of the present application Figure 2 .like Figure 3 As shown, the method includes:

[0068] S301. Generate an i-th first random sequence, encrypt the i-th first training result according to the i-th first random sequence, and obtain the i-th first feature vector. The i-th first training result is obtained by processing the first training sample through the first local model A(i-1) of the first client terminal.

[0069] S302, receiving the i-th second feature vector sent by the second client terminal, where the i-th second feature vector is obtained by the second client terminal encrypting the i-th second training result through the i-th second random sequence, and the i-th second training result is obtained by processing the second training sample through the second local model Bi of the second client terminal.

[0070] S303. Obtain an i-th intermediate result based on the i-th first eigenvector, the i-th second eigenvector and the label information corresponding to the first training sample, and send the i-th intermediate result to the second client terminal. The intermediate result is used to instruct the second client terminal to update the model parameters of the second local model B(i-1) based on the i-th intermediate result.

[0071] Specifically, the execution method of S301 to S303 is the same as the execution method of S201 to S203, and the execution process of S301 to S303 is not repeated here.

[0072] S304: Determine the i-th gradient information according to the i-th intermediate result and the first training sample.

[0073] In a possible design, for each cycle, the product of the intermediate result and the first training sample is determined as the gradient information.

[0074] Exemplarily, the gradient information is determined by the following formula 6:

[0075] G=∑dX A Formula 6;

[0076] Among them, G is the gradient information.

[0077] It should be noted that, by substituting the above formula 5 into formula 6, the following formula 7 can be obtained:

[0078]

[0079] In the above formula 7, when R1 and R2 are both Laplace noise sequences with an average value of 0, the larger the number of random numbers included in the random sequence, The closer it is to 0, the above formula 7 is approximated as the following formula 8:

[0080]

[0081] S305 . Update the first local model A(i-1) according to the i-th gradient information to obtain the first local model A(i).

[0082] The first local model A(i-1) is updated, that is, the model parameters of the first local model A(i-1) (i.e. ) to update.

[0083] The first local model A(i) is a first local model obtained by updating the first local model A(i-1).

[0084] S306: Determine whether the first local model A(i) converges.

[0085] If yes, execute S307, otherwise execute S308.

[0086] Exemplarily, determining whether the first local model A(i) has converged includes: determining the model parameters of the first local model A(i) Whether each element in converges, if so, execute S307, otherwise execute S308.

[0087] S307: Determine the first local model A(i) as the final result of the model training.

[0088] S308 , add 1 to i. S301 to S308 are repeatedly executed until the first local model converges. Initially, i is equal to 1.

[0089] In a possible design, it is also possible to: set the initial number of loops; update the initial number of loops each time S301 to S308 are repeated; if the updated initial number of loops is equal to the maximum number of iterations, the first local model obtained when the maximum number of iterations is executed is determined as the final result of the model training.

[0090] exist Figure 3 In the data processing method provided in the embodiment, during each repeated execution of S301 to S308, an intermediate result is obtained based on the first feature vector, the second feature vector and the label information, and the intermediate result is sent to the second client terminal, which can prevent the data in the first client terminal from being leaked to the second client terminal, thereby improving the data security of the first client terminal.

[0091] Let's take one round of iteration as an example. Figure 4 , the data interaction process between the first client terminal and the second client terminal is described.

[0092] Figure 4 Schematic diagram of the data processing method provided in the embodiment of the present application Figure 3 .like Figure 4 As shown, including:

[0093] S401. The second client terminal generates a second random sequence, and encrypts the second training result according to the second random sequence to obtain a second feature vector.

[0094] S402: The second client terminal sends a second feature vector to the first client terminal.

[0095] S403: The first client terminal generates a first random sequence, and encrypts the first training result according to the first random sequence to obtain a first feature vector.

[0096] S404: The first client terminal obtains an intermediate result according to the first feature vector, the second feature vector, and the label information corresponding to the first training sample.

[0097] S405: The first client terminal sends the intermediate result to the second client terminal.

[0098] S406: The first client terminal determines gradient information according to the intermediate result and the first training sample; and updates model parameters of the first local model according to the gradient information to obtain an updated first local model.

[0099] S407: The second client terminal determines gradient information according to the intermediate result and the second training sample; and updates model parameters of the second local model according to the gradient information to obtain an updated second local model.

[0100] exist Figure 4 In the data processing method provided in the embodiment, since the intermediate result becomes information obtained by encrypting the label information and the first training sample through the first random sequence and the second random sequence, after the first client terminal sends the intermediate result to the second client terminal, the second client terminal cannot obtain the first random sequence and therefore cannot decrypt the intermediate result to obtain the label information and the first training sample, thereby avoiding leakage of data in the first client terminal to the second client terminal and improving the data security of the first client terminal.

[0101] In the present application, since the data in the first client terminal cannot be leaked to the second client terminal, the data security of the first client terminal is improved, thereby making the first local model in the first client terminal more robust and able to resist malicious attacks from the second client terminal.

[0102] For example, the first local model and the second local model are both logistic regression models.

[0103] Exemplarily, the logistic regression model can predict whether a user will make overdue payments. When it is necessary to train the first local model and the second local model as a model for predicting whether a user will make overdue payments, the first client terminal can use the user's deposit, age, etc. as the first training sample, and the user's corresponding overdue repayment record or non-overdue repayment record as the marking information. The second client terminal can use the user's gender, income, expenditure, each consumption amount, bad debt record, etc. as the second training sample to achieve joint training of the first local model and the second local model to obtain a model for predicting whether a user will make overdue payments. In the process of obtaining a model for predicting whether a user will make overdue payments, the second client terminal sends the intermediate result encrypted by a random sequence to the first client terminal (including the first training sample of deposit, age, etc., and the marking information including the overdue repayment record or the non-overdue repayment record), thereby avoiding the leakage of the first training sample and the marking information to the second client terminal, and improving the data security of the first client terminal.

[0104] Exemplarily, the logistic regression model can be used to predict whether the user has a certain disease. When the first local model and the second local model need to be trained to predict whether the user has a certain disease, the first client terminal can use the user's weight, age, blood pressure, blood lipids, etc. as the first training sample, and use the user's disease or non-disease as marking information. The second client terminal can use the user's exercise duration, heart rate, sleep depth, breathing rate, etc. as the second training sample to achieve joint training of the first local model and the second local model to obtain a model for predicting whether the user has a certain disease. In the process of obtaining a model for predicting whether the user has a certain disease, the second client terminal sends the intermediate result encrypted by a random sequence to the first client terminal (including the first training samples of weight, age, blood pressure, blood lipids, etc., and marking information including having a certain disease or not having a certain disease), thereby avoiding the leakage of the first training sample and marking information to the second client terminal, and improving the data security of the first client terminal.

[0105] Figure 5 Schematic diagram of the structure of a data processing device provided in an embodiment of the present invention. The data processing device is applied to a first client terminal. Figure 5 As shown, the data processing device includes: a generating module 501, a processing module 502, a receiving module 503 and a sending module 504; wherein,

[0106] A generating module 501, configured to generate a first random sequence;

[0107] The processing module 502 is used to encrypt the first training result according to the first random sequence to obtain a first feature vector; the first training result is obtained by processing the first training sample through the first local model of the first client terminal;

[0108] A receiving module 503 is used to receive a second feature vector sent by a second client terminal; the second feature vector is obtained by encrypting a second training result by the second client terminal through a second random sequence, and the second training result is obtained by processing a second training sample through a second local model of the second client terminal;

[0109] The processing module 502 is further used to obtain an intermediate result according to the first feature vector, the second feature vector and the label information corresponding to the first training sample;

[0110] The sending module 504 is used to send the intermediate result to the second client terminal; the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result.

[0111] The data processing device provided in the embodiment of the present invention is used to execute the technical solution of any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0112] Optionally, the processing module 502 is further specifically used to: determine the sum of the first eigenvector and the second eigenvector; determine the difference between the product of the first preset ratio and the sum and the product of the second preset ratio and the label information, and determine it as an intermediate result.

[0113] Optionally, the processing module 502 is specifically configured to: determine the sum of the first random sequence and the first training result as a first feature vector.

[0114] Optionally, the processing module 502 is also specifically used to: determine gradient information based on the intermediate results and the first training sample; update the model parameters of the first local model based on the gradient information to obtain an updated first local model; determine whether the updated first local model converges; if the updated first local model is in a converged state, determine the updated first local model as the final result of the model training.

[0115] Optionally, the processing module 502 is also specifically used to: if the updated first local model is in an unconverged state, repeat the following steps until the first local model converges: regenerate the first random sequence, determine a new first eigenvector based on the regenerated first random sequence, obtain a new second eigenvector from the second client terminal, and determine a new intermediate result based on the new first eigenvector and the new second eigenvector to continue updating the parameters of the first local model.

[0116] Optionally, the processing module 502 is further specifically configured to: determine the product of the intermediate result and the first training sample as gradient information.

[0117] Optionally, the first random sequence is a Laplace noise sequence with a mean value of 0, or a Gaussian white noise sequence with a mean value of 0.

[0118] The data processing device provided in the embodiment of the present invention is used to execute the technical solution of any of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.

[0119] Figure 6 A schematic diagram of the structure of a data processing device provided by an embodiment of the present invention. Figure 6 As shown, the data processing device (e.g., the first client terminal device) may include: a memory 601, a processor 602, and a data processing program stored in the memory 601 and executable on the processor 602. When the data processing program is executed by the processor 602, the steps of the data processing method of any of the aforementioned embodiments are implemented.

[0120] Optionally, the memory 601 may be independent or integrated with the processor 602 .

[0121] The implementation principle and technical effects of the data processing device (ie, the first client terminal) provided in the embodiment of the present invention can be found in the aforementioned embodiments and will not be described in detail here.

[0122] An embodiment of the present invention further provides a computer-readable storage medium, on which a data processing program is stored. When the data processing program is executed by a processor, the steps of the data processing method of any of the aforementioned embodiments are implemented.

[0123] The present invention also provides a computer program product, comprising a computer program, which implements the steps of any of the above-mentioned data processing methods when executed by a processor.

[0124] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0125] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present invention.

[0126] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0127] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0128] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0129] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0130] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0131] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a client terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0133] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data processing method, characterized in that: Applied to a first client terminal, the method comprises: Generate a first random sequence, and encrypt a first training result according to the first random sequence to obtain a first feature vector; the first training result is obtained by processing a first training sample through a first local model of the first client terminal; receiving a second feature vector sent by a second client terminal; the second feature vector is obtained by encrypting a second training result by the second client terminal through a second random sequence, and the second training result is obtained by processing a second training sample through a second local model of the second client terminal; An intermediate result is obtained according to the first feature vector, the second feature vector and the label information corresponding to the first training sample, and the intermediate result is sent to the second client terminal; the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result; specifically including: the second client cannot obtain the first random sequence, determines the gradient information according to the intermediate result and the second training sample, and updates the second local model parameters according to the gradient information.

2. The method according to claim 1, characterized in that The obtaining an intermediate result according to the first feature vector, the second feature vector, and the label information corresponding to the first training sample includes: determining a sum of the first eigenvector and the second eigenvector; A difference between a product of a first preset ratio and the sum value and a product of a second preset ratio and the tag information is determined as the intermediate result.

3. The method according to claim 1 or 2, characterized in that: The encrypting the first training result according to the first random sequence to obtain a first feature vector includes: The sum of the first random sequence and the first training result is determined as the first feature vector.

4. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: Determining gradient information according to the intermediate result and the first training sample; updating the model parameters of the first local model according to the gradient information to obtain an updated first local model; Determining whether the updated first local model converges; If the updated first local model is in a converged state, the updated first local model is determined as a final result of the model training.

5. The method according to claim 4, characterized in that The method further comprises: If the updated first local model is in an unconverged state, the following steps are repeated until the first local model converges: Regenerate the first random sequence, determine a new first feature vector according to the regenerated first random sequence, obtain a new second feature vector from the second client terminal, and determine a new intermediate result according to the new first feature vector and the new second feature vector to continue updating the parameters of the first local model.

6. The method according to claim 4, characterized in that The step of determining gradient information according to the intermediate result and the first training sample includes: The product of the intermediate result and the first training sample is determined as the gradient information.

7. The method according to any one of claims 1-2, characterized in that: The first random sequence is a Laplace noise sequence with an average value of 0, or a Gaussian white noise sequence with an average value of 0.

8. A data processing device, characterized in that: Applied to a first client terminal, the device comprises: a generating module, a processing module, a receiving module and a sending module; wherein, The generating module is used to generate a first random sequence; The processing module is used to encrypt the first training result according to the first random sequence to obtain a first feature vector; the first training result is obtained by processing the first training sample through the first local model of the first client terminal; The receiving module is used to receive a second feature vector sent by a second client terminal; the second feature vector is obtained by the second client terminal encrypting a second training result through a second random sequence, and the second training result is obtained by processing a second training sample through a second local model of the second client terminal; The processing module is further used to obtain an intermediate result according to the first feature vector, the second feature vector and the label information corresponding to the first training sample; The sending module is used to send the intermediate result to the second client terminal; the intermediate result is used to instruct the second client terminal to update the model parameters of the second local model according to the intermediate result, specifically including: the second client cannot obtain the first random sequence, determines the gradient information according to the intermediate result and the second training sample, and updates the second local model parameters according to the gradient information.

9. A data processing device, characterized in that: The data processing device comprises: a memory, a processor, and a data processing program stored in the memory and executable on the processor, wherein the data processing program implements the steps of the data processing method according to any one of claims 1 to 7 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a data processing program, and when the data processing program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Model parameter training method and device based on federated learning, equipment and medium

    CN109886417A

  • Data processing method, device and equipment and storage medium

    CN112364919A