Federated learning modeling method, device, equipment and readable storage medium

By negotiating with the federated learning participation device to determine the model training task and time period, and coordinating the federated learning modeling device to conduct federated learning modeling, the problem of low computing resource utilization of coordinators in the federated learning system is solved, and resource utilization efficiency is improved.

CN111538598BActive Publication Date: 2024-11-08WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010360246.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-29
Publication Date
2024-11-08
Estimated Expiration
2040-04-29

AI Technical Summary

Technical Problem

In the federated learning system, coordinators do not need to perform computational tasks when local iterative training is carried out by each federal party, but occupy computing resources, resulting in low computing resource utilization.

Method used

By negotiating and interacting with each federal participating devices, determine the model training tasks and model training time periods to be completed, and coordinate the participating devices to perform preset federated learning modeling processes based on this information, ensuring that the coordinator effectively utilizes computing during the model training time period. resource.

Benefits of technology

This improves the computing resource utilization rate of the coordinator, avoids the situation where the coordinator does not need to perform computing tasks during local iterative training, and enhances the system's resource efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111538598B_ABST
    Figure CN111538598B_ABST
Patent Text Reader

Abstract

The present application discloses a federated learning modeling method, apparatus, device and readable storage medium, wherein the federated learning modeling method comprises: negotiating and interacting with each second device associated with the first device, determining each model training task to be completed, and determining each model training participating device corresponding to each model training task to be completed in each second device, thereby obtaining the model training time period corresponding to each model training task to be completed, and based on each model training time period, coordinating each model training participating device corresponding to each model training task to be completed to perform a preset federated learning modeling process to complete each model training task to be completed. The present application solves the technical problem of low utilization of computing resources of the coordinator in the federated learning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a federated learning modeling method, apparatus, device and readable storage medium. Background Art

[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.

[0003] With the continuous development of computer software and artificial intelligence, the application field of federated learning is becoming more and more extensive. In the federated learning scenario, usually multiple federated learning participants jointly train a model, and the coordinator is used to coordinate the various federated learning participants to perform model training. For example, in each round of federation, the gradients sent by each federated participant are weighted and averaged, etc. However, when each federated participant performs local iterative training, the coordinator does not need to perform computing tasks but occupies computing resources. That is, when each federated participant performs local iterative training, the computing resources of the coordinator are wasted, thereby reducing the computing resource utilization of the coordinator. That is, there is a technical problem in the prior art that the computing resource utilization of the coordinator in the federated learning system is low. Summary of the invention

[0004] The main purpose of this application is to provide a federated learning modeling method, apparatus, device and readable storage medium, aiming to solve the technical problem of low utilization of coordinator computing resources in the federated learning system in the prior art.

[0005] To achieve the above object, the present application provides a federated learning modeling method, which is applied to a first device and includes:

[0006] Negotiate and interact with each second device associated with the first device to determine each model training task to be completed, and determine each model training participating device corresponding to each model training task to be completed in each second device;

[0007] Obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on each of the model training time periods, coordinate the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process to complete each of the to-be-completed model training tasks.

[0008] Optionally, the step of determining, in each of the second devices, each model training participating device corresponding to each of the to-be-completed model training tasks, respectively, includes:

[0009] Obtaining model training information corresponding to each of the model training tasks;

[0010] Based on each of the model training information, the model training participating devices corresponding to each of the to-be-completed model training tasks are determined by performing intention confirmation interaction with each of the second devices.

[0011] Optionally, the model training information includes model index information.

[0012] The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises:

[0013] Sending each of the model index information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks;

[0014] Based on the first determination information respectively fed back by the second devices, the model training participating devices respectively corresponding to the model training tasks to be completed are determined.

[0015] Optionally, the model training information includes model training time information.

[0016] The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises:

[0017] Sending each of the model training time information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks;

[0018] Based on the second determination information respectively fed back by the second devices, the model training participating devices respectively corresponding to the model training tasks to be completed are determined.

[0019] Optionally, in each of the model training time periods, local model parameters sent by each of the model training participating devices corresponding to the model training time period are respectively received, and the latest federated model parameters are calculated based on a preset aggregation rule;

[0020] Determine whether the latest federated model parameters meet the preset training task end condition;

[0021] If the latest federated model parameters meet the preset training task end condition, the latest federated model parameters are sent to each of the second devices so that each of the second devices can update its own local model;

[0022] If the latest federal model parameters do not meet the preset training task termination conditions, the latest federal model parameters will be sent to each of the model training participating devices respectively, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions.

[0023] To achieve the above object, the present application also provides a federated learning modeling method, which is applied to a second device and includes:

[0024] Interacting with the first device to determine model training information and obtain device status information, so as to determine whether to participate in a to-be-completed model training task corresponding to the model training information based on the device status information;

[0025] If participating in the pending model training task, the preset federated learning modeling process is executed through coordinated interaction with the first device to complete the pending model training task.

[0026] Optionally, the step of executing a preset federated learning modeling process by coordinating and interacting with the first device includes:

[0027] Determine the model to be trained corresponding to the model training task to be completed, and iteratively train the model to be trained until the model to be trained reaches a preset number of iterations, and obtain local model parameters corresponding to the model to be trained;

[0028] Sending the local model parameters to the first device, so that the first device calculates the latest federal model parameters based on the local model parameters;

[0029] Receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the model to be trained until the local model reaches a preset training end condition, and obtain the target modeling model corresponding to the model training task to be completed.

[0030] The present application also provides a federated learning modeling apparatus, which is a virtual apparatus and is applied to a first device. The federated learning modeling apparatus includes:

[0031] A negotiation module, used to negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine each model training participating device corresponding to each model training task to be completed in each second device;

[0032] A coordination module is used to obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on each of the model training time periods, coordinate the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process to complete each of the to-be-completed model training tasks.

[0033] Optionally, the negotiation module includes:

[0034] An acquisition unit, used to acquire model training information corresponding to each of the model training tasks;

[0035] A determination unit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the model training information by performing intention confirmation interaction with each of the second devices.

[0036] Optionally, the determining unit includes:

[0037] A first sending subunit is used to send each of the model index information to each of the second devices, so that each of the second devices can determine each target model training task to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks;

[0038] The first determination subunit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the first determination information respectively fed back by each of the second devices.

[0039] Optionally, the determining unit further includes:

[0040] A second sending subunit is used to send each of the model training time information to each of the second devices, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks;

[0041] The second determination subunit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the second determination information respectively fed back by each of the second devices.

[0042] Optionally, the coordination module includes:

[0043] A calculation unit, configured to receive, within each of the model training time periods, local model parameters sent by each of the model training participating devices corresponding to the model training time period, and calculate the latest federated model parameters based on a preset aggregation rule;

[0044] A first determination unit, used to determine whether the latest federated model parameters meet a preset training task end condition;

[0045] an updating unit, configured to send the latest federated model parameters to each of the second devices if the latest federated model parameters meet the preset training task end condition, so that each of the second devices can update its own local model;

[0046] The second determination unit is used to send the latest federal model parameters to each of the model training participating devices respectively if the latest federal model parameters do not meet the preset training task termination conditions, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions.

[0047] To achieve the above-mentioned object, the present application further provides a federated learning modeling apparatus, which is applied to a second device, and further includes:

[0048] An interaction module, configured to interact with the first device, determine model training information, and obtain device status information, so as to determine whether to participate in a to-be-completed model training task corresponding to the model training information based on the device status information;

[0049] The federated learning modeling module is used to coordinate and interact with the first device to execute a preset federated learning modeling process to complete the model training task to be completed if participating in the model training task to be completed.

[0050] Optionally, the federated learning modeling module includes:

[0051] An iterative training unit, used to determine the model to be trained corresponding to the model training task to be completed, and iteratively train the model to be trained until the model to be trained reaches a preset number of iterations, and obtain local model parameters corresponding to the model to be trained;

[0052] A sending unit, configured to send the local model parameters to the first device, so that the first device calculates the latest federal model parameters based on the local model parameters;

[0053] An updating unit is used to receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the model to be trained until the local model reaches a preset training end condition, thereby obtaining a target modeling model corresponding to the model training task to be completed.

[0054] The present application also provides a federated learning modeling device, which is a physical device, and includes: a memory, a processor, and a program of the federated learning modeling method stored in the memory and executable on the processor. When the program of the federated learning modeling method is executed by the processor, the steps of the federated learning modeling method as described above can be implemented.

[0055] The present application also provides a readable storage medium, on which is stored a program for implementing the federated learning modeling method. When the program of the federated learning modeling method is executed by a processor, the steps of the federated learning modeling method as described above are implemented.

[0056] The present application determines each model training task to be completed by negotiating and interacting with each second device associated with the first device, and determines each model training participating device corresponding to each model training task to be completed in each second device, thereby obtaining the model training time period corresponding to each model training task to be completed, and based on each model training time period, coordinates each model training participating device corresponding to each model training task to be completed to perform a preset federated learning modeling process to complete each model training task to be completed. That is, the present application provides a method for performing federated learning based on a time-sharing manner, that is, before performing federated learning modeling, by interacting with each of the second devices, the model training tasks to be completed that need to be executed are determined, and then the model training participating devices and model training time periods corresponding to each of the model training tasks to be completed are determined, and then the coordinator can coordinate the model training participating devices corresponding to each of the model training tasks to be completed based on the model training time periods to perform a preset federated learning modeling process to complete each of the model training tasks to be completed, that is, when the model participating devices of a training model to be completed are performing local iterative training, the coordinator can coordinate the model training participating devices corresponding to other model training tasks to be completed to perform federated learning modeling, thereby avoiding the situation where the coordinator does not need to perform computing tasks but occupies computing resources when each federated participant performs local iterative training, thereby achieving the purpose of making full use of the coordinator's computing resources and improving the utilization rate of the coordinator's computing resources. Therefore, the technical problem of low utilization rate of the coordinator's computing resources in the federated learning system is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0059] Figure 1 This is a flowchart of the first embodiment of the federated learning modeling method of the present application;

[0060] Figure 2 This is a flow chart of the second embodiment of the federated learning modeling method of the present application;

[0061] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0062] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0063] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] The present application embodiment provides a federated learning modeling method. In the first embodiment of the federated learning modeling method of the present application, refer to Figure 1 , the federated learning modeling method is applied to a first device, and the federated learning modeling method includes:

[0065] Step S10, performing negotiation and interaction with each second device associated with the first device, determining each model training task to be completed, and determining each model training participating device corresponding to each model training task to be completed in each second device;

[0066] In this embodiment, it should be noted that one of the to-be-completed model training tasks corresponds to one or more model training participating devices, the first device is the coordinator of horizontal federated learning, the second device is a participant in horizontal federated learning, the model training participating device is the second device participating in the to-be-completed training task, and the to-be-completed model training task is a task for model training based on horizontal federated learning, wherein one to-be-completed model training task can be used to train one or more target models, and one of the target models can also be obtained based on executing one or more to-be-completed model training tasks.

[0067] Optionally, the second device may choose to execute the to-be-completed model training task in a preset trusted execution environment, such as Intel's SGX (Intel Software Guard Extensions).

[0068] Each second device associated with the first device negotiates and interacts to determine each model training task to be completed, and determines each model training participating device corresponding to each model training task to be completed in each second device. Specifically, each second device associated with the first device negotiates and interacts to determine each model training task to be completed and model training information of each model training task to be completed, and then based on the model training information, determines each model training participating device corresponding to each model training task to be completed in each second device.

[0069] Wherein, in step S10, the step of determining in each of the second devices the model training participating devices corresponding to each of the to-be-completed model training tasks respectively comprises:

[0070] Step S11, obtaining model training information corresponding to each of the model training tasks;

[0071] In this embodiment, it should be noted that the model training information includes model name information, model training time period, etc., wherein the model name information is the identifier of the corresponding model to be trained, such as a code, a character string, etc., and the model training time period is the estimated time information required for model training.

[0072] Step S12, based on each of the model training information, by performing intention confirmation interaction with each of the second devices, determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks.

[0073] In this embodiment, based on each of the model training information, the willingness confirmation interaction is performed with each of the second devices to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks. Specifically, each of the model training information is sent to each of the second devices so that each of the second devices can obtain device status information, and based on the device status information, it is determined whether to participate in the to-be-completed model training tasks corresponding to each of the model training information. If it is determined to participate in the to-be-completed model training tasks, the determination information corresponding to the to-be-completed model training tasks is fed back to the first device, and then the first device receives each of the determination information, identifies the second device corresponding to each of the determination information as a model training participating device, and counts one or more model training participating devices corresponding to each of the to-be-completed model training tasks.

[0074] Wherein, the model training information includes model index information,

[0075] The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises:

[0076] Step A10, sending each of the model index information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks;

[0077] In this embodiment, it should be noted that the model index information is the identification information of the corresponding model training task to be completed, such as a code or a character string, and the first determination information is information indicating that the second device is determined to participate in the model training task to be completed corresponding to the model index information, wherein the first determination information may be willingness information, local model parameter information or local model gradient information separately replied by the second device, to indicate that the second device is willing to participate in the corresponding model training task to be completed, and each of the training tasks to be completed corresponds to a model training time period for executing the task.

[0078] Each of the model index information is sent to each of the second devices respectively, so that each of the second devices can determine each target model training task to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks. Specifically, the model index information corresponding to the model training time period is broadcast to each of the second devices within a preset time period before the start of each of the model training time periods, so that the second device can determine the corresponding to-be-completed model training tasks based on the model index information, and based on the acquired current device operating status, wherein the device operating status includes the currently available computing resources, further determine whether to participate in the to-be-completed model training tasks; if it is determined to participate in the to-be-completed model training tasks, the first determination information is fed back to the first device to indicate participation in the to-be-completed model training tasks; if it is determined not to participate in the to-be-completed model training tasks, the model index information is ignored, and wait for receiving the next model index information.

[0079] Step A20: Based on the first determination information respectively fed back by the second devices, determine the model training participating devices corresponding to the model training tasks to be completed.

[0080] In this embodiment, based on the first determination information respectively fed back by the second devices, the model training participating devices corresponding to the model training tasks to be completed are determined. Specifically, before the start of each model training time period, the first determination information corresponding to the model training tasks to be completed corresponding to the model index information sent by the second devices is received respectively, and the second device that sends each first determination information is used as the model training participating device, wherein one first determination information corresponds to one second device and one model training participating device.

[0081] Wherein, the model training information includes model training time information,

[0082] The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises:

[0083] Step B10, sending each of the model training time information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks;

[0084] In this embodiment, it should be noted that the second determination information is information indicating that the second device has determined to participate in the to-be-completed model training task corresponding to the model training time information, each of the to-be-completed training tasks corresponds to a model training time period for executing the task, and the second determination information will be sent by the second device to the first device before the start of the model training time period corresponding to the to-be-completed model training task corresponding to the second determination information.

[0085] Each of the model training time information is sent to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks. Specifically, before the model training time period corresponding to each of the to-be-completed model training tasks, each of the model training time information is sent to each of the second devices respectively, so that each of the second devices can obtain the training time limit information respectively, wherein the training time limit information indicates whether the second device has free time and sufficient computing resources to participate in the to-be-completed model training tasks within the model training time period. Then, each of the second devices will determine whether to participate in the to-be-completed model training tasks corresponding to the model training time information based on the training limit information and the model training time information. If it is determined to participate in the to-be-completed model training tasks, the second determination information will be fed back to the first device to indicate that it participates in the to-be-completed model training tasks. If it is determined not to participate in the to-be-completed model training tasks, the model training time information will be ignored, and the next model training time information will be waited for.

[0086] Step B20: Determine the model training participating devices corresponding to the model training tasks to be completed based on the second determination information respectively fed back by the second devices.

[0087] In this embodiment, based on the second determination information respectively fed back by the second devices, the model training participating devices corresponding to the model training tasks to be completed are determined. Specifically, before the start of each model training time period, the second determination information corresponding to the model training tasks to be completed corresponding to the model training time information sent by the second devices is received respectively, and the second device sending each second determination information is used as the model training participating device, wherein one first determination information corresponds to one second device and one model training participating device.

[0088] Step S20, obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on each of the model training time periods, coordinate each of the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process to complete each of the to-be-completed model training tasks.

[0089] In this embodiment, it should be noted that the preset federated learning modeling process is a process for performing federated learning, and each of the model training time periods includes a first model training time period and a second model training time period.

[0090] Obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on each of the model training time periods, coordinate each of the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process to complete each of the to-be-completed model training tasks. Specifically, obtain the model training time period corresponding to each of the to-be-completed model training tasks, and in each of the model training time periods, receive the local model parameters sent by the corresponding each of the model training participating devices, and calculate the latest federal model parameters corresponding to each of the local model parameters based on preset aggregation rules, wherein the preset aggregation rules include weighted averaging, summing, etc., and determine whether the latest federal model parameters meet the preset training task completion conditions. If the latest federal model parameters meet the training task completion conditions, send the latest federal model parameters to each of the second devices respectively, so that each of the second devices can update their respective local models based on the latest federal model parameters. If the latest federal model parameters do not meet the training task completion conditions, send the latest federal model parameters to each of the model training devices respectively. Participating devices, so that each of the model training participating devices updates its own local model, and re-performs federated learning based on the updated local model, and recalculates the latest federated model parameters until the latest federated model parameters meet the training task completion conditions, wherein the training task completion conditions include loss function convergence, model reaching the maximum number of iterations, etc., wherein, if there is an intersection time period for each of the model training time periods, then within the intersection time period, the first device will determine the order of calculating the latest federated model parameters corresponding to each of the to-be-completed model training tasks according to the time sequence of receiving each of the local model parameters corresponding to each of the to-be-completed model training tasks. For example, assuming that each of the to-be-completed model training tasks includes task A and task B, then the first device has received all the local model parameters sent by the model training participating devices corresponding to task A at 9:07, and has received all the local model parameters sent by the model training participating devices corresponding to task B at 9:09, then the first device will give priority to calculating the latest federated model parameters corresponding to task A, and then calculate the latest federated model parameters corresponding to task B.

[0091] Optionally, the first device may choose to execute, in the preset trusted execution environment, a step of calculating, based on preset aggregation rules, the latest federal model parameters corresponding to each of the local model parameters.

[0092] The step of respectively coordinating each of the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process based on each of the model training time periods includes:

[0093] Step S21, in each of the model training time periods, respectively receiving the local model parameters sent by each of the model training participating devices corresponding to the model training time period, and calculating the latest federated model parameters based on a preset aggregation rule;

[0094] In this embodiment, it should be noted that the local model parameters include model network parameters and gradient information, etc., wherein the model network parameters are the network parameters of the local model after iterative training after the model training participating device iteratively trains the local model held by itself for a preset number of times. For example, assuming that the local model is a linear model Y=β0+β1X1+β2X2+…+β n X n , then the network parameters are vectors (β0, β1, β2, ..., β n ).

[0095] In each of the model training time periods, local model parameters sent by each of the model training participating devices corresponding to the model training time period are received respectively, and the latest federal model parameters are calculated based on preset aggregation rules. Specifically, in each of the model training time periods, local model parameters sent by each of the model training participating devices corresponding to the model training time period are received, wherein each of the local model parameters is obtained by the model training participating device performing a preset number of iterative training on the federal participating model corresponding to the local model parameter, wherein the federal participating model is the local model of the model training participating device, and then based on the preset aggregation rules, each of the local model parameters is weightedly averaged to obtain the latest federal model parameters.

[0096] Step S22, determining whether the latest federated model parameters meet the preset training task end condition;

[0097] In this embodiment, it should be noted that the preset training task termination conditions include the training reaching a maximum number of iterations, the loss function training convergence, etc.

[0098] Determine whether the latest federated model parameters meet the preset training task end condition. Specifically, if the difference between the latest federated model parameters and the latest federated model parameters of the previous round is less than a preset difference threshold, then determine that the latest federated model parameters meet the preset training task end condition.

[0099] Step S23: if the latest federated model parameters meet the preset training task end condition, the latest federated model parameters are sent to each of the second devices so that each of the second devices can update its own local model;

[0100] In this embodiment, if the latest federal model parameters meet the preset training task termination conditions, the latest federal model parameters are sent to each second device so that each second device can update its own local model. Specifically, if the latest federal model parameters meet the preset training task termination conditions, the latest federal model parameters are sent to each second device so that each second device can replace and update the corresponding model parameters in the local model with the latest federal model parameters based on the latest federal model parameters.

[0101] In addition, it can be set that if the difference between the latest federal model parameters and the latest federal model parameters of the previous round is less than a preset difference threshold for a preset number of consecutive times, it is determined that the latest federal model parameters meet the preset training task end conditions.

[0102] Step S23: If the latest federal model parameters do not meet the preset training task termination conditions, the latest federal model parameters are sent to each of the model training participating devices respectively, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions.

[0103] In this embodiment, if the latest federal model parameters do not meet the preset training task termination conditions, the latest federal model parameters are sent to each of the model training participating devices respectively, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions. Specifically, if the latest federal model parameters do not meet the preset training task termination conditions, the latest federal model parameters are sent to each of the model training participating devices respectively, so that each of the model training participating devices can update its own federal participation model based on the latest federal model parameters, and iteratively train the updated federal participation model. When the number of iterative training reaches the preset number of iterative training times, the local model parameters of the federal participation model after iterative training are re-acquired, and the recalculated local model parameters are sent to the first device, so that the first device can recalculate the latest federal model parameters based on the recalculated local model parameters sent by each of the second devices and the preset aggregation rules, until the latest federal model parameters meet the preset training task termination conditions.

[0104] This embodiment determines each model training task to be completed by negotiating and interacting with each second device associated with the first device, and determines each model training participating device corresponding to each model training task to be completed in each second device, thereby obtaining the model training time period corresponding to each model training task to be completed, and based on each model training time period, coordinates each model training participating device corresponding to each model training task to be completed to perform a preset federated learning modeling process to complete each model training task to be completed. That is, this embodiment provides a method for performing federated learning based on a time-sharing manner, that is, before performing federated learning modeling, by interacting with each of the second devices, the model training tasks to be completed that need to be executed are determined, and then the model training participating devices and model training time periods corresponding to each of the model training tasks to be completed are determined, and then the coordinator can coordinate the model training participating devices corresponding to each of the model training tasks to be completed based on each of the model training time periods to perform a preset federated learning modeling process to complete each of the model training tasks to be completed, that is, when the model participating devices of a training model to be completed are performing local iterative training, the coordinator can coordinate the model training participating devices corresponding to other model training tasks to be completed to perform federated learning modeling, thereby avoiding the situation where the coordinator does not need to perform computing tasks and consume computing resources when each federated participant performs local iterative training, thereby achieving the purpose of making full use of the coordinator's computing resources and improving the utilization rate of the coordinator's computing resources. Therefore, the technical problem of low utilization rate of the coordinator's computing resources in the federated learning system is solved.

[0105] Further, refer to Figure 2 Based on the first embodiment of the present application, in another embodiment of the present application, the federated learning modeling method is applied to a second device, and the federated learning modeling method includes:

[0106] Step C10, interacting with the first device, determining model training information, and acquiring device status information, so as to determine whether to participate in the to-be-completed model training task corresponding to the model training information based on the device status information;

[0107] In this embodiment, the model training information includes model index information and model training time information, and the device status information includes the available computing resources of the second device, wherein the available computing resources are the computing resources that can be called by the second device within the model training time period corresponding to the model training task to be completed.

[0108] Before performing step C10, the second device negotiates and interacts with the first device to determine each model training task to be completed.

[0109] Interact with the first device to determine model training information, and obtain device status information, so as to determine whether to participate in the to-be-completed model training task corresponding to the model training information based on the device status information. Specifically, negotiate and interact with the first device to obtain model training information, and determine available computing resources, and then judge whether the available computing resources meet the to-be-completed model training task corresponding to the model training information. If the available computing resources meet the to-be-completed model training task, it is determined to participate in the to-be-completed model training task. If the available computing resources do not meet the to-be-completed model training task, it is determined not to participate in the to-be-completed model training task. For example, assuming that the to-be-completed model training task needs to occupy 50% of all computing resources of the second device, and the available computing resources that can be called by the second device are 40%, the available computing resources do not meet the to-be-completed model training task, and then it is determined not to participate in the to-be-completed model training task.

[0110] Step C20, if participating in the to-be-completed model training task, then executing a preset federated learning modeling process by coordinating and interacting with the first device to complete the to-be-completed model training task.

[0111] In this embodiment, if participating in the to-be-completed model training task, the preset federated learning modeling process is executed by coordinating and interacting with the first device to complete the to-be-completed model training task. Specifically, if participating in the to-be-completed model training task, the to-be-trained model corresponding to the to-be-completed model training task is determined, and the to-be-trained model is iteratively trained until the to-be-trained model reaches a preset number of iterative training times, then the local model parameters of the to-be-trained model after iterative training are obtained, and the local model parameters are sent to the first device, so that the first device can calculate the latest federal model parameters based on the local model parameters sent by each second device, and The latest federal model parameters are broadcast to each second device, and then the second device receives the latest federal model parameters, and based on the latest federal model parameters, updates the model to be trained, and determines whether the updated model to be trained meets the preset iteration end condition. If the updated model to be trained meets the preset iteration end condition, it is determined that the training task of the model to be completed is completed. If the updated model to be trained does not meet the preset iteration end condition, the model to be trained is iteratively trained again so that the first device can recalculate the latest federal model parameters to re-update the model to be trained until the updated model to be trained meets the preset iteration end condition.

[0112] Among them, in step C20, the step of executing a preset federated learning modeling process by coordinating and interacting with the first device includes:

[0113] Step C21, determining the model to be trained corresponding to the to-be-completed model training task, and iteratively training the model to be trained until the model to be trained reaches a preset number of iterations, and obtaining local model parameters corresponding to the model to be trained;

[0114] In this embodiment, the model to be trained corresponding to the model training task to be completed is determined, and the model to be trained is iteratively trained until the model to be trained reaches a preset number of iterations, and the local model parameters corresponding to the model to be trained are obtained. Specifically, the model to be trained corresponding to the model training task to be completed is determined, and the model to be trained is iteratively trained and updated until the model to be trained reaches a preset number of iterations, and the local model parameters of the model to be trained after the iterative training and update are extracted.

[0115] Step C22, sending the local model parameters to the first device, so that the first device calculates the latest federal model parameters based on the local model parameters;

[0116] In this embodiment, the local model parameters are sent to the first device so that the first device calculates the latest federal model parameters based on the local model parameters. Specifically, the local model parameters are sent to the first device so that the first device calculates the latest federal model parameters corresponding to each local model parameter based on the local model parameters sent by the associated second devices through preset aggregation rules, wherein the preset aggregation rules include weighted averaging, summation, etc.

[0117] Step C23, receiving the latest federated model parameters fed back by the first device, and updating the model to be trained based on the latest federated model parameters until the local model reaches the preset training end condition, and obtaining the target modeling model corresponding to the model training task to be completed.

[0118] In this embodiment, the latest federal model parameters fed back by the first device are received, and based on the latest federal model parameters, the model to be trained is updated until the local model reaches a preset training end condition, and the target modeling model corresponding to the model training task to be completed is obtained. Specifically, the latest federal model parameters fed back by the first device are received, and the local model parameters in the model to be trained are replaced and updated with the latest federal model parameters to obtain the replaced and updated model to be trained, and it is determined whether the replaced and updated model to be trained meets the preset iterative training end condition. If the replaced and updated model to be trained meets the preset iterative training end condition, the replaced and updated model to be trained is used as the target modeling model. If the replaced and updated model to be trained does not meet the preset iterative training end condition, the model to be trained is iteratively trained again to replace and update the model to be trained until the replaced and updated model to be trained meets the preset iterative training end condition.

[0119] This embodiment determines the model training information and obtains the device status information by interacting with the first device, so as to determine whether to participate in the to-be-completed model training task corresponding to the model training information based on the device status information, and then if participating in the to-be-completed model training task, it coordinates and interacts with the first device to execute the preset federated learning modeling process to complete the to-be-completed model training task. That is, this embodiment provides a method for modeling based on federated learning, that is, before performing federated learning modeling, it determines whether to participate in the to-be-completed model training task corresponding to the model training information by negotiating and interacting with the first device and obtaining its own device operating status, and then if it is determined to participate, it can coordinate and interact with the first device to execute the preset federated learning modeling process to complete the model training task, that is, the second device can autonomously choose to participate in the to-be-completed model training task before each federated learning modeling, thereby laying a foundation for solving the technical problem of low utilization of computing resources of the coordinator in the federated learning system.

[0120] Reference Figure 3 , Figure 3 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0121] like Figure 3As shown, the federated learning modeling device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0122] Optionally, the federated learning modeling device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0123] Those skilled in the art will understand that Figure 3 The structure of the federated learning modeling device shown in the figure does not constitute a limitation of the federated learning modeling device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0124] like Figure 3 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a federated learning modeling program. The operating system is a program that manages and controls the hardware and software resources of the federated learning modeling device, and supports the operation of the federated learning modeling program and other software and / or programs. The network communication module is used to realize communication between the components inside the memory 1005, and communication with other hardware and software in the federated learning modeling system.

[0125] exist Figure 3 In the federated learning modeling device shown, the processor 1001 is used to execute the federated learning modeling program stored in the memory 1005 to implement the steps of any of the above-mentioned federated learning modeling methods.

[0126] The specific implementation of the federated learning modeling device of the present application is basically the same as the embodiments of the above-mentioned federated learning modeling method, and will not be repeated here.

[0127] The embodiment of the present application further provides a federated learning modeling apparatus, which is applied to a first device and includes:

[0128] A negotiation module, used to negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine each model training participating device corresponding to each model training task to be completed in each second device;

[0129] A coordination module is used to obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on each of the model training time periods, coordinate the model training participating devices corresponding to each of the to-be-completed model training tasks to perform a preset federated learning modeling process to complete each of the to-be-completed model training tasks.

[0130] Optionally, the negotiation module includes:

[0131] An acquisition unit, used to acquire model training information corresponding to each of the model training tasks;

[0132] A determination unit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the model training information by performing intention confirmation interaction with each of the second devices.

[0133] Optionally, the determining unit includes:

[0134] A first sending subunit is used to send each of the model index information to each of the second devices, so that each of the second devices can determine each target model training task to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks;

[0135] The first determination subunit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the first determination information respectively fed back by each of the second devices.

[0136] Optionally, the determining unit further includes:

[0137] A second sending subunit is used to send each of the model training time information to each of the second devices, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks;

[0138] The second determination subunit is used to determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks based on each of the second determination information respectively fed back by each of the second devices.

[0139] Optionally, the coordination module includes:

[0140] A calculation unit, configured to receive, within each of the model training time periods, local model parameters sent by each of the model training participating devices corresponding to the model training time period, and calculate the latest federated model parameters based on a preset aggregation rule;

[0141] A first determination unit, used to determine whether the latest federated model parameters meet a preset training task end condition;

[0142] an updating unit, configured to send the latest federated model parameters to each of the second devices if the latest federated model parameters meet the preset training task end condition, so that each of the second devices can update its own local model;

[0143] The second determination unit is used to send the latest federal model parameters to each of the model training participating devices respectively if the latest federal model parameters do not meet the preset training task termination conditions, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions.

[0144] The specific implementation of the federated learning modeling device of the present application is basically the same as the embodiments of the above-mentioned federated learning modeling method, and will not be repeated here.

[0145] To achieve the above-mentioned purpose, an embodiment of the present application further provides a federated learning modeling device, which is applied to a second device and includes:

[0146] An interaction module, configured to interact with the first device, determine model training information, and obtain device status information, so as to determine whether to participate in a to-be-completed model training task corresponding to the model training information based on the device status information;

[0147] The federated learning modeling module is used to coordinate and interact with the first device to execute a preset federated learning modeling process to complete the model training task to be completed if participating in the model training task to be completed.

[0148] Optionally, the federated learning modeling module includes:

[0149] An iterative training unit, used to determine the model to be trained corresponding to the model training task to be completed, and iteratively train the model to be trained until the model to be trained reaches a preset number of iterations, and obtain local model parameters corresponding to the model to be trained;

[0150] A sending unit, configured to send the local model parameters to the first device, so that the first device calculates the latest federal model parameters based on the local model parameters;

[0151] An updating unit is used to receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the model to be trained until the local model reaches a preset training end condition, thereby obtaining a target modeling model corresponding to the model training task to be completed.

[0152] The specific implementation of the federated learning modeling device of the present application is basically the same as the embodiments of the above-mentioned federated learning modeling method, and will not be repeated here.

[0153] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned federated learning modeling methods.

[0154] The specific implementation methods of the readable storage medium of the present application are basically the same as the embodiments of the above-mentioned federated learning modeling method, and will not be repeated here.

[0155] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A federated learning modeling method, characterized in that: The federated learning modeling method is applied to a first device, and the federated learning modeling method includes: Negotiate and interact with each second device associated with the first device to determine each model training task to be completed, and determine each model training participating device corresponding to each model training task to be completed in each second device; Obtaining the model training time period corresponding to each of the to-be-completed model training tasks, and in each of the model training time periods, respectively receiving the local model parameters sent by each of the model training participating devices corresponding to the model training time period, and calculating the latest federated model parameters based on a preset aggregation rule; Determine whether the latest federated model parameters meet the preset training task end condition, wherein the preset training task end condition includes that the training reaches the maximum number of iterations and the loss function training converges; If the latest federated model parameters meet the preset training task end condition, the latest federated model parameters are sent to each of the second devices so that each of the second devices can update its own local model; If the latest federal model parameters do not meet the preset training task termination conditions, the latest federal model parameters will be sent to each of the model training participating devices respectively, so that each of the model participating devices can update its own federal participation model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task termination conditions to complete each of the to-be-completed model training tasks.

2. The federated learning modeling method according to claim 1, characterized in that: The step of determining, in each of the second devices, each model training participating device corresponding to each of the to-be-completed model training tasks, respectively, comprises: Obtaining model training information corresponding to each of the model training tasks; Based on each of the model training information, the model training participating devices corresponding to each of the to-be-completed model training tasks are determined by performing intention confirmation interaction with each of the second devices.

3. The federated learning modeling method according to claim 2, characterized in that: The model training information includes model index information, The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises: Sending each of the model index information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired model training requirement information and each of the model index information, and generate first determination information corresponding to each of the target model training tasks; Based on the first determination information respectively fed back by the second devices, the model training participating devices respectively corresponding to the model training tasks to be completed are determined.

4. The federated learning modeling method according to claim 2, characterized in that: The model training information includes model training time information, The step of determining each of the model training participating devices corresponding to each of the to-be-completed model training tasks by performing willingness confirmation interaction with each of the second devices based on each of the model training information comprises: Sending each of the model training time information to each of the second devices respectively, so that each of the second devices can determine each of the target model training tasks to participate in each of the model training tasks based on the acquired training time limit information and each of the model training time information, and generate second determination information corresponding to each of the target model training tasks; Based on the second determination information respectively fed back by the second devices, the model training participating devices respectively corresponding to the model training tasks to be completed are determined.

5. A federated learning modeling method, characterized in that: The federated learning modeling method is applied to a second device, and the federated learning modeling method includes: Interacting with the first device described in any one of claims 1 to 4, determining model training information, and obtaining device status information, so as to determine whether to participate in the to-be-completed model training task corresponding to the model training information based on the device status information; If participating in the pending model training task, the preset federated learning modeling process is executed through coordinated interaction with the first device to complete the pending model training task.

6. The federated learning modeling method according to claim 5, characterized in that: The step of executing a preset federated learning modeling process by coordinating and interacting with the first device includes: Determine the model to be trained corresponding to the model training task to be completed, and iteratively train the model to be trained until the model to be trained reaches a preset number of iterations, and obtain local model parameters corresponding to the model to be trained; Sending the local model parameters to the first device, so that the first device calculates the latest federal model parameters based on the local model parameters; Receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the model to be trained until the local model reaches a preset training end condition, and obtain the target modeling model corresponding to the model training task to be completed.

7. A federated learning modeling device, characterized in that: The federated learning modeling device comprises: A negotiation module, used to negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine each model training participating device corresponding to each model training task to be completed in each of the second devices; A coordination module is used to obtain the model training time period corresponding to each of the to-be-completed model training tasks, and within each of the model training time periods, respectively receive the local model parameters sent by each of the model training participating devices corresponding to the model training time period, and calculate the latest federal model parameters based on preset aggregation rules; determine whether the latest federal model parameters meet the preset training task end conditions; if the latest federal model parameters meet the preset training task end conditions, send the latest federal model parameters to each of the second devices so that each of the second devices can update its own local model; if the latest federal model parameters do not meet the preset training task end conditions, send the latest federal model parameters to each of the model training participating devices so that each of the model participating devices can update its own federal participating model to recalculate the latest federal model parameters until the latest federal model parameters meet the preset training task end conditions to complete each of the to-be-completed model training tasks.

8. A federated learning modeling device, characterized in that: The federated learning modeling device includes: a memory, a processor, and a program stored in the memory for implementing the federated learning modeling method. The memory is used to store a program for implementing a federated learning modeling method; The processor is used to execute a program for implementing the federated learning modeling method to implement the steps of the federated learning modeling method as described in any one of claims 1 to 4 or 5 to 6.

9. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing the federated learning modeling method, and the program for implementing the federated learning modeling method is executed by a processor to implement the steps of the federated learning modeling method as described in any one of claims 1 to 4 or 5 to 6.