Federated learning method and apparatus

By using a third-party arbitration node for secure intersection and data slicing, the problem of insufficient negative sample quantity caused by inconsistent user labels is solved, thus optimizing the performance and speed of the horizontal federated learning model.

CN115700565BActive Publication Date: 2025-12-09CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110849252.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2025-12-09
Estimated Expiration
2041-07-27

AI Technical Summary

Technical Problem

In existing horizontal federated learning, inconsistent user labels result in a small number of negative samples, affecting model performance. Furthermore, traditional encryption techniques reduce running speed and make it difficult to effectively find model parameters, leading to lower model performance compared to local models.

Method used

Secure intersection is achieved through a third-party arbitration node. The correct negative samples are obtained by using the encrypted data intersection, increasing the number of negative samples. Data slicing and gradient mean calculation are used to optimize the model parameters.

Benefits of technology

It improves the performance of federated learning models, reduces label imbalance, protects data security, and improves the running speed and convergence of models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700565B_ABST
    Figure CN115700565B_ABST
Patent Text Reader

Abstract

The present application provides a kind of transverse federal learning method and device, the method increases a new type of safe intersection agreement on traditional transverse federal learning mechanism, without knowing each other's negative sample, get the correct intersection of participant, and will not get any information in the set of another party outside intersection, can increase the negative sample of each participant, reduce the imbalance of label category, solve the label inconsistency problem of different participants with the same user;Or, with local model as the initial parameter of federal learning, the model index value of local model is used as the benchmark, the effectiveness of the gradient value transmitted by the participant is identified, to ensure that the result of federal learning is better than the result of local model, and to reduce the deterioration of model result due to large distribution difference of participants, and to transmit the average gradient of multiple slices in the form of data slices, change the way of model gradient interaction, that is, to protect the original data of each other to obtain gradient value and to reduce the running speed of federal learning model, and to speed up convergence.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The embodiment of the present application relates to the technical field of data service, and particularly relates to a transverse federated learning method and device. BACKGROUND

[0002] In the past, in order to improve model precision, the parties with the same business characteristics will increase the number of negative samples by sharing the black list, but due to various policies and competition, the parties are unwilling to share, and finally these data exist in the form of an island. The industry proposes transverse federated learning to solve the data island problem of the parties with the same business characteristics.

[0003] However, the traditional transverse federated learning assumes that the labels of users of different parties are consistent when the users have the same user, and in fact, there is a problem that the labels of some users are inconsistent between the two parties, and the effect of the federated learning model using such data will be affected.

[0004] In addition, the model effect is affected by the data quality in addition to the data quantity. Due to the use of encryption technology for multiple interactions in the traditional federated learning to protect data security, the running speed is much lower than that of the centralized model, and the model cannot find the appropriate parameters by brute force according to the traditional method, resulting in the problem that the model effect is lower than the local model effect of the participating party. SUMMARY

[0005] The embodiment of the present application provides a transverse federated learning method and device, which is used to solve the problem that the effect of the existing transverse federated learning is affected by the inconsistent labels of users in each participating party, which will lead to a small number of negative samples of each transverse federated learning node, thereby reducing the effect of the federated learning model, or the problem that invalid model parameters cannot be identified and the effect of the transverse federated learning model is lower than the local model effect of the participating party.

[0006] In order to solve the above technical problems, the present application is implemented as follows:

[0007] In a first aspect, the embodiment of the present application provides a transverse federated learning method applied to a participating party node of transverse federated learning, and the method comprises the following steps:

[0008] Receiving a public key sent by a third-party arbitration node;

[0009] Encrypting the user identifier in the local user data according to the generated random number, the public key and an encryption formula to obtain a ciphertext set;

[0010] Sending the ciphertext set of the self to other participating party nodes, and receiving the ciphertext set of each other participating party node;

[0011] re-encrypt at least part of the received ciphertext set to obtain a target ciphertext set of each participant node, wherein the target ciphertext set of each participant node is obtained by sequentially encrypting the user identifier of each participant node by each participant node;

[0012] send the target ciphertext set to the third-party arbitration node;

[0013] receive the information of the user identifier in the intersection of the target ciphertext set of each participant node sent by the third-party arbitration node, which belongs to the user identifier of the participant node itself;

[0014] return the information of the user identifier labeled as a negative sample in the received user identifier to the third-party arbitration node;

[0015] receive the information of the target user identifier returned by the third-party arbitration node, wherein the target user identifier belongs to the user identifier labeled as a negative sample returned by other participant nodes, but does not belong to the user identifier labeled as a negative sample returned by the participant node;

[0016] change the label of the user data corresponding to the target user identifier to a negative sample to obtain new user data.

[0017] Optionally, the re-encryption of at least part of the received ciphertext set comprises:

[0018] determine whether the number of ciphertexts in the received ciphertext set is lower than a threshold value;

[0019] if the number of ciphertexts is lower than the threshold value, directly re-encrypt each ciphertext in the received ciphertext set by using the encryption formula;

[0020] if the number of ciphertexts is higher than the threshold value, select the threshold value of ciphertexts from the received ciphertext set, and re-encrypt the threshold value of ciphertexts by using the encryption formula.

[0021] Optionally, after sending the target ciphertext set to the third-party arbitration node, the method further comprises:

[0022] clear the received ciphertext set from other participant nodes and the ciphertext set obtained by re-encrypting the received ciphertext set.

[0023] Optionally, the information of the user identifier in the intersection is a serial number generated when the user identifier is encrypted.

[0024] Optionally, the target ciphertext set comprises the length of the ciphertext in the target ciphertext set.

[0025] Optionally, after obtaining the new user data, the method further comprises:

[0026] a local model learning step of dividing new user data into a training set and a test set, and obtaining a local model using the training set and the test set;

[0027] a first slicing step of slicing the training set to obtain at least two first sliced data sets;

[0028] a second slicing step of dispersing the at least two first sliced data sets to at least two edge security computing nodes of the self to cluster the first sliced data sets on the edge security computing nodes to obtain s data sets labeled as positive samples and s data sets labeled as negative samples, and randomly combining the s data sets labeled as positive samples and the s data sets labeled as negative samples one by one to obtain s second sliced data sets;

[0029] a federated learning step of selecting r user data from each second sliced data set of each edge security computing node of the self, calculating gradients of the r user data, collecting the gradients of each edge security computing node of the self, calculating a mean value of the gradients of at least part of the edge security computing nodes, and sending the mean value to other participant nodes; after receiving the mean value of the gradients sent by the other participant nodes, calculating new model parameters and a model index value according to the mean value of the gradients, and comparing the new model index value with a model index value of the local model, if the new model index value is greater than the model index value of the local model, changing the model parameters of the local model to the new model parameters, otherwise not changing;

[0030] repeating the federated learning step until the local model converges.

[0031] Optionally, the method further comprises:

[0032] as a participant node of a transverse federated learning task initiator, the edge security computing node of the self sets the result parameters of a local model as initial parameters of gradients, and sets other parameters and a model index value of the transverse federated learning; and sends the other parameters to other participant nodes;

[0033] as a participant node of a transverse federated learning non-task initiator, the edge security computing node of the self sets the result parameters of a local model as initial parameters of gradients, and sets a model index value; receives other parameters sent by a participant node of a transverse federated learning task initiator; and combines the initial parameter values of the gradients, the model index value set by the self, and the received other parameters.

[0034] Optionally, the number of positive samples and the number of negative samples in the first sliced data set are the same.

[0035] Optionally, the gradient of each of the edge security computing nodes is aggregated, and the mean value of the gradient of at least part of the edge security computing nodes is calculated, including:

[0036] The gradient transmitted by the u edge security computing nodes is randomly selected, and the mean value of the gradient transmitted by the u edge security computing nodes is calculated.

[0037] Optionally, the new model parameter is calculated by the following formula:

[0038] w t =w t-1 -a*gi_avg

[0039] wherein, w t is the new model parameter, w t-1 is the last model parameter, a is the learning rate, and gi_avg is the mean value of the gradient.

[0040] In a second aspect, an embodiment of the present application provides a horizontal federated learning method applied to a third-party arbitration node of horizontal federated learning, and the method includes:

[0041] Generating a public key and sending it to each participant node participating in the horizontal federated learning;

[0042] Receiving a target ciphertext set of each of the participant nodes, wherein the target ciphertext set of each of the participant nodes is obtained by sequentially encrypting the user identifier of each participant node by each participant node;

[0043] Obtaining the intersection of the target ciphertext set of each of the participant nodes;

[0044] Sending the information of the user identifier in the intersection to the corresponding participant node;

[0045] Receiving the information of the user identifier with a negative sample label in the user identifier received by the participant node and returned by the participant node;

[0046] Returning the information of the target user identifier to the participant node, wherein the target user identifier belongs to the user identifier with a negative sample label returned by other participant nodes but does not belong to the user identifier with a negative sample label returned by the participant node.

[0047] Optionally, obtaining the intersection of the target ciphertext set of each of the participant nodes includes:

[0048] Using a fuzzy matching method to match the target ciphertext set of each of the participant nodes to obtain the intersection of the target ciphertext set of each of the participant nodes.

[0049] Optionally, the information of the user identifier in the intersection is a serial number generated when the user identifier is encrypted.

[0050] Optionally, the target ciphertext set comprises lengths of the ciphertexts in the target ciphertext set.

[0051] The intersection of the target ciphertext sets of the participant nodes comprises:

[0052] The lengths of the ciphertexts in the target ciphertext set of each participant node are extracted, and the ciphertexts whose lengths appear less than the number of participant nodes are filtered out to obtain a filtered target ciphertext set of each participant node.

[0053] The intersection of the filtered target ciphertext sets of the participant nodes is obtained.

[0054] Optionally, after sending the information of the user identifier in the intersection to the corresponding participant node, the method further comprises:

[0055] The target ciphertext sets sent by the participant nodes are emptied.

[0056] In a third aspect, an embodiment of the present application provides a horizontal federated learning method applied to a participant node of horizontal federated learning, and the method comprises:

[0057] A local model learning step: dividing new user data into a training set and a test set, and obtaining a local model by using the training set and the test set.

[0058] A first slicing step: performing first slicing on the training set to obtain at least two first sliced data sets.

[0059] A second slicing step: dispersing the at least two first sliced data sets to at least two edge security calculation nodes of the participant node, clustering the first sliced data sets in the edge security calculation nodes to obtain s data sets with positive labels and s data sets with negative labels, randomly combining the s data sets with positive labels and the s data sets with negative labels one by one to obtain s second sliced data sets.

[0060] federated learning step: selecting r user data from each of the second slice data sets of the edge security computing nodes respectively, calculating the gradient of the r user data, and collecting the gradients of the edge security computing nodes, calculating the mean of the gradients of at least part of the edge security computing nodes, and sending to other participant nodes; after receiving the mean of the gradients sent by other participant nodes, calculating new model parameters and model index values according to the mean of the gradients, and comparing the new model index values with the model index values of the local model, if the new model index values are greater than the model index values of the local model, changing the model parameters of the local model to the new model parameters, otherwise not changing;

[0061] repeating the federated learning step until the local model converges.

[0062] Optionally, further comprising:

[0063] As a participant node of a transverse federated learning task initiator, the edge security computing node sets the result parameters of the local model as the initial parameters of the gradient, and sets other parameters and model index values of the transverse federated learning; the other parameters are sent to other participant nodes.

[0064] As a participant node of a transverse federated learning non-task initiator, the edge security computing node sets the result parameters of the local model as the initial parameters of the gradient, and sets the model index values; the other parameters sent by the participant node of the transverse federated learning task initiator are received; the initial parameter values of the gradient and the model index values set by itself are combined with the received other parameters.

[0065] Optionally, the number of positive samples and the number of negative samples in the first slice data set are the same.

[0066] Optionally, collecting the gradients of the edge security computing nodes and calculating the mean of the gradients of at least part of the edge security computing nodes comprises:

[0067] Randomly selecting the gradients transmitted by u edge security computing nodes and calculating the mean of the gradients transmitted by u edge security computing nodes.

[0068] Optionally, the new model parameters are calculated by the following formula:

[0069] w t = w t-1 -a*gi_avg

[0070] wherein w t is the new model parameter, w t-1for the previous model parameters, a is a learning rate, and gi_avg is the average of the gradient.

[0071] In a fourth aspect, an embodiment of the present application provides a participant node of transverse federated learning, comprising:

[0072] The first receiving module is configured to receive a public key sent by the third-party arbitration node;

[0073] The first encryption module is configured to encrypt a user identifier in local user data according to the generated random number, the public key and an encryption formula to obtain a ciphertext set;

[0074] The first sending module is configured to send the ciphertext set of the participant node to other participant nodes;

[0075] The second receiving module is configured to receive ciphertext sets of the other participant nodes;

[0076] The second encryption module is configured to re-encrypt at least part of the ciphertexts in the received ciphertext set to obtain a target ciphertext set of the participant nodes, the target ciphertext set of the participant nodes being obtained by successively encrypting the user identifiers of the participant nodes by the participant nodes;

[0077] The second sending module is configured to send the target ciphertext set to the third-party arbitration node;

[0078] The third receiving module is configured to receive information of a user identifier belonging to the participant node in an intersection of the target ciphertext sets of the participant nodes sent by the third-party arbitration node;

[0079] The third sending module is configured to return information of a user identifier labeled as a negative sample in the received user identifiers to the third-party arbitration node;

[0080] The fourth receiving module is configured to receive information of a target user identifier returned by the third-party arbitration node, the target user identifier belonging to a user identifier labeled as a negative sample returned by the other participant nodes but not belonging to a user identifier labeled as a negative sample returned by the participant node;

[0081] The changing module is configured to change a label of user data corresponding to the target user identifier to a negative sample to obtain new user data.

[0082] In a fifth aspect, an embodiment of the present application provides a third-party arbitration node of transverse federated learning, comprising:

[0083] The first sending module is configured to generate a public key and send the public key to participant nodes participating in transverse federated learning;

[0084] The first receiving module is configured to receive a target ciphertext set of each of the participant nodes, the target ciphertext set of each of the participant nodes being obtained by sequentially encrypting a user identifier of each of the participant nodes by each of the participant nodes;

[0085] The obtaining module is configured to obtain an intersection of the target ciphertext sets of the participant nodes;

[0086] The first sending module is configured to send information of the user identifiers in the intersection to corresponding participant nodes;

[0087] The second receiving module is configured to receive information of user identifiers with a label of negative samples among the user identifiers received by the participant nodes;

[0088] The second sending module is configured to return information of a target user identifier to the participant nodes, the target user identifier belonging to user identifiers with a label of negative samples returned by other participant nodes but not belonging to user identifiers with a label of negative samples returned by the participant nodes.

[0089] In a sixth aspect, an embodiment of the present application provides a participant node of horizontal federated learning, comprising:

[0090] The local model learning module is configured to divide new user data into a training set and a test set, and obtain a local model by using the training set and the test set;

[0091] The first slicing module is configured to slice the training set for the first time to obtain at least two first sliced data sets;

[0092] The second slicing module is configured to disperse the at least two first sliced data sets to at least two edge security calculation nodes of the participant node, so as to cluster the first sliced data sets in the edge security calculation nodes to obtain s data sets with a label of positive samples and s data sets with a label of negative samples, randomly combine the s data sets with a label of positive samples and the s data sets with a label of negative samples one by one, and obtain s second sliced data sets;

[0093] The federal learning module is configured to select r user data from each second slice dataset of the edge security computing nodes respectively, calculate gradients of the r user data, collect the gradients of the edge security computing nodes, calculate the mean of the gradients of at least part of the edge security computing nodes, and send the mean to other participant nodes; after receiving the mean of the gradients sent by the other participant nodes, calculate new model parameters and a model index value according to the mean of the gradients, compare the new model index value with a model index value of the local model, change the model parameters of the local model to the new model parameters if the new model index value is greater than the model index value of the local model, and otherwise, do not change.

[0094] The control module is configured to control the federal learning module to repeatedly perform until the local model converges.

[0095] In a seventh aspect, an electronic device is provided, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and the program, when executed by the processor, implements the steps of the horizontal federated learning method of the first aspect, the second aspect, or the third aspect.

[0096] In an eighth aspect, a computer-readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the horizontal federated learning method of the first aspect, the second aspect, or the third aspect.

[0097] In the embodiments of the present application, a new type of secure intersection protocol is added, that is, the encrypted data is sent to a third-party arbitration node for secure intersection, the correct intersection of the participants is obtained without knowing the negative sample ids of each other, and any information in the set of the other party outside the intersection is not obtained, the negative sample original data of the non-intersection is protected from being known by the other participants, the negative samples of each participant are increased, the imbalance of the label categories is reduced, the problem that the number of negative samples of each horizontal federated learning node is small due to the inconsistent labels of the same user of different participants, thereby reducing the effect of the federated learning model.

[0098] Alternatively, the local model is used as the initial parameter of the federated learning, the model index value of the local model is used as the benchmark, the effectiveness of the gradient value transmitted by the participant is identified, the result of the federated learning is ensured to be better than the result of the local model, the model result is reduced due to the large distribution difference of the participants, and the data slice method is used to transmit the average gradient of multiple slices, the model gradient interaction method is changed, that is, the original data of each other is protected to obtain the gradient value and the running speed of the federated learning model is reduced, and the convergence is accelerated. BRIEF DESCRIPTION OF DRAWINGS

[0099] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a better understanding of the preferred embodiments, and are not intended to be a limitation of the application. Moreover, in the drawings, like reference numerals denote same or similar components. In the drawings:

[0100] Figure 1 A schematic diagram of a horizontal federated learning method applied to a participant node according to an embodiment of the present application;

[0101] Figure 2 A schematic diagram of a horizontal federated learning method applied to a third-party arbitration node according to an embodiment of the present application;

[0102] Figure 3 A schematic diagram of an application scenario of a horizontal federated learning method according to an embodiment of the present application;

[0103] Figure 4 A schematic diagram of a horizontal federated learning method applied to a participant node according to another embodiment of the present application;

[0104] Figure 5 A schematic diagram of a horizontal federated learning method applied to a participant node according to yet another embodiment of the present application;

[0105] Figure 6 A schematic diagram of an application scenario of a horizontal federated learning method according to an embodiment of the present application;

[0106] Figure 7 A schematic diagram of a model parameter interaction step according to an embodiment of the present application;

[0107] Figure 8 A schematic diagram of a structure of a participant node of a horizontal federated learning according to an embodiment of the present application;

[0108] Figure 9 A schematic diagram of a structure of a third-party arbitration node of a horizontal federated learning according to an embodiment of the present application;

[0109] Figure 10 A schematic diagram of a structure of a participant node of a horizontal federated learning according to another embodiment of the present application;

[0110] Figure 11 A schematic diagram of a structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0111] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are some of the embodiments of the present application but not all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of the present application.

[0112] Please refer to Figure 1 The embodiments of the present application provide a transverse federated learning method applied to a participant node of transverse federated learning. In the embodiments of the present application, the participant node of transverse federated learning can be two or more. The method comprises the following steps.

[0113] Step 11: receiving a public key sent by a third-party arbitration node;

[0114] In the embodiments of the present application, the third-party arbitration node sends the same public key to each participant node. The public key can be randomly generated by the third-party arbitration node, for example, two numbers n and e are randomly generated as the public key, where n=p*q, p and q are any different large prime numbers, e is an arbitrarily selected large integer (for example, an integer with a length of 1024 bits), and satisfies gcd(e, l(n))=1, l(n)=(p-1)*(q-1), and the gcd() function is a function returning the greatest common divisor of two or more integers.

[0115] Step 12: encrypting the user identifier in the local user data according to the generated random number, the public key and the encryption formula to obtain a ciphertext set;

[0116] The local user data is, for example, the data of a channel merchant. At this time, the user data can include: the channel merchant's legal representative's ID number, whether it is a poor service channel merchant (blacklisted channel merchant), the proportion of low-quality numbers in the month, the proportion of terminal abnormalities in the month, whether it violates the three prohibitions, whether it violates the real-name system, the complaint rate in the month, whether it leaks customer information, the number card mortality rate, and the monthly suspected card raising, etc. Among them, the channel merchant's legal representative's ID number can be used as the user identifier.

[0117] The participant node generates a random number, for example, an integer can be randomly generated according to the time, and then the generated random number, the received public key and the preset encryption formula are used to encrypt the user identifier in the local user data to obtain a ciphertext set.

[0118] Step 13: sending the ciphertext set of itself to other participant nodes and receiving the respective ciphertext sets sent by other participant nodes;

[0119] That is, each participant node exchanges the respective ciphertext sets.

[0120] For example, including two participant nodes, participant node A and B, participant node A sends its own ciphertext set to participant node B, and participant node B sends its own ciphertext set to participant node A.

[0121] In another example, including three participant nodes, participant nodes A, B and C, participant node A sends its own ciphertext set to participant node B, participant node B sends its own ciphertext set to participant node C, and participant node C sends its own ciphertext set to participant node A.

[0122] Step 14: re-encrypting at least part of the received ciphertext set to obtain a target ciphertext set of each participant node, wherein the target ciphertext set of each participant node is obtained by successively encrypting the user identifier of each participant node by each participant node;

[0123] For example, including two participant nodes, participant node A and B, participant node A encrypts the user identifier of local data to obtain a ciphertext set, and then sends the ciphertext set to participant node B, and participant node B re-encrypts the ciphertext in the received ciphertext set to obtain the final target ciphertext set of participant node A. Similarly, participant node B encrypts the user identifier of local data to obtain a ciphertext set, and then sends the ciphertext set to participant node A, and participant node A re-encrypts the ciphertext in the received ciphertext set to obtain the final target ciphertext set of participant node B.

[0124] In another example, including three participant nodes, participant nodes A, B and C, participant node A encrypts the user identifier of local data to obtain a ciphertext set, and then sends the ciphertext set to participant node B, and participant node B re-encrypts the ciphertext in the received ciphertext set, and sends the re-encrypted ciphertext set to participant node C, and participant node C re-encrypts the ciphertext in the received ciphertext set to obtain the final target ciphertext set of participant node A. Participant node B encrypts the user identifier of local data to obtain a ciphertext set, and then sends the ciphertext set to participant node C, and participant node C re-encrypts the ciphertext in the received ciphertext set, and sends the re-encrypted ciphertext set to participant node A, and participant node A re-encrypts the ciphertext in the received ciphertext set to obtain the final target ciphertext set of participant node B.

[0125] That is, it is necessary to ensure that a user identifier needs to be encrypted by all participant nodes once.

[0126] Step 15: sending the target ciphertext set to the third-party arbitration node;

[0127] Step 16: receiving the information of the user identifier belonging to itself in the intersection of the target ciphertext set of each participant node sent by the third-party arbitration node;

[0128] The third-party arbitration node obtains the intersection of the user identifiers of each participant node, and the intersection includes the information of n user identifiers, where n is the number of participant nodes. The information of the user identifier may be, for example, a serial number generated when the user identifier is encrypted, rather than the user identifier itself, so as to improve the security of data. For example, when there are two participant nodes A and B, the above intersection can be represented as (participant A_serial number 1a, participant B_serial number 1b), where participant A_serial number 1a represents a serial number corresponding to a user identifier in the participant node A, and participant B_serial number 1b represents a serial number corresponding to a user identifier in the participant node B.

[0129] The third-party arbitration node sends the information of each user identifier in the intersection to the corresponding participant node, for example, sends participant A_serial number 1a to the participant node A and participant B_serial number 1b to the participant node B.

[0130] Step 17: returning the information of the user identifier labeled as a negative sample in the received user identifier to the third-party arbitration node;

[0131] For example, the information of the user identifier received by the participant node A is (participant A_serial number 1a, participant A_serial number 1e, participant A_serial number 1g, …), where the user data corresponding to (participant A_serial number 1a, participant A_serial number 1g, …) is labeled as a negative sample. At this time, the participant node A returns (participant A_serial number 1a, participant A_serial number 1g, …) to the third-party arbitration node.

[0132] Step 18: receiving the information of the target user identifier returned by the third-party arbitration node, where the target user identifier belongs to the user identifier labeled as a negative sample returned by other participant nodes but does not belong to the user identifier labeled as a negative sample returned by the participant node;

[0133] Step 19: changing the label of the user data corresponding to the target user identifier to a negative sample to obtain new user data.

[0134] In the embodiment of the present application, a new secure intersection protocol is added, that is, the encrypted data is sent to a third-party arbitration node for secure intersection, so that the correct intersection of the participants is obtained without knowing the negative samples of each other, and no information in the set of the other party outside the intersection is obtained, the original negative sample data of the non-intersection is protected from being known by the other participants, and the negative samples of each participant can be increased to reduce the imbalance of the label categories and solve the problem of inconsistent labels of the same user of different participants.

[0135] In the embodiment of the present application, the received at least part of the ciphertext set is re-encrypted, including:

[0136] Step 141: judging whether the number of ciphertexts in the received ciphertext set is lower than a threshold value;

[0137] In the embodiment of the present application, different participant nodes can use the same or different threshold values.

[0138] Step 142: if the threshold value is lower, the received ciphertext set is directly re-encrypted by using the encryption formula;

[0139] In the re-encryption, the participant node uses the random number generated in step 12 and the encryption formula to encrypt each ciphertext in the received ciphertext set.

[0140] Step 143: if the threshold value is higher, the threshold value of ciphertexts is selected from the received ciphertext set, and the threshold value of ciphertexts is re-encrypted by using the encryption formula.

[0141] In the embodiment of the present application, the threshold value of ciphertexts can be randomly selected from the received ciphertext set.

[0142] In the embodiment of the present application, by adding the data quantity threshold value mechanism, the violent collision of the library can be prevented, and the system security is improved.

[0143] In the embodiment of the present application, after the target ciphertext set is sent to the third-party arbitration node, the received ciphertext set and the ciphertext set obtained by re-encrypting the received ciphertext set are emptied.

[0144] In the embodiment of the present application, the received ciphertext set and the ciphertext set obtained by re-encrypting the received ciphertext set are emptied, so that data leakage can be avoided.

[0145] In the embodiment of the present application, the target ciphertext set contains the length of the ciphertext in the target ciphertext set, for example, the target ciphertext set is:

[0146] {Length 24: {Serial number 5b: ciphertext of party b's ID number 1, Serial number 21b: ciphertext of party b's ID number 10}...}

[0147] {Length 34: {Serial number 5b: b party's ID number 5 (ciphertext), Serial number 21b: b party's ID number 21 (ciphertext)}……}

[0148] ...

[0149] The third-party arbitrator can extract the length of the ciphertext in the target ciphertext set of each participating node and filter out ciphertext whose length appears less than the number of participating nodes. For example, if a ciphertext of length 34 appears only in the target ciphertext set of participant B and not in the target ciphertext sets of other participants, then ciphertext of that length can be directly filtered out without participating in the intersection process, thereby improving the efficiency of data processing.

[0150] Please refer to Figure 2 This invention provides a horizontal federated learning method applied to a third-party arbitration node in horizontal federated learning. In this embodiment, the method includes:

[0151] Step 21: Generate a public key and send it to each participating node in the horizontal federated learning process;

[0152] In this embodiment of the invention, the participating nodes in horizontal federated learning can be two or more.

[0153] In this embodiment of the invention, the third-party arbitration node sends the same public key to all participating nodes. The public key can be randomly generated by the third-party arbitration node, for example, by randomly generating two numbers n and e as the public key, where n = p * q, p and q are any different large prime numbers, and e is any chosen large integer (e.g., an integer with a length of 1024 bits), satisfying gcd(e, l(n)) = 1, l(n) = (p-1) * (q-1), where gcd() is a function that returns the greatest common divisor of two or more integers.

[0154] Step 22: Receive the target ciphertext set of each participating node, wherein the target ciphertext set of each participating node is obtained by encrypting the user identifier of each participating node in turn.

[0155] Step 23: Obtain the intersection of the target ciphertext sets of each participating node;

[0156] In the embodiment of the present application, the fuzzy matching method can be used to match the target ciphertext sets of the participant nodes, so as to obtain the intersection of the target ciphertext sets of the participant nodes, thereby improving the matching efficiency. For example, when comparing two 1024-bit ciphertexts, if the 10th bit of the two is different, there is no need to continue the comparison, thereby improving the matching efficiency and saving the calculation amount.

[0157] Step 24: sending the information of the user identifiers in the intersection to the corresponding participant nodes;

[0158] The third-party arbitration node obtains the intersection of the user identifiers of the participant nodes, and the intersection includes the information of n user identifiers, where n is the number of the participant nodes. The information of the user identifiers can be, for example, the serial number generated when the user identifier is encrypted, rather than the user identifier itself, thereby improving the security of the data. For example, when there are two participant nodes A and B, the intersection can be represented as (participant A_serial number 1a, participant B_serial number 1b), where participant A_serial number 1a represents the serial number corresponding to a user identifier in the participant node A, and participant B_serial number 1b represents the serial number corresponding to a user identifier in the participant node B.

[0159] The third-party arbitration node sends the information of the user identifiers in the intersection to the corresponding participant nodes, for example, sends participant A_serial number 1a to the participant node A and sends participant B_serial number 1b to the participant node B.

[0160] Step 25: receiving the information of the user identifiers with the label of negative samples in the user identifiers received by the participant nodes;

[0161] For example, the information of the user identifiers received by the participant node A is (participant A_serial number 1a, participant A_serial number 1e, participant A_serial number 1g, …), where the user data corresponding to (participant A_serial number 1a, participant A_serial number 1g, …) has the label of negative samples, and at this time, the participant node A returns (participant A_serial number 1a, participant A_serial number 1g, …) to the third-party arbitration node.

[0162] Step 26: returning the information of the target user identifiers to the participant nodes, where the target user identifiers belong to the user identifiers with the label of negative samples returned by other participant nodes, but do not belong to the user identifiers with the label of negative samples returned by the participant nodes.

[0163] In the embodiment of the application, a new secure intersection protocol is added, that is, by sending the encrypted data to a third-party arbitration node for secure intersection, the problem of inconsistent labels of the same user of different participants can be solved, the number of negative samples of each participant is increased, the imbalance of data label distribution is reduced, and the original data of the negative samples of the non-intersection is protected from being known by other participants.

[0164] In the embodiment of the application, optionally, the target ciphertext set comprises the length of the ciphertext in the target ciphertext set; for example, the target ciphertext set is:

[0165] {Length 24: {Serial number 5b: b party ID No. 1 ciphertext), serial number 21b: b party ID No. 10 ciphertext)}……}

[0166] {Length 34: {Serial number 5b: b party ID No. 5 ciphertext), serial number 21b: b party ID No. 21 ciphertext)}……}

[0167] ……

[0168] At this time, obtaining the intersection of the target ciphertext sets of the participant nodes comprises:

[0169] Extracting the length of the ciphertext in the target ciphertext set of each participant node, filtering out the ciphertext whose length appears less than the number of participant nodes, and obtaining the filtered target ciphertext set of each participant node;

[0170] Obtaining the intersection of the filtered target ciphertext sets of the participant nodes.

[0171] For example, if the ciphertext with a length of 34 only appears in the target ciphertext set of participant B and does not appear in the target ciphertext set of other participants, the ciphertext with this length can be directly filtered out without participating in the intersection process, thereby improving the efficiency of data processing.

[0172] In the embodiment of the application, optionally, after sending the information of the user identifier in the intersection to the corresponding participant node, the method further comprises: emptying the target ciphertext set sent by each participant node, thereby avoiding data leakage.

[0173] In order to introduce conveniently, the following takes the business scene of identifying service-poor channel merchants as an example to introduce the horizontal federated learning method of the embodiment of the application in detail, wherein the meaning of the user is different in different business scenes, and the user represents the channel merchant in the scene of identifying service-poor channel merchants, and the user represents the user of the bank in the scene of bank risk control.

[0174] The secure intersection protocol of the embodiment of the application mainly includes three parts of encryption, fuzzy matching intersection set and intersection matching label change; the functions are to increase the number of negative samples of both parties, reduce the imbalance of data label distribution, and protect the original data of the negative sample channel merchant list from being known by the other party, wherein the negative sample refers to a poor service channel merchant.

[0175] Please refer to Figure 3 :

[0176] Encryption:

[0177] 1. The third party arbiter node randomly generates two numbers n and e as public keys, wherein n=p*q, p and q are any different large prime numbers, e is any selected large integer (for example, 1024-bit integer) satisfying gcd(e, l(n))=1, l(n)=(p-1)*(q-1), and (n, e) is transmitted to party A and party B. The gcd() function is a function returning the greatest common divisor of two or more integers.

[0178] 2. Party A and party B each extract local user data, which includes, for example, channel merchant legal representative ID number, whether it is a poor service channel merchant (blacklist channel merchant), low-quality number ratio this month, terminal abnormality ratio this month, whether it violates the three forbidden orders, whether it violates the real-name system, this month's complaint rate, whether it leaks customer information, number card mortality rate, and monthly suspected card raising.

[0179] Step 1: Party A randomly generates an integer r according to the current time a ∈random, uses the received public key and encryption formula to encrypt the channel merchant legal representative ID number in the local user data to obtain the set ses(ai), and the encryption formula can be as follows:

[0180]

[0181] Wherein, i is the i-th channel merchant, ai is the i-th channel merchant of party A, H is a hash operation, useid is the channel merchant legal representative ID number, and ses(ai) is the first ciphertext of the legal representative ID number of the i-th channel merchant of party A after encryption.

[0182] The first ciphertext set of party A can be expressed as: {serial number 1a: ses(a1), serial number 2a: ses(a2), ……}, wherein serial number 1a, serial number 2a, …… are the encryption serial numbers of the legal representative ID numbers of the channel merchants.

[0183] Party B randomly generates an integer r according to the current time arandom, the channel representative identity card number in the local user data is encrypted to obtain the set ses(bi) by using the received public key and the encryption formula, and the encryption formula can be as follows:

[0184]

[0185] Wherein, i is the i-th channel, bi is the i-th channel of the participant B, H is the hash operation, useid is the channel representative identity card number, ses(bi) is the first ciphertext of the i-th channel representative identity card number of the participant B after encryption.

[0186] The first ciphertext set of the participant B can be expressed as: {Serial number 1b: ses(b1), Serial number 2b: ses(b2), ……}, wherein, serial number 1b, serial number 2b…… are the encryption serial numbers of the channel representative identity card number.

[0187] Step 2: the participant A and the participant B exchange the first ciphertext set ses(ai) and ses(bi);

[0188] The participant A judges whether the number of users (i.e. the number of first ciphertexts) in the first ciphertext set ses(bi) exceeds the threshold value 1, if not, the participant A encrypts ses(bi) by using the random number r a And the encryption formula, to obtain DB(bi), which represents the second ciphertext of the i-th channel of the participant B; wherein, the encryption formula is as follows:

[0189]

[0190] If it exceeds the threshold value 1, randomly select threshold value 1 first ciphertext from ses(bi) to obtain DB(bi) according to the above formula:

[0191]

[0192] The participant B judges whether the number of users (i.e. the number of first ciphertexts) in the first ciphertext set ses(ai) exceeds the threshold value 2, if not, the participant B encrypts ses(ai) by using the random number r b And the encryption formula, to obtain DB(ai), which represents the second ciphertext of the i-th channel of the participant A; wherein, the encryption formula is as follows:

[0193]

[0194] If it exceeds the threshold value 2, randomly select threshold value 1 first ciphertext from ses(ai) to obtain DB(ai) according to the above formula:

[0195]

[0196] Step 3: Party A sends SDB(bi) to the third-party arbitration node, where SDB(bi) is the DB(bi) plus the length of the ciphertext, and the data format of SDB(bi) is as follows:

[0197] {Length 34: {Sequence number 5b: Party b ID number 5 second ciphertext), Sequence number 21b: Party b ID number 21 second ciphertext)}……}

[0198] This data format is JSON data format, where the length can be represented by key, and the following data is represented by value.

[0199] Party B sends SDB(ai) to the third-party arbitration node, where SDB(ai) is the DB(ai) plus the length of the ciphertext, and the data format is similar to that of Party A.

[0200] Party A and B clear the received first ciphertext and encrypted second ciphertext.

[0201] Fuzzy matching intersection:

[0202] Step 1: The third-party arbitration node extracts the key in SDB(ai) of Party A and the key in SDB(bi) of Party B, and filters out the value corresponding to the key that appears once, only matching the value of the double value of the key that appears twice, and the matching principle is as follows:

[0203] Input: Party A's encrypted length is length, and Party B's encrypted length is length, num is a fixed length, and 8 can be selected.

[0204] Output: The matched ciphertext of both parties.

[0205] Initial value: left = 0, right = length, mid1 = length / 2, mid2 = length / 2, flag = 0

[0206] Determine the following conditions:

[0207] When the contents of the left bit to the left+num bit of data_a are not equal to the same position segment of data_b, or the contents of the mid1-num bit to the mid1 bit of data_a are not equal to the contents of the same position segment of data_b, or the contents of the mid2 bit to the mid2+num bit of data_a are not equal to the contents of the same position segment of data_b, or the contents of the right-num bit to the right bit of data_a are not equal to the contents of the same position segment of data_b, flag=1 stops the loop, otherwise left=left+num, mid1=mid-8, right=right-8, mid2=mid2+8, continue the loop until left>mid1 or mid2>right stop.

[0208] The encrypted value corresponding to the output flag=0 is output in the following format: each element in the intersection is composed of the serial number of party A and the serial number of party B:

[0209] Inner={(party A serial number 1a, party B serial number 1b), (party A serial number 2a, party B serial number 2b)…}

[0210] Step 2: The third-party arbitration node sends the serial numbers of party A in the intersection Inner_a to party A and the serial numbers of party B in the intersection Inner_b to party B; the third-party arbitration node automatically clears the ciphertexts transmitted by the two parties except for retaining the intersection Inner.

[0211] Intersection matching label change:

[0212] Step 1: Party A extracts the serial numbers of channel merchants with poor service in Inner_a and obtains set s_Inner_a, and transmits it to the third-party arbitration node; party B extracts the serial numbers of channel merchants with poor service in Inner_b and obtains set s_Inner_b, and transmits it to the third-party arbitration node.

[0213] Step 2: The third-party arbitration node adds t=2 behind each element in the intersection (inner) if the serial number of party A in the element is in s_Inner_a and the serial number of party B in the element is in s_Inner_b, adds t=1 behind the element if the serial number of party A in the element is in s_Inner_a but the serial number of party B is not in s_Inner, or the serial number of party B in the element is in s_Inner_b but the serial number of party A is not in s_Inner_a, and adds t=0 behind the rest of the elements, where t=1 corresponds to the identity card of the channel merchant, one party is a channel merchant with normal service and the other party is a channel merchant with poor service.

[0214] Step 3: The third-party arbitration node transmits the sequence number ss_a corresponding to the participant A in the element t = 1 to the participant A, and transmits the sequence number ss_b corresponding to the participant B in the element t = 1 to the participant B.

[0215] Step 4: The participant A receives the set ss_a, and changes the label of the channel in the sequence number in ss_a to a poor service channel, and the participant B receives the set ss_b, and changes the label of the channel in the sequence number in ss_b to a poor service channel, that is, changes the label to 1, in the embodiment of the application, the label 1 represents a poor service channel, and the label 0 represents a good service channel.

[0216] Please refer to Figure 4 The embodiment of the application provides a transverse federated learning method applied to a participant node of transverse federated learning, and the participant node of transverse federated learning can be two or more, and the method comprises the following steps:

[0217] Step 41: a secure intersection step, wherein the secure intersection step can comprise the above Figure 1 The various steps shown in the figure are not repeated.

[0218] Step 42: a model parameter interaction step;

[0219] Please refer to Figure 4 The model parameter interaction step 42 comprises the following steps:

[0220] A local model learning step 421: dividing new user data into a training set and a test set, and obtaining a local model by using the training set and the test set;

[0221] A first slicing step 422: performing first slicing on the training set to obtain at least two first sliced data sets; in the embodiment of the application, the participant node can perform first slicing in a random manner;

[0222] Second slicing step 423: disperse the at least two first slice data sets to the at least two edge security computing nodes of the self to cluster the first slice data sets on the edge security computing nodes to obtain s data sets labeled as positive samples and s data sets labeled as negative samples, and randomly combine the s data sets labeled as positive samples and the s data sets labeled as negative samples one by one to obtain s second slice data sets; in the embodiment of the application, it is assumed that there are m first slice data sets, and the m first slice data sets are dispersed to m edge security computing nodes, and one edge security computing node corresponds to one first slice data set. In the embodiment of the application, clustering refers to dividing a set of objects into multiple classes composed of similar objects. In addition, in the embodiment of the application, the number of second slice data sets s obtained by each participant node can be the same or different.

[0223] Federal learning step 424: select r user data from each second slice data set of each edge security computing node of the self respectively, calculate the gradient of the r user data, and collect the gradients of each edge security computing node of the self, calculate the mean of the gradients of at least part of the edge security computing nodes, and send to other participant nodes; after receiving the mean of the gradients sent by other participant nodes, calculate new model parameters and model index values according to the mean of the gradients, and compare the new model index values with the model index values of the local model, if the new model index values are greater than the model index values of the local model, change the model parameters of the local model to the new model parameters, otherwise do not change; for example, participant node A selects r user data from each second slice data set (there are s second slice data sets) of each edge security computing node (assuming there are L edge security computing nodes) of the self respectively, and calculates L*s gradients by using the r user data of each second slice data set, and selects part or all of the L*s gradients to calculate the mean.

[0224] Repeat the federal learning step 424 until the local model converges.

[0225] In the embodiment of the application, the local model is used as the initial parameter of federal learning, the model index value of the local model is used as the benchmark, the effectiveness of the gradient value transmitted by the participant is identified, the result of federal learning is ensured to be better than the result of the local model, and the model result caused by large distribution difference of the participants is reduced, and the average gradient of multiple slices is transmitted in the form of data slicing, the mode of model gradient interaction is changed, that is, the original data of each other is protected to obtain the gradient value, and the running speed of the federal learning model is reduced, and the convergence is accelerated.

[0226] In the embodiment of the application, the method further comprises:

[0227] As a participant node of a transverse federal learning task initiator, the edge security computing node of the participant node sets an initial parameter of a gradient as a result parameter of a local model, sets other parameters and model index values of the transverse federal learning, and sends the other parameters to other participant nodes.

[0228] As a participant node of a transverse federal learning task initiator, the edge security computing node of the participant node sets an initial parameter of a gradient as a result parameter of a local model, sets other parameters and model index values of the transverse federal learning, and sends the other parameters to other participant nodes.

[0229] In the embodiment of the application, optionally, the number of positive samples and the number of negative samples in the first slice data set are the same.

[0230] In the embodiment of the application, optionally, the gradient of each edge security computing node of the participant node is collected, and the mean value of the gradient of at least part of the edge security computing nodes is calculated by randomly selecting the gradient transmitted by u edge security computing nodes and calculating the mean value of the gradient transmitted by the u edge security computing nodes.

[0231] In the embodiment of the application, optionally, the new model parameter is calculated by using the following formula:

[0232] w t =w t-1 -a*gi_avg

[0233] wherein, w t is a new model parameter, w t-1 is a model parameter of the last time, a is a learning rate, and gi_avg is the mean value of the gradient.

[0234] The above embodiment of the application has the following advantages:

[0235] 1. The traditional transverse federal learning cannot distinguish the inconsistency of the same merchant label, and at most uses PSI (Private Set Intersection) to obtain the intersection set, the data quantity affects the running speed, and the merchant ID alignment involves multiple ciphertext interaction operations, which has a large cost. In the embodiment of the application, only the encrypted blacklist is matched by using a fuzzy security matching module to obtain a difference set and is transmitted to each party for matching, thereby increasing negative samples, reducing interaction cost, and greatly improving the calculation speed.

[0236] 2. Traditional horizontal federated learning involves setting initial parameters based on experience, with each component learning together. This approach results in a slow model and makes parameter tuning extremely difficult, making it hard to find optimal parameters quickly. Furthermore, if the data distributions of the components are imbalanced, the federated learning model often performs worse than a locally built model. This paper employs a novel model parameter interaction method, utilizing federated learning technology to optimize the local model, further reducing the label imbalance problem and mitigating the poor performance caused by inconsistent data distributions. The model is faster, and its accuracy is only better than the locally built model.

[0237] 3. In this embodiment of the invention, when identifying invalid model parameters, the model index value obtained from the local model parameters is used as the benchmark. Only if it is greater than the benchmark will it be updated; otherwise, it will not be updated. The advantages are that it is suitable for two-party and multi-party applications, with fast running speed and high accuracy.

[0238] 4. In this embodiment of the invention, the federated learning model and the local model are in a sequential relationship. The federated learning model is obtained based on the local model. The local model's index value is used as a benchmark. Each time the parameters are updated, the new parameters are compared with the benchmark. If they are higher, the updated parameters are updated. The running speed is fast, ensuring that it is higher than the local model and has high accuracy.

[0239] In the above embodiments, the secure intersection and model parameter interaction steps are combined. In other embodiments of the present invention, the model parameter interaction step can also be used independently, regardless of whether the above secure intersection step is performed.

[0240] Please refer to Figure 5 This invention provides a horizontal federated learning method applied to participating nodes in horizontal federated learning. In this embodiment, the participating nodes in horizontal federated learning can be two or more. The method includes:

[0241] Local model learning step 51: Divide the new user data into a training set and a test set, and use the training set and test set to obtain a local model;

[0242] First Slicing Step 52: Slice the training set into at least two first slice datasets; in this embodiment of the invention, the participating nodes can be sliced ​​in a random manner for the first slice.

[0243] Second slicing step 53: disperse the at least two first slicing data sets to the at least two edge security computing nodes of the self to cluster the first slicing data sets on the edge security computing nodes to obtain s data sets labeled as positive samples and s data sets labeled as negative samples, and randomly combine the s data sets labeled as positive samples and the s data sets labeled as negative samples one by one to obtain s second slicing data sets; in the embodiment of the application, assuming that there are m first slicing data sets, the m first slicing data sets are dispersed to m edge security computing nodes, and one edge security computing node corresponds to one first slicing data set. In the embodiment of the application, clustering refers to dividing a collection of objects into multiple classes composed of similar objects. In addition, in the embodiment of the application, the number of second slicing data sets s obtained by each participant node can be the same or different.

[0244] Federal learning step 54: select r user data from each second slicing data set of each edge security computing node of the self respectively, calculate the gradient of the r user data, and collect the gradients of each edge security computing node of the self, calculate the mean of the gradients of at least part of the edge security computing nodes, and send to other participant nodes; after receiving the mean of the gradients sent by other participant nodes, calculate new model parameters and model index values according to the mean of the gradients, and compare the new model index values with the model index values of the local model, if the new model index values are greater than the model index values of the local model, change the model parameters of the local model to the new model parameters, otherwise do not change; for example, participant node A selects r user data from each second slicing data set (there are s second slicing data sets) of each edge security computing node (assuming there are L edge security computing nodes) of the self respectively, and calculates L*s gradients by using the r user data of each second slicing data set, and selects part or all of the L*s gradients to calculate the mean.

[0245] Repeat the federal learning step 54 until the local model converges.

[0246] In the embodiment of the application, the model index value obtained by the local model parameter is taken as the reference when identifying invalid model parameters, and only when it is greater than the reference is it updated, otherwise it is not updated, thereby solving the problems that the existing cannot identify invalid model parameters and the effect of the horizontal federal learning model is lower than that of the participant local model.

[0247] In the embodiment of the application, the method further comprises:

[0248] As a participant node of a horizontal federated learning task initiator, the edge security computing node of the participant node sets the result parameter of a local model as an initial parameter of a gradient, sets other parameters and model index values of the horizontal federated learning, and sends the other parameters to other participant nodes.

[0249] As a participant node of a horizontal federated learning non-task initiator, the edge security computing node of the participant node sets the result parameter of a local model as an initial parameter of a gradient, sets a model index value, receives other parameters sent by a participant node of a horizontal federated learning task initiator, and combines the initial parameter value of the gradient and the model index value set by the participant node of the horizontal federated learning non-task initiator with the received other parameters.

[0250] In the embodiment of the application, optionally, the number of positive samples and the number of negative samples in the first slice data set are the same.

[0251] In the embodiment of the application, optionally, the edge security computing node of the application collects the gradient of each edge security computing node, and calculates the mean value of the gradient of at least part of the edge security computing nodes, including: randomly selecting the gradient transmitted by u edge security computing nodes, and calculating the mean value of the gradient transmitted by the u edge security computing nodes.

[0252] In the embodiment of the application, optionally, the new model parameter is calculated by the following formula:

[0253] w t =w t-1 -a*gi_avg

[0254] wherein, w t is a new model parameter, w t-1 is a model parameter of the last time, a is a learning rate, and gi_avg is the mean value of the gradient.

[0255] For the convenience of introduction, the business scenario of discriminating service-poor channel merchants is taken as an example to introduce the horizontal federated learning method of the embodiment of the application in detail, wherein the meanings of users are different in different business scenarios. In the scenario of discriminating service-poor channel merchants, the user represents a channel merchant, and in the scenario of bank risk control, the user represents a user of a bank.

[0256] Please refer to Figure 6 The horizontal federated learning method in the embodiment of the application mainly includes the following parts: federated learning model parameter initialization, local data slice distribution to respective edge security computing nodes, and participant parameter interaction.

[0257] Main function: using the data of each participant, optimizing respective local models, and improving the efficiency and accuracy of model training.

[0258] The specific process is as follows:

[0259] federal learning model parameter initialization

[0260] 1. Participant A and participant B each divide the local user data into two parts, one training data set and one test data set. Using the data in the training set, a binary classification model (local model) is constructed with whether or not it is a poor service channel as the label and fields other than the channel legal ID as the characteristics, and the local model result parameters and the model indicator values of the local model on the test data set are retained.

[0261] Data example: using a logistic regression model, model parameter init is similar;

[0262] Model result parameters are similar {w0=0.343, w1=0.3434, w2=0.9343, …};

[0263] Model indicators are similar {auc: 0.8, ks=0.2}, where auc is the area under the ROC curve, and the horizontal axis of the ROC curve is FPRate (the meaning of FPRate is the proportion of predicted class 1 among all samples with true class 0), and the vertical axis is TPRate (the meaning of TPRate is the proportion of predicted class 1 among all samples with true class 1), with a value range of [0, 1], the higher the better; ks is used to evaluate the risk discrimination ability of the model, and the index measures the difference between the cumulative fractions of good and bad samples. The greater the cumulative difference between good and bad samples, the greater the ks index, and the stronger the risk discrimination ability of the model, generally greater than 0.2.

[0264] 2. Participant A and participant B each set the local model result parameters as the initial parameters of the gradient on the local edge security computing node.

[0265] Data example: the task initiator is participant A, and participant A sets the parameters of this federal learning {initial parameters of the gradient: {w0: 0.2323, w1: 0.2323, …}, model indicator values: {ks: 0.2, auc: 0.7}, loss: "L2", number of iterations: 100, learning rate: 0.1, …} on the local edge security computing node before initiating the task, and transmits the parameters other than the initial parameters of the gradient and the model indicator values to participant B;

[0266] Party B sets the initial parameters of the gradient at the local edge security computing node: {w0: 0.293, w1: 0.2, …}, and the model index value: {ks: 0.2, auc: 0.7}. Party A transmits other parameters to obtain the parameters: {the initial parameters of the gradient: {w0: 0.293, w1: 0.2, …}, the model index value: {ks: 0.2, auc: 0.7}, loss: “L2”, the number of iterations: 100, learning rate: 0.1, …}.

[0267] Local data slices are dispersed in respective security nodes

[0268] 1. Party A and Party B each randomly slice the training set to obtain a first slice data set. Each first slice data set contains all negative samples and an equal number of positive samples. The number of slices is the number of positive samples / negative samples.

[0269] Data example: Party A has a total of 3000 samples, 2000 positive samples, and 1000 negative samples. Then, it is sliced into two pieces, each first slice data set containing 1000 positive samples and all negative samples. Each slice data is in the following form:

[0270] Label, feature 1, feature 2, …, feature t.

[0271] 2. Party A and Party B disperse their respective first slice data sets to their respective edge security computing nodes.

[0272] 3. Party A and Party B slice the data of their respective edge security computing nodes again to form small miniBatch (second slice data set). Each miniBatch label category is still 1:1. The second slicing rule is as follows:

[0273] Step 1: Each edge security computing node uses its own node data to perform 2 times of clustering according to the label category. The number of clustering each time is s1.

[0274] Step 2: After clustering, s1 data sets with label 1 (negative samples) and s1 data sets with label 0 (positive samples) are obtained.

[0275] Step 3: The s1 data sets with label 1 and the s1 data sets with label 0 are randomly combined one by one to obtain s1 miniBatch data sets (second slice data set). This ensures that each miniBatch label category is still 1:1.

[0276] Double parameter interaction

[0277] Step 1: Please refer to Figure 7The task initiator starts the federated learning task. Participant A and participant B each randomly select r user samples from each miniBatch of each edge security computing node, calculate the gradient gi corresponding to the selection, where r is less than the number of users in the miniBatch; at the aggregation node, u random edge security computing nodes transmit gi, calculate the average value, obtain gi_avg, and pass it to the other party.

[0278] Step 2: When participants A and B receive gi_avg, they first obtain new model parameters based on gi_avg and the model parameter update formula, and calculate the model index value of the new model parameters on the test dataset. They then compare the new model index value with the initial value of the model index value. If the new index value is greater than the initial value, the model parameters are changed to the new model parameters. Otherwise, no changes are made, and the parameter interaction process between the two parties continues until the model converges.

[0279] The above embodiments of the present invention have the following advantages:

[0280] 1. Traditional horizontal federated learning involves setting initial parameters based on experience, with each component learning together. This approach results in a slow model and makes parameter tuning extremely difficult, making it hard to find optimal parameters quickly. Furthermore, if the data distributions of the components are imbalanced, the federated learning model often performs worse than a locally built model. This paper employs a novel model parameter interaction method, utilizing federated learning technology to optimize the local model, further reducing the label imbalance problem and mitigating the poor performance caused by inconsistent data distributions. The model is faster, and its accuracy is only better than the locally built model.

[0281] 2. In this embodiment of the invention, when identifying invalid model parameters, the model index value obtained from the local model parameters is used as the benchmark. Only if it is greater than the benchmark will it be updated; otherwise, it will not be updated. The advantages are that it is suitable for two-party and multi-party applications, with fast running speed and high accuracy.

[0282] 3. In this embodiment of the invention, the federated learning model and the local model are in a sequential relationship. The federated learning model is obtained based on the local model. The local model's index value is used as a benchmark. Each time the parameters are updated, the new parameters are compared with the benchmark. If they are higher, the updated parameters are updated. The running speed is fast, ensuring that it is higher than the local model and has high accuracy.

[0283] Please refer to Figure 8 This embodiment of the invention also provides a participant node 80 for horizontal federated learning, including:

[0284] The first receiving module 81 is used to receive the public key sent by the third-party arbitration node;

[0285] The first encryption module 82 is configured to encrypt the user identifier in the local user data according to the generated random number, the public key and an encryption formula, to obtain a ciphertext set;

[0286] The first sending module 83 is configured to send the ciphertext set of the participant node to other participant nodes.

[0287] The second receiving module 84 is configured to receive the ciphertext set of each participant node sent by other participant nodes.

[0288] The second encryption module 85 is configured to re-encrypt at least part of the ciphertexts in the received ciphertext set, to obtain a target ciphertext set of each participant node, wherein the target ciphertext set of each participant node is obtained by successively encrypting the user identifier of each participant node by each participant node.

[0289] The second sending module 86 is configured to send the target ciphertext set to the third-party arbitration node.

[0290] The third receiving module 87 is configured to receive information of the user identifier belonging to the participant node in the intersection of the target ciphertext set of each participant node sent by the third-party arbitration node.

[0291] The third sending module 88 is configured to return the information of the user identifier labeled as a negative sample in the received user identifier to the third-party arbitration node.

[0292] The fourth receiving module 89 is configured to receive the information of the target user identifier returned by the third-party arbitration node, wherein the target user identifier belongs to the user identifier labeled as a negative sample returned by other participant nodes, but does not belong to the user identifier labeled as a negative sample returned by the participant node.

[0293] The changing module 810 is configured to change the label of the user data corresponding to the target user identifier to a negative sample, to obtain new user data.

[0294] Optionally, the re-encryption of at least part of the ciphertexts in the received ciphertext set comprises:

[0295] determining whether the number of the ciphertexts in the received ciphertext set is lower than a threshold value;

[0296] if the number of the ciphertexts is lower than the threshold value, directly re-encrypting each ciphertext in the received ciphertext set by using the encryption formula;

[0297] if the number of the ciphertexts is higher than the threshold value, selecting the threshold value of the ciphertexts from the received ciphertext set, and re-encrypting the threshold value of the ciphertexts by using the encryption formula.

[0298] Optionally, the method further comprises:

[0299] A clearing module is configured to clear the ciphertext sets received from other participant nodes and the ciphertext sets obtained by re-encrypting the received ciphertext sets after the target ciphertext set is sent to the third-party arbitration node.

[0300] Optionally, the information of the user identifier in the intersection is a serial number generated when the user identifier is encrypted.

[0301] Optionally, the target ciphertext set comprises the length of the ciphertext in the target ciphertext set.

[0302] Optionally, the method further comprises:

[0303] A local model learning module is configured to divide new user data into a training set and a test set, and obtain a local model by using the training set and the test set.

[0304] A first slicing module is configured to slice the training set for the first time to obtain at least two first sliced data sets.

[0305] A second slicing module is configured to disperse the at least two first sliced data sets to at least two edge secure computing nodes of itself, to cluster the first sliced data sets in the edge secure computing nodes to obtain s data sets with positive labels and s data sets with negative labels, and to randomly combine the s data sets with positive labels and the s data sets with negative labels one by one to obtain s second sliced data sets.

[0306] A federated learning module is configured to select r user data from each second sliced data set of each edge secure computing node of itself, to calculate the gradient of the r user data, to collect the gradients of the edge secure computing nodes of itself, to calculate the mean of the gradients of at least part of the edge secure computing nodes, and to send the mean to other participant nodes; after receiving the mean of the gradients sent by other participant nodes, to calculate new model parameters and a model index value according to the mean of the gradients, and to compare the new model index value with a model index value of the local model; if the new model index value is greater than the model index value of the local model, to change the model parameters of the local model to the new model parameters, otherwise not to change.

[0307] A control module is configured to control the federated learning module to repeat the execution until the local model converges.

[0308] Optionally, the method further comprises:

[0309] The first setting module is configured to set, as a participant node of a horizontal federated learning task initiator, an initial parameter of a gradient as a result parameter of a local model at an edge security calculation node of the participant node, and set other parameters and model index values of the horizontal federated learning; and send the other parameters to other participant nodes.

[0310] The second setting module is configured to set, as a participant node of a horizontal federated learning non-task initiator, an initial parameter of a gradient as a result parameter of a local model at an edge security calculation node of the participant node, and set model index values; receive other parameters sent by a participant node of a horizontal federated learning task initiator; and combine the initial parameter value of the gradient and the model index values set by the participant node with the received other parameters.

[0311] Optionally, the number of positive samples and the number of negative samples in the first slice data set are the same.

[0312] Optionally, the step of collecting the gradients of the edge security calculation nodes and calculating the mean value of the gradients of at least part of the edge security calculation nodes comprises:

[0313] randomly selecting the gradients transmitted by the u edge security calculation nodes and calculating the mean value of the gradients transmitted by the u edge security calculation nodes.

[0314] Optionally, the new model parameter is calculated by using the following formula:

[0315] w t =w t-1 -a*gi_avg

[0316] wherein w t is a new model parameter, w t-1 is a model parameter of the last time, a is a learning rate, and gi_avg is the mean value of the gradient.

[0317] For reference Figure 9 , the embodiment of the application further provides a third-party arbitration node 90 of horizontal federated learning, comprising:

[0318] A first sending module 91 is configured to generate a public key and send the public key to each participant node participating in horizontal federated learning;

[0319] A first receiving module 92 is configured to receive a target ciphertext set of each of the participant nodes, wherein the target ciphertext set of each of the participant nodes is obtained by successively encrypting a user identifier of each of the participant nodes by each of the participant nodes;

[0320] An obtaining module 93 is configured to obtain an intersection of the target ciphertext sets of the participant nodes;

[0321] The first sending module 94 is configured to send information of the user identifiers in the intersection to the corresponding participant node;

[0322] The second receiving module 95 is configured to receive information of user identifiers with negative labels in the user identifiers received by the participant node from the participant node;

[0323] The second sending module 96 is configured to return information of target user identifiers to the participant node, wherein the target user identifiers belong to the user identifiers with negative labels returned by other participant nodes but do not belong to the user identifiers with negative labels returned by the participant node.

[0324] Optionally, obtaining the intersection of the target ciphertext sets of the participant nodes comprises:

[0325] The target ciphertext sets of the participant nodes are matched by using a fuzzy matching method to obtain the intersection of the target ciphertext sets of the participant nodes.

[0326] Optionally, the information of the user identifiers in the intersection is a serial number generated when the user identifier is encrypted.

[0327] Optionally, the target ciphertext set contains the length of the ciphertext in the target ciphertext set.

[0328] Obtaining the intersection of the target ciphertext sets of the participant nodes comprises:

[0329] The length of the ciphertext in the target ciphertext set of each participant node is extracted, and the ciphertext with a length appearing less than the number of the participant nodes is filtered out to obtain a filtered target ciphertext set of each participant node.

[0330] The intersection of the filtered target ciphertext sets of the participant nodes is obtained.

[0331] For reference Figure 10 The embodiment of the present application also provides a participant node 100 of horizontal federated learning, comprising:

[0332] The local model learning module 101 is configured to divide new user data into a training set and a test set, and obtain a local model by using the training set and the test set.

[0333] The first slicing module 102 is configured to slice the training set for the first time to obtain at least two first sliced data sets.

[0334] The second slicing module 103 is configured to disperse the at least two first slicing data sets to the at least two edge security computing nodes of the second slicing module 103, to cluster the first slicing data sets in the edge security computing nodes to obtain s data sets with positive labels and s data sets with negative labels, to randomly combine the s data sets with positive labels and the s data sets with negative labels one by one to obtain s second slicing data sets.

[0335] The federated learning module 104 is configured to select r user data from each second slicing data set of each edge security computing node of the federated learning module 104 respectively, to calculate the gradient of the r user data, to collect the gradient of each edge security computing node of the federated learning module 104, to calculate the mean of the gradient of at least part of the edge security computing nodes, and to send the mean of the gradient to other participant nodes; after receiving the mean of the gradient sent by the other participant nodes, to calculate new model parameters and a model index value according to the mean of the gradient, to compare the new model index value with a model index value of the local model, to change the model parameters of the local model to the new model parameters if the new model index value is greater than the model index value of the local model, and to not change otherwise.

[0336] The control module 105 is configured to control the federated learning module to repeat the execution until the local model converges.

[0337] Optionally, the method further comprises:

[0338] The first setting module is configured to, as a participant node of a horizontal federated learning task initiator, set the result parameters of a local model as initial parameters of the gradient in the edge security computing node of the first setting module, and set other parameters and a model index value of the horizontal federated learning; and send the other parameters to other participant nodes.

[0339] The second setting module is configured to, as a participant node of a horizontal federated learning non-task initiator, set the result parameters of a local model as initial parameters of the gradient in the edge security computing node of the second setting module, and set a model index value; receive other parameters sent by a participant node of a horizontal federated learning task initiator; and combine the initial parameter value of the gradient and the model index value set by the second setting module with the received other parameters.

[0340] Optionally, the number of positive samples and the number of negative samples in the first slicing data set are the same.

[0341] Optionally, the collecting of the gradient of each edge security computing node of the federated learning module 104 and the calculating of the mean of the gradient of at least part of the edge security computing nodes comprise:

[0342] Randomly select u edge security computing nodes to transmit the gradients, and calculate the mean of the gradients transmitted by u edge security computing nodes.

[0343] Optionally, the new model parameters are calculated using the following formula:

[0344] w t =w t-1 -a*gi_avg

[0345] Among them, w t For the new model parameters, w t-1 Here are the model parameters from the previous iteration, 'a' is the learning rate, and 'gi_avg' is the mean of the gradients.

[0346] Please refer to Figure 11 The present invention also provides an electronic device 110, including a processor 111, a memory 112, and a computer program stored in the memory 112 and executable on the processor 111. When the computer program is executed by the processor 111, it implements the various processes of the above-described horizontal federated learning method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0347] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described horizontal federated learning method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0348] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0349] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, also can be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application essentially or say the part which contributes to the prior art can be embodied in the form of software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions to make a terminal (may be a mobile phone, computer, server, air conditioner, or network equipment, etc.) execute the method described in various embodiments of the present application.

[0350] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A method of federated learning across horizons, the method comprising: A method applied to a participant node of a horizontal federated learning, the method comprising: receiving a public key sent by a third-party arbitration node; encrypting a user identifier in local user data according to a generated random number, the public key, and an encryption formula to obtain a ciphertext set; sending the ciphertext set of the participant node to other participant nodes and receiving ciphertext sets of the other participant nodes; re-encrypting at least part of the ciphertexts in the received ciphertext set to obtain a target ciphertext set of the participant nodes, the target ciphertext set of the participant nodes being obtained by successively encrypting user identifiers of the participant nodes by the participant nodes; sending the target ciphertext set to the third-party arbitration node; receiving information of user identifiers belonging to the participant node in an intersection of the target ciphertext sets of the participant nodes sent by the third-party arbitration node; returning information of user identifiers labeled as negative samples in the received user identifiers to the third-party arbitration node; receiving information of target user identifiers returned by the third-party arbitration node, the target user identifiers belonging to user identifiers labeled as negative samples returned by other participant nodes but not belonging to user identifiers labeled as negative samples returned by the participant node; changing a label of user data corresponding to the target user identifiers to a negative sample to obtain new user data.

2. The method of claim 1, wherein, The re-encrypting at least part of the ciphertexts in the received ciphertext set comprises: determining whether the number of ciphertexts in the received ciphertext set is lower than a threshold value; if the number of ciphertexts is lower than the threshold value, directly re-encrypting each ciphertext in the received ciphertext set using the encryption formula; if the number of ciphertexts is higher than the threshold value, selecting the threshold value of ciphertexts from the received ciphertext set and re-encrypting the threshold value of ciphertexts using the encryption formula.

3. The method of claim 2, wherein, The sending the target ciphertext set to the third-party arbitration node further comprises: emptying the ciphertext sets received from other participant nodes and the ciphertext sets obtained by re-encrypting the received ciphertext sets.

4. The method of claim 1, wherein, The obtaining new user data further comprises: a local model learning step of dividing the new user data into a training set and a test set and obtaining a local model using the training set and the test set; a first slicing step of slicing the training set for a first time to obtain at least two first sliced data sets; a second slicing step of dispersing the at least two first sliced data sets to at least two edge security calculation nodes of the participant node to cluster the first sliced data sets in the edge security calculation nodes to obtain s data sets labeled as positive samples and s data sets labeled as negative samples, and randomly combining the s data sets labeled as positive samples and the s data sets labeled as negative samples one by one to obtain s second sliced data sets; The federated learning step includes: selecting r user data from each of the second slice data sets of the edge security computing nodes respectively, calculating the gradient of the r user data, collecting the gradients of the edge security computing nodes, calculating the mean of the gradients of at least part of the edge security computing nodes, and sending the mean to other participant nodes; after receiving the mean of the gradients sent by the other participant nodes, calculating new model parameters and a model index value according to the mean of the gradients, comparing the new model index value with a model index value of the local model, if the new model index value is greater than the model index value of the local model, changing the model parameters of the local model to the new model parameters, otherwise, not changing; The federated learning step is repeatedly performed until the local model converges.

5. The method of claim 4, wherein, Further comprising: A participant node as a horizontal federated learning task initiator sets the result parameters of a local model as initial parameters of the gradient in the edge security computing node of the participant node, sets other parameters and a model index value of the horizontal federated learning, and sends the other parameters to other participant nodes; A participant node as a horizontal federated learning non-task initiator sets the result parameters of a local model as initial parameters of the gradient in the edge security computing node of the participant node, sets a model index value, receives other parameters sent by a participant node as a horizontal federated learning task initiator, and combines the initial parameter value of the gradient, the model index value and the received other parameters.

6. The method of claim 4, wherein, The collection of the gradients of the edge security computing nodes and the calculation of the mean of the gradients of at least part of the edge security computing nodes include: Randomly selecting the gradients transmitted by u edge security computing nodes and calculating the mean of the gradients transmitted by the u edge security computing nodes.

7. The method of claim 4, wherein, The new model parameters are calculated by the following formula: w t = w t-1 -a*gi_avg where w t is the new model parameter, w t-1 is the previous model parameter, a is the learning rate, and g i_avg is the average of the gradients.

8. A method of federated learning across horizons, the method comprising: A third-party arbitration node applied to horizontal federated learning includes: Generating a public key and sending it to each participant node participating in the horizontal federated learning; Receiving a target ciphertext set of each participant node, which is obtained by sequentially encrypting the user identifier of each participant node by each participant node; Obtaining the intersection of the target ciphertext sets of the participant nodes; Sending the information of the user identifier in the intersection to the corresponding participant node; Receiving the information of the user identifier with a negative sample label in the user identifier received by the participant node; Returning the information of the target user identifier to the participant node, the target user identifier belongs to the user identifier with a negative sample label returned by other participant nodes, but does not belong to the user identifier with a negative sample label returned by the participant node.

9. The method of claim 8, wherein, Obtaining the intersection of the target ciphertext sets of the participant nodes includes: Using a fuzzy matching method to match the target ciphertext sets of the participant nodes to obtain the intersection of the target ciphertext sets of the participant nodes.

10. The method of claim 8, wherein, The information of the user identifier in the intersection is a serial number generated when the user identifier is encrypted.

11. The method of claim 8, wherein, The target ciphertext set includes the length of the ciphertext in the target ciphertext set. The intersection of the target ciphertext set of each participant node includes: Extracting the length of the ciphertext in the target ciphertext set of each participant node, filtering out the ciphertext whose length of occurrence is less than the number of participant nodes, and obtaining the filtered target ciphertext set of each participant node; Obtaining the intersection of the filtered target ciphertext set of each participant node.

12. A method of federated learning across horizons, the method comprising: The method applied to the participant node of horizontal federated learning includes: A local model learning step: dividing new user data into a training set and a test set, and obtaining a local model by using the training set and the test set; A first slicing step: performing first slicing on the training set to obtain at least two first sliced data sets; A second slicing step: dispersing the at least two first sliced data sets to at least two edge security calculation nodes of itself, clustering the first sliced data sets in the edge security calculation nodes to obtain s data sets with positive labels and s data sets with negative labels, randomly combining the s data sets with positive labels and the s data sets with negative labels one by one to obtain s second sliced data sets; A federated learning step: selecting r user data from each second sliced data set of each edge security calculation node of itself, calculating the gradient of the r user data, collecting the gradient of each edge security calculation node of itself, calculating the mean of the gradient of at least part of the edge security calculation nodes, and sending it to other participant nodes; after receiving the mean of the gradient sent by other participant nodes, calculating new model parameters and model index values according to the mean of the gradient, and comparing the new model index values with the model index values of the local model; if the new model index values are greater than the model index values of the local model, the model parameters of the local model are changed to new model parameters, otherwise not changed; Repeating the federated learning step until the local model converges.

13. The method of claim 12, wherein, Further comprising: As a participant node of horizontal federated learning task initiator, the result parameters of the local model are taken as the initial parameters of the gradient in the edge security calculation node of itself, and other parameters and model index values of horizontal federated learning are set; the other parameters are sent to other participant nodes; As a participant node of horizontal federated learning non-task initiator, the result parameters of the local model are taken as the initial parameters of the gradient in the edge security calculation node of itself, and the model index values are set; the initial parameter values of the gradient and the model index values set by itself are combined with the received other parameters.

14. The method of claim 12, wherein, Collecting the gradient of each edge security calculation node of itself, calculating the mean of the gradient of at least part of the edge security calculation nodes includes: Randomly selecting the gradient transmitted by u edge security calculation nodes and calculating the mean of the gradient transmitted by u edge security calculation nodes.

15. The method of claim 12, wherein, The new model parameters are calculated by the following formula: w t = w t-1 -a*gi_avg where w t is the new model parameter, w t-1 is the previous model parameter, a is the learning rate, and g i_avg is the average of the gradients.

16. An electronic device, comprising: Including: A processor, a memory, and a program stored on the memory and executable on the processor, the program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 1 to 7, or the program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 8 to 11, or the program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 12 to 15.

17. A computer-readable storage medium, characterized in that, A computer program stored on the computer readable storage medium, the computer program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 1 to 7; or the computer program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 8 to 11, or the computer program, when executed by the processor, implements the steps of the federated learning method across horizons according to any one of claims 12 to 15.

Citation Information

Patent Citations

  • Federation network construction method based on federation learning, equipment and readable storage medium

    CN109167695A

  • Information value calculation method based on homomorphic encryption, device and readable storage medium

    CN109241770A