CN111538598A - Federated learning modeling method, apparatus, device and readable storage medium - Google Patents
Federated learning modeling method, apparatus, device and readable storage medium Download PDFInfo
- Publication number
- CN111538598A CN111538598A CN202010360246.5A CN202010360246A CN111538598A CN 111538598 A CN111538598 A CN 111538598A CN 202010360246 A CN202010360246 A CN 202010360246A CN 111538598 A CN111538598 A CN 111538598A
- Authority
- CN
- China
- Prior art keywords
- model training
- model
- completed
- task
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 238000003860 storage Methods 0.000 title claims abstract description 11
- 238000012549 training Methods 0.000 claims abstract description 523
- 230000008569 process Effects 0.000 claims abstract description 26
- 230000003993 interaction Effects 0.000 claims description 20
- 230000002776 aggregation Effects 0.000 claims description 13
- 238000004220 aggregation Methods 0.000 claims description 13
- 238000012790 confirmation Methods 0.000 claims description 10
- 238000004891 communication Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本申请公开了一种联邦学习建模方法、装置、设备及可读存储介质,所述联邦学习建模方法包括:与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备,进而获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。本申请解决了联邦学习系统里协调者计算资源利用率低的技术问题。
The present application discloses a federated learning modeling method, apparatus, device, and readable storage medium. The federated learning modeling method includes: negotiating and interacting with each second device associated with the first device, and determining each to-be-completed learning method. model training tasks, and determine each model training participating device corresponding to each of the to-be-completed model training tasks in each of the second devices, and then obtain the model training time period corresponding to each of the to-be-completed model training tasks, and based on For each model training time period, 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, so as to complete each of the to-be-completed model training tasks. This application solves the technical problem of the low utilization rate of the coordinator's computing resources in the federated learning system.
Description
技术领域technical field
本申请涉及金融科技(Fintech)的人工智能领域,尤其涉及一种联邦学习建模方法、装置、设备及可读存储介质。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 technique
随着金融科技,尤其是互联网科技金融的不断发展,越来越多的技术(如分布式、区块链Blockchain、人工智能等)应用在金融领域,但金融业也对技术提出了更高的要求,如对金融业对应待办事项的分发也有更高的要求。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 for technology. Requirements, such as the distribution of corresponding to-do items in the financial industry, also have higher requirements.
随着计算机软件和人工智能的不断发展,联邦学习的应用领域也越来越广泛,在联邦学习场景中,通常由多个联邦学习参与方共同训练一个模型,而协调者用于协调各个联邦学习参与方进行模型训练,例如,在每轮联邦时,对各联邦参与方发送的梯度进行加权求平均等,但是,在各个联邦参与方进行本地迭代训练时,协调者无需执行计算任务但占用计算资源,也即,在各个联邦参与方进行本地迭代训练时,浪费了协调者的计算资源,进而降低了协调者的计算资源利用率,也即,现有技术中存在联邦学习系统里协调者计算资源利用率低的技术问题。With the continuous development of computer software and artificial intelligence, the application fields of federated learning are becoming more and more extensive. In a federated learning scenario, a model is usually trained by multiple federated learning participants, and the coordinator is used to coordinate each federated learning. Participants perform model training. For example, in each round of federation, the gradients sent by each federation participant are weighted and averaged, etc. However, when each federation participant performs local iterative training, the coordinator does not need to perform computing tasks but takes up computing power. resources, that is, when each federated participant performs local iterative training, the computing resources of the coordinator are wasted, thereby reducing the utilization of the computing resources of the coordinator. Technical issues with low resource utilization.
发明内容SUMMARY OF THE INVENTION
本申请的主要目的在于提供一种联邦学习建模方法、装置、设备及可读存储介质,旨在解决现有技术中联邦学习系统里协调者计算资源利用率低的技术问题。The main purpose of this application is to provide a federated learning modeling method, apparatus, device and readable storage medium, which aims to solve the technical problem of the low utilization rate of the coordinator's computing resources in the federated learning system in the prior art.
为实现上述目的,本申请提供一种联邦学习建模方法,所述联邦学习建模方法应用于第一设备,所述联邦学习建模方法包括:To achieve the above purpose, the present application provides a federated learning modeling method, the federated learning modeling method is applied to the first device, and the federated learning modeling method includes:
与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备;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 of the to-be-completed model training tasks in each of the second devices ;
获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。Obtain the model training time periods corresponding to the model training tasks to be completed, and coordinate the model training participating devices corresponding to the model training tasks to be completed to perform preset federated learning based on the model training time periods modeling process to complete each of the to-be-completed model training tasks.
可选地,所述在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备的步骤包括:Optionally, the step of determining each model training participating device corresponding to each of the to-be-completed model training tasks in each of the second devices includes:
获取各所述模型训练任务对应的模型训练信息;obtaining model training information corresponding to each of the model training tasks;
基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Based on each of the model training information, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined through a willingness confirmation interaction with each of the second devices.
可选地,所述模型训练信息包括模型索引信息,Optionally, 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 a willingness confirmation interaction with each of the second devices based on each of the model training information includes:
将各所述模型索引信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的模型训练需求信息和各所述模型索引信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第一确定信息;Send each of the model index information to each of the second devices, respectively, for each of the second devices to determine in each of the model training tasks based on the acquired model training requirement information and each of the model index information, respectively. Participating in each target model training task, and generating first determination information corresponding to each of the target model training tasks;
基于各所述第二设备分别反馈的各第一确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Based on each first determination information fed back by each of the second devices, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined.
可选地,所述模型训练信息包括模型训练时间信息,Optionally, 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 a willingness confirmation interaction with each of the second devices based on each of the model training information includes:
将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的训练时间限制信息和各所述模型训练时间信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第二确定信息;Send each of the model training time information to each of the second devices, so that each of the second devices can perform the training tasks in each of the model training tasks based on the acquired training time limit information and the training time information of each of the models. Determine each target model training task to participate in, and generate the second determination information corresponding to each of the target model training tasks;
基于各所述第二设备分别反馈的各第二确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Based on each second determination information fed back by each of the second devices, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined.
可选地,在各所述模型训练时间段内,分别接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算最新联邦模型参数;Optionally, within each model training time period, receive local model parameters sent by each of the model training participating devices corresponding to the model training time period respectively, and calculate the latest federated model parameters based on a preset aggregation rule;
确定所述最新联邦模型参数是否满足预设训练任务结束条件;determining whether the latest federated model parameters meet the preset training task end condition;
若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备更新各自的本地模型;If the latest federated model parameters satisfy the preset training task ending condition, sending the latest federated model parameters to each of the second devices, so that each of the second devices can update their respective local models;
若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型参与设备更新各自的联邦参与模型,以重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件。If the latest federated model parameters do not meet the preset training task end condition, the latest federated model parameters are sent to each of the model training participating devices respectively, so that each of the model participating devices can update their respective federated participation model to recalculate the latest federated model parameters until the latest federated model parameters satisfy the preset training task end condition.
为实现上述目的,本申请还提供一种联邦学习建模方法,所述联邦学习建模方法应用于第二设备,所述联邦学习建模方法包括:To achieve the above purpose, the present application also provides a federated learning modeling method, the federated learning modeling method is applied to the second device, and the federated learning modeling method includes:
与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务;Interacting with the first device, determining model training information, and acquiring device status information, 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 to-be-completed model training task, a preset federated learning modeling process is executed by coordinating and interacting with the first device to complete the to-be-completed model training task.
可选地,所述通过与所述第一设备进行协调交互,执行预设联邦学习建模流程的步骤包括:Optionally, the step of executing a preset federated learning modeling process by coordinating and interacting with the first device includes:
确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代次数,获取所述待训练模型对应的本地模型参数;determining the to-be-trained model corresponding to the to-be-completed model training task, and performing iterative training on the to-be-trained model until the to-be-trained model reaches a preset number of iterations, and acquiring local model parameters corresponding to the to-be-trained model;
将所述本地模型参数发送至所述第一设备,以供所述第一设备基于所述本地模型参数,计算最新联邦模型参数;sending the local model parameters to the first device for the first device to calculate the latest federated model parameters based on the local model parameters;
接收所述第一设备反馈的最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,直至所述本地模型达到预设训练结束条件,获得所述待完成模型训练任务对应的目标建模模型。Receive the latest federated model parameters fed back by the first device, and update the to-be-trained model based on the latest federated model parameters until the local model reaches a preset training end condition, and obtain the corresponding model training tasks to be completed. target modeling model.
本申请还提供一种联邦学习建模装置,所述联邦学习建模装置为虚拟装置,且所述联邦学习建模装置应用于第一设备,所述联邦学习建模装置包括:The present application also provides a federated learning modeling device, the federated learning modeling device is a virtual device, and the federated learning modeling device is applied to the first device, and the federated learning modeling device includes:
协商模块,用于与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备;A negotiation module, configured to negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine in each of the second devices the corresponding model training tasks to be completed respectively Participating equipment for each model training;
协调模块,用于获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。A coordination module, configured to obtain the model training time periods corresponding to the model training tasks to be completed, and coordinate the model training participating devices corresponding to the model training tasks to be completed based on the model training time periods A preset federated learning modeling process is performed to complete each of the to-be-completed model training tasks.
可选地,所述协商模块包括:Optionally, the negotiation module includes:
获取单元,用于获取各所述模型训练任务对应的模型训练信息;an obtaining unit, configured to obtain model training information corresponding to each of the model training tasks;
确定单元,用于基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。A determination unit, configured 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 a willingness confirmation interaction with each of the second devices.
可选地,所述确定单元包括:Optionally, the determining unit includes:
第一发送子单元,用于将各所述模型索引信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的模型训练需求信息和各所述模型索引信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第一确定信息;A first sending subunit, configured to send each of the model index information to each of the second devices, so that each of the second devices can, based on the acquired model training requirement information and each of the model index information, respectively, in the Determining each target model training task involved in each of the model training tasks, and generating first determination information corresponding to each of the target model training tasks;
第一确定子单元,用于基于各所述第二设备分别反馈的各第一确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。The first determination subunit is configured 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.
可选地,所述确定单元还包括:Optionally, the determining unit further includes:
第二发送子单元,用于将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的训练时间限制信息和各所述模型训练时间信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第二确定信息;The second sending subunit is configured to send each of the model training time information to each of the second devices respectively, so that each of the second devices can use the acquired training time limit information and each of the model training time information respectively. , determine each target model training task involved in each of the model training tasks, and generate second determination information corresponding to each of the target model training tasks;
第二确定子单元,用于基于各所述第二设备分别反馈的各第二确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。A second determination subunit, configured 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 fed back by each of the second devices.
可选地,所述协调模块包括:Optionally, the coordination module includes:
计算单元,用于在各所述模型训练时间段内,分别接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算最新联邦模型参数;a computing unit, configured to respectively receive local model parameters sent by each of the model training participating devices corresponding to the model training time period in each of the model training time periods, and calculate the latest federated model parameters based on a preset aggregation rule ;
第一判定单元,用于确定所述最新联邦模型参数是否满足预设训练任务结束条件;a first determination unit, configured to determine whether the latest federated model parameters meet the preset training task end condition;
更新单元,用于若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备更新各自的本地模型;An update unit, configured to send the latest federated model parameters to each of the second devices if the latest federated model parameters satisfy the preset training task end condition, so that each of the second devices can update their respective local model;
第二判定单元,用于若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型参与设备更新各自的联邦参与模型,以重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件。A second determination unit, configured to send the latest federated model parameters to each of the model training participating devices, respectively, if the latest federated model parameters do not meet the preset training task ending condition, for each of the The participating devices update their respective federated participation models to recalculate the latest federated model parameters until the newest federated model parameters satisfy the preset training task end condition.
为实现上述目的,本申请还提供一种联邦学习建模装置,所述联邦学习建模装置应用于第二设备,所述联邦学习建模装置还包括:To achieve the above purpose, the present application further provides a federated learning modeling device, the federated learning modeling device is applied to the second device, and the federated learning modeling device further includes:
交互模块,用于与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务;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 the to-be-completed model training task corresponding to the model training information based on the device status information;
联邦学习建模模块,用于若参与所述待完成模型训练任务,则通过与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述待完成模型训练任务。The federated learning modeling module is configured to perform a preset federated learning modeling process by coordinating and interacting with the first device if participating in the to-be-completed model training task to complete the to-be-completed model training task.
可选地,所述联邦学习建模模块包括:Optionally, the federated learning modeling module includes:
迭代训练单元,用于确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代次数,获取所述待训练模型对应的本地模型参数;an iterative training unit, configured to determine the to-be-trained model corresponding to the to-be-completed model training task, perform iterative training on the to-be-trained model until the to-be-trained model reaches a preset number of iterations, and obtain the corresponding to-be-trained model The local model parameters of ;
发送单元,用于将所述本地模型参数发送至所述第一设备,以供所述第一设备基于所述本地模型参数,计算最新联邦模型参数;a sending unit, configured to send the local model parameters to the first device, so that the first device can calculate the latest federated model parameters based on the local model parameters;
更新单元,用于接收所述第一设备反馈的最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,直至所述本地模型达到预设训练结束条件,获得所述待完成模型训练任务对应的目标建模模型。an update unit, configured to receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the to-be-trained model until the local model reaches a preset training end condition, and obtain the to-be-trained model Complete the target modeling model corresponding to the model training task.
本申请还提供一种联邦学习建模设备,所述联邦学习建模设备为实体设备,所述联邦学习建模设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的所述联邦学习建模方法的程序,所述联邦学习建模方法的程序被处理器执行时可实现如上述的联邦学习建模方法的步骤。The present application also provides a federated learning modeling device, the federated learning modeling device is an entity device, and the federated learning modeling device includes: a memory, a processor, and a device stored on the memory and available on the processor The program of the federated learning modeling method that runs on the federated learning modeling method, when the program of the federated learning modeling method is executed by the processor, can implement the steps of the federated learning modeling method as described above.
本申请还提供一种可读存储介质,所述可读存储介质上存储有实现联邦学习建模方法的程序,所述联邦学习建模方法的程序被处理器执行时实现如上述的联邦学习建模方法的步骤。The present application also provides a readable storage medium on which a program for implementing the federated learning modeling method is stored, and when the program for the federated learning modeling method is executed by a processor, the above-mentioned federated learning modeling method is implemented. steps of the modulo method.
本申请通过与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备,进而获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。也即,本申请提供了一种基于时分的方式进行联邦学习的方法,也即,在进行联邦学习建模之前,通过与各所述第二设备进行交互,确定需要执行的各待完成模型训练任务,进而确定每一所述待完成模型训练任务对应的各模型训练参与设备和模型训练时间段,进而协调者可基于各所述模型训练时间段,分别协调每一所述待完成模型训练任务对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务,也即,在一所述待完成训练模型的各个模型参与设备正在进行本地迭代训练时,协调者可协调其他待完成模型训练任务对应的各模型训练参与设备进行联邦学习建模,进而避免了在各个联邦参与方进行本地迭代训练时,协调者无需执行计算任务但占用计算资源的情况发生,进而达到了充分利用协调者的计算资源的目的,提高了协调者的计算资源的利用率,所以,解决了联邦学习系统里协调者计算资源利用率低的技术问题。The present application determines each model training task to be completed through negotiation and interaction with each second device associated with the first device, and determines each model corresponding to each of the to-be-completed model training tasks in each of the second devices. Training participating equipment, and then 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 of the model training participating equipment corresponding to each of the model training tasks to be completed. A preset federated learning modeling process is performed to complete each of the to-be-completed model training tasks. That is, the present application provides a method for federated learning based on time division, that is, before performing federated learning modeling, by interacting with each of the second devices, it is determined that each to-be-completed model training needs to be performed task, and then determine each model training participating device and model training time period corresponding to each model training task to be completed, and then the coordinator can coordinate each of the model training tasks to be completed based on each model training time period. Each corresponding model training participating device performs a preset federated learning modeling process to complete each of the to-be-completed model training tasks, that is, each model participating device of the to-be-completed training model is performing local iterative training At the same time, 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 need for the coordinator to perform computing tasks but occupy computing resources when each federated participant performs local iterative training. The situation occurs, and then the purpose of making full use of the coordinator's computing resources is achieved, and the utilization rate of the coordinator's computing resources is improved. Therefore, the technical problem of the low utilization rate of the coordinator's computing resources in the federated learning system is solved.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application.
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. In other words, on the premise of no creative labor, other drawings can also be obtained from these drawings.
图1为本申请联邦学习建模方法第一实施例的流程示意图;FIG. 1 is a schematic flowchart of the first embodiment of the federated learning modeling method of the present application;
图2为本申请联邦学习建模方法第二实施例的流程示意图;FIG. 2 is a schematic flowchart of the second embodiment of the federated learning modeling method of the present application;
图3为本申请实施例方案涉及的硬件运行环境的设备结构示意图。FIG. 3 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种联邦学习建模方法,在本申请联邦学习建模方法的第一实施例中,参照图1,所述联邦学习建模方法应用于第一设备,所述联邦学习建模方法包括:An embodiment of the present application provides a federated learning modeling method. In the first embodiment of the federated learning modeling method of the present application, referring to FIG. 1 , the federated learning modeling method is applied to a first device, and the federated learning modeling method is applied to a first device. Modular methods include:
步骤S10,与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备;Step S10, negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine each model corresponding to each of the to-be-completed model training tasks in each of the second devices training participation equipment;
在本实施例中,需要说明的是,一所述待完成模型训练任务对应一个或者多个模型训练参与设备,所述第一设备为横向联邦学习的协调者,所述第二设备为横向联邦学习的参与者,所述模型训练参与设备为参与所述待完成训练任务的第二设备,所述待完成模型训练任务为基于横向联邦学习进行模型训练的任务,其中,一个待完成模型训练任务可用于训练一个或者多个目标模型,一个所述目标模型也可基于执行一个或者多个待完成模型训练任务而获得。In this embodiment, it should be noted that one of the model training tasks to be completed corresponds to one or more model training participating devices, the first device is the coordinator of the horizontal federated learning, and the second device is the horizontal federation Learning participants, 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 model training task based on horizontal federated learning, wherein one to-be-completed model training task It can be used to train one or more target models, and one of the target models can also be obtained based on the execution of one or more model training tasks to be completed.
可选的,所述第二设备可选择在预设可信执行环境中执行所述待完成模型训练任务,例如,英特尔的SGX(Intel Software Guard Extensions)等。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).
与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备,具体地,与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务和每一所述待完成模型训练任务的模型训练信息,进而基于所述模型训练信息,在各所述第二设备中确定每一所述待完成模型训练任务对应的各模型训练参与设备。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 of the to-be-completed model training tasks in each of the second devices Specifically, each second device associated with the first device performs negotiation and interaction to determine each model training task to be completed and the model training information of each model training task to be completed, and then based on the model training information, In each of the second devices, each model training participating device corresponding to each of the to-be-completed model training tasks is determined.
其中,在步骤S10中,所述在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备的步骤包括:Wherein, in step S10, the step of determining each model training participating device corresponding to each of the to-be-completed model training tasks in each of the second devices includes:
步骤S11,获取各所述模型训练任务对应的模型训练信息;Step S11, acquiring model training information corresponding to each of the model training tasks;
在本实施例中,需要说明的是,所述模型训练信息包括模型名称信息、模型训练时间段等,其中,所述模型名称信息为对应的待训练模型的标识,例如,编码、字符串等,所述模型训练时间段为预估的模型训练所需时间信息。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 code, character string, etc. , the model training time period is the estimated time information required for model training.
步骤S12,基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Step S12 , based on each of the model training information, through the willingness confirmation interaction with each of the second devices, determine each of the model training participating devices corresponding to each of the to-be-completed model training tasks respectively.
在本实施例中,基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备,具体地,分别将各所述模型训练信息发送每一所述第二设备,以供各所述第二设备获取设备状态信息,并基于设备状态信息,分别确定是否参与各所述模型训练信息对应的待完成模型训练任务,若确定参与所述待完成模型训练任务,则向所述第一设备反馈所述待完成模型训练任务对应的确定信息,进而所述第一设备分别接收各确定信息,并将每一所述确定信息对应的第二设备标识为模型训练参与设备,并统计各所述待完成模型训练任务对应的一个或者多个模型训练参与设备。In this embodiment, based on each of the model training information, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined by performing a willingness confirmation interaction with each of the second devices. Specifically, Send each of the model training information to each of the second devices respectively, so that each of the second devices can obtain the device status information, and based on the device status information, respectively determine whether to participate in the pending completion corresponding to each of the model training information The model training task, if it is determined to participate in the model training task to be completed, the determination information corresponding to the model training task to be completed is fed back to the first device, and then the first device receives the determination information respectively, and sends each determination information to the first device. A second device corresponding to the determination information is identified as a model training participating device, and one or more model training participating devices corresponding to each of the to-be-completed model training tasks are counted.
其中,所述模型训练信息包括模型索引信息,Wherein, the model training information includes model index information,
所述基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备的步骤包括:Described based on each described model training information, by carrying out willingness confirmation interaction with each described second equipment, the step of determining each described model training participating equipment corresponding to each described model training task to be completed respectively comprises:
步骤A10,将各所述模型索引信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的模型训练需求信息和各所述模型索引信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第一确定信息;Step A10: Send each of the model index information to each of the second devices, so that each of the second devices can perform training in each of the models based on the acquired model training requirement information and each of the model index information. Determine each target model training task involved in the task, and generate first determination information corresponding to each of the target model training tasks;
在本实施例中,需要说明的是,所述模型索引信息为对应的待完成模型训练任务的标识信息,例如,编码或者字符串等,所述第一确定信息为表明所述第二设备确定参与所述模型索引信息对应的待完成模型训练任务的信息,其中,所述第一确定信息可为所述第二设备单独回复的意愿信息、本地模型参数信息或者本地模型梯度信息等,以表明所述第二设备愿意参与对应的待完成模型训练任务,各所述待完成训练任务均对应一个执行任务的模型训练时间段。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 indicates that the second device determines Participate in the information of the to-be-completed model training task corresponding to the model index information, wherein the first determination information may be the willingness information, local model parameter information or local model gradient information that the second device replies alone, to indicate The second device is willing to participate in the corresponding to-be-completed model training tasks, and each of the to-be-completed training tasks corresponds to a model training time period in which the task is performed.
将各所述模型索引信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的模型训练需求信息和各所述模型索引信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第一确定信息,具体地,在每一所述模型训练时间段开始前的预设时长内向各所述第二设备广播所述模型训练时间段对应的模型索引信息,以供所述第二设备基于所述模型索引信息确定对应的待完成模型训练任务,并基于获取的当前设备运行状态,其中,所述设备运行状态包括当前可用计算资源,进而确定是否参与所述待完成模型训练任务,若确定参与所述待完成模型训练任务,则向所述第一设备反馈第一确定信息,以表明参与所述待完成模型训练任务,若确定不参与所述待完成模型训练任务,则忽略所述模型索引信息,并等待接收下一所述模型索引信息。Send each of the model index information to each of the second devices, respectively, for each of the second devices to determine in each of the model training tasks based on the acquired model training requirement information and each of the model index information, respectively. Participate in each target model training task, and generate first determination information corresponding to each target model training task, specifically, broadcast to each of the second devices within a preset time period before the start of each of the model training time periods The model index information corresponding to the model training time period, for the second device to determine the corresponding model training task to be completed based on the model index information, and based on the obtained current device operating state, wherein the device operating state Including currently available computing resources, and then determine whether to participate in the to-be-completed model training task, and if it is determined to participate in the to-be-completed model training task, then feed back first determination information to the first device to indicate participation in the to-be-completed model training task For the training task, if it is determined not to participate in the to-be-completed model training task, the model index information is ignored, and the next model index information is waited for.
步骤A20,基于各所述第二设备分别反馈的各第一确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Step A20: 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.
在本实施例中,基于各所述第二设备分别反馈的各第一确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备,具体地,每一所述模型训练时间段开始前,分别接收各所述第二设备发送的所述模型索引信息对应的所述待完成模型训练任务对应的各所述第一确定信息,并将发送每一所述第一确定信息的各第二设备作为所述模型训练参与设备,其中,一所述第一确定信息对应一所述第二设备对应一所述模型训练参与设备。In this embodiment, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined based on each first determination information fed back by each of the second devices. Before the training period starts, each of the first determination information corresponding to the to-be-completed model training task corresponding to the model index information sent by each of the second devices is respectively received, and each of the first determination information is sent. Each second device of the information is used as the model training participating device, wherein one of the first determination information corresponds to one of the second devices corresponds to one of the model training participating devices.
其中,所述模型训练信息包括模型训练时间信息,Wherein, 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 a willingness confirmation interaction with each of the second devices based on each of the model training information includes:
步骤B10,将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的训练时间限制信息和各所述模型训练时间信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第二确定信息;Step B10: Send each of the model training time information to each of the second devices, so that each of the second devices can use the obtained training time limit information and each of the model training time information in each of the second devices. Determine each target model training task involved in the model training task, and generate second determination information corresponding to each of the target model training tasks;
在本实施例中,需要说明的是,所述第二确定信息为表明所述第二设备确定参与所述模型训练时间信息对应的待完成模型训练任务的信息,各所述待完成训练任务均对应一个执行任务的模型训练时间段,且所述第二确定信息将由所述第二设备在所述第二确定信息对应的待完成模型训练任务对应的模型训练时间段开始之前发送至所述第一设备。In this embodiment, it should be noted that the second determination information is information indicating that the second device determines to participate in the to-be-completed model training task corresponding to the model training time information, and each of the to-be-completed training tasks is A model training period corresponding to an execution task, and the second determination information will be sent by the second device to the second device before the model training period corresponding to the model training task to be completed corresponding to the second determination information starts. a device.
将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的训练时间限制信息和各所述模型训练时间信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第二确定信息,具体地,在每一所述待完成模型训练任务对应的模型训练时间段之前,将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别获取训练时间限制信息,其中,所述训练时间限制信息为表明所述第二设备在所述模型训练时间段内是否有空闲时间和足够的计算资源参与所述待完成模型训练任务,进各所述第二设备将基于所述训练限制信息和所述模型训练时间信息,确定是否参与所述模型训练时间信息对应的待完成模型训练任务,若确定参与所述待完成模型训练任务,则向所述第一设备反馈第二确定信息,以表明参与所述待完成模型训练任务,若确定不参与所述待完成模型训练任务,则忽略所述模型训练时间信息,并等待接收下一所述模型训练时间信息。Send each of the model training time information to each of the second devices, so that each of the second devices can perform the training tasks in each of the model training tasks based on the acquired training time limit information and the training time information of each of the models. Determine each target model training task to participate in, and generate second determination information corresponding to each target model training task. Specifically, before the model training time period corresponding to each model training task to be completed, each The model training time information is respectively sent to each of the second devices, so that each of the second devices can obtain training time limit information, wherein the training time limit information indicates that the second device is in the model training period. Whether there is free time and enough computing resources to participate in the model training task to be completed within the time period, the second device will determine whether to participate in the model training based on the training restriction information and the model training time information. The model training task to be completed corresponding to the time information, if it is determined to participate in the to-be-completed model training task, the second determination information is fed back to the first device to indicate participation in the to-be-completed model training task, if it is determined not to participate in any model training task. If the model training task to be completed is described, the model training time information is ignored, and the next model training time information is waited for.
步骤B20,基于各所述第二设备分别反馈的各第二确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。Step B20: 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 fed back by each of the second devices.
在本实施例中,基于各所述第二设备分别反馈的各第二确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备,具体地,每一所述模型训练时间段开始前,分别接收各所述第二设备发送的所述模型训练时间信息对应的所述待完成模型训练任务对应的各所述第二确定信息,并将发送各每一所述第二确定信息的第二设备作为所述模型训练参与设备,其中,一所述第一确定信息对应一所述第二设备对应一所述模型训练参与设备。In this embodiment, each of the model training participating devices corresponding to each of the to-be-completed model training tasks is determined based on each second determination information fed back by each of the second devices. Before the training period starts, each of the second determination information corresponding to the to-be-completed model training task corresponding to the model training time information sent by each of the second devices is respectively received, and each of the second determination information will be sent. The second device of the second determination information is used as the model training participating device, wherein one of the first determination information corresponds to one of the second device corresponds to one of the model training participating devices.
步骤S20,获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。Step S20: Acquire the model training time period corresponding to each of the model training tasks to be completed, and coordinate the model training participating devices corresponding to the model training tasks to be completed based on the model training time periods to perform pre-preparation. Set up a federated learning modeling process to complete each of the to-be-completed model training tasks.
在本实施例中,需要说明的是,所述预设联邦学习建模流程为进行联邦学习的流程,各所述模型训练时间段包括第一模型训练时间段和第二模型训练时间段。In this embodiment, it should be noted that the preset federated learning modeling process is a process of 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.
获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务,具体地,获取各所述待完成模型训练任务对应的模型训练时间段,并在每一所述模型训练时间段内,接收对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算各所述本地模型参数对应的最新联邦模型参数,其中,所述预设聚合规则包括加权求平均、求和等,并确定所述最新联邦模型参数是否达到预设训练任务完成条件,若所述最新联邦模型参数达到所述训练任务完成条件,则将所述最新联邦模型参数分别发送至各所述第二设备,以供各所述第二设备基于所述最新联邦模型参数更新各自的本地模型,若最新联邦模型参数未达到所述训练任务完成条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型训练参与设备更新各自的本地模型,并基于更新后的本地模型重新进行联邦学习,重新计算最新联邦模型参数,直至所述最新联邦模型参数达到训练任务完成条件,其中,所述训练任务完成条件包括损失函数收敛、模型达到最大迭代次数等,其中,若各所述模型训练时间段存在交集时间段,则在所述交集时间段内,所述第一设备将根据接收每一所述待完成模型训练任务对应的各本地模型参数的时间先后顺序,确定计算各所述待完成模型训练任务对应的最新联邦模型参数的先后顺序,例如,假设各所述待完成模型训练任务包括任务A和任务B,则所述第一设备在9点零7分,已全部接收所述任务A对应的模型训练参与设备发送的各本地模型参数,在9点零9分,已全部接收任务B对应的模型训练参与设备发送的各本地模型参数,则所述第一设备优先计算任务A对应的最新联邦模型参数,再计算任务B对应的最新联邦模型参数。Obtain the model training time periods corresponding to the model training tasks to be completed, and coordinate the model training participating devices corresponding to the model training tasks to be completed to perform preset federated learning based on the model training time periods The modeling process is to complete each of the to-be-completed model training tasks, specifically, to obtain the model training time period corresponding to each of the to-be-completed model training tasks, and within each model training time period, receive the corresponding The model trains the local model parameters sent by participating devices, and calculates the latest federated model parameters corresponding to each of the local model parameters based on preset aggregation rules, wherein the preset aggregation rules include weighted average, summation, etc., and determine whether the latest federated model parameters meet the preset training task completion conditions, and if the latest federated model parameters meet the training task completion conditions, send the latest federated model parameters to each of the second devices respectively, for each of the second devices to update their respective local models based on the latest federated model parameters, and if the latest federated model parameters do not meet the training task completion condition, send the latest federated model parameters to each of the models respectively Train participating devices, so that each of the model training participating devices can update their respective local models, and based on the updated local models, perform federated learning again, and recalculate 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, the model reaches 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 The order of calculating the latest federated model parameters corresponding to each of the to-be-completed model training tasks will be determined according to the chronological order of receiving the local model parameters corresponding to each of the to-be-completed model training tasks. Completing the model training task includes task A and task B, then the first device has all received the local model parameters sent by the model training participating devices corresponding to the task A at 9:07, and at 9:09 , having received all the local model parameters sent by the model training participating devices corresponding to task B, the first device preferentially calculates the latest federated model parameters corresponding to task A, and then calculates the latest federated model parameters corresponding to task B.
可选地,所述第一设备可选择在所述预设可信执行环境执行基于预设聚合规则,计算各所述本地模型参数对应的最新联邦模型参数的步骤。Optionally, the first device may choose to execute the step of calculating the latest federated model parameters corresponding to each of the local model parameters based on a preset aggregation rule in the preset trusted execution environment.
其中,所述基于各所述模型训练时间段,分别协调每一所述待完成模型训练任务对应的各所述模型训练参与设备进行预设联邦学习建模流程的步骤包括:Wherein, the step of coordinating each model training participating device corresponding to each model training task to be completed to perform a preset federated learning modeling process based on each model training time period includes:
步骤S21,在各所述模型训练时间段内,分别接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算最新联邦模型参数;Step S21, in each of the model training time periods, respectively receiving 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;
在本实施例中,需要说明的是,所述本地模型参数包括模型网络参数和梯度信息等,其中,所述模型网络参数为所述模型训练参与设备对自身持有的本地模型迭代训练预设次数后,迭代训练后的所述本地模型的网络参数,例如假设所述本地模型为线性模型Y=β0+β1X1+β2X2+…+βnXn,则所述网络参数为向量(β0,β1,β2,…,βn)。In this embodiment, it should be noted that the local model parameters include model network parameters, gradient information, etc., wherein the model network parameters are preset by the model training participating device for the local model iterative training held by itself After the number of times, iteratively train the network parameters of the local model. For example, assuming that the local model is a linear model Y=β 0 +β 1 X 1 +β 2 X 2 +…+β n X n , then the network The parameters are vectors (β 0 , β 1 , β 2 , . . . , β n ).
在各所述模型训练时间段内,分别接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算最新联邦模型参数,具体地,每一所述模型训练时间段内,接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,其中,每一所述本地模型参数均为所述模型训练参与设备对所述本地模型参数对应的联邦参与模型进行预设次数的迭代训练获得的,其中,所述联邦参与模型为所述模型训练参与设备的本地模型,进而基于预设聚合规则,对各所述本地模型参数进行加权求平均,获得所述最新联邦模型参数。During each model training time period, the local model parameters sent by each model training participating device corresponding to the model training time period are respectively received, and the latest federated model parameters are calculated based on the preset aggregation rules. 1. During the model training time period, receive local model parameters sent by each of the model training participating devices corresponding to the model training time period, wherein each of the local model parameters is the result of the model training participating device. The federated participation model corresponding to the local model parameters is obtained by performing iterative training for a preset number of times, wherein the federated participation model is the local model of the model training participating device, and then based on the preset aggregation rules, each local model is The parameters are weighted and averaged to obtain the latest federated model parameters.
步骤S22,确定所述最新联邦模型参数是否满足预设训练任务结束条件;Step S22, determining whether the latest federated model parameters meet the preset training task end condition;
在本实施例中,需要说明的是,所述预设训练任务结束条件包括训练达到最大迭代次数、损失函数训练收敛等。In this embodiment, it should be noted that the preset training task ending conditions include training reaching the maximum number of iterations, loss function training convergence, and the like.
确定所述最新联邦模型参数是否满足预设训练任务结束条件,具体地,若所述最新联邦模型参数与所述上一轮最新联邦模型参数的差值小于预设差值阀值,则判定所述最新联邦模型参数达到所述预设训练任务结束条件,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 last round of the latest federated model parameters is less than a preset difference threshold, determine that the the latest federated model parameters reach the preset training task end condition,
步骤S23,若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备更新各自的本地模型;Step S23, if the latest federated model parameters satisfy the preset training task ending condition, send the latest federated model parameters to each of the second devices, so that each of the second devices can update their respective local models ;
在本实施例中,若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备更新各自的本地模型,具体地,若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备基于所述最新联邦模型参数,对本地模型中对应的模型参数进行替换更新为所述最新联邦模型参数。In this embodiment, if the latest federated model parameters satisfy the preset training task ending condition, the latest federated model parameters are sent to each of the second devices, so that each of the second devices can update their respective Specifically, if the latest federated model parameters satisfy the preset training task end condition, the latest federated model parameters are sent to each of the second devices for each second device to use based on For the latest federated model parameters, the corresponding model parameters in the local model are replaced and updated to the latest federated model parameters.
另外地,还可设置若所述最新联邦模型参数与所述上一轮最新联邦模型参数的差值小于预设差值阀值的情况连续出现预设次数,则判定所述最新联邦模型参数达到所述预设训练任务结束条件。In addition, it can also be set that if the difference between the latest federated model parameters and the last round of the latest federated model parameters is smaller than a preset difference threshold for a preset number of times, it is determined that the latest federated model parameters reach The preset training task ending condition.
步骤S23,若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型参与设备更新各自的联邦参与模型,以重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件。Step S23, if the latest federated model parameters do not meet the preset training task end condition, send the latest federated model parameters to each of the model training participating devices, so that each of the model participating devices can update their respective models. to recalculate the latest federated model parameters until the latest federated model parameters satisfy the preset training task end condition.
在本实施例中,若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型参与设备更新各自的联邦参与模型,以重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件,具体地,若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供每一所述模型训练参与设备基于所述最新联邦模型参数,更新各自持有的联邦参与模型,并对更新后的联邦参与模型进行迭代训练,进而当迭代训练的次数达到预设迭代训练次数时,重新获取迭代训练后的所述联邦参与模型的本地模型参数,并将重新计算的各所述本地模型参数发送至所述第一设备,以供所述第一设备基于各所述第二设备发送的重新计算的各本地模型参数和所述预设聚合规则,重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件。In this embodiment, if the latest federated model parameters do not meet the preset training task ending condition, the latest federated model parameters are sent to each of the model training participating devices respectively for each of the models to participate in. The devices update their respective federated participation models to recalculate the latest federated model parameters until the latest federated model parameters meet the preset training task end condition, specifically, if the latest federated model parameters do not meet the predetermined Set the training task end condition, then send the latest federated model parameters to each of the model training participating devices, so that each of the model training participating devices can update their respective federation participation based on the latest federated model parameters model, and iteratively trains the updated federation participation model, and then when the number of iterative training reaches the preset number of iterative training times, re-acquires the local model parameters of the federated participation model after iterative training, and recalculates each The local model parameters are sent to the first device for the first device to recalculate the latest federation based on the recalculated local model parameters and the preset aggregation rules sent by the second devices model parameters until the latest federated model parameters satisfy the preset training task end condition.
本实施例通过与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备,进而获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。也即,本实施例提供了一种基于时分的方式进行联邦学习的方法,也即,在进行联邦学习建模之前,通过与各所述第二设备进行交互,确定需要执行的各待完成模型训练任务,进而确定每一所述待完成模型训练任务对应的各模型训练参与设备和模型训练时间段,进而协调者可基于各所述模型训练时间段,分别协调每一所述待完成模型训练任务对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务,也即,在一所述待完成训练模型的各个模型参与设备正在进行本地迭代训练时,协调者可协调其他待完成模型训练任务对应的各模型训练参与设备进行联邦学习建模,进而避免了在各个联邦参与方进行本地迭代训练时,协调者无需执行计算任务和消耗计算资源的情况发生,进而达到了充分利用协调者的计算资源的目的,提高了协调者的计算资源的利用率,所以,解决了联邦学习系统里协调者计算资源利用率低的技术问题。In this embodiment, through negotiation and interaction with each second device associated with the first device, each model training task to be completed is determined, and each of the model training tasks to be completed is determined in each of the second devices. Model training participation equipment, and then obtains the model training time periods corresponding to the model training tasks to be completed, and coordinates the model training participation corresponding to the model training tasks to be completed based on the model training time periods. The device performs a preset federated learning modeling process to complete each of the to-be-completed model training tasks. That is, this embodiment provides a time-division-based method for federated learning, that is, before performing federated learning modeling, each to-be-completed model that needs to be executed is determined by interacting with each of the second devices Training tasks, and then determine each model training participating device and model training time period corresponding to each of the model training tasks to be completed, and then the coordinator can coordinate each of the to-be-completed model training based on each of the model training time periods. Each model training participating device corresponding to the task performs a preset federated learning modeling process to complete each of the to-be-completed model training tasks, that is, each model participating device of the to-be-completed training model is performing local iteration During training, the coordinator can coordinate each model training participating device corresponding to other model training tasks to be completed to perform federated learning modeling, thereby avoiding the need for the coordinator to perform computing tasks and consume computing resources when each federated participant performs local iterative training. In this way, the purpose of making full use of the coordinator's computing resources is achieved, and the utilization rate of the coordinator's computing resources is improved. Therefore, the technical problem of the low utilization rate of the coordinator's computing resources in the federated learning system is solved.
进一步地,参照图2,基于本申请中第一实施例,在本申请的另一实施例中,所述联邦学习建模方法应用于第二设备,所述联邦学习建模方法包括:Further, referring to FIG. 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:
步骤C10,与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务;Step C10, interact with the first device, 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;
在本实施例中,所述模型训练信息包括模型索引信息和模型训练时间信息,所述设备状态信息包括所述第二设备的可用计算资源,其中,所述可用计算资源为所述第二设备在所述待完成模型训练任务对应的模型训练时间段内可调用的计算资源。In this embodiment, the model training information includes model index information and model training time information, and the device status information includes available computing resources of the second device, where the available computing resources are the second device The computing resources that can be invoked during the model training time period corresponding to the model training task to be completed.
在进行步骤C10之前,所述二设备与所述第一设备进行协商交互,确定各待完成模型训练任务。Before performing step C10, the second device negotiates and interacts with the first device to determine each model training task to be completed.
与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务,具体地,与所述第一设备进行协商交互,获取模型训练信息,并确定可用计算资源,进而判断所述可用计算资源是否满足所述模型训练信息对应的待完成模型训练任务,若所述可用计算资源满足所述待完成模型训练任务,则确定参与所述待完成模型训练任务,若所述可用计算资源不满足所述待完成模型训练任务,则确定不参与所述待完成模型训练任务,例如,假设所述待完成模型训练任务需占用所述第二设备的所有计算资源的50%,而所述第二设备可调用的可用计算资源为40%,则所述可用计算资源不满足所述待完成模型训练任务,进而确定不参与所述待完成模型训练任务。Interact with the first device, 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. The first device performs negotiation and interaction, obtains model training information, and determines available computing resources, and then judges whether the available computing resources satisfy the model training tasks to be completed corresponding to the model training information, and if the available computing resources satisfy the to-be-completed model training tasks Complete the model training task, then determine to participate in the to-be-completed model training task, and if the available computing resources do not meet the to-be-completed model training task, determine not to participate in the to-be-completed model training task, for example, assuming the to-be-completed model training task Completing the model training task requires 50% of all computing resources of the second device, and the available computing resources that can be invoked by the second device are 40%, then the available computing resources do not satisfy the model training task to be completed. , and then determine not to participate in the to-be-completed model training task.
步骤C20,若参与所述待完成模型训练任务,则通过与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述待完成模型训练任务。Step C20, if participating in the to-be-completed model training task, execute a preset federated learning modeling process by coordinating and interacting with the first device to complete the to-be-completed model training task.
在本实施例中,若参与所述待完成模型训练任务,则通过与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述待完成模型训练任务,具体地,若参与所述待完成模型训练任务,则确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代训练次数,则获取迭代训练后的所述待训练模型的本地模型参数,并将所述本地模型参数发送至所述第一设备,以供所述第一设备基于各所述第二设备发送的本地模型参数,计算最新联邦模型参数,并将所述最新联邦模型参数广播至各所述第二设备,进而所述第二设备接所述最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,并判断更新后的待训练模型是否满足预设迭代结束条件,若更新后的待训练模型满足预设迭代结束条件,则判定完成所述待完成模型训练任务,若更新后的待训练模型不满足预设迭代结束条件,则重新对所述待训练模型进行迭代训练,以供所述第一设备重新计算所述最新联邦模型参数,以重新对所述待训练模型进行更新,直至更新后的待训练模型满足预设迭代结束条件。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, determine the to-be-trained model corresponding to the to-be-completed model training task, and perform iterative training on the to-be-trained model until the to-be-trained model reaches the preset number of iterative training times, then Acquire the local model parameters of the model to be trained after iterative training, and send the local model parameters to the first device for the first device to be based on the local model parameters sent by each of the second devices, Calculate the latest federated model parameters, and broadcast the latest federated model parameters to each of the second devices, and then the second device receives the latest federated model parameters, and updates the to-be-to-be-modeled parameters based on the latest federated model parameters Train the model, and judge whether the updated model to be trained satisfies the preset iteration end condition. If the updated model to be trained satisfies the preset iteration end condition, it is judged that the model training task to be completed is completed. If the updated model to be trained satisfies the preset iteration end condition If the model does not meet the preset iteration end condition, the model to be trained is re-iteratively trained for the first device to recalculate the latest federated model parameters to re-update the model to be trained until the update The final model to be trained satisfies the preset iteration end condition.
其中,在步骤C20中,所述通过与所述第一设备进行协调交互,执行预设联邦学习建模流程的步骤包括:Wherein, in step C20, the step of executing the preset federated learning modeling process by coordinating and interacting with the first device includes:
步骤C21,确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代次数,获取所述待训练模型对应的本地模型参数;Step C21: Determine the to-be-trained model corresponding to the to-be-completed model training task, and perform iterative training on the to-be-trained model until the to-be-trained model reaches a preset number of iterations, and obtain a local model corresponding to the to-be-trained model parameter;
在本实施例中,确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代次数,获取所述待训练模型对应的本地模型参数,具体地,确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练更新,直至所述待训练模型达到预设迭代次数,并提取迭代训练更新后的所述待训练模型的本地模型参数。In this embodiment, 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 iterations, and the corresponding to-be-trained model is obtained. The local model parameters of The updated local model parameters of the model to be trained.
步骤C22,将所述本地模型参数发送至所述第一设备,以供所述第一设备基于所述本地模型参数,计算最新联邦模型参数;Step C22, sending the local model parameters to the first device for the first device to calculate the latest federated model parameters based on the local model parameters;
在本实施例中,将所述本地模型参数发送至所述第一设备,以供所述第一设备基于所述本地模型参数,计算最新联邦模型参数,具体地,将所述本地模型参数发送至所述第一设备,以供所述第一设备基于关联的各第二设备发送的本地模型参数,通过预设聚合规则,计算各所述本地模型参数对应的最新联邦模型参数,其中,所述预设聚合规则包括加权求平均、求和等。In this embodiment, the local model parameters are sent to the first device, so that the first device can calculate the latest federated model parameters based on the local model parameters, and specifically, send the local model parameters to the first device, so that the first device can calculate the latest federated model parameters corresponding to each of the local model parameters based on the local model parameters sent by the associated second devices through preset aggregation rules, wherein the The preset aggregation rules include weighted averaging, summation, and the like.
步骤C23,接收所述第一设备反馈的最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,直至所述本地模型达到预设训练结束条件,获得所述待完成模型训练任务对应的目标建模模型。Step C23: Receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the to-be-trained model until the local model reaches a preset training end condition, and obtain the to-be-completed model The target modeling model corresponding to the training task.
在本实施例中,接收所述第一设备反馈的最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,直至所述本地模型达到预设训练结束条件,获得所述待完成模型训练任务对应的目标建模模型,具体地,接收所述第一设备反馈的最新联邦模型参数,并将所述待训练模型中的本地模型参数替换更新为所述最新联邦模型参数,获得替换更新后的待训练模型,并判断替换更新后的所述待训练模型是否满足预设迭代训练结束条件,若替换更新后的所述待训练模型满足预设迭代训练结束条件,则将替换更新后的所述待训练模型作为所述目标建模模型,若替换更新后的所述待训练模型不满足预设迭代训练结束条件,则重新对所述待训练模型进行迭代训练,以对所述待训练模型进行替换更新,直至替换更新后的所述待训练模型满足预设迭代训练结束条件。In this embodiment, the latest federated model parameters fed back by the first device are received, and based on the latest federated model parameters, the model to be trained is updated until the local model reaches a preset training end condition, and the The target modeling model corresponding to the model training task to be completed, specifically, receiving the latest federated model parameters fed back by the first device, and replacing and updating the local model parameters in the to-be-trained model with the latest federated model parameters, Obtain the replaced and updated model to be trained, and determine whether the replaced and updated model to be trained satisfies the preset iterative training end condition, and if the replaced and updated model to be trained satisfies the preset iterative training end condition, then replace The 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, then the iterative training is performed on the model to be trained again, so that the The to-be-trained model is replaced and updated until the replaced and updated model to-be-trained meets the preset iterative training end condition.
本实施例通过与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务,进而若参与所述待完成模型训练任务,则通过与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述待完成模型训练任务。也即,本实施例提供了一种基于联邦学习建模方法,也即,在进行联邦学习建模前,通过与所述第一设备进行协商交互和获取自身的设备运行状态,确定是否参与所述模型训练信息对应的待完成模型训练任务,进而若确定参与,即可与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述模型训练任务,也即,所述第二设备在每次进行联邦学习建模之前,均可自主选择参与所述待完成模型训练任务,进而为解决联邦学习系统里协调者计算资源利用率低的技术问题奠定了基础。In this embodiment, by interacting with the first device, the model training information is determined, and the device status information is obtained, 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 further if Participate in the to-be-completed model training task, execute a preset federated learning modeling process by coordinating and interacting with the first device to complete the to-be-completed model training task. That is, this embodiment provides a modeling method based on federated learning, that is, before performing federated learning modeling, it is determined whether to participate in any The model training task to be completed corresponding to the model training information, and if it is determined to participate, it can coordinate and interact with the first device, and execute the preset federated learning modeling process to complete the model training task, that is, all the The second device can independently 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 the coordinator's computing resources in the federated learning system.
参照图3,图3是本申请实施例方案涉及的硬件运行环境的设备结构示意图。Referring to FIG. 3 , FIG. 3 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present application.
如图3所示,该联邦学习建模设备可以包括:处理器1001,例如CPU,存储器1005,通信总线1002。其中,通信总线1002用于实现处理器1001和存储器1005之间的连接通信。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储设备。As shown in FIG. 3 , the federated learning modeling device may include: a
可选地,该联邦学习建模设备还可以包括矩形用户接口、网络接口、摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。矩形用户接口可以包括显示屏(Display)、输入子模块比如键盘(Keyboard),可选矩形用户接口还可以包括标准的有线接口、无线接口。网络接口可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。Optionally, the federated learning modeling device may further include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency, radio frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may include a display screen (Display), an input sub-module such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. Optional network interfaces may include standard wired interfaces and wireless interfaces (eg, WI-FI interfaces).
本领域技术人员可以理解,图3中示出的联邦学习建模设备结构并不构成对联邦学习建模设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the structure of the federated learning modeling device shown in FIG. 3 does not constitute a limitation on the federated learning modeling device, and may include more or less components than those shown in the figure, or combine some components, Or a different component arrangement.
如图3所示,作为一种计算机存储介质的存储器1005中可以包括操作系统、网络通信模块以及联邦学习建模程序。操作系统是管理和控制联邦学习建模设备硬件和软件资源的程序,支持联邦学习建模程序以及其它软件和/或程序的运行。网络通信模块用于实现存储器1005内部各组件之间的通信,以及与联邦学习建模系统中其它硬件和软件之间通信。As shown in FIG. 3 , the
在图3所示的联邦学习建模设备中,处理器1001用于执行存储器1005中存储的联邦学习建模程序,实现上述任一项所述的联邦学习建模方法的步骤。In the federated learning modeling device shown in FIG. 3 , the
本申请联邦学习建模设备具体实施方式与上述联邦学习建模方法各实施例基本相同,在此不再赘述。The specific implementation manner of the federated learning modeling device of the present application is basically the same as the above-mentioned embodiments of the federated learning modeling method, and details are not repeated here.
本申请实施例还提供一种联邦学习建模装置,所述联邦学习建模装置应用于第一设备,所述联邦学习建模装置包括:An embodiment of the present application further provides a federated learning modeling apparatus, where the federated learning modeling apparatus is applied to the first device, and the federated learning modeling apparatus includes:
协商模块,用于与所述第一设备关联的各第二设备进行协商交互,确定各待完成模型训练任务,并在各所述第二设备中确定各所述待完成模型训练任务分别对应的各模型训练参与设备;A negotiation module, configured to negotiate and interact with each second device associated with the first device, determine each model training task to be completed, and determine in each of the second devices the corresponding model training tasks to be completed respectively Participating equipment for each model training;
协调模块,用于获取各所述待完成模型训练任务对应的模型训练时间段,并基于各所述模型训练时间段,协调各所述待完成模型训练任务分别对应的各所述模型训练参与设备进行预设联邦学习建模流程,以完成各所述待完成模型训练任务。A coordination module, configured to obtain the model training time periods corresponding to the model training tasks to be completed, and coordinate the model training participating devices corresponding to the model training tasks to be completed based on the model training time periods A preset federated learning modeling process is performed to complete each of the to-be-completed model training tasks.
可选地,所述协商模块包括:Optionally, the negotiation module includes:
获取单元,用于获取各所述模型训练任务对应的模型训练信息;an obtaining unit, configured to obtain model training information corresponding to each of the model training tasks;
确定单元,用于基于各所述模型训练信息,通过与各所述第二设备进行意愿确认交互,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。A determination unit, configured 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 a willingness confirmation interaction with each of the second devices.
可选地,所述确定单元包括:Optionally, the determining unit includes:
第一发送子单元,用于将各所述模型索引信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的模型训练需求信息和各所述模型索引信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第一确定信息;A first sending subunit, configured to send each of the model index information to each of the second devices, so that each of the second devices can, based on the acquired model training requirement information and each of the model index information, respectively, in the Determining each target model training task involved in each of the model training tasks, and generating first determination information corresponding to each of the target model training tasks;
第一确定子单元,用于基于各所述第二设备分别反馈的各第一确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。The first determination subunit is configured 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.
可选地,所述确定单元还包括:Optionally, the determining unit further includes:
第二发送子单元,用于将各所述模型训练时间信息分别发送至各所述第二设备,以供各所述第二设备分别基于获取的训练时间限制信息和各所述模型训练时间信息,在各所述模型训练任务中确定参与的各目标模型训练任务,并生成各所述目标模型训练任务对应的第二确定信息;The second sending subunit is configured to send each of the model training time information to each of the second devices respectively, so that each of the second devices can use the acquired training time limit information and each of the model training time information respectively. , determine each target model training task involved in each of the model training tasks, and generate second determination information corresponding to each of the target model training tasks;
第二确定子单元,用于基于各所述第二设备分别反馈的各第二确定信息,确定各所述待完成模型训练任务分别对应的各所述模型训练参与设备。A second determination subunit, configured 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 fed back by each of the second devices.
可选地,所述协调模块包括:Optionally, the coordination module includes:
计算单元,用于在各所述模型训练时间段内,分别接收所述模型训练时间段对应的各所述模型训练参与设备发送的本地模型参数,并基于预设聚合规则,计算最新联邦模型参数;a computing unit, configured to respectively receive local model parameters sent by each of the model training participating devices corresponding to the model training time period in each of the model training time periods, and calculate the latest federated model parameters based on a preset aggregation rule ;
第一判定单元,用于确定所述最新联邦模型参数是否满足预设训练任务结束条件;a first determination unit, configured to determine whether the latest federated model parameters meet the preset training task end condition;
更新单元,用于若所述最新联邦模型参数满足所述预设训练任务结束条件,则将所述最新联邦模型参数发送至各所述第二设备,以供各所述第二设备更新各自的本地模型;An update unit, configured to send the latest federated model parameters to each of the second devices if the latest federated model parameters satisfy the preset training task end condition, so that each of the second devices can update their respective local model;
第二判定单元,用于若所述最新联邦模型参数不满足所述预设训练任务结束条件,则将所述最新联邦模型参数分别发送至各所述模型训练参与设备,以供各所述模型参与设备更新各自的联邦参与模型,以重新计算所述最新联邦模型参数,直至所述最新联邦模型参数满足所述预设训练任务结束条件。A second determination unit, configured to send the latest federated model parameters to each of the model training participating devices, respectively, if the latest federated model parameters do not meet the preset training task ending condition, for each of the The participating devices update their respective federated participation models to recalculate the latest federated model parameters until the newest federated model parameters satisfy the preset training task end condition.
本申请联邦学习建模装置的具体实施方式与上述联邦学习建模方法各实施例基本相同,在此不再赘述。The specific implementation of the federated learning modeling apparatus of the present application is basically the same as the above-mentioned embodiments of the federated learning modeling method, and details are not described herein again.
为实现上述目的,本申请实施例还提供一种联邦学习建模装置,所述联邦学习建模装置应用于第二设备,所述联邦学习建模装置包括:To achieve the above purpose, an embodiment of the present application further provides a federated learning modeling device, the federated learning modeling device is applied to the second device, and the federated learning modeling device includes:
交互模块,用于与所述第一设备进行交互,确定模型训练信息,并获取设备状态信息,以基于所述设备状态信息,确定是否参与所述模型训练信息对应的待完成模型训练任务;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 the to-be-completed model training task corresponding to the model training information based on the device status information;
联邦学习建模模块,用于若参与所述待完成模型训练任务,则通过与所述第一设备进行协调交互,执行预设联邦学习建模流程,以完成所述待完成模型训练任务。The federated learning modeling module is configured to perform a preset federated learning modeling process by coordinating and interacting with the first device if participating in the to-be-completed model training task to complete the to-be-completed model training task.
可选地,所述联邦学习建模模块包括:Optionally, the federated learning modeling module includes:
迭代训练单元,用于确定所述待完成模型训练任务对应的待训练模型,并对所述待训练模型进行迭代训练,直至所述待训练模型达到预设迭代次数,获取所述待训练模型对应的本地模型参数;an iterative training unit, configured to determine the to-be-trained model corresponding to the to-be-completed model training task, perform iterative training on the to-be-trained model until the to-be-trained model reaches a preset number of iterations, and obtain the corresponding to-be-trained model The local model parameters of ;
发送单元,用于将所述本地模型参数发送至所述第一设备,以供所述第一设备基于所述本地模型参数,计算最新联邦模型参数;a sending unit, configured to send the local model parameters to the first device, so that the first device can calculate the latest federated model parameters based on the local model parameters;
更新单元,用于接收所述第一设备反馈的最新联邦模型参数,并基于所述最新联邦模型参数,更新所述待训练模型,直至所述本地模型达到预设训练结束条件,获得所述待完成模型训练任务对应的目标建模模型。an update unit, configured to receive the latest federated model parameters fed back by the first device, and based on the latest federated model parameters, update the to-be-trained model until the local model reaches a preset training end condition, and obtain the to-be-trained model Complete the target modeling model corresponding to the model training task.
本申请联邦学习建模装置的具体实施方式与上述联邦学习建模方法各实施例基本相同,在此不再赘述。The specific implementation of the federated learning modeling apparatus of the present application is basically the same as the above-mentioned embodiments of the federated learning modeling method, and details are not described herein again.
本申请实施例提供了一种可读存储介质,且所述可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序还可被一个或者一个以上的处理器执行以用于实现上述任一项所述的联邦学习建模方法的步骤。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 the federated learning modeling method described in any one of the above.
本申请可读存储介质具体实施方式与上述联邦学习建模方法各实施例基本相同,在此不再赘述。The specific implementations of the readable storage medium of the present application are basically the same as the above-mentioned embodiments of the federated learning modeling method, and are not repeated here.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利处理范围内。The above are only the 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 by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields , are similarly included within the scope of patent processing of this application.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010360246.5A CN111538598B (en) | 2020-04-29 | 2020-04-29 | Federated learning modeling method, device, equipment and readable storage medium |
PCT/CN2021/090823 WO2021219053A1 (en) | 2020-04-29 | 2021-04-29 | Federated learning modeling method, apparatus and device, and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010360246.5A CN111538598B (en) | 2020-04-29 | 2020-04-29 | Federated learning modeling method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111538598A true CN111538598A (en) | 2020-08-14 |
CN111538598B CN111538598B (en) | 2024-11-08 |
Family
ID=71979068
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010360246.5A Active CN111538598B (en) | 2020-04-29 | 2020-04-29 | Federated learning modeling method, device, equipment and readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111538598B (en) |
WO (1) | WO2021219053A1 (en) |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112164224A (en) * | 2020-09-29 | 2021-01-01 | 杭州锘崴信息科技有限公司 | Traffic information processing system, method, device and storage medium for information security |
CN112232518A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Lightweight distributed federated learning system and method |
CN112232519A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112650583A (en) * | 2020-12-23 | 2021-04-13 | 新智数字科技有限公司 | Resource allocation method, device, readable medium and electronic equipment |
CN112700013A (en) * | 2020-12-30 | 2021-04-23 | 深圳前海微众银行股份有限公司 | Parameter configuration method, device, equipment and storage medium based on federal learning |
CN112994981A (en) * | 2021-03-03 | 2021-06-18 | 上海明略人工智能(集团)有限公司 | Method and device for adjusting time delay data, electronic equipment and storage medium |
CN113011602A (en) * | 2021-03-03 | 2021-06-22 | 中国科学技术大学苏州高等研究院 | Method and device for training federated model, electronic equipment and storage medium |
CN113191090A (en) * | 2021-05-31 | 2021-07-30 | 中国银行股份有限公司 | Block chain-based federal modeling method and device |
CN113469377A (en) * | 2021-07-06 | 2021-10-01 | 建信金融科技有限责任公司 | Federal learning auditing method and device |
WO2021219053A1 (en) * | 2020-04-29 | 2021-11-04 | 深圳前海微众银行股份有限公司 | Federated learning modeling method, apparatus and device, and readable storage medium |
WO2022037239A1 (en) * | 2020-08-21 | 2022-02-24 | Huawei Technologies Co.,Ltd. | System and methods for supporting artificial intelligence service in a network |
US11283609B2 (en) | 2020-08-21 | 2022-03-22 | Huawei Technologies Co., Ltd. | Method and apparatus for supporting secure data routing |
CN114548472A (en) * | 2020-11-26 | 2022-05-27 | 新智数字科技有限公司 | Resource allocation method, device, readable medium and electronic equipment |
WO2022108529A1 (en) * | 2020-11-19 | 2022-05-27 | 脸萌有限公司 | Model construction method and apparatus, and medium and electronic device |
WO2022156910A1 (en) * | 2021-01-25 | 2022-07-28 | Nokia Technologies Oy | Enablement of federated machine learning for terminals to improve their machine learning capabilities |
WO2023111150A1 (en) * | 2021-12-16 | 2023-06-22 | Nokia Solutions And Networks Oy | Machine-learning agent parameter initialization in wireless communication network |
WO2023125760A1 (en) * | 2021-12-30 | 2023-07-06 | 维沃移动通信有限公司 | Model training method and apparatus, and communication device |
WO2023143082A1 (en) * | 2022-01-26 | 2023-08-03 | 展讯通信(上海)有限公司 | User device selection method and apparatus, and chip and module device |
WO2023148012A1 (en) * | 2022-02-02 | 2023-08-10 | Nokia Solutions And Networks Oy | Iterative initialization of machine-learning agent parameters in wireless communication network |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114139731B (en) * | 2021-12-03 | 2025-01-14 | 深圳前海微众银行股份有限公司 | Vertical federated learning modeling optimization method, equipment, medium and program product |
CN114168295A (en) * | 2021-12-10 | 2022-03-11 | 深圳致星科技有限公司 | Hybrid architecture system and task scheduling method based on historical task effect |
CN114492179B (en) * | 2022-01-13 | 2024-09-17 | 工赋(青岛)科技有限公司 | Information processing system, method, apparatus, device, and storage medium |
CN115345317B (en) * | 2022-08-05 | 2023-04-07 | 北京交通大学 | A Fair Reward Distribution Method for Federated Learning Based on Fairness Theory |
CN115577876A (en) * | 2022-09-27 | 2023-01-06 | 广西综合交通大数据研究院 | Waybill punctuality prediction method for online freight platform based on blockchain and federated learning |
CN116055335B (en) * | 2022-12-21 | 2023-12-19 | 深圳信息职业技术学院 | Internet of Vehicles intrusion detection model training method, intrusion detection method and equipment based on federated learning |
CN115987985B (en) * | 2022-12-22 | 2024-02-27 | 中国联合网络通信集团有限公司 | Model collaborative construction method, center cloud, edge node and medium |
CN116186341B (en) * | 2023-04-25 | 2023-08-15 | 北京数牍科技有限公司 | Federal graph calculation method, federal graph calculation device, federal graph calculation equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109670684A (en) * | 2018-12-03 | 2019-04-23 | 北京顺丰同城科技有限公司 | The dispatching method and electronic equipment of goods stock based on time window |
US20190171978A1 (en) * | 2017-12-06 | 2019-06-06 | Google Llc | Systems and Methods for Distributed On-Device Learning with Data-Correlated Availability |
CN110442457A (en) * | 2019-08-12 | 2019-11-12 | 北京大学深圳研究生院 | Model training method, device and server based on federation's study |
CN110598870A (en) * | 2019-09-02 | 2019-12-20 | 深圳前海微众银行股份有限公司 | Method and device for federated learning |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180089587A1 (en) * | 2016-09-26 | 2018-03-29 | Google Inc. | Systems and Methods for Communication Efficient Distributed Mean Estimation |
CN110263908B (en) * | 2019-06-20 | 2024-04-02 | 深圳前海微众银行股份有限公司 | Federal learning model training method, apparatus, system and storage medium |
CN111538598B (en) * | 2020-04-29 | 2024-11-08 | 深圳前海微众银行股份有限公司 | Federated learning modeling method, device, equipment and readable storage medium |
-
2020
- 2020-04-29 CN CN202010360246.5A patent/CN111538598B/en active Active
-
2021
- 2021-04-29 WO PCT/CN2021/090823 patent/WO2021219053A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190171978A1 (en) * | 2017-12-06 | 2019-06-06 | Google Llc | Systems and Methods for Distributed On-Device Learning with Data-Correlated Availability |
CN109670684A (en) * | 2018-12-03 | 2019-04-23 | 北京顺丰同城科技有限公司 | The dispatching method and electronic equipment of goods stock based on time window |
CN110442457A (en) * | 2019-08-12 | 2019-11-12 | 北京大学深圳研究生院 | Model training method, device and server based on federation's study |
CN110598870A (en) * | 2019-09-02 | 2019-12-20 | 深圳前海微众银行股份有限公司 | Method and device for federated learning |
Non-Patent Citations (2)
Title |
---|
YONG CHENG: "A Communication efficient collaborative Learning Framework for Distributed Features", 《ARXIV.ORG》, 24 December 2019 (2019-12-24) * |
谢丰;卞建玲;王楠;郑倩;: "联邦学习在泛在电力物联网人工智能领域的应用", 中国高新科技, no. 23, 1 December 2019 (2019-12-01) * |
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021219053A1 (en) * | 2020-04-29 | 2021-11-04 | 深圳前海微众银行股份有限公司 | Federated learning modeling method, apparatus and device, and readable storage medium |
US11588907B2 (en) | 2020-08-21 | 2023-02-21 | Huawei Technologies Co., Ltd. | System and methods for supporting artificial intelligence service in a network |
US11283609B2 (en) | 2020-08-21 | 2022-03-22 | Huawei Technologies Co., Ltd. | Method and apparatus for supporting secure data routing |
WO2022037239A1 (en) * | 2020-08-21 | 2022-02-24 | Huawei Technologies Co.,Ltd. | System and methods for supporting artificial intelligence service in a network |
CN112164224A (en) * | 2020-09-29 | 2021-01-01 | 杭州锘崴信息科技有限公司 | Traffic information processing system, method, device and storage medium for information security |
CN112232519B (en) * | 2020-10-15 | 2024-01-09 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112232518B (en) * | 2020-10-15 | 2024-01-09 | 成都数融科技有限公司 | Lightweight distributed federal learning system and method |
CN112232519A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Joint modeling method based on federal learning |
CN112232518A (en) * | 2020-10-15 | 2021-01-15 | 成都数融科技有限公司 | Lightweight distributed federated learning system and method |
WO2022108529A1 (en) * | 2020-11-19 | 2022-05-27 | 脸萌有限公司 | Model construction method and apparatus, and medium and electronic device |
CN114548472A (en) * | 2020-11-26 | 2022-05-27 | 新智数字科技有限公司 | Resource allocation method, device, readable medium and electronic equipment |
CN112650583A (en) * | 2020-12-23 | 2021-04-13 | 新智数字科技有限公司 | Resource allocation method, device, readable medium and electronic equipment |
CN112700013A (en) * | 2020-12-30 | 2021-04-23 | 深圳前海微众银行股份有限公司 | Parameter configuration method, device, equipment and storage medium based on federal learning |
WO2022156910A1 (en) * | 2021-01-25 | 2022-07-28 | Nokia Technologies Oy | Enablement of federated machine learning for terminals to improve their machine learning capabilities |
CN112994981B (en) * | 2021-03-03 | 2022-05-10 | 上海明略人工智能(集团)有限公司 | Method and device for adjusting time delay data, electronic equipment and storage medium |
CN113011602B (en) * | 2021-03-03 | 2023-05-30 | 中国科学技术大学苏州高等研究院 | Federal model training method and device, electronic equipment and storage medium |
CN113011602A (en) * | 2021-03-03 | 2021-06-22 | 中国科学技术大学苏州高等研究院 | Method and device for training federated model, electronic equipment and storage medium |
CN112994981A (en) * | 2021-03-03 | 2021-06-18 | 上海明略人工智能(集团)有限公司 | Method and device for adjusting time delay data, electronic equipment and storage medium |
CN113191090A (en) * | 2021-05-31 | 2021-07-30 | 中国银行股份有限公司 | Block chain-based federal modeling method and device |
CN113469377A (en) * | 2021-07-06 | 2021-10-01 | 建信金融科技有限责任公司 | Federal learning auditing method and device |
WO2023111150A1 (en) * | 2021-12-16 | 2023-06-22 | Nokia Solutions And Networks Oy | Machine-learning agent parameter initialization in wireless communication network |
WO2023125760A1 (en) * | 2021-12-30 | 2023-07-06 | 维沃移动通信有限公司 | Model training method and apparatus, and communication device |
WO2023143082A1 (en) * | 2022-01-26 | 2023-08-03 | 展讯通信(上海)有限公司 | User device selection method and apparatus, and chip and module device |
WO2023148012A1 (en) * | 2022-02-02 | 2023-08-10 | Nokia Solutions And Networks Oy | Iterative initialization of machine-learning agent parameters in wireless communication network |
Also Published As
Publication number | Publication date |
---|---|
WO2021219053A1 (en) | 2021-11-04 |
CN111538598B (en) | 2024-11-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111538598A (en) | Federated learning modeling method, apparatus, device and readable storage medium | |
WO2021232754A1 (en) | Federated learning modeling method and device, and computer-readable storage medium | |
WO2020029971A1 (en) | Processing method and device for payment process, medium and electronic device | |
CN107944566B (en) | A machine learning method, master node, worker node and system | |
CN113157422A (en) | Cloud data center cluster resource scheduling method and device based on deep reinforcement learning | |
CN111898768A (en) | Data processing method, apparatus, equipment and medium | |
CN113329069A (en) | Instant messaging method, system and computing equipment | |
CN111428884A (en) | Forward method-based federated modeling method, device, and readable storage medium | |
US11948009B2 (en) | Method and device for operating instance resources based on instance arranging property | |
CN111898765A (en) | Feature binning method, device, equipment and readable storage medium | |
CN111797996A (en) | Sample completion method, apparatus, device and readable storage medium | |
CN114302422A (en) | Method and device for processing business by using learning model | |
WO2023184917A1 (en) | Computing power information processing method and system and computing power gateway | |
CN112131013A (en) | Method, device, device and storage medium for monitoring call chain in distributed system | |
CN110247979A (en) | A kind of scheduling scheme determines method, apparatus and electronic equipment | |
CN109819023A (en) | Distributed transaction processing method and Related product | |
CN104035819A (en) | Scientific workflow scheduling method and device | |
CN111652382A (en) | Blockchain-based data processing method, device, equipment and storage medium | |
CN108289115A (en) | A kind of information processing method and system | |
CN116996443B (en) | A network collaborative traffic scheduling method and system combining GNN and SAC models | |
CN113591999A (en) | End edge cloud federal learning model training system and method | |
CN111798315A (en) | Smart contract system, smart contract management method, device and readable storage medium | |
CN104202777B (en) | A Resource Negotiation Method Based on Augmented Lagrangian in Mobile Ad Hoc Networks | |
CN112714146A (en) | Resource scheduling method, device, equipment and computer readable storage medium | |
CN109409883A (en) | Cooperative processing method, household appliance and server based on intelligent contract |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |