Asynchronous federated learning method, system, device and storage medium with front-end and back-end separation

By introducing a front-end and back-end separation asynchronous federated learning method in the federated learning framework, the problem of the asynchronous mode not supporting and edge-end devices in the existing technology is solved, and efficient asynchronous federated learning and multi-end compatibility are achieved.

CN114861931BActive Publication Date: 2025-04-08SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210373640.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-04-08
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

The existing federated learning framework does not support asynchronous mode and does not adapt to edge devices, resulting in network blockage and inefficient global model updates, complex configuration and poor scalability.

Method used

A method of asynchronous federated learning that is separated by front-end and back-end is proposed. Through the system architecture of front-end and back-end separation, data exchange is used in the form of an interface to realize asynchronous federated learning. The system includes the front-end and the back-end. The user identities of the front-end include service users, system managers and training participants. The back-end is responsible for pushing service request information, setting up global training policies, performing asynchronous federated learning and model evaluation.

Benefits of technology

It realizes multi-terminal compatibility of asynchronous federated learning systems, improves system flexibility and portability, adapts to the configuration and deployment of complex environments, and reduces the dependence of applications on the system running environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114861931B_ABST
    Figure CN114861931B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for asynchronous federated learning with front-end and back-end separation, wherein the method comprises: according to the service to be trained, the service user sends service request information to the back-end; the service request information received by the back-end is pushed to the system manager; the system manager sets the global training strategy of the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back-end, and the back-end starts the asynchronous federated learning of the task to be executed; the back-end sends a training notification to the training participants; the training participants train the local model and upload the trained local model to the back-end; the back-end generates a global model according to the received local model, and evaluates the global model; when the evaluation is passed, the back-end updates the use status of the service to be trained, and returns the updated use status to the service user. The front-end and back-end of the asynchronous federated learning system proposed in the embodiment of the present application are relatively independent and loosely coupled, which can effectively improve the compatibility of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of federated learning application technology, and in particular to an asynchronous federated learning method, system, device and storage medium with front-end and back-end separation. Background Art

[0002] With the development of big data technology, a large amount of multi-source heterogeneous data has caused the problem of data island distribution. Fine-grained data islands not only increase the difficulty of data processing, but also increase the difficulty of data supervision, and the risk of sensitive information leakage also increases. In order to solve the above problems to a certain extent, in recent years, the federated learning framework has been used to train user data to meet the needs of multi-source heterogeneous data fusion and user privacy protection.

[0003] Traditional federated learning uses synchronous optimization, which is not flexible enough and can easily lead to problems such as network congestion on the central server side and inefficient global model updates. Therefore, asynchronous federated learning has become a new research direction. However, most existing federated learning frameworks do not support asynchronous models and are not suitable for edge devices. In addition, these federated learning frameworks are usually developed for specific implementation scenarios, with poor scalability and difficulty in configuration. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the present application proposes a front-end and back-end separated asynchronous federated learning method, system, device and storage medium.

[0005] In the first aspect, an embodiment of the present application provides an asynchronous federated learning method with separated front-end and back-end, which is applied to an asynchronous federated learning system with separated front-end and back-end, wherein the system includes a front-end and a back-end, and the front-end and the back-end exchange data in the form of an interface; the user identities of the front-end include service users, system administrators, and training participants; the method includes: according to the service to be trained, the service user sends service request information to the back-end; the service request information received by the back-end is pushed to the system administrator; according to the received service request information, the system administrator sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back-end; according to the global training strategy, the back-end starts asynchronous federated learning of the task to be executed ; During the asynchronous federated learning process, the backend sends a training notification to the training participant; according to the training notification, the training participant trains the local model and uploads the trained local model to the backend; the backend generates a global model based on the received local model and evaluates the global model; when the evaluation passes, the backend updates the usage status of the service to be trained and returns the updated usage status to the service user; after receiving the usage status, the service user sends a local service request corresponding to the service to be trained to the backend; according to the local service request, the backend sends the global model to the service user; the service user receives the global model and performs local service calculations to obtain service calculation results, and visualizes the service calculation results on the front-end interface.

[0006] Optionally, the method also includes: after the backend receives the service request information, the backend records the service request information in a backend database; the backend sends a response message to the service user, declaring the response information as an information flow; based on the response information, the service user updates the front-end interface; after receiving the usage status, closing the information flow channel, and performing a pop-up prompt or providing a local service request button on the front-end interface; wherein the local service button is an interface button for sending the local service request to the backend.

[0007] Optionally, according to the training notification, the training participant trains the local model and uploads the trained local model to the back end, including: the training notification includes a special event identifier corresponding to the task to be performed and a local model upload interface; according to the special event identifier, the training participant sends a user information query request to the back end; according to the user information query request, the back end determines whether the training participant is training the task to be performed for the first time; if the training participant is training the task to be performed for the first time, the back end returns the global training strategy, global encryption model, local training container image and container configuration file corresponding to the task to be performed to the training participant; the training participant deploys the local training container according to the received local training container image and container configuration file, and saves the global training strategy; the training participant imports the global encrypted model into the local training container, trains the global encrypted model according to the global training strategy, and obtains the local model; through the local model upload interface, the training participant uploads the local model to the back end.

[0008] Optionally, the method also includes: according to the local service request, the backend sends the local computing container image and the container configuration file to the service user; the service user deploys the local computing container according to the local computing container image and the container configuration file; the service user receives the global model and performs local service calculation to obtain the service calculation result. This step is specifically: importing the global model into the local computing container, running the local computing container, and obtaining the service calculation result.

[0009] Optionally, the method further includes: when the evaluation fails, the backend receives the new local model, updates the global model according to the new local model, and re-evaluates the updated global model.

[0010] In the second aspect, an embodiment of the present application provides an asynchronous federated learning system with separated front-end and back-end, including a front-end and a back-end: the front-end and the back-end exchange data in the form of an interface; the front-end includes a service user terminal, a training participant terminal and a system administrator terminal; the back-end includes a service user module, a training participant module and a system administrator module; the service user terminal is used for the service user to call the service user module; the service user module is used for sending service request information of the service to be trained to the back-end, and for sending local service requests to the back-end, and for performing local service calculations; the training participant terminal is used for the training participant to call the training participant module; the training participant module is used for training the local model according to the training notification sent by the back-end, and for uploading the trained local model to the back-end; the system administrator module is used for the system administrator to call the system administrator module; the system administrator module is used to set the global training strategy for the service to be trained, and for sending the global training strategy to the back-end.

[0011] Optionally, the interface communication mechanism of the system includes an immediate response mode and an asynchronous processing mode.

[0012] Optionally, the front end also includes a universal terminal, and the back end also includes a universal function module; the universal terminal is used for users to call the universal function module; the universal function module is used to provide at least one function of user registration and login, interface resource response, database management, data statistical processing and data encryption and decryption.

[0013] In a third aspect, an embodiment of the present application provides an asynchronous federated learning device with separated front-end and back-end, comprising: at least one processor; at least one memory for storing at least one program; when the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned asynchronous federated learning method with separated front-end and back-end.

[0014] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a program executable by a processor, and the program executable by the processor is used to implement the above-mentioned asynchronous federated learning method with front-end and back-end separation when executed by the processor.

[0015] The beneficial effects of the embodiments of the present application are as follows: the method proposed in the present application is applied to an asynchronous federated learning system with front-end and back-end separation, the system including a front-end and a back-end, and the user identities of the front-end include service users, system managers and training participants; the method includes: according to the service to be trained, the service user sends service request information to the back-end; the service request information received by the back-end is pushed to the system manager; according to the received service request information, the system manager sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back-end; according to the global training strategy, the back-end starts asynchronous federated learning of the task to be executed; in the process of asynchronous federated learning, the back-end sends a training notification to the training participants; according to the training notification, the training participants train the local model and upload the trained local model to the back-end; the back-end generates a global model according to the received local model and evaluates the global model; when the evaluation passes, the back-end updates the usage status of the service to be trained and returns the updated usage status to the service user; after receiving the usage status, the service user sends a local service request corresponding to the service to be trained to the back-end; according to the local service request, the back-end sends the global model to the service user; the service user receives the global model and performs local service calculation to obtain the service calculation result, and visualizes the service calculation result on the front-end interface. The asynchronous federated learning system proposed in the embodiment of the present application is separated from the front-end and the back-end, and the front-end and the back-end exchange data in the form of an interface, so the front-end and the back-end are relatively independent and loosely coupled. In this way, the front-end device is not restricted by the back-end, and can adapt to the configuration, development and deployment of complex environments, effectively improving the multi-terminal compatibility of the asynchronous federated learning system of the embodiment of the present application. In addition, the asynchronous federated learning method of the embodiment of the present application proposes to design the roles of service users, training participants and system managers at the front end, which can well adapt to the multi-threaded asynchronous processing of the asynchronous federated learning process by different terminal devices and different users in a multi-terminal environment, and provides a practical implementation plan for the edge devices of multiple terminals to participate in asynchronous federated learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0017] Figure 1 A schematic diagram of the system architecture of an asynchronous federated learning system with front-end and back-end separation provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a service user terminal interface proposed in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of a training participant terminal interface proposed in an embodiment of the present application;

[0020] Figure 4 This is a schematic diagram of the interface of the system administrator terminal proposed in the embodiment of the present application;

[0021] Figure 5 A flowchart of the steps of the asynchronous federated learning method with front-end and back-end separation proposed in an embodiment of the present application;

[0022] Figure 6 A schematic diagram of module division of the module interface layer provided in an embodiment of the present application;

[0023] Figure 7 A schematic diagram of a process for a service user to initiate a service request information provided in an embodiment of the present application;

[0024] Figure 8 A flowchart of a system administrator configuring a global training strategy and initiating asynchronous federated learning provided in an embodiment of the present application;

[0025] Fig. 9 A flowchart of the steps for training a local model by a training participant provided in an embodiment of the present application;

[0026] Fig.10 A flowchart of the steps for the system administrator and training participants to complete asynchronous federated learning in an embodiment of the present application;

[0027] Fig.11 A flowchart of the steps for a service user to perform local service calculations provided by an embodiment of the present application;

[0028] Fig.12 A schematic diagram of an asynchronous federated learning device with separated front-end and back-end provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0030] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0031] With the development of big data technology, a large amount of multi-source heterogeneous data has caused the problem of data island distribution. Fine-grained data islands not only increase the difficulty of data processing, but also increase the difficulty of data supervision, and the risk of sensitive information leakage also increases. In order to solve the above problems to a certain extent, in recent years, the federated learning framework has been used to train user data to meet the needs of multi-source heterogeneous data fusion and user privacy protection.

[0032] Traditional federated learning uses a synchronous optimization method, that is, in each training round, the central server sends the global model to multiple clients synchronously. After multiple clients train the model based on local data, they return the updated model to the central server. The central server waits for all clients to upload the local model before performing a global model aggregation update. It is understandable that since the global model is sent to multiple clients synchronously, this may cause the central server to occupy too many resources in a short period of time, resulting in network congestion; and the synchronous optimization method is inefficient and difficult to control for updating the global model. Therefore, asynchronous federated learning has become a new research direction. For example, related technologies include FATE initiated by WeBank's AI department, PySyft of OpenMind, and Flower of Cambridge University, etc., which support asynchronous mode.

[0033] However, there are not many federated learning frameworks that support asynchronous mode. Most federated learning frameworks do not support asynchronous mode and are not suitable for edge devices. In addition, these federated learning frameworks are usually developed for specific implementation scenarios (such as self-developed federated learning system projects of enterprises). For reasons of security and specialization, these federated learning frameworks are generally less scalable and have complex configurations, making them difficult to use in practice.

[0034] Based on this, the embodiment of the present application proposes an asynchronous federated learning method, system, device and storage medium with separated front-end and back-end. The method proposed in the present application is applied to an asynchronous federated learning system with separated front-end and back-end. The system includes a front-end and a back-end. The user identities of the front-end include service users, system managers and training participants. The method includes: according to the service to be trained, the service user sends service request information to the back-end; the service request information received by the back-end is pushed to the system manager; according to the received service request information, the system manager sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back-end; according to the global training strategy, the back-end starts asynchronous federated learning of the task to be executed; in In the process of asynchronous federated learning, the backend sends a training notification to the training participants; according to the training notification, the training participants train the local model and upload the trained local model to the backend; the backend generates a global model based on the received local model and evaluates the global model; when the evaluation passes, the backend updates the usage status of the service to be trained and returns the updated usage status to the service user; after the service user receives the usage status, it sends a local service request corresponding to the service to be trained to the backend; according to the local service request, the backend sends the global model to the service user; the service user receives the global model and performs local service calculations to obtain the service calculation results, and visualizes the service calculation results on the front-end interface. The asynchronous federated learning system proposed in the embodiment of the present application is separated from the front and back ends, and the front and back ends exchange data in the form of an interface, so the front and back ends are relatively independent and loosely coupled, so that the front-end device can be free from the restrictions of the back end, can adapt to the configuration, development and deployment of complex environments, and effectively improve the multi-terminal compatibility of the asynchronous federated learning system of the embodiment of the present application. In addition, the asynchronous federated learning method of the embodiment of the present application proposes to design the roles of service users, training participants and system administrators at the front end, which can well adapt to the multi-threaded asynchronous processing of the asynchronous federated learning process by different terminal devices and different users in a multi-terminal environment, and provides a practical implementation plan for multi-terminal edge devices to participate in asynchronous federated learning.

[0035] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0036] First, for the sake of convenience, unless otherwise specified, all the following "systems" are asynchronous federated learning systems with front-end and back-end separation provided in the embodiments of the present application, and all the following "methods" are asynchronous federated learning methods with front-end and back-end separation proposed in the embodiments of the present application.

[0037] refer to Figure 1 , Figure 1 A schematic diagram of the system architecture of an asynchronous federated learning system with front-end and back-end separation provided in an embodiment of the present application is shown in FIG. Figure 1As shown, the system architecture of the system proposed in the embodiment of the present application includes but is not limited to an interactive terminal layer, a module interface layer, a container deployment layer, a system data layer and a basic algorithm layer.

[0038] In the system, the front end generally refers to the terminal device with an operation interface and the local data storage and data processing system. The front end is used to provide static resources from the local data storage, complete local business processing through the local data processing system, and send HTTP requests to the back end. The back end generally refers to the device responsible for receiving, parsing, and processing requests. In most cases, this device is a server. The back end performs data processing and other operations and resource responses based on the front end's requests.

[0039] Therefore, based on the development model of the separation of the front and back ends of the system of this application, the interactive terminal layer is located at the front end, and the interactive terminal layer is used to complete the interactive operation between the user and the system, and realizes the visualization of the release of the front-end device request and the response of the back-end server through interface calls and data communication. The module interface layer is located at the back end, and uses including but not limited to Python as a function implementation technology. The module interface layer is used to receive the request issued by the front end and execute the functional module of the back end, call the algorithm library or the content in the container pool on demand, and complete the response of the back-end resources. The front end calls the interface through the interactive terminal layer, and the back end executes the function through the module interface layer. Therefore, data is exchanged between the front end and the back end in the form of an interface. This data exchange can be in the form of information flow or in the form of file flow. In this way, by setting different communication protocols, the system of the embodiment of the present application can realize cross-language and cross-platform multi-terminal device management, thereby further improving the compatibility of the asynchronous federated learning system.

[0040] Among them, the interface communication mechanism of the module interface layer includes immediate response mode and asynchronous processing mode. In the immediate response mode, the front end initiates an HTTP request, the back end performs logical processing on the request, responds to the processing result, and then the communication session ends; while in the asynchronous processing mode, the front end initiates an HTTP request, and the back end declares this data as an information flow when responding to the front end. The front end opens a channel to maintain a connection with the back end. The back end can continue to push the processing results to the front end during the logical processing of the request until the processing is completed and the information flow end mark is declared in the response data. The front end closes the channel and the communication session ends.

[0041] In addition, as the operating basis of the system supporting the separation of front-end and back-end, the basic algorithm layer, container deployment layer and system data layer are arranged accordingly at the front-end and back-end. The basic algorithm layer is used to store the core algorithm of the system and form a core algorithm library to support the operation of the system. The container deployment layer is used to store the core container image and configuration file of the system on the back-end server to form a core container pool to support the operation of the system, and deploy the encapsulated container on the front-end device according to the needs of the federated learning process, such as setting a container deployment module on the front-end and setting a container pool on the back-end. The container image of the back-end container pool virtualizes and makes portable some of the required applications and dependent packages (these required applications and dependent packages include but are not limited to PyTorch machine learning scripts and their environments) to meet the needs of the asynchronous federated learning system and reduce the dependence of the application on the system operating environment. The system data layer is used to store the data of the asynchronous federated learning system on the front-end device and the back-end server, and provide database operations. The system data layer uses, including but not limited to MySQL as a database management system. For example, a front-end database is deployed in the front-end device, which is used to store the front-end device data of the asynchronous federated learning system, including but not limited to terminal user information and user data for local training or calculation; and is used to provide database management tools or commands to support the functional implementation of terminal services. A backend database is deployed in the backend server. The backend database is used to store the backend server data of the asynchronous federated learning system, including but not limited to service request information, service availability status, training participant information and global model information, and to provide database management tools or commands to support the functional implementation of the backend interface.

[0042] In some embodiments, the system builds the communication connection and interface call between the front-end and back-end through RESTful API, and completes the call of the front-end terminal device to the back-end server function module, where JSON is the front-end and back-end data exchange format. In order to ensure data security, the front-end and back-end of the system use including but not limited to Token and Session as identity authentication and management technologies.

[0043] Furthermore, the interactive terminal layer and the module interface layer are specifically divided according to the user identity. The interactive interface layer set at the front end includes the service user terminal, the training participant terminal and the system manager terminal. Corresponding to these three terminals, the module interface layer set at the back end includes the service user module, the training participant module and the system manager module. The following first describes the three terminals in the interactive terminal layer.

[0044] The service user terminal is used for service users to call the service user module. The service user terminal can be deployed in a mobile phone, using, but not limited to, JAVA and XML as interface construction technology. When a service user uses the service user terminal in a mobile phone, he can browse and operate the service list page, service result page, and service availability status pop-up window in the display interface of the service user terminal. Figure 2 , Figure 2 This is a schematic diagram of the service user terminal interface proposed in the embodiment of the present application. Figure 2 The service list page in the service user terminal and the service availability pop-up window are shown in the figure. The training participant terminal is used for the training participant to call the training participant module. The training participant terminal can be deployed in a mobile phone, using, but not limited to, JAVA and XML as interface construction technology. When the training participant uses the training participant terminal in the mobile phone, he can browse and operate the task information list in the display interface of the training participant terminal. Figure 3 , Figure 3 This is a schematic diagram of the training participant terminal interface proposed in the embodiment of the present application. Figure 3 The task information list in the training participant terminal is shown in the figure. The system administrator module is used by the system administrator to call the system administrator module. The system administrator terminal is generally deployed in a web page, using HTML, CSS and JavaScript as the interface construction technology. When the system administrator uses the system administrator terminal, he can browse and operate the request list page, task information list page and policy setting pop-up window in the display interface of the system administrator terminal. Figure 4 , Figure 4 This is a schematic diagram of the interface of the system administrator terminal proposed in the embodiment of the present application. Figure 4 2 shows a task information list in the system manager terminal.

[0045] Corresponding to the three terminals in the interactive interface layer, there are also three corresponding modules in the module interface layer for calling. The service user module is used to send service request information of the service to be trained to the back end, and is used to send local service requests to the back end, and is used to perform local service calculations; the training participant module is used to train the local model according to the training notification sent by the back end, and is used to upload the trained local model to the back end; the system manager module is used to set the global training strategy of the service to be trained, and is used to send the global training strategy to the back end. The more specific functions and sub-module divisions of the three modules in the module interface layer will be further explained below in conjunction with the method of the embodiment of the present application.

[0046] In addition, in addition to the specific terminals and calling modules generated corresponding to the three user identities, the interactive terminal layer also includes a universal terminal. Correspondingly, the module interface layer also includes a universal function module. The universal terminal is used for users to call the universal function module; the universal function module is used to provide at least one function of user registration and login, interface resource response, database management, data statistical processing and data encryption and decryption.

[0047] Next, based on the front-end and back-end separated asynchronous federated learning system of one or more of the above embodiments, the front-end and back-end separated asynchronous federated learning method proposed in the embodiments of the present application is described.

[0048] Reference Figure 5 , Figure 5 This is a flowchart of the steps of the asynchronous federated learning method with front-end and back-end separation proposed in the embodiment of the present application. The method is applied to the asynchronous federated learning system with front-end and back-end separation in the embodiment of the present application. The system includes a front-end and a back-end, and the front-end and the back-end exchange data in the form of an interface; the user identities of the front-end include service users, system administrators, and training participants; the following is combined with Figure 5 The specific process of implementing asynchronous federated learning by cooperating with these three user identities is described. The method includes but is not limited to S500-S5100:

[0049] S500, according to the service to be trained, the service user sends a service request message to the backend;

[0050] Specifically, in order to meet the requirements of implementing asynchronous federated learning in the form of multiple threads on multiple terminals and multiple users, the embodiment of the present application designs three user identities at the front end, namely service users, system managers, and training participants. Service users can initiate service training requests for federated learning according to demand, and perform local computing services based on the trained global model; system managers configure specific training strategies for federated learning; and training participants train local models locally. In this way, the entire federated learning process is split into request-configuration-training-service, which is performed asynchronously by different users, thereby greatly improving the flexibility and portability of the federated learning system.

[0051] At the beginning of the entire federated learning, the service user first sends a service request message to the backend based on the service to be trained. In the embodiment of the present application, the service to be trained refers to a service whose task is trainable and has no trained model yet, and the service user can make a service request for these services to be trained.

[0052] Combine the following Figure 6 and Figure 7 , specifically explains the process of service users initiating service request information. Figure 6 A schematic diagram of module division of the module interface layer provided in an embodiment of the present application, Figure 7 A schematic diagram of the process of a service user initiating a service request message provided in an embodiment of the present application. Figure 6 As shown, the module interface layer includes a service user module, a training participant module and a system manager module. The service user module includes a service request publishing sub-module and a local service computing sub-module. The training participant module includes a local model training sub-module. The system manager module includes a training strategy setting sub-module and an asynchronous federated training sub-module.

[0053] like Figure 7 As shown, the service user accesses the service user terminal on the mobile phone, referring to Figure 2 , there is a service list page in the interface. The service user interacts with the service user terminal. For example, when clicking on a service in the service list, the service user module in the module interface layer is called. The service publishing submodule in the service user module sends service request information to the backend in an asynchronous mode. The backend records the service request information in the backend database. Then the backend sends a response message to the service user, declaring the response information as an information flow. The information flow channel between the frontend and the backend will be open all the time. The service user terminal interface is updated asynchronously and displayed as waiting. The backend continues to read the backend database and continues to push the usage status of the current service to be trained to the service user terminal. If the usage status of the current service to be trained becomes available, the backend returns the usage status to the service user terminal through the information flow channel and tells the service user terminal to close the information flow channel. Then, the service user terminal closes the information flow channel and pops up a window prompt or provides a local service request button on the frontend interface for the service user to use the trained service.

[0054] It is understandable that if there is a service with a trained model in the service list of the service user terminal, the service user can directly click on the service to perform local calculation. In addition, if there is an untrainable service in the service list, when the service user clicks on the service, the service user terminal can prompt through a pop-up window.

[0055] S510, the service request information received by the backend is pushed to the system administrator;

[0056] Specifically, according to the above step S500, the backend receives the service request information sent by the service user. In the embodiment of the present application, the system administrator terminal will continuously receive the information flow of the backend, so the backend pushes the received service request information to the system administrator, and the request list of the system administrator terminal will asynchronously update the service request information, for example, the request list displays the information of the tasks to be executed corresponding to the service to be trained that has been requested.

[0057] S520, according to the received service request information, the system administrator sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back end;

[0058] Specifically, according to the received service request information, the system administrator terminal asynchronously updates the request list. Figure 8 Describes the process of system administrators configuring global training strategies and initiating asynchronous federated learning. Figure 8 , Figure 8 A schematic diagram of a process for a system administrator to configure a global training strategy and initiate asynchronous federated learning according to an embodiment of the present application. Figure 8 As shown, the system administrator interacts with the system administrator terminal interface, and the submodule can pop up a setting window for the task to be executed on the interface. The system administrator can browse and operate the setting window. The system administrator fills in the global training strategy of the task to be executed in the window, and sends the HTTP request with the global training strategy to the backend through the interactive button, calling Figure 6 The training strategy setting submodule in the training strategy setting submodule. After receiving the global training strategy, the training strategy setting submodule sends the global training strategy to the backend database, which stores or updates the global training strategy. The backend continuously reads the database and returns a response to the system administrator terminal. The current response is an information flow. The information flow channel between the system administrator terminal and the backend remains open. The backend can continuously push the training status of the current task to be executed to the system administrator terminal, and the system administrator terminal asynchronously updates the interface to training.

[0059] S530: According to the global training strategy, the backend starts asynchronous federated learning of the tasks to be executed;

[0060] Specifically, refer to Figure 8 , after setting the global training strategy, Figure 6 The asynchronous federation training submodule in will be automatically called to start training the tasks to be executed. The asynchronous federation submodule will query the backend database for the training participants who can participate in this round of global training, such as determining the number of training participants and the specific front-end devices, etc.

[0061] S540, during the asynchronous federated learning process, the backend sends a training notification to the training participants;

[0062] Specifically, referring to the above step S530, the asynchronous federation submodule determines the training participants participating in this round of training through the backend database. Since the training participants will always maintain connection with the backend after the training participant terminals go online, the training participants will receive the training notifications sent by the backend.

[0063] S550. According to the training notification, the training participant trains the local model and uploads the trained local model to the backend;

[0064] Specifically, refer to Fig. 9 , Fig. 9 A flowchart of the steps for training a participant to train a local model provided in an embodiment of the present application. Fig. 9 As shown, since the training notification received by the training participant includes the special event identifier corresponding to the task to be executed and the local model upload interface, Figure 6 The local model training submodule in is called, and a user information query request is sent to the backend database according to the special event identifier. The backend database returns the training participant's user information to the local model training submodule, and the local model training submodule determines whether the training participant is training the task to be executed for the first time according to the user information query request. If not, the backend only returns the current global encryption model to the training participant terminal, and according to the global encryption model; if so, the backend returns the global training strategy corresponding to the task to be executed, the global encryption model, the local training container image and the container configuration file to the training participant terminal.

[0065] It is understandable that the global training strategy is pushed by the backend database; the untrained global model is encrypted by the basic algorithm layer, and the global encrypted model is pushed to the training participant terminal; the local training container image and container configuration file are pushed by the backend container pool. The above files are pushed to the front-end training participant terminal by the local model training submodule.

[0066] In some embodiments, the encryption and decryption algorithms in the basic algorithm layer include but are not limited to the AES algorithm and the RSA algorithm. The AES algorithm is used to encrypt the model files transmitted between the front-end and the back-end, and the RSA algorithm is used to encrypt the AES key between the front-end and the back-end.

[0067] The training participant deploys a local training container at the training participant terminal according to the received local training container image and container configuration file, and saves the global training strategy; then, the training participant terminal imports the global encryption model and the local training-related data read from the front-end database into the local training container, runs the local training container so that the container trains the global encryption model according to the global training strategy, and obtains the local model after the script in the local training container is finished running; the training participant terminal exports the trained local model to the local device, and then the training participant terminal uploads the local model to the back end through the local model upload interface.

[0068] S560, the backend generates a global model according to the received local model, and evaluates the global model;

[0069] Specifically, when the backend receives the global model sent by the training participant terminal, Figure 6The asynchronous federated training submodule in the training process uses an asynchronous federated aggregation algorithm to aggregate local models, generate a global model, and evaluate the updated global model. If the evaluation fails, the asynchronous federated training submodule continues to organize a new round of global training, receives new local models from the training participant terminals, updates the global model according to the new local models, and re-evaluates the updated global model.

[0070] In some embodiments, the asynchronous federation aggregation algorithm adopts an asynchronous aggregation algorithm based on weight summary and version awareness, which can record and dynamically update the model parameters and versions uploaded by each training participant at the back end. When the training participant uploads the locally trained model parameters, it also uploads its serial number; when the back end receives the model parameters, it uses the weight summary to update the latest model parameters of the node and updates its version.

[0071] In some embodiments, the specific process of model parameter aggregation in the asynchronous federation aggregation algorithm is: 1) calculate the latest version of all current training participants; 2) calculate the aggregation weight based on the difference between the current version of each training participant and the latest version and aggregate the global model; 3) calculate the version gap threshold. If the sum of the version gaps of all training participants is greater than the threshold, the aggregated global model will be delegated to all training participants, otherwise the global model will only be delegated to the training participants who have uploaded the model parameters this time. The specific calculation formula for model parameter aggregation in the asynchronous federation aggregation algorithm is:

[0072]

[0073]

[0074] Where i represents the i-th training participant, n represents the total number of training participants; v latest Indicates the latest version of the uploaded model parameters; α represents the version ratio hyperparameter, α∈(0,1); server v [i] indicates the version of the parameters uploaded by the current i-th training participant, initially 1; server w [i] represents the model uploaded by the i-th training participant; w latest represents the global model parameter after version weighting aggregation, w′ latest represents the normalized global model parameters.

[0075] v latest , server v [i],server w The update formula for [i] is:

[0076] v latest =v latest+1

[0077] server v [i] = v latest

[0078] server w [i] = w

[0079] Where w is the model parameter uploaded by the training participant; when the server receives the model parameter uploaded by the training participant, it accumulates and updates v latest ; Update server v [i], record the version of the model parameters uploaded by the corresponding training participants; update the server w [i], record the model parameters uploaded by the corresponding training participants.

[0080] S570: When the evaluation is passed, the backend updates the usage status of the service to be trained and returns the updated usage status to the service user;

[0081] Specifically, referring to step S560, when the updated global model evaluation passes, the global training of the current task to be executed is completed. The backend database updates the usage status of the current service to be trained, and updates the task training status of the current task to be executed. Then, the backend notifies the system administrator terminal of the updated task training status, and the system administrator terminal refreshes the task list accordingly, and changes the status of the current task to trained; and the backend notifies the service user terminal of the usage status of the updated service to be trained, and the service user terminal refreshes the service list accordingly, changes the usage status of the current service to trained, and performs a pop-up notification in the interface.

[0082] At this point, the system administrator and the training participants have completed all steps in the asynchronous federated learning method of the embodiment of the present application. Fig.10 , Fig.10 This is a flowchart of the steps for the system administrator and training participants to complete asynchronous federated learning in the embodiment of the present application. Fig.10 As shown, first, the system administrator terminal sends a task request to the local model training submodule, and then the local model training submodule reads the available training participants from the backend database and notifies the training participant terminal to start training. After the training participant terminal completes the local model training, it encrypts the local model and uploads it to the local model training submodule of the backend. The backend decrypts the local model through the encryption and decryption algorithm of the basic algorithm layer, and aggregates and updates the global model through the asynchronous federation aggregation algorithm. The local model training submodule evaluates the global model and repeats the training until the evaluation passes. Then the local model training submodule informs the system administrator that the current training is over, and the training participant terminal also clears the relevant containers, scripts and other files accordingly.

[0083] S580, after receiving the usage status, the service user sends a local service request corresponding to the service to be trained to the backend;

[0084] Specifically, after the service user receives the usage status of the service that has been trained, referring to the content of step S500, the service user terminal interface pops up a prompt or provides a local service request button for the service user to use the trained service. The service user can click the local service request button to send a local service request corresponding to the service to be trained to the backend.

[0085] S590, according to the local service request, the backend sends the global model to the service user;

[0086] Specifically, refer to Fig.11 , Fig.11 A flowchart of the steps for a service user to perform local service calculations provided in an embodiment of the present application. Fig.11 As shown, the service user clicks the local service request button to send a local service request corresponding to the service to be trained to the backend, calling Figure 6 The local service computing submodule in the backend container pool reads the local computing container image and container configuration file, reads the global model in the backend database, and encrypts the global model through the encryption and decryption algorithm of the basic algorithm layer to obtain the global encrypted model. Then, the local service computing submodule at the backend sends the global model, local computing container image and container configuration file to the frontend service user terminal. The service user deploys the local computing container according to the local computing container image and container configuration file, decrypts the global encrypted model to obtain the global model, reads the data related to the local service computing in the frontend database, imports these data and the global model into the local computing container, runs the local computing container, and obtains the service computing result.

[0087] S5100, the service user receives the global model and performs local service calculation, obtains the service calculation result, and visualizes the service calculation result on the front-end interface;

[0088] Specifically, according to the above step S590, the service user receives the global model and performs local service calculation to obtain the service calculation result, and then the service user terminal exports the local calculation result and visualizes the local calculation result on the interface of the service user terminal.

[0089] Through steps S500-S5100, the embodiment of the present application describes a front-end and back-end separated asynchronous federated learning method in combination with an asynchronous federated learning system. In the embodiment of the present application, it is proposed that the front end has three user identities, namely, a service user, a system manager and a training participant. The method includes: according to the received service request information, the system manager sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back end; according to the global training strategy, the back end starts the asynchronous federated learning of the task to be executed; in the process of asynchronous federated learning, the back end sends a training notification to the training participant; according to the training notification, the training participant trains the local model and uploads the trained local model to the back end; the back end generates a global model based on the received local model and evaluates the global model; when the evaluation passes, the back end updates the usage status of the service to be trained and returns the updated usage status to the service user; after receiving the usage status, the service user sends a local service request corresponding to the service to be trained to the back end; according to the local service request, the back end sends the global model to the service user; the service user receives the global model and performs local service calculation, obtains the service calculation result, and visualizes the service calculation result on the front end interface.

[0090] The asynchronous federated learning system proposed in the embodiment of the present application is separated from the front and back ends, and the front and back ends exchange data in the form of interfaces, so the front and back ends are relatively independent and loosely coupled. In this way, the front-end device can be free from the restrictions of the back end, and can adapt to the configuration, development and deployment of complex environments, effectively improving the multi-terminal compatibility of the asynchronous federated learning system of the embodiment of the present application. Furthermore, the asynchronous federated learning method of the embodiment of the present application proposes to design the roles of service users, training participants and system managers in the front end, which can well adapt to the multi-terminal environment. Different terminal devices (such as web pages, IOS systems, Android systems, etc.) and different users of the asynchronous federated learning process multi-threaded asynchronous processing provides a practical and complete workflow for the edge devices of multiple terminals to participate in asynchronous federated learning. In addition, the platform architecture of the embodiment of the present application is clear, and the overall process is designed according to the modular idea. The interfaces of each module are coordinated and cooperated with each other. There is no need for developers to actively manage business interfaces. Users can independently build new module interfaces based on business needs, and loose coupling is achieved in both system development and deployment stages. Finally, the system combines container technology and arranges container deployment layers on both the front and back ends. The code and environment required for local training, local computing and other processes of federated learning are encapsulated in the container, so that these data are not affected by the device operation support environment, greatly reducing the application's dependence on the system. The asynchronous federated learning system with separated front and back ends proposed in the embodiment of the present application has the ability to be ported to multiple systems such as users, enterprises, and platforms and break their data barriers.

[0091] refer to Fig.12 , Fig.12 A schematic diagram of an asynchronous federated learning device with front-end and back-end separation provided in an embodiment of the present application, wherein the device 1200 includes at least one processor 1210 and at least one memory 1220 for storing at least one program; Fig.12 A processor and a memory are taken as an example.

[0092] The processor and the memory may be connected via a bus or other means. Fig.12 The example of connecting through bus is taken in the following.

[0093] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0094] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0095] The embodiment of the present application further discloses a computer storage medium, in which a program executable by a processor is stored. The program executable by the processor is used to implement the method proposed in the present application when executed by the processor.

[0096] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0097] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present application. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A front-end and back-end separated asynchronous federated learning method, the front-end and back-end separated asynchronous federated learning method is applied to a front-end and back-end separated asynchronous federated learning system, the system includes a front-end and a back-end, and the front-end and the back-end exchange data in the form of an interface; The user identities of the front end include service users, system administrators and training participants; characterized in that, The method comprises: According to the service to be trained, the service user sends service request information to the backend; The service request information received by the backend is pushed to the system administrator; According to the received service request information, the system administrator sets a global training strategy for the task to be executed corresponding to the service to be trained, and sends the global training strategy to the back end; According to the global training strategy, the backend starts asynchronous federated learning of the task to be executed; During the asynchronous federated learning process, the backend sends a training notification to the training participants; According to the training notification, the training participant trains the local model and uploads the trained local model to the backend; The backend generates a global model according to the received local model, and evaluates the global model; When the evaluation is passed, the backend updates the usage status of the service to be trained and returns the updated usage status to the service user; After receiving the usage status, the service user sends a local service request corresponding to the service to be trained to the backend; According to the local service request, the backend sends the global model to the service user; The service user receives the global model and performs local service calculation to obtain service calculation results, and visualizes the service calculation results on the front-end interface; The training participant trains a local model according to the training notification, and uploads the trained local model to the backend, including: The training notification includes a special event identifier corresponding to the task to be executed and a local model upload interface; According to the special event identifier, the training participant sends a user information query request to the backend; According to the user information query request, the backend determines whether the training participant is training the task to be performed for the first time; If the training participant is training the task to be executed for the first time, the backend returns the global training strategy, global encryption model, local training container image and container configuration file corresponding to the task to be executed to the training participant; The training participant deploys a local training container according to the received local training container image and container configuration file, and saves the global training strategy; The training participant imports the global encrypted model into the local training container, trains the global encrypted model according to the global training strategy, and obtains the local model; Through the local model uploading interface, the training participant uploads the local model to the backend.

2. The asynchronous federated learning method with front-end and back-end separation according to claim 1 is characterized in that: The method further comprises: After the backend receives the service request information, the backend records the service request information in a backend database; The backend sends a response message to the service user, declaring the response message as an information flow; According to the response information, the service user updates the front-end interface; After receiving the usage status, the information flow channel is closed, and a pop-up window prompt or a local service request button is provided on the front-end interface; Wherein, the local service button is an interface button for sending the local service request to the backend.

3. The asynchronous federated learning method with front-end and back-end separation according to claim 1 is characterized in that: The method further comprises: According to the local service request, the backend sends the local computing container image and the container configuration file to the service user; The service user deploys a local computing container according to the local computing container image and container configuration file; The step in which the service user receives the global model and performs local service calculation to obtain the service calculation result is specifically as follows: The global model is imported into the local computing container, and the local computing container is run to obtain the service computing result.

4. The asynchronous federated learning method with front-end and back-end separation according to any one of claims 1 to 3, It is characterized in that The method further comprises: When the evaluation fails, the backend receives the new local model, updates the global model according to the new local model, and re-evaluates the updated global model.

5. A system for implementing the asynchronous federated learning method with front-end and back-end separation as described in any one of claims 1 to 4, characterized in that: Including front-end and back-end: The front end and the back end exchange data in the form of an interface; The front end includes a service user terminal, a training participant terminal and a system administrator terminal; The backend includes a service user module, a training participant module and a system administrator module; The service user terminal is used for the service user to call the service user module; The service user module is used to send service request information of the service to be trained to the backend, and to send a local service request to the backend, and to perform local service calculation; The training participant terminal is used for the training participant to call the training participant module; The training participant module is used to train the local model according to the training notification sent by the back end, and to upload the trained local model to the back end; The system manager module is used for the system manager to call the system manager module; The system manager module is used to set a global training strategy for the service to be trained, and is used to send the global training strategy to the backend.

6. The asynchronous federated learning system with front-end and back-end separation according to claim 5 is characterized in that: The interface communication mechanism of the system includes an immediate response mode and an asynchronous processing mode.

7. The asynchronous federated learning system with front-end and back-end separation according to any one of claims 5 to 6, It is characterized in that The front end also includes a universal terminal, and the back end also includes a universal function module; The universal terminal is used for the user to call the universal function module; The general function module is used to provide at least one function of user registration and login, interface resource response, database management, data statistical processing and data encryption and decryption.

8. An asynchronous federated learning device with front-end and back-end separation, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the asynchronous federated learning method with front-end and back-end separation as described in any one of claims 1 to 4.

9. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the asynchronous federated learning method with front-end and back-end separation as described in any one of claims 1 to 4 when executed by the processor.

Citation Information

Patent Citations

  • Edge computing-oriented federated learning method

    CN111708640A

  • Equipment evaluation and federated learning importance aggregation method, system and equipment based on edge intelligence and readable storage medium

    CN112181666A