A device selection and bandwidth allocation system, method for hierarchical federated learning
By employing a virtual queue algorithm to select terminal devices in hierarchical federated learning and using binary search to allocate bandwidth, the problem of low training efficiency caused by differences in computing power and network bandwidth is solved, achieving efficient device selection and bandwidth allocation, and improving overall training performance and data diversity.
Patent Information
- Application Number
- CN202410093876.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-23
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2044-01-23
AI Technical Summary
In hierarchical federated learning, the differences in computing power and network bandwidth of terminal devices lead to inefficiency in the training process, which may result in a decline in overall training performance. Furthermore, improper bandwidth allocation may increase the probability of devices falling behind.
The device selection module uses a virtual queue-based algorithm to select terminal devices, and allocates bandwidth to the selected terminal devices using a binary search bandwidth allocation algorithm to minimize the total training time and ensure data diversity.
It improves the training efficiency and performance of hierarchical federated learning, reduces the probability of falling behind devices, and ensures model accuracy and data diversity.
Smart Images

Figure CN117914708B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hierarchical federated learning, and more particularly to a device selection and bandwidth allocation system and method for hierarchical federated learning. Background Technology
[0002] With the release of relevant privacy protection policies and the increasing awareness of privacy among the public, the privacy and security of user data are receiving more and more attention. Therefore, federated learning has emerged and has become an attractive technology for intelligent applications in the Internet of Things (IoT) environment. In traditional machine learning methods, data is usually centrally stored on a central server for training. This centralized model may leak sensitive information and pose security risks. Federated learning, as a distributed machine learning method, allows model training while protecting user privacy.
[0003] Current solutions employ a hierarchical federated learning framework, migrating part of the model aggregation process from the cloud to edge servers to reduce communication load and thus mitigate transmission overhead. However, in hierarchical federated learning, edge devices play a crucial role, responsible for preprocessing, computation, and aggregation of local data. Different edge devices may have varying computing capabilities and bandwidth. If some edge devices have poor performance or low network bandwidth, they may significantly slow down the entire training process during preprocessing and aggregation, ultimately causing a significant deceleration due to lagging edge devices. On one hand, selecting edge devices with low computing power for communication may prolong the pre-aggregation phase, potentially negatively impacting the efficiency of hierarchical federated learning. On the other hand, the downlink of edge servers is shared by the edge devices they cover. Inappropriate network bandwidth allocation may cause selected edge devices to suffer from high update upload latency, increasing the probability of lagging edge devices and ultimately leading to a decline in overall training performance. Summary of the Invention
[0004] To address the challenges faced by existing highly distributed environments and to ensure the efficiency and performance of federated learning, this invention proposes a device selection and bandwidth allocation system for hierarchical federated learning. The system includes a device selection module and a bandwidth allocation module that configures cloud servers, edge servers, and terminal devices, with the terminal devices being covered by corresponding edge servers.
[0005] The device selection module is used to select the terminal device;
[0006] The bandwidth allocation module allocates bandwidth to the selected terminal device;
[0007] The device selection module selects a terminal device to train the model locally, obtains local updates, and calculates the local training time of the selected terminal device.
[0008] The edge server pre-aggregates the local updates sent by the terminal devices selected by the device selection module, obtains the pre-aggregation result, and calculates the local update transmission time.
[0009] The cloud server receives the pre-aggregation results uploaded by the edge server to update the global model and calculates the upload time of the pre-aggregation results.
[0010] The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
[0011] Furthermore, the local training time of the selected terminal device is expressed as:
[0012]
[0013] in, Let D be the local training time of terminal device i covered by edge server e in the k-th training round, τ be the number of iterations performed during local training of the terminal device, representing the number of iterations required for each terminal device to perform aggregation. e,i Describes the local dataset of terminal device i covered by edge server e, |D e,i | represents the number of data samples in the local dataset of terminal device i covered by edge server e, t e,i Let I represent the time it takes for each data sample in the local dataset of terminal device i covered by edge server e to be trained and updated locally on terminal device i. Let E represent the set of all edge servers. e Let e represent the set of all terminal devices covered by the edge server e, and K represent the total number of training rounds of the model.
[0014] Furthermore, the local update transmission time is measured using the bandwidth allocation ratio parameter and the downlink bandwidth of the associated edge server, specifically expressed as:
[0015]
[0016]
[0017] in, Let ξ represent the local update transmission time of terminal device i covered by edge server e in the k-th training round, and let ξ represent the size of the local update. For the downlink bandwidth of edge server e, Indicates the bandwidth allocation ratio, I e Let e represent the set of all terminal devices covered by edge server e, E represent the set of all edge servers, and K represent the total number of training rounds of the model.
[0018] Furthermore, the upload time of the pre-aggregation result is expressed as:
[0019]
[0020] in, ξ represents the time it takes for edge server e to upload the pre-aggregated results in the k-th training round, and ξ represents the scale of the local update. This represents the network bandwidth between the edge server e and the cloud server.
[0021] Furthermore, minimizing the total training time of the model is expressed as:
[0022]
[0023]
[0024] Among them, T k This represents the training time for the k-th round, where K represents the total number of training rounds for the model. Let the local training time of terminal device i covered by edge server e be the training time in the k-th training round. This represents the local update transmission time of terminal device i covered by edge server e in the k-th training round. This represents the time when edge server e uploads the pre-aggregation results in the k-th training round. This indicates whether the terminal device i covered by edge server e was actually selected in the k-th training round; a value of 1 indicates selection, and a value of 0 indicates otherwise. e E represents the set of all terminal devices covered by edge server e, where E represents the set of all edge servers.
[0025] Furthermore, the device selection module employs a virtual queue-based device selection algorithm when selecting a terminal device. The selection of the terminal device is abstracted into updating the queue length, specifically as follows:
[0026] Initialize the virtual queue length for each terminal device. At the start of each training round, the terminal devices are sorted in descending order of the virtual queue length.
[0027] The M terminal devices with the longest queue length are selected using a greedy algorithm.
[0028] At the end of each training round, the length of the virtual queue is updated according to the virtual update rules;
[0029] The update of the virtual queue length according to the virtual update rule is represented as follows:
[0030]
[0031] in, This represents the length of the virtual queue for terminal device i covered by edge server e in the (k+1)th training round; This represents the length of the virtual queue for terminal device i covered by edge server e in the kth training round; This indicates whether the terminal device i covered by edge server e was actually selected in the k-th training round; a value of 1 indicates selection, and a value of 0 indicates otherwise. e,i This represents the expected guaranteed participation rate of terminal device i covered by edge server e;
[0032] If the length of each virtual queue remains stable during training and the data diversity constraint holds, repeat the above process until the global loss of the model meets the requirements.
[0033] Furthermore, the bandwidth allocation module allocates bandwidth to the selected terminal device based on a binary search bandwidth allocation algorithm, specifically as follows:
[0034] Initialize search area in, Set the expected time T e T e This indicates the completion time of the update uploaded to edge server e; the expected time is initialized to [value].
[0035] in, This represents the lower bound of the completion time for updates uploaded to edge server e. This represents the upper bound of the completion time of the update uploaded to edge server e. Let the local training time of terminal device i covered by edge server e be the training time in the k-th training round. Let e represent the set of terminal devices covered by the edge server e in the k-th training round;
[0036] If the sum of the bandwidth ratios of all terminals on the edge server to which the terminal device belongs is between [1-δ, 1], then the bandwidth allocation is reasonable. If the sum of the ratios is less than 1-δ, the bandwidth allocation is too large; if the sum of the ratios is greater than 1, the bandwidth allocation is too small. Here, δ is a hyperparameter used to adjust the threshold of the bandwidth allocation ratio. The bandwidth utilization of each edge server is evaluated, and multiple binary searches are performed. A better bandwidth allocation strategy is selected based on the bandwidth utilization, and the search area is further divided into halves to finally achieve an optimal bandwidth allocation that meets the accuracy requirements.
[0037] This invention also proposes a joint device selection and bandwidth allocation method for hierarchical federated learning, based on the above-described system implementation, including:
[0038] Use the device selection module to select the terminal device;
[0039] The bandwidth allocation module is used to allocate bandwidth to the selected terminal devices.
[0040] The model is trained locally on the terminal device selected by the device selection module, local updates are obtained, and the local training time of the selected terminal device is calculated.
[0041] The local update is sent to the corresponding edge server of the selected terminal device for pre-aggregation, the pre-aggregation result is obtained, and the local update transmission time is calculated.
[0042] The pre-aggregation results are uploaded to the cloud server to update the global model, and the upload time of the pre-aggregation results is calculated.
[0043] The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
[0044] The beneficial effects of the technical solution provided by this invention are:
[0045] This invention proposes a device selection and bandwidth allocation system and method for hierarchical federated learning. The system includes a device selection module and a bandwidth allocation module for configuring cloud servers, edge servers, and terminal devices. Under the constraint of minimizing the total training time of the model, the bandwidth allocation module performs bandwidth allocation; under the constraint of data diversity, the device selection module performs device selection. The device selection module employs a virtual queue-based device selection algorithm when selecting terminal devices, and the bandwidth allocation module allocates bandwidth to the selected terminal devices based on a binary search bandwidth allocation algorithm. This effectively solves the device selection and bandwidth allocation problems in traditional hierarchical federated learning, providing an innovative solution for improving training performance and ensuring data diversity and model accuracy. Attached Figure Description
[0046] Figure 1 This is a block diagram of a device selection and bandwidth allocation system for hierarchical federated learning according to an embodiment of the present invention;
[0047] Figure 2 A diagram illustrating the Top-M device selection strategy for unified bandwidth allocation in this embodiment of the invention;
[0048] Figure 3 This is a diagram illustrating the selection strategy for diversity sensing devices with adaptive bandwidth allocation in an embodiment of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0050] A block diagram of the device selection and bandwidth allocation system for hierarchical federated learning according to an embodiment of the present invention is shown below. Figure 1 The system includes a device selection module and a bandwidth allocation module for configuring cloud servers, edge servers, and terminal devices. Terminal devices are covered by corresponding edge servers. Participants in hierarchical federated learning do not need to communicate with the cloud server; they only need to upload updates to the training model to the edge servers they cover. The edge servers then pre-aggregate the received updates and send the results to the cloud to update the global model.
[0051] The device selection module selects terminal devices; the bandwidth allocation module allocates bandwidth to the selected terminal devices. To avoid falling behind, bandwidth needs to be allocated to each selected terminal device. The device selection decision and bandwidth allocation strategy can have a profound impact on the model's training time, convergence speed, training stability, and the final accuracy achieved.
[0052] The system works as follows: the device selection module selects a terminal device to train the model locally, obtains local updates, and calculates the local training time of the selected terminal device; the edge server pre-aggregates the local updates sent by the terminal devices selected by the device selection module, obtains the pre-aggregation result, and calculates the local update transmission time; the cloud server receives the pre-aggregation result uploaded by the edge server to update the global model and calculates the pre-aggregation result upload time.
[0053] The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
[0054] Each training cycle can be divided into two phases: the local training phase and the aggregation phase.
[0055] (1) Local training phase
[0056] During the local training phase, the terminal devices use their local datasets to train the model downloaded from the cloud server. Within each training cycle, the cloud server needs to select at least M terminal devices for global aggregation, using binary variables. This is used to measure whether the terminal device i covered by the edge server e is actually selected in the k-th training round. There are only two possible values: 1 if the terminal device is selected during training, and 0 otherwise. Accordingly, to ensure the cloud server can collect sufficient updates, the number of selected terminal devices should satisfy the following inequality:
[0057]
[0058] Therefore, in the k-th round, the local training time of terminal device i can be calculated as:
[0059]
[0060] in, Let D be the local training time of terminal device i covered by edge server e in the k-th training round, τ be the number of iterations performed during local training of the terminal device, representing the number of iterations required for each terminal device to perform aggregation. e,i Describes the local dataset of terminal device i covered by edge server e, |D e,i | represents the number of data samples in the local dataset of terminal device i covered by edge server e, t e,i Let I represent the time it takes for each data sample in the local dataset of terminal device i covered by edge server e to be trained and updated locally on terminal device i. Let E represent the set of all edge servers. e Let e represent the set of all terminal devices covered by the edge server e, and K represent the total number of training rounds of the model.
[0061] (2) Aggregation stage
[0062] The aggregation phase consists of two processes. The first process is that the terminal device sends the local update to its coverage edge server for pre-aggregation. The second process is that the pre-aggregation result is uploaded to the cloud server to update the global model.
[0063] After local training is complete, the selected terminal device i will upload local updates to its associated edge server. To further mitigate the lagging issue, appropriate bandwidth needs to be carefully allocated to each terminal device (e.g., allocating more bandwidth to terminal devices with lower computing power) to compensate for differences in computing capabilities, ensuring that local update transmission times are approximately consistent. To meet this requirement, downlink bandwidth is allocated to edge server e. To reduce the fallback effect, use The bandwidth allocation ratio is used to represent the local update transmission time of terminal device i. This can be measured by the bandwidth allocation ratio parameter and the downlink bandwidth of its associated edge server. The specific expression is:
[0064]
[0065]
[0066] in, Let ξ represent the local update transmission time of terminal device i covered by edge server e in the k-th training round, and let ξ represent the size of the local update. For the downlink bandwidth of edge server e, Indicates the bandwidth allocation ratio, I e Let e represent the set of all terminal devices covered by edge server e, E represent the set of all edge servers, and K represent the total number of training rounds of the model.
[0067] The pre-aggregated updates are uploaded to the cloud server for global aggregation, and the upload time of the corresponding pre-aggregated results in round k can be expressed as:
[0068]
[0069] in, ξ represents the time it takes for edge server e to upload the pre-aggregated results in the k-th training round, and ξ represents the scale of the local update. This represents the network bandwidth between the edge server e and the cloud server.
[0070] The device selection and bandwidth allocation in this embodiment of the invention are performed under the constraints of minimizing the total training time of the model and data diversity. Suitable devices are selected for pre-aggregation, and the accuracy and performance of the model are ensured by comprehensively considering the data distribution and the computing power of the devices. Bandwidth resources are intelligently allocated according to the device load and network bandwidth availability to avoid lagging behind and improve training efficiency.
[0071] Minimizing the total training time of the model is expressed as:
[0072]
[0073]
[0074] Among them, T k This represents the training time for the k-th round, where K represents the total number of training rounds for the model. Let the local training time of terminal device i covered by edge server e be the training time in the k-th training round. This represents the local update transmission time of terminal device i covered by edge server e in the k-th training round. This represents the time when edge server e uploads the pre-aggregation results in the k-th training round. This indicates whether the terminal device i covered by edge server e was actually selected in the k-th training round; a value of 1 indicates selection, and a value of 0 indicates otherwise. eE represents the set of all terminal devices covered by edge server e, where E represents the set of all edge servers.
[0075] The primary goal of device selection is to minimize the overall model training time while ensuring data diversity. The device selection module employs a virtual queue-based algorithm, where device selection is abstracted as queue length updates. A virtual queue is set up for each device; the virtual queue length is monitored and updated to reflect the participation rate of real terminal devices; virtual update rules are introduced to maintain the stability of the virtual queue length; and device selection is performed based on the stability constraints of the virtual queue length. This approach allows for consideration of diversity constraints during device selection and provides a predictable guarantee of participation rates.
[0076] Specifically:
[0077] (1) Initialize the virtual queue length of each terminal device. At the beginning of each training round, the terminal devices are sorted in descending order of the virtual queue length.
[0078] (2) Select the M terminal devices with the longest queue length by using a greedy algorithm to avoid selecting devices with very different computing capabilities to participate in the same round of training, and reduce the lag effect caused by the heterogeneity of terminal devices.
[0079] (3) To ensure the data diversity constraint, a virtual update rule was introduced. At the end of each training round, the length of the virtual queue was updated according to the virtual update rule.
[0080] The update of the virtual queue length according to the virtual update rule is represented as follows:
[0081]
[0082] in, This represents the length of the virtual queue for terminal device i covered by edge server e in the (k+1)th training round; This represents the length of the virtual queue for terminal device i covered by edge server e in the kth training round; This indicates whether the terminal device i covered by edge server e was actually selected in the k-th training round; a value of 1 indicates selection, and a value of 0 indicates otherwise. e,i This represents the expected guaranteed participation rate of terminal device i covered by edge server e;
[0083] (4) When the length of each virtual queue remains stable during training, the data diversity constraint holds. This can be achieved by converting the data diversity constraint into the stability of the virtual queue length. Repeat the above process until the global loss of the model meets the requirements.
[0084] This algorithm allows for selection based on the queue length of terminal devices, prioritizing higher-performance devices during federated learning and selecting terminal devices with similar computing capabilities in each training round to reduce the fall-out effect and improve overall efficiency.
[0085] The bandwidth allocation module allocates bandwidth to the selected terminal devices based on a binary search algorithm. It determines the optimal bandwidth allocation scheme so that the edge servers receive updates from all selected terminal devices almost simultaneously, minimizing the differences in device computing power. After local training is complete, the selected terminal device i will upload its local update to its associated edge server. To further mitigate the "fallback" problem, appropriate bandwidth needs to be carefully allocated to each terminal device (e.g., allocating more bandwidth to terminal devices with lower computing power) to compensate for differences in computing power, ensuring that local update transmission times are essentially consistent.
[0086] Binary search bandwidth allocation algorithms are primarily used in real-world scenarios to solve resource allocation problems, especially when efficient and fair allocation of limited resources is required. In fields such as network communication, cloud computing, and streaming media services, bandwidth allocation is a critical issue, and binary search algorithms can be applied to these scenarios to optimize bandwidth allocation. In communication networks, bandwidth resources are limited. Binary search bandwidth allocation algorithms can dynamically allocate bandwidth resources based on factors such as network traffic, user demand, and priorities, thereby improving overall network performance and user satisfaction. When the network is congested, the algorithm can prioritize allocating bandwidth to high-priority data streams, ensuring the timely transmission of critical information. The specific binary search bandwidth allocation algorithm is as follows:
[0087] Initialize search area in, Set the expected time T e T e This indicates the completion time of the update uploaded to edge server e; the expected time is initialized to [value].
[0088] in, This represents the lower bound of the completion time for updates uploaded to edge server e. This represents the upper bound of the completion time of the update uploaded to edge server e. Let the local training time of terminal device i covered by edge server e be the training time in the k-th training round. Let e represent the set of terminal devices covered by the edge server e in the k-th training round;
[0089] If the sum of the bandwidth ratios of all terminals on the edge server to which the terminal device belongs is between [1-δ, 1], then the bandwidth allocation is reasonable. If the sum of the ratios is less than 1-δ, the bandwidth allocation is too large; if the sum of the ratios is greater than 1, the bandwidth allocation is too small. Here, δ is a hyperparameter used to adjust the threshold of the bandwidth allocation ratio. The bandwidth utilization of each edge server is evaluated, and multiple binary searches are performed. A better bandwidth allocation strategy is selected based on the bandwidth utilization, and the search area is further divided into halves to finally achieve an optimal bandwidth allocation that meets the accuracy requirements.
[0090] This invention also proposes a joint device selection and bandwidth allocation method for hierarchical federated learning, based on the above-described system implementation, including:
[0091] Use the device selection module to select the terminal device;
[0092] The bandwidth allocation module is used to allocate bandwidth to the selected terminal devices.
[0093] The model is trained locally on the terminal device selected by the device selection module, local updates are obtained, and the local training time of the selected terminal device is calculated.
[0094] The local update is sent to the corresponding edge server of the selected terminal device for pre-aggregation, the pre-aggregation result is obtained, and the local update transmission time is calculated.
[0095] The pre-aggregation results are uploaded to the cloud server to update the global model, and the upload time of the pre-aggregation results is calculated.
[0096] The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
[0097] In one specific embodiment of the present invention, the system consists of two edge servers and eight terminal devices, wherein terminal devices 1-4 are covered by edge server 1, and the remaining terminal devices are covered by edge server 2. The Top-M device selection strategy diagram for unified bandwidth allocation in this embodiment of the present invention is shown below. Figure 2 As shown in the figure, the diversity sensing device selection strategy with adaptive bandwidth allocation in this embodiment of the invention is illustrated in the diagram below. Figure 3 As shown in the figure, the time represents the time spent on model training or model uploading.
[0098] Top-M device selection is a strategy for bandwidth allocation during device selection. In each training round, it selects only the M highest-performing devices and distributes bandwidth resources evenly among them. The aim of this strategy is to improve training efficiency by selecting only the highest-performing devices, thus reducing unnecessary computational and communication overhead. The Top-M device selection strategy first evaluates the performance of all devices and ranks them according to performance metrics such as computing power and communication bandwidth. It selects the M highest-performing devices, such as… Figure 2 As shown, in the first round, devices 3, 6, 7, and 8 were selected, and bandwidth resources were evenly allocated to these devices. The advantage of this strategy is that it can quickly select the best-performing device and effectively utilize bandwidth resources. Edge servers perform model aggregation, and finally, global model aggregation is performed. That is, the first round takes 22 seconds, and the second round follows the same pattern.
[0099] The diversity-aware device selection strategy with adaptive bandwidth allocation aims to optimize device selection and bandwidth allocation to improve learning efficiency. This strategy aims to fully utilize bandwidth resources while ensuring device diversity. Device diversity refers to the differences in computing power, network conditions, etc., among the selected devices, which can better cover data distribution and improve the model's generalization ability. Adaptive bandwidth allocation dynamically allocates bandwidth resources based on the device's computing power and network conditions. Devices with weaker computing power are allocated more bandwidth resources to ensure they can successfully complete the learning task. Conversely, devices with stronger computing power are allocated less bandwidth resources, thus making fuller use of network resources. Figure 3As shown, before selecting devices, their computing power and network conditions need to be evaluated to determine their performance. Devices are ranked according to performance, and the best-performing devices are selected. This ensures that the selected devices have sufficient computing power and network conditions to complete the learning task; devices 3, 4, 6, and 8 are selected. Next, the edge servers perform model aggregation and upload it to the central server for global model aggregation. The first round takes a total of 20.4 seconds. In the second round of training, bandwidth resources are dynamically allocated based on device performance and network conditions. Devices with lower performance are allocated more bandwidth resources to ensure they can successfully complete the learning task, while devices with higher performance are allocated less bandwidth resources to make fuller use of network resources. To consider the diversity of data models, clients that were not selected in the previous round are prioritized in the next round; devices 1, 4, 5, and 7 are selected in the second round, which takes a total of 18 seconds. This strategy ensures device diversity while fully utilizing bandwidth resources, improving the efficiency of federated learning. Furthermore, device selection and bandwidth allocation can be dynamically adjusted according to actual conditions to adapt to different learning scenarios and needs.
[0100] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. 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 the invention. Therefore, the invention 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 disclosed herein.
Claims
1. A device selection and bandwidth allocation system for hierarchical federated learning, characterized in that, The system includes a device selection module and a bandwidth allocation module for configuring cloud servers, edge servers, and terminal devices, with the terminal devices being covered by the corresponding edge servers. The device selection module is used to select terminal devices. When selecting terminal devices, the device selection module employs a virtual queue-based device selection algorithm. The selection of terminal devices is abstracted as queue length updating, specifically: Initialize the virtual queue length for each terminal device. At the beginning of each training round, the terminal devices are sorted in descending order of the virtual queue length. The M terminal devices with the longest queue length are selected using a greedy algorithm. At the end of each training round, the length of the virtual queue is updated according to the virtual update rules; The update of the virtual queue length according to the virtual update rule is represented as follows: in, Represents edge server Coverage of terminal devices In the +1 virtual queue length for training rounds; Represents edge server Coverage of terminal devices In the The length of the virtual queue for the training round; Represents edge server Coverage of terminal devices Is it in the first The value of a selected item is 1, otherwise it is 0. This represents the expected guaranteed participation rate of terminal device i covered by edge server e; If the length of each virtual queue remains stable during training and the data diversity constraint holds, repeat the above process until the global loss of the model meets the requirements. The bandwidth allocation module allocates bandwidth to the selected terminal devices based on a binary search bandwidth allocation algorithm, so that the completion time of all selected devices uploading local updates tends to be consistent. The device selection module selects a terminal device to train the model locally, obtains local updates, and calculates the local training time of the selected terminal device. The edge server pre-aggregates the local updates sent by the terminal devices selected by the device selection module, obtains the pre-aggregation result, and calculates the local update transmission time. The cloud server receives the pre-aggregation results uploaded by the edge server to update the global model and calculates the upload time of the pre-aggregation results. The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
2. The device selection and bandwidth allocation system for hierarchical federated learning according to claim 1, characterized in that, The local training time of the selected terminal device is expressed as: in, For edge servers Coverage of terminal devices In the Local training time in the training round, The number of iterations performed for local training on the terminal devices represents the number of iterations required for each terminal device to update. Aggregation can only occur after this process. Represents edge server Coverage of terminal devices Local dataset, Represents edge server Coverage of terminal devices The number of data samples in the local dataset. To represent edge servers Coverage of terminal devices Each data sample in the local dataset is on the edge server Coverage of terminal devices The time for local updates during training, Represents the set of all edge servers. This represents the set of all terminal devices covered by edge server e. This represents the total number of training rounds for the model.
3. The device selection and bandwidth allocation system for hierarchical federated learning according to claim 1, characterized in that, Local update transmission time is measured by the bandwidth allocation ratio parameter and the downlink bandwidth of the associated edge server, specifically expressed as: in, Represents edge server Coverage of terminal devices In the Local update transfer time in training rounds Indicates the scale of the local update. For edge servers Downlink bandwidth, , This represents the set of all terminal devices covered by edge server e. Represents the set of all edge servers. This represents the total number of training rounds for the model.
4. A device selection and bandwidth allocation system for hierarchical federated learning according to claim 1, characterized in that, The upload time of the pre-aggregation result is expressed as: in, Represents edge server In the The time required to upload pre-aggregation results during the training round. Indicates the scale of the local update. Represents edge servers Network bandwidth between the cloud server and the cloud server.
5. A device selection and bandwidth allocation system for hierarchical federated learning according to claim 1, characterized in that, Minimizing the total training time of the model is expressed as: in, Indicates the first The training time in each round, This represents the total number of training rounds of the model. For edge servers Coverage of terminal devices In the Local training time in the training round, Represents edge server Coverage of terminal devices In the Local update transfer time in training rounds Represents edge server In the The time to upload pre-aggregation results during the training round; This indicates whether the terminal devices covered by the edge server were actually selected in the training round; a value of 1 indicates selection, and a value of 0 indicates otherwise. Represents edge server The collection of all terminal devices covered This represents the set of all edge servers.
6. A device selection and bandwidth allocation system for hierarchical federated learning according to claim 1, characterized in that, The bandwidth allocation module allocates bandwidth to the selected terminal device based on a binary search bandwidth allocation algorithm, specifically as follows: Initialize search area ,in, Set the expected time , This indicates the expected completion time for the update uploaded to edge server e. Initialized to ; in, This represents the lower bound of the completion time for updates uploaded to edge server e. This represents the upper bound of the completion time of the update uploaded to edge server e. For edge servers Coverage of terminal devices In the Local training time in the training round, Indicates the first The collection of terminal devices covered by the training round edge server e; The sum of the bandwidth ratios of all terminals on the edge server to which the terminal device belongs is in [1- If the bandwidth allocation is between 1 and 1, then the allocation is reasonable. If the sum of the proportions is less than 1... If the bandwidth allocation is too large, then the bandwidth allocation is too small; if the sum of the proportions is greater than 1, then the bandwidth allocation is too small. It is a hyperparameter used to adjust the threshold of the bandwidth allocation ratio, evaluate the bandwidth utilization of each edge server, and perform multiple binary searches to select a better bandwidth allocation strategy based on the bandwidth utilization, and further divide it into half the search area to finally achieve an optimal bandwidth allocation that meets the accuracy requirements.
7. A joint device selection and bandwidth allocation method for hierarchical federated learning, implemented based on the system described in any one of claims 1-6, characterized in that, include: Use the device selection module to select the terminal device; The bandwidth allocation module is used to allocate bandwidth to the selected terminal device. The model is trained locally on the terminal device selected by the device selection module, local updates are obtained, and the local training time of the selected terminal device is calculated. The local update is sent to the corresponding edge server of the selected terminal device for pre-aggregation, the pre-aggregation result is obtained, and the local update transmission time is calculated. The pre-aggregation results are uploaded to the cloud server to update the global model, and the upload time of the pre-aggregation results is calculated. The total training time of the model is calculated based on the local training time, local update transmission time, and pre-aggregation result upload time of the selected terminal device. Device selection and bandwidth allocation are carried out under the constraints of minimizing the total training time of the model and data diversity.
Citation Information
Patent Citations
Federal learning method based on equipment training time fairness
CN115713128A
Asynchronous hierarchical joint learning training method based on bandwidth pre-allocation
CN117221122A