A method, apparatus, device, and storage medium for selecting federated learning clients.
By selecting clients based on reward ratio and latency score in hierarchical federated learning, the problem of client attribution in overlapping edge server regions is solved, achieving an efficient and low-latency training process and improving model convergence speed and computational efficiency.
Patent Information
- Application Number
- CN202310468937.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-04-26
AI Technical Summary
In hierarchical federated learning, the client attribution problem in overlapping areas of multiple edge servers leads to extended training time, and existing methods have failed to effectively address the latency and cost issues of client selection.
By sorting clients within each edge server region according to their return on investment, selecting the candidate client set that meets the budget, calculating latency scores, determining the candidate client set with the highest scores, marking the selected set, and clearing the unmarked set, the process continues until all servers are complete.
It effectively solves the client attribution problem in overlapping areas of multiple edge servers, ensuring high training efficiency and low latency, and improving the model's convergence speed and computational efficiency.
Smart Images

Figure CN116614498B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and in particular to a method, apparatus, device, and storage medium for selecting federated learning clients. Background Technology
[0002] With the rapid development of the internet, massive amounts of data are generated daily, creating opportunities for learning-based artificial intelligence. Unlike traditional federated learning, hierarchical federated learning eliminates direct interaction between terminal devices and the central server. Instead, model parameters are uploaded to edge servers located closer to the network. These edge servers train their clients for several rounds before uploading the model parameters back to the central server for aggregation. This significantly reduces communication time and provides a more stable network connection. However, unlike the central server, edge servers typically handle client selection and training within a small area. This leads to overlapping regions where clients reside on multiple edge servers. When an edge server independently selects a client, multiple edge servers may simultaneously select the same client. Limited by the client's computing and communication capabilities, it can only participate in training on one edge server, significantly extending the overall training time. Summary of the Invention
[0003] The main objective of this invention is to provide a federated learning client selection method, apparatus, device, and storage medium that can select clients for each edge server sequentially based on the budget of each edge server, effectively solving the client attribution problem in overlapping areas of multiple edge servers, while ensuring high training efficiency. Furthermore, by selecting a set of clients with low latency and low cost for training, the convergence speed of the model is greatly accelerated, and the computational efficiency is improved.
[0004] Firstly, this application provides a method for selecting a federated learning client, the method comprising the steps of:
[0005] Clients within the region corresponding to each edge server are sorted according to their return on investment, and clients that meet the budget of each edge server are selected to determine the candidate client set for each edge server.
[0006] Calculate the latency score for each client in the candidate client set of each edge server, and determine the candidate client set with the highest score, where the latency score is the reward that the client participating in the training brings to the server;
[0007] All clients in the candidate client set with the highest score, as well as the edge server corresponding to the candidate client set with the highest score, are marked as selected. The candidate client sets of the remaining unmarked edge servers are cleared until all edge servers have been marked.
[0008] In conjunction with the first aspect mentioned above, as an optional implementation method, the return ratio for clients within the region corresponding to each edge server is determined based on the ratio of the estimated return sent by the client to the edge server to the client's bid price.
[0009] Sort the clients in the region corresponding to each edge server in descending order of their return ratio, and find the minimum number of clients that meet the budget of each edge server.
[0010] The minimum client is used as the threshold, and clients ranked before the minimum client are selected one by one.
[0011] Based on the selected client, a set of candidate clients is generated.
[0012] In conjunction with the first aspect mentioned above, as an optional implementation method, according to the formula... For the k-th round of training, the reward of client j on edge server e based on upper bound confidence UCB is... The latency score for the client's UCB. To determine whether client i has been selected by the server in round k, Let $e$ be the budget for each edge server $e$ during the $k$ round of training.
[0013] In conjunction with the first aspect mentioned above, as an optional implementation method, when selecting a client, according to the formula... Restrict the selection of clients, among which For the k-th round, the reward received by client i for participating in training on edge server e is... In the k-th round, is client i selected to participate in training on edge server e? For the k-th round, the set of clients selected by edge server e.
[0014] In conjunction with the first aspect mentioned above, as an optional implementation method, according to the formula... Calculate the latency score for the client in this round of training, where Let the latency score of client i under edge server e be . In the k-th round, at the time when edge server e receives the model parameters from client i, Let t be the start time of the kth round of training.max Define the maximum time for a predefined training round;
[0015] Based on the latency score obtained from this round of training by the client, according to the formula... Calculate the average latency score of all clients in the candidate client set, where This represents the number of times client i has been selected by edge server e up to the (k-1)th round of training. Let α be the latency score of client i on edge server e during k-1 rounds of training, and let α be the parameter for adjusting historical latency and β be the parameter for adjusting latency in the current round. The average latency score of all clients in the client set. This represents the number of times client i has been selected by edge server e up to round k.
[0016] The candidate client set with the highest score is determined based on the sum of the latency scores of all clients in the candidate client set.
[0017] In conjunction with the first aspect mentioned above, as an optional implementation, the model is initialized by a central server and then distributed to each edge server.
[0018] Each edge server will train the model individually for each client in the candidate client set it is distributed to.
[0019] After each client completes training, it uploads the trained model parameters to the corresponding edge server. The edge server records the time when it receives the model parameters from each client to update the number of times the client is selected and the latency score.
[0020] In conjunction with the first aspect mentioned above, as an optional implementation method, the latest model parameters are uploaded to the central server for aggregation based on the number of local training rounds on the edge servers. After the central server completes the aggregation, the parameters are redistributed to each edge server to update the local model of the edge server itself.
[0021] Secondly, this application provides a federated learning client selection device, the device comprising:
[0022] The selection module is used to sort the clients in the region corresponding to each edge server according to the return ratio and select the clients that meet the budget of each edge server to determine the candidate client set for each edge server.
[0023] The calculation module is used to calculate the latency score of each client in the candidate client set of each edge server and determine the candidate client set with the highest score, wherein the latency score is the reward that the client participating in the training brings to the server;
[0024] The marking module is used to mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and to clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked.
[0025] Thirdly, this application also provides an electronic device, the electronic device comprising: a processor; and a memory storing computer-readable instructions, which, when executed by the processor, implement the method described in any one of the first aspects.
[0026] Fourthly, this application also provides a computer-readable storage medium storing computer program instructions that, when executed by a computer, cause the computer to perform the method described in any of the first aspects.
[0027] This application provides a method, apparatus, device, and storage medium for selecting clients in federated learning. The method includes the following steps: sorting clients within the region corresponding to each edge server according to their reward ratio, and selecting clients that meet the budget of each edge server to determine a candidate client set for each edge server; calculating the latency score of each client in the candidate client set of each edge server, and determining the candidate client set with the highest score, where the latency score represents the reward brought to the server by the client participating in training; marking all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and clearing the candidate client sets of the remaining unmarked edge servers until all edge servers have been marked. This application can select clients for each edge server sequentially according to the budget of each edge server, effectively solving the client attribution problem in overlapping areas of multiple edge servers, while ensuring training efficiency. Furthermore, by selecting a client set with low latency and low cost for training, it greatly accelerates the model's convergence speed and improves computational efficiency.
[0028] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit the invention. Attached Figure Description
[0029] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0030] Figure 1 This is a flowchart of a federated learning client selection method provided in the embodiments of this application;
[0031] Figure 2 This is a schematic diagram of a federated learning client selection device provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of this application;
[0033] Figure 4 This is a schematic diagram of a computer-readable program medium provided in an embodiment of this application. Detailed Implementation
[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0035] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the drawings represent functional entities and do not necessarily correspond to physically or logically independent entities.
[0036] This application provides a federated learning client selection method, apparatus, device, and storage medium that can select clients for each edge server sequentially based on the budget of each edge server. This effectively solves the client attribution problem in overlapping areas of multiple edge servers, while ensuring high training efficiency. Furthermore, by selecting a set of clients with low latency and low cost for training, the convergence speed of the model is greatly accelerated, and computational efficiency is improved.
[0037] To achieve the aforementioned technical effects, the general concept of this application is as follows:
[0038] A method for selecting federated learning clients, the method comprising the steps of:
[0039] S101: Sort the clients in the region corresponding to each edge server according to the return ratio, and select the clients that meet the budget of each edge server to determine the candidate client set of each edge server.
[0040] S102: Calculate the latency score of each client in the candidate client set of each edge server, and determine the candidate client set with the highest score, wherein the latency score is the reward that the client participating in the training brings to the server.
[0041] S103: Mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked.
[0042] The embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0043] Reference Figure 1 , Figure 1 The diagram shown is a flowchart of a federated learning client selection method provided by the present invention. Figure 1 As shown, the method includes the following steps:
[0044] Step S101: Sort the clients in the region corresponding to each edge server according to the return ratio, and select the clients that meet the budget of each edge server to determine the candidate client set of each edge server.
[0045] Specifically, for an edge server e, clients within its corresponding region are first sorted in descending order of their reward ratio. The smallest client j that satisfies the budget of each edge server is then identified. Clients preceding j are selected as a threshold to generate a candidate client set. It should be noted that the reward ratio is the ratio of the estimated reward a client sends to the edge server to the client's bid price, i.e., the reward received per unit bid. It's important to understand that edge servers, similar to base stations, are only responsible for selecting and training clients within a single region. Sorts clients within the server's region in descending order of their reward ratio reduces latency caused by the "fallback effect," thereby accelerating the training process.
[0046] In one embodiment, a budget B is preset for each edge server in each training round. Within budget B, as many clients as possible are selected, sorted in descending order of r / b (reward ratio), i.e., those with higher reward ratios are selected first. Clients are selected one by one. To ensure realism and individual rationality, a critical payout rule is used to pay a reward P to each winning client. Due to the limited budget, it is necessary to find the smallest client j that satisfies the budget. Only when a client before j wins can it receive a reward; otherwise, the total reward payout would exceed the edge server's budget. It should be noted that the descending reward ratio sorting is used to select clients to maximize the use of the total budget for selecting as many clients as possible. Each edge server performs this operation to select as many clients as possible, using the selected clients to generate a candidate client set for each edge server.
[0047] It's important to note that the budget for each edge server is preset, not calculated. For example, each edge server might have a budget of 100 per round. Because the budget for each edge server is limited, while the number of clients within its service area is large, only a portion of the clients can be selected to participate in this round of training based on the budget.
[0048] The bidding price for edge server e, For the k-th round of training, the reward of client j on edge server e based on upper bound confidence UCB is... The latency score for the client's UCB. To determine whether client i has been selected by the server in round k, Let $e$ be the budget for each edge server $e$ during the $k$ round of training.
[0049] In one embodiment, when a client is selected, according to the formula Restrict the selection of clients, among which For the k-th round, the reward received by client i for participating in training on edge server e is... In the k-th round, is client i selected to participate in training on edge server e? For the k-th round, the set of clients selected by edge server e.
[0050] It should be noted that while ensuring authenticity and individual rationality, clients are usually not mindless machines, but rational and selfish individuals. If their benefits cannot be guaranteed, they will not be willing to participate in the training, because it consumes server resources and time.
[0051] It should also be noted that the formula is: For any edge server e, the sum of the rewards for the selected clients does not exceed its own budget limit, as stated in the formula. For any client selected by the edge server, the reward they receive is greater than their bid price, according to the formula. The client-side value range is 0 and 1, where 0 represents that the client did not select it, and 1 represents that the client selected it. (Formula) This means that the same client cannot be selected by multiple edge servers.
[0052] Step S102: Calculate the latency score of each client in the candidate client set of each edge server, and determine the candidate client set with the highest score, wherein the latency score is the reward brought to the server by the client participating in the training.
[0053] Specifically, according to the formula Calculate the latency score for the client in this round of training, where Let the latency score of client i under edge server e be . In the k-th round, at the time when edge server e receives the model parameters from client i, Let t be the start time of the kth round of training. max The maximum time for a predefined training round is defined. It should be noted that the latency score can be understood as the reward that participating clients bring to the server.
[0054] Based on the latency score obtained from this round of training by the client, according to the formula... Calculate the average latency score of all clients in the candidate client set, where This represents the number of times client i has been selected by edge server e up to the (k-1)th round of training. Let α be the latency score of client i on edge server e during k-1 training rounds, and β be the parameter for adjusting historical latency and current latency. It should be noted that the average latency score is a weighted average of the client's historical scores, which can be understood as the historical average return.
[0055] It's important to note that the average latency score is calculated by weighting client i's latency score in the current round on edge server e with the average latency scores from previous rounds. Calculating the average latency score provides an up-to-date assessment of the client's latency. Changes in the client's network environment will affect the average latency score. For example, if the client's network environment deteriorates, the client's average latency score on this edge server will decrease after the current round, thus impacting client selection in the next round.
[0056] The average latency score is used to calculate the UCB-based latency score, which directly affects the selection of clients in the next round.
[0057] It should also be noted that the latest latency of the client is often a better representation of the client's current network condition, and therefore is usually more important than the historical latency. When implementing it, you can set specific values, such as α=1 and β=2.
[0058] The average latency score of all clients in the client set. This represents the number of times client i has been selected by edge server e up to round k.
[0059] The candidate client set with the highest score is determined based on the sum of the latency scores of all clients in the candidate client set.
[0060] For ease of understanding, an example is provided, based on the candidate clients corresponding to each determined edge server. Calculate the latency score of UCB for all clients in each candidate client group to determine the total score for all candidate clients, i.e., the latency score of all clients. sum.
[0061] It should be noted that UCB is an upper confidence bound algorithm. The idea is that clients with high average latency scores have high availability, while clients that have not been selected or have been selected less often have high exploration value. Exploration value can be measured by uncertainty measure, and the upper bound of the sum of the two is taken to replace the client latency assessment.
[0062] UCB's latency score is calculated using the average latency score. The main purpose of calculating the UCB latency score is to better balance exploration and exploitation when selecting clients.
[0063] Step S103: Mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked.
[0064] Specifically, the edge server of the selected client is marked as Edge servers that do not select clients are marked as Where k is the number of training rounds, and e is the edge server;
[0065] Mark the client selected by the edge server as Clients not selected by the edge server are marked as Where k is the number of training rounds and i is the client.
[0066] To illustrate this more clearly, first, all edge servers are sorted in descending order of reward ratio, and clients are selected. At this point, each edge server has a candidate client set (the clients in different sets may overlap). Then, the total score of the clients in each edge server's candidate set is calculated, and the set with the highest score is selected. This client set and its corresponding edge server are marked as selected, and the candidate client sets of the other edge servers are cleared. The above process is then repeated. For example, for three edge servers a, b, and c, the candidate client sets calculated in this round are a1, b1, and c1, respectively. Assuming that all clients in a1 have the highest score, then all clients in a1 are marked as selected, and b1 and c1 are cleared. Then, the above process is repeated for b and c (clients already marked as selected cannot be nominated again).
[0067] Understandably, calculating each All clients The sum of the values is used to select the edge server with the largest sum and mark it as selected. At the same time, its client collection All client i are marked as selected. Clear all After selecting the candidate client set for the edge servers, repeat the above operation on these remaining edge servers until all edge servers have been selected.
[0068] In one embodiment, one intermediate cloud server, S edge servers, and N clients are defined. Each edge server has several clients. φ is defined. e,t This refers to the set of clients within the range of edge server e at round t. There may be overlapping areas between different edge servers. Due to limitations in client computing power and bandwidth, clients in overlapping regions can only participate in the training of one edge server per round. In the k-th round of training, assuming the start time is... Client i submits its bid to participate in the training of edge server e. use This indicates that client i participates in the training of edge server e in the kth round. Conversely, use This indicates that in round k, client i has not yet been selected by any client. This indicates that the server has been selected. The set of clients selected by edge server e in round t is... And provide a reward for each of these clients. Meanwhile, the budget for edge server e in this round (round t) is The time it takes for edge server e to receive the model parameters from client i is The maximum time for one round of training is t max That is, exceeding t max The edge server then stops receiving model parameters from the client. This represents the number of times client i has been selected by edge server e up to round k.
[0069] In one embodiment, a central server initializes the model and distributes it to each edge server. Each edge server then distributes the model to each client in its corresponding candidate client set for individual training. After each client completes its training, it uploads the trained model parameters to the corresponding edge server. The edge server records the time it receives the model parameters from each client to update the number of times the client has been selected and its latency score. It should be noted that the edge servers initially do not have a model; the cloud server distributes the model to the edge servers, and only then can the edge servers distribute the model to clients for local training.
[0070] In one embodiment, the problem of minimizing the training time per round can be modeled as a formula. It should be noted that minimizing modeling means making each round take as short as possible, thereby shortening the overall training process of federated learning.
[0071] In one embodiment, each edge server a distributes the model to the set. Each client, after completing local training, uploads its model parameters to the corresponding edge server. Simultaneously, the edge server records the time it receives the model parameters from each client and updates the number of times that client has been selected. And calculate and updates Then, the latency score based on UCB is calculated. Meanwhile, the edge server completes this round of parameter aggregation.
[0072] Tc is a user-defined value that represents how many rounds of local training are performed on the edge servers before the edge servers upload the model parameters to the central server.
[0073] In one embodiment, Tc=0, then each edge server uploads the latest model parameters to the central server for aggregation, and after the central server completes the aggregation, it redistributes them to each edge server, and the edge server updates its local model.
[0074] In one embodiment, experiments were conducted under various budgets on the edge servers. s = 4 edge servers and n = 40 clients were used. Each client had the same amount of data, but it was not independently identically distributed (Non-iID). Each client's bid in each round was a constant between (0.5, 1). The budget for each edge server in each round was uniformly B. The longest round duration t in the MNIST dataset was also considered. max =10s, the longest time t for each round in the CIFAR10 dataset. max =120s, per T c =In the third round, the edge server uploads the model to the central server for aggregation, and the training is fixed at 30 rounds.
[0075] Understandably, this application selects clients for each edge server sequentially based on the client's bidding situation, combined with the client's historical latency and training quality, and according to the budget of each edge server. This effectively solves the problem of overlapping areas of edge servers, while ensuring the efficiency of training, as well as the authenticity of user bids, individual rationality, and computational efficiency.
[0076] Reference Figure 2 , Figure 2 The diagram shown is a schematic of a federated learning client selection device provided by the present invention. Figure 2 As shown, the device includes:
[0077] Selection module 201: It is used to sort the clients in the region corresponding to each edge server according to the return ratio and select the clients that meet the budget of each edge server to determine the candidate client set of each edge server.
[0078] Calculation module 202: It is used to calculate the latency score of each client in the candidate client set of each edge server and determine the candidate client set with the highest score, wherein the latency score is the reward that the client participating in the training brings to the server.
[0079] The marking module 203 is used to mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and to clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked.
[0080] Furthermore, in one possible implementation, the selection module 201 is also used to determine the return ratio of the client in the region corresponding to each edge server based on the ratio of the estimated return sent by the client to the edge server to the client's bid price.
[0081] Sort the clients in the region corresponding to each edge server in descending order of their return ratio, and find the minimum number of clients that meet the budget of each edge server.
[0082] The minimum client is used as the threshold, and clients ranked before the minimum client are selected one by one.
[0083] Based on the selected client, a set of candidate clients is generated.
[0084] Furthermore, in one possible implementation, the computing module 202 is also used for root... Bidding price, For the k-th round of training, the reward of client j on edge server e based on upper bound confidence UCB is... The latency score for the client's UCB. To determine whether client i has been selected by the server in round k, Let $e$ be the budget for each edge server $e$ during the $k$ round of training.
[0085] Furthermore, in one possible implementation, a restriction module is also included, which is used to, when a client is selected, according to the formula Restrict the selection of clients, among which For the k-th round, the reward received by client i for participating in training on edge server e is... In the k-th round, is client i selected to participate in training on edge server e? For the k-th round, the set of clients selected by edge server e.
[0086] Furthermore, in one possible implementation, the calculation module 202 is also used to calculate according to the formula Calculate the latency score for the client in this round of training, where Let the latency score of client i under edge server e be . In the k-th round, at the time when edge server e receives the model parameters from client i, Let t be the start time of the kth round of training. max Define the maximum time for a predefined training round;
[0087] Based on the latency score obtained from this round of training by the client, according to the formula... Calculate the average latency score of all clients in the candidate client set, where This represents the number of times client i has been selected by edge server e up to the (k-1)th round of training. Let α be the latency score of client i on edge server e during k-1 rounds of training, and let α be the parameter for adjusting historical latency and β be the parameter for adjusting latency in the current round. The average latency score of all clients in the client set. This represents the number of times client i has been selected by edge server e up to round k.
[0088] The candidate client set with the highest score is determined based on the sum of the latency scores of all clients in the candidate client set.
[0089] Furthermore, in one possible implementation, an update module is also included, which is used to initialize the model through the central server and distribute the model to each edge server;
[0090] Each edge server will train the model individually for each client in the candidate client set it is distributed to.
[0091] After each client completes training, it uploads the trained model parameters to the corresponding edge server. The edge server records the time when it receives the model parameters from each client to update the number of times the client is selected and the latency score.
[0092] Furthermore, in one possible implementation, the update module is also used to upload the latest model parameters to the central server for aggregation based on the number of local training rounds of the edge server, and then redistribute them to each edge server after the central server completes the aggregation, so as to update the local model of the edge server itself.
[0093] The following reference Figure 3 To describe an electronic device 300 according to this embodiment of the present invention. Figure 3 The electronic device 300 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0094] like Figure 3 As shown, the electronic device 300 is manifested in the form of a general-purpose computing device. The components of the electronic device 300 may include, but are not limited to: at least one processing unit 310, at least one storage unit 320, and a bus 330 connecting different system components (including storage unit 320 and processing unit 310).
[0095] The storage unit stores program code that can be executed by the processing unit 310, causing the processing unit 310 to perform the steps described in the "Embodiment Methods" section of this specification according to various exemplary embodiments of the present invention.
[0096] Storage unit 320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 321 and / or cache memory 322, and may further include read-only memory (ROM) 323.
[0097] Storage unit 320 may also include a program / utility 324 having a set (at least one) of program modules 325, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0098] Bus 330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0099] Electronic device 300 can also communicate with one or more external devices (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 300, and / or any device that enables electronic device 300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 350. Furthermore, electronic device 300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 360. As shown, network adapter 360 communicates with other modules of electronic device 300 via bus 330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0100] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0101] According to the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0102] refer to Figure 4 As shown, a program product 400 for implementing the above-described method according to an embodiment of the present invention is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0104] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0105] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0106] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0107] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0108] In summary, this application provides a federated learning client selection method, apparatus, device, and storage medium. The method includes the following steps: sorting clients within the region corresponding to each edge server according to their reward ratio, and selecting clients that meet the budget of each edge server to determine a candidate client set for each edge server; calculating the latency score of each client in the candidate client set of each edge server, and determining the candidate client set with the highest score, where the latency score represents the reward brought to the server by the client participating in training; marking all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and clearing the candidate client sets of the remaining unmarked edge servers until all edge servers have been marked. This application can select clients for each edge server sequentially according to the budget of each edge server, effectively solving the client attribution problem in overlapping areas of multiple edge servers, while ensuring training efficiency. Furthermore, selecting a client set with low latency and low cost for training greatly accelerates the model convergence speed and improves computational efficiency.
[0109] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
[0110] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
Claims
1. A method for selecting federated learning clients, characterized in that, include: Clients within the region corresponding to each edge server are sorted according to their return on investment, and clients that meet the budget of each edge server are selected to determine the candidate client set for each edge server. Calculate the latency score for each client in the candidate client set of each edge server, and determine the candidate client set with the highest score, where the latency score is the reward that the client participating in the training brings to the server; Mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked; Specifically, the candidate client set corresponding to each edge server is calculated. Latency scores for all clients The sum of the values is used to select the edge server with the largest sum and mark it as selected. Edge servers that do not select clients are marked as 0, and simultaneously its client set All client i are marked as selected. Clients not selected by the edge server are marked as 1; Clear all After selecting the candidate client set for the edge servers, repeat the above operation for the remaining edge servers until all edge servers have been selected.
2. The method according to claim 1, characterized in that, The step of sorting clients within the region corresponding to each edge server according to their return on investment and selecting clients that meet the budget of each edge server to determine the candidate client set for each edge server includes: The return ratio for clients within the region corresponding to each edge server is determined by the ratio of the estimated return sent by the client to the edge server to the client's bid price. Sort the clients in the region corresponding to each edge server in descending order of their return ratio, and find the minimum number of clients that meet the budget of each edge server. The minimum client is used as the threshold, and clients ranked before the minimum client are selected one by one. Based on the selected client, a set of candidate clients is generated.
3. The method according to claim 2, characterized in that: According to the formula Calculate the minimum number of clients required to satisfy the budget of each edge server, where In the k-th round of training, client j participates in the bidding price for edge server e. For the k-th round of training, the reward of client j on edge server e based on upper bound confidence UCB is... The latency score for the client's UCB. To determine whether client i has been selected by the server in round k, Let $e$ be the budget for each edge server $e$ during the $k$ round of training.
4. The method according to claim 2, characterized in that, Also includes: When selecting a client, according to the formula ; ; Restricting the selection of clients, among which For the k-th round, the reward received by client i for participating in training on edge server e is... In the k-th round, is client i selected to participate in training on edge server e? For the k-th round, the set of clients selected by edge server e.
5. The method according to claim 1, characterized in that, The calculation of latency score for each client in the candidate client set of each edge server, and the determination of the candidate client set with the highest score, includes: According to the formula Calculate the latency score for the client in this round of training, where Let the latency score of client i under edge server e be . In the k-th round, at the time when edge server e receives the model parameters from client i, Let k be the start time of the training round. Define the maximum time for a predefined training round; Based on the latency score obtained from this round of training by the client, according to the formula... Calculate the average latency score of all clients in the candidate client set, where This represents the number of times client i has been selected by edge server e up to the (k-1)th round of training. Let α be the latency score of client i on edge server e during k-1 rounds of training, and let α be the parameter for adjusting historical latency and β be the parameter for adjusting latency in the current round. Based on the average delay score, using the formula Calculate the latency score of the UCB for all clients in the candidate client set, where The average latency score for all clients in the client set. This represents the number of times client i has been selected by edge server e up to round k. The candidate client set with the highest score is determined based on the sum of the latency scores of all clients in the candidate client set.
6. The method according to claim 1, characterized in that, include: The model is initialized through a central server and then distributed to each edge server. Each edge server will train the model individually for each client in the candidate client set it is distributed to. After each client completes training, it uploads the trained model parameters to the corresponding edge server. The edge server records the time when it receives the model parameters from each client to update the number of times the client is selected and the latency score.
7. The method according to claim 1, characterized in that, Also includes: Based on the number of training rounds on the edge servers, the latest model parameters are uploaded to the central server for aggregation. After the central server completes the aggregation, the parameters are redistributed to each edge server to update the local model on the edge server.
8. A federated learning client selection device, characterized in that, include: The selection module is used to sort the clients in the region corresponding to each edge server according to the return ratio and select the clients that meet the budget of each edge server to determine the candidate client set for each edge server. The calculation module is used to calculate the latency score of each client in the candidate client set of each edge server and determine the candidate client set with the highest score, wherein the latency score is the reward that the client participating in the training brings to the server; The marking module is used to mark all clients in the candidate client set with the highest score and the edge server corresponding to the candidate client set with the highest score as selected, and to clear the candidate client set of the remaining unmarked edge servers until all edge servers have been marked. Calculate the candidate client set for each edge server Latency scores for all clients The sum of the values is used to select the edge server with the largest sum and mark it as selected. Edge servers that do not select clients are marked as 0, and simultaneously its client set All client i are marked as selected. Clients not selected by the edge server are marked as 1; Clear all After selecting the candidate client set for the edge servers, repeat the above operation for the remaining edge servers until all edge servers have been selected.
9. An electronic device, characterized in that, The electronic device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores computer program instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Equipment scheduling method in multi-task federated learning system
CN115033382A
Client selection method, system and device in federated learning and storage medium
CN115600691A