Method and device for generating multi-layer federated learning architecture and method and device for model training based on multi-layer federated learning architecture

By adopting a multi-layer federated learning architecture in federated learning, dispersing model aggregation tasks and processing pressure, the problems of single point failure and performance bottlenecks in traditional architectures are solved, and higher robustness and scalability are achieved.

CN119849598APending Publication Date: 2025-04-18IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411853685.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the federated learning scenario where large-scale participants participate, traditional federated learning architectures are prone to single point failure problems, and when the number of participants increases significantly, the processing pressure of the central node increases, which easily leads to performance bottlenecks.

Method used

Using a multi-layer federated learning architecture, we use multiple first-level clusters, elect the underlying central nodes, and iterate the intermediate and top-level central nodes to distribute model aggregation tasks, reduce the risk of single-point failure, and disperse the processing pressure in the cloud.

Benefits of technology

By completing model aggregation operations in a hierarchical order, the risk of system interruption caused by single point failure is reduced, and the processing pressure is dispersed when the number of participants increases, which improves the robustness and scalability of the system and enables federated learning to be carried out efficiently in a mobile ad hoc network environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849598A_ABST
    Figure CN119849598A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of federated learning, and provides a multi-layer federated learning architecture generation method and device, and a model training method and device based on the multi-layer federated learning architecture, and the method comprises the steps: obtaining a plurality of first-level clusters generated based on the division of a plurality of participants, and electing a bottom-layer center node from each first-level cluster; obtaining a plurality of second-level clusters generated by dividing the bottom-layer center node, and electing a center node from each second-level cluster to obtain a middle-layer center node; obtaining a plurality of third-level clusters divided by the middle-layer center node, electing a center node from the third-level clusters, and carrying out layer-by-layer iteration to obtain a top-layer center node; the middle-layer center node aggregates the model parameters of the middle-layer participants and distributes global model parameters; and the top-layer center node updates the global model parameters and issues the global model parameters to the middle-layer center node. According to the method, model aggregation operation is sequentially completed in a layered mode, a single center node is prevented from undertaking all aggregation tasks, and the system interruption risk caused by single-point faults is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular to the generation of a multi-layer federated learning architecture, and a model training method and device based on the multi-layer federated learning architecture. Background Art

[0002] Federated learning is a distributed machine learning method. Traditional federated learning usually adopts a "cloud-participant" architecture: participants perform model training based on the initial model and local data. After the training is completed, each participant uploads the locally updated model parameters to the service provider's central node for model aggregation. After aggregation, the central node generates a new global model and sends it to all participants for the next round of training.

[0003] However, in federated learning scenarios involving large numbers of participants, this traditional architecture may have problems, and the central node may have a single point of failure problem: the central node is the key link in model aggregation, and once a failure occurs, the entire training process will be interrupted. In addition, when the number of participants increases significantly, the processing pressure of the central node also increases, which can easily lead to performance bottlenecks. Summary of the invention

[0004] The present invention provides a method and device for generating a multi-layer federated learning architecture, and a model training method based on the multi-layer federated learning architecture, so as to solve the problem in the prior art that the central node of federated learning is the key link of model aggregation. Once a failure occurs, the entire training process will be interrupted, and when the number of participants increases significantly, the processing pressure of the central node also increases, which can easily lead to performance bottlenecks.

[0005] The present invention provides a method for generating a multi-layer federated learning architecture, comprising the following steps: Acquire multiple first-level clusters generated based on the division of multiple participants, and select a bottom-level central node from each of the first-level clusters; Acquire multiple secondary clusters generated based on the division of the bottom central node, select a central node from each of the secondary clusters, and obtain a middle-layer central node; Acquire multiple three-level clusters generated based on the division of the middle-layer central node, select central nodes from the three-level clusters respectively, and iterate layer by layer to acquire the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

[0006] According to a method for generating a multi-layer federated learning architecture provided by the present invention, the middle-layer participant monitors the first state of the middle-layer central node, and when the first state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the middle-layer central node according to the central node link; the central node link stores central nodes at all levels in the form of a multi-branch tree; The bottom-level participant monitors the second state of the bottom-level central node, and when the second state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the bottom-level central node according to the central node link.

[0007] The present invention also provides a model training method based on a multi-layer federated learning architecture, comprising: Receive a first model parameter sent by a middle-layer central node, where the first model parameter is obtained by the middle-layer central node aggregating iterative parameters of the middle-layer participants, and the iterative parameters are obtained by the bottom-layer participants iterating the second model parameters based on local sample data; Based on the first model parameters, updating the second model parameters; Send the updated second model parameters to the middle layer central node, so that the middle layer central node sends the updated second model parameters to the bottom layer central node of the bottom layer participant, and the bottom layer central node sends the updated second model parameters to the bottom layer participant, and the bottom layer participant performs parameter iteration on the updated second model parameters based on the local sample data to obtain the updated first model parameters and returns them until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0008] According to a model training method based on a multi-layer federated learning architecture provided by the present invention, the step of determining the first model parameter includes: Determine a target aggregation threshold, a hysteresis tolerance limit, a first cache area, and a second cache area of ​​the intermediate layer central node; Receiving the model update quantity and model version number sent by the bottom-level participant, and determining the model lag round based on the model version number; Comparing the model update quantity with the target aggregation threshold, and comparing the model hysteresis rounds with the hysteresis tolerance limit, to determine a first iteration parameter corresponding to the first cache area, and a second iteration parameter corresponding to the second cache area; The first model parameter is determined based on the first iteration parameter and the second iteration parameter.

[0009] According to a model training method based on a multi-layer federated learning architecture provided by the present invention, the step of determining a target aggregation threshold of the central node in the intermediate layer includes: Determining an initial aggregation threshold, a total number of second updates received by the second cache area, and an aggregation duration; The target aggregation threshold is determined based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration.

[0010] According to a model training method based on a multi-layer federated learning architecture provided by the present invention, determining the target aggregation threshold based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration includes: Determine whether the current federation round is a first threshold, and if the current federation round is the first threshold, determine that the target aggregation threshold is the initial aggregation threshold; If the current federal round is not the first threshold, determine whether the second total number of updates is zero; if the second total number of updates is not zero, determine the target aggregation threshold based on the first total number of updates received by the first cache area and the second total number of updates; if the second total number of updates is zero and the aggregation duration is greater than or equal to the aggregation timeout duration, determine the target aggregation threshold to be the first total number of updates; if the aggregation duration is less than the aggregation timeout duration, determine the target aggregation threshold to be half of the first total number of updates.

[0011] According to a model training method based on a multi-layer federated learning architecture provided by the present invention, the initial aggregation threshold is determined based on the number of participants in the first federated learning.

[0012] The present invention also provides a model training method based on a multi-layer federated learning architecture, comprising: Perform parameter iteration on the second model parameter based on the local sample data to obtain the iteration parameter, and send the iteration parameter to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iteration parameter and sends it to the middle-level central node of the middle-level participant, and the first model parameter after the iteration parameter is aggregated is sent to the service provider through the middle-level central node, and the service provider updates the second model parameter based on the first model parameter; Receiving the updated second model parameters returned by the service provider, and performing parameter iteration on the updated second model parameters based on the local sample data until model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0013] According to a model training method based on a multi-layer federated learning architecture provided by the present invention, the intermediate layer central node merges the training progress of its own node and the first model parameters and sends them to the service provider; The bottom layer central node merges the training progress of its own node and the second model parameters and sends the result to the middle layer central node.

[0014] The present invention also provides a device for generating a multi-layer federated learning architecture, comprising the following units: A first election unit is used to obtain multiple first-level clusters generated based on the division of multiple participants, and respectively elect a bottom-level central node from each of the first-level clusters; A second election unit is used to obtain multiple secondary clusters generated based on the division of the bottom central node, and respectively elect a central node from each of the secondary clusters to obtain a middle-layer central node; A third election unit is used to obtain multiple three-level clusters generated based on the division of the middle-layer central node, respectively elect central nodes from the three-level clusters, and iterate layer by layer to obtain the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

[0015] The present invention also provides a model training device based on a multi-layer federated learning architecture, comprising: A first receiving unit is used to receive a first model parameter sent by an intermediate layer central node, where the first model parameter is obtained by the intermediate layer central node aggregating iterative parameters of the intermediate layer participants, and the iterative parameters are obtained by the lowest layer participants performing parameter iteration on the second model parameters based on local sample data; A first updating unit, configured to update the second model parameter based on the first model parameter; A model training unit, used for sending the updated second model parameters to the middle layer central node, so that the middle layer central node sends the updated second model parameters to the bottom layer central node of the bottom layer participant, and the bottom layer participant sends the updated second model parameters to the bottom layer participant through the bottom layer central node, and the bottom layer participant performs parameter iteration on the updated second model parameters based on the local sample data to obtain the updated first model parameters and returns them until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0016] The present invention also provides a model training device based on a multi-layer federated learning architecture, comprising: A second updating unit is used to perform parameter iteration on the second model parameter based on the local sample data to obtain the iteration parameter, and send the iteration parameter to the bottom central node of the lowest-level participant, so that the bottom central node aggregates the iteration parameter and sends it to the middle-layer central node of the middle-layer participant, and the first model parameter after the iteration parameter is aggregated is sent to the service party through the middle-layer central node, and the service party updates the second model parameter based on the first model parameter; A second receiving unit, configured to receive the updated second model parameters returned by the service provider, and perform parameter iteration on the updated second model parameters based on the local sample data until model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0017] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements a method for generating a multi-layer federated learning architecture as described in any one of the above, or implements a model training method based on a multi-layer federated learning architecture as described in any one of the above.

[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements a method for generating a multi-layer federated learning architecture as described in any one of the above, or implements a model training method based on a multi-layer federated learning architecture as described in any one of the above.

[0019] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements a method for generating a multi-layer federated learning architecture as described in any one of the above, or implements a model training method based on a multi-layer federated learning architecture as described in any one of the above.

[0020] The generation of a multi-layer federated learning architecture, a model training method and a device based on the multi-layer federated learning architecture provided by the present invention, on the one hand, avoid a single central node from taking on all aggregation tasks by completing the model aggregation operations in layers and in sequence, thereby reducing the risk of system interruption caused by a single point of failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks, thereby constructing a multi-layer federated learning architecture that is not completely dependent on the cloud, so that federated learning can be carried out efficiently in a mobile ad hoc network environment, while having good scalability and fault tolerance. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 It is a flowchart of the method for generating a multi-layer federated learning architecture provided by the present invention.

[0023] Figure 2 It is a schematic diagram of the multi-layer federated learning architecture provided by the present invention.

[0024] Figure 3 It is a schematic diagram of the dynamic transmission of model parameters provided by the present invention.

[0025] Figure 4 It is one of the flow charts of the model training method based on the multi-layer federated learning architecture provided by the present invention.

[0026] Figure 5 This is the second flow chart of the model training method based on the multi-layer federated learning architecture provided by the present invention.

[0027] Figure 6 It is a structural schematic diagram of a generation device of a multi-layer federated learning architecture provided by the present invention.

[0028] Figure 7 It is one of the structural schematic diagrams of the model training device based on the multi-layer federated learning architecture provided by the present invention.

[0029] Figure 8 This is the second structural schematic diagram of the model training device based on the multi-layer federated learning architecture provided by the present invention.

[0030] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type.

[0033] Figure 1 is a flow chart of a method for generating a multi-layer federated learning architecture provided by the present invention, Figure 2 is a schematic diagram of the multi-layer federated learning architecture provided by the present invention, such as Figure 1 , Figure 2 As shown, the method includes step 110 , step 120 and step 130 .

[0034] Step 110, obtaining multiple first-level clusters generated based on the division of multiple participants, and selecting a bottom-level central node from each of the first-level clusters; Step 120, obtaining multiple secondary clusters generated based on the division of the bottom central node, and selecting a central node from each of the secondary clusters to obtain a middle-layer central node; Step 130, obtaining multiple three-level clusters generated based on the division of the middle-layer central nodes, selecting central nodes from the three-level clusters respectively, and iterating layer by layer to obtain the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

[0035] Specifically, in large-scale federated learning scenarios, traditional federated learning usually relies on a central node (usually the cloud) to complete model aggregation. In the embodiment of the present invention, a multi-layer federated learning architecture is generated layer by layer, and the model aggregation task will be jointly undertaken by entities at multiple levels, such as Figure 2As shown in the figure, in this multi-layer federated learning architecture, the multi-layer federated learning architecture can be composed of N levels. The entities at the bottom layer are responsible for performing local training of the model. These entities have certain computing power and data resources and can be trained based on the initial model. The top-level entity, that is, the top-level central node (service provider), is responsible for completing the aggregation and distribution of the global model. Each entity in the middle layer is responsible for collecting and aggregating model parameters from its subordinate levels; in addition, for the middle-layer entities with computing power and data, they are not only responsible for aggregation, but also can participate in local model training, and upload the training results to the upper-level entity after integrating the training progress of the current node. Through this hierarchical architecture, the aggregation tasks can be dispersed and the overall robustness and scalability of the system can be improved.

[0036] It should be noted that the above-mentioned entities include participants and service parties. The participants can be clients, and the participants include at least 2 clients. The service party can be a cloud, and here, there is only one cloud.

[0037] The embodiment of the present invention introduces the design of lightweight federated learning, which improves the way in which model aggregation is handled by the cloud in the traditional federated learning architecture. In the embodiment of the present invention, the task of model aggregation is no longer completely dependent on the cloud, but can be completed by the participants in federated learning, that is, each client. This means that federated learning can build a mobile ad-hoc network (MANET) without cloud support, and perform model training within the network on this basis. At the same time, through the coordination of higher-level central nodes (such as the cloud), model training and aggregation can be performed on a larger scale.

[0038] In order to realize the formation of a federated learning network that does not rely on the cloud, the embodiment of the present invention proposes a multi-level distributed network self-organization algorithm. The algorithm realizes flexible model training and aggregation structure by autonomously organizing the connection of the federated training network by the participants, and can effectively allocate computing resources and aggregation tasks among the participants. The specific implementation steps of the pseudo code of Algorithm 1 are as follows: In this algorithm, multiple clusters generated by the division of multiple participants are first obtained. The participants in each cluster collaborate through a distributed algorithm to form a cross-regional federated learning architecture. In each cluster, the participants select a central node through an election mechanism to be responsible for model aggregation and management within the cluster. First, each participant decides whether to participate in the central node election in the cluster. The participants who participate in the election will be regarded as candidates. These candidates need to send heartbeat signals to other participants to inform them of their participation in the election. In this way, the participants can understand each other and determine whether to participate in the election. During the election process, the participants in each cluster can select a final central node according to a specific election strategy. For example, the "oldest" election strategy in the Bully algorithm is adopted, that is, the participant's ID is used as the election basis, and the participant with the largest ID is selected as the central node. After the election is completed, each cluster forms a traditional "center-client" federated learning architecture. That is, first obtain multiple first-level clusters generated based on the division of multiple participants, and select the bottom-level central node from each first-level cluster, and use the bottom-level central node as the central node of the bottom-level participant of the multi-layer federated learning architecture. The bottom-level central node is used to aggregate the model parameters of the bottom-level participant and distribute the model parameters issued by the middle-level central node.

[0039] In order to achieve cross-cluster federated learning, the central nodes of multiple clusters are again elected through the same election mechanism to select higher-level central nodes. That is, multiple secondary clusters generated based on the division of the underlying central nodes are obtained, and central nodes are elected from each secondary cluster to obtain the middle-layer central nodes. The middle-layer central nodes are used as the central nodes of the middle-layer participants of the multi-layer federated learning architecture. The middle-layer central nodes are used to aggregate the model parameters of the middle-layer participants and distribute the global model parameters issued by the service provider.

[0040] This process will continue until a multi-level federated learning architecture is formed. That is, multiple three-level clusters generated based on the division of the middle-level central nodes are obtained, and the central nodes are selected from the three-level clusters respectively, and the top-level central nodes are obtained layer by layer, and the top-level central nodes are used as the service party of the multi-level federated learning architecture. The top-level central nodes are used to update the global model parameters and send the updated global model parameters to the middle-level central nodes.

[0041] That is, in this multi-layer federated learning architecture, the central node is not only responsible for aggregating and issuing model parameters, but also has computing and data resources to undertake the tasks of model training and aggregation, thereby achieving efficient training and aggregation on a global scale.

[0042] It should be noted that, when there are multiple middle-layer central nodes, the global model parameters issued by the middle-layer central node distribution service provider are executed by the top-level middle-layer central node under the service provider.

[0043] Through this multi-level distributed network self-organizing algorithm, that is, the method for generating a multi-layer federated learning architecture in an embodiment of the present invention, it is possible to flexibly construct a multi-layer federated learning architecture that is not completely dependent on the cloud, so that federated learning can be carried out efficiently in a mobile ad hoc network environment while having good scalability and fault tolerance.

[0044] The method provided by the embodiment of the present invention is that the multi-layer federated learning architecture is composed of the bottom-level participants, the bottom-level central node, the middle-level participants, the middle-level central node and the service party. The bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node. The middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters. The top-level central node is the service party of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node. On the one hand, by completing the model aggregation operation in layers in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by a single point of failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks, thereby constructing a multi-layer federated learning architecture that is not completely dependent on the cloud, so that federated learning can be carried out efficiently in a mobile ad hoc network environment, while having good scalability and fault tolerance.

[0045] Furthermore, in the multi-layer federated learning architecture of the embodiment of the present invention, the model parameters need to be transmitted sequentially between the layers, that is, each layer completes the aggregation by collecting model parameters from lower-level entities and uploads the results to higher-level entities. However, traditional federated learning assumes that the cloud and the client will not be disconnected or exit the network during the entire training process, so the entire federated learning process can be completed smoothly. But in actual situations, the client and the cloud may exit the current network at any time due to failures, network fluctuations, or changes in spatial position, which will have an adverse effect on the training effect of federated learning.

[0046] This problem also exists in the multi-level federated learning architecture proposed in the embodiment of the present invention, because these elected central nodes may also exit the current network without completing the federated learning task, resulting in the interruption of the training process or the failure of model aggregation.

[0047] In order to solve this problem, an embodiment of the present invention proposes a model parameter dynamic transmission algorithm to cope with the situation where the central node is offline.

[0048] Based on the above embodiment, the middle-layer participant monitors the first state of the middle-layer central node, and when the first state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the middle-layer central node according to the central node link; the central node link stores central nodes at all levels in the form of a multi-branch tree; The bottom-level participant monitors the second state of the bottom-level central node, and when the second state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the bottom-level central node according to the central node link.

[0049] Specifically, Figure 3 is a schematic diagram of the dynamic transmission of model parameters provided by the present invention, such as Figure 3 As shown, during the model parameter transmission and aggregation process, when it is found that the central node of a certain level is offline or exits the network, the responsibility of the node is immediately transferred to the node of a higher level or other backup nodes through the protocol.

[0050] Specifically, the middle-layer participants monitor the first state of the middle-layer central node, and when the first state is offline or unconnectable, immediately trigger the model parameter transfer mechanism to save the unfinished model parameters to the upper-level central node of the middle-layer central node according to the central node link. The central node link stores central nodes at all levels in the form of a multi-branch tree.

[0051] The lowest-level participant monitors the second state of the bottom-level central node, and when the second state is offline or unconnectable, immediately triggers the model parameter transfer mechanism to save the unfinished model parameters to the upper-level central node of the bottom-level central node according to the central node link.

[0052] Here, the offline state usually refers to the process in which the network connection between the participant and the central node has been established and is in use, and the connection is suddenly interrupted due to some reason (such as network fluctuations, equipment failure, etc.), resulting in the inability to continue to use the connection for data transmission or communication.

[0053] Here, the unconnectable state refers to the situation where when a participant attempts to establish a network connection with the central node, the connection cannot be successfully established due to network problems, device setting errors, server unavailability, etc.

[0054] It should be noted that in order to make this solution efficient, all participants in the embodiment of the present invention will save their links to the top-level central node, so that the model parameters can be quickly transferred after their corresponding central node goes offline.

[0055] In addition, for the top-level central node, that is, the service provider, once a failure occurs and it is unable to continue to participate in the federated learning aggregation, the solution for dynamic transmission of model parameters cannot be solved. The embodiment of the present invention performs the election shown in Algorithm 1 on the second-level intermediate layer participants to re-determine a new top-level central node.

[0056] It is understandable that in order to deal with the possible disconnection of the central node, the embodiment of the present invention designs a cross-level model transmission mechanism: when the upper central node of the current level fails, the system will automatically upgrade the current entity to a higher level and upload the model parameters to the upper level node to complete the aggregation. This effectively improves the robustness and reliability of the multi-layer federated learning architecture, making it more stable and efficient in scenarios involving large-scale participants.

[0057] In the method provided by the embodiment of the present invention, the middle-layer participants monitor the first state of the middle-layer central node, and when the first state is an offline state or an unconnectable state, the unfinished model parameters are saved to the upper-level central node of the middle-layer central node according to the central node link; the bottom-level participants monitor the second state of the bottom-level central node, and when the second state is an offline state or an unconnectable state, the unfinished model parameters are saved to the upper-level central node of the bottom-level central node according to the central node link. This avoids the central node of a certain level from being offline or exiting the network during the model parameter transmission and aggregation process, and improves the robustness of federated learning.

[0058] On the basis of the above-mentioned embodiment, that is, after the multi-layer federated learning architecture is generated, model training can be performed based on the multi-layer federated learning architecture.

[0059] Based on the above embodiments, the present invention provides a model training method based on a multi-layer federated learning architecture. The method is applied to a service provider in a multi-layer federated learning architecture. The service provider may specifically be a central server. Figure 4 This is one of the flow charts of the model training method based on the multi-layer federated learning architecture provided by the present invention, such as Figure 4 As shown, the method includes: Step 410, receiving a first model parameter sent by a middle-layer central node, wherein the first model parameter is obtained by the middle-layer central node aggregating iterative parameters of the middle-layer participants, and the iterative parameters are obtained by the bottom-layer participants iterating the second model parameters based on local sample data; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0060] Specifically, in each round of iteration of federated learning, the service provider sends the second model parameter, that is, the service provider model parameter, to the middle layer central node, and the middle layer central node sends the second model parameter to the lowest-level participant. The lowest-level participant performs parameter iteration on the second model parameter based on the local sample data, and obtains the iteration parameter after the iteration is completed. Among them, the first model parameter is obtained by aggregating the iteration parameters of the middle-level participants by the middle-layer central node. The first model parameter is the model parameter of the participant after the parameter iteration is completed. In other words, the second model parameter is the model parameter of the participant before model training, and the first model parameter is the model parameter of the participant after model training.

[0061] Then, the lowest-level participant sends the iterative parameters obtained after model training based on local sample data to the middle-layer central node. The middle-layer central node aggregates the iterative parameters of the middle-layer participants to obtain the first model parameters, and the service provider receives the first model parameters sent by the middle-layer central node.

[0062] That is, the central node in the middle layer is not only responsible for aggregating iterative parameters and issuing the second model parameters, but also has computing and data resources to undertake the tasks of model training and aggregation, thereby achieving efficient training and aggregation on a global scale.

[0063] It should be noted that when the service provider sends the second model parameters to the participants, it does not necessarily send them to all the participants. For example, the service provider can send all the parameters to some of the participants, or to all the participants. The choice can be flexible as needed, and the embodiment of the present invention does not specifically limit this.

[0064] Step 420: Update the second model parameters based on the first model parameters.

[0065] Specifically, after receiving the first model parameters sent by the middle layer central node, the service provider aggregates the first model parameters sent by the middle layer central node, and updates the second model parameters based on the aggregated model parameters.

[0066] Step 430, sending the updated second model parameters to the middle-layer central node, so that the middle-layer central node sends the updated second model parameters to the bottom-level central node of the bottom-level participant, and the bottom-level participant sends the updated second model parameters to the bottom-level participant through the bottom-level central node, and the bottom-level participant iterates the updated second model parameters based on the local sample data to obtain the updated first model parameters and returns them until the model training is completed.

[0067] Specifically, the service provider sends the updated second model parameters to the middle-layer central node, so that the middle-layer central node sends the updated second model parameters to the bottom-level central node of the bottom-level participant, and the bottom-level participant iterates the updated second model parameters based on local sample data to obtain the updated first model parameters and returns them until the model training is completed.

[0068] The condition for completing the model training here may be that the local models of each participant have converged, or that a preset number of iterations has been reached, and the embodiment of the present invention does not specifically limit this.

[0069] It can be understood that when there are multiple middle-layer central nodes, the second model parameter issued by the middle-layer central node distribution service provider is executed by the top-level middle-layer central node under the service provider, and the first model parameter received by the service provider is also sent by the top-level middle-layer central node.

[0070] The method provided by the embodiment of the present invention receives the first model parameter sent by the middle layer central node, the first model parameter is obtained by the middle layer central node aggregating the iterative parameters of the middle layer participants, and the iterative parameter is obtained by the bottom-level participants performing parameter iteration on the second model parameter based on local sample data; then based on the first model parameter, the second model parameter is updated, and finally, the updated second model parameter is sent to the middle layer central node, so that the middle layer central node sends the updated second model parameter to the bottom-level participants, and the bottom-level participants perform parameter iteration on the updated second model parameter based on local sample data to obtain the updated first model parameter and return it until the model training is completed. On the one hand, by completing the model aggregation operation in layers and in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by single point failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks.

[0071] In the related technology, in the federated learning scenario with large-scale client participation, this traditional architecture has the problem of synchronous training: traditional federated learning usually adopts synchronous training, and each round of model aggregation needs to wait for all clients to upload local models. In this way, clients with slower training speed will slow down the global aggregation process, limiting the overall training efficiency, and the system is susceptible to network instability factors.

[0072] In order to solve the problem of single point failure of central nodes, existing solutions mainly rely on asynchronous improvement methods. For example, fully asynchronous federated learning achieves model training and aggregation by eliminating the dependence on central nodes and reaching model consensus among distributed clients. This method allows each client to conduct local training independently, and through direct model parameter exchange or consensus protocol, it reduces the dependence on central nodes, improves the fault tolerance of the system, and avoids system crashes caused by single point failures.

[0073] To address the issues of client disconnection or slow training speed, existing solutions mostly adopt a semi-asynchronous federated learning strategy. In this strategy, the central node sets an aggregation threshold, and global aggregation is triggered only when a certain number of clients upload model parameters, avoiding delays caused by waiting for all clients to upload models. On the other hand, there are also solutions that selectively receive model parameters from some clients to reduce the waiting time for global aggregation, thereby accelerating the training process. This method improves the training efficiency of the system by flexibly adjusting the aggregation strategy, especially when there are a large number of participating clients or the network conditions are unstable, which can effectively reduce the burden of synchronous waiting.

[0074] Existing asynchronous federated learning solutions are mainly divided into fully asynchronous federated learning and semi-asynchronous federated learning. In fully asynchronous federated learning, model aggregation relies on the consensus of model parameters between distributed clients, without the need for central nodes to participate in aggregation. Generally, fully asynchronous federated learning adopts a distributed consensus algorithm. Although this effectively avoids the single point failure problem of the central node, the frequent exchange of model parameters between clients will bring a large communication burden. Especially in the case of large-scale client participation, the communication bottleneck is more obvious, affecting the training efficiency. Semi-asynchronous federated learning sets an aggregation threshold to avoid waiting for all clients to upload model updates, thereby reducing the time consumption of global aggregation. Although this method improves training efficiency to a certain extent, there is usually no mechanism for dynamically adjusting the aggregation threshold in existing semi-asynchronous solutions. In the scenario of dynamically changing federated learning, fixed thresholds may lead to problems such as waste of model progress.

[0075] Based on the above problem, the step of determining the first model parameter includes: Step 210, determining a target aggregation threshold, a hysteresis tolerance limit, a first buffer area, and a second buffer area of ​​the intermediate layer central node; Step 220, receiving the model update quantity and model version number sent by the bottom-level participant, and determining the model lag round based on the model version number; Step 230, comparing the model update quantity and the target aggregation threshold, and comparing the model hysteresis rounds and the hysteresis tolerance limit, to determine a first iteration parameter corresponding to the first cache area, and a second iteration parameter corresponding to the second cache area; Step 240: Determine the first model parameter based on the first iteration parameter and the second iteration parameter.

[0076] Specifically, considering that in traditional federated learning, a synchronous training mode is usually adopted. In this mode, all participants will perform local model updates in each round of federated training and upload the updated model parameters to the central node for aggregation. This requires the central node to wait for all participants to complete training and upload model parameters before the next round of model aggregation. However, the disadvantage of this synchronization method is that the time of the entire federated training process is determined by the client that takes the longest time. Even if other clients have completed training and are ready to upload model parameters, the central node still needs to wait for the slowest client to complete training, which affects the efficiency and speed of the overall training.

[0077] In order to alleviate the efficiency problems caused by the synchronous training method, the embodiment of the present invention adopts a semi-asynchronous training method. Each entity in the middle layer and the top layer maintains a dynamic aggregation threshold. Instead of blindly waiting for the model parameters uploaded by all participants, it decides whether to aggregate based on the threshold strategy, thereby speeding up the training process. In addition, the embodiment of the present invention introduces a two-level cache asynchronous aggregation scheme, which balances the differences in training speeds of the participants by rationally utilizing model updates and improves global aggregation efficiency.

[0078] The embodiment of the present invention proposes an asynchronous aggregation solution based on two-level cache, and the specific algorithm is as follows: In the embodiment of the present invention, model parameter updates are divided into several categories according to the number of lag rounds: the latest model parameters, model parameters that can be lagged by 1 round, model parameters that can be lagged by 2 rounds, ..., model parameters that can be lagged by N rounds. In order to maximize the contribution of local model parameter updates, each central node will set a tolerable number of lag rounds to determine which model parameter updates can participate in the aggregation of the global model.

[0079] Specifically, if the number of lag rounds that the central node can tolerate in the current training is 1, then if a participating client is training slowly but can still complete the upload before the second round of federated learning aggregation, the client's update can still participate in the update of the global model. In this way, even if the client's update lags behind by 1 round, as long as it completes the upload within the specified round, it can continue to contribute to the global model. However, for local updates that lag behind for more rounds, these updates will be rejected from participating in global aggregation. Because these updates are already too far away from the global training progress and cannot effectively reflect the current state of the global model, continuing to accept these updates with more lags may interfere with global training or affect the aggregation quality. Therefore, only updates within the set lag round range will be allowed to participate in aggregation. Through this mechanism, the system can ensure the timeliness of local updates while avoiding training deviations caused by too many delayed updates, effectively improving the overall efficiency and stability of federated learning.

[0080] In order to implement this method, each central node will set up two cache areas: the first cache area Cache1 and the second cache area Cache2, which are used to store the latest model parameters and the lagged model parameters respectively. Every time the local model parameter update is received, the central node will compare the difference in model versions, determine the model lag round based on the model version number, and decide which cache area to store the model parameters according to the updated model lag round situation.

[0081] That is, the above process first determines the target aggregation threshold of the central node in the middle layer K , Tolerance limit of hysteresis , a first cache area Cache1 and a second cache area Cache2.

[0082] Then, the middle-layer central node receives the number of participant updates and the model version number sent by the lowest-level participants, and determines the model lag round based on the model version number.

[0083] Furthermore, the model update quantity and the target aggregation threshold are compared, and the model lag rounds and the lag tolerance limit are compared to determine the first iteration parameter corresponding to the first cache area and the second iteration parameter corresponding to the second cache area.

[0084] Specifically, if the number of model updates received by the central node does not exceed the target aggregation threshold K , and the model update belongs to the latest model parameters of the current round, then the update will be uploaded to Cache1; if the update exceeds K , but it is still within the tolerable lag range, that is, the model lag does not exceed , the model will be uploaded to Cache2; once the number of model updates received exceeds the maximum tolerable lag round number set by the system (i.e., exceeds the lag tolerance limit ), the update will be rejected by the central node, and the participant corresponding to the model update will be marked, indicating that the update progress of the participant is too late. The next time the model is issued, the system will forcibly overwrite the models of these lagging participants and force them to update to the latest version to ensure that they can keep up with the progress of global training. Among them, the strategy for uploading the first model parameters is shown in the following formula: in, Indicates the first buffer The current number of model updates received, represents the model lag round, represents the target aggregation threshold, Indicates the tolerance limit for hysteresis.

[0085] When the central node aggregates the model parameters, it will perform weighted aggregation on the model parameters in Cache1 and Cache2 according to the source and lag of the model. The formula for weighted aggregation is as follows: in, is the aggregated model parameter, that is, the first model parameter, represents the first iteration parameter, represents the second iteration parameter, and It is the weighting coefficient, which can be customized according to the model performance.

[0086] It should be noted that the above-mentioned model parameter determination method is applicable to any central node, that is, it can be a bottom-layer central node or a middle-layer central node, and will not be described in detail here.

[0087] The method provided by the embodiment of the present invention introduces an asynchronous aggregation scheme based on two-level cache. Under the premise of ensuring normal model aggregation, it receives as many model updates from local participants as possible. These updates will participate in the subsequent aggregation process, thereby improving the update frequency and training efficiency of model training.

[0088] Based on the above embodiment, determining the target aggregation threshold of the intermediate layer central node in step 210 includes: Step 211, determining an initial aggregation threshold, a total number of second updates received by the second cache area, and an aggregation duration; Step 212: Determine the target aggregation threshold based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration.

[0089] Specifically, since the participants in each round of federated learning are uncertain in a dynamically changing scenario, the target aggregation threshold of the central node should be updated in time with the training environment. As for the setting of the target aggregation threshold, it is believed in the embodiment of the present invention that a dynamic aggregation threshold should be used for setting. Specifically, when the disconnection frequency of the participants changes, the central node will dynamically adjust the aggregation threshold according to the actual situation. If in a certain round, the training progress of most participants is relatively synchronized, and there are fewer disconnected participants, the target aggregation threshold can be appropriately increased to allow more participants to participate in the aggregation. If the disconnection is frequent or the participation of the participants is uneven, the aggregation threshold will be appropriately reduced to reduce unnecessary waiting.

[0090] Specifically, first, determine the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration. The initial aggregation threshold is determined based on the number of participants in the first federated learning, and the formula for the initial aggregation threshold is as follows: in, represents the initial aggregation threshold, Represents the number of participants in the first federated learning.

[0091] Then, the target aggregation threshold is determined based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration.

[0092] Based on the above embodiment, step 212 includes: Step 2121, determining whether the current federation round is a first threshold, and if the current federation round is the first threshold, determining the target aggregation threshold to be the initial aggregation threshold; Step 2122: if the current federal round is not the first threshold, determine whether the second total number of updates is zero; if the second total number of updates is not zero, determine the target aggregation threshold based on the first total number of updates received by the first cache area and the second total number of updates; if the second total number of updates is zero and the aggregation duration is greater than or equal to the aggregation timeout duration, determine the target aggregation threshold to be the first total number of updates; if the aggregation duration is less than the aggregation timeout duration, determine the target aggregation threshold to be half of the first total number of updates.

[0093] Specifically, determine whether the current federal round is the first threshold. If the current federal round is the first threshold, determine that the target aggregation threshold is the initial aggregation threshold. Here, the first threshold is 1. It can be understood that when the current federal round is the first threshold, the current federal round is the first federal learning.

[0094] If the current federation round is not the first threshold, determine whether the second total update is zero. If the second total update is not zero, determine the target aggregation threshold based on the first total update and the second total update received by the first cache area; if the second total update is zero and the aggregation duration is greater than or equal to the aggregation timeout duration, determine the target aggregation threshold to be the first total update; if the aggregation duration is less than the aggregation timeout duration, determine the target aggregation threshold to be half of the first total update. The specific adaptive model aggregation threshold adjustment algorithm is as follows: That is, after the training starts, after each global aggregation is completed, the central node needs to be updated according to the number of models uploaded this time. When performing global aggregation, if the current Cache2 cache area has more latest model parameters, then it proves that the set target aggregation threshold is too small, so it is necessary to dynamically adjust based on the number of local updates in the two cache areas. In the embodiment of the present invention, K is adjusted to the sum of the number of Cache1 models and half of the number of Cache2 models. This is because the total number of model parameters uploaded in each round may change, so the embodiment of the present invention will adopt a conservative promotion strategy; and if Cache2 is empty during aggregation, it means that the target aggregation threshold set by the embodiment of the present invention is the same as the current number of model parameters actually uploaded. At the same time, it will be judged whether there is a timeout waiting situation for the global model aggregation, which means that the central node is waiting for the local update upload and has timed out. This situation may cause a lag or even failure in federated learning, so it is necessary to readjust the target aggregation threshold in the next round of training. That is, K needs to be reduced based on the number of Cache1 models. The embodiment of the present invention will set K to half of the current number of models uploaded in Cache1 to ensure the reduction of the target aggregation threshold; and if and , which means that the central node has not timed out, which means that K is set reasonably and remains unchanged in the next round of training. The formula is as follows: in, represents the target aggregation threshold, Indicates the first buffer The current number of model updates received, Indicates the first buffer The current number of model updates received, Indicates the aggregation duration. Indicates the aggregation timeout period.

[0095] The method provided by the embodiment of the present invention adopts an adaptive model aggregation threshold adjustment algorithm. The algorithm can dynamically adjust the target aggregation threshold according to the current participant uploading the model, thereby effectively improving the efficiency of global aggregation. Through this mechanism, the target aggregation threshold can be flexibly adjusted according to the actual training progress, avoiding the time waste of waiting for too many participants to upload, while ensuring the balance and efficiency of the aggregation process.

[0096] In summary, in order to solve the single point failure and synchronous training problems in the traditional federated learning architecture, the embodiment of the present invention transforms the traditional "cloud-client" architecture into a multi-level federated learning architecture by improving the training architecture of federated learning. In this architecture, the bottom-level entity is responsible for local training of the model and uploading model parameters to the upper level; the top-level entity is responsible for receiving model parameters from lower-level entities and performing aggregation and distribution tasks. Multi-level collaboration is formed between entities at each layer, which can not only complete model aggregation, but also perform local training when computing power and data are available, and upload the updated model to the upper-level entity.

[0097] It should be noted that the model based on the multi-layer federated learning architecture trained by the above method can be applied to various application fields such as smart terminals, smart transportation, smart medical care, autonomous driving, smart cities, etc. to achieve classification and recognition functions. The processing objects of the trained model based on the multi-layer federated learning architecture can be image samples, discrete data samples, text samples or voice samples, etc., which are not exhaustive here. Among them, the federated learning model can be any machine learning model, which can be specifically expressed as a neural network, a linear model or other types of machine learning models.

[0098] The following is an explanation of the model training process based on the multi-layer federated learning architecture in the medical field. Federated learning is a distributed training process involving multiple participants. The local data sources owned by different participants are mostly different, and the training data of each participant may need to be protected for privacy. For example, a hospital in a certain area needs to use federated learning to train an electrocardiogram-based disease classification model. First, collect patient data from different hospitals, including medical history, examination results, treatment plans, and efficacy. Then, clean, standardize, and encode the patient data to ensure data quality.

[0099] For each participant (hospital) model, you can choose a machine learning model suitable for recommending treatment options, such as decision trees, random forests, or neural networks. Initialize the model parameters and ensure that all hospitals participating in federated learning start with the same initial model.

[0100] Specifically, multiple first-level clusters generated based on the division of multiple participants (hospitals) can be obtained, and the bottom-level central node can be selected from each first-level cluster. Then, multiple second-level clusters generated based on the division of the bottom-level central node can be obtained, and the central node can be selected from each second-level cluster to obtain the middle-level central node. Finally, multiple third-level clusters generated based on the division of the middle-level central node can be obtained, and the central node can be selected from each third-level cluster. It is then iterated layer by layer to obtain the top-level central node.

[0101] It should be noted that the above election of the central node can be implemented through a distributed algorithm (such as the Bully algorithm), and the central node is responsible for the model aggregation and management of the cluster.

[0102] Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants (hospitals corresponding to the bottom level) and distribute the model parameters of the middle-level central nodes. The middle-level central nodes are used to aggregate the model parameters of the middle-level participants (hospitals corresponding to the middle level) and distribute the global model parameters. The top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central nodes.

[0103] Each hospital (participant) uses local data to train the initial model and generate model parameter updates. During the training process, hospitals may have different training speeds due to differences in data volume, computing power, or network conditions.

[0104] For the central nodes in the middle layer, a two-level cache asynchronous aggregation solution can be implemented, that is, two cache areas (Cache1 and Cache2) are set in the central nodes of each level to store the latest model parameters and lagged model parameters respectively. According to the number of lag rounds of model parameter updates, the updates are distributed to the corresponding cache areas. For model parameter updates within the tolerable number of lag rounds, they are allowed to participate in the aggregation of global model parameters.

[0105] Since the participants in each round of federated learning are uncertain in a dynamically changing scenario, the target aggregation threshold of the central node should be updated in time with the training environment. As for the setting of the target aggregation threshold, the embodiment of the present invention believes that a dynamic target aggregation threshold should be used for setting. That is, an adaptive model aggregation threshold adjustment algorithm is designed, that is, the target aggregation threshold is dynamically adjusted according to the situation of the current participant uploading the model. If in the current round, the training progress of most participants is relatively synchronized, and there are fewer participants who are offline, the target aggregation threshold can be appropriately increased. If the offline is frequent or the participation of the participants is uneven, the target aggregation threshold will be appropriately reduced.

[0106] Finally, the model is evaluated: the distributed model is evaluated in each hospital, using indicators such as accuracy and recall rate to evaluate the model, and the model evaluation results are fed back to the central node at the next level.

[0107] Model iteration: Feedback the evaluation results to the service provider, who will adjust the model parameters and training strategies. Repeat the above training, aggregation and distribution process until the model achieves satisfactory performance. Once the model training is completed and verified, the final model will be deployed to all hospitals for recommending treatment plans.

[0108] Through the above steps, a multi-layer federated learning architecture and asynchronous aggregation scheme can be used to efficiently train a machine learning model for recommending treatment plans while protecting the privacy of patient data.

[0109] Based on the above embodiments, the present invention provides a model training method based on a multi-layer federated learning architecture, which is applied to participants in a multi-layer federated learning architecture. Figure 5 This is the second flow chart of the model training method based on the multi-layer federated learning architecture provided by the present invention, such as Figure 5 As shown, the method includes: Step 510, iterating the second model parameters based on the local sample data to obtain iterated parameters, and sending the iterated parameters to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iterated parameters and sends them to the middle-level central node of the middle-level participant, and the first model parameters after the iterated parameters are aggregated are sent to the service provider through the middle-level central node, and the service provider updates the second model parameters based on the first model parameters; Step 520, receiving the updated second model parameters returned by the service provider, and performing parameter iteration on the updated second model parameters based on the local sample data until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0110] Specifically, in each round of iteration of federated learning, the lowest-level participant iterates the second model parameters based on local sample data to obtain iterative parameters, and sends the iterative parameters to the lowest-level central node of the lowest-level participant, so that the lowest-level central node aggregates the iterative parameters and sends them to the middle-level central node of the middle-level participant, and the first model parameters after the iterative parameters are aggregated are sent to the service provider through the middle-level central node.

[0111] Here, the second model parameter is the model parameter of the participant before model training, and the first model parameter is the model parameter of the participant after model training.

[0112] That is, the central node in the middle layer is not only responsible for aggregating iterative parameters and issuing the second model parameters, but also has computing and data resources to undertake the tasks of model training and aggregation, thereby achieving efficient training and aggregation on a global scale.

[0113] It should be noted that when the service provider sends the second model parameters to the participants, it does not necessarily send them to all the participants. For example, the service provider can send all the parameters to some of the participants, or to all the participants. The choice can be flexible as needed, and the embodiment of the present invention does not specifically limit this.

[0114] After receiving the first model parameters sent by the intermediate layer central node, the service provider aggregates the first model parameters sent by the intermediate layer central node, and updates the second model parameters based on the aggregated model parameters.

[0115] In the next round of iteration, the bottom layer receives the updated second model parameters returned by the service provider, and performs parameter iteration on the updated second model parameters based on the local sample data until the model training is completed.

[0116] The condition for completing the model training here may be that the local models of each participant have converged, or that a preset number of iterations has been reached, and the embodiment of the present invention does not specifically limit this.

[0117] It can be understood that when there are multiple middle-layer central nodes, the second model parameter issued by the middle-layer central node distribution service provider is executed by the top-level middle-layer central node under the service provider, and the first model parameter received by the service provider is also sent by the top-level middle-layer central node.

[0118] The method provided by the embodiment of the present invention performs parameter iteration on the second model parameter based on local sample data to obtain the iteration parameter, and sends the iteration parameter to the bottom central node of the lowest-level participant, so that the bottom central node aggregates the iteration parameter and sends it to the middle-layer central node of the middle-layer participant, and sends the first model parameter after the iteration parameter is aggregated to the service party through the middle-layer central node, and the service party updates the second model parameter based on the first model parameter; receives the updated second model parameter returned by the service party, and performs parameter iteration on the updated second model parameter based on the local sample data until the model training is completed. On the one hand, by completing the model aggregation operation in layers and in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by single point failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks.

[0119] Based on the above embodiment, the intermediate layer central node merges the training progress of its own node and the first model parameters and sends the result to the service provider; The bottom layer central node merges the training progress of its own node and the second model parameters and sends the result to the middle layer central node.

[0120] Specifically, the middle layer central node may fuse the training progress of its own node with the first model parameters and send the result to the service provider.

[0121] The bottom-level central node can fuse the training progress of its own node with the second model parameters and send them to the middle-level central node.

[0122] It is understandable that by aggregating and fusing model parameters at multiple levels, the data and learning results of nodes at different levels can be fully utilized. This distributed learning method helps to improve the accuracy and generalization ability of the overall model because each node can contribute unique perspectives and information to it.

[0123] The generation device of the multi-layer federated learning architecture provided by the present invention is described below. The generation device of the multi-layer federated learning architecture described below and the generation method of the multi-layer federated learning architecture described above can refer to each other.

[0124] Based on any of the above embodiments, the present invention provides a device for generating a multi-layer federated learning architecture. Figure 6 is a schematic diagram of the structure of a device for generating a multi-layer federated learning architecture provided by the present invention, such as Figure 6 As shown, the device comprises: A first election unit 610 is used to obtain multiple first-level clusters generated based on the division of multiple participants, and respectively elect a bottom-level central node from each of the first-level clusters; The second election unit 620 is used to obtain multiple secondary clusters generated based on the division of the bottom central node, and respectively elect a central node from each of the secondary clusters to obtain a middle-layer central node; The third election unit 630 is used to obtain multiple three-level clusters generated based on the division of the middle-layer central node, respectively elect central nodes from the three-level clusters, and iterate layer by layer to obtain the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

[0125] The device provided by the embodiment of the present invention, the multi-layer federated learning architecture is composed of the bottom-level participants, the bottom-level central node, the middle-level participants, the middle-level central node and the service side. The bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node. The middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters. The top-level central node is the service side of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node. On the one hand, by completing the model aggregation operation in layers in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by a single point of failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks, thereby constructing a multi-layer federated learning architecture that is not completely dependent on the cloud, so that federated learning can be carried out efficiently in a mobile ad hoc network environment, while having good scalability and fault tolerance.

[0126] Based on any of the above embodiments, the middle-layer participant monitors the first state of the middle-layer central node, and when the first state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the middle-layer central node according to the central node link; the central node link stores central nodes at all levels in the form of a multi-branch tree; The bottom-level participant monitors the second state of the bottom-level central node, and when the second state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the bottom-level central node according to the central node link.

[0127] The model training device of the multi-layer federated learning architecture provided by the present invention is described below. The model training device of the multi-layer federated learning architecture described below and the model training method of the multi-layer federated learning architecture described above can be referenced to each other.

[0128] Based on any of the above embodiments, the present invention provides a model training device based on a multi-layer federated learning architecture. Figure 7 is one of the structural diagrams of the model training device based on the multi-layer federated learning architecture provided by the present invention, such as Figure 7 As shown, the device comprises: A first receiving unit 710 is used to receive a first model parameter sent by a middle-layer central node, where the first model parameter is obtained by the middle-layer central node aggregating iterative parameters of the middle-layer participants, and the iterative parameters are obtained by the bottom-layer participants performing parameter iteration on the second model parameters based on local sample data; A first updating unit 720, configured to update the second model parameters based on the first model parameters; The model training unit 730 is used to send the updated second model parameters to the middle layer central node, so that the middle layer central node sends the updated second model parameters to the bottom layer central node of the bottom layer participant, and the bottom layer participant sends the updated second model parameters to the bottom layer participant through the bottom layer central node, and the bottom layer participant performs parameter iteration on the updated second model parameters based on the local sample data to obtain the updated first model parameters and return them until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0129] The device provided by the embodiment of the present invention receives the first model parameter sent by the middle layer central node, the first model parameter is obtained by the middle layer central node aggregating the iterative parameters of the middle layer participants, and the iterative parameter is obtained by the bottom-level participants performing parameter iteration on the second model parameter based on local sample data; then based on the first model parameter, the second model parameter is updated, and finally, the updated second model parameter is sent to the middle layer central node, so that the middle layer central node sends the updated second model parameter to the bottom-level participants, and the bottom-level participants perform parameter iteration on the updated second model parameter based on local sample data to obtain the updated first model parameter and return it until the model training is completed. On the one hand, by completing the model aggregation operation in layers and in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by single point failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks.

[0130] Based on any of the above embodiments, the invention further includes a first model parameter determination unit, wherein the first model parameter determination unit is specifically configured to: A target aggregation threshold determination unit, used to determine a target aggregation threshold, a hysteresis tolerance limit, a first buffer area, and a second buffer area of ​​the intermediate layer central node; A third receiving unit is used to receive the model update quantity and model version number sent by the bottom-level participant, and determine the model lag round based on the model version number; A comparing unit, configured to compare the model update quantity and the target aggregation threshold, and compare the model hysteresis rounds and the hysteresis tolerance limit, to determine a first iteration parameter corresponding to the first cache area, and a second iteration parameter corresponding to the second cache area; The first model parameter determination unit is used to determine the first model parameter based on the first iteration parameter and the second iteration parameter.

[0131] Based on any of the foregoing embodiments, the unit for determining the target aggregation threshold is specifically configured to: Determine an initial aggregation threshold subunit, used to determine an initial aggregation threshold, a total number of second updates received by the second cache area, and an aggregation duration; The target aggregation threshold determination subunit is configured to determine the target aggregation threshold based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration.

[0132] Based on any of the foregoing embodiments, the target aggregation threshold determination subunit is specifically configured to: Determine whether the current federation round is a first threshold, and if the current federation round is the first threshold, determine that the target aggregation threshold is the initial aggregation threshold; If the current federal round is not the first threshold, determine whether the second total number of updates is zero; if the second total number of updates is not zero, determine the target aggregation threshold based on the first total number of updates received by the first cache area and the second total number of updates; if the second total number of updates is zero and the aggregation duration is greater than or equal to the aggregation timeout duration, determine the target aggregation threshold to be the first total number of updates; if the aggregation duration is less than the aggregation timeout duration, determine the target aggregation threshold to be half of the first total number of updates.

[0133] Based on any of the above embodiments, the initial aggregation threshold is determined based on the number of participants in the first federated learning.

[0134] The model training device based on the multi-layer federated learning architecture provided by the present invention is described below. The model training device based on the multi-layer federated learning architecture described below and the model training method based on the multi-layer federated learning architecture described above can be referenced to each other.

[0135] Based on any of the above embodiments, the present invention provides a model training device based on a multi-layer federated learning architecture. Figure 8 This is the second structural diagram of the model training device based on the multi-layer federated learning architecture provided by the present invention, such as Figure 8 As shown, the device comprises: The second updating unit 810 is used to perform parameter iteration on the second model parameters based on the local sample data to obtain the first model parameters, and send the first model parameters to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the first model parameters and sends them to the middle-level central node of the middle-level participant, and the aggregated first model parameters are sent to the service provider through the middle-level central node, and the service provider updates the second model parameters based on the aggregated first model parameters; The second receiving unit 820 is used to receive the updated second model parameters returned by the service provider, and perform parameter iteration on the updated second model parameters based on the local sample data until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture described above.

[0136] The device provided by the embodiment of the present invention performs parameter iteration on the second model parameter based on local sample data to obtain the iteration parameter, and sends the iteration parameter to the bottom central node of the lowest-level participant, so that the bottom central node aggregates the iteration parameter and sends it to the middle-layer central node of the middle-layer participant, and sends the first model parameter after the iteration parameter is aggregated to the service party through the middle-layer central node, and the service party updates the second model parameter based on the first model parameter; receives the updated second model parameter returned by the service party, and performs parameter iteration on the updated second model parameter based on the local sample data until the model training is completed. On the one hand, by completing the model aggregation operation in layers and in sequence, it is avoided that a single central node undertakes all aggregation tasks, thereby reducing the risk of system interruption caused by single point failure; on the other hand, even when the number of participants increases significantly, the processing pressure of the cloud is dispersed to each central node, reducing the occurrence of performance bottlenecks.

[0137] Based on any of the above embodiments, the intermediate layer central node merges the training progress of its own node and the first model parameters and sends the result to the service provider; The bottom layer central node merges the training progress of its own node and the second model parameters and sends the result to the middle layer central node.

[0138] Fig. 9 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig. 9As shown, the electronic device may include: a processor (processor) 910 , a communication interface (Communications Interface) 920 , a memory (memory) 930 and a communication bus 940 , wherein the processor 910 , the communication interface 920 , and the memory 930 communicate with each other through the communication bus 940 . The processor 910 can call the logic instructions in the memory 930 to execute a method for generating a multi-layer federated learning architecture, which includes: obtaining multiple first-level clusters generated based on the division of multiple participants, and selecting a bottom-level central node from each of the first-level clusters; obtaining multiple second-level clusters generated based on the division of the bottom-level central node, selecting a central node from each of the second-level clusters to obtain a middle-layer central node; obtaining multiple third-level clusters generated based on the division of the middle-layer central node, selecting a central node from the third-level clusters, and iterating layer by layer to obtain a top-level central node; wherein the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-layer central node; the middle-layer central node is used to aggregate the model parameters of the middle-layer participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-layer central node.

[0139] The processor 910 can also call the logic instructions in the memory 930 to execute a model training method based on a multi-layer federated learning architecture, the method including: receiving a first model parameter sent by the middle-layer central node, the first model parameter is obtained by the middle-layer central node aggregating the iterative parameters of the middle-layer participants, and the iterative parameter is obtained by the bottom-level participant performing parameter iteration on the second model parameter based on local sample data; based on the first model parameter, updating the second model parameter; sending the updated second model parameter to the middle-layer central node, so that the middle-layer central node sends the updated second model parameter to the bottom-level participant's bottom-level participant, and the updated second model parameter is sent to the bottom-level participant through the bottom-level central node, and the bottom-level participant performs parameter iteration on the updated second model parameter based on the local sample data to obtain the updated first model parameter and return it until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the above-mentioned multi-layer federated learning architecture.

[0140] The processor 910 can also call the logic instructions in the memory 930 to execute a model training method based on a multi-layer federated learning architecture, the method including: performing parameter iteration on the second model parameters based on local sample data to obtain iteration parameters, and sending the iteration parameters to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iteration parameters and sends them to the middle-level central node of the middle-level participant, and sends the first model parameters after the iteration parameters are aggregated to the service party through the middle-level central node, and the service party updates the second model parameters based on the first model parameters; receiving the updated second model parameters returned by the service party, and performing parameter iteration on the updated second model parameters based on the local sample data until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the above-mentioned multi-layer federated learning architecture.

[0141] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0142] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the generation method of the multi-layer federated learning architecture provided by the above methods, the method including: obtaining multiple first-level clusters generated based on the division of multiple participants, and selecting a bottom-level central node from each of the first-level clusters; obtaining multiple second-level clusters generated based on the division of the bottom-level central node, selecting a central node from each of the second-level clusters to obtain a middle-layer central node; obtaining multiple third-level clusters generated based on the division of the middle-layer central node, selecting a central node from the third-level clusters, and iterating layer by layer to obtain a top-level central node; wherein the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-layer central node; the middle-layer central node is used to aggregate the model parameters of the middle-layer participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-layer central node.

[0143] When the computer program is executed by the processor, the computer can execute the model training method based on the multi-layer federated learning architecture provided by the above methods, the method comprising: receiving a first model parameter sent by the middle-layer central node, the first model parameter is obtained by the middle-layer central node aggregating the iterative parameters of the middle-layer participants, and the iterative parameter is obtained by the bottom-level participant performing parameter iteration on the second model parameter based on local sample data; based on the first model parameter, updating the second model parameter; sending the updated second model parameter to the middle-layer central node, so that the middle-layer central node sends the updated second model parameter to the bottom-level participant's bottom-level participant, and the updated second model parameter is sent to the bottom-level participant through the bottom-level central node, and the bottom-level participant performs parameter iteration on the updated second model parameter based on the local sample data to obtain the updated first model parameter and return it until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture.

[0144] When the computer program is executed by the processor, it is implemented to execute the model training method based on the multi-layer federated learning architecture provided by the above-mentioned methods, and the method includes: performing parameter iteration on the second model parameter based on local sample data to obtain the iteration parameter, and sending the iteration parameter to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iteration parameter and sends it to the middle-level central node of the middle-level participant, and the first model parameter after the iteration parameter is aggregated is sent to the service party through the middle-level central node, and the service party updates the second model parameter based on the first model parameter; receiving the updated second model parameter returned by the service party, and performing parameter iteration on the updated second model parameter based on the local sample data until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture mentioned above.

[0145] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute a method for generating a multi-layer federated learning architecture provided by the above-mentioned methods, the method comprising: obtaining a plurality of first-level clusters generated based on the division of multiple participants, and selecting a bottom-level central node from each of the first-level clusters; obtaining a plurality of second-level clusters generated based on the division of the bottom-level central node, selecting a central node from each of the second-level clusters, and obtaining a middle-layer central node; obtaining a plurality of third-level clusters generated based on the division of the middle-layer central node, selecting a central node from each of the third-level clusters, and iterating layer by layer to obtain a top-level central node; wherein the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-layer central node; the middle-layer central node is used to aggregate the model parameters of the middle-layer participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, and is used to update the global model parameters and send the updated global model parameters to the middle-layer central node.

[0146] When the computer program is executed by the processor, it is implemented to execute the model training method based on the multi-layer federated learning architecture provided by the above-mentioned methods, and the method includes: receiving a first model parameter sent by the middle-layer central node, the first model parameter is obtained after the middle-layer central node aggregates the iterative parameters of the middle-layer participants, and the iterative parameter is obtained by the bottom-level participant performing parameter iteration on the second model parameter based on local sample data; based on the first model parameter, updating the second model parameter; sending the updated second model parameter to the middle-layer central node, so that the middle-layer central node sends the updated second model parameter to the bottom-level participant, and the updated second model parameter is sent to the bottom-level participant through the bottom-level central node, and the bottom-level participant performs parameter iteration on the updated second model parameter based on the local sample data to obtain the updated first model parameter and return it until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture mentioned above.

[0147] When the computer program is executed by the processor, it is implemented to execute the model training method based on the multi-layer federated learning architecture provided by the above-mentioned methods, and the method includes: performing parameter iteration on the second model parameter based on local sample data to obtain the iteration parameter, and sending the iteration parameter to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iteration parameter and sends it to the middle-level central node of the middle-level participant, and the first model parameter after the iteration parameter is aggregated is sent to the service party through the middle-level central node, and the service party updates the second model parameter based on the first model parameter; receiving the updated second model parameter returned by the service party, and performing parameter iteration on the updated second model parameter based on the local sample data until the model training is completed; the multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture mentioned above.

[0148] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a multi-layer federated learning architecture, characterized in that: include: Acquire multiple first-level clusters generated based on the division of multiple participants, and select a bottom-level central node from each of the first-level clusters; Acquire multiple secondary clusters generated based on the division of the bottom central node, select a central node from each of the secondary clusters, and obtain a middle-layer central node; Acquire multiple three-level clusters generated based on the division of the middle-layer central node, select central nodes from the three-level clusters respectively, and iterate layer by layer to obtain the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

2. The method for generating a multi-layer federated learning architecture according to claim 1, characterized in that: The middle-layer participant monitors the first state of the middle-layer central node, and when the first state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the middle-layer central node according to the central node link; the central node link stores central nodes at all levels in the form of a multi-branch tree; The bottom-level participant monitors the second state of the bottom-level central node, and when the second state is an offline state or an unconnectable state, saves the unfinished model parameters to the upper-level central node of the bottom-level central node according to the central node link.

3. A model training method based on a multi-layer federated learning architecture, characterized in that: include: Receive a first model parameter sent by a middle-layer central node, where the first model parameter is obtained by the middle-layer central node aggregating iterative parameters of the middle-layer participants, and the iterative parameters are obtained by the bottom-layer participants iterating the second model parameters based on local sample data; Based on the first model parameters, updating the second model parameters; Send the updated second model parameters to the middle layer central node, so that the middle layer central node sends the updated second model parameters to the bottom layer central node of the bottom layer participant, and the bottom layer central node sends the updated second model parameters to the bottom layer participant, and the bottom layer participant performs parameter iteration on the updated second model parameters based on the local sample data to obtain the updated first model parameters and returns them until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture as described in any one of claims 1 to 2.

4. The model training method based on the multi-layer federated learning architecture according to claim 3 is characterized in that: The step of determining the first model parameter comprises: Determine a target aggregation threshold, a hysteresis tolerance limit, a first cache area, and a second cache area of ​​the intermediate layer central node; Receiving the model update quantity and model version number sent by the bottom-level participant, and determining the model lag round based on the model version number; Comparing the model update quantity with the target aggregation threshold, and comparing the model hysteresis rounds with the hysteresis tolerance limit, to determine a first iteration parameter corresponding to the first cache area, and a second iteration parameter corresponding to the second cache area; The first model parameter is determined based on the first iteration parameter and the second iteration parameter.

5. The model training method based on the multi-layer federated learning architecture according to claim 4 is characterized in that: The determining of the target aggregation threshold of the intermediate layer central node includes: Determining an initial aggregation threshold, a total number of second updates received by the second cache area, and an aggregation duration; The target aggregation threshold is determined based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration.

6. The model training method based on a multi-layer federated learning architecture according to claim 5, characterized in that: The determining the target aggregation threshold based on the initial aggregation threshold, the total number of second updates received by the second cache area, and the aggregation duration includes: Determine whether the current federation round is a first threshold, and if the current federation round is the first threshold, determine that the target aggregation threshold is the initial aggregation threshold; If the current federal round is not the first threshold, determine whether the second total number of updates is zero; if the second total number of updates is not zero, determine the target aggregation threshold based on the first total number of updates received by the first cache area and the second total number of updates; if the second total number of updates is zero and the aggregation duration is greater than or equal to the aggregation timeout duration, determine the target aggregation threshold to be the first total number of updates; if the aggregation duration is less than the aggregation timeout duration, determine the target aggregation threshold to be half of the first total number of updates.

7. The model training method based on a multi-layer federated learning architecture according to claim 6, characterized in that: The initial aggregation threshold is determined based on the number of participants in the first federated learning.

8. A model training method based on a multi-layer federated learning architecture, characterized in that: include: Perform parameter iteration on the second model parameter based on the local sample data to obtain the iteration parameter, and send the iteration parameter to the bottom-level central node of the lowest-level participant, so that the bottom-level central node aggregates the iteration parameter and sends it to the middle-level central node of the middle-level participant, and the first model parameter after the iteration parameter is aggregated is sent to the service provider through the middle-level central node, and the service provider updates the second model parameter based on the first model parameter; Receiving the updated second model parameters returned by the service provider, and performing parameter iteration on the updated second model parameters based on the local sample data until model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture as described in any one of claims 1 to 2.

9. The model training method based on a multi-layer federated learning architecture according to claim 8, characterized in that: The intermediate layer central node merges the training progress of its own node and the first model parameters and sends the result to the service provider; The bottom layer central node merges the training progress of its own node and the second model parameters and sends the result to the middle layer central node.

10. A device for generating a multi-layer federated learning architecture, characterized in that: include: A first election unit is used to obtain multiple first-level clusters generated based on the division of multiple participants, and respectively elect a bottom-level central node from each of the first-level clusters; A second election unit is used to obtain multiple secondary clusters generated based on the division of the bottom central node, and respectively elect a central node from each of the secondary clusters to obtain a middle-layer central node; A third election unit is used to obtain multiple three-level clusters generated based on the division of the middle-layer central node, respectively elect central nodes from the three-level clusters, and iterate layer by layer to obtain the top-level central node; Among them, the bottom-level central node is used to aggregate the model parameters of the bottom-level participants and distribute the model parameters of the middle-level central node; the middle-level central node is used to aggregate the model parameters of the middle-level participants and distribute the global model parameters; the top-level central node is the service provider of the multi-layer federated learning architecture, which is used to update the global model parameters and send the updated global model parameters to the middle-level central node.

11. A model training device based on a multi-layer federated learning architecture, characterized in that: include: A first receiving unit is used to receive a first model parameter sent by an intermediate layer central node, where the first model parameter is obtained by the intermediate layer central node aggregating iterative parameters of the intermediate layer participants, and the iterative parameters are obtained by the lowest layer participants performing parameter iteration on the second model parameters based on local sample data; A first updating unit, configured to update the second model parameter based on the first model parameter; A model training unit, used for sending the updated second model parameters to the middle layer central node, so that the middle layer central node sends the updated second model parameters to the bottom layer central node of the bottom layer participant, and the bottom layer participant sends the updated second model parameters to the bottom layer participant through the bottom layer central node, and the bottom layer participant performs parameter iteration on the updated second model parameters based on the local sample data to obtain the updated first model parameters and returns them until the model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture as described in any one of claims 1 to 2.

12. A model training device based on a multi-layer federated learning architecture, characterized in that: include: A second updating unit is used to perform parameter iteration on the second model parameter based on the local sample data to obtain the iteration parameter, and send the iteration parameter to the bottom central node of the lowest-level participant, so that the bottom central node aggregates the iteration parameter and sends it to the middle-layer central node of the middle-layer participant, and the first model parameter after the iteration parameter is aggregated is sent to the service party through the middle-layer central node, and the service party updates the second model parameter based on the first model parameter; A second receiving unit, configured to receive the updated second model parameters returned by the service provider, and perform parameter iteration on the updated second model parameters based on the local sample data until model training is completed; The multi-layer federated learning architecture is determined based on the generation method of the multi-layer federated learning architecture as described in any one of claims 1 to 2.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, it implements the method for generating a multi-layer federated learning architecture as described in any one of claims 1 to 2, or implements the model training method based on a multi-layer federated learning architecture as described in any one of claims 3 to 9.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for generating a multi-layer federated learning architecture as described in any one of claims 1 to 2, or implements the model training method based on a multi-layer federated learning architecture as described in any one of claims 3 to 9.