Federated learning methods, devices, and storage media

By using a ring communication link to transmit a mask and superimpose sample label statistical vectors in federated learning to generate scrambled statistical vectors, and the central server calculates the global statistical vectors and determines the distribution ratio, the problems of low global model training efficiency and high privacy leakage risk are solved, achieving more efficient model training and lower privacy leakage risk.

CN122154975APending Publication Date: 2026-06-05UNIV OF MACAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610266367.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Current federated learning schemes suffer from low global model training efficiency and insufficient accuracy, as well as a high risk of client privacy leaks. This is mainly due to differences in client data distribution and the transmission of sample statistical information.

Method used

By transmitting masks and superimposing sample label statistical vectors between clients in a ring communication link, scrambled statistical vectors are generated. The central server calculates the global statistical vector and determines the global data distribution ratio, which is then sent to the clients for local data sampling and model training. The global model is then updated in conjunction with a preset aggregation algorithm.

Benefits of technology

It improves the training efficiency and accuracy of the global model, reduces the risk of privacy leaks on the client side, protects data privacy through masking technology, and achieves a more efficient federated learning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154975A_ABST
    Figure CN122154975A_ABST
Patent Text Reader

Abstract

The application provides a federated learning method, device and storage medium, and relates to the technical field of machine learning. The method sequentially transmits masks between each client in the ring communication link, and respectively superimposes the masks on the basis of the sample label statistical vector to obtain a scrambled statistical vector that cannot obtain real data through back propagation. The center server receives the scrambled statistical vectors uploaded by each client, combines a preset aggregation algorithm to calculate and obtain a global statistical vector, combines a distribution information determination algorithm to determine the corresponding global data distribution proportion, and implements the global data distribution proportion to each client to control the appropriate client to perform local data sampling and complete local model training according to the global data distribution proportion. Finally, the center server receives the model update data of each client to update the global model, thereby improving the training efficiency and precision of the global model in the federated learning process and reducing the risk of client privacy leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to a federated learning method, device, and storage medium. Background Technology

[0002] Federated learning is an emerging distributed machine learning approach. Its core idea is to train a global model by coordinating multiple clients (such as mobile devices and edge nodes) to work together without centralizing the original data.

[0003] Current federated learning schemes typically involve each client independently training its model using local data, and then uploading updated model data (such as gradients or model parameters) to a central server for aggregation. This process completes the training of the central server's global model while protecting user data privacy.

[0004] However, due to the significant differences in data distribution among different clients, uploading the model update data from each client to the central server for aggregation may cause a decrease in the global model accuracy and slow convergence due to these differences in data distribution. Furthermore, when each client uploads its own model update data, the central server may also need to obtain the sample statistics of each client, which may lead to privacy risks for each client. It is evident that the current federated learning scheme has low global model training efficiency, insufficient accuracy, and a high risk of client privacy leakage. Summary of the Invention

[0005] The main purpose of this application is to propose a federated learning method, device, and storage medium, which aims to improve the training efficiency and accuracy of the global model in the federated learning process and reduce the risk of client privacy leakage.

[0006] In a first aspect, the present invention provides a federated learning method applied to a central server of a federated learning system, the federated learning system further comprising: multiple clients, each client being communicatively connected to the central server, and the multiple clients forming a ring communication link; the method comprising: Receive scrambling statistical vectors uploaded by multiple clients; wherein, the scrambling statistical vectors include: sample label statistical vectors with superimposed masks; The global statistical vector is calculated and obtained based on the scrambled statistical vector and the preset aggregation algorithm; Based on the global statistical vector and distribution information, an algorithm is used to determine the global data distribution ratio corresponding to the global statistical vector; The global data distribution ratio is distributed to each client so that each client performs local data sampling according to the global data distribution ratio and completes local model training based on the sampled local data. The system receives model update data from each client after completing local model training. This model update data is used to update the global model in the central server.

[0007] In an optional implementation, the sample label statistical vector of the overlay mask includes: a local data statistical vector, a first mask vector, and a second mask vector; Wherein, the first mask vector is a vector randomly generated by each client according to the dimension of the corresponding local data statistics vector, and the second mask vector is the first mask vector of the previous adjacent client received by each client through the ring communication link.

[0008] In an optional implementation, the step of calculating and obtaining the global statistical vector based on the scrambled statistical vector and a preset aggregation algorithm includes: Based on the scrambling statistical vector and formula Calculate and obtain the global statistical vector; in, For the global statistical vector, The number of clients, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

[0009] In an optional implementation, the step of determining the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information determination algorithm includes: Based on the global statistical vector and formula Determine the global data distribution ratio corresponding to the global statistical vector; in, For the global sample labels corresponding to the global statistical vector, the first... The proportion of global sample labels. , The total number of categories of the global sample labels. , for The The component represents the m-th component in the client. The number of local samples corresponding to the global sample label described in the class. for The The nth component represents the nth component. The number of global samples corresponding to the global sample label described in the class.

[0010] In an optional implementation, the method further includes: Receive the local sample plan sampling quantity and device information uploaded by each of the aforementioned clients; Based on the planned local sample quantity, the device information, and the preset participating device selection algorithm, the client participating in the current training round is determined. If the client is the client participating in the current training round, local data sampling is performed according to the corresponding planned local sample quantity, and local model training for the current training round is completed based on the sampled local data.

[0011] Secondly, the present invention provides a federated learning method applied to a client of a federated learning system, the federated learning system comprising: a central server and multiple clients, each client being communicatively connected to the central server, and the multiple clients sharing a ring communication link; the method comprising: The scrambling statistical vector is transmitted to the central server; wherein the scrambling statistical vector includes: a sample label statistical vector with superimposed mask; so that the central server calculates and obtains a global statistical vector based on the scrambling statistical vector and a preset aggregation algorithm; and determines the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and a distribution information determination algorithm; Receive the global data distribution ratio sent by the central server; Local data sampling is performed according to the global data distribution ratio, and local model training is completed based on the sampled local data; The model update data after local model training is completed is sent to the central server. The model update data is used by the central server to update the global model in the central server.

[0012] In an optional implementation, after performing local data sampling according to the global data distribution ratio and completing local model training based on the sampled local data, the method further includes: Based on the sampled local data, determine the remaining local data status; Based on the global data distribution ratio and the remaining local data, update the corresponding bottleneck label, and repeat the steps of local data sampling and local model training to complete at least one new training round of local model training.

[0013] Thirdly, the present invention provides a federated learning device, comprising: The first receiving module is configured to receive scrambling statistical vectors uploaded by multiple clients; wherein the scrambling statistical vectors include: sample label statistical vectors with superimposed masks; The aggregation module is used to calculate and obtain the global statistical vector based on the scrambled statistical vector and the preset aggregation algorithm; The distribution module is used to determine the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information and to determine the algorithm. The distribution module is used to distribute the global data distribution ratio to each client, so that each client performs local data sampling according to the global data distribution ratio and completes local model training based on the sampled local data. The first receiving module is further configured to receive model update data after each client has completed local model training, and the model update data is used to update the global model in the central server.

[0014] Fourthly, the present invention provides a federated learning device, comprising: An upload module is used to transmit scrambled statistical vectors to the central server; wherein, the scrambled statistical vectors include: sample label statistical vectors with superimposed masks; so that the central server can calculate and obtain a global statistical vector based on the scrambled statistical vectors and a preset aggregation algorithm; and determine the global data distribution ratio corresponding to the global statistical vectors based on the global statistical vectors and a distribution information determination algorithm; The second receiving module is used to receive the global data distribution ratio sent by the central server; The sampling module is used to perform local data sampling according to the global data distribution ratio, and to complete local model training based on the sampled local data; The upload module is also used to send model update data after local model training is completed to the central server, and the model update data is used by the central server to update the global model in the central server.

[0015] Fifthly, the present invention provides a central server, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the central server is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method described in the first aspect above.

[0016] In a sixth aspect, the present invention provides a client comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the client is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method described in the second aspect above.

[0017] In a seventh aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method as described in the first or second aspect above.

[0018] The beneficial effects of this application are: The federated learning method provided in this application includes: receiving scrambled statistical vectors uploaded by multiple clients in a ring communication link, wherein the scrambled statistical vectors are obtained by each client sequentially transmitting a mask through the ring communication link and superimposing the mask on the sample label statistical vector; calculating and obtaining a global statistical vector based on the scrambled statistical vectors and a preset aggregation algorithm; determining the global data distribution ratio corresponding to the global statistical vectors by combining the distribution information determination algorithm; distributing the global data distribution ratio to each client so that the appropriate client can perform local data sampling according to the global data distribution ratio and complete local model training based on the sampled local data; and finally receiving the model update data after each client has completed local model training and updating the global model through the model update data. In this embodiment, masks are sequentially transmitted between clients in a ring communication link, and masks are superimposed on the sample label statistical vectors to obtain scrambled statistical vectors that cannot be obtained by reverse engineering. The central server receives the scrambled statistical vectors uploaded by each client, calculates the global statistical vector using a preset aggregation algorithm, and then determines the corresponding global data distribution ratio using a distribution information determination algorithm. This enables the global data distribution ratio to be distributed to each client, allowing appropriate clients to perform local data sampling and complete local model training according to the global data distribution ratio. Finally, the central server receives the model update data from each client to update the global model, thereby improving the training efficiency and accuracy of the global model in the federated learning process and reducing the risk of client privacy leakage. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic diagram of a federated learning system architecture is provided as an embodiment of this application; Figure 2 A schematic diagram of a federated learning method provided in one embodiment of this application; Figure 3 A schematic diagram of a federated learning method provided for another embodiment of this application; Figure 4 A schematic diagram of a federated learning method is provided as another embodiment of this application; Figure 5 A schematic diagram of a federated learning method is provided as another embodiment of this application; Figure 6 A complete federated learning flowchart is provided for one embodiment of this application; Figure 7 A schematic diagram of the structure of a federated learning device provided in one embodiment of this application; Figure 8 A schematic diagram of the structure of a federated learning device provided in one embodiment of this application; Figure 9 A schematic diagram of the structure of a central server provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a client provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0022] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0023] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0024] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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. Without further limitations, 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 said element.

[0025] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0026] Current federated learning schemes typically involve each client independently training its model using local data, and then uploading updated model data (such as gradients or model parameters) to a central server for aggregation. This process completes the training of the central server's global model while protecting user data privacy.

[0027] However, due to the significant differences in data distribution among different clients, uploading the model update data from each client to the central server for aggregation may cause a decrease in the global model accuracy and slow convergence on the central server due to these differences in data distribution. Furthermore, when each client uploads its own model update data, the central server may also need to obtain the sample statistics information of each client. Even if this sample statistics information is encrypted, third parties may still illegally obtain the data through reverse reasoning, abnormal decryption, or other means, which may lead to privacy risks for each client. It is evident that the current federated learning scheme has low global model training efficiency, insufficient accuracy, and a high risk of client privacy leakage.

[0028] To address the aforementioned issues, the main objective of this application is to propose a federated learning method that aims to improve the training efficiency and accuracy of the global model during the federated learning process, while reducing the risk of client privacy leaks.

[0029] Figure 1 A schematic diagram of a federated learning system architecture provided in one embodiment of this application is shown below. Figure 1 The aforementioned federated learning system includes a central server and multiple clients, all of which are connected to the central server and form a ring communication link among the multiple clients.

[0030] For example, the central server may be a server device with computing power, and the client may be a computer or other device with computing power, but is not limited thereto. The central server may deploy a global model, and each client may deploy a local model. It is understood that in order to train or update the global model through the model parameters of the local model in each client, the model parameters of the global model and the model parameters of the local model may have the same or similar parameter scale, parameter form, etc., but there are no specific restrictions here.

[0031] like Figure 1 As shown, the aforementioned clients form a ring communication link. For example, this could mean that the clients are connected in a ring in the order of first client → second client → third client → ... → last client → first client. It is understood that the aforementioned... Figure 1 The four clients mentioned are just one possible example; the actual number of clients is not limited to four, but can be adjusted and determined according to the actual situation. Figure 1 For example, with four clients, the next client after the first client is the second client, and the previous client after the first client is the last client. Similarly, the next client after the second client is the third client, and the previous client after the second client is the first client, and so on.

[0032] In addition to deploying a local model, each of the aforementioned clients can also store multiple local data entries. These local data entries can be categorized and stored according to data type. It is understood that the categories of local data in each client can be the same. For example, if a federated learning system has five categories of local data, then each client in each federated learning system stores all five categories of local data, but this is not a limitation.

[0033] Each type of local data mentioned above can, for example, correspond to a local sample label. This local sample label can be used as a classification index or classification identifier for the local data to indicate a corresponding local data category. The categories of local data in different clients within the same federated learning system can be the same, and therefore the local sample labels corresponding to the local data in each client of the federated learning system can be the same. In this case, each client in the federated learning system can share a set of global sample labels as their respective local sample labels.

[0034] Each of the aforementioned clients can also be equipped with a random number generator. This random number generator can generate a mask vector with the same dimension as the sample label statistical vector corresponding to the local sample label in the client, which can be used as encrypted data. However, the specific sample label statistical vector form, mask vector form, and specific encryption method can all be selected and determined according to the actual situation, and are not restricted here.

[0035] Figure 2 This application provides a schematic diagram of a federated learning method flow according to an embodiment of the present application. The execution entity of this method may be, for example, the one described above. Figure 1 The example uses the central server of the federated learning system, but is not limited to this; please refer to [reference needed]. Figure 2 The method includes: S201. Receive scrambling statistical vectors uploaded by multiple clients. These scrambling statistical vectors include: sample label statistical vectors with superimposed masks.

[0036] For example, before receiving scrambled statistical vectors uploaded by multiple clients, each client in the federated learning system can obtain the sample label statistical vectors based on its own local sample labels and the local data corresponding to each local sample label. Then, through the random number generator, a mask vector with the same dimension is generated based on the dimension of the sample label statistical vector. The mask vector and the sample label statistical vector are then superimposed by concatenation or fusion to obtain the scrambled statistical vector corresponding to each client.

[0037] In one possible implementation, after each client generates a mask vector with the same dimension based on the dimension of its own sample label statistical vector, it can also send the generated mask vector to the next client through the aforementioned ring communication link. In this way, each client can receive the mask vector from the previous client. Based on this, the scrambling statistical vector corresponding to each client can also be obtained by superimposing its own mask vector, the mask vector of the previous client, and its own sample label statistical vector. However, the specific superposition method is not specifically limited here and can be adjusted and determined according to the actual situation.

[0038] After obtaining the scrambling statistical vector, each client can, for example, upload the scrambling statistical vector to the central server through its own communication connection with the central server.

[0039] S202. Based on the above scrambled statistical vector and preset aggregation algorithm, calculate and obtain the global statistical vector.

[0040] For example, the aforementioned preset aggregation algorithm may refer to an algorithm in the central server used to process the scrambled statistical vectors uploaded by each client, thereby calculating summary information that can reflect the overall situation of all data. The specific type and form of the algorithm can be adjusted and determined according to the actual situation, and are not limited here. After receiving the scrambled statistical vectors uploaded by all clients, the central server can execute the algorithm.

[0041] Specifically, the preset aggregation algorithm can perform operations, including but not limited to vector summation, on each scrambled statistical vector received by the central server to eliminate the interference components (i.e., masks) used for privacy protection without cracking the privacy information in each scrambled statistical vector, thereby restoring the summary result of the original data statistics of all clients, i.e., the aforementioned global statistical vector.

[0042] For example, the aforementioned global statistical vector could be a multi-dimensional vector, where the value in each dimension represents the total number of samples of the corresponding category across all clients in the entire system. Taking the federated learning system as an example with 5 categories of data, the global statistical vector calculated based on the scrambled statistical vector and the preset aggregation algorithm could be a 5-dimensional vector, where the first component represents the total number of samples of the first category across all clients, and so on. However, the specific form of the global statistical vector is not limited to the example above.

[0043] S203. Based on the above global statistical vector and distribution information, determine the algorithm to determine the global data distribution ratio corresponding to the above global statistical vector.

[0044] For example, the aforementioned distribution information determination algorithm may refer to the algorithm in the aforementioned central server used to convert the aforementioned global statistical vector reflecting the absolute number of samples into statistical information reflecting the relative proportion of samples of each category. However, the specific type and form of the distribution information determination algorithm can be adjusted and determined according to the actual situation, and are not limited here.

[0045] Specifically, the distribution information determination algorithm can, for example, analyze the component values ​​of each dimension in the global statistical vector and calculate the percentage of the number of samples in each category to the total number of samples in all categories, thereby obtaining the global data distribution ratio.

[0046] For example, suppose the global statistical vector above shows that the total number of samples of type I in all clients of the federated learning system is 1000 (i.e., the total number of local data in each client corresponding to the global label of type I, the same below), the total number of samples of type II in all clients of the federated learning system is 2000, and the total number of samples of all categories in all clients of the federated learning system is 10000. Then, by using this distribution information to determine the algorithm, we can find that the global data distribution ratio corresponding to type I samples is 10%, and the global data distribution ratio corresponding to type II samples is 20%. This global data distribution ratio is used to describe the distribution ratio of each type of data in the entire federated learning system.

[0047] It is understood that the above are merely possible examples, and the actual determination of the number of samples of each type, the classification of samples, and the proportion of global data distribution is not limited to the examples above.

[0048] S204. The above-mentioned global data distribution ratio is distributed to each of the above-mentioned clients, so that each of the above-mentioned clients performs local data sampling according to the above-mentioned global data distribution ratio and completes local model training based on the sampled local data.

[0049] For example, after calculating the global data distribution ratio, the central server will distribute the global data distribution ratio to each client through communication connections. Upon receiving the global data distribution ratio, each client can, for example, compare the distribution of its local data by category with the received global data distribution ratio, and determine the number of samples to be extracted from each category of local data based on a preset sampling strategy. This sampling strategy could be, for example, a strategy that maximizes the number of local data samples while ensuring that the distribution ratio of the sampled local data is the same as the global data distribution ratio; however, the specific content and form of this sampling strategy are not limited here. It is understood that when each client performs local data sampling according to the global data distribution ratio, it can randomly sample its local data, ultimately forming, for example, a local dataset for this round of training.

[0050] Finally, each client can train the local model using its own local dataset, such as iteratively updating the model parameters, to complete the local model training. How each client trains the local model based on its local dataset can be determined based on factors such as the type of local model; no specific restrictions are imposed here.

[0051] S205. Receive model update data from each of the aforementioned clients after they have completed local model training. The model update data is used to update the global model in the aforementioned central server.

[0052] For example, after each client completes local model training based on the sampled local data, it generates corresponding model update data. This model update data can, for example, represent the changes in model parameters during local model training. Each client uploads the model update data after local model training to the central server to provide feedback to the central server on the changes in model parameters during the current local model training.

[0053] The specific form of the aforementioned model update data can be determined based on the design or communication protocol of the federated learning system. For example, the model update data could be the update amount of model parameters, i.e., the difference between the model parameters of the local model before and after the current training round; alternatively, the model update data could be the complete model parameters of the local model after training; or it could be gradient information calculated during training, etc. However, the specific form of the model update data is not limited to the examples mentioned above.

[0054] After receiving the model update data from each of the aforementioned clients after they have completed local model training, the central server can perform a fusion calculation on the model update data, for example, using a preset model aggregation algorithm, to obtain a global model update value. For example, the model aggregation algorithm could be a weighted average algorithm, but it is not limited to this. Finally, the central server applies the global model update value to the update of the global model, but the specific method for updating the global model is not limited here.

[0055] The federated learning method provided in this application includes: receiving scrambled statistical vectors uploaded by multiple clients in a ring communication link, wherein the scrambled statistical vectors are obtained by each client sequentially transmitting a mask through the ring communication link and superimposing the mask on the sample label statistical vector; calculating and obtaining a global statistical vector based on the scrambled statistical vectors and a preset aggregation algorithm; determining the global data distribution ratio corresponding to the global statistical vectors by combining the distribution information determination algorithm; distributing the global data distribution ratio to each client so that the appropriate client can perform local data sampling according to the global data distribution ratio and complete local model training based on the sampled local data; and finally receiving the model update data after each client has completed local model training and updating the global model through the model update data. In this embodiment, masks are sequentially transmitted between clients in a ring communication link, and masks are superimposed on the sample label statistical vectors to obtain scrambled statistical vectors that cannot be obtained by reverse engineering. The central server receives the scrambled statistical vectors uploaded by each client, calculates the global statistical vector using a preset aggregation algorithm, and then determines the corresponding global data distribution ratio using a distribution information determination algorithm. This enables the global data distribution ratio to be distributed to each client, allowing appropriate clients to perform local data sampling and complete local model training according to the global data distribution ratio. Finally, the central server receives the model update data from each of the above clients to update the global model, thereby improving the training efficiency and accuracy of the global model in the federated learning process and reducing the risk of client privacy leakage.

[0056] Optionally, in the above Figure 2 Based on the embodiments, the sample label statistical vector of the above-mentioned superimposed mask includes: local data statistical vector, first mask vector, and second mask vector.

[0057] Wherein, the first mask vector is a vector randomly generated by each of the aforementioned clients according to the dimension of the corresponding local data statistical vector, and the second mask vector is the first mask vector of the previous adjacent client received by each of the aforementioned clients through the aforementioned ring communication link.

[0058] For example, the aforementioned local data statistics vector may refer to the above... Figure 2 In the embodiment, the local sample labels and the statistical vectors of the local data corresponding to each local sample label, the first mask vector mentioned above may refer to the mask vector of each client, and the second mask vector may refer to the mask vector received by each client from the previous client.

[0059] The sample label statistical vector of the above-mentioned overlay mask can be represented as: local data statistical vector + first mask vector - second mask vector. For example, taking a federated learning system with 4 clients, the local data statistical vectors of these 4 clients can be represented as A1~A4 respectively, and the mask vectors of these 4 clients can be represented as B1~B4 respectively. For the first client, it receives the mask vector from the previous client, that is, it receives the mask vector B4 from the fourth client. The sample label statistical vector of the overlay mask for the first client can be represented as A1+B1-B4. Similarly, the sample label statistical vector of the overlay mask for the second client can be represented as A2+B2-B1, the sample label statistical vector of the overlay mask for the third client can be represented as A3+B3-B2, and the sample label statistical vector of the overlay mask for the fourth client can be represented as A4+B4-B3.

[0060] Continuing with the example above, the global statistical vector is calculated based on the scrambled statistical vector and the preset aggregation algorithm. For instance, the sample label statistical vectors of the overlay mask corresponding to the first client are added to the sample label statistical vectors of the overlay mask corresponding to the fourth client, resulting in: (A1+B1-B4)+(A2+B2-B1)+(A3+B3-B2)+(A4+B4-B3)=A1+A2+A3+A4. It can be seen that the preset aggregation algorithm eliminates the interference components (i.e., the mask) used for privacy protection without cracking the privacy information in each scrambled statistical vector. However, for the sample label statistical vector of the overlay mask corresponding to each client, due to the existence of the first and second mask vectors, it is uploaded to the central server in the form of a non-real value. Therefore, it is impossible to reverse-engineer the real data of a client based on the scrambled statistical vector uploaded by a single client, effectively protecting client privacy.

[0061] Furthermore, based on the above embodiments, the calculation of the global statistical vector according to the scrambled statistical vector and the preset aggregation algorithm includes: The global statistical vector is obtained by calculating the scrambled statistical vector described above and the following formula:

[0062] in, For the above global statistical vector, For the number of clients mentioned above, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

[0063] Furthermore, based on the above embodiments, the algorithm for determining the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information includes: The global data distribution ratio corresponding to the above global statistical vector is determined based on the above global statistical vector and the following formula:

[0064] in, For the global sample labels corresponding to the above global statistical vector, the first... The proportion of global sample labels. , This represents the total number of categories for the global sample labels mentioned above. , for The The component represents the m-th client. The number of local samples corresponding to the global sample labels mentioned above. for The The nth component represents the nth component. The number of global samples corresponding to the global sample labels mentioned above.

[0065] Figure 3 A schematic diagram of a federated learning method flow provided for another embodiment of this application, such as... Figure 3 As shown, optionally, in the foregoing Figure 2 Based on the embodiments, the above method further includes: S301. Receive the local sample plan sampling quantity and device information uploaded by each of the above clients.

[0066] For example, the planned sampling quantity of the aforementioned local samples may refer to the amount of local data that each client can sample, based on the distribution ratio of the received global data, while ensuring that the distribution ratio of the sampled local data is the same as the distribution ratio of the global data, so as to maximize the amount of local data sampled. This amount of local data may, for example, reflect the maximum sample size (i.e., the maximum amount of local data) that the corresponding client can currently use for local model training.

[0067] The aforementioned device information may refer to data describing the device status, capabilities, or attributes of the client. Its specific content can be defined according to the management requirements of the federated learning system, and may include, but is not limited to: the client's computing power (e.g., CPU frequency, memory size), network conditions (e.g., bandwidth, latency), device identifier, current battery level, historical training performance (e.g., average loss value, contribution score), or whether it is in an idle / available state. The clients upload the calculated local sample plan sampling quantity and their respective device information to the central server, which can better provide a basis for the central server's subsequent scheduling decisions.

[0068] S302. Based on the above-mentioned local sample plan sampling quantity, the above-mentioned device information, and the preset participating device selection algorithm, determine the above-mentioned clients participating in the current training round. If the above-mentioned client is a client participating in the current training round, then perform local data sampling according to the corresponding above-mentioned local sample plan sampling quantity, and complete the local model training of the current training round based on the sampled local data.

[0069] For example, the aforementioned preset participant selection algorithm may include, but is not limited to, the Oort algorithm (a systematic participant selection framework designed to improve the overall training efficiency of federated learning), the REFL (Resource-Efficient Federated Learning) algorithm, the FedAvg (Federated Averaging) algorithm, and other algorithms. After receiving the local sample plan sampling quantity and device information from each client, the central server will execute the aforementioned preset participant selection algorithm to select some clients from the current clients of the federated learning system to participate in the current training round.

[0070] Specifically, the preset participating device selection algorithm comprehensively evaluates and filters clients based on the planned sampling quantity of local samples reported by each client and the aforementioned device information. This filters clients with abundant local data, and / or strong computing power, and / or stable network conditions, and / or excellent historical training performance, to participate in the current training round, thereby improving the convergence speed and stability of this training round. For example, the preset participating device selection algorithm can output a list of clients participating in the current training round. Of course, the above is only one possible example; the actual types, forms, and filtering criteria of the preset participating device selection algorithm can be adjusted and determined according to the actual situation, and are not limited to the examples above.

[0071] Figure 4This application provides a schematic diagram of a federated learning method flowchart, which can be implemented by, for example, the method described above. Figure 1 The example uses a client for the federated learning system, but is not limited to this; please refer to [reference needed]. Figure 4 The method includes: S401. Transmit the scrambling statistical vector to the central server. The scrambling statistical vector includes a sample label statistical vector with an overlay mask. This allows the central server to calculate and obtain a global statistical vector based on the scrambling statistical vector and a preset aggregation algorithm. Furthermore, based on the global statistical vector and distribution information, an algorithm is used to determine the global data distribution ratio corresponding to the global statistical vector.

[0072] S402, Receive the global data distribution ratio sent by the central server.

[0073] S403. Perform local data sampling according to the above global data distribution ratio, and complete local model training based on the sampled local data.

[0074] S404. Send the model update data after the local model training is completed to the central server. The model update data is used by the central server to update the global model in the central server.

[0075] Optionally, the sample label statistical vector of the above-mentioned overlay mask includes: local data statistical vector, first mask vector, and second mask vector.

[0076] Wherein, the first mask vector is a vector randomly generated by each of the aforementioned clients according to the dimension of the corresponding local data statistical vector, and the second mask vector is the first mask vector of the previous adjacent client received by each of the aforementioned clients through the aforementioned ring communication link.

[0077] Furthermore, based on the above embodiments, the calculation of the global statistical vector according to the scrambled statistical vector and the preset aggregation algorithm includes: The global statistical vector is obtained by calculating the scrambled statistical vector described above and the following formula:

[0078] in, For the above global statistical vector, For the number of clients mentioned above, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

[0079] Furthermore, based on the above embodiments, the algorithm for determining the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information includes: The global data distribution ratio corresponding to the above global statistical vector is determined based on the above global statistical vector and the following formula:

[0080] in, For the global sample labels corresponding to the above global statistical vector, the first... The proportion of global sample labels. , This represents the total number of categories for the global sample labels mentioned above. , for The The component represents the m-th client. The number of local samples corresponding to the global sample labels mentioned above. for The The nth component represents the nth component. The number of global samples corresponding to the global sample labels mentioned above.

[0081] In addition, in the aforementioned Figure 4 Based on the embodiments, the above method further includes: The local sample plan sampling quantity and device information are transmitted to the central server, so that the central server can determine the clients participating in the current training round based on the local sample plan sampling quantity, the device information, and the preset participating device selection algorithm.

[0082] If the aforementioned client is one of the clients participating in the current training round, then local data sampling will be performed according to the corresponding local sample plan sampling quantity, and the local model training for the current training round will be completed based on the sampled local data.

[0083] Figure 5 A schematic diagram of a federated learning method is provided as another embodiment of this application, such as... Figure 5 As shown, optionally, in the foregoing Figure 4 Based on the embodiments, after performing local data sampling according to the global data distribution ratio and completing local model training based on the sampled local data, the above method further includes: S501. Determine the remaining local data based on the sampled local data.

[0084] For example, the local data of each client mentioned above can be one-time sampled data. That is, after local data sampling is performed according to the global data distribution ratio, the sampled local data cannot be sampled again. Other local data that was not sampled in this local data sampling is the aforementioned remaining local data. The quantity and distribution of the remaining local data is the aforementioned remaining local data situation.

[0085] For example, suppose a client's local data is divided into three categories, with 900 records in each category. The client then stores 2700 local data records. Assuming the global data distribution ratio corresponding to the first local data sampling is 1:2:3 for the first category, the third category is the first to be exhausted. The local sample label / global sample label corresponding to the third category is the client's current bottleneck label, indicating the upper limit of the current local data constraint. Based on the 900 third-category data records, the number of first-category and second-category data records can be further determined. In this example, 300 first-category data records and 600 second-category data records can be sampled. Finally, based on the sampled local data, the client determines the remaining local data: 600 first-category data records, 300 second-category data records, and 0 third-category data records.

[0086] Specifically, based on the already determined bottleneck labels and the number of data points under their corresponding data categories, the number of data points under other data categories can be further determined, for example, using the following formula:

[0087]

[0088] Among them, the above is the resampling coefficient, used to represent the sampling ratio of the m-th client for the k-th type of data. Bottleneck label for the m-th client The number of data items under the corresponding data category. The bottleneck label for the m-th client The corresponding global data distribution ratio, Let represent the set of clients in the federated learning system during the local model training in the r-th training epoch. It is the set of all global sample labels. For the m-th client, the first... The number of data points under each global sample label corresponding to a data category, which is the number of data points under other data categories determined based on the already determined number of data points under the bottleneck label and its corresponding data category.

[0089] Of course, the above is just one possible example. The actual types and quantities of local data, as well as the methods for determining the quantity of data under other data categories, are not limited to the examples above.

[0090] S502. Based on the above global data distribution ratio and the above remaining local data situation, update the corresponding bottleneck labels, and repeat the steps of local data sampling and local model training to complete at least one new training round of local model training.

[0091] For example, based on the global data distribution ratio and the remaining local data, the corresponding bottleneck labels are updated, and the steps of local data sampling and local model training are repeated. After completing at least one new training epoch of local model training, the process can stop, for example, when a preset number of epochs is reached, such as after completing 5 epochs of local model training, but this is not a limitation. Alternatively, the process can stop when the local data on each client is consumed to a certain amount, for example, when the average number of local data items per client is less than 1000. Of course, the above is just one possible example, and the specific number of new training epochs of local model training to be completed can be adjusted and determined according to the actual situation, and is not limited here.

[0092] To facilitate understanding of the complete process of the federal learning system in this application, Figure 6 For a complete federated learning flowchart provided for one embodiment of this application, please refer to... Figure 6 The complete process of the federal learning system in this application during the federal learning process includes: S6001. Each client generates a mask vector with the same dimension based on the dimension of its own sample label statistical vector, and sends the mask vector to the next client.

[0093] S6002. Each client generates its own scrambling statistical vector based on its local data statistical vector, the corresponding mask vector (first mask vector), and the mask vector of the previous client (second mask vector).

[0094] S6003, each client transmits scrambling statistical vectors to the central server.

[0095] S6004. The central server receives scrambled statistical vectors uploaded by multiple clients and calculates and obtains the global statistical vector based on the scrambled statistical vectors and the preset aggregation algorithm.

[0096] S6005. The central server determines the algorithm based on the global statistical vector and distribution information to determine the global data distribution ratio corresponding to the global statistical vector.

[0097] S6006: The central server distributes the global data distribution ratio to each client.

[0098] S6007. Each client receives the global data distribution ratio sent by the central server and determines the current bottleneck label and the amount of data under the corresponding data category based on the global data distribution ratio.

[0099] S6008. Each client determines the amount of data in other data categories based on the amount of data in the data category corresponding to the bottleneck label.

[0100] S6009. Each client determines the local sample plan sampling quantity based on the data quantity under the data category corresponding to the bottleneck label and the data quantity under other corresponding data categories.

[0101] S6010: Each client root transmits the local sample plan sampling quantity and equipment information to the central server.

[0102] S6011. The central server receives the local sample plan sampling quantity and device information uploaded by each client. Based on the local sample plan sampling quantity, device information, and preset participating device selection algorithm, it determines the clients participating in the current training round.

[0103] S6012. The client participating in the current training round performs local data sampling according to the corresponding local sample plan sampling quantity, and completes the local model training for the current training round based on the sampled local data.

[0104] S6013. Each client sends the model update data after completing local model training to the central server, and determines the remaining local data based on the sampled local data.

[0105] S6014. Update the corresponding bottleneck labels based on the global data distribution ratio and the remaining local data.

[0106] S6015. Repeat steps S6007-S6014 until the preset stop condition is met.

[0107] Figure 7 This is a schematic diagram of a federated learning device according to an embodiment of this application. The federated learning device can perform the above-described... Figures 2-3 The federated learning method in this embodiment can be integrated into devices with computing capabilities, such as the aforementioned central server. Figure 7 As shown, the device may include: The first receiving module 710 is used to receive scrambling statistical vectors uploaded by multiple clients. These scrambling statistical vectors include: sample label statistical vectors with superimposed masks.

[0108] The aggregation module 720 is used to calculate and obtain the global statistical vector based on the above scrambled statistical vector and the preset aggregation algorithm.

[0109] The distribution module 730 is used to determine the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information.

[0110] The distribution module 740 is used to distribute the global data distribution ratio to each of the aforementioned clients, so that each of the aforementioned clients can perform local data sampling according to the global data distribution ratio and complete local model training based on the sampled local data.

[0111] The first receiving module 710 is also used to receive model update data after each client has completed local model training. The model update data is used to update the global model in the central server.

[0112] The federated learning method provided in this application includes: receiving scrambled statistical vectors uploaded by multiple clients in a ring communication link, wherein the scrambled statistical vectors are obtained by each client sequentially transmitting a mask through the ring communication link and superimposing the mask on the sample label statistical vector; calculating and obtaining a global statistical vector based on the scrambled statistical vectors and a preset aggregation algorithm; determining the global data distribution ratio corresponding to the global statistical vectors by combining the distribution information determination algorithm; distributing the global data distribution ratio to each client so that the appropriate client can perform local data sampling according to the global data distribution ratio and complete local model training based on the sampled local data; and finally receiving the model update data after each client has completed local model training and updating the global model through the model update data. In this embodiment, masks are sequentially transmitted between clients in a ring communication link, and masks are superimposed on the sample label statistical vectors to obtain scrambled statistical vectors that cannot be obtained by reverse engineering. The central server receives the scrambled statistical vectors uploaded by each client, calculates the global statistical vector using a preset aggregation algorithm, and then determines the corresponding global data distribution ratio using a distribution information determination algorithm. This enables the global data distribution ratio to be distributed to each client, allowing appropriate clients to perform local data sampling and complete local model training according to the global data distribution ratio. Finally, the central server receives the model update data from each of the above clients to update the global model, thereby improving the training efficiency and accuracy of the global model in the federated learning process and reducing the risk of client privacy leakage.

[0113] Optionally, the sample label statistical vector of the overlay mask includes: a local data statistical vector, a first mask vector, and a second mask vector. The first mask vector is a vector randomly generated by each client based on the dimension of the corresponding local data statistical vector, and the second mask vector is the first mask vector received by each client from the preceding neighboring client through the ring communication link.

[0114] Optionally, the aggregation module 720 is specifically used to perform the aggregation based on the scrambling statistical vector and formula described above. Calculate and obtain the global statistical vector. Among them, For the above global statistical vector, For the number of clients mentioned above, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

[0115] Optionally, the aforementioned distribution module 730 is specifically used to calculate the global statistical vector and formula described above. Determine the global data distribution proportion corresponding to the above global statistical vector. Among them, For the global sample labels corresponding to the above global statistical vector, the first... The proportion of global sample labels. , This represents the total number of categories for the global sample labels mentioned above. , for The The component represents the m-th client. The number of local samples corresponding to the global sample labels mentioned above. for The The nth component represents the nth component. The number of global samples corresponding to the global sample labels mentioned above.

[0116] Optionally, the first receiving module 710 is further configured to receive the local sample plan sampling quantity and device information uploaded by each of the aforementioned clients.

[0117] The aforementioned federated learning device further includes: a determination module, used to determine the clients participating in the current training round based on the aforementioned local sample plan sampling quantity, the aforementioned device information, and a preset participating device selection algorithm, wherein if the aforementioned client is a client participating in the current training round, local data sampling is performed according to the corresponding aforementioned local sample plan sampling quantity, and local model training for the current training round is completed based on the sampled local data.

[0118] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0119] Figure 8 This is a schematic diagram of a federated learning device according to an embodiment of this application. The federated learning device can perform the above-described... Figures 4-5 The federated learning method in this embodiment can be integrated into devices with computing capabilities, such as the aforementioned client. Figure 8 As shown, the device may include: The upload module 810 is used to transmit scrambled statistical vectors to the central server. These scrambled statistical vectors include sample label statistical vectors with superimposed masks. This allows the central server to calculate and obtain a global statistical vector based on the scrambled statistical vectors and a preset aggregation algorithm. Furthermore, based on the global statistical vectors and distribution information, an algorithm is used to determine the global data distribution ratio corresponding to the global statistical vectors.

[0120] The second receiving module 820 is used to receive the global data distribution ratio sent by the central server.

[0121] The sampling module 830 is used to perform local data sampling according to the above-mentioned global data distribution ratio, and to complete local model training based on the sampled local data.

[0122] The aforementioned upload module 810 is also used to send model update data after local model training is completed to the aforementioned central server. The aforementioned model update data is used by the aforementioned central server to update the global model in the aforementioned central server.

[0123] Optionally, the sample label statistical vector of the overlay mask includes: a local data statistical vector, a first mask vector, and a second mask vector. The first mask vector is a vector randomly generated by each client based on the dimension of the corresponding local data statistical vector, and the second mask vector is the first mask vector received by each client from the preceding neighboring client through the ring communication link.

[0124] Optionally, the upload module 810 is specifically used to enable the central server to apply the scrambling statistical vector and formula. Calculate and obtain the global statistical vector. Among them, For the above global statistical vector, For the number of clients mentioned above, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

[0125] Optionally, the aforementioned upload module 810 is specifically used to enable the aforementioned central server to perform the global statistical vector and formula. Determine the global data distribution proportion corresponding to the above global statistical vector. Among them, For the global sample labels corresponding to the above global statistical vector, the first... The proportion of global sample labels. , This represents the total number of categories for the global sample labels mentioned above. , for The The component represents the m-th client. The number of local samples corresponding to the global sample labels mentioned above. for The The nth component represents the nth component. The number of global samples corresponding to the global sample labels mentioned above.

[0126] Optionally, the upload module 810 can also be used to transmit the local sample plan sampling quantity and device information to the central server, so that the central server can determine the client participating in the current training round based on the local sample plan sampling quantity, the device information, and the preset participating device selection algorithm.

[0127] The aforementioned federated learning device may further include: a training module, configured to, if the aforementioned client is a client participating in the current training round, perform local data sampling according to the corresponding local sample plan sampling quantity, and complete local model training for the current training round based on the sampled local data.

[0128] Optionally, the federated learning device may further include: an update module, used to determine the remaining local data based on the sampled local data. Based on the global data distribution ratio and the remaining local data, the corresponding bottleneck label is updated, and the steps of local data sampling and local model training are repeated to complete at least one new training epoch of local model training.

[0129] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0130] Figure 9 This is a schematic diagram of the structure of a central server provided in an embodiment of this application. The central server can be a device with computing power, such as the aforementioned server. Figure 9 As shown, the central server 900 includes: The processor 910, storage medium 920, and bus 930 are connected via bus 930.

[0131] The storage medium 920 stores machine-readable instructions executable by the processor 910. When the central server is running, the processor 910 executes these machine-readable instructions to perform the aforementioned tasks. Figures 2-3 The federated learning method in the embodiments.

[0132] It should be understood that, Figure 9 The structure shown is only a schematic diagram of the central server; the central server may also include components such as... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown. Figure 9 The components shown can be implemented using hardware, software, or a combination thereof.

[0133] Figure 10 This is a schematic diagram of a client structure provided in an embodiment of this application. The client can be a device with computing power, such as the aforementioned computer. Figure 10 As shown, the client 1000 includes: The processor 1010, storage medium 1020, and bus 1030 are connected in communication via bus 1030.

[0134] The storage medium 1020 stores machine-readable instructions executable by the processor 1010. When the client runs, the processor 1010 executes the aforementioned machine-readable instructions to perform the above-mentioned tasks. Figures 4-5 The federated learning method in the embodiments.

[0135] It should be understood that, Figure 10 The structure shown is only a schematic diagram of the client-side structure; the client may also include more... Figure 10 The more or fewer components shown, or having the same Figure 10 The different configurations shown. Figure 10 The components shown can be implemented using hardware, software, or a combination thereof.

[0136] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the federated learning method described in the above method embodiments.

[0137] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media includes non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program exhibits. The program code can be compressed, for example, in a suitable form.

[0138] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program exhibits according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0139] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0140] If the functionality is implemented as a software module and sold or used as an independent exhibit, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software exhibit. This computer software exhibit is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0141] The above description is merely a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural transformations made based on the inventive concept of this application and the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.

Claims

1. A federated learning method, characterized in that, A central server is used in a federated learning system, which further includes multiple clients, all of which are communicatively connected to the central server, and a ring communication link is formed among the multiple clients. The method includes: Receive scrambling statistical vectors uploaded by multiple clients; wherein the scrambling statistical vectors include: sample label statistical vectors with superimposed masks; The global statistical vector is calculated and obtained based on the scrambled statistical vector and the preset aggregation algorithm; Based on the global statistical vector and distribution information, an algorithm is used to determine the global data distribution ratio corresponding to the global statistical vector; The global data distribution ratio is distributed to each client so that each client performs local data sampling according to the global data distribution ratio and completes local model training based on the sampled local data. The system receives model update data from each client after completing local model training. This model update data is used to update the global model in the central server.

2. The federated learning method according to claim 1, characterized in that, The sample label statistical vector of the overlay mask includes: local data statistical vector, first mask vector, and second mask vector; Wherein, the first mask vector is a vector randomly generated by each client according to the dimension of the corresponding local data statistics vector, and the second mask vector is the first mask vector of the previous adjacent client received by each client through the ring communication link.

3. The federated learning method according to claim 2, characterized in that, The step of calculating and obtaining the global statistical vector based on the scrambled statistical vector and the preset aggregation algorithm includes: Based on the scrambling statistical vector and formula Calculate and obtain the global statistical vector; in, For the global statistical vector, The number of clients, This is the first mask vector corresponding to the m-th client. For the m-th second mask vector, This is the local data statistics vector corresponding to the m-th client.

4. The federated learning method according to claim 3, characterized in that, The algorithm for determining the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and distribution information includes: Based on the global statistical vector and formula Determine the global data distribution ratio corresponding to the global statistical vector; in, For the global sample labels corresponding to the global statistical vector, the first... The proportion of global sample labels. , The total number of categories of the global sample labels. , for The The component represents the m-th component in the client. The number of local samples corresponding to the global sample label described in the class. for The The nth component represents the nth component. The number of global samples corresponding to the global sample label described in the class.

5. The federated learning method according to claim 1, characterized in that, The method further includes: Receive the local sample plan sampling quantity and device information uploaded by each of the aforementioned clients; Based on the planned local sample quantity, the device information, and the preset participating device selection algorithm, the client participating in the current training round is determined. If the client is the client participating in the current training round, local data sampling is performed according to the corresponding planned local sample quantity, and local model training for the current training round is completed based on the sampled local data.

6. A federated learning method, characterized in that, A client application for a federated learning system, the federated learning system comprising: a central server and multiple clients, each client communicating with the central server, and the multiple clients sharing a ring communication link, the method comprising: The scrambling statistical vector is transmitted to the central server; wherein the scrambling statistical vector includes: a sample label statistical vector with superimposed mask; so that the central server calculates and obtains a global statistical vector based on the scrambling statistical vector and a preset aggregation algorithm; and determines the global data distribution ratio corresponding to the global statistical vector based on the global statistical vector and a distribution information determination algorithm; Receive the global data distribution ratio sent by the central server; Local data sampling is performed according to the global data distribution ratio, and local model training is completed based on the sampled local data; The model update data after local model training is completed is sent to the central server. The model update data is used by the central server to update the global model in the central server.

7. The federated learning method according to claim 6, characterized in that, After performing local data sampling according to the global data distribution ratio and completing local model training based on the sampled local data, the method further includes: Based on the sampled local data, determine the remaining local data status; Based on the global data distribution ratio and the remaining local data, update the corresponding bottleneck label, and repeat the steps of local data sampling and local model training to complete at least one new training round of local model training.

8. A central server, characterized in that, include: The processor, storage medium, and bus are provided, wherein the storage medium stores machine-readable instructions executable by the processor, and when the central server is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1-5.

9. A client, characterized in that, include: A processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the client is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 6-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1-7.