Cache aggregation method and device oriented to hierarchical federated learning and storage medium

By introducing a cache window aggregation mechanism and adaptive window adjustment into hierarchical federated learning, the problems of high communication overhead and low bandwidth utilization in hierarchical federated learning are solved, achieving more efficient allocation of communication resources and model training accuracy.

CN121907780APending Publication Date: 2026-04-21STATE GRID FUJIAN ELECTRIC POWER CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID FUJIAN ELECTRIC POWER CO LTD
Filing Date
2025-11-21
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Hierarchical federated learning suffers from high communication overhead and low bandwidth utilization, especially in large systems where communication between edge servers and cloud centers is frequent and redundant, resulting in high network bandwidth consumption and communication costs, as well as low bandwidth utilization.

Method used

A cache window aggregation mechanism is introduced, where edge nodes cache model data from terminal devices and upload it in batches to the global aggregation server when aggregation conditions are met. Combined with an adaptive window adjustment strategy, communication efficiency is optimized, and batch processing of model updates is performed through filling, aggregation, and clearing operations of the cache queue.

Benefits of technology

It effectively reduces network resource overhead, improves the resource utilization of edge-cloud communication, enhances the accuracy and efficiency of model training, and meets the needs of parallel training for multiple terminal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121907780A_ABST
    Figure CN121907780A_ABST
Patent Text Reader

Abstract

The invention provides a hierarchical federated learning-oriented cache aggregation method and apparatus, and a storage medium, the method is executed by an edge node in hierarchical federated learning, and the edge node is in communication connection with a terminal device and a global aggregation server; for each global training round, the method comprises the following steps: receiving local model data uploaded by a terminal device corresponding to the edge node; under the condition that the quantity of the local model data cached in the cache window corresponding to the edge node is smaller than the window size of the current round, adding the received local model data into the cache window; and under the condition that an aggregation condition is met, aggregating the local model data cached in the cache window to obtain aggregated model data, and uploading the aggregated model data to a global aggregation server to obtain global model data. According to the invention, on the premise of ensuring the model training precision, the defects of high communication overhead and low bandwidth utilization rate of the existing hierarchical federation learning can be overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and in particular to a cache aggregation method and apparatus for hierarchical federated learning. Background Technology

[0002] The power grid is a critical national information infrastructure, and its stable operation is directly related to the lifeline of the national economy and national security. With the deepening of the construction of new power systems, the power grid is evolving from a traditional unidirectional transmission and distribution network to an energy internet characterized by interaction between power sources, grids, loads, and storage, and multi-energy complementarity. This process generates massive amounts of heterogeneous and sensitive power grid fundamental data (such as distribution automation terminal status data, user electricity consumption information, distributed energy output data, and equipment monitoring data). The compliant management and collaborative control of this data are core prerequisites for ensuring the safe, stable, and efficient operation of the power grid.

[0003] However, the inherent characteristics of power grid data bring enormous challenges to its value extraction: on the one hand, the data exhibits significant silo characteristics, with these data being scattered and stored in the hands of different entities such as provincial and municipal power companies, power generation groups, and users, forming independent "data silos" that make it difficult to effectively aggregate the data and thus impossible to carry out centralized AI modeling work; on the other hand, the privacy and compliance requirements of the data are extremely high. Because power grid data involves state secrets, trade secrets, and personal privacy, it is subject to a series of strict laws and regulations, and arbitrary transfer and sharing without permission are strictly prohibited.

[0004] Federated Learning (FL), a distributed machine learning paradigm where "the model moves while the data remains stationary," enables multiple clients to collaboratively train models without sharing the original data. This effectively solves the problems of "data silos" and privacy protection, providing a revolutionary technical path to overcome these challenges. FL allows data holders (such as local power supply companies and substations) to collaboratively train a global machine learning model by exchanging encrypted model update data without sharing the original data. This perfectly aligns with the compliance requirement of "data not leaving the domain," making it possible to achieve collaborative analysis and intelligent mining of network-wide data while ensuring data security. Examples include building more accurate load forecasting models, equipment fault early warning models, or distributed energy consumption strategies.

[0005] Federated learning, as a distributed machine learning paradigm, has a key architecture called Hierarchical Federated Learning (HFL). HFL typically employs a three-layer structure: client layer, edge layer, and cloud layer, aiming to alleviate the computational burden on cloud centers and reduce network communication overhead. In this architecture, after one or more rounds of local training on the terminal device, the updated model data is uploaded to the edge server for intermediate aggregation. After aggregation, the edge server uploads the results to the cloud server for global aggregation. The cloud server then distributes the latest global model update data to the edge servers and terminal devices, and this process iterates. Existing hierarchical federated learning schemes typically use a "one or more rounds of local training on the terminal - edge aggregation - cloud re-aggregation" model. Although repeated model updates (i.e., multiple rounds of local training on the terminal followed by uploading) reduce the communication frequency between the terminal and the edge server, the communication mode between the edge server and the cloud center remains "mandatory transmission per round," meaning that after each edge aggregation, the aggregation results must be immediately uploaded to the cloud center. This model has the following two significant drawbacks: (1) Communication overhead increases linearly with terminal scale: In large federated learning systems, the number of terminal devices may be very large, corresponding to a large number of edge servers. In each round of training, all edge servers need to communicate with the cloud center once, and the total amount of uplink communication is proportional to the number of edge servers, resulting in huge and continuous network bandwidth consumption and communication costs.

[0006] (2) Low bandwidth utilization and redundant transmission: The intermediate aggregation results frequently uploaded by the edge server may contain a large amount of redundant information, especially in the middle of training, when the model changes gradually become more gradual, and the direction of model update in multiple consecutive uploads may be basically the same. That is, the practice of uploading all model update data each time is inefficient and fails to fully compress and utilize the amount of information carried by each communication.

[0007] To understand the current state of technological development, existing patent applications were searched, compared, and analyzed, and the following technical information with high relevance to this invention was selected: Existing technical solution 1: Chinese patent application with publication number CN119316130A and application title "A Vertical Federated Learning Framework Based on Secret Sharing and Public Key Encryption". This patent application belongs to the field of federated learning technology and proposes a vertical federated learning framework suitable for scenarios with "multiple participants with complementary features and overlapping samples". The participating entities include one aggregation server and two or more participants. In training tasks and contribution calculation, it can protect the privacy data of the aggregation server and participants through secret sharing and enhance the privacy protection of the transmission channel by combining public key encryption. While reducing the computation and communication overhead of traditional security technologies, it ensures the model training accuracy and data compliance. The method includes: the aggregation server and each participant first perform a longitudinal federated learning training task. During the initialization phase, the sample space is aligned through privacy intersection (the aggregation server uniquely possesses the real labels). Each party generates and publishes its public key and establishes a routing table (two participants are divided into a first hop and a last hop; if there are more than two, an intermediate hop is added, specifying the next hop direction for each participant). Subsequently, each participant obtains partial prediction values ​​based on local data and transmits them according to the communication framework (the first hop slices the prediction values ​​and sends them to the aggregation server and the next hop respectively; the intermediate hop superimposes the received slices and local prediction values ​​before slicing and transmitting them; the last hop superimposes the slices and sends them to the aggregation server; the entire process is encrypted using the recipient's public key). After decryption, the aggregation server aggregates the training data, updates the parameters, and distributes the model error. Each participant updates its local model based on the error gradient descent. After training is completed, the aggregation server and each participant calculate the contribution. First, the aggregation server masks the aggregated values ​​with random numbers before distributing them. Each participant calculates the average distance weight and transmits the result to the aggregation server. Finally, the aggregation server calculates the contribution of each participant.

[0008] Existing technical solution 2: Chinese invention patent with authorization number CN119210465B and application name "A hierarchical federated learning method with adaptive compression coding". This patent belongs to the field of electronic digital data processing technology and proposes a hierarchical federated learning method suitable for large-scale data processing and model training. The participating entities include terminal devices, edge servers and cloud servers. It can make full use of the computing resources of each layer by constructing a hierarchical architecture. Combined with adaptive compression coding to dynamically match the transmission compression rate, it solves the problems of device training asynchrony and transmission deviation accumulation caused by traditional fixed training methods. While reducing communication costs and training latency, it ensures model aggregation quality and data transmission efficiency. The method includes: first, constructing a hierarchical federated learning architecture consisting of terminal devices, edge servers, and cloud servers; then, acquiring data processing information such as the number of CPU cores, clock frequency, and solid-state drive read / write speed of each terminal device, evaluating the data processing performance index, and matching corresponding edge servers according to a predefined performance index range (prioritizing matching terminal devices of the same performance level to the same edge server); each terminal device collecting environmental data from the environmental resource scheduling cloud platform to train the model, determining the model generation performance evaluation value (calculated by combining model generation time, number of CPU cores, memory usage, and hard drive read / write efficiency), and if the evaluation value meets the standard, inputting the model into the edge server. If the performance of the cloud server fails to meet the standards, a performance warning is issued. Simultaneously, the edge server monitors network performance indicators such as transmission bandwidth, latency, and packet loss rate at each input terminal and matches them with corresponding compression ratios. Based on the terminal model performance comparison results, the edge server performs adaptive compression encoding and edge aggregation on the received terminal models according to the matched compression ratio. The cloud server receives the edge aggregation results at preset intervals and performs global aggregation, then determines the global aggregation quality indicators (calculated by combining aggregation completion, aggregation duration, terminal memory usage, and edge output bandwidth). Finally, if the global aggregation quality indicators meet the standards, the cloud server uploads the results to the environmental resource scheduling cloud platform; otherwise, an aggregation quality warning is issued.

[0009] The core objective of existing technical solution 1, which uses secret sharing and public-key encryption, is to address privacy leaks in vertical federation scenarios. While it ensures data security through secret sharing and public-key encryption, it fails to optimize "communication efficiency," resulting in significant bandwidth and latency waste in its transmission process. Technically, its communication framework relies on "multi-hop slice transmission": the first-hop participant sends predicted value slices to the aggregation server and the next hop separately; intermediate hops require overlapping slices before splitting and transmitting; and the final hop sends two slices to the aggregation server. Furthermore, every step requires public-key encryption and private-key decryption—this "multi-node, multi-round, multi-slice" transmission logic significantly increases the number of data transmissions and the total data volume. While existing technical solution 2's adaptive compression coding can reduce the amount of data transmitted per round, it neglects the equally crucial communication optimization dimension of "transmission frequency." Regardless of changes in the timeliness of terminal model updates, the aggregation pressure on edge servers, or the real-time network load, it mechanically receives, compresses, and uploads packets according to a predetermined cycle, ignoring the redundant bandwidth waste caused by "unnecessary transmissions" and missing opportunities to further reduce overall communication overhead. In other words, existing technical solutions 1 and 2 have failed to address the problems of high communication overhead and low bandwidth utilization in federated learning.

[0010] At present, hierarchical federated learning systems are in a stage of rapid development, but the communication overhead from edge to cloud is still a key bottleneck restricting system performance. Moreover, hierarchical federated learning involves diverse devices and complex training tasks. For example, mobile devices, IoT devices, and edge nodes (i.e., edge servers) can all participate in federated learning training. Different devices often have different computing capabilities, communication conditions, and data distribution characteristics, and their settings and requirements for training rounds, model size, upload frequency, and service quality also differ.

[0011] Therefore, there is an urgent need for a suitable communication optimization scheme that can minimize communication overhead, improve bandwidth utilization, and meet the needs of parallel training of multiple terminal devices (such as network service quality requirements) while ensuring model training accuracy. Summary of the Invention

[0012] In view of this, embodiments of the present invention provide a cache aggregation method and apparatus for hierarchical federated learning, which can reduce network resource overhead and achieve an optimal balance between communication efficiency and model accuracy.

[0013] One aspect of the present invention provides a cache aggregation method for hierarchical federated learning, which is executed by edge nodes in hierarchical federated learning, the edge nodes being communicatively connected to a terminal device and a global aggregation server respectively; for each global training epoch, the method includes the following steps: Receive local model data uploaded by the terminal devices corresponding to the edge nodes; If the amount of local model data cached in the cache window corresponding to the edge node is less than the current round window size, the received local model data will be added to the cache window. When the aggregation conditions are met, the local model data cached in the aggregation cache window becomes the aggregated model data, and the aggregated model data is uploaded to the global aggregation server to obtain the global model data.

[0014] In some embodiments of the present invention, after receiving local model data, the method further includes: If the amount of local model data cached in the cache window corresponding to the edge node is equal to the window size of the current round, the received local model data is not added to the cache window, or the first local model data added to the cache window is removed and the received local model data is added to the cache window.

[0015] In some embodiments of the present invention, the window size in the current round of global training is a set initial window value, and the window size in the current round of global training in each round after the first round is determined according to the window adaptive strategy. Window adaptation strategies include: If the total model difference obtained from the aggregated local model data in the previous round of global training is less than the first set difference threshold, then the minimum value between the sum of the previous round window size and the first set change value and the set maximum window size shall be taken as the current round window size. If the total model difference obtained from the aggregated local model data in the previous round of global training is greater than the second set difference threshold, then the maximum value between the difference between the previous round window size and the second set change value and the set minimum window value will be taken as the current round window size. If the total model difference obtained from the aggregated local model data in the previous round of global training is not less than the first set difference threshold and not greater than the second set difference threshold, then the window size of the previous round will be used as the window size of the current round; wherein the first set difference threshold is not greater than the second set difference threshold.

[0016] In some embodiments of the present invention, the total model variance is obtained in the following manner: After determining that the received local model data will be added to the cache window, the difference between the local model data and the mean of the existing local model data in the cache window is calculated to obtain the model difference degree corresponding to the local model data. After determining that the aggregation condition has been met, the mean of the model dissimilarity corresponding to all local model data cached in the cache window is calculated to obtain the total model dissimilarity.

[0017] In some embodiments of the present invention, obtaining aggregated model data from local model data cached in the aggregated cache window includes: performing a weighted summation on the local model data cached in the cache window, and obtaining aggregated model data based on the summation result.

[0018] In some embodiments of the present invention, the aggregation weight corresponding to the local model data cached in the cache window is determined based on the size of the local dataset of the terminal device that uploaded the local model data; The stopping condition for iterative training in hierarchical federated learning is reaching the maximum number of global training rounds or the global model data satisfying the convergence condition; and The aggregation condition is set based on whether the amount of local model data cached in the cache window corresponding to the edge node is equal to the size of the cache window in the current round.

[0019] In some embodiments of the present invention, after uploading the aggregation model data to the global aggregation server, the method further includes: The cached local model data in the cache window corresponding to the edge node is cleared, so that the cache window corresponding to the edge node is empty.

[0020] Another aspect of the present invention provides a cache aggregation apparatus for hierarchical federated learning, including a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the apparatus implements the steps of the method described in any of the above embodiments.

[0021] Another aspect of the present invention provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0022] Another aspect of the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described in any of the above embodiments.

[0023] This invention proposes a cache aggregation method and apparatus for hierarchical federated learning. By incorporating the idea of ​​cache window aggregation, it improves the traditional communication mode of hierarchical federated learning, completing batch processing of local model data through operations such as simulating cache data filling and aggregation. The method proposed in this application can achieve more efficient allocation of communication resources, improve the resource utilization of edge-cloud communication, and maximize the accuracy and efficiency of federated learning training.

[0024] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.

[0025] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description

[0026] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings: Figure 1 This is a flowchart illustrating a cache aggregation method for hierarchical federated learning in one embodiment of the present invention.

[0027] Figure 2 This is a flowchart illustrating a cache aggregation method for hierarchical federated learning in another embodiment of the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0029] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0030] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0031] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0032] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0033] In a hierarchical federated learning scenario, edge-cloud communication optimization is crucial for improving the overall performance and resource utilization of the federated learning system. Currently, the communication mode between edge servers and the cloud center uses a "transmission every round" approach, which not only causes communication overhead to increase linearly with the number of terminals but also results in redundant transmissions.

[0034] Based on this, this application proposes a cache aggregation method for hierarchical federated learning, aiming to improve the communication efficiency of hierarchical federated learning systems in multi-terminal device parallel training scenarios, thereby improving federated learning training performance and enhancing model accuracy and system reliability. Specifically, this invention improves the traditional communication mode of hierarchical federated learning by combining the idea of ​​cache window aggregation mechanism. It introduces a model cache window to improve the aggregation process and upload strategy of edge nodes, and further uses an adaptive window adjustment mechanism to optimize the resource utilization, communication efficiency, and global model convergence performance of edge nodes. By applying the improved cache window aggregation scheme to hierarchical federated learning, a more efficient communication resource allocation scheme can be achieved, improving the resource utilization of edge-cloud communication and maximizing the accuracy and efficiency of federated learning training. Among them, the cache window aggregation mechanism is an aggregation algorithm for federated learning communication optimization based on the ideas of cache queues and batch processing. The cache window aggregation algorithm completes the batch processing of model updates by simulating operations such as filling, aggregation, and clearing of cache queues, and has excellent communication optimization performance.

[0035] Furthermore, since the allocation of computing and storage resources on the cloud server (also known as the global aggregation server) is difficult to directly control at the edge nodes, this application focuses on model aggregation and upload strategies on edge nodes to optimize the "edge-cloud" connection. Edge nodes use cache windows to uniformly cache and aggregate received local model update data, maximizing the use of limited edge-cloud communication bandwidth resources to meet the needs of global federated learning training. Specifically, this application constructs a corresponding cache window for each edge node in the edge layer to receive and cache local model data uploaded by the terminal devices served by that edge node. When aggregation conditions are met, the cached local model data is aggregated and uploaded to the global aggregation server for global aggregation to obtain global model data. The local model data uploaded by the terminal devices mentioned in this application can be local model parameters and / or local model gradients obtained by updating the model on the terminal devices. The aggregated model data uploaded by the edge nodes can be aggregated model parameters and / or aggregated model gradients obtained by the edge nodes. The global model data is obtained by the global aggregation server updating the model based on the aggregated model data and can be global model parameters and / or global model gradients. Furthermore, the cache window corresponding to each edge node can also be regarded as a cache pool. The size of the cache window can be understood as the capacity of the cache pool (i.e., the cache window size is used to indicate the amount of local model data that the cache window can hold), and the size of the cache window can be further adjusted in each round of global training through an adaptive adjustment mechanism. The local model data cached in the cache window can be stored in the cache window in the form of a queue.

[0036] In some embodiments of the present invention, the hierarchical federated learning system architecture may be configured as follows: The hierarchical federated learning architecture proposed in this application may include a terminal device layer (i.e., the client layer), an edge layer, and a cloud center layer. The terminal device layer includes N terminal devices, each maintaining a local dataset and a copy of the model. The terminal device layer can be represented as follows: ( The edge layer consists of K edge nodes, each responsible for the aggregation task of one or more terminal devices. The edge layer can be represented as follows: ( The cloud center layer includes a global aggregation server, which is responsible for receiving the aggregation results uploaded by edge nodes and performing global aggregation.

[0037] The aggregated training weights corresponding to each terminal device are (Edge nodes aggregate local model data based on aggregation weights, which can be determined based on the size of the local dataset on each terminal device.) The size of the local model data updated by each terminal device is... The minimum upload frequency requirement for each terminal device is: The set of available communication links between the edge layer and the cloud center layer is as follows: (Each edge node has at least one available communication link with the global aggregation server), and the set of available bandwidth for each communication link is: For all edge nodes, model aggregation can be processed in parallel by the corresponding cache windows. The size of the cache window corresponding to each edge node is ( ), No. The window (i.e., the first window) The number of local model data cached within the cache window corresponding to each edge node is ( Without considering the removal of local model data from the cache window, since the terminal device uploads the local model data to the edge server after local training, It also indicates the first All terminal devices corresponding to each edge node (each terminal device corresponds to only one edge node, i.e., it only receives services from one edge node) and the first edge node. The total number of communications between edge nodes.

[0038] As an example, based on the above settings, this application can model the hierarchical federated learning communication optimization problem as follows: Based on the communication scenario modeling to determine the objective function and constraints, the key to this application lies in how to design a window aggregation strategy to minimize the number of edge-cloud communications (to reduce communication overhead and bandwidth utilization) while meeting the minimum communication frequency requirements of all terminal devices, and simultaneously maintaining model training accuracy and convergence stability. Based on the above definitions, the multi-objective constraint model for hierarchical federated learning communication optimization can be: ; ; ; st Constraint 1 Constraint 2 Constraint 3 Constraint 4 in, and They are edge nodes (i.e., the first) The communication overhead weighting coefficient and bandwidth utilization weighting coefficient of each edge node. For terminal devices (i.e., the first) The priority weight of each terminal device. Indicates terminal device Upload local model data to edge nodes Number of times, Display window For terminal equipment The service quality factor can be obtained from the hierarchical federated learning network.

[0039] In the above problem modeling, This represents the weighted average of the communication overhead across all cached windows. express The goal is to minimize the number of edge-cloud communications. express The goal is to maximize bandwidth utilization between the edge and the terminal during window aggregation to avoid excessive bandwidth usage on individual communication links, which could lead to link congestion and increased transmission latency. This indicates the degree to which the terminal device meets the Quality of Service (QoS) requirement. It means The goal is to maximize the overall service level between the edge and the terminal. Additionally, constraint 1 states that the aggregated service frequency allocated to each terminal device should meet its minimum communication requirements, which is fundamental to ensuring QoS during federated learning training. Constraint 2 is a bandwidth resource constraint, indicating that the... The window (i.e., the first window) The total size of all model updates processed by the cache windows corresponding to each edge node shall not exceed the total available bandwidth of the link. Constraint 3 is a window capacity constraint, indicating that the amount of local model data cached in any cache window cannot exceed the window size. Constraint 4 is a variable constraint, indicating the range of values ​​for the decision variables.

[0040] As an example, in the hierarchical federated learning communication optimization problem, communication overhead, bandwidth utilization, and service quality are objective functions with different dimensions. To facilitate the solution of subsequent algorithms, the above objective functions can be normalized and dimensionless, and the multi-objective model can be constructed into a single-objective model using the idea of ​​linear weighting. The specific expression can be: ; in, , , These are dimensionless standardized functions. , and The objective functions are respectively , , The weight, and They represent the objective functions respectively. ( The minimum and maximum values ​​(for specific values) of ). This indicates the penalty for violating the constraint, which is set according to the specific circumstances.

[0041] The aforementioned modeling transforms the hierarchical federated learning communication optimization problem into a non-deterministic polynomial complete (NPC) problem with polynomial complexity. Traditional fixed aggregation strategies (such as synchronous and asynchronous aggregation) easily lead to wasted communication resources, and the optimization effect cannot be guaranteed. This invention, based on goal modeling, proposes a hierarchical federated learning communication optimization scheme based on cached window aggregation. This cached aggregation method can be executed by each edge node in the hierarchical federated learning process. Each edge node communicates with the terminal devices it serves (in this application, the terminal devices served by the edge nodes can be referred to as the terminal devices corresponding to the edge nodes), and each edge node communicates with the global aggregation server. In each global training round, each terminal device can perform one or more rounds of model updates. In this application, each edge node can perform one model aggregation, and the global aggregation server performs one global model update and distributes the updated data to all terminal devices and edge nodes.

[0042] In each round of global training, the client layer, edge layer, and cloud center layer all use the same model update steps. The following description uses one global training round for an edge node. Furthermore, for simplicity, when using formulas below, the local model gradient is taken as the local model data uploaded by the terminal device, the aggregated model gradient is taken as the aggregated model data, and the global model parameters are taken as the global model data.

[0043] Figure 1 This is a flowchart illustrating a cache aggregation method for hierarchical federated learning in one embodiment of the present invention. Figure 1 As shown, the method includes steps S110 to S130.

[0044] Step S110: Receive local model data uploaded by the terminal devices corresponding to the edge nodes. That is, each terminal device performs one or more rounds of gradient descent training based on its local dataset, and then the terminal device can upload the trained local model data (such as local model gradients) to the corresponding edge node. The use of gradient descent for training by the terminal devices is only an example; other training methods such as multi-task learning (MTL) can also be used, and this invention is not limited to this.

[0045] Assuming in the first One global training round ( , To maximize the number of global training rounds, (and must be an integer), terminal device Can be performed ( ( ) Rounds of local training. Terminal equipment The formula for performing local training can be expressed as follows: ; in, Indicates terminal device The local loss function, The gradient of the loss function is represented. Indicates the first Global model data distributed by the cloud center for each global training round. This represents the learning rate. This is the set value.

[0046] terminal equipment After execution After a round of local training, the local model gradient (representing the parameter update amount) can be obtained. Upload to the corresponding edge node.

[0047] Step S120: If the number of local model data cached in the cache window corresponding to the edge node (one terminal device uploads one local model data at a time) is less than the current round window size, the received local model data is added to the cache window.

[0048] Assuming in the first Each global training round, for edge nodes Upon receiving the terminal device Uploaded local model data After that, you can Add the corresponding cache window, and the cache window will then be updated as follows: ; ; in, Indicates the first Cache window during round global training (No. The local model data cached in the cache window corresponding to each edge node. Indicates the first Cache window during round global training The amount of cached local model data. and In the The changes can be made in real time during the global training round.

[0049] In some embodiments of the present invention, after the edge node receives local model data, the method further includes: if the number of local model data cached in the cache window corresponding to the edge node is equal to the current round window size, either not adding the received local model data to the cache window, or removing the first local model data added to the cache window and adding the received local model data to the cache window. That is, assuming in the... Each global training round, edge nodes The corresponding cache window size equal In this case, the cache window will not be updated, or the cached data will be replaced with newly received local model data (at this time). renew, (No change).

[0050] As an example, before performing global training in the current round, edge nodes The cache window parameters need to be initialized (for example, the cache window parameters can be initialized before executing step S110). At this time, the window is set to empty, and the number of local model data cached in the window is 0, which can be expressed by the formula: , For example, after the aggregated model data is uploaded to the global aggregation server in step S130 (or after the edge node receives the global model data sent by the global aggregation server), the local model data cached in the cache window corresponding to the edge node is cleared (all local model data in the cache window is removed), so that the cache window corresponding to the edge node is empty.

[0051] Furthermore, this invention can improve the traditional window mechanism by incorporating the idea of ​​adaptive window size control, dynamically adjusting the window size and upload strategy by introducing a model difference factor. The current round window size refers to the size of the cached window in the current global training round. In each round of global training, the current round window size is a fixed value, but the current round window size can differ in different global training rounds. That is, the current round window size in the first round of global training (which can be simply referred to as the first round window size) is the set initial window value, which can be expressed by the formula: ,in, Indicates the window size in the first round. This represents the initial window value set (which can be customized as needed, for example...). (Set to any integer between 5 and 10); the size of the cache window in each round of global training after the first round is determined according to the window adaptation strategy.

[0052] As an example, the window adaptation strategy may include: if the total model variance obtained based on the aggregated local model data (i.e., the local model data aggregated in step S130) in the previous round of global training is less than a first set variance threshold, then the minimum value between the sum of the previous round window size (i.e., the size of the cached window in the previous round of global training) and the first set change value and the set maximum value of the window is taken as the current round window size; if the total model variance obtained based on the aggregated local model data in the previous round of global training is greater than a second set variance threshold, then the maximum value between the difference between the previous round window size and the second set change value and the set minimum value of the window is taken as the current round window size; if the total model variance obtained based on the aggregated local model data in the previous round of global training is not less than the first set variance threshold and not greater than the second set variance threshold, then the previous round window size is taken as the current round window size. The window adaptation strategy can be expressed by the following formula: ; in, This represents the total model dissimilarity obtained from the aggregated local model data in the previous round of global training. and The first set difference threshold and the second set difference threshold are respectively set. ), and These are the first set change value and the second set change value (the first set change value and the second set change value can be the same or different, such as...). ), and These represent the upper bound (i.e., setting the maximum value of the window) and the lower bound (i.e., setting the minimum value of the window) of the window size, respectively. , , , , and The numerical values ​​can all be set by the user, and .

[0053] For example, , , Adjust the learning rate for the window. and These are the user-defined options for increasing and decreasing the number of windows. This indicates the integer division operation.

[0054] The total model variance can be obtained as follows: After determining that the received local model data will be added to the cache window (… ,or After removing and replacing local model data, calculate the difference between the local model data and the mean of the existing local model data in the cache window to obtain the model dissimilarity corresponding to the local model data. After determining that the aggregation condition has been met, calculate the mean of the model dissimilarity corresponding to all local model data cached in the cache window to obtain the total model dissimilarity. It should be noted that if there is a case where local model data is removed and replaced from the cache window, after removing the first local model data added to the cache window, calculate the difference between the local model data to be added to the cache window and the mean of the cached data in the current cache window.

[0055] In the Each global training round, edge nodes Received from terminal device Uploaded local model data And after determining that the received local model data will be added to the cache window, a cache window adaptive adjustment mechanism will be initiated to calculate the first... The cache window size during global training is determined. The adaptive adjustment mechanism for the cache window includes calculating the model dissimilarity corresponding to specific local model data, calculating the total model dissimilarity, and implementing the window adaptive strategy.

[0056] The model dissimilarity for specific local model data can be expressed by the following formula: ; in, This indicates the existing local model data in the cache window. Represents local model data Cache in cache window middle( Different from ), express The corresponding difference (the model difference corresponding to the first local model data added to the cache window is itself).

[0057] The formula for calculating the total variance of the model can be: .

[0058] Step S130: When the aggregation conditions are met, the local model data cached in the aggregation cache window is converted into aggregated model data, and the aggregated model data is uploaded to the global aggregation server to obtain global model data.

[0059] As an example, the aggregation condition is set based on whether the amount of local model data cached in the cache window corresponding to the edge node is equal to the cache window size of the current round. To avoid conflict with the condition in step S120 for determining whether local model data should be added to the cache window, the aggregation condition can be that the amount of local model data cached in the cache window corresponding to the edge node is equal to the cache window size of the current round, and the duration of global training in the current round reaches the set time. This application does not specifically limit the aggregation condition; it can be set around the cache window mechanism.

[0060] In some embodiments of the present invention, obtaining aggregated model data from local model data cached in the aggregated cache window includes: performing a weighted summation on the local model data cached in the cache window, and obtaining the aggregated model data based on the summation result. Edge nodes The process of performing aggregate calculations can be represented as follows: ; in, Represents edge nodes In the The aggregated model gradient obtained from each global training epoch. Indicates terminal device The corresponding aggregation weights. Furthermore, the local model data cached in the cache window. Corresponding aggregate weight It can be determined based on the size of the local dataset of the terminal device uploading the local model data, such as... , Indicates terminal device ( The size of the local dataset.

[0061] The formula for calculating aggregated model data described above is merely an example. For instance, the local model data cached in the cache window can also be weighted and averaged, and the result can be used as the aggregated model data. This invention does not specifically limit the process of obtaining aggregated model data based on the summation result.

[0062] Furthermore, such as Figure 2 As shown, in the first In each global training round, the global aggregation server in the cloud center layer receives aggregated updates from each edge node. Perform global aggregation. The global aggregation formula can be expressed as follows: ; In the formula, Indicates the first The global model parameters are aggregated by the global aggregation server during the round of global training. Represents edge nodes The corresponding number of terminal devices This represents the total number of terminal devices. In other words, the weight of an edge node during the global aggregation process is determined based on the number of terminal devices corresponding to that edge node.

[0063] In some embodiments of the present invention, after the global aggregation server performs global aggregation, if the iterative training stopping condition is not met, the cloud center layer will obtain... The message is sent to each edge node, and the edge nodes will... Forwarded to the managed terminal devices. When the iterative training stopping condition is met (such as reaching the maximum global training rounds),... When the global model data obtained in the current global training round meets the convergence condition, the iterative training process of federated learning is stopped, and the final global model parameters are obtained. .

[0064] This application does not specifically limit the convergence condition. For example, if the stopping condition for iterative training is the global model data obtained in the current global training round... If the convergence condition is met, it can be expressed as: ; In the formula, This indicates the set convergence threshold.

[0065] The method proposed in this application represents a significant improvement in terms of time complexity, space complexity, and communication complexity. (1) Time complexity analysis: The time complexity of a single model aggregation is O(m d) The time complexity of window resizing is O(m), and the overall algorithm time complexity is O(T). K m d); where m is The average size of the cache window during the round of global training, where d is the dimension of the model parameters. (2) Space complexity analysis: The space complexity of each cache window is O(m d) The overall space complexity of the algorithm is O(K). m d). (3) Communication complexity analysis: The traditional method has O(T) communication rounds. N), the number of communication rounds in this algorithm is O(T). In contrast, the communication complexity of the method in this application is reduced by approximately m times (N / m).

[0066] The hierarchical federated learning communication optimization method based on cache window aggregation proposed in this invention is suitable for isolated data with high privacy requirements, such as power grid data. Compared with existing federated learning communication strategies, the method proposed in this application has the following significant advantages: (1) Communication efficiency is significantly improved and network resource consumption is greatly reduced. Traditional hierarchical federated learning uses a "per-round transmission" communication model between edge servers and the cloud center, resulting in high communication frequency and significant bandwidth waste. This invention innovatively introduces a cache window aggregation mechanism, formulating a global communication strategy for the heterogeneous needs of multiple devices: multiple local model update data are cached and batch-aggregated on edge nodes, and the aggregation results are only uploaded to the cloud center when aggregation conditions are met. This "batch upload" mode effectively reduces the number of communication sessions between the edge and cloud, alleviates the computational pressure on the cloud center, and significantly reduces network bandwidth consumption and communication latency. The reduction in communication overhead is particularly pronounced in scenarios with large-scale terminal devices, and the unique window management mechanism balances communication efficiency with model accuracy.

[0067] (2) Adaptive window adjustment mechanism to achieve dynamic performance optimization To address the challenge of traditional fixed window sizes failing to adapt to dynamic network environments and heterogeneous model updates, this invention proposes an adaptive window size adjustment algorithm based on model dissimilarity. By calculating the dissimilarity of model updates within the window in real time, the window size is dynamically adjusted: when the model update dissimilarity is large, the window is appropriately reduced to accelerate convergence; when the dissimilarity is small, the window is increased to reduce communication frequency. This adaptive mechanism enables the cache window to intelligently adjust its aggregation strategy according to the training state.

[0068] Corresponding to the above method, the present invention also provides a cache aggregation apparatus for hierarchical federated learning. The apparatus includes a computer device, which includes a processor and a memory. The memory stores computer programs / instructions, and the processor executes the computer programs / instructions stored in the memory. When the computer programs / instructions are executed by the processor, the apparatus implements the steps of the method described above.

[0069] This invention also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.

[0070] This invention also provides a computer program product storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer program product can be a tangible product, such as random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of product known in the art.

[0071] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0072] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0073] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0074] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A cache aggregation method for hierarchical federated learning, characterized in that, This method is executed by edge nodes in the hierarchical federated learning, which are communicatively connected to both the terminal device and the global aggregation server. For each global training epoch, the method includes the following steps: Receive local model data uploaded by the terminal device corresponding to the edge node; If the amount of local model data cached in the cache window corresponding to the edge node is less than the current round window size, the received local model data will be added to the cache window. When the aggregation conditions are met, the local model data cached in the aggregation cache window becomes the aggregated model data, and the aggregated model data is uploaded to the global aggregation server to obtain the global model data.

2. The method according to claim 1, characterized in that, After receiving the local model data, the method further includes: If the amount of local model data cached in the cache window corresponding to the edge node is equal to the current round window size, the received local model data is not added to the cache window, or the first local model data added to the cache window is removed and the received local model data is added to the cache window.

3. The method according to claim 1, characterized in that, In the first round of global training, the window size for the current round is the set initial window value. In each subsequent round of global training, the window size for the current round is determined according to the window adaptation strategy. The window adaptive strategy includes: If the total model difference obtained from the aggregated local model data in the previous round of global training is less than the first set difference threshold, then the minimum value between the sum of the previous round window size and the first set change value and the set maximum window size shall be taken as the current round window size. If the total model difference obtained from the aggregated local model data in the previous round of global training is greater than the second set difference threshold, then the maximum value between the difference between the previous round window size and the second set change value and the set minimum window value will be taken as the current round window size. If the total model difference obtained from the aggregated local model data in the previous round of global training is not less than the first set difference threshold and not greater than the second set difference threshold, then the window size of the previous round will be used as the window size of the current round; wherein the first set difference threshold is not greater than the second set difference threshold.

4. The method according to claim 3, characterized in that, The overall model variance was obtained in the following way: After determining that the received local model data will be added to the cache window, the difference between the local model data and the mean of the existing local model data in the cache window is calculated to obtain the model difference degree corresponding to the local model data. After determining that the aggregation condition has been met, the mean of the model dissimilarity corresponding to all local model data cached in the cache window is calculated to obtain the total model dissimilarity.

5. The method according to claim 1, characterized in that, The process of obtaining aggregated model data from local model data cached in the aggregated cache window includes: performing a weighted summation on the local model data cached in the cache window, and obtaining aggregated model data based on the summation result.

6. The method according to claim 5, characterized in that, The aggregation weights corresponding to the local model data cached in the cache window are determined based on the size of the local dataset of the terminal device that uploaded the local model data; The stopping condition for iterative training in hierarchical federated learning is reaching the maximum number of global training rounds or the global model data satisfying the convergence condition. as well as The aggregation condition is set based on whether the amount of local model data cached in the cache window corresponding to the edge node is equal to the size of the cache window in the current round.

7. The method according to claim 1, characterized in that, After uploading the aggregated model data to the global aggregation server, the method further includes: The cached local model data in the cache window corresponding to the edge node is cleared, so that the cache window corresponding to the edge node is empty.

8. A cache aggregation device for hierarchical federated learning, comprising a processor, a memory, and a computer program / instructions stored in the memory, characterized in that, The processor is configured to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the method as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • A hierarchical federated learning method with adaptive compression coding

    CN119210465B

  • Longitudinal federated learning framework based on secret sharing and public key encryption

    CN119316130A