A federated learning system, federated learning-based data processing method

By using two servers to interactively compute the normalization and cosine similarity of gradient data in a federated learning system, the problem of low data processing efficiency in existing technologies is solved, and more efficient data security and Byzantine error-tolerant privacy aggregation are achieved.

CN118153707BActive Publication Date: 2026-05-19ZHEJIANG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG LAB
Filing Date
2024-02-04
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing privacy-enhanced robust federated learning systems, while ensuring data security, suffer from low data processing efficiency.

Method used

By setting up two servers in the federated learning system, the gradient data from the client is divided into two parts and sent to the two servers respectively. The servers interact to determine the normalization and cosine similarity of the gradient data, perform weighted calculations, and finally return the aggregated gradient values ​​to the client to update the local data for training the model.

Benefits of technology

It improves data security and data processing efficiency in federated learning systems, and reduces the time consumption of Byzantine error-tolerant privacy aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118153707B_ABST
    Figure CN118153707B_ABST
Patent Text Reader

Abstract

The application relates to a federal learning system and a data processing method based on federal learning. Gradient data of a client is split and sent to two servers respectively by setting the two servers, and the two servers interact to judge whether the gradient data of the client is normalized data. Then, the two servers interact to calculate the cosine similarity between the normalized gradient data and the aggregation result of the last round, the weighting coefficient of the client gradient data, and the client gradient weighted aggregation value, and return the aggregation gradient value to the client respectively. The client calculates the total aggregation gradient value according to the aggregation gradient value, and updates the local data training model using the total aggregation gradient value. Through the interaction calculation between the two servers, the data security in the existing federal learning system and the efficiency of the data processing of the federal learning are improved, which is beneficial to ensuring the system federal learning system Byzantine error tolerance privacy aggregation without bringing huge time overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a federated learning system and a data processing method based on federated learning. Background Technology

[0002] Federated learning is a distributed learning method for joint modeling among multiple parties, enabling collaborative modeling without data leaving the domain. However, federated learning systems are also vulnerable to attacks from various malicious actors. Typically, two attack methods exist: data poisoning attacks and model parameter data theft attacks. Data poisoning attacks are usually caused by malicious users within the federated learning system. Malicious actors use data with backdoors to train their local models, injecting a backdoor into the entire global model. When the model misclassifies certain data, the data poisoning attack compromises the robustness of the entire global model. Model parameter data theft attacks typically occur when malicious attackers are present in the data transmission link. By intercepting transmitted plaintext model parameters or gradient data, they can deduce the user's local real dataset, compromising the privacy and security of local user data. Therefore, building efficient, privacy-enhancing, and robust federated learning systems is essential.

[0003] In existing privacy-enhanced robust federated learning systems, the primary privacy-preserving technique used is homomorphic encryption. Byzantine faults (BFTs) are error models describing completely untrusted scenarios, involving both faulty and malicious behavior. Byzantine fault tolerance (BFT) refers to the ability to tolerate Byzantine faults. However, while homomorphic encryption schemes ensure Byzantine fault tolerance and privacy aggregation, they also face the problem of high computational overhead. Therefore, existing technologies face the challenge of low data processing efficiency while ensuring data security in federated learning systems.

[0004] There is currently no effective solution to the problem of low data processing efficiency while ensuring data security in federated learning systems. Summary of the Invention

[0005] This embodiment provides a federated learning system and a data processing method based on federated learning to solve the problem of low data processing efficiency in related technologies when ensuring data security in federated learning systems.

[0006] Firstly, this embodiment provides a federated learning system, which includes interconnected clients, a first server, and a second server;

[0007] The client is configured to obtain local gradient data from the local dataset training model and send the local gradient data to the first server and the second server respectively; receive the first aggregated update gradient and the second aggregated update gradient sent by the first server and the second server; obtain the target aggregated update gradient based on the first aggregated update gradient and the second aggregated update gradient, and update the local dataset training model based on the target aggregated update gradient.

[0008] The first server is configured to receive local gradient data sent by the client, receive a first gradient result sent by the second server, determine target gradient data in the local gradient data based on the local gradient data and the first gradient result, receive a first updated gradient result sent by the second server, calculate a first aggregated updated gradient based on the first updated gradient result and the target gradient data, and send the first aggregated updated gradient to the client.

[0009] The second server is configured to receive gradient data sent by the client, receive a second gradient result sent by the first server, determine target gradient data in the gradient data based on the gradient data and the second gradient result, receive a second updated gradient result sent by the first server, calculate a second aggregated updated gradient based on the second updated gradient result and the target gradient data, and send the second aggregated updated gradient to the client.

[0010] Secondly, this embodiment provides a data processing method based on federated learning, applied to a first server in a federated learning system, the method comprising:

[0011] Receive local gradient data sent by the client and receive the first gradient result sent by the second server;

[0012] Based on the local gradient data and the first gradient result, the target gradient data in the local gradient data is determined;

[0013] Receive the first updated gradient result sent by the second server;

[0014] Based on the first update gradient result and the target gradient data, a first aggregated update gradient is calculated and sent to the client.

[0015] In some embodiments, determining the target gradient data in the local gradient data based on the local gradient data and the first gradient result includes:

[0016] Receive the first gradient data sent by the client, wherein the local gradient data includes the first gradient data;

[0017] Based on the first gradient data and the preset first triplet data, a second gradient result is generated and sent to the second server;

[0018] Based on the second gradient result and the first gradient result, generate gradient data and;

[0019] Based on the gradient data, the target gradient data in the local gradient data is determined.

[0020] In some embodiments, determining the target gradient data from the local gradient data based on the gradient data includes:

[0021] Determine whether the gradient data is a preset data value;

[0022] When the gradient data sum is determined to be a preset data value, the cosine similarity between the gradient data sum and the preset historical aggregated gradient data is calculated.

[0023] When the cosine similarity is within a preset similarity threshold range, the local gradient data is determined to be the target gradient data.

[0024] In some embodiments, after determining the target gradient data in the local gradient data and before calculating the first aggregated update gradient, the process includes:

[0025] Based on the first triplet data, the target gradient data, and the historical gradient aggregation data, a first weighted gradient result is calculated and sent to the second server.

[0026] The system receives the second weighted gradient result sent by the second server and calculates the first weighting coefficient based on the first weighted gradient result and the second weighted gradient result.

[0027] In some embodiments, calculating the first aggregated update gradient based on the first update gradient result and the target gradient data includes:

[0028] Based on the first triplet data, the target gradient data, the historical aggregated gradient data, and the first weighting coefficient, a first updated gradient result is generated and sent to the second server;

[0029] Receive the second update gradient result sent by the second server; generate the first aggregated update gradient based on the first update gradient result and the second update gradient result.

[0030] Thirdly, this embodiment provides a data processing method based on federated learning, applied to a client in a federated learning system. The method includes:

[0031] Gradient data is obtained from training the model using a local dataset, and the gradient data is sent to the first server and the second server in the federated learning system, respectively.

[0032] Receive the first aggregated update gradient and the second aggregated update gradient sent by the first server and the second server, respectively.

[0033] Based on the first aggregate update gradient and the second aggregate update gradient, the target aggregate update gradient is obtained, and the local dataset training model is updated based on the target aggregate update gradient.

[0034] Fourthly, this embodiment provides a data processing method based on federated learning, applied to a second server in a federated learning system, the method comprising:

[0035] Receive gradient data sent by the client and receive the second gradient result sent by the first server;

[0036] Based on the gradient data and the second gradient result, the target gradient data in the gradient data is determined;

[0037] Receive the second updated gradient result sent by the first server;

[0038] Based on the second update gradient result and the target gradient data, a second aggregated update gradient is calculated and sent to the client.

[0039] Fifthly, this embodiment provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the federated learning-based data processing methods described in the second, third, and fourth aspects above.

[0040] In a sixth aspect, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the federated learning-based data processing methods described in the second, third, and fourth aspects above.

[0041] Compared to related technologies, the federated learning system and data processing method provided in this embodiment utilize two servers. The client's gradient data is divided into two parts and sent to each server. The two servers interact to determine whether the client's gradient data is normalized. Subsequently, the two servers interactively calculate the cosine similarity between the normalized gradient data and the previous aggregation result, the weighting coefficients of the client's gradient data, and the weighted aggregated value of the client's gradient. They then return the aggregated gradient values ​​to the client. The client receives the aggregated gradient values ​​from both servers, calculates the total aggregated gradient value, and uses this total aggregated gradient value to update its local data for model training. This interactive computation between the two servers improves data security and the efficiency of data processing in existing federated learning systems.

[0042] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0043] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0044] Figure 1 This is a hardware structure block diagram of the terminal for the federated learning-based data processing method in this embodiment;

[0045] Figure 2 This is a schematic diagram of the federated learning system according to an embodiment of this application;

[0046] Figure 3 This is a flowchart of the data processing method based on federated learning in this embodiment;

[0047] Figure 4 This is a flowchart of another data processing method based on federated learning in this embodiment;

[0048] Figure 5 This is a flowchart of another data processing method based on federated learning, as exemplified in this application.

[0049] Figure 6 This is a schematic diagram of the federated learning system in this specific embodiment;

[0050] Figure 7 This is a flowchart of a data processing method based on federated learning in this specific embodiment. Detailed Implementation

[0051] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0052] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0053] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of the terminal for the federated learning-based data processing method in this embodiment. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0054] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the federated learning-based data processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0055] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0056] With the advent of the big data era, people's lives are now inextricably linked to data, making data privacy and security issues increasingly prominent. Ensuring efficient data use while guaranteeing data security is a crucial problem to solve. Data is often stored in a distributed manner, and how various participants can collaborate to use data efficiently while ensuring the security of local private data requires privacy-preserving computation techniques. Existing technologies utilize federated learning, a distributed learning method for multi-party joint modeling, to complete multi-party joint modeling without data leaving the domain. However, federated learning systems are also vulnerable and face attacks from various malicious attackers. Therefore, it is essential to build efficient, privacy-enhancing, robust federated learning systems. In existing privacy-enhancing, robust federated learning systems, the main privacy technology used is homomorphic encryption, which often suffers from high computational overhead. This application proposes a privacy-enhancing method by constructing secure multi-party computational multiplication triples, thereby ensuring Byzantine fault tolerance and privacy aggregation in the federated learning system without incurring significant time costs.

[0057] This embodiment provides a federated learning system. Figure 2 This is a schematic diagram of a federated learning system according to an embodiment of this application. (Reference) Figure 2The system includes: multiple clients 1, a first server 2, and a second server 3. Clients 1, the first server 2, and the second server 3 are interconnected.

[0058] Client 1 is used to obtain local gradient data from the local dataset training model and send the local gradient data to the first server 2 and the second server 3 respectively; receive the first aggregated update gradient and the second aggregated update gradient sent by the first server 2 and the second server 3; obtain the target aggregated update gradient based on the first aggregated update gradient and the second aggregated update gradient, and update the local dataset training model based on the target aggregated update gradient.

[0059] The first server 2 is used to receive local gradient data sent by the client 1 and the first gradient result sent by the second server 3; determine the target gradient data in the local gradient data based on the local gradient data and the first gradient result; receive the first updated gradient result sent by the second server 3; calculate the first aggregated updated gradient based on the first updated gradient result and the target gradient data, and send the first aggregated updated gradient to the client 1.

[0060] The second server 3 is used to receive gradient data sent by client 1 and receive the second gradient result sent by first server 2; determine the target gradient data in the gradient data based on the gradient data and the second gradient result; receive the second updated gradient result sent by first server 2; calculate the second aggregated updated gradient based on the second updated gradient result and the target gradient data, and send the second aggregated updated gradient to client 1.

[0061] Specifically, the federated learning system in this application includes a client 1, a first server 2, and a second server 3. The client 1 trains a model using a preset local dataset to obtain local gradient data, splits the local gradient data, and sends it to the first server 2 and the second server 3 respectively. Subsequently, the first server 2 and the second server 3 receive the local gradient data and perform interactive calculations to determine the target gradient data in the local gradient data. Then, the first server 2 and the second server 3 interact to securely aggregate the target gradient data, calculate the first aggregated update gradient and the second aggregated update gradient respectively, and send them to the client 1 so that the client 1 can obtain the target aggregated update gradient based on the first aggregated update gradient and the second aggregated update gradient, and update the local dataset training model based on the target aggregated update gradient.

[0062] Through the above steps, each client trains its model locally to obtain gradient data and normalizes the gradient data. Each client then splits and sends its local gradient data to the first server 2 and the second server 3. The first server 2 and the second server 3 collaborate to filter the local gradient data while ensuring client data privacy and security. For example, the first server 1 and the second server 2 obtain target gradient data through normalization and cosine similarity judgment, identifying gradient data from potential malicious actors. The first server 2 and the second server 3 use the obtained similarity to evaluate each client, ensuring that data from highly similar actors receives higher weights during federated learning. The first server 2 and the second server 3 use weighted values ​​to weight the gradient data, completing the robust and secure aggregation of the federated learning system. By using interactive computation between the two cloud servers, it is beneficial to reduce time consumption while ensuring Byzantine fault tolerance and privacy-preserving aggregation in the federated learning system.

[0063] This embodiment provides a data processing method based on federated learning. Figure 3 This is a flowchart of the data processing method based on federated learning in this embodiment, as shown below. Figure 3 As shown, this method is applied to the first server, and the process includes the following steps:

[0064] Step S310: Receive local gradient data sent by the client and receive the first gradient result sent by the second server.

[0065] Specifically, a first server and a client are connected. The first server receives a portion of the local gradient data sent by the client. The client splits each item in the local gradient data into two parts and sends the sets of the two parts to the first server and the second server respectively. For example, the local gradient data sent by the client is a set of multiple data items. The sum or product of each gradient data item received by the first server and each gradient data item received by the second server constitutes the set of local gradient data. A triplet of data (a, b, c) is preset, where c = a * b; and (a, b, c) is split into (a1, b1, c1) and (a2, b2, c2) and sent to the first server and the second server respectively. The second server calculates the first gradient result based on (a2, b2, c2) and the local gradient data received from the client, and sends the first gradient result to the first server.

[0066] Step S320: Determine the target gradient data in the local gradient data based on the local gradient data and the first gradient result.

[0067] Specifically, the first server (a1, b1, c1) and the local gradient data received from the client calculate the second gradient result, and based on the first gradient result and the second gradient result, perform a secure calculation of interactive multiplication triples with the second server, thereby filtering out the target gradient data from the local gradient data.

[0068] Step S330: Receive the first update gradient result sent by the second server; calculate the first aggregated update gradient based on the first update gradient result and the target gradient data, and send the first aggregated update gradient to the client.

[0069] Specifically, the first server receives the first updated gradient result sent by the second server. More specifically, the second server calculates the first updated gradient result based on (a2, b2, c2), the local gradient data received from the client, and the calculated weighting coefficients, and sends the first updated gradient result to the first server. The first server calculates the second updated gradient result based on (a1, b1, c1), the local gradient data received from the client, and the calculated weighting coefficients. Then, based on the first and second updated gradient results, it calculates the first aggregated updated gradient and sends the first aggregated updated gradient to the client.

[0070] Through the above steps, the first server receives local gradient data and preset triplet data sent by the client, interacts with the second server to determine the target gradient data, and then interacts with the second server to calculate the first aggregated update gradient based on the target gradient data. The first aggregated update gradient is then sent to the client so that the client can update the model trained on the local dataset based on the first aggregated update gradient. This improves the data security and data processing efficiency of the existing federated learning system, and further helps to reduce time consumption while ensuring Byzantine error tolerance and privacy aggregation in the federated learning system.

[0071] In some embodiments, step S320 includes steps S321 to S323:

[0072] Step S321: Receive the first gradient data sent by the client. The local gradient data includes the first gradient data.

[0073] Specifically, the first server receives the first gradient data from the local gradient data sent by the client. The number of data points in the set corresponding to the first gradient data is the same as the number of data points in the set corresponding to the local gradient data.

[0074] Step S322: Generate a second gradient result based on the first gradient data and the preset first triplet data, and send the second gradient result to the second server.

[0075] Specifically, the first server calculates the second gradient data result based on the first gradient data and the preset first triplet data, and sends the second gradient result to the second server for interactive calculation. For example, the first triplet data is (a1, b1, c1) in the aforementioned embodiment.

[0076] Step S323: Generate gradient data and based on the second gradient result and the first gradient result; determine the target gradient data in the local gradient data based on the gradient data and.

[0077] Specifically, the first server calculates the gradient data sum based on the second gradient result and the first gradient result sent by the second server, where the gradient data sum is the sum of the first and second gradient results. The first server determines the target gradient data in its local gradient data based on the gradient data sum. For example, the local gradient data sent by the client is split and sent to the two servers after normalization. Therefore, by determining whether the gradient data sum is normalized data, the first server determines whether the local gradient data is normalized data, and thus determines the target gradient data.

[0078] Through the above steps, the first server determines the target gradient data based on the second gradient result generated by the first gradient data and the preset first triplet data, as well as the first gradient result sent by the second server. Then, through secure interaction between the two servers, it determines whether the local gradient data uploaded by each client is normalized, which helps to improve the data security of the federated learning system.

[0079] In some embodiments, step S320 includes steps S324 to S325.

[0080] Step S324: Determine whether the gradient data sum is a preset data value; when the gradient data sum is determined to be a preset data value, calculate the cosine similarity between the gradient data sum and the preset historical aggregated gradient data.

[0081] Specifically, the first server determines the gradient data sum based on the first and second gradient results, and then checks whether the gradient data sum is a preset data value. When the gradient data sum is a preset data value, the local gradient data is determined to be normal data; when the gradient data sum is not a preset data value, the local gradient data is determined to be abnormal data, and thus the local gradient data is discarded. For example, the local gradient data sent by the client is normalized before being sent to the two servers. Therefore, based on whether the gradient data sum is normalized data, it is determined whether the local gradient data is normalized data, and thus whether the local gradient data is normal data. After obtaining normal data, the cosine similarity between the gradient data sum and the previous historical gradient aggregation data is calculated.

[0082] Step S325: When the cosine similarity is within the preset similarity threshold range, the local gradient data is determined as the target gradient data.

[0083] Specifically, after calculating the cosine similarity, the first server determines whether the cosine similarity is within a preset threshold range. If the cosine similarity is within the preset threshold range, the local gradient data is determined to be normal data, i.e., the target gradient data. If the cosine similarity is not within the preset threshold range, the local gradient data is determined to be abnormal data, i.e., potentially poisoned data.

[0084] Through the above steps, the first server determines normal data by judging whether the gradient data and its values ​​match preset values. Then, based on the cosine similarity between the normal data and historical aggregated gradient data, it determines the target gradient data. By judging the gradient data and its cosine similarity to determine the target gradient data, the data security of the federated learning system is improved.

[0085] In some embodiments, the sequence after step S320 and before step S330 includes:

[0086] Step S301: Calculate the first weighted gradient result based on the first triplet data, the target gradient data, and the historical gradient aggregation data, and send the first weighted gradient result to the second server.

[0087] Specifically, the first server calculates a first weighted gradient result based on the first triplet data, the target gradient data, and the historical gradient aggregation data, and sends the first weighted gradient result to the second server. The second server calculates a second weighted gradient result based on the second triplet data, the target gradient data, and the historical gradient aggregation data, and sends the second weighted gradient result to the first server. For example, the second triplet data is (a2, b2, c2) in the aforementioned embodiment.

[0088] Step S302: Receive the second weighted gradient result sent by the second server, and calculate the first weighting coefficient based on the first weighted gradient result and the second weighted gradient result.

[0089] Specifically, the first server receives the second weighted gradient result sent by the second server, and obtains the first weighting coefficient based on the first weighted gradient result and the second weighted gradient result.

[0090] Through the above steps, the first server and the second server respectively calculate the first weighted gradient result and the second weighted gradient result, and interact with the first weighted gradient result and the second weighted gradient result to calculate the first weighted coefficient, which helps to improve the data security of the federated learning system.

[0091] In some embodiments, step S330 includes steps S331 to S332.

[0092] Step S331: Based on the first triplet data, the target gradient data, the historical aggregated gradient data, and the first weighting coefficient, generate the first updated gradient result and send it to the second server.

[0093] Specifically, the first server generates a first updated gradient result based on the first triplet data, the target gradient data, the historical aggregated gradient data, and the first weighting coefficient, and sends it to the second server. The second server generates a second updated gradient result based on the second triplet data, the target gradient data, the historical aggregated gradient data, and the second weighting coefficient, and sends it to the first server.

[0094] Step S332: Receive the second update gradient result sent by the second server; generate the first aggregated update gradient based on the first update gradient result and the second update gradient result.

[0095] Through the above steps, the first server and the second server interact to calculate the first update gradient result and the second update gradient result, and send them to the client respectively. This helps to improve the data security and data processing efficiency in the federated learning system, and solves the problem of huge time overhead in the prior art while ensuring Byzantine error tolerance privacy aggregation.

[0096] This embodiment also provides a data processing method based on federated learning. Figure 4 This is a flowchart of another data processing method based on federated learning in this embodiment, such as... Figure 4 As shown, this process is applied to clients in a federated learning system and includes the following steps:

[0097] Step S410: Obtain gradient data from the model trained on the local dataset, and send the gradient data to the first server and the second server in the federated learning system respectively.

[0098] Step S420: Receive the first aggregated update gradient and the second aggregated update gradient sent by the first server and the second server, respectively.

[0099] Step S430: Obtain the target aggregation update gradient based on the first aggregation update gradient and the second aggregation update gradient, and update the local dataset training model based on the target aggregation update gradient.

[0100] Specifically, the client trains a model using a preset local dataset to obtain local gradient data, splits the local gradient data, and sends it to a first server and a second server respectively. Subsequently, the first server and the second server receive the local gradient data and perform interactive calculations to determine the target gradient data in the local gradient data. Then, the first server and the second server interact to securely aggregate the target gradient data, calculate the first aggregated update gradient and the second aggregated update gradient respectively, and send them to the client so that the client can obtain the target aggregated update gradient based on the first aggregated update gradient and the second aggregated update gradient, and update the local dataset training model based on the target aggregated update gradient.

[0101] Through the above steps, the client splits the local gradient data to two servers and obtains the target aggregated update gradient by using the interactive computation of the two cloud servers. This updates the local dataset to train the model, which helps to reduce the time consumption while ensuring privacy-preserving aggregation with Byzantine error tolerance in the federated learning system.

[0102] This embodiment also provides a data processing method based on federated learning. Figure 5 This is a flowchart of another data processing method based on federated learning, as described in this application embodiment. Figure 5 As shown, this process is applied to the second server in the federated learning system, including steps S510 to S530.

[0103] Step S510: Receive gradient data sent by the client and receive the second gradient result sent by the first server.

[0104] Specifically, the second server connects to the client. The second server receives a portion of the local gradient data sent by the client. The client splits each item in the local gradient data into two parts and sends the sets of the two parts to the first and second servers respectively. For example, the local gradient data sent by the client is a set of multiple data items. The sum or product of each gradient data item received by the second server and each gradient data item received by the first server constitutes the set of local gradient data. A preset triplet (a, b, c) is given, where c = a * b. (a, b, c) is split into (a1, b1, c1) and (a2, b2, c2) and sent to the first and second servers respectively. For example, the value of a is the sum of the values ​​of a1 and a2, the value of b is the sum of the values ​​of b1 and b2, and the value of c is the sum of the values ​​of c1 and c2. The first server calculates the second gradient result based on (a1, b1, c1) and the local gradient data received from the client, and sends the second gradient result to the second server.

[0105] Step S520: Determine the target gradient data in the gradient data based on the gradient data and the second gradient result.

[0106] Specifically, the second server calculates the first gradient result based on the multiplication triple data (a2, b2, c2) and the local gradient data received from the client. Based on the first gradient result and the second gradient result, it performs secure calculation of the interactive multiplication triple with the first server, and then filters the target gradient data from the local gradient data.

[0107] Step S530: Receive the second update gradient result sent by the first server; calculate the second aggregated update gradient based on the second update gradient result and the target gradient data, and send the second aggregated update gradient to the client.

[0108] Specifically, the second server receives the second updated gradient result sent by the first server. More specifically, the first server calculates the second updated gradient result based on (a2, b2, c2), the local gradient data received from the client, and the calculated weighting coefficients, and sends the second updated gradient result to the second server. The second server calculates the first updated gradient result based on (a2, b2, c2), the local gradient data received from the client, and the calculated weighting coefficients. Then, based on the first and second updated gradient results, it calculates the second aggregated updated gradient and sends the second aggregated updated gradient to the client.

[0109] In one specific embodiment, the second server receives second gradient data sent by the client, and the local gradient data includes the second gradient data;

[0110] Based on the second gradient data and the preset second triplet data, the first gradient result is generated and sent to the first server;

[0111] Based on the first gradient result and the second gradient result, generate gradient data and;

[0112] Based on the gradient data and determine the target gradient data in the local gradient data.

[0113] In one specific embodiment, the second server determines whether the gradient data is a preset data value;

[0114] When the gradient data sum is determined to be a preset data value, the cosine similarity between the local gradient data and the preset historical aggregated gradient data is calculated.

[0115] When the cosine similarity is within the preset similarity threshold range, the local gradient data is determined as the target gradient data.

[0116] In one specific embodiment, a second weighted gradient result is calculated based on the second triplet data, the target gradient data, and the historical gradient aggregation data, and the second weighted gradient result is sent to the first server;

[0117] Receive the first weighted gradient result sent by the first server, and calculate the second weighted coefficient based on the second weighted gradient result and the first weighted gradient result.

[0118] In one specific embodiment, a second updated gradient result is generated based on the second triplet data, the target gradient data, the historical aggregated gradient data, and the second weighting coefficient, and then sent to the first server;

[0119] Receive the first update gradient result sent by the first server; generate the second aggregated update gradient based on the second update gradient result and the first update gradient result.

[0120] The present embodiment will be described and explained below through specific examples.

[0121] Figure 6 This is a schematic diagram of the federated learning system according to a specific embodiment. (Reference) Figure 6 The system comprises multiple clients, two non-colluding cloud servers, and a trusted third party. The functions of each entity are described below: Trusted Third Party: The trusted third party generates multiplication triples during the online phase and sends them to the first cloud server S1 and the second cloud server S2, then goes offline. Client: The client possesses a local dataset, trains a model based on the local dataset, and obtains model parameters. Malicious attackers may exist within the client. Dual Cloud Servers: The first cloud server S1 and the second cloud server S2 are two non-colluding servers that jointly and securely execute robust federated aggregations that tolerate Byzantine faults. Exemplarily, the first cloud server here is the same as the first server in the aforementioned embodiment, and the second cloud server is the same as the second server in the aforementioned embodiment.

[0122] refer to Figure 6 The federated learning system includes server 1 and server 2. Exemplarily, server 1 represents the first cloud server in the aforementioned embodiment, and server 2 represents the second cloud server in the aforementioned embodiment. Clients 1, 2, ..., n respectively include dataset 1, dataset 2, and dataset n, wherein multiple clients send gradient data to server 1. as well as Send gradient data to server 2 as well as Subsequently, server 1 and server 2 interact and perform computations using the aforementioned federated learning-based data processing method, with server 1 sending gradient data. Server 2 sends gradient data to multiple clients. The poisoning attackers in multiple clients are calculated based on the aforementioned cosine similarity.

[0123] During the federated learning aggregation process, the first cloud server S1 and the second cloud server S2 each initialize a global model gradient data. and In subsequent iterations of federated learning, server S1 retains the aggregation result value from the previous round. Server S2 retains the value from the previous round of aggregation. They are represented as follows:

[0124]

[0125]

[0126] in, and The values ​​of the previous round of aggregation results are retained for the first cloud server S1 and the second cloud server S2, respectively. These represent the previous round aggregation result values ​​corresponding to the dimensions of different gradient data retained by the first cloud server S1; These represent the previous round aggregation result values ​​corresponding to the dimensions of different gradient data retained by the second cloud server S2.

[0127] The data processing method of the federated learning system in this specific embodiment is as follows:

[0128] Step 1: Client i generates gradient data during the k-th round of local model training. The client obtains the local gradient data by splitting it:

[0129]

[0130]

[0131] in, These represent the gradient data of different dimensions of the gradient data received by the first cloud server S1 from the client. These represent gradient data of different dimensions received by the second cloud server S2 from the client; the client will then process the gradient data. Send the gradient data to the first cloud server S1. The data is sent to the second cloud server S2. Exemplarily, the first cloud server S1 and the second cloud server S2 here are the first server and the second server in the aforementioned embodiments; the gradient data here... This refers to the first gradient data in the aforementioned embodiments; the gradient data here... This refers to the second gradient data in the aforementioned embodiments.

[0132] Step 2: The two cloud servers securely interact to calculate the sum of squares of the gradients for each client i, and determine whether the gradient data is normalized.

[0133] Server S1 calculates:

[0134]

[0135]

[0136] Where a1 and b1 represent the multiplication triplet data sent to the first cloud server S1, and m represents the dimension of the gradient data. This represents the gradient data of different dimensions of the gradient data received by the first cloud server S1 from the client, e 1im and f 1im This represents the calculation result of the first cloud server S1, namely the second gradient result in the aforementioned embodiment.

[0137] Server S2 calculation:

[0138]

[0139]

[0140] Where a2 and b2 represent the multiplication triplet data sent to the second cloud server S2, and m represents the dimension of the gradient data. This indicates that the second cloud server S2 receives gradient data of different dimensions from the client, e 2im and f 2im This represents the calculation result of the second cloud server S2, namely the second gradient result in the aforementioned embodiment.

[0141] Subsequently, the first cloud server S1 will e 1im and f 1im Send it to the second cloud server S2, where m∈[1,n]; the second cloud server S2 will send e 2im and f 2im Send to the first cloud server S1, where m∈[1,n].

[0142] The results were obtained through interactive computation between the first cloud server S1 and the second cloud server S2:

[0143] e im =e 1im +e 2im m∈[1,n]

[0144] f im =f 1im +f 2im m∈[1,n]

[0145] Where m represents the dimension of the gradient data, e im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2.

[0146] First Cloud Server S1 Computing:

[0147]

[0148]

[0149] Where a1, b1, and c1 represent the multiplication triplet data sent to the first cloud server S1, e im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2. G represents the normalized gradient data corresponding to gradient data in different dimensions. i_sum1 This represents the total normalized gradient data, i.e., the second gradient result in the aforementioned embodiment.

[0150] Second cloud server S2 computing:

[0151]

[0152]

[0153] Where a2, b2, and c2 represent the multiplication triplet data sent to the second cloud server S2, and e im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2. G represents the normalized gradient data corresponding to gradient data in different dimensions. i_sum2 This represents the total normalized gradient data, i.e., the first gradient result in the aforementioned embodiment.

[0154] The information obtained through interaction between the first cloud server S1 and the second cloud server S2 is as follows:

[0155] G i_sum =G i_sum1 +G i_sum2

[0156] Among them, G i_sum2 G represents the normalized gradient data of the first cloud server S1. i_sum2 G represents the normalized gradient data of the second cloud server S2. i_sum This represents the sum of the normalized gradient data of the first cloud server S1 and the second cloud server S2, i.e., the gradient data sum in the aforementioned embodiments.

[0157] For each client i, if G i_sum If the value is equal to 1, the gradient data is considered to be normal data; if it is not equal to 1, the gradient data is considered to be abnormal data, and the client data is removed.

[0158] Step 3: For each client i, the first cloud server S1 and the second cloud server S2 securely compute the gradient aggregation from the previous round. Calculate cosine similarity of data i,j If the cosine similarity is close to the previous round of aggregated gradient, it is considered normal gradient data; if the cosine similarity is small compared to the previous round, it is considered potentially poisoned data.

[0159] because:

[0160]

[0161] therefore:

[0162]

[0163] Among them, G i The data is normalized, which is the gradient data and sum in the aforementioned embodiments. Let G represent the aggregated gradient from the previous round, and |||| represent the magnitude. Therefore, G i and The modulus of all values ​​is 1. G represents i and The inner product of. G represents i and The product of modulo.

[0164] First Cloud Server S1 Computing:

[0165]

[0166]

[0167] Where a1 and b1 represent the multiplication triplet data sent to the first cloud server S1, and m represents the dimension of the gradient data. This indicates that the first cloud server S1 receives gradient data of different dimensions sent by the client. e represents the aggregate gradient of the first cloud server S1 in the previous round. 1im and f 1im This represents the calculation result of the first cloud server S1.

[0168] Second cloud server S2 computing:

[0169]

[0170]

[0171] Where a2 and b2 represent the multiplication triplet data sent to the second cloud server S2, and m represents the dimension of the gradient data. This indicates that the second cloud server S2 receives gradient data of different dimensions sent by the client. e represents the aggregate gradient of the second cloud server S2 in the previous round. 2im and f 2im This indicates the calculation result of the second cloud server S2.

[0172] The first cloud server S1 will e 1im and f 1im Send it to the second cloud server S2, where m∈[1,n]; server S2 will send e 2im and f 2im Send to the first cloud server S1, where m∈[1,n].

[0173] The results were obtained from calculations performed by the first cloud server S1 and the second cloud server S2:

[0174] e im =e 1im +e 2im m∈[1,n]

[0175] f im =f 1im +f 2im m∈[1,n]

[0176] Where m represents the dimension of the gradient data, e im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2.

[0177] First Cloud Server S1 Computing:

[0178] D im1 =e im f im +a1f im +b1e im +c1,m∈[1,n]

[0179]

[0180] η i1 =cos i1

[0181]

[0182] Where m represents the dimension of the gradient data, eim and f im This represents the interactive calculation result between the first cloud server S1 and the second cloud server S2. a1, b1, and c1 represent the multiplication triplet data sent to the first cloud server S1, respectively, and e... im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2. (D) im1 and cos i1 This represents the intermediate variable used to calculate the weighting coefficients. η1 represents the weighting coefficient of server S1, i.e., the first weighting coefficient in the aforementioned embodiment.

[0183] Second cloud server S2 computing:

[0184] D im2 =a2f m +b2e m +c2,m∈[1,n]

[0185]

[0186] η i2 =cos i2

[0187]

[0188] Where m represents the dimension of the gradient data, e im and f im This represents the interactive calculation result between the first cloud server S1 and the second cloud server S2. a2, b2, and c2 represent the multiplication triplet data sent to the second cloud server S2, respectively. im and f im This represents the result of the interaction calculation between the first cloud server S1 and the second cloud server S2. (D) im2 and cos i2 This represents the intermediate variable used to calculate the weighting coefficients. η2 represents the weighting coefficient of the second cloud server S2, which is the first weighting coefficient in the aforementioned embodiment.

[0189] Step 4: The first cloud server S1 and the second cloud server S2 interact to complete the secure aggregation of gradient data.

[0190] First Cloud Server S1 Computing:

[0191]

[0192] f 1i =η i1 -b1

[0193] Where a1 and b1 represent the multiplication triplet data sent to the first cloud server S1, and m represents the dimension of the gradient data. η represents the gradient data of different dimensions of the gradient data received by the first cloud server S1 from the client. i1 e represents the weighting coefficient of the first cloud server S1. 1im and f 1i This represents the calculation result of the first cloud server S1.

[0194] Second cloud server S2 computing:

[0195]

[0196] f 2i =η i2 -b2

[0197] Where a2 and b2 represent the multiplication triplet data sent to the second cloud server S2, and m represents the dimension of the gradient data. η represents the gradient data of different dimensions of the gradient data received by the second cloud server S2 from the client. i2 e represents the weighting coefficient of the second cloud server S2. 2im and f 2i This indicates the calculation result of the second cloud server S2.

[0198] The first cloud server S1 will e 1im and f 1i Send it to the second cloud server S2, where m∈[1,n]; the second cloud server S2 will send e 2im and f 2i Send to the first cloud server S1, where m∈[1,n];

[0199] The results were obtained through joint computation by the first cloud server S1 and the second cloud server S2:

[0200] e im =e 1im +e 2im m∈[1,n]

[0201] f = f 1i +f 2i

[0202] η = η1 + η2

[0203] First Cloud Server S1 Computing:

[0204] D 1im =e im f 1i +a1f 1i +b1e im +c1,m∈[1,n]

[0205]

[0206] Where m represents the dimension of the gradient data, e im and f im This represents the interactive calculation result between the first cloud server S1 and the second cloud server S2. a1, b1, and c1 represent the multiplication triplet data sent to the first cloud server S1, respectively, and e... im and f im This represents the interactive calculation result of the first cloud server S1 and the second cloud server S2. η1 represents the weighting coefficient of the first cloud server S1, i.e., the first weighting coefficient in the aforementioned embodiment. AGG m1 This represents the aggregated update gradient calculated by the first cloud server S1, which is the first update gradient result in the aforementioned embodiment.

[0207] Second cloud server S2 computing:

[0208] D 2im =a2f 2i +b2e im +c2,m∈[1,n]

[0209]

[0210] Where m represents the dimension of the gradient data, e im and f im This represents the interactive calculation result between the first cloud server S1 and the second cloud server S2. a2, b2, and c2 represent the multiplication triplet data sent to the second cloud server S2, respectively. im and f im This represents the interactive calculation result of the first cloud server S1 and the second cloud server S2. η2 represents the weighting coefficient of the second cloud server S2, which is the first weighting coefficient in the aforementioned embodiment. AGG m2 This represents the aggregated update gradient calculated by the second cloud server S2, which is the second update gradient result in the aforementioned embodiment.

[0211] The first cloud server S1 and the second cloud server S2 respectively will AGG m1 and AGG m2 , and send to each client, where m∈[1,n].

[0212] Step 5: Each client calculates the aggregated update gradient, which is the target aggregated update gradient in the aforementioned embodiment:

[0213] AGG m =AGG m1 +AGG m2

[0214] Among them, AGG m1AGG represents the aggregated update gradient calculated by the first cloud server S1. m2 The aggregated update gradient calculated by the second cloud server S2 is represented by m, which represents the dimension of the gradient data, m∈[1,n]. Then the client performs local federated learning updates based on the aggregated update gradient, that is, updates the local dataset training model in the aforementioned embodiment.

[0215] Figure 7 This is a flowchart of a data processing method based on federated learning, according to a specific embodiment. The data processing method based on federated learning includes the following steps:

[0216] In step S710, each client trains the model locally to obtain gradient data and normalizes the gradient data.

[0217] In step S720, each client sends the gradient data G. i Split into and Uploaded to server S1 and server S2 respectively.

[0218] In step S730, servers S1 and S2 securely interact to determine whether the gradient data uploaded by each client is normalized.

[0219] In step S740, servers S1 and S2 use the normalized gradient data and the aggregation results from the previous round to calculate the cosine similarity.

[0220] In step S750, servers S1 and S2 securely interact to calculate the weighting coefficients of gradient data for each client. η1 and η2 are obtained respectively.

[0221] In step S760, servers S1 and S2 securely calculate the gradient-weighted aggregate value for each client, and servers S1 and S2 respectively obtain the AGG. m1 and AGG m2 This information is then returned to each client.

[0222] Step S770, each client obtains AGG m1 and AGG m2 Then calculate the aggregation gradient AGG m =AGG m1 +AGG m2 Use Aggregated Gradients (AGG) to update the local model.

[0223] Specifically, each client trains the model locally to obtain gradient data and normalizes the gradient data; each client then transmits the gradient data G. i Split into and The gradient data is uploaded to the first cloud server S1 and the second cloud server S2 respectively; the first cloud server S1 and the second cloud server S2 securely interact to determine whether the gradient data uploaded by each client is normalized; the first cloud server S1 and the second cloud server S2 use the normalized gradient data and the previous round of aggregation results to calculate the cosine similarity; the first cloud server S1 and the second cloud server S2 securely interact to calculate the weighting coefficient of the gradient data of each client. First cloud server S1 and second cloud server S2 obtain η1 and η2 respectively; first cloud server S1 and second cloud server S2 securely calculate the gradient weighted aggregation value AGG for each client, and first cloud server S1 and second cloud server S2 obtain AGG respectively. m1 and AGG m2 m∈[1,n], returned to each client; each client obtains AGG m1 and AGG m2 m∈[1,n]. Then calculate the aggregate gradient AGG. m =AGG m1 +AGG m2 Use Aggregated Gradients (AGG) to update the local model.

[0224] It should be noted that the steps shown in the above process or the flowcharts in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. This embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0225] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0226] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0227] S1 receives local gradient data sent by the client and first gradient results sent by the second server.

[0228] S2, based on the local gradient data and the first gradient result, determine the target gradient data in the local gradient data.

[0229] S3, receive the first update gradient result sent by the second server; calculate the first aggregate update gradient based on the first update gradient result and the target gradient data, and send the first aggregate update gradient to the client.

[0230] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0231] Furthermore, in conjunction with the federated learning-based data processing method provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the federated learning-based data processing methods described in the above embodiments.

[0232] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0233] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0234] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0235] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A federated learning system, characterized in that, The system includes interconnected clients, a first server, and a second server; The client is configured to obtain local gradient data from the local dataset training model and send the local gradient data to the first server and the second server respectively; receive the first aggregated update gradient and the second aggregated update gradient sent by the first server and the second server; obtain the target aggregated update gradient based on the first aggregated update gradient and the second aggregated update gradient, and update the local dataset training model based on the target aggregated update gradient. The first server is used to receive local gradient data sent by the client and to receive the first gradient result sent by the second server; Based on the local gradient data and the first gradient result, the target gradient data in the local gradient data is determined; Receive the first updated gradient result sent by the second server; Based on the first update gradient result and the target gradient data, a first aggregated update gradient is calculated and sent to the client; The second server is used to receive gradient data sent by the client and to receive the second gradient result sent by the first server; Based on the gradient data and the second gradient result, the target gradient data in the gradient data is determined; The system receives the second update gradient result sent by the first server; calculates the second aggregated update gradient based on the second update gradient result and the target gradient data, and sends the second aggregated update gradient to the client.

2. A data processing method based on federated learning, characterized in that, The method, applied to a first server in the federated learning system as described in claim 1, comprises: Receive local gradient data sent by the client and receive the first gradient result sent by the second server; Based on the local gradient data and the first gradient result, the target gradient data in the local gradient data is determined; Receive the first updated gradient result sent by the second server; Based on the first update gradient result and the target gradient data, a first aggregated update gradient is calculated and sent to the client.

3. The data processing method based on federated learning according to claim 2, characterized in that, The step of determining the target gradient data in the local gradient data based on the local gradient data and the first gradient result includes: Receive the first gradient data sent by the client, wherein the local gradient data includes the first gradient data; Based on the first gradient data and the preset first triplet data, a second gradient result is generated and sent to the second server; Based on the second gradient result and the first gradient result, generate gradient data and; Based on the gradient data, the target gradient data in the local gradient data is determined.

4. The data processing method based on federated learning according to claim 3, characterized in that, The step of determining the target gradient data in the local gradient data based on the gradient data includes: Determine whether the gradient data is a preset data value; When the gradient data sum is determined to be a preset data value, the cosine similarity between the gradient data sum and the preset historical aggregated gradient data is calculated. When the cosine similarity is within a preset similarity threshold range, the local gradient data is determined to be the target gradient data.

5. The data processing method based on federated learning according to claim 3, characterized in that, After determining the target gradient data in the local gradient data and before calculating the first aggregated update gradient, the process includes: Based on the first triplet data, the target gradient data, and the historical gradient aggregation data, a first weighted gradient result is calculated and sent to the second server. The system receives the second weighted gradient result sent by the second server and calculates the first weighting coefficient based on the first weighted gradient result and the second weighted gradient result.

6. The data processing method based on federated learning according to claim 5, characterized in that, The step of calculating the first aggregated update gradient based on the first update gradient result and the target gradient data includes: Based on the first triplet data, the target gradient data, the historical aggregated gradient data, and the first weighting coefficient, a first updated gradient result is generated and sent to the second server; Receive the second update gradient result sent by the second server; generate the first aggregated update gradient based on the first update gradient result and the second update gradient result.

7. A data processing method based on federated learning, characterized in that, Applied to a client in the federated learning system as described in claim 1, the method includes: Gradient data is obtained from training the model using a local dataset, and the gradient data is sent to the first server and the second server in the federated learning system, respectively. Receive the first aggregated update gradient and the second aggregated update gradient sent by the first server and the second server, respectively. The target aggregation update gradient is obtained based on the first aggregation update gradient and the second aggregation update gradient, and the local dataset training model is updated based on the target aggregation update gradient.

8. A data processing method based on federated learning, characterized in that, The method, applied to a second server in the federated learning system as described in claim 1, comprises: Receive gradient data sent by the client and receive the second gradient result sent by the first server; Based on the gradient data and the second gradient result, the target gradient data in the gradient data is determined; Receive the second updated gradient result sent by the first server; Based on the second update gradient result and the target gradient data, a second aggregated update gradient is calculated and sent to the client.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the data processing method based on federated learning as described in any one of claims 2 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data processing method based on federated learning as described in any one of claims 2 to 8.