Carbon-efficient federated learning methods and apparatus on edge computing systems
By constructing a hybrid grouping framework federated learning method in edge computing systems, combining synchronous and asynchronous training methods with energy consumption optimization, the high carbon efficiency problem caused by the uncertainty of RE generation in edge computing systems is solved, and efficient federated learning training is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAT UNIV OF DEFENSE TECH
- Filing Date
- 2025-07-18
- Publication Date
- 2026-06-12
AI Technical Summary
In edge computing systems, how to achieve a balance between participant configuration, data distribution, and renewable energy availability to enable highly carbon-efficient federated learning training, especially when RE generation is highly uncertain and dynamic, is a challenge, as existing methods often lead to suboptimal solutions.
By constructing a hybrid grouping framework for federated learning training, and employing synchronous and asynchronous training methods, edge servers are grouped, and loss function values are calculated within each group to generate gradients and model parameter updates. Parameters are aggregated using synchronous and asynchronous aggregators, and total carbon emissions are calculated by combining energy consumption and RE generation to optimize energy demand.
While taking into account participant response latency and data distribution, energy demand was optimized, total carbon emissions were reduced, and the efficiency and accuracy of model training were improved.
Smart Images

Figure CN122195626A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of edge computing technology, and in particular to a carbon-efficient federated learning method and apparatus for edge computing systems. Background Technology
[0002] Renewable energy (RE) is being widely harvested and supplied to computing facilities to achieve greater carbon efficiency, particularly for compute-intensive machine learning applications. Leading providers, including Microsoft, Google, and Amazon, have equipped their data centers with RE power plants to replace fossil fuels, either wholly or partially. Edge clusters or edge data centers have an advantage over centralized data centers in utilizing distributed RE supply because edge servers are geographically dispersed, facilitating access to diverse RE resources from nearby locations.
[0003] Figure 1 This section showcases a typical scenario of a distributed edge computing system, its node connectivity, and integrated RE (Resource Energy) power supply. Geographically proximate edge servers form an Energy Supply Segment (ESS). Each ESS draws energy from both the off-site conventional power grid and the on-site RE supply, with the former acting as a backup power source during RE shortages. For federated learning (FL) training supported by this hybrid energy supply, a direct approach to achieving high carbon efficiency is to selectively schedule a subset of edge servers for training. For example, servers with abundant RE resources (reducing carbon emissions) and high-performance configurations (shortening training time) within their ESSs should be prioritized during the selection process.
[0004] However, balancing participant configuration, data distribution, and RE availability is challenging. This multidimensional trade-off often leads to suboptimal solutions. In particular, to ensure training accuracy and efficiency, it is sometimes necessary to abandon RE-rich servers or even choose carbon-intensive servers, which significantly compromises carbon efficiency. Secondly, unlike off-site power supply, on-site RE generation (for each individual ESS) is more difficult to predict due to its reliance on local weather data. Effective evaluation can only be conducted in advance for tens of minutes. This short-term visibility leads to a lack of global planning, requiring participants to be selected online within each time period (such as FL training rounds) and gradually approximating the optimal solution. While the number of edge computing facilities is not as large as that of mobile clients, their scale is growing rapidly. Therefore, scalability is crucial for solutions handling large numbers of participants. Furthermore, RE sharing in a highly dynamic RE generation environment further exacerbates the overall challenges. Summary of the Invention
[0005] Therefore, it is necessary to provide a carbon-efficient federated learning method and apparatus for edge computing systems to address the aforementioned technical problems.
[0006] A carbon-efficient federated learning method on an edge computing system, the method comprising:
[0007] The participants in the edge server deployments across various energy supply segments will be grouped.
[0008] Within the group, each participant calculates the loss function value and generates gradients and updates the model parameters based on local data and a pre-distributed federated learning model; the updated parameters are sent to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the group's global model parameters for this iteration.
[0009] Between groups, the global model parameters within a group are uploaded to an asynchronous aggregator for asynchronous aggregation to obtain the global model parameters between groups;
[0010] The participants' computational and communication energy consumption in a single round is calculated based on their micro-batch data and computing network device configuration. The total energy consumption is then calculated, and the total carbon emissions within the group are calculated based on the total energy consumption and the RE generation of the ESS to which the participants belong.
[0011] Under the constraints of the total iteration duration and the total carbon emissions, the inter-group global model parameters are iteratively solved to minimize the inter-group global model loss function value.
[0012] In one embodiment, the method further includes: pre-grouping participants to obtain pre-grouping results; obtaining the label distribution vector of each participant in each pre-group and calculating the label distribution vector of that group; calculating the global label distribution vector based on the label distribution vectors of all participants; and calculating the Jensen-Shannon divergence based on the group label distribution vector and the global label distribution vector.
[0013] Clustering algorithms are used to identify the cluster centers of each group based on the participants' single round time.
[0014] The grouping influence index of participants is calculated based on the difference between the participant's single round time and the average single round time within the group and the Jensen-Shannon divergence within the group. Participants are then assigned to the cluster center with the least influence according to the grouping influence index to obtain a new group.
[0015] Update the cluster center of the new group and iterate until grouping is complete.
[0016] In one embodiment, the method further includes setting a time threshold, wherein when the difference between a participant's single round time and the average single round time within the group is greater than the threshold, the participant is removed from the current group.
[0017] In one embodiment, it further includes:
[0018] Calculate the gradient utility value of the selected set of participants within the group, minimize the gradient utility value to map the gradients of other participants within the group to the gradients of the selected participants corresponding to the gradient utility value, and calculate the loss function value of the federated learning model within the group.
[0019] In one embodiment, the method further includes: calculating the gradient utility value of participants in the selected set based on their historical gradient values.
[0020] In one embodiment, the process further includes: dividing the process of calculating the loss function value of the participant selection set based on the gradient utility value into sub-problems that are processed independently in each iteration round; and for each sub-problem, maintaining and updating a virtual queue for tracking the carbon emission budget surplus and deficit status to reflect carbon constraints in subsequent iterations.
[0021] In one embodiment, the method further includes: for each subproblem in the virtual queue, using a bidirectional greedy approximate search strategy to determine a subset of participants that meet carbon emission constraints and have gradient utility values.
[0022] A carbon-efficient federated learning device on an edge computing system, the device comprising:
[0023] The grouping module is used to group the edge server participants deployed in various energy supply segments;
[0024] The intra-group computation module is used to calculate the loss function value and generate gradients and update model parameters for each participant based on local data and pre-distributed federated learning models; the updated parameters are sent to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the intra-group global model parameters for this iteration round.
[0025] The inter-group calculation module is used to upload the global model parameters within the group to the asynchronous aggregator for asynchronous aggregation to obtain the global model parameters between the groups.
[0026] The carbon emission calculation module is used to calculate the computational energy consumption and communication energy consumption of the participants in a single round based on the participants' micro-batch data and computing network device configuration, calculate the total energy consumption, and calculate the total carbon emissions within the group based on the total energy consumption and the RE generated by the ESS to which the participants belong.
[0027] An iterative module is used to iteratively solve the inter-group global model under the constraints of the total iteration duration and the total carbon emissions, so as to minimize the loss function value of the inter-group global model.
[0028] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0029] The participants in the energy supply segment deployed on the edge server were grouped;
[0030] Within a group, each participant calculates the loss function value and generates gradients and updates model parameters based on local data and a pre-distributed federated learning model; the updated parameters are then sent to a synchronous aggregator; the synchronous aggregator aggregates the received parameter updates to obtain the group-wide global model parameters for that iteration; between groups, the group-wide global model parameters are uploaded to an asynchronous aggregator for asynchronous aggregation to obtain the group-wide global model parameters.
[0031] The computational and communication energy consumption of the participants in a single round is calculated based on the participants' micro-batch data and local data. The total energy consumption is calculated, and the total carbon emissions within the group are calculated based on the total energy consumption and the RE generation of the participant's ESS.
[0032] Under the constraints of the total iteration duration and the total carbon emissions, the inter-group global model parameters are iteratively solved to minimize the inter-group global model loss function value.
[0033] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0034] Within a group, each participant calculates the loss function value and generates gradients and updates model parameters based on local data and a pre-distributed federated learning model; the updated parameters are then sent to a synchronous aggregator; the synchronous aggregator aggregates the received parameter updates to obtain the group's global model parameters for that iteration; between groups, the group's global model parameters are uploaded to an asynchronous aggregator for asynchronous aggregation to obtain the group's global model parameters.
[0035] The computational and communication energy consumption of the participants in a single round is calculated based on the participants' micro-batch data and local data. The total energy consumption is calculated, and the total carbon emissions within the group are calculated based on the total energy consumption and the RE generation of the participant's ESS.
[0036] Under the constraints of the total iteration duration and the total carbon emissions, the inter-group global model parameters are iteratively solved to minimize the inter-group global model loss function value.
[0037] The aforementioned carbon-efficient federated learning method and device on the edge computing system integrates the advantages of synchronous and asynchronous training methods by constructing a hybrid grouping framework for federated learning training. After participants are grouped, within each group, the loss function value is calculated based on local data and a pre-built federated learning model, generating corresponding gradients and model parameter updates. The updated models are then aggregated through a synchronous aggregator to obtain the group's global model for the current round. Between groups, the group's global model is uploaded to an asynchronous aggregator for asynchronous aggregation, yielding the group's global model parameters. This approach considers participant response latency and data distribution, as well as the server-related energy supply context, and supports lightweight fine-tuning for group maintenance. Finally, based on the total energy consumption of each participant and the corresponding energy supply segment (RE) generation, the total carbon emissions within the group are calculated. During model iteration, both completion time and total carbon emissions are considered to optimize energy demand. Attached Figure Description
[0038] Figure 1 This is a typical scenario diagram of a distributed edge computing system, its node connections, and the integrated power supply for the RE in one embodiment;
[0039] Figure 2 This is a flowchart illustrating a carbon-efficient federated learning method on an edge computing system in one embodiment.
[0040] Figure 3 This is a pseudocode diagram of Algorithm 1 in one embodiment;
[0041] Figure 4 A pseudocode diagram of the method of Algorithm 2 in another embodiment;
[0042] Figure 5 This is a structural block diagram of a carbon-efficient federated learning device on an edge computing system in one embodiment.
[0043] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0045] In one embodiment, such as Figure 2 As shown, a carbon-efficient federated learning method for edge computing systems is provided, comprising the following steps:
[0046] Step 202 involves grouping the edge server participants deployed in each energy supply segment.
[0047] Grouping can be done using clustering algorithms, such as the K-means algorithm.
[0048] Step 204: Each participant calculates the loss function value and generates gradients and updates model parameters based on local data and pre-distributed federated learning models; the updated parameters are sent to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the group's global model parameters for this iteration.
[0049] The loss function value can be determined by the pre-deployed federated learning model and its local data. For example, all participants are denoted as K = {1,2,...,k,...,K}, and each participant k holds local data, denoted as D. k Size is |D k Then, the loss function value for participant k is calculated as follows:
[0050]
[0051] Where ω represents the model parameters, l k (z i ;ω) represents the data sample z i The loss value for each data sample z. i From input x i and target value y i Composition, i.e., z i =(x i ,y i Federated learning facilitates the acquisition of a global model within the group and minimizes the global loss function f(ω) by enabling collaboration among numerous participants.
[0052]
[0053] Where, p k It is the weight of participant k.
[0054] Step 206: Between groups, upload the global model parameters within the group to the asynchronous aggregator for asynchronous aggregation to obtain the global model parameters between groups.
[0055] Step 208: Calculate the participant's computational energy consumption and communication energy consumption in a single round based on the participant's micro-batch data and computational network device configuration, calculate the total energy consumption, and calculate the total carbon emissions within the group based on the total energy consumption and the RE generated by the participant's ESS.
[0056] Step 210: Under the constraints of total iteration duration and total carbon emissions, iteratively solve the inter-group global model parameters to minimize the inter-group global model loss function value.
[0057] The carbon-efficient federated learning method on the aforementioned edge computing system integrates the advantages of synchronous and asynchronous training methods by constructing a hybrid grouping framework for federated learning training. After participants are grouped, within each group, each participant calculates the loss function value and generates corresponding gradients and parameter updates based on local data and a pre-distributed federated learning model. These updated parameters are then sent to a synchronous aggregator. The synchronous aggregator aggregates the received parameter updates to obtain the group's global model parameters for that iteration. Between groups, the group's global model is uploaded to an asynchronous aggregator for asynchronous aggregation to obtain the group's global model parameters. This approach considers participant response latency and data distribution, as well as the server's energy supply context, and supports lightweight fine-tuning for group maintenance. Finally, based on total energy consumption and RE generation for each ESS, the total carbon emissions within the group are calculated. During model iteration, both completion time and total carbon emissions are considered to optimize energy demand.
[0058] In one embodiment, local training is performed in each round r within a group, and global model ω is performed between groups. r Distributed to these participants from the asynchronous aggregator. Each selected participant initializes its local parameters to... Then use the learning rate η k Perform H iterations of stochastic gradient descent (SGD):
[0059]
[0060] Participants then upload the updated model parameters to the synchronization aggregator, where a weighted average is used to update the global model within the group.
[0061]
[0062] Among them, K r It is the selected set of participants.
[0063] In one embodiment, the calculation process for energy consumption is as follows:
[0064] The energy consumed by a processor (such as a CPU or GPU) can be expressed as:
[0065]
[0066] and This indicates power consumption and computation duration. A typical GPU consists of multi-core computing modules and memory modules. Power consumption It increases with increasing GPU core frequency, memory frequency, and voltage. Conversely, computation duration... As these factors increase, power consumption decreases. For CPUs, power consumption and duration are primarily affected by the processor cores. It is worth noting that numerous models have demonstrated that... and Both can be accurately estimated before task execution. Given a certain number of training iterations, the energy consumption of participant k in a training round can be expressed as:
[0067]
[0068] in, This indicates micro-batch data.
[0069] In one embodiment, the calculation process for communication energy consumption is as follows:
[0070] set up The total amount of data communicated by participant k in round r is represented by:
[0071]
[0072] FPP represents floating-point precision, which is configured in software. For example, FPP=32 indicates single precision, and FPP=64 indicates double precision. (Transmission) The energy consumption of bit data is:
[0073]
[0074] in It is transmission power. This indicates the transmission rate. The transmission power here is affected by hardware configuration and network fluctuations. In edge computing systems, this is typically supported by a wired network, and the specifications remain stable. This helps to reliably estimate the energy requirements for data transmission.
[0075] Define server idle energy as The total energy demand of participant k in a round r can be written as:
[0076]
[0077] Therefore, in one embodiment, the calculation process for total carbon emissions includes:
[0078] Participants can naturally form different sets of ESS (Energy Supply Segments), represented as The RE generation of ESS m in round r is represented as The average off-site energy carbon intensity is .
[0079] To minimize carbon emissions, each ESS prioritizes on-site REs and only draws energy from the off-site grid when additional energy is needed. Therefore, the total carbon emissions of an ESS are determined by the selected participant K. r The amount of energy consumed determines:
[0080]
[0081] Extending to all ESS considered, the total carbon emissions are:
[0082]
[0083] In one embodiment, the global duration of a single training round is determined by the set of participants K. r The slowest participant is chosen, often referred to as the "fallback participant." The total duration of the r-th round consists of computation, communication, and auxiliary time. (Such as model initialization) consists of:
[0084]
[0085] Based on this, high-carbon-efficiency FL training can be formalized as an optimization problem. The goal is to maximize the model accuracy after a total of R training rounds, i.e., minimize the global loss f(ω), which is subject to the total training time T. tot and carbon credits C tot Constraints:
[0086]
[0087]
[0088]
[0089] In one embodiment, participants are pre-grouped to obtain pre-grouping results. The label distribution vector of each participant in each pre-group is obtained, and the label distribution vector of that group is calculated. A global label distribution vector is calculated based on the label distribution vectors of all participants. Jensen-Shannon divergence is calculated based on the group label distribution vector and the global label distribution vector. Clustering algorithm is used to identify the cluster center of each group according to the participants' round time. The grouping influence index of participants is calculated based on the difference between the single round duration of a participant and the average round time within the group and the Jensen-Shannon divergence within the group. Participants are assigned to the cluster center with the least influence according to the grouping influence index to obtain a new group. The cluster center of the new group is updated, and the process is iterated until the grouping is completed.
[0090] Specifically, to simultaneously consider the duration of rounds and the characteristics of data distribution, Jensen-Shannon (JS) divergence is used as a measure to quantify the similarity of data label distributions. This divergence measures the divergence between the data of potential groups and new participants, as well as the global data distribution, and is expressed as follows: Shared label distribution preserves FL's privacy guarantees because it only reveals aggregate statistics without exposing the raw data.
[0091] The grouping method follows three steps:
[0092] Step 1: Determine the average round time for each group Various classification methods can be used, such as the K-means algorithm, to identify the centroids of each group based solely on the round duration of each participant.
[0093] Step 2: Clear all groups and evaluate how each participant k affects each group using the grouping impact metric:
[0094]
[0095] in Balancing time overhead with data distribution can be adjusted to suit specific needs. Participants are then assigned to groups that minimize their impact, demonstrating round duration alignment and optimized data distribution.
[0096] Step 3: Update the group centroid, and repeat steps 1-2 until convergence or the preset iteration limit is reached.
[0097] Furthermore, a time threshold is set. When the difference between a participant's single round duration and the average round duration within the group exceeds the threshold, the participant is removed from the current group.
[0098] In another embodiment, the system implements lightweight, adaptive group adjustments to handle rapid changes in participant data patterns and server states. For each round, the duration and data changes of each participant are monitored. When there is a non-empty set of participants k in group g... When k is reassigned to the group that minimizes f, servers with unacceptable deviations from the average performance of all groups are removed; excluded servers can be re-added. This real-time optimization ensures that each participant operates in its most efficient group configuration.
[0099] Specifically, the pseudocode for the above grouping embodiments is as follows: Figure 3 As shown.
[0100] In one embodiment, the gradient utility value of a selected set of participants within the group is calculated, the gradient utility value is minimized to map the gradients of other participants within the group to the gradients of the selected participants corresponding to the gradient utility value, and the loss function value of the federated learning model within the group is calculated accordingly.
[0101] Specifically, participant grouping helps mitigate static data distribution bias. However, dynamic changes in model parameters during training still lead to variations in participant gradient contributions. To reduce training bias caused by selection, gradient utility is calculated by mapping the gradient of each participant within a group to the most similar gradient in a selected subset, thus measuring the group gradient utility. For group g in round τ, the selected subset is... The gradient utility value is calculated as follows:
[0102]
[0103] minimize This ensures the global representativeness of the selected subset. Subsequently, the loss function value of the within-group federated learning model can be calculated and minimized based on the selected set of participants.
[0104] In one embodiment, the gradient utility value of participants in the selected set is calculated based on their historical gradient values.
[0105] Specifically, calculation The cost is high because it requires participants to upload gradients. Recent historical gradient values from participants are used when available. For outdated gradients, updated models can be distributed using quantization and compression techniques, and new gradients can be computed using small sample data. Therefore, a new optimization problem can be constructed for each group g:
[0106]
[0107]
[0108]
[0109] In one embodiment, the process of calculating the loss function value of the participant selection set based on the gradient utility value is divided into sub-problems that are processed independently in each iteration round; for each sub-problem, a virtual queue for tracking the carbon emission budget surplus and deficit status is maintained and updated to reflect carbon constraints in subsequent iterations.
[0110] Specifically, the regret-based virtual queue method decomposes P2 into a series of round-by-round sub-problems. The core principle is to introduce a virtual queue Q(τ) to accumulate and propagate the differences between past rounds' decisions and expected values, i.e., regrets. By minimizing this regret as a relaxation condition, the original constraints can be approximated. For group g, its virtual queue is constructed as follows:
[0111]
[0112] in Let g represent the carbon emissions of group g in round τ, which is the sum of carbon emissions generated by this group in all ESSs, denoted as: Carbon emissions per ESS m Calculated as We use This represents the energy demand of the remaining groups in ESS m. The expected carbon emission target for round τ is set as a key indicator of online processing stability. It is typically set as the total constraint value divided by the decision period. Therefore, we restructure P2 into multiple sub-problems separated by round:
[0113]
[0114] In one embodiment, each subproblem in the virtual queue uses a bidirectional greedy approximate search strategy to determine a subset of participants that meet carbon emission constraints and have gradient utility values.
[0115] Specifically, given this scalability issue, the concept of submodular functions is introduced, and it is proven that P3 can be transformed into a special case, namely, an unconstrained submodular function, for which a more efficient and general solution can be found.
[0116] The proof is as follows:
[0117] Definition 1: If for any For u∈K\B, if f(A∪u)-f(A)≥f(B∪u)-f(B), then the function It is a submodular function. An unconstrained submodular function is called an unconstrained submodular function (USM).
[0118] Theorem 1: By taking a constant and adding its negation transformation, problem P3 can satisfy the USM condition.
[0119] Proof: The first part of P3 can be reconstructed into a facility location problem by maximizing a constant plus its negative, which is a well-known submodular problem. Since the submodular function is closed under addition, we only need to prove the second part. It also satisfies the secondary modulus property.
[0120] Let A and B be sets. Two subsets, of which Let k be the participants to be included and Suppose that k belongs to the m-th ESS. It is a constant value, therefore maximize Equivalent to maximizing Furthermore, when considering including client k, we only need to examine Corresponding components in It exhibits a non-decreasing trend as the number of participants increases, therefore we have (Set B is the same) and Will Considered
[0121] (i) if
[0122] (ii) if
[0123]
[0124] (iii) if
[0125] When calculating Λ(B), we must also satisfy conditions (i) to (iii). However, The non-decreasing property restricts the value of Λ(A)-Λ(B). For example, if Λ(A) satisfies condition (iii), that is... Λ(B) must also satisfy condition (iii). We have listed these interdependent constraints between Λ(A) and Λ(B) and their differences in Table 1.
[0126] Table 1: Values of Λ(A)-Λ(B) under conditional constraints
[0127]
[0128] As we can see from Table 1, Λ(A)-Λ(B)≥0 holds true. Therefore, It satisfies the USM. Q.E.D. Definition 2: Assume the optimal solution to the problem is x. * If the solution x produced by a certain approximation algorithm satisfies We then call this algorithm approximate.
[0129] For the USM problem, many studies have proposed solutions that can be implemented in linear time. Greedy algorithms for approximation ratios. Among them, the bidirectional greedy algorithm stands out due to its efficiency, requiring only one traversal of the solution space. For example... Figure 4 As shown in Algorithm 2, it first initializes two sets. (Line 1). Then, it checks each participant one by one and decides whether to perform the operation of adding to A or removing from B. The criterion for judgment is to compare the marginal value change caused by adding or removing, denoted as a. k and b k (Lines 2-8)
[0130] Building upon the basic bidirectional greedy algorithm, we introduce a randomization operation, which has been shown to further improve the approximation ratio. This method is based on probabilities associated with marginal values, specifically... (Lines 5-8) Make decisions about adding or removing participants.
[0131] Please note that these are just examples of greedy algorithms. Theoretical lower bound; in practice, the result is usually closer to the optimal solution.
[0132] In one embodiment, such as Figure 5 As shown, a carbon-efficient federated learning device on an edge computing system is provided, comprising: a grouping module 502, an intra-group computing module 504, an inter-group computing module 506, a carbon emission calculation module 508, and an iteration module 510, wherein:
[0133] Grouping module 502 is used to group edge server participants located in different energy supply segments according to the duration of a single round and the distribution of data;
[0134] The intra-group computation module 504 is used to calculate the loss function value and generate gradients and update model parameters based on local data and pre-distributed federated learning models within the group; send the updated parameters to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the intra-group global model parameters for this iteration round.
[0135] The inter-group calculation module 506 uploads the intra-group global model parameters to the asynchronous aggregator for asynchronous aggregation to obtain inter-group global model parameters.
[0136] Carbon emission calculation module 508 is used to calculate the computational energy consumption and communication energy consumption of the participants in a single round based on the participants' micro-batch data and computational network device configuration, calculate the total energy consumption, and calculate the total carbon emissions within the group based on the total energy consumption and the RE generated by the ESS to which the participants belong.
[0137] The iteration module 510 is used to iteratively solve the inter-group global model parameters under the constraints of the total iteration duration and the total carbon emissions, so as to minimize the inter-group global model loss function value.
[0138] Specific limitations regarding the carbon-efficient federated learning device on edge computing systems can be found in the limitations of the carbon-efficient federated learning method on edge computing systems described above, and will not be repeated here. Each module in the aforementioned carbon-efficient federated learning device on edge computing systems can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0139] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores participant data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a carbon-efficient federated learning method on an edge computing system.
[0140] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0141] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement an embodiment of the method described above.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements an embodiment of the method described above.
[0143] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A carbon-efficient federated learning method for edge computing systems, characterized in that, The method includes: The participants in the edge server deployments across various energy supply segments will be grouped. Within the group, each participant calculates the loss function value and generates gradients and updates the model parameters based on local data and a pre-distributed federated learning model; the updated parameters are sent to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the group's global model parameters for this iteration. Between groups, the global model parameters within a group are uploaded to an asynchronous aggregator for asynchronous aggregation to obtain the global model parameters between groups; The participants' computational and communication energy consumption in a single round is calculated based on their micro-batch data and computing network device configuration. The total energy consumption is then calculated, and the total carbon emissions within the group are calculated based on the total energy consumption and the RE generation of the ESS to which the participants belong. Under the constraints of the total iteration duration and the total carbon emissions, the inter-group global model parameters are iteratively solved to minimize the inter-group global model loss function value.
2. The method according to claim 1, characterized in that, The participants in the edge server deployment across various energy supply segments will be grouped, including: Participants are pre-grouped to obtain pre-grouping results. The label distribution vector of each participant in each pre-group is obtained and the label distribution vector of that group is calculated. The global label distribution vector is calculated based on the label distribution vectors of all participants. The Jensen-Shannon divergence is calculated based on the label distribution vector of the group and the global label distribution vector. Clustering algorithms are used to identify the cluster centers of each group based on the participants' single round time. The grouping influence index of participants is calculated based on the difference between the participant's single round time and the average single round time within the group and the Jensen-Shannon divergence within the group. Participants are then assigned to the cluster center with the least influence according to the grouping influence index to obtain a new group. Update the cluster center of the new group and iterate until grouping is complete.
3. The method according to claim 2, characterized in that, The method further includes: Set a time threshold; when the difference between a participant's single round time and the group's average single round time exceeds the threshold, the participant will be removed from the current group.
4. The method according to claim 1, characterized in that, Calculate the loss function value of the within-group federated learning model, including: Calculate the gradient utility value of the selected set of participants within the group, minimize the gradient utility value to map the gradients of other participants within the group to the gradients of the selected participants corresponding to the gradient utility value, and calculate the loss function value of the federated learning model within the group.
5. The method according to claim 4, characterized in that, The method further includes: Calculate the gradient utility value of participants in the selected set based on their historical gradient values.
6. The method according to claim 5, characterized in that, The method further includes: The process of calculating the loss function value of the participant selection set based on the gradient utility value is divided into subproblems that are handled independently in each iteration round; for each subproblem, a virtual queue is maintained and updated to track the carbon emission budget surplus and deficit status so that carbon constraints are reflected in subsequent iterations.
7. The method according to claim 6, characterized in that, The method further includes: For each subproblem in the virtual queue, a bidirectional greedy approximate search strategy is used to determine the subset of participants that meet the carbon emission constraints and have gradient utility values.
8. A carbon-efficient federated learning device on an edge computing system, characterized in that, The device includes: The grouping module is used to group edge server participants located in different energy supply segments according to the duration of a single round and the distribution of data. The intra-group computation module is used to calculate the loss function value and generate gradients and update model parameters for each participant based on local data and pre-distributed federated learning models; the updated parameters are sent to the synchronization aggregator; the synchronization aggregator aggregates the received parameter updates to obtain the intra-group global model parameters for this iteration round. The inter-group calculation module is used to upload the global model parameters within the group to the asynchronous aggregator for asynchronous aggregation to obtain the global model parameters between the groups. The carbon emission calculation module is used to calculate the computational energy consumption and communication energy consumption of the participants in a single round based on the participants' micro-batch data and computing network device configuration, calculate the total energy consumption, and calculate the total carbon emissions within the group based on the total energy consumption and the RE generated by the ESS to which the participants belong. The iterative module is used to iteratively solve the inter-group global model parameters under the constraints of the total iteration duration and the total carbon emissions, so as to minimize the inter-group global model loss function value.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.