A method and system for constructing a multi-level federated learning network topology structure

CN118504705BActive Publication Date: 2026-10-27NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410561591.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2026-10-27
Estimated Expiration
2044-05-08

Smart Images

  • Figure CN118504705B_ABST
    Figure CN118504705B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of distributed machine learning, and particularly relates to a method and system for constructing a multi-level federated learning network topology, which first initializes a current server as a central server, a current client set as all clients, and a relay server queue as empty; calculates the time required for each client in the current client set to complete a round of training and upload local model parameters to the current server, and sorts the current clients; traverses the client queue, selects one of the two ways of connecting the client to the relay server or the current server with less time required, and connects the client to the federated learning network; updates the relay server queue, determines the current server and the current client set for the next operation; and repeats the above process until the federated learning network topology is constructed. The method can adaptively realize hierarchical clustering of the clients according to the computing and communication performance of the clients, reduce the training time and communication overhead, and improve the overall efficiency of the federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed machine learning technology, and in particular to a method and system for constructing a multi-level federated learning network topology. Background Technology

[0002] Machine learning is one of the most cutting-edge research fields today, and it is ubiquitous in modern life. Federated learning, as a machine learning technique, utilizes multiple data sources with local data to train machine learning models at the network edge, building a global model based on virtual fused data. However, due to the significant heterogeneity of computing and communication capabilities across devices, applying federated learning in real-world networks still faces many challenges.

[0003] In traditional star-shaped federated learning networks, communication is a key technical bottleneck. A federated learning network may consist of a large number of devices (clients), such as millions of smartphones. Considering geographical differences, transmitting data from these edge devices to the central federated learning server can consume significant bandwidth resources and communication time. Furthermore, different devices have vastly different data processing speeds due to hardware performance and other factors. When devices with significantly different computing capabilities participate in federated learning, high-performance devices can be negatively impacted by low-performance devices, thus affecting the overall efficiency of the federated learning process.

[0004] Several solutions exist to address the issue of mitigating the negative impact of device computational and communication heterogeneity on federated learning performance. Among them, S. Hosseinalipour et al. proposed a multi-layered federated learning concept. The main idea is to group client devices with similar attributes together for federated learning, reducing the differences between devices within the same group. This facilitates management and improves the utilization efficiency of each device, thereby enhancing the overall efficiency of the federated learning network. However, this concept does not provide a specific scheme for constructing the federated learning network.

[0005] Therefore, how to propose a specific method for constructing a multi-level federated learning network topology to improve the overall efficiency of federated learning has become an urgent problem for those skilled in the art. Summary of the Invention

[0006] In view of the problems existing in the prior art, the present invention is proposed.

[0007] Therefore, this invention provides a method for constructing a multi-level federated learning network topology, which focuses on the heterogeneity of client computation and communication, and can adaptively construct federated learning network topology, reduce training time and communication overhead of federated learning network, and improve the overall efficiency of federated learning.

[0008] To address the aforementioned technical problems, this invention provides the following technical solution: a method for constructing a multi-level federated learning network topology, comprising: constructing a multi-level federated learning framework; calculating the time required for each client in the current client to complete one round of training and upload local model parameters to the current server, and forming a queue; iteratively processing the clients in the queue, and determining whether the construction of the multi-level federated learning network structure is complete.

[0009] As a preferred embodiment of the method for constructing a multi-level federated learning network topology according to the present invention, the multi-level federated learning framework comprises a central server and N clients. Clients can directly connect to the server or act as relay servers to connect to other clients. Clients are responsible for training their local models, the server is responsible for aggregating the local models of the connected clients, and the client acting as a relay server is responsible for aggregating its own local models and those of the connected clients.

[0010] In a preferred embodiment of the method for constructing a multi-level federated learning network topology as described in this invention, the central server's node number is 0, all client node numbers are 1, 2, ..., N, and the training time for any client i to train a local model for one round is t. i The delay for transmitting model parameters between any two nodes i and j is d. ij ;

[0011] Let s be the current server. For the current client set, For the relay server queue, initialize: s = 0. Empty.

[0012] As a preferred embodiment of the method for constructing a multi-level federated learning network topology according to the present invention, the formation of the queue includes calculating... The time required for each client to complete one round of training and upload local model parameters to the current server s. And All clients according to t is Arrange them in ascending order to form queue L.

[0013] In a preferred embodiment of the method for constructing a multi-level federated learning network topology as described in this invention, the iterative processing of sequentially traversing the clients in the queue includes:

[0014] If client j is the first client in queue L, then client j is directly connected to the current server s. If queue L has been traversed completely, ... If Childof(k) is not empty, then add k to the relay server queue. At the end; if client j is not the first client in queue L. Childof(s) is the set of clients directly connected to the current server s. It calculates the time required for client j to complete one round of local model training and upload the model to the current server s using client k as a relay server.

[0015]

[0016] Among them, t jk =t j +d jk , t rk =t r +d rk Childof(k) is the set of clients that are directly connected to client k.

[0017] As a preferred embodiment of the method for constructing a multi-level federated learning network topology according to the present invention, the iterative processing of sequentially traversing the clients in the queue includes: Calculation yields Minimum client k * , is represented as:

[0018]

[0019] like Then connect client j to client k. * ;like Connect client j directly to the current server s;

[0020] If queue L has been traversed completely If Childof(k) is not empty, then add k to the relay server queue. At the end of the queue; if queue L has not been traversed completely, let j be the next client in queue L, and start the iteration process again.

[0021] As a preferred embodiment of the method for constructing a multi-level federated learning network topology according to the present invention, the step of determining whether the construction of the multi-level federated learning network structure is complete includes: if If it is not empty, then let the relay server queue... The first node is dequeued and becomes the current server s. And disconnect Recalculate all client and s connections. The time required for each client to complete one round of training and upload local model parameters to the current server s And All clients according to t is Sort the data in ascending order to form queue L; if An empty value indicates that the construction of the multi-level federated learning network structure has been completed.

[0022] Another objective of this invention is to provide a system for constructing a multi-layered federated learning network topology. The parameter upload module optimizes the data upload process, improving training efficiency and enhancing data security through encryption and secure transmission mechanisms. It also intelligently allocates resources to handle large-scale concurrent uploads. The queue management module optimizes resource allocation and improves response speed through fair scheduling and effective queue management mechanisms, while enhancing system fairness and performance through load balancing. The iterative processing module continuously improves the model's accuracy and robustness through progressive model optimization and network structure verification, dynamically adjusting the training strategy based on the iteration results. The integration of these modules not only enhances the system's functionality and efficiency but also improves its security and scalability.

[0023] As a preferred embodiment of the multi-level federated learning network topology construction system described in this invention, it includes: a parameter uploading module, a queue management module, and an iterative processing module;

[0024] The parameter upload module is responsible for uploading model parameters after the client completes training;

[0025] The queue management module manages the queues where clients complete their training time.

[0026] The iterative processing module performs client-side iterative processing and network structure determination.

[0027] A computer device includes a memory and a processor, the memory storing a computer program, characterized in that the processor executes the computer program to implement the steps of any one of the methods described in the method for constructing a multi-level federated learning network topology.

[0028] A 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 steps of any one of the methods in the method for constructing a multi-level federated learning network topology.

[0029] The beneficial effects of this invention are as follows: The method of this invention can adaptively realize hierarchical clustering of the client according to the client's computing and communication performance, thereby efficiently constructing a multi-layer federated learning network topology and solving the heterogeneity problem of traditional star topology; by hierarchical partitioning, the training time of the entire federated learning network can be reduced, communication overhead can be reduced, thereby improving the overall efficiency of federated learning. Attached Figure Description

[0030] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a flowchart illustrating a method for constructing a multi-level federated learning network topology, as provided in one embodiment of the present invention.

[0032] Figure 2 This diagram illustrates a verification example of a method for constructing a multi-level federated learning network topology, as provided in an embodiment of the present invention. Detailed Implementation

[0033] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0034] Example 1

[0035] Reference Figures 1-2 This is the first embodiment of the present invention, which provides a method for constructing a multi-level federated learning network topology, including:

[0036] like Figure 1 As shown, the method includes the following steps:

[0037] Step 1: Assume the entire federated learning framework consists of a central server and N clients. Clients can either connect directly to the server or act as relay servers to connect to other clients. Clients are responsible for training their local models, the server is responsible for aggregating the local models of the clients it connects to, and clients acting as relay servers are also responsible for aggregating their own and the local models of the clients they connect to. Let the node number of the central server be 0, and the node numbers of all clients be 1, 2, ..., N. Let t be the time required for any client i to train its local model for one round. i The delay for transmitting model parameters between any two nodes (including the central server and the client) i and j is d. ij Let s be the current server. For the current client set,

[0038] For the relay server queue, initialize: s = 0. Empty;

[0039] Step 2, Calculation The time required for each client to complete one round of training and upload local model parameters to the current server s And All clients according to t is Sort the data in ascending order to form queue L;

[0040] Step 3: Iterate through the clients in queue L one by one. Perform the following operations:

[0041] Step 3-1: If client j is the first client in queue L, then connect client j directly to the current server s and proceed to step 3-5; otherwise, proceed to step 3-2.

[0042] Step 3-2 Childof(s) is the set of clients directly connected to the current server s. It calculates the time required for client j to complete one round of local model training and upload the model to the current server s using client k as a relay server.

[0043]

[0044] Among them, t jk =t j +d jk , t rk =t r +d rk Childof(k) is the set of clients that are directly connected to client k;

[0045] Step 3-3 Calculation yields Minimum client k * ,Right now:

[0046]

[0047] Steps 3-4, if Then connect client j to client k. * Otherwise, connect client j directly to the current server s.

[0048] Step 3-5: If queue L has been traversed, proceed to step 4; otherwise, let j be the next client in queue L, and proceed to step 3-1.

[0049] Step 4 If Childof(k) is not empty, then add k to the relay server queue. The end;

[0050] Step 5, if If it is not empty, then let the relay server queue... The first node is dequeued and becomes the current server s. And disconnect If all clients and s are connected, proceed to step 2; otherwise, it indicates that the construction of the multi-level federated learning network structure is complete, and the method steps end.

[0051] To verify the method for constructing the multi-level federated learning network topology of this invention, a verification example is provided. In this verification example, one central server (numbered 0) and nine clients (numbered 1 to 9) are set up. Initialization: If empty, s = 0.

[0052] Let t1 to t9 be 3.54, 2.93, 1.64, 2.97, 4.92, 1.99, 2.05, 4.99, and 2.42 seconds respectively, and d 10 ~d 90 The durations are 6.5, 8.5, 2.5, 2.5, 8.5, 8.5, 14.5, 6.5, and 12.5 seconds respectively. Calculate... The time t required for each client to complete one round of training and upload local model parameters to the current server. 10 ~t 90 The durations were 10.04, 11.44, 4.14, 5.47, 13.42, 10.49, 16.55, 11.49, and 14.92 seconds, respectively. All clients according to t 10 ~t 90Sort the data in ascending order to form queue L: <3,4,1,6,2,8,5,9,7>;

[0053] Iterate through the clients in queue L:

[0054] For the first client in queue L, i.e., j=3, connect client 3 directly to the current server 0;

[0055] For the second client in queue L, i.e., j=4, calculate the time required for client 4 to complete one round of local model training and upload the model to the current server 0 using client 3 as a relay server, i.e.:

[0056]

[0057] Where, let d 43 =10 (seconds), then t 43 =d 43 +t4 = 12.97 (seconds), and at this time Childof(3) is empty, therefore we can get:

[0058]

[0059] At this point, Childof(0) = {3}, then:

[0060]

[0061] because Therefore, client 4 is directly connected to the current server 0;

[0062] For the third client in queue L, i.e., j=1, and Childof(0)={3,4}, we first calculate the time required for client 1 to complete one round of local model training and upload the model to the current server 0 using client 3 as a relay server, i.e.:

[0063]

[0064] Where, let d 13 =16 (seconds), then t 13 =d 13 +t1 = 19.54 (seconds), and at this time Childof(3) is empty, therefore we can obtain:

[0065]

[0066] Next, calculate the time required for client 1 to complete one round of local model training and upload the model to the current server 0 using client 4 as a relay server. Similarly, we can obtain: but:

[0067]

[0068] because Therefore, client 1 is connected to relay server 4;

[0069] Repeat the above operations until queue L has been traversed, resulting in a preliminary federated learning network topology as follows: Figure 2 As shown in (a);

[0070] At this point, Childof(0) = {3, 4}, and both Childof(3) and Childof(4) are not empty. Therefore, clients 3 and 4 are added to the relay server queue. At the end,

[0071] make The first client, 3, is dequeued to become the current server, s, i.e., s = 3. And disconnect All clients and 3 connections in the middle;

[0072] Repeat the above operation until the queue is full. Empty, construction complete, final federated learning network topology as follows: Figure 2 As shown in (b).

[0073] Example 2

[0074] The second embodiment of the present invention provides a simulation experiment of a method for constructing a multi-level federated learning network topology, further verifying the superiority of the present invention over traditional technical methods.

[0075] The simulation experiment is set up as follows: the entire federated learning process takes place within a 20×20 (square kilometer) square region, with the central server located at the center of the square, and 200 clients randomly distributed within it. The training time t for any client i to complete one round of local model training is... i Randomly generated, t i ∈[1,5] (seconds); the delay d between any two nodes (including the central server and the client) i and j for transmitting model parameters. ij It is inversely proportional to the square of the distance between i and j, d ij ∈(0,200] (seconds).

[0076] In each experiment, the same simulation environment was generated according to the above settings. The time taken for all clients to complete one round of local model training and upload the model to the central server was compared between the multi-level federated learning network topology constructed in this invention and the traditional star-shaped federated learning network topology. A total of 9 simulation experiments were conducted, and the simulation results are shown in Table 1.

[0077] Table 1 Comparison of time for different federated learning network topologies

[0078]

[0079]

[0080] As can be seen from Table 1, the time required for each experiment of the present invention is significantly less than that of the traditional technical solution.

[0081] Example 3

[0082] The third embodiment of the present invention differs from the first two embodiments in that:

[0083] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0085] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0086] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0087] Example 4

[0088] This is a fourth embodiment of the present invention, which provides a system for constructing a multi-level federated learning network topology, characterized in that it includes a parameter uploading module, a queue management module, and an iterative processing module;

[0089] The parameter upload module is responsible for uploading model parameters after the client completes training;

[0090] The queue management module manages the queues where clients complete their training time.

[0091] The iterative processing module performs client-side iterative processing and network structure determination.

[0092] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for constructing a multi-level federated learning network topology, characterized in that: include, Construct a multi-layered federated learning framework; Calculate the time required for each client in the current client to complete one round of training and upload the local model parameters to the current server, and form a queue; It iterates through the clients in the queue, processing them sequentially, and determines whether the construction of the multi-level federated learning network structure is complete. The multi-level federated learning framework consists of a central server and It consists of several clients, and the node number of the central server is... The node number for all clients is Any client The time to train a local model is Any two nodes and The delay for transmitting model parameters between them is ; make For the current server, For the current client set, Initialize the relay server queue: , , Empty; The formation of the queue includes calculating Each client completes one round of training and uploads its local model parameters to the current server. The time required , and will All clients according to Sort in ascending order to form a queue ; The iterative processing of clients sequentially traversing the queue includes the client being responsible for training the local model, if the client... It is a queue The first client in the process will then be the client. Connect directly to the current server The server is responsible for aggregating the local models of the connected clients; if the client Not a queue The first client in the game, , To connect directly to the current server The client set, computing clients Complete one round of local model training, and use the client As a relay server, upload the model to the current server. Time required: in, , , To connect directly to the client A collection of clients; The iterative processing of sequentially traversing the clients in the queue also includes... Calculation yields Minimal client ,like Then the client Connect to client The client acting as a relay server is responsible for aggregating its own local model and that of the clients it connects to; if , will the client Connect directly to the current server ; If queue The traversal has been completed. ,like If not empty, then Add to relay server queue The end of the queue; if the queue Incomplete traversal, For queue The next client will then undergo iterative processing again.

2. The method for constructing a multi-level federated learning network topology as described in claim 1, characterized in that: Calculation yields Minimal client , is represented as: 。 3. The method for constructing a multi-level federated learning network topology as described in claim 2, characterized in that: The determination of whether the construction of the multi-level federated learning network structure is complete includes, if... If it is not empty, then let the relay server queue... The first node is dequeued and becomes the current server. , And disconnected All clients and The connection needs to be recalculated. Each client completes one round of training and uploads its local model parameters to the current server. Time required , and will All clients according to Sort in ascending order to form a queue ;like An empty value indicates that the construction of the multi-level federated learning network structure has been completed.

4. A system for constructing a multi-level federated learning network topology based on any one of claims 1-3, characterized in that: This includes a parameter upload module, a queue management module, and an iteration processing module; The parameter upload module is responsible for uploading model parameters after the client completes training; The queue management module manages the queues where clients complete their training time. The iterative processing module performs client-side iterative processing and network structure determination.

5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

6. A 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 steps of the method according to any one of claims 1 to 3.