Task scheduling method, device, equipment and medium for large-scale federated learning
By classifying and assigning terminals in large-scale federated learning, ensuring that each round of iteration is completed within a preset time, the training efficiency and accuracy problems caused by terminal resource constraints are solved, and the efficiency and model accuracy of federated learning are improved.
Patent Information
- Application Number
- CN202210623174.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-06-01
AI Technical Summary
In large-scale federated learning scenarios, due to heterogeneous computing resources, variable network channel conditions and deep neural network computing resources requirements, each round of federated learning training time is too long, and some terminals cannot complete the calculation within the specified time, resulting in model accuracy reduce.
By sending the model training condition attribute parameter request information to the preset broadcast domain, the target terminal is determined and classified, and it is divided into the first and second target terminals. All learning tasks are distributed to first-class terminals with better computing resources and executed independently, and some learning tasks are sent to second-class terminals with poor computing resources and trained together with edge servers to ensure that each round of iteration is at the preset time. Completed within.
The overall efficiency and model accuracy of federated learning are improved, so that as many heterogeneous terminals can complete training within preset time, and the user scale and model accuracy involved in training are improved.
Smart Images

Figure CN115016911B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular, to a task scheduling method, apparatus, device and medium for large-scale federated learning. Background Art
[0002] Federated Learning is a privacy-preserving distributed machine learning technology that makes full use of data and computing resources scattered across various terminals to collaboratively carry out distributed machine learning while ensuring that data does not leave the local machine. In the distributed learning process, federated learning usually adopts a synchronous update mode, where the server distributes the model to the terminals participating in the training, and then collects the training feedback results of each terminal to complete the parameter update.
[0003] However, in this process, due to the heterogeneity of computing resources of each terminal, changeable network channel conditions, and high requirements for computing resources of deep neural networks, each round of federated learning training will take too long, or some terminals will be unable to complete the current round of calculations within the specified time, resulting in a small number of participating users and reduced model accuracy when the results of the current round are aggregated. This problem is particularly prominent in large-scale federated learning. Summary of the invention
[0004] The embodiments of the present invention provide a task scheduling method, apparatus, device and medium for large-scale federated learning, so that each terminal participating in large-scale federated learning can complete training within a preset time, thereby improving the efficiency and accuracy of model training.
[0005] In a first aspect, an embodiment of the present invention provides a task scheduling method for large-scale federated learning, the method comprising:
[0006] Sending model training condition attribute parameter request information to a preset broadcast domain, and obtaining corresponding request feedback information, and determining the target terminal participating in the current round of model training based on the request feedback information;
[0007] Classifying the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals;
[0008] Distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and send some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperate with each terminal in the second-category target terminal in turn to perform the learning tasks of the current round of model training.
[0009] In a second aspect, an embodiment of the present invention provides a task scheduling device for large-scale federated learning, the device comprising:
[0010] A federated learning participating terminal determination module is used to send model training condition attribute parameter request information to a preset broadcast domain, obtain corresponding request feedback information, and determine the target terminal participating in the current round of model training based on the request feedback information;
[0011] A participating terminal classification module is used to classify the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals;
[0012] The terminal learning task scheduling module is used to distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and sends some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperates with each terminal in the second-category target terminal to perform the learning tasks of the current round of model training in turn.
[0013] In a third aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0014] one or more processors;
[0015] A memory for storing one or more programs;
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the task scheduling method for large-scale federated learning provided by any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a task scheduling method for large-scale federated learning as provided in any embodiment of the present invention.
[0018] The embodiments of the above invention have the following advantages or beneficial effects:
[0019] In an embodiment of the present invention, a model training condition attribute parameter request information is sent to a preset broadcast domain, and corresponding request feedback information is obtained, and based on the request feedback information, the target terminal participating in the current round of model training is determined; then, when allocating federated learning tasks to the target terminal, each target terminal is first classified according to each model training condition attribute parameter in the request feedback information to obtain a first category of target terminals and a second category of target terminals; all learning tasks of the model to be trained are distributed to each first category of target terminals, so that each first category of target terminals independently executes the learning tasks of the current round of model training, and a preset part of the learning tasks in the model to be trained is sent to each second category of target terminals, and each terminal in the second category of target terminals is coordinated in turn to execute the learning tasks of the current round of model training. That is, the technical solution of the embodiment of the present invention is oriented to large-scale federated learning scenarios. First, it evaluates whether the current state of the target terminal is suitable for training. By constructing a method for arranging federated learning tasks based on the current state of the terminal, the terminals with better computing resources, network resources, etc. will complete the training tasks independently based on the traditional federated learning mode. For terminals with poor computing resources, network resources, etc., the training tasks will be completed by joint collaborative training with the edge server, ensuring that each round of iteration in the large-scale model training scenario, heterogeneous terminals can successfully complete each round of federated learning tasks within the expected time, thereby improving the overall efficiency and model accuracy of federated learning. The technical solution of this embodiment solves the technical problems that in large-scale federated learning scenarios, some terminals cannot complete the current round of calculations within the specified time due to resource constraints, so that they cannot participate in the aggregation of the current round of results, and ultimately lead to the reduction of model accuracy due to the small number of users participating in each round of training. This technical solution can enable as many heterogeneous terminals as possible to participate in model training and complete the training within a preset time. On the one hand, it improves the efficiency of each round of model training in large-scale federated learning scenarios, and on the other hand, due to the increase in the scale of users participating in training, the final accuracy of the model will also be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of a task scheduling method for large-scale federated learning provided in Example 1 of the present invention;
[0021] Figure 2 It is a schematic diagram of the implementation process of federated learning in the prior art;
[0022] Figure 3 This is a schematic diagram of interaction between a first type of target terminal and a server provided in Embodiment 1 of the present invention;
[0023] Figure 4 This is a schematic diagram of interaction between a second type of target terminal and a server provided in the first embodiment of the present invention;
[0024] Figure 5 It is a schematic diagram of a preset partial learning task segmentation provided by the first embodiment of the present invention;
[0025] Figure 6 is a flowchart of a task scheduling method for large-scale federated learning provided by Embodiment 2 of the present invention;
[0026] Figure 7 It is a structural diagram of a task scheduling device for large-scale federated learning provided by Embodiment 3 of the present invention;
[0027] Figure 8 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0029] Embodiment 1
[0030] Figure 1 This is a flowchart of a task scheduling method for large-scale federated learning provided in Embodiment 1 of the present invention. This embodiment can be applied to model training scenarios of federated learning involving multiple terminals, especially in large-scale federated learning. The method can be executed by a task scheduling device for large-scale federated learning, which can be implemented in the form of hardware and / or software and configured in a computer device or server.
[0031] like Figure 1 As shown in Figure 1, the task orchestration method for large-scale federated learning includes the following steps:
[0032] S110, sending model training condition attribute parameter request information to a preset broadcast domain, and obtaining corresponding request feedback information, and determining the target terminal participating in the current round of model training based on the request feedback information.
[0033] Among them, the model training condition attribute parameters can be one or more parameter information of parameters such as computing resources, network status, power constraints and model training data volume, which can represent the computing power and learning efficiency of the terminal participating in federated learning. Among them, computing resources can be the memory space of the terminal participating in federated learning that can be used for computing function code application, the network status can be the network bandwidth between the terminal participating in federated learning and the server, the power constraint can refer to the endurance time that the terminal can continue to participate in federated learning, and the data volume represents the amount of model training sample data of the terminal itself, which can reflect the relative length of time the terminal performs the learning task to a certain extent.
[0034] The preset broadcast domain can be understood as a collection of all terminal devices in the network that can receive the same broadcast message. The server sends a broadcast message in the preset broadcast domain, and the content of the broadcast message can be a request information for model training condition attribute parameters. The terminal that can receive the broadcast message in the preset broadcast domain can enter the preset broadcast domain through a preset password or identification code, receive the corresponding broadcast message, and interact with the server. Further, if the terminal device that receives the broadcast message confirms that it can perform the model training task of the current round, it will feedback the broadcast message, that is, send a request feedback information to the server to inform the server of the corresponding information in the model training condition attribute parameters. Thus, the server can determine the target terminal that can participate in the current round of model training based on the received request feedback information. Specifically, the server will wait for the request feedback information of each terminal within the preset waiting time after sending the broadcast message, and the terminal that provides information feedback can be used as the target terminal; and the terminal that does not reply within the preset waiting time is determined not to participate in the current round of federated learning.
[0035] S120. Classify the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals.
[0036] Specifically, the computing resource information of each target terminal is different, and the corresponding computing power is also different. Therefore, in the process of federated learning, the target terminal with lower computing power is the terminal that has the greatest impact on the overall federated learning efficiency. Therefore, in this embodiment, in order to improve the overall learning efficiency of federated learning, the terminal will be evaluated and classified according to the model training condition attribute parameters of each target terminal, and the terminal with poor computing power can efficiently complete the learning task of federated learning with the assistance of the server.
[0037] Specifically, in the process of classifying the target terminals, a comprehensive score can be given based on one or more of the computing resource information, network status information, power constraint information, and model training data volume information of each target terminal, and the terminals can be sorted from high to low. Each attribute parameter can set a corresponding weight factor according to the degree of influence on computing power or computing efficiency. The weight factors of each parameter are comprehensively analyzed and scored, and a scoring threshold is set. Target terminals with a score greater than or equal to the scoring threshold are regarded as the first type of target terminals, and terminals with a score less than the scoring threshold are regarded as the second type of target terminals. Among them, the computing power of the second type of target terminals is lower than that of the first type of target terminals.
[0038] S130, distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and send some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperate with each terminal in the second-category target terminal in turn to perform the learning tasks of the current round of model training.
[0039] Generally, the implementation process of federated learning can refer to Figure 2 The process shown in Figure 2 In the process, all target terminals establish a connection with the server at the same time to perform parallel training. The server first distributes the trained model to each target terminal. Each target terminal performs model training based on its local model training data, executes the federated learning task to update its local model parameters, and then uploads the local model parameters obtained after model training to the server. The server determines the final model parameter update result of the current round of training by integrating the model training results of all target terminals. However, in actual situations, due to multiple factors such as the computing resources, network status, and power constraints of each target terminal, the model training time of each round of the target terminal is different during iterative training. In the same round of model training, the target terminal that completes the training first needs to wait for the target terminal that completes the training last, resulting in low training efficiency; on the other hand, since the computing resources owned by the server itself are also relatively limited, it is difficult to ensure that large-scale terminals are split and trained in parallel at the same time. Therefore, in this embodiment, when performing task scheduling for federated learning, the target terminals must first be screened out, and the target terminals must be classified and processed, and different federated learning task allocation strategies must be adopted to improve the efficiency of each round of model training as a whole.
[0040] Specifically, the interaction process between the first type of target terminal and the server can be referred to Figure 3 The schematic diagram shown. Figure 3In the example, the first target terminal, the second target terminal, and the third target terminal are all first-class target terminals, that is, target terminals with relatively high computing efficiency, and can independently perform learning tasks according to the conventional federated learning process. That is, the server will distribute all learning tasks of the model to be trained to each first-class target terminal at the same time (step ①), so that each first-class target terminal can independently perform all learning tasks of the current round of model training. Then, after each first-class target learning terminal completes the model training locally, it uploads the updated model parameters to the server (step ②). The first-class target terminal that completes the current round of model training can wait for the server's broadcast message to enter the next round of model training. It can be understood that when each first-class target terminal performs a federated learning task, it executes the learning task in parallel.
[0041] Further, the interaction process between the second type of target terminal and the server can refer to Figure 4 The schematic diagram shown. Figure 4 In the figure, the fourth target terminal and the fifth target terminal are both the second type of target terminals, i.e., target terminals with relatively low computing efficiency. In order to improve the overall efficiency of federated learning, it is necessary to perform learning tasks in collaboration with the server with the assistance of the server.
[0042] Specifically, when assigning learning tasks to the second-category target terminals, first, the second-category target terminals are sorted, and then each second-category target terminal is made to perform the learning tasks in sequence according to the sorting results, that is, each second-category target terminal performs the learning tasks in series. When sorting the second-category target terminals, a random sorting strategy can be adopted to obtain a sorting result. Alternatively, according to the preset terminal scoring strategy when classifying the target terminals, each terminal in each second-category target terminal is sorted according to the scoring score.
[0043] Then, according to the ranking results of the second-category target terminals, for each second-category target terminal, the preset partial learning task is sent to the current second-category target terminal (step ①), so that the current second-category target terminal (the fourth target terminal) completes the partial learning task of the current round of model training, and obtains the primary learning result of the current second-category target terminal for the preset partial learning task (step ②). Further, based on the primary learning result, the learning task other than the preset partial learning task is completed to obtain the secondary learning result, and the secondary learning result is sent to the current second-category target terminal (step ③), so that the current second-category target terminal completes the final label calculation result, and obtains the final label calculation result uploaded by the current second-category target terminal (step ④); according to the final label calculation result, the parameters of the model to be trained are updated, and the preset partial learning task of the model to be trained after the updated parameters is sent to the next second-category target terminal (the fifth target terminal) corresponding to the current second-category target terminal in the ranking result to continue learning (complete steps ⑤⑥⑦⑧, which are consistent with the execution content of ①②③④), that is, until all terminals in the second-category target terminal complete the learning task of the current round of model training.
[0044] Among them, the current second-category target terminal is a terminal selected according to the sorting result of the second-category target terminal. The first second-category target terminal in the sorting result first uses its own model training data to execute the preset part of the learning task of the model training. Then, the next second-category target terminal adjacent to the current second-category target terminal in the sorting result is used as the second-category target terminal to execute the corresponding federated learning task.
[0045] Specifically, in the process of the current second-category target terminal performing the task, the server first sends the preset partial learning task to the current second-category target terminal, so that the current second-category target terminal completes the partial learning task of the current round of model training, and obtains the preliminary learning result of the current second-category target terminal for the preset partial learning task. Among them, the preliminary learning result can be the first model gradient obtained after the current second-category target terminal completes the preset partial learning task. After the current second-category target terminal completes the preset partial learning task, it will return the corresponding first model gradient to the server. Then, the server continues the training process of the model to be trained according to the first model gradient information returned by the second-category target terminal to obtain the secondary learning result. Among them, the secondary learning result can be the second model gradient obtained by the server after completing the corresponding learning task. The server will send the second model gradient to the current second-category target terminal, and the current second-category target terminal will complete the final calculation to obtain the label result output by the model to be trained. The current second-category target terminal will further upload the calculated label result to the server, and the server will update the parameters of the model to be trained according to the label result. Then, the preset partial learning task of the model to be trained with updated parameters is sent to the new current second-category target terminal, and the new second-category target terminal continues to execute the federated learning task.
[0046] Furthermore, the preset partial learning tasks are the result of dividing the structural hierarchy of the model to be trained. For example, the model to be trained can be divided into a hierarchical structure such as an input layer, a convolutional layer, a pooling layer, and a fully connected layer. The learning tasks corresponding to each functional layer before the fully connected layer can be used as the preset partial learning tasks and executed on the second type of target terminal, and the learning tasks corresponding to the fully connected layer can be executed on the server. For specific division of learning tasks, please refer to Figure 5 Schematic diagram of neural network segmentation shown. Figure 5 In the figure, each cuboid represents a neuron, corresponding to a neural network functional layer. When performing neural network segmentation, a computational weight graph can be constructed based on the different computational loads of each neuron to quantify the computation of each layer. At the same time, combined with the computational resources and network conditions of each target terminal, a deep neural network split suitable for each terminal can be performed. The computational label results can be placed on the target terminal side or on the server side, and can be set according to the specific computing scenario. Figure 5 In the task segmentation diagram shown, the label results are calculated on the server side.
[0047] It is understandable that when the server issues a federated learning task, it will initialize the model parameters in the learning task.
[0048] In this embodiment, a local training strategy is adopted for the first column of target terminals with sufficient computing resources, and collaborative training is performed for the second category of target terminals with limited resources. This avoids the problem of some terminals slowing down the entire training iteration process due to limited computing resources in terms of training timeliness, thereby improving the efficiency of federated learning as a whole.
[0049] The technical solution of this embodiment sends model training condition attribute parameter request information to a preset broadcast domain, obtains corresponding request feedback information, and determines the target terminals participating in the current round of model training based on the request feedback information; then, when scheduling federated learning tasks to the target terminals, first classify the target terminals according to the various model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals; distribute all learning tasks of the model to be trained to each first-category target terminal, so that each first-category target terminal independently executes the learning tasks of the current round of model training, and sends the preset part of the learning tasks in the model to be trained to each second-category target terminal, and cooperates with each terminal in the second-category target terminal in turn to execute the learning tasks of the current round of model training. That is, the technical solution of the embodiment of the present invention is oriented to large-scale federated learning scenarios. First, it evaluates whether the current state of the target terminal is suitable for training. By constructing a method for arranging federated learning tasks based on the current state of the terminal, the terminals with better computing resources, network resources, etc. will complete the training tasks independently based on the traditional federated learning mode. For terminals with poor computing resources, network resources, etc., the training tasks will be completed by joint collaborative training with the edge server, ensuring that each round of iteration in the large-scale model training scenario, heterogeneous terminals can successfully complete each round of federated learning tasks within the expected time, thereby improving the overall efficiency and model accuracy of federated learning. The technical solution of this embodiment solves the technical problems that in large-scale federated learning scenarios, some terminals cannot complete the current round of calculations within the specified time due to resource constraints, so that they cannot participate in the aggregation of the current round of results, and ultimately lead to the reduction of model accuracy due to the small number of users participating in each round of training. This technical solution can enable as many heterogeneous terminals as possible to participate in model training and complete the training within a preset time. On the one hand, it improves the efficiency of each round of model training in large-scale federated learning scenarios, and on the other hand, due to the increase in the scale of users participating in training, the final accuracy of the model will also be improved.
[0050] Embodiment 2
[0051] Figure 6A flowchart of a task scheduling method for large-scale federated learning provided in Embodiment 2 of the present invention. The technical solution of this embodiment further describes the interaction process between each terminal and the server in federated learning on the basis of the above embodiment, further improving the efficiency of federated learning. The method can be performed by a task scheduling device for large-scale federated learning, which can be implemented in the form of hardware and / or software and configured in a mobile terminal, a computer device or a server.
[0052] like Figure 6 As shown in Figure 1, the task orchestration method for large-scale federated learning includes the following steps:
[0053] S210: Send model training condition attribute parameter request information to a preset broadcast domain, obtain corresponding request feedback information, and determine the target terminal participating in the current round of model training based on the request feedback information.
[0054] S220. Classify the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals.
[0055] S230, distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and sends some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperates with each terminal in the second-category target terminal to perform the learning tasks of the current round of model training in turn.
[0056] For example, when the federated learning task is assigned to the second type of target terminal, the neural network can be layered F u and F s Two parts. F u Including L 0 , L 1 , ..., L m Layer, F s Including L m , L m+1 , L m+2 , ..., L n Layers, where n represents the total number of layers of the neural network to be trained. The server randomly initializes the network structure F u and F s The parameters of can be initialized by Gaussian distribution and other methods. Then send F u To the first second-category target terminal after the second-category target terminals are sorted.
[0057] The first second-class target terminal executes F uThe corresponding learning task is calculated by the forward propagation algorithm to obtain F u The last layer outputs the result d′ 1 , together with the label (d 1 ′, label 1 ) is sent to the server; the server receives (d 1 ′, label 1 ), continue to calculate through the forward propagation algorithm until F is obtained s The last layer gets the final expected result g 1 ; Then, the server uses the backpropagation algorithm to calculate and update the network weights of the model to be trained layer by layer based on the error until the Ln+1 layer, and obtains g 1 ', and gives the gradient g1' to the first second-class target terminal. After receiving g1', the first second-class target terminal completes the remaining calculations of the current round locally through the back propagation algorithm, updates the local complete weight calculation model output label results, and sends the corresponding model output label results to the server. At this point, the first second-class target terminal completes the calculation of the current round of model training tasks; after receiving the model output label results, the server updates the model to be trained and cooperates with the second second-class target terminal to start the current round of model training learning tasks.
[0058] In this embodiment, in order to further improve the efficiency of a round of federated learning, for the second type of target terminals that cannot complete the preset learning task within the preset time, an information discarding strategy can be adopted to no longer wait for the initial learning results of the current second type of target terminals.
[0059] Specifically, when the waiting time for the preliminary learning result of the current second-category target terminal is greater than the preset waiting time threshold, the preset partial learning task of the model to be trained updated based on the final label calculation result calculated by the previous second-category target terminal corresponding to the current second-category target terminal in the sorting result can be sent to the next second-category target terminal corresponding to the current second-category target terminal in the sorting result. That is, the next second-category target terminal uses its local model training data to perform the same federated learning task as the current second-category target terminal.
[0060] S240. Obtain the independent model training results of each of the first-category target terminals and the coordinated model training results of the last terminal in the second-category target terminals that performs the learning task, and determine the final model parameters of the model to be trained in the current round of model training based on the independent model training results and the coordinated model training results.
[0061] After each first-category target terminal and each second-category target terminal completes the learning task, the server will summarize the model training results of each target terminal and determine the final parameter update result of the current round of model training. Specifically, it can be to calculate the mean or weighted sum of the training results of each independent model and the training results of the coordinated model; and use the values of each parameter corresponding to the corresponding mean result or weighted sum result as the final model parameter.
[0062] For example, for the first type of target terminal, the server will receive the model parameter w uploaded by the last terminal among the first type of target terminals and the second type of target terminals. i The server will adjust the model parameters according to the model parameters, such as w 1 , ..., w m Calculate the final update parameters of the model to be trained after the current round of model training, denoted as That is, the average of the model update parameters obtained by the m target terminals is taken. The model update parameters obtained by the m target terminals include m-1 model update parameters of the first type of target terminals and one model update parameter of the second type of target terminal.
[0063] The technical solution of this embodiment sends model training condition attribute parameter request information to a preset broadcast domain, obtains corresponding request feedback information, and determines the target terminal participating in the current round of model training based on the request feedback information; then, when scheduling federated learning tasks to the target terminal, first classify each target terminal according to each model training condition attribute parameter in the request feedback information to obtain the first type of target terminal and the second type of target terminal; distribute all learning tasks of the model to be trained to each first type of target terminal, so that each first type of target terminal independently performs the learning tasks of the current round of model training, and sends the preset part of the learning tasks in the model to be trained to each second type of target terminal, and cooperates with each terminal in the second type of target terminal to perform the learning tasks of the current round of model training in turn, and in the process of the second type of target terminal performing the learning tasks, the current second type of target terminal will be selected according to the waiting time, so as to further improve the comprehensive learning efficiency of federated learning. Finally, the final parameter update result of the current round of model training will be determined according to the model training results of the first type of target terminal and the second type of target terminal. That is, the technical solution of the embodiment of the present invention is oriented to large-scale federated learning scenarios. First, it evaluates whether the current state of the target terminal is suitable for training. By constructing a method for arranging federated learning tasks based on the current state of the terminal, the terminals with better computing resources, network resources, etc. will complete the training tasks independently based on the traditional federated learning mode. For terminals with poor computing resources, network resources, etc., the training tasks will be completed by joint collaborative training with the edge server, ensuring that each round of iteration in the large-scale model training scenario, heterogeneous terminals can successfully complete each round of federated learning tasks within the expected time, thereby improving the overall efficiency and model accuracy of federated learning. The technical solution of this embodiment solves the technical problems that in large-scale federated learning scenarios, some terminals cannot complete the current round of calculations within the specified time due to resource constraints, so that they cannot participate in the aggregation of the current round of results, and ultimately lead to the reduction of model accuracy due to the small number of users participating in each round of training. This technical solution can enable as many heterogeneous terminals as possible to participate in model training and complete the training within a preset time. On the one hand, it improves the efficiency of each round of model training in large-scale federated learning scenarios, and on the other hand, due to the increase in the scale of users participating in training, the final accuracy of the model will also be improved.
[0064] Embodiment 3
[0065] Figure 7 This is a structural diagram of a task scheduling device for large-scale federated learning provided in Example 3 of the present invention. This embodiment is applicable to model training scenarios of federated learning involving multiple terminals. The device can be implemented by software and / or hardware and integrated into a computer device with application development capabilities.
[0066] like Figure 7As shown, the task scheduling device for large-scale federated learning includes: a federated learning participating terminal determination module 310, a participating terminal classification module 320 and a terminal learning task scheduling module 330.
[0067] Among them, the federated learning participating terminal determination module 310 is used to send model training condition attribute parameter request information to the preset broadcast domain, and obtain corresponding request feedback information, and determine the target terminal participating in the current round of model training based on the request feedback information; the participating terminal classification module 320 is used to classify the target terminals according to the various model training condition attribute parameters in the request feedback information, and obtain first-category target terminals and second-category target terminals; the terminal learning task scheduling module 330 is used to distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently executes the learning tasks of the current round of model training, and sends the preset part of the learning tasks in the model to be trained to each of the second-category target terminals, and cooperates with each terminal in the second-category target terminal to execute the learning tasks of the current round of model training in turn.
[0068] The technical solution of this embodiment is to send model training condition attribute parameter request information to a preset broadcast domain, obtain corresponding request feedback information, and determine the target terminals participating in the current round of model training based on the request feedback information; then, when scheduling federated learning tasks to the target terminals, first classify each target terminal according to each model training condition attribute parameter in the request feedback information to obtain first-category target terminals and second-category target terminals; distribute all learning tasks of the model to be trained to each first-category target terminal, so that each first-category target terminal independently executes the learning tasks of the current round of model training, and sends some preset learning tasks in the model to be trained to each second-category target terminal, and cooperates with each terminal in the second-category target terminal to execute the learning tasks of the current round of model training in turn. That is, the technical solution of the embodiment of the present invention is oriented to large-scale federated learning scenarios. First, it evaluates whether the current state of the target terminal is suitable for training. By constructing a method for arranging federated learning tasks based on the current state of the terminal, the terminals with better computing resources, network resources, etc. will complete the training tasks independently based on the traditional federated learning mode. For terminals with poor computing resources, network resources, etc., the training tasks will be completed by joint collaborative training with the edge server, ensuring that each round of iteration in the large-scale model training scenario, heterogeneous terminals can successfully complete each round of federated learning tasks within the expected time, thereby improving the overall efficiency and model accuracy of federated learning. The technical solution of this embodiment solves the technical problems that in large-scale federated learning scenarios, some terminals cannot complete the current round of calculations within the specified time due to resource constraints, so that they cannot participate in the aggregation of the current round of results, and ultimately lead to the reduction of model accuracy due to the small number of users participating in each round of training. This technical solution can enable as many heterogeneous terminals as possible to participate in model training and complete the training within a preset time. On the one hand, it improves the efficiency of each round of model training in large-scale federated learning scenarios, and on the other hand, due to the increase in the scale of users participating in training, the final accuracy of the model will also be improved.
[0069] In an optional implementation manner, the participating terminal classification module 320 is specifically configured to:
[0070] According to a preset terminal scoring strategy, a learning ability score is performed for each of the target terminals based on one or more of the computing resource information, the network status information, the power constraint information, and the model training data volume information in the feedback information;
[0071] According to the learning ability scoring result of each target terminal, each target terminal is classified into a first category target terminal and a second category target terminal.
[0072] In an optional implementation, the terminal learning task scheduling module 330 is specifically used to:
[0073] Randomly or according to a preset terminal scoring strategy, sort the terminals in the second category of target terminals;
[0074] According to the ranking result of the second-category target terminals, for each second-category target terminal, the preset partial learning task is sent to the current second-category target terminal, so that the current second-category target terminal completes the partial learning task of the current round of model training, and obtains the preliminary learning result of the current second-category target terminal for the preset partial learning task;
[0075] Based on the primary learning result, the learning tasks other than the preset partial learning tasks are completed to obtain a secondary learning result, and the secondary learning result is sent to the current second-category target terminal, so that the current second-category target terminal completes the final label calculation result;
[0076] The parameters of the model to be trained are updated according to the final label calculation result, and the preset partial learning tasks of the model to be trained after the updated parameters are sent to the next second category target terminal corresponding to the current second category target terminal in the sorting result to continue learning until all terminals in the second category target terminal complete the learning tasks of the current round of model training.
[0077] In an optional implementation, the task scheduling apparatus for large-scale federated learning further includes a model updating module, which is used to:
[0078] Obtaining independent model training results for each of the first-category target terminals and a coordinated model training result for the last terminal that performs a learning task among the second-category target terminals;
[0079] Based on the independent model training results and the coordinated model training results, final model parameters of the model to be trained in the current round of model training are determined.
[0080] In an optional implementation, the model updating module is specifically used to:
[0081] Calculate the mean or weighted sum of the independent model training results and the matching model training results;
[0082] The numerical values of the parameters corresponding to the mean value or the weighted sum value are used as the final model parameters.
[0083] In an optional implementation, the task scheduling apparatus for large-scale federated learning further includes a learning task initialization module, which is used to:
[0084] Initialize the parameters of the model to be trained.
[0085] In an optional implementation, the terminal learning task scheduling module 330 may also be used to:
[0086] When the waiting time for the preliminary learning result of the current second-category target terminal is greater than the preset waiting time threshold, the preset partial learning task of the model to be trained, which is updated based on the final label calculation result calculated for the previous second-category target terminal corresponding to the current second-category target terminal in the sorting result, is sent to the next second-category target terminal corresponding to the current second-category target terminal in the sorting result.
[0087] The task scheduling device for large-scale federated learning provided by an embodiment of the present invention can execute the task scheduling method for large-scale federated learning provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0088] Embodiment 4
[0089] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 4 of the present invention. Figure 8 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capabilities, such as an intelligent controller and server, a mobile phone and other terminal devices.
[0090] like Figure 8 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0091] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0092] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0093] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0094] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0095] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via the bus 18. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0096] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the task scheduling method for large-scale federated learning provided in the embodiment of the present invention, which includes:
[0097] Sending model training condition attribute parameter request information to a preset broadcast domain, and obtaining corresponding request feedback information, and determining the target terminal participating in the current round of model training based on the request feedback information;
[0098] Classifying the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals;
[0099] Distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and send some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperate with each terminal in the second-category target terminal in turn to perform the learning tasks of the current round of model training.
[0100] Embodiment 5
[0101] The fifth embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for scheduling tasks for large-scale federated learning provided in any embodiment of the present invention is implemented, including:
[0102] Sending model training condition attribute parameter request information to a preset broadcast domain, and obtaining corresponding request feedback information, and determining the target terminal participating in the current round of model training based on the request feedback information;
[0103] Classifying the target terminals according to the model training condition attribute parameters in the request feedback information to obtain first-category target terminals and second-category target terminals;
[0104] Distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and send some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperate with each terminal in the second-category target terminal in turn to perform the learning tasks of the current round of model training.
[0105] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0106] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0107] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0108] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0109] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0110] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A task scheduling method for large-scale federated learning, characterized in that: The method comprises: Sending model training condition attribute parameter request information to a preset broadcast domain, and obtaining corresponding request feedback information, and determining the target terminal participating in the current round of model training based on the request feedback information; According to the various model training condition attribute parameters in the request feedback information, the target terminals are classified into a first category and a second category; including: according to a preset terminal scoring strategy, the learning ability of each target terminal is scored according to one or more of the computing resource information, network status information, power constraint information and model training data volume information in the request feedback information, and a scoring threshold is set; according to the learning ability scoring results of each target terminal, the target terminal whose learning ability scoring result is greater than the scoring threshold is regarded as the first category target terminal, and the target terminal whose learning ability scoring result is less than the scoring threshold is regarded as the second category target terminal; Distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and send some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperate with each terminal in the second-category target terminal in turn to perform the learning tasks of the current round of model training.
2. The method according to claim 1, characterized in that The sending of a preset part of the learning tasks in the model to be trained to each of the second-category target terminals, and sequentially cooperating with each of the second-category target terminals to perform the learning tasks of the current round of model training, includes: Randomly or according to a preset terminal scoring strategy, sort the terminals in the second category of target terminals; According to the ranking result of the second-category target terminals, for each second-category target terminal, the preset partial learning task is sent to the current second-category target terminal, so that the current second-category target terminal completes the partial learning task of the current round of model training, and obtains the preliminary learning result of the current second-category target terminal for the preset partial learning task; Based on the primary learning result, the learning tasks other than the preset partial learning tasks are completed to obtain a secondary learning result, and the secondary learning result is sent to the current second-category target terminal, so that the current second-category target terminal completes the final label calculation result; The parameters of the model to be trained are updated according to the final label calculation result, and the preset partial learning tasks of the model to be trained after the updated parameters are sent to the next second category target terminal corresponding to the current second category target terminal in the sorting result to continue learning until all terminals in the second category target terminal complete the learning tasks of the current round of model training.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining independent model training results for each of the first-category target terminals and a coordinated model training result for the last terminal that performs a learning task among the second-category target terminals; Based on the independent model training results and the coordinated model training results, final model parameters of the model to be trained in the current round of model training are determined.
4. The method according to claim 3, characterized in that The determining, based on the training results of each of the independent models and the coordinated model training results, final model parameters of the model to be trained in the current round of model training includes: Calculate the mean or weighted sum of the independent model training results and the matching model training results; The numerical values of the parameters corresponding to the mean value or the weighted sum value are used as the final model parameters.
5. The method according to claim 1, characterized in that Before sending the learning task to each target terminal, the method further includes: Initialize the parameters of the model to be trained.
6. The method according to claim 2, characterized in that The method further comprises: When the waiting time for the preliminary learning result of the current second-category target terminal is greater than the preset waiting time threshold, the preset partial learning task of the model to be trained, which is updated based on the final label calculation result calculated for the previous second-category target terminal corresponding to the current second-category target terminal in the sorting result, is sent to the next second-category target terminal corresponding to the current second-category target terminal in the sorting result.
7. A task scheduling device for large-scale federated learning, characterized in that: The device comprises: A federated learning participating terminal determination module is used to send model training condition attribute parameter request information to a preset broadcast domain, obtain corresponding request feedback information, and determine the target terminal participating in the current round of model training based on the request feedback information; The participating terminal classification module is used to classify the target terminals according to the model training condition attribute parameters in the request feedback information to obtain the first type of target terminals and the second type of target terminals; specifically, it is used to score the learning ability of each target terminal according to the preset terminal scoring strategy, according to one or more of the computing resource information, network status information, power constraint information and model training data volume information in the request feedback information, and set a scoring threshold; according to the learning ability scoring results of each target terminal, the target terminal whose learning ability scoring result is greater than the scoring threshold is regarded as the first type of target terminal, and the target terminal whose learning ability scoring result is less than the scoring threshold is regarded as the second type of target terminal; The terminal learning task scheduling module is used to distribute all learning tasks of the model to be trained to each of the first-category target terminals, so that each of the first-category target terminals independently performs the learning tasks of the current round of model training, and sends some of the preset learning tasks in the model to be trained to each of the second-category target terminals, and cooperates with each terminal in the second-category target terminal to perform the learning tasks of the current round of model training in turn.
8. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the task scheduling method for large-scale federated learning as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the task scheduling method for large-scale federated learning as described in any one of claims 1 to 6 is implemented.
