Network function calculation coding scheme applied to hierarchical federal learning

By introducing a hybrid network structure and greedy algorithm connected to multiple edge servers in cloud-edge collaborative federated learning, combined with network function calculation technology, the problem of existing solutions failing to fully utilize the computing power of edge servers is solved, and more efficient communication is achieved. and aggregation process, reducing communication costs and improving scalability.

CN118869142AActive Publication Date: 2024-10-29SUN YAT SEN UNIVERSITY SHENZHEN +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410827971.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-29
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

The existing cloud-edge collaborative federated learning solution based on a tree-like network structure fails to fully utilize the computing power of the edge server, resulting in high communication costs. Moreover, the existing network coding solution has a narrow application range and poor scalability, especially in multi-network environments. In the edge server connection scenario.

Method used

A hybrid network structure model connected by multiple edge servers is proposed. It combines network function calculation technology and greedy algorithm. User data is equally divided and edge servers are selected for encoding and transmission through the greedy strategy to achieve global and local aggregation processes and optimize network function calculation. rate.

Benefits of technology

It effectively reduces communication costs, improves the transmission rate and the convergence speed of local aggregation, has good scalability, is suitable for any hierarchical federated learning scenario of cloud-edge collaboration, and ensures lossless transmission accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869142A_ABST
    Figure CN118869142A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud communication, and particularly discloses a network function calculation coding scheme applied to hierarchical federated learning, which consists of three parts: a hybrid network structure model connected by multiple edge servers; a coding transmission scheme of a user-edge server; and global aggregation and local aggregation of the model. The scheme fully utilizes the characteristics of federated learning function calculation, combines a network function calculation technology and a greedy algorithm thought, and fully utilizes the calculation capability of an edge server to improve the function calculation rate of a network, so that the overall communication cost of the system is reduced; even if the finite field is small, the scheme can effectively improve the function calculation rate of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud communication technology, and in particular to a network function computing coding scheme applied to hierarchical federated learning. Background Art

[0002] 1. Hierarchical federated learning based on cloud-edge-device collaboration

[0003] Traditional cloud-centric machine learning requires collecting data from all parties first and sending all the data to cloud-based servers or data centers for processing and training. However, uploading all this data to the central server will take up a lot of network bandwidth, and the transmission delay of data interaction is high. It is not suitable for scenarios with low transmission delay requirements, and there is also a risk of privacy leakage. In order to enable artificial intelligence systems to more efficiently coordinate data training from all parties while meeting data privacy, security and regulatory requirements, Google proposed the federated learning framework in 2016. In federated learning, after training the model locally, the user end updates the model parameters instead of uploading local data to the central server. This means that the data storage and modeling training processes are migrated to the user end. The user end only needs to upload the model update parameters to the central server, and then the central server performs weighted aggregation to obtain the training results, thereby effectively protecting the privacy of user data.

[0004] Since there may be tens of thousands of devices involved in the training of a federated network, each training requires multiple rounds of communication, and the network bandwidth and other resources are limited, reducing the communication cost has become a key issue of concern. Currently, most methods to reduce communication costs focus on two aspects: one is to reduce the total number of rounds of uploading data; the other is to reduce the amount of data uploaded in each round. These methods rarely consider optimizing the communication network structure of federated learning. The traditional federated learning structure is based on a two-layer network in the cloud, such as Figure 1 As shown in Figure 1, a large number of mobile devices communicate directly with the cloud center server, but the mobile devices and the central server are often far away. The communication of the wide area network requires a large amount of network bandwidth and has serious delay. People have introduced edge computing in federated learning and proposed a three-layer heterogeneous federated learning network based on collaborative training of cloud, edge and terminal, such as Figure 2 As shown, the communication cost can be reduced by transferring part of the computation to the edge server.

[0005] 2. Network Coding and Network Function Computation

[0006] Network function computing is a field closely related to network coding. Network coding is a technology for information transmission and data storage. Instead of simply storing and forwarding data, intermediate nodes are allowed to process the information before sending it, thereby improving the efficiency and reliability of the network.

[0007] Next, we will use the butterfly network, a typical single-source and two-sink network, to describe the implementation of network coding. Figure 3 and Figure 4 As shown, assume that the communication network G = (V, E), where V describes the node set of G, E describes the edge set of G, S is the source, C 1 and C 2 are all destination nodes, and the channel capacity is 1. The main task of this network is to transfer information w 1 and w 2 From source node S to destination node C 1 and C 2 . Figure 3 This is the traditional router storage and forwarding process. Since the channel capacity is 1, the edge server 3 receives w 1 and w 2 It takes two time slots to send the message, so C 1 and C 2 At the same time, receiving 1 and w 2 Two time slots are required. However, network coding technology such as Figure 4 As shown, the edge server 3 can transmit w 1 and w 2 Perform XOR operation w 1 ⊕w 2 , the operation result w 1 ⊕w 2 Transmitted to node 4, this process only takes one time slot. 1 Receive w from node 1 1 and w from node 4 1 ⊕w 2 , according to w 1 ⊕w 1 ⊕w 2 =w 2 The same goes for C v You can also get w 1 , C 1 and C 2 At the same time, get w 1 and w 2 One time slot is required, so the maximum flow-minimum cut bound can be achieved using network coding.

[0008] The above coding scheme is for a certain network topology, while random network coding is a coding scheme for a network with an unknown topology. The destination divides the data to be sent into several packets and then encodes each packet. The encoding process involves selecting a set of random coefficients and multiplying them with the original packet to generate an encoded packet. When the edge server of random network coding receives multiple encoded packets, it linearly combines these packets and then sends the generated combined packet. When the receiving end receives a sufficient number of encoded packets, it can restore the original packet by solving the linear equation system.

[0009] The network function calculation problem is based on the premise that the edge server has the network coding function, and the central server in some networks is interested in the relevant functions of the source data rather than the original data, such as wireless sensor networks. Wireless sensor networks are composed of nodes with sensing, wireless communication and computing capabilities. Such a network not only needs to complete the task of sensing the environment, but also needs to pass the functions of the relevant data to the designated receiving node through a series of messages transmitted between nodes and calculations on the nodes. For example, in environmental monitoring, the relevant statistical values ​​of the temperature sensor readings may be the average, median, and mode of the temperature; in the temperature alarm network, the data of interest may be the maximum value of the temperature reading. At this time, the edge server not only stores and forwards the collected data, but also plays a dual role of calculation and communication. The network function calculation problem is an extended network coding problem. Traditional network coding requires the original information of the source to be restored at the destination, which can be considered as the identity function of the source at the destination. The uplink communication network based on federated learning with cloud-edge-end collaboration also has this function calculation feature. In the classic federated averaging algorithm, users upload the updated parameters of the model to the central server after local training. What the central server needs is the average arithmetic sum of the user data rather than the original data, so edge servers such as edge servers can play a computing role.

[0010] 3. Federated learning based on network coding

[0011] As coding technology and federated learning are increasingly integrated, network coding has also been introduced into federated learning transmission, mainly including deterministic network coding and random network coding. NC-FLs (Network Coding-Federated Learning System) proposed based on deterministic network coding studies the coding scheme in a butterfly network based on two users. This coding scheme divides the data into two parts and sends them out in a combined manner. Finally, the central server receives enough messages and decodes them to obtain the original data. The uplink process uses network function calculation technology, and the central server only needs to solve the arithmetic sum of the source data. Figure 5 , Figure 6The following are the downlink and uplink processes of federated learning based on network coding:

[0012] The FedNC (Federated Learning-Network Coding) coding scheme is proposed based on random network coding. The idea is to mix the information of the local model by performing random linear combinations on the original data packets before uploading for further aggregation. FedNC improves the performance of traditional FL in several important aspects, including security, throughput, and robustness.

[0013] Disadvantages of the existing technology:

[0014] 1. Disadvantages of existing cloud-edge-device collaborative federated learning based on tree-like transmission structure

[0015] Currently, most federated learning based on cloud-edge-end collaboration considers the tree network structure, that is, it only considers the situation where each end node is connected to only one edge server, and the edge server is connected to the cloud, and lacks consideration of optimizing more complex transmission structures, such as the situation where users can connect to multiple edge servers. Therefore, traditional solutions do not fully utilize the computing power of edge servers, resulting in high communication costs.

[0016] 2. Disadvantages of existing federated learning based on network coding

[0017] At present, the NC-FLs scheme based on deterministic network coding only studies the coding transmission based on butterfly network. This coding scheme is only suitable for the case of two users, and lacks the rate analysis of the coding scheme from the perspective of information theory.

[0018] The current FedNC scheme based on random network coding requires a large finite field to ensure the success rate of central server decoding.

[0019] In summary, the existing network coding-based federated learning solutions have a narrow scope of application and poor scalability. Summary of the invention

[0020] In view of the problem that the network structure in cloud-edge-end collaborative heterogeneous federated learning is single and difficult to meet the actual user needs, the present invention aims to propose a hybrid network structure with better scalability and multi-edge server connection based on the traditional tree network structure, and propose a corresponding network coding scheme. The scheme makes full use of the characteristics of federated learning function calculation, combines network function calculation technology and greedy algorithm ideas, and makes full use of the computing power of edge servers to improve the function calculation rate of the network, thereby reducing the overall communication cost of the system. Even when the finite domain is small, the scheme can effectively improve the function calculation rate of the network.

[0021] The technical solution adopted by the present invention is as follows:

[0022] A network function computing encoding scheme for hierarchical federated learning includes the following three components:

[0023] P1, hybrid network structure model with multiple edge servers connected;

[0024] P2, encoding and transmission scheme between user and edge server;

[0025] P3, global aggregation and local aggregation process of the model.

[0026] Preferably, P1 is a three-layer cloud-edge-end collaborative network structure in which the user end is connected to one or more edge servers, and one or more edge servers are connected to the cloud.

[0027] Preferably, the network structure is specifically:

[0028] In the network, the top layer is a central server or a central server, which performs data aggregation on the parameters in the system to further perform federated learning calculations; the middle layer is r edge servers m i ,1≤i≤r, or edge server, performs data aggregation and forwarding; the bottom layer is s users σ i ,1≤i≤s, each user randomly connects to a different edge server and uploads his own parameter data. User σ i The number of connected edge servers is denoted as C i .

[0029] Preferably, each user σ i ,1≤i≤s, the generated parameter data x i There are k symbols, each of which is contained in the alphabet A = {0, 1, 2, ..., q-1}: x i =(x i,1 ,x i,2 ,…,x i,k ),x i,j ∈A.

[0030] Preferably, P2 comprises the following steps:

[0031] S2.1. Equally divide the parameter data of each user;

[0032] Each user σ i ,1≤i≤s generated parameter data x i Each of them has k symbols, and the parameter data x generated by each user i is equally divided into r parts, i.e., the number of edge servers; in actual application scenarios, k is much larger than r, and k is approximately considered to be divisible by r; the parameter data x of each user iAfter evenly dividing into r parts, each part of the parameter data contains symbols, which are arranged in the original data order as the first part, the second part,..., the rth part; between the user and the edge server, the data is in parts, that is symbols, and is uploaded and aggregated as a whole;

[0033] S2.2. Edge server initialization settings;

[0034] Set the allocated data volume of edge server m i to be l i , 1 ≤ i ≤ r, and the initial values of l i are all 1;

[0035] Set the retrieval index of edge server m i to be d i , 1 ≤ i ≤ r, and the initial values of d i are all i;

[0036] Start a loop from the (i + 1) % r part in each round, where % represents the modulo operation;

[0037] S2.3. Sort and select the edge server for the data to be allocated in this round of decision;

[0038] Define the following two rules, and sort the edge servers according to the allocated data volume l i of each edge server m i , 1 ≤ i ≤ r:

[0039] If l a < l b , then the sorting of m a is more forward;

[0040] If l a = l b and a < b, then the sorting of m a is more forward;

[0041] Traverse the edge servers from front to back according to the above sorting, and judge whether the data of the users connected to the edge server m i has been transmitted;

[0042] If not, select m i , if so, continue to traverse the next edge server in the sorting, and re - execute the judgment until an edge server is selected;

[0043] S2.4. Retrieve the underlying user data connected to the edge server selected in S2.3, and generate an uplink coding transmission scheme through the greedy strategy;

[0044] For the edge server m selected in S2.3i , retrieve the data currently to be allocated and transmitted in the underlying user to which it is connected, a total of r parts; for each part of the data, find out how many nodes have not yet transmitted the data; according to m i The current search index d i , will be from the d i Part to (d i +r-1) The %r part traverses and searches the data, where % represents the remainder operation;

[0045] If the jth part of data is the largest to be transmitted, then the jth part of the node data that has not yet been transmitted is assigned to be transmitted to the edge server m i , by m i Aggregate these data; if the amount of data to be transmitted in part a and part b is the same, the order of their detection in the traversal search should be compared. If a is detected earlier than b, part a should be selected to be allocated and transmitted to edge server m. i ; Finally, m i The current search index d i Update to (j+1)%r, where % represents the remainder operation;

[0046] S2.5, updating the allocated data volume of the edge server selected in S2.3;

[0047] For S2.3 selected edge server m i , which has been assigned to b i Round data aggregation, b i >1; the number of users aggregated in the jth round is recorded as a j , 1 <j<b i , that is, for a j Arithmetic and operations are performed on the parameter data; according to information theory, the alphabet size of each symbol of the data generated by the j-th round of aggregation is a j (q-1)+1, each parameter data is still symbols; after b i Round aggregation, that is, after arithmetic and operation, up to now m i The size of data that needs to be transmitted to the central server is:

[0048]

[0049] Since k and r are both constants, each subsequent iteration updates l according to the following formula: i :

[0050]

[0051] To measure the edge server m iThe amount of allocated data;

[0052] Calculate and update m i The corresponding l i ;

[0053] S2.6, loop S2.3-S2.5 until the data of all bottom-level users have been allocated and transmitted to the corresponding edge servers, then the loop ends; at this point, the uplink coding transmission scheme between the bottom-level user and the edge server is obtained, which is recorded as Greedy-NFC, Greedy Algorithm for Network Function Computing;

[0054] Before training begins, the central server generates a coding scheme based on the network topology. In each round of training, the user only needs to upload the model update parameters to the edge server according to the corresponding transmission matrix, without having to traverse the above process again.

[0055] Preferably, P3 comprises the following steps:

[0056] S3.1, assuming that the user takes every τ 1 Upload data to the edge server once in a round, and the edge server aggregates τ 2 After uploading to the cloud server, the user trains τ 1 τ 2 The global aggregation is performed only after τ times; the initial value of the edge server aggregation round number τ is 0; the user uses the gradient parameters received from the edge server or the central server to perform local training, and each local training τ 1 After the round, the data needs to be processed and sent to the edge server;

[0057] Using the federated average algorithm, the central server's objective function is:

[0058]

[0059] Where N is the number of clients participating in the training, D i is the dataset of user i, |D i | is data D i The amount of data, is the sum of all user data sets;

[0060] User training completed 1 After the round, the gradient parameter w needs to be obtained i (k) and |D i |Multiply to get |D i |×w i (k), then |D i |×w i(k) The data is sent to the middle layer node according to the Greedy-NFC encoding scheme mentioned above. In particular, if the amount of training data of the users is equal, the original gradient parameters are directly transmitted without processing the data, and the result is:

[0061]

[0062] S3.2. The user uploads the data to the edge server according to the Greedy-NFC method. After receiving the data, the edge server performs arithmetic and operation on the same part of the data; the number of times the edge server is aggregated is updated τ+1;

[0063] S3.3. If τ<τ 2 , the aggregated data is fed back to the user, that is, local aggregation; since the user receives data from multiple edge servers, it is necessary to calculate the federated average of the same part of the data:

[0064]

[0065] where w (j) (k+1) refers to the update parameters of the jth part, N j refers to the number of users aggregated in the jth part, |D j | refers to the N of the jth part of the aggregation j The sum of the data of users; if the amount of training data of users is equal, then:

[0066]

[0067] S3.4, if τ=τ 2 , the aggregated data is transmitted to the central server, i.e. global aggregation, and the central server calculates the federated average of each part of the data:

[0068]

[0069] The updated gradient is then transmitted back to the user, who does not need to process the data after receiving it. Similarly, if the amount of data trained by the user is equal, then:

[0070]

[0071] At the same time, the edge server starts to calculate the aggregation times again: τ = 0;

[0072] S3.5. Iterate S3.1→S3.2→S3.3→S3.4 until the training requirements are met.

[0073] The present invention has the following characteristics and advantages:

[0074] 1. Improve the transmission rate

[0075] The traditional tree structure does not take into account the situation where users connect to multiple edge servers and the traditional communication process requires the restoration of original data on the central server. The network based on multiple edge servers considered in the present invention and the encoding scheme proposed in combination with network function calculation can achieve calculation while transmitting, and use the greedy idea to effectively improve the network function calculation rate.

[0076] 2. Improve the convergence speed of local aggregation

[0077] Since users can connect to data from multiple edge servers at the same time, each edge server can aggregate more users during local aggregation, thereby feeding the aggregated data back to the user end before the next round of training, which can improve the convergence speed of training to a certain extent.

[0078] 3. Scalability

[0079] Since this communication scheme starts from the transmission structure, it is independent of federated learning. At the same time, compared with the traditional NC-FLs encoding scheme that is only applicable to the two-user case, our proposed scheme can be extended to any cloud-edge-end collaborative hierarchical federated learning.

[0080] 4. Lossless transmission

[0081] The encoding scheme designed by the present invention is lossless and thus does not cause loss of accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 This is a schematic diagram of federated learning with a traditional two-layer network structure;

[0083] Figure 2 This is a schematic diagram of the hierarchical federated learning structure based on cloud-edge-end collaboration;

[0084] Figure 3 This is a schematic diagram of the traditional butterfly network communication process;

[0085] Figure 4 This is a schematic diagram of the butterfly network communication process based on network coding;

[0086] Figure 5 This is a schematic diagram of the downlink process of federated learning based on network coding;

[0087] Figure 6 This is a schematic diagram of the uplink process of federated learning based on network coding;

[0088] Figure 7 This is a schematic diagram of a hierarchical federated learning structure connected by multiple edge services;

[0089] Figure 8 is an example of a coding scheme according to an embodiment of the present invention;

[0090] Fig. 9 This is a transmission scheme in which data is divided into two parts according to an embodiment of the present invention;

[0091] Fig.10 This is a transmission scheme in which data is divided into three parts in an embodiment of the present invention. DETAILED DESCRIPTION

[0092] The global aggregation uplink coding transmission scheme and the local aggregation downlink feedback scheme for the hybrid network structure model of multi-edge server connection proposed in the present invention are combined with the network function calculation technology to improve the network function calculation rate. The user data is evenly divided into the same number of copies as the number of edge servers, and the edge server with the smallest allocated data is selected according to the greedy algorithm in each round. The edge server starts to cyclically retrieve and greedily aggregate the data part of the most users from the next round of the aggregation node in the previous round. These designs for balancing the transmission volume from the edge server to the top node are the key to improving the network function calculation rate of the present invention.

[0093] 1. User-edge server encoding scheme generation process

[0094] consider Figure 8 The network structure in: 1 top-level node, 3 edge servers, 3 bottom-level users, each user can connect to two middle-level nodes. Assume that the bottom-level user needs to transmit parameter data x i Each of them is 3 symbols from the alphabet A = {0, 1}. Assume that the amount of training data for each user is equal.

[0095] S1: divide the parameter data of each user equally;

[0096] Since the number of edge servers is r = 3, the user σ 1 , σ 2 , σ 3 The data x 1 、x 2 、x 3 Divide into 3 equal parts, and get (x 11 ,x 12 ,x 13 )、(x 21 ,x 22 ,x 23 )、(x 31 ,x 32 ,x 33 ).

[0097] S2: Initialization;

[0098] Set the allocated data volume for each edge server: 1 = l 2 = l 3= 1. Set the search index of each edge server: d 1 =1,d 2 =2,d 3 =3.

[0099] Start loop S3-S5;

[0100] Loop 1:

[0101] S3: Sort and select edge servers to distribute data: m 1 →m 2 →m 3 (Because l 1 = l 2 = l 3 , but 1<2<3). Therefore m 1 The edge server to which the data is to be allocated in this round of decision making.

[0102] S4:m 1 Current search index d 1 = 1, so starting from part 1, search for m 1 The underlying user σ connected 1 , σ 2 The data to be allocated for transmission in the current part is x. 11 +x 21 , the data to be allocated for transmission in part 2 is x 12 +x 22 , the data to be allocated for transmission in part 3 is x 13 +x 23 Since the amount of data to be allocated for transmission is 2, according to the order of the three in the traversal search, the data in the first part is selected to be allocated for transmission to the edge server m. 1 . m 1 Aggregate the data (calculate the sum) to get x 11 +x 21 . m 1 The search index is updated to d 1 =2.

[0103] S5: According to the formula b 1 =1,a 1 =2, q=2, update m 1 The amount of allocated data is: l 1 =2*(2-1)+1=3.

[0104] Loop 2:

[0105] S3: Sort and select edge servers to distribute data: m 2 →m 3 →m1 (Because l 2 = l 3 =0 <l 1 =3, but 2<3). Therefore m 2 The edge server to which the data is to be allocated in this round of decision making.

[0106] S4:m 2 Current search index d 2 =2, so starting from the second part, search for m 2 The underlying user σ connected 1 , σ 3 The data to be allocated for transmission in the current part is x. 12 +x 32 , the data to be allocated for transmission in part 3 is x 13 +x 33 , the data to be allocated for transmission in part 1 is x 31 Since the amount of data to be allocated for transmission in the second and third parts is 2, the data in the second part is selected to be allocated and transmitted to the edge server m according to the order of their detection in the traversal search. 2 . m 2 Aggregate the data (calculate the sum) to get x 12 +x 32 . m 2 The search index is updated to d 2 =3.

[0107] S5: According to the formula b 2 =1, a 1 =2, q=2, update m 2 The amount of allocated data is: 2 =2*(2-1)+1=3.

[0108] Loop 3:

[0109] S3: Sort and select edge servers to distribute data: m 3 →m 1 →m 2 (Because l 3 =0 <l 1 = l 2 =3). Therefore m 3 The edge server to which the data is to be allocated in this round of decision making.

[0110] S4:m 3 Current search index d 3 =3, so starting from the 3rd part, search for m 3 The underlying user σ connected 2 , σ3 The data to be allocated for transmission in the current part is x. 23 +x 33 , the data to be allocated for transmission in part 1 is x 31 , the data to be allocated for transmission in part 2 is x 22 The data to be allocated for transmission in part 3 is the largest, so the data in part 3 is selected to be allocated for transmission to edge server m 3 . m 3 Aggregate the data (calculate the sum) to get x 23 +x 33 . m 3 The search index is updated to d 3 =1.

[0111] S5: According to the formula b 3 =1,a 1 =2, q=2, update m 3 The amount of allocated data is: l 3 =2*(2-1)+1=3.

[0112] Loop 4:

[0113] S3: Sort and select edge servers to distribute data: m 1 →m 2 →m 3 (Because l 1 = l 2 = l 3 , but 1<2<3). Therefore m 1 The edge server to which the data is to be allocated in this round of decision making.

[0114] S4:m 1 Current search index d 1 =2, so starting from the second part, search for m 2 The underlying user σ connected 1 , σ 2 The data to be allocated for transmission in the current part is x. 22 , the data to be allocated for transmission in part 3 is x 13 Since the amount of data to be allocated for transmission in the second and third parts is 1, the data in the second part is selected to be allocated for transmission to the edge server m according to the order of their detection in the traversal search. 1 Since there is only one copy of the data, m 1 No need to aggregate data. 1 The search index is updated to d 1 =3.

[0115] S5: According to the formula b 1 =2, a 1 =2, a 2 =1, q=2, update m 1 The amount of allocated data is: 1 =[2*(2-1)+1]*[1*(2-1)+1]=6.

[0116] Loop 5:

[0117] The same as the above loop, the result is: select the data in part 3 (x 13 ) is assigned to the edge server m 2 , and the data x 22 Direct feedback to users 3 .

[0118] Loop 6:

[0119] The same as the above loop, the result is: select the data in part 1 (x 31 ) is assigned to the edge server m 3 .

[0120] S6: At this point, all the user's data has been uploaded, and the edge server m 1 、m 2 、m 3 The aggregated data are:

[0121] The above is the generation process of the encoding scheme from user to middle-layer node.

[0122] 2. Global aggregation and local aggregation process

[0123] S1: The user uses the gradient parameters received from the edge server or the central server to perform local training. 1 After each round, the data needs to be processed and sent to the edge server; using the federated average algorithm, the objective function of the central server is:

[0124]

[0125] Where N is the number of clients participating in the training, D i is the dataset of user i, |D i | is data D i The amount of data, is the sum of all user data sets;

[0126] User training completed 1 After the round, the gradient parameter w needs to be obtained i (k) and |D i|Multiply to get |D i |×w i (k), then |D i |×w i (k) The data is sent to the edge server according to the Greedy-NFC encoding scheme mentioned above. In particular, if the amount of training data of the users is equal, the original gradient parameters are directly transmitted without processing the data, and the result is:

[0127]

[0128] S2: The user uploads the data to the edge server according to the Greedy-NFC method. After receiving the data, the edge server performs arithmetic and operation on the same part of the data; the number of times the edge server is aggregated is updated τ+1;

[0129] S3: If τ<τ 2 The aggregated data Feedback to the user. Userσ 1 Received from edge server m 1 、m 2 Feedback data The same part of the data according to Find the new parameters by averaging: User 2 , σ 3 Same reason.

[0130] S4: If τ = τ 2 The aggregated data is then transmitted to the central server, and the same part of the data is transmitted according to Find the average Then transmit it back to the user end to start a new round of training.

[0131] S5: Iterate S1→S2→S3→S4 until the training requirements are met.

[0132] 3. Efficiency comparison between this solution and traditional solutions

[0133] First, the calculation method of the network function calculation rate is explained: If a coding scheme enables the central server to calculate k symbol functions f(x 1,j ,x 2,j ,…,x s,j ), (j = 1, 2, ..., k), and each edge transmits at most n symbols from alphabet B, then we call the network function calculation rate of this (k, n) encoding scheme: Here we assume that A = B, then the network function calculation rate is simplified to: The physical meaning is that using the network n times can calculate the objective function k times.

[0134] Compared with the traditional scheme, the uplink encoding scheme in the present invention improves the network function calculation rate. Since users need to send enough information, we do not consider the transmission optimization from users to edge servers, but only need to consider the communication bottleneck optimization from edge servers to central servers. Fig. 9 , Fig.10 The comparison of the simple encoding scheme intuitively illustrates the advantages of this encoding scheme.

[0135] In the traditional tree structure, each user is only connected to one edge server, so the entire data needs to be sent to the edge server. Therefore, even after the edge server performs the calculation, it still needs to transmit k symbols to the central server, and the network function calculation rate is 1. If we consider Fig. 9 The network coding scheme for connecting multiple edge servers shown in Fig. 1 (assuming that q in the alphabet A = {0, 1, ..., q-1} is large enough): Each user divides the data into two equal parts (because the user has two transmission links), and the size of each data after division is symbols are sent to the edge server by two links. Due to the “barrel effect”, the overall communication efficiency of the network is limited by the link that needs to transmit the most data. It can be seen that the communication bottleneck is at the edge server m. 2 On the link from the central server to the central server, because the two parts of data need to be sent separately, that is, k symbols, the communication cost is not reduced compared with the tree structure, and the network function calculation rate is still 1. Another encoding scheme is to divide the data generated by each user into three parts according to the scheme proposed by the present invention (see the specific embodiment), and each data has Symbols, such as Fig.10 As shown, after encoding, the amount of data sent from each edge server to the top node is two copies of data, that is, data, according to The network function calculation rate is obtained as

[0136] The embodiments described above are only descriptions of the preferred modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A network function computing coding scheme for hierarchical federated learning, characterized in that: It includes the following three components: P1. A hybrid network structure model with multiple edge server connections; P2. An encoding transmission scheme for user-edge servers; P3. The global aggregation and local aggregation processes of the model.

2. The solution according to claim 1, characterized in that P1 is a three-layer cloud-edge-end collaborative network structure where each user is connected to one or more edge servers, and each edge server is connected to the central server.

3. The solution according to claim 2, characterized in that: The specific network structure is as follows: In the network, the top layer is a central server that aggregates the parameters of users in the system to further perform federated learning calculations; the middle layer is r edge servers m i , 1≤i≤r, performs partial data aggregation and forwarding; the bottom layer is s users σ i , 1≤i≤s, each user randomly connects to a different edge server and uploads his own parameter data to the edge server. User σ i The number of connected edge servers is denoted as C i .

4. The solution according to claim 3, characterized in that: Each user σ i , 1≤i≤s, the generated parameter data x i There are k symbols, each of which is contained in the alphabet A = {0, 1, 2, ..., q-1}: x i =(x i,1 , x i,2 , ..., x i,k ), x i,j ∈A.

5. The solution according to claim 1, characterized in that: P2 includes the following steps: S2.

1. Evenly divide the parameter data of each user; Each user σ i , 1≤i≤s generated parameter data x i Each of them has k symbols, and the parameter data x generated by each user i It is equally divided into r parts, which is the number of edge servers; In the actual application scenario, k is much larger than r, and k is approximately regarded as divisible by r; The parameter data x of each user i After being equally divided into r parts, each part of the parameter data contains symbols, and are arranged into part 1, part 2, ..., part r according to the original order of the data; between the user and the edge server, the data is divided into parts, that is, symbols, upload and aggregate operations as a whole; S2.

2. Initialize the settings of the edge server; Setting up the edge server i The amount of allocated data is l i , 1≤i≤r,l i The initial value is 1; Setting up the edge server i The search index is d i , 1≤i≤r,d i The initial value is i; Start cycling from the (i + 1)%r part in each round, where % represents the modulo operation; S2.

3. Sort and select the edge server for the data to be allocated in this round of decision-making; Define the following two rules, according to each edge server m i , the amount of allocated data l with 1≤i≤r i To sort the edge servers: If l a <l b , then m a The order of is higher; If l a = l b and a < b, then m a is sorted earlier; According to the above order, traverse the edge servers from front to back and determine the edge server m i Whether the data of the connected user has been transmitted; If no, select m i ,If so, continue to traverse the next edge server in the sorting and re-execute the judgment until an edge server is selected; S2.

4. Retrieve the user data connected to the edge server selected in S2.3, and generate an uplink encoding transmission scheme through the greedy strategy; For S2.3 selected edge server m i , retrieve the data to be allocated and transmitted among the users connected to it, a total of r parts; for each part of the data, find out how many nodes have not yet transmitted the data; according to m i The current search index d i , will be from the d i Part to (d i +r-1) The %r part traverses and searches the data, where % represents the remainder operation; If the jth part of data is the largest to be transmitted, then the jth part of the node data that has not yet been transmitted is assigned to be transmitted to the edge server m i , by m i Aggregate this data; If the amount of data to be transmitted in part a and part b is the same, the order of their detection in the traversal search should be compared. If a is detected earlier than b, part a should be selected to be allocated and transmitted to edge server m. i ; Finally, m i The current search index d i Update to (j+1)%r, where % represents the remainder operation; S2.

5. Update the allocated data volume of the edge server selected in S2.3; For S2.3 selected edge server m i , which has been assigned to b i Round data aggregation, b i >1; the number of users aggregated in the jth round is recorded as a j , 1<j i , that is, for a j Arithmetic and operations are performed on the parameter data;​ According to information theory, the alphabet size of each symbol of the data generated by the jth round of aggregation is a j (q-1)+1, each parameter data is still symbols; After b i Round aggregation, that is, after arithmetic and operation, up to now m i The size of data that needs to be transmitted to the central server is: Since k and r are both constants, each subsequent iteration updates l according to the following formula: i : To measure the edge server m i The amount of allocated data; Calculate and update m i The corresponding l i ; S2.

6. Loop S2.3 - S2.5 until all the data of the underlying users has been allocated and transmitted to the corresponding edge servers, then end the loop; So far, an uplink encoding transmission scheme between the underlying user-edge servers is obtained, denoted as Greedy-NFC, Greedy Algorithm for Network Function Computing; Before the start of training, the central server generates an encoding scheme according to the network topology. In each round of training, users only need to upload the model update parameters to the edge server according to the corresponding transmission matrix, and there is no need to traverse the above process again.

6. The solution according to claim 1, characterized in that: P3 includes the following steps: S3.

1. Assume that users upload data to the edge server every T1 rounds, and the edge server uploads it to the cloud server after aggregating T2 times, that is, a global aggregation is performed only after users train T1T2 times; The initial value of the aggregation round number T of the edge server is 0; users use the gradient parameters received from the edge server or the central server for local training, and after training locally for T1 rounds each time, they need to process the data and send it to the edge server; Using the federated averaging algorithm, the objective function of the central server: Where N is the number of clients participating in the training, D i is the dataset of user i, |D i | is data D i The amount of data, is the sum of all user data sets; After the user has trained τ1 rounds, the obtained gradient parameter w i (k) and |D i |Multiply to get | D i |×w i (k), then | D i |×w i (k) The data is sent to the middle layer node according to the Greedy-NFC encoding scheme mentioned above. In particular, if the amount of training data of the users is equal, the original gradient parameters are directly transmitted without processing the data, and the result is: S3.

2. Users upload to the edge server according to the method of Greedy-NFC. After the edge server receives the data, it performs arithmetic sum operations on the same part of the data; update the aggregation times T + 1 of the edge server; S3.

3. If T < T2, then feedback the aggregated data back to the users, that is, local aggregation; since users receive data from multiple edge servers, it is necessary to calculate the federated average of the same part of the data: Where w( j )(k+1) refers to the update parameters of the jth part, N j refers to the number of users aggregated in the jth part, | D j | refers to the N of the jth part of the aggregation j The sum of the data of users; if the amount of training data of users is equal, then: S3.

4. If T = T2, then transmit the aggregated data to the central server, that is, global aggregation, and the central server calculates the federated average of each part of the data: Then transmit the updated gradient back to the users, and users do not need to process the data after receiving it; similarly, if the amount of data trained by users is equal, then: At the same time, the edge server restarts calculating the aggregation times: T = 0; S3.

5. Iterate S3.1→S3.2→S3.3→S3.4 until the training requirements are met.

Citation Information

Patent Citations

  • High-energy-efficiency computing communication joint optimization method for edge federated learning

    CN111176929A

  • Edge calculation and resource optimization method based on federated learning

    CN113791895A

  • System and method for distributed learning of wireless edge dynamics

    CN114930347A

  • Air computing federated learning design method under Cloud-RAN architecture

    CN117134805A

  • Cooperative edge cache optimization method based on asynchronous federated learning and perception clustering

    CN117873402A