Method and device for joint optimization of energy consumption and federated learning performance based on simulated annealing, storage medium and equipment

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

Patent Information

Application Number
CN202310787450.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2026-10-30
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

[0003]本发明的目的在于克服现有技术中的不足,提供一种基于模拟退火的能耗与联邦学习性能的联合优化方法、装置、可存储介质及设备,解决现有技术中联邦学习的用户调度与资源分配策略不合理,影响联邦学习性能与用户能耗之间的平衡的问题

Benefits of technology

[0086]本发明公开了一种基于模拟退火的能耗与联邦学习性能的联合优化方法,包括获取参与联邦学习用户的总能耗以及考虑错包率引起的总收敛间隔,确定系统总代价函数及约束条件,构建总代价函数最小化的优化问题;对所述优化问题进行求解,获取最优用户选择、最优带宽分配和最优发送功率;获取最优用户选择中的用户,使所述用户按照所述最优带宽分配与最优发送功率参与联邦学习。本发明针对联邦学习无线网络场景,考虑到无线链路传输的不可靠性可能引起的错包率对联邦学习性能的影响,综合考虑将用户的终端总能耗与考虑错包率带来的收敛间隔定义为系统的代价函数,联合考虑了联邦学习过程中学习性能与用户的利益,通过联合优化用户选择、用户的发送功率及带宽分配,保障联邦学习性能的同时,降低了用户的终端能耗,实现了用户能耗与联邦学习性能的平衡优化。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116723525B_ABST
    Figure CN116723525B_ABST
Patent Text Reader

Abstract

The application discloses a kind of energy consumption and federal learning performance based on simulated annealing joint optimization method, belong to communication technical field, including obtaining the total energy consumption of participating federal learning user and considering the total convergence interval caused by error rate, determine system total cost function and constraint condition, construct optimization problem of total cost function minimization;Optimization problem is solved, and optimal user selection, optimal bandwidth allocation and optimal sending power are obtained;The user in optimal user selection is obtained, so that the user participates in federal learning according to optimal bandwidth allocation and optimal sending power.The application solves the problem that the user scheduling and resource allocation strategy of federal learning in the prior art is unreasonable, affects the balance between federal learning performance and user energy consumption, adopts simulated annealing, KKT condition and iterative method to solve the optimization problem of total cost function minimization, to obtain reasonable user selection and resource allocation scheme, while guaranteeing federal learning performance, reduce total energy consumption of user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method, apparatus, storage medium, and device for joint optimization of energy consumption and federated learning performance based on simulated annealing. Background Technology

[0002] With the development of mobile communication and the Internet of Things (IoT), the amount of data generated by devices has surged. Users are increasingly focused on data privacy, making traditional centralized machine learning methods, such as sending data to cloud servers, insufficient. Federated learning, a form of distributed machine learning, has gained attention. In federated learning, users collaboratively train a local model using their own data, then upload it to a central server for secure aggregation and to build a new global model. The central server then transmits the global model back to users to update their local models, iterating this process until the required accuracy of the global model is achieved. Compared to centralized and distributed field learning, federated learning effectively solves data privacy issues and addresses the "data silo" phenomenon, maximizing the value of data and improving the performance of artificial intelligence algorithms. However, due to the limited communication resources, not all users can participate in federated learning. Furthermore, the unreliability of wireless links can lead to packet error rates that negatively impact performance. Therefore, in wireless networks, developing reasonable and effective user scheduling and resource allocation strategies significantly affects federated learning performance and terminal energy consumption. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, storage medium and device for joint optimization of energy consumption and federated learning performance based on simulated annealing, thereby solving the problem that unreasonable user scheduling and resource allocation strategies in federated learning affect the balance between federated learning performance and user energy consumption in the prior art.

[0004] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0005] In a first aspect, the present invention provides a joint optimization method for energy consumption and federated learning performance based on simulated annealing, comprising:

[0006] Obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem that minimizes the total cost function;

[0007] Solve the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power;

[0008] Obtain the users selected from the optimal user pool, and enable these users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power.

[0009] In conjunction with the first aspect, further, obtaining the users in the optimal user selection, and enabling the users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power, includes:

[0010] The local model is trained by obtaining data on optimal user selection, optimal bandwidth allocation, and optimal transmission power, and then the local model is securely aggregated to construct a global model.

[0011] In conjunction with the first aspect, further, the total energy consumption of the users participating in federated learning includes the training energy consumption and communication energy consumption required to train their local models;

[0012] The formula for calculating the communication energy consumption is as follows:

[0013]

[0014] In the formula, E i up For user i's communication energy consumption, t i up p is the upload latency required for user i to upload the trained model to the base station. i Let b be the transmission power of user i. i For the bandwidth allocated to user i, h i Let N be the channel gain for user i, N0 be the noise power, and L be the data size of the neural network model w.

[0015] The formula for calculating the training energy consumption is:

[0016]

[0017]

[0018] In the formula, E i comp Let t be the training energy required for user i to train its local model in one round of global iteration. i comp The training latency of user i training a local model using its local dataset, D i f is the amount of sample data for user i. i C is the number of revolutions per second of user i's CPU. i This represents the number of CPU revolutions required for user i to process one sample of data. The number of local iterations required to achieve the desired accuracy ε, where θ is a constant determined by the global model, and κ is a constant determined by the switched capacitor; κf i 2 Calculate the CPU power consumption required for user i in one cycle; To train D iThe number of CPU revolutions for each sample data point;

[0019] The packet error rate is the packet error rate that occurs when transmitting the local model; the expression for the packet error rate is:

[0020]

[0021] In the formula, m0 is a threshold, q i This refers to the packet error rate that occurs when transmitting a local model.

[0022] The expression for the total convergence interval considering the error rate is as follows:

[0023]

[0024] In the formula, a i To determine whether user i is selected, ζ1, ζ2, and μ are all constants greater than 0.

[0025] In conjunction with the first aspect, the definition of the total system cost function is further as follows:

[0026]

[0027] In the formula, γ is the weighting coefficient, and C is the total cost function of the system;

[0028] The optimization problem of the system is:

[0029]

[0030] The constraints are:

[0031] (1)a i ∈{0,1},

[0032] (2)

[0033] (3)

[0034] (4)

[0035] (5)b i ≥0,

[0036] in,

[0037] In the formula, P represents the system's optimization problem, B represents the system's total bandwidth, and T represents the maximum total time allowed for one round of global iteration in federated learning. The maximum transmit power for user i. p is the broadcast delay of the base station transmitting the global model to user i.d Let I' be the base station's transmission power, and let I' be the set of users participating in federated learning. Constraint (1) means a i It is a 0-1 variable, a i =1 indicates that user i is selected; otherwise, a i =0; Constraint (2) indicates that the total bandwidth allocated to all users participating in federated learning cannot exceed the total bandwidth B; Constraint (3) indicates that the total delay of a user participating in federated learning in one round of global iteration cannot exceed the maximum allowed total delay T; Constraint (4) is a constraint on the user's transmission power; Constraint (5) is a constraint on the user's bandwidth allocation.

[0038] In conjunction with the first aspect, further, solving the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power includes the following steps:

[0039] Initialize user selection and bandwidth allocation for users;

[0040] Based on the user selection and the user's bandwidth allocation, the optimal transmission power is obtained by solving based on simulated annealing.

[0041] Based on the user selection and the optimal transmission power, the optimal bandwidth allocation is obtained by solving the KKT conditions.

[0042] Repeat the steps to find the optimal transmission power and optimal bandwidth allocation. When the total system cost function converges, determine the contribution of each user to the total system cost function.

[0043] When the user who contributes the most to the total cost function of the system participates in federated learning, update the user selection, initialize the bandwidth allocation for the user, and repeat the solution steps for optimal transmission power and optimal bandwidth allocation.

[0044] When the user who contributes the most to the total cost function of the system does not participate in federated learning, the optimal decision with the minimum total cost function is obtained. The optimal decision includes the optimal user selection, the optimal bandwidth allocation, and the optimal transmission power.

[0045] The contribution of each user to the total system cost function is defined as follows:

[0046]

[0047] In the formula, η i This represents the contribution of each user to the total cost function of the system.

[0048] In conjunction with the first aspect, further, the step of obtaining the optimal transmission power based on simulated annealing, according to the user selection and the user's bandwidth allocation, includes:

[0049] Determine user selection and bandwidth allocation for each user, and optimize transmission power;

[0050] The optimization problem P is equivalent to P1:

[0051]

[0052] The constraints are:

[0053] (1)

[0054] (2)

[0055] In the formula, P1 is the equivalent problem of the optimization problem P;

[0056] Based on constraint (2) of P1, determine the minimum transmission power of the users participating in federated learning;

[0057] According to the minimum transmission power and the constraint condition (1) of P1, in Within the range, the optimal transmission power is obtained based on simulated annealing; the p i min Minimum transmission power for users participating in federated learning.

[0058] In conjunction with the first aspect, further, the step of obtaining the optimal bandwidth allocation based on the user selection and the optimal transmission power using KKT conditions includes:

[0059] Determine user selection and bandwidth allocation for each user, and optimize bandwidth allocation;

[0060] The optimization problem P is equivalent to P2, and the objective function of P2 is:

[0061]

[0062] In the formula, P2 is the equivalent problem of the optimization problem P;

[0063] The constraints are:

[0064] (1)

[0065] (2)

[0066] (3)b i ≥0,

[0067] When considering constraint (2) of P2, the minimum bandwidth allocation for users participating in federated learning is determined as follows:

[0068]

[0069] In the formula, b i min To determine the minimum bandwidth allocation for users participating in federated learning;

[0070] When constraint (2) of P2 is disregarded, P2 is simplified to P3, and the objective function of P3 is:

[0071]

[0072] In the formula, P3 is the simplified version of the optimization problem P2;

[0073] The constraints are:

[0074] (1)

[0075] Solving optimization problem P3 based on KKT conditions, wherein the objective function of P3 is about b i The bandwidth allocation is maximized when the constraint condition (1) of P3 is equal to the value of P3.

[0076] The objective function of the optimization problem P2 is about b i The bandwidth allocation is monotonically decreasing, and is optimal when it satisfies the maximum value of all constraints. That is, the optimal bandwidth allocation is the maximum solution obtained from the minimum bandwidth allocation for users participating in federated learning and the objective function of P3.

[0077] Secondly, the present invention provides a joint optimization device based on simulated annealing energy consumption and federated learning performance, comprising:

[0078] A problem module is constructed to obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem that minimizes the total cost function.

[0079] The problem-solving module is used to solve the optimization problem and obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power.

[0080] The federated learning module is used to obtain the users in the optimal user selection, and to enable the users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power.

[0081] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any of the first aspects.

[0082] Fourthly, the present invention provides an apparatus comprising:

[0083] Memory, used to store instructions;

[0084] A processor for executing the instructions, causing the device to perform operations implementing the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any of the first aspects.

[0085] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0086] This invention discloses a joint optimization method for energy consumption and federated learning performance based on simulated annealing. The method includes obtaining the total energy consumption of users participating in federated learning and the total convergence interval considering packet error rate; determining the total system cost function and constraints; constructing an optimization problem that minimizes the total cost function; solving the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power; and selecting the users in the optimal user selection so that they participate in federated learning according to the optimal bandwidth allocation and optimal transmission power. This invention addresses the federated learning wireless network scenario, considering the impact of packet error rate caused by the unreliability of wireless link transmission on federated learning performance. It comprehensively considers the total terminal energy consumption of users and the convergence interval considering packet error rate as the system cost function, jointly considering the learning performance and user interests during the federated learning process. By jointly optimizing user selection, user transmission power, and bandwidth allocation, it ensures federated learning performance while reducing user terminal energy consumption, achieving a balanced optimization of user energy consumption and federated learning performance. Attached Figure Description

[0087] Figure 1 This is a flowchart illustrating a joint optimization method for energy consumption and federated learning performance based on simulated annealing, provided in Embodiment 1 of the present invention. Figure 1 ;

[0088] Figure 2 This is a flowchart illustrating a joint optimization method for energy consumption and federated learning performance based on simulated annealing, provided in Embodiment 1 of the present invention. Figure 2 ;

[0089] Figure 3 This is a system model diagram of a joint optimization method for energy consumption and federated learning performance based on simulated annealing, provided in Embodiment 1 of the present invention. Detailed Implementation

[0090] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.

[0091] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0092] Example 1:

[0093] like Figure 1 As shown, this embodiment provides a joint optimization method for energy consumption and federated learning performance based on simulated annealing, including the following steps:

[0094] Step 1: Obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem P that minimizes the total cost function;

[0095] The set of users is represented as I = {1, 2, ..., I}, with a total of I users; the channel gain of user i is:

[0096]

[0097] In the formula, h i Let g be the channel gain for user i, g0 be the channel interference power when d0 = 1m, α be the path loss exponent, and d i Let be the distance between user i and the base station.

[0098] Participating in federated learning requires training a local model using data obtained from the optimization problem P. The energy consumption of the terminal device directly affects the user experience. Therefore, we mainly focus on the energy consumption of the user terminal during the federated learning process, including training energy consumption and communication energy consumption.

[0099] The formula for calculating the training energy consumption is as follows:

[0100]

[0101]

[0102] In the formula, E i comp Let t be the training energy required for user i to train its local model in one round of global iteration. i comp The training latency of user i training a local model using its local dataset, D i f is the amount of sample data for user i. i C is the number of revolutions per second of user i's CPU. i This represents the number of CPU revolutions required for user i to process one sample of data. The number of local iterations required to achieve the desired accuracy ε, where θ is a constant determined by the global model, and κ is a constant determined by the switched capacitor; κf i 2 Calculate the CPU power consumption required for user i in one cycle; To train D i The number of CPU revolutions for each sample data point.

[0103] Use D i C represents the amount of sample data for user i. i f represents the number of CPU revolutions for user i to process one sample of data. i This represents the number of CPU revolutions per second for user i. In one round of global iteration, the training latency for user i to train a local model using its local dataset is:

[0104]

[0105] In the formula, t i comp The training latency for user i to train a local model using its local dataset. θ represents the number of local iterations required to achieve the desired accuracy ε, where θ is a constant determined by the global model.

[0106] After completing local training, the user uploads the trained model to the base station using Frequency Division Multiple Access (FDMA). According to Shannon's formula, the achievable upload rate for user i is:

[0107]

[0108] In the formula, r i Let N0 be the upload rate of user i, and N0 be the noise power. i Let b be the transmission power of user i. i This refers to the bandwidth allocated to user i.

[0109] Assuming the neural network model w has a data size of L, the upload latency required for user i to upload the trained model to the base station is:

[0110]

[0111] In the formula, t i up Let L be the upload latency required for user i to upload the trained model to the base station, and L be the data size of the neural network model w.

[0112] The formula for calculating the energy consumption of user i communication is:

[0113]

[0114] In the formula, Ei up Let i be the communication energy consumption of user i.

[0115] The packet error rate is the packet error rate that occurs when transmitting local models. Assuming each local model is transmitted as a separate data packet on the uplink, due to the unreliability of the wireless network, the possible packet error rate when transmitting local models is:

[0116]

[0117] In the formula, m0 is a threshold, q i This represents the packet error rate that occurs when transmitting a local model.

[0118] Due to the existence of the error rate, the upper bound of convergence for federated learning has a gap. in a i This indicates whether user i is selected. When A ≥ 1, the federated learning method obviously will not converge. Therefore, we only need to consider the scenario where A < 1. When t is large enough, A... t =0. The interval can be rewritten as:

[0119]

[0120] In the formula, a i To determine whether user i is selected, ζ1, ζ2, and μ are all constants greater than 0.

[0121] Maximizing federated learning performance means minimizing the margin, which is equivalent to minimizing...

[0122] The definition of the total system cost function is as follows:

[0123]

[0124] In the formula, γ is the weighting coefficient, and C is the total cost function of the system;

[0125] Considering the total user energy consumption and federated learning performance, the optimization problem of the system is:

[0126]

[0127] The constraints are:

[0128] (1)a i ∈{0,1},

[0129] (2)

[0130] (3)

[0131] (4)

[0132] (5)b i ≥0,

[0133]

[0134] In the formula, P represents the system's optimization problem, B represents the system's total bandwidth, and T represents the maximum total time allowed for one round of global iteration in federated learning. The maximum transmit power for user i. p is the broadcast delay of the base station transmitting the global model to user i. d Let I be the base station's transmission power, and let I' be the set of users participating in federated learning. Constraint (1) means a i It is a 0-1 variable, a i =1 indicates that user i is selected; otherwise, a i =0; Constraint (2) indicates that the total bandwidth allocated to all users participating in federated learning cannot exceed the total bandwidth B; Constraint (3) indicates that the total delay of a user participating in federated learning in one round of global iteration cannot exceed the maximum allowed total delay T; Constraint (4) is a constraint on the user's transmission power; Constraint (5) is a constraint on the user's bandwidth allocation.

[0135] Step 2: Solve the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power;

[0136] Specifically, the following steps are included:

[0137] Step A: Initialize user selection;

[0138] Step B: Initialize user bandwidth allocation;

[0139] Step C: Based on the user selection and the bandwidth allocation of the user, the optimal transmission power p is obtained by using the optimization problem P and the constraints based on simulated annealing;

[0140] Step D: Based on the user selection and the optimal transmission power, using the optimization problem P and the constraints, solve the optimal bandwidth allocation b based on the KKT (Karush-Kuhn-Tucker) conditions;

[0141] Step E: Repeat steps C and D until the total system cost function converges;

[0142] Step F: When the total system cost function converges, determine the contribution of each user to the total system cost function; define the contribution of each user to the total system cost function as:

[0143]

[0144] In the formula, η i This represents the contribution of each user to the total cost function of the system.

[0145] Step G: When the contribution value η to the total cost function of the system i When the largest user participates in federated learning, the user selection is updated, and steps B to F are repeated, i.e., the bandwidth allocation of the user is initialized, and the solution steps for optimal transmission power and optimal bandwidth allocation are repeated until the user with the largest contribution to the total cost function of the system does not participate in federated learning. At this point, the optimal decision with the minimum total cost function is obtained. The optimal decision includes the optimal user selection a, the optimal bandwidth allocation b, and the optimal transmission power p.

[0146] In step C, based on the user selection and the user's bandwidth allocation, the optimal transmission power p is obtained by solving the optimization problem P and its constraints using simulated annealing, including:

[0147] Determine user selection and bandwidth allocation for each user, and optimize transmission power.

[0148] Since training energy consumption is independent of transmission power, the optimization problem P is equivalent to P1:

[0149]

[0150] The constraints are:

[0151] (1)

[0152] (2)

[0153] In the formula, P1 is the equivalent problem of the optimization problem P.

[0154] Based on constraint (2) of P1, determine the minimum transmission power of user i participating in federated learning.

[0155] Based on the obtained minimum transmission power The constraint condition (1) of P1, in Within the range, the optimal transmission power is obtained by solving based on simulated annealing.

[0156] In step D, based on the user selection and the optimal transmission power, the optimal bandwidth allocation b is obtained by solving the optimization problem P and the constraints using the KKT conditions, including:

[0157] Determine user selection and bandwidth allocation for each user, and optimize bandwidth allocation.

[0158] Since training energy consumption and packet error rate are independent of bandwidth allocation, the optimization problem P is equivalent to P2, and the objective function of P2 is:

[0159]

[0160] In the formula, P2 is the equivalent problem of the optimization problem P1.

[0161] The constraints are:

[0162] (1)

[0163] (2)

[0164] (3)b i ≥0,

[0165] When considering constraint (2) of P2, the minimum bandwidth allocation for user i participating in federated learning is determined as follows:

[0166]

[0167] In the formula, b i min To determine the minimum bandwidth allocation for users participating in federated learning.

[0168] If we assume that we do not consider the constraint (2) of P2, we simplify P2 to P3, and the objective function of P3 is:

[0169]

[0170] In the formula, P3 is the simplified version of the optimization problem P2.

[0171] The constraints are:

[0172] (1)

[0173] Solving optimization problem P3 based on KKT conditions, since the objective function of P3 is related to b i The bandwidth allocation is maximized when the constraint condition (1) of P3 is equal to the value of P3.

[0174] Since the objective function of optimization problem P2 is about b i Monotonically decreasing, so when the bandwidth allocation b i The optimal value is the maximum value that satisfies all constraints. That is, the maximum solution obtained from the minimum bandwidth allocation for users participating in federated learning and the objective function of P3 is taken as the optimal bandwidth allocation b.

[0175] Step 3: Select the user from the optimal user selection a, and have the user participate in federated learning according to the optimal bandwidth allocation b and the optimal transmission power p.

[0176] The final data on optimal user selection a, optimal bandwidth allocation b, and optimal transmission power p are used to participate in federated learning. Subsequently, the obtained optimized data can be used to train local models, and the local models can be securely aggregated to construct a global model.

[0177] Example 2:

[0178] Based on the same inventive concept as Embodiment 1, this embodiment introduces a joint optimization device for energy consumption and federated learning performance based on simulated annealing, comprising:

[0179] A problem module is constructed to obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem that minimizes the total cost function.

[0180] The problem-solving module is used to solve the optimization problem and obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power.

[0181] The federated learning module is used to obtain the users in the optimal user selection, and to enable the users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power.

[0182] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.

[0183] Example 3:

[0184] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any of Embodiment 1.

[0185] Example 4:

[0186] Based on the same inventive concept as other embodiments, this embodiment describes a device comprising:

[0187] Memory, used to store instructions;

[0188] A processor is configured to execute the instructions, causing the device to perform operations implementing the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any of Embodiment 1.

[0189] In summary, this invention provides a method, apparatus, storable medium, and device for joint optimization of energy consumption and federated learning performance based on simulated annealing. For federated learning wireless network scenarios, considering the impact of packet error rate caused by the unreliability of wireless link transmission on federated learning performance, a joint user selection, bandwidth allocation, and transmit power optimization method is proposed to achieve a trade-off between total user energy consumption and federated learning performance. This method considers both total user energy consumption and federated learning performance, defining the total terminal energy consumption of the user and the convergence interval caused by packet error rate as the total cost function of the system, forming an optimization problem that minimizes the total cost function. To solve this problem, it is decomposed into three optimization sub-problems: transmit power, bandwidth allocation, and user selection. Simulated annealing, KKT conditions, and iterative methods are used to solve these three sub-problems respectively. Finally, a reasonable user selection and resource allocation scheme is obtained through iterative analysis of the three sub-problems, thereby ensuring federated learning performance while reducing the total terminal energy consumption of the user. Unlike traditional scenarios that only consider federated learning performance or only consider energy consumption, this method achieves a balanced optimization of user energy consumption and federated learning performance.

[0190] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A joint optimization method for energy consumption and federated learning performance based on simulated annealing, characterized in that, include: Obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem that minimizes the total cost function; Solve the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power; Obtain the users from the optimal user selection, and enable the users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power; The total energy consumption of users participating in federated learning includes the training energy consumption and communication energy consumption required to train their local models. The formula for calculating the communication energy consumption is as follows: ; In the formula, E i up For users Communication energy consumption, t i up For users The upload latency required to upload the trained model to the base station, p i For users The transmission power, b i To be assigned to users bandwidth, h i For users The channel gain, N0 is the noise power, and L is the neural network model. Data size; The formula for calculating the training energy consumption is: ; ; In the formula, E i comp For users The training energy required to train its local model in a single global iteration, t i comp For users Training latency of training a local model using its local dataset. For users The amount of sample data, For users The number of revolutions per second of the CPU. Indicates user The number of CPU revolutions required to process a single sample of data. To achieve the required accuracy Number of local iterations required It is a constant determined by the global model; It is a constant determined by the switched capacitor. For users Calculate the CPU power consumption for one lap; For training The number of CPU revolutions for each sample data point; The packet error rate is the packet error rate that occurs when transmitting the local model; the expression for the packet error rate is: ; In the formula, It is a threshold, q i This refers to the packet error rate that occurs when transmitting a local model. The expression for the total convergence interval considering the error rate is as follows: ; In the formula, For users Whether or not to be selected, , and All are constants greater than 0. Total number of users The number of local iterations is a relevant constant. The base parameter in the convergence interval expression. for of Power of 1 Indicates the round index of the global iteration; The definition of the total system cost function is as follows: ; In the formula, Here, C represents the weighting coefficients, and C is the total system cost function. The optimization problem of the system is: P= ; The constraints are: (1) ; (2) ; (3) ; (4) ; (5) ; in, ; In the formula, P represents the optimization problem of the system. The total system bandwidth This represents the maximum total time allowed for one round of global iteration in federated learning. For users Maximum transmission power, Transmit the global model from the base station to the user Broadcast delay, For the base station's transmission power, set For the set of users participating in federated learning, Constraint (1) indicates It is a 0-1 variable. Indicates user Selected, otherwise Constraint (2) states that the total bandwidth allocated to all users participating in federated learning cannot exceed the total bandwidth. Constraint (3) indicates that the total latency of a user participating in federated learning in one round of global iteration cannot exceed the maximum allowed total latency. Constraint (4) is a constraint on the user's transmission power; constraint (5) is a constraint on the user's bandwidth allocation.

2. The joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in claim 1, characterized in that, The step of obtaining the users from the optimal user selection and enabling those users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power includes: The local model is trained by obtaining data on optimal user selection, optimal bandwidth allocation, and optimal transmission power, and then the local model is securely aggregated to construct a global model.

3. The joint optimization method for energy consumption and federated learning performance based on simulated annealing according to claim 2, characterized in that, Solving the optimization problem to obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power includes the following steps: Initialize user selection and bandwidth allocation for users; Based on the user selection and the user's bandwidth allocation, the optimal transmission power is obtained by solving based on simulated annealing. Based on the user selection and the optimal transmission power, the optimal bandwidth allocation is obtained by solving the KKT conditions. Repeat the steps to find the optimal transmission power and optimal bandwidth allocation. When the total system cost function converges, determine the contribution of each user to the total system cost function. When the user who contributes the most to the total cost function of the system participates in federated learning, update the user selection, initialize the bandwidth allocation for the user, and repeat the solution steps for optimal transmission power and optimal bandwidth allocation. When the user who contributes the most to the total cost function of the system does not participate in federated learning, the optimal decision with the minimum total cost function is obtained. The optimal decision includes the optimal user selection, the optimal bandwidth allocation, and the optimal transmission power. The contribution of each user to the total system cost function is defined as follows: ; In the formula, This represents the contribution of each user to the total cost function of the system.

4. The joint optimization method for energy consumption and federated learning performance based on simulated annealing according to claim 3, characterized in that, The step of obtaining the optimal transmission power based on simulated annealing, according to the user selection and the user's bandwidth allocation, includes: Determine user selection and bandwidth allocation for each user, and optimize transmission power; The optimization problem P is equivalent to P1: P1= ; The constraints are: (1) ; (2) ; In the formula, P1 is the equivalent problem of the optimization problem P; Based on constraint (2) of P1, determine the minimum transmission power of the users participating in federated learning; According to the minimum transmission power and the constraint condition (1) of P1, in Within the range, the optimal transmission power is obtained based on simulated annealing; the p i min Minimum transmission power for users participating in federated learning.

5. The joint optimization method for energy consumption and federated learning performance based on simulated annealing according to claim 4, characterized in that, The step of obtaining the optimal bandwidth allocation based on the user selection and the optimal transmission power, using KKT conditions, includes: Determine user selection and bandwidth allocation for each user, and optimize bandwidth allocation; The optimization problem P is equivalent to P2, and the objective function of P2 is: P2= ; In the formula, P2 is the equivalent problem of the optimization problem P; The constraints are: (1) ; (2) ; (3) ; When considering constraint (2) of P2, the minimum bandwidth allocation for users participating in federated learning is determined as follows: ; In the formula, b i min To determine the minimum bandwidth allocation for users participating in federated learning; When the constraint (2) of P2 is not considered, P2 is simplified to P3, and the objective function of P3 is: P3= ; In the formula, P3 is the simplified version of the optimization problem P2; The constraints are: (1) ; Solving optimization problem P3 based on KKT conditions, wherein the objective function of P3 is about Monotonically decreasing, the bandwidth allocation is maximized when constraint (1) of P3 is equal; The objective function of the optimization problem P2 is about The bandwidth allocation is monotonically decreasing, and is optimal when it satisfies the maximum value of all constraints. That is, the optimal bandwidth allocation is the maximum solution obtained from the minimum bandwidth allocation for users participating in federated learning and the objective function of P3.

6. A joint optimization device for energy consumption and federated learning performance based on simulated annealing, characterized in that, include: A problem module is constructed to obtain the total energy consumption of users participating in federated learning and the total convergence interval caused by the error rate, determine the total cost function and constraints of the system, and construct an optimization problem that minimizes the total cost function. The problem-solving module is used to solve the optimization problem and obtain the optimal user selection, optimal bandwidth allocation, and optimal transmission power. The federated learning module is used to obtain the users in the optimal user selection, and enable the users to participate in federated learning according to the optimal bandwidth allocation and optimal transmission power; The total energy consumption of users participating in federated learning includes the training energy consumption and communication energy consumption required to train their local models. The formula for calculating the communication energy consumption is as follows: ; In the formula, E i up For users Communication energy consumption, t i up For users The upload latency required to upload the trained model to the base station, p i For users The transmission power, b i To be assigned to users bandwidth, h i For users The channel gain, N0 is the noise power, and L is the neural network model. Data size; The formula for calculating the training energy consumption is: ; ; In the formula, E i comp For users The training energy required to train its local model in a single global iteration, t i comp For users Training latency of training a local model using its local dataset. For users The amount of sample data, For users The number of revolutions per second of the CPU. Indicates user The number of CPU revolutions required to process a single sample of data. To achieve the required accuracy Number of local iterations required It is a constant determined by the global model; It is a constant determined by the switched capacitor. For users Calculate the CPU power consumption for one lap; For training The number of CPU revolutions for each sample data point; The packet error rate is the packet error rate that occurs when transmitting the local model; the expression for the packet error rate is: ; In the formula, It is a threshold, q i This refers to the packet error rate that occurs when transmitting a local model. The expression for the total convergence interval considering the error rate is as follows: ; In the formula, For users Whether or not to be selected, , and All are constants greater than 0. Total number of users The number of local iterations is a relevant constant. The base parameter in the convergence interval expression. for of Power of 1 Indicates the round index of the global iteration; The definition of the total system cost function is as follows: ; In the formula, Here, C represents the weighting coefficients, and C is the total system cost function. The optimization problem of the system is: P= ; The constraints are: (1) ; (2) ; (3) ; (4) ; (5) ; in, ; In the formula, P represents the optimization problem of the system. The total system bandwidth This represents the maximum total time allowed for one round of global iteration in federated learning. For users Maximum transmission power, Transmit the global model from the base station to the user Broadcast delay, For the base station's transmission power, set For the set of users participating in federated learning, Constraint (1) indicates It is a 0-1 variable. Indicates user Selected, otherwise Constraint (2) states that the total bandwidth allocated to all users participating in federated learning cannot exceed the total bandwidth. Constraint (3) indicates that the total latency of a user participating in federated learning in one round of global iteration cannot exceed the maximum allowed total latency. Constraint (4) is a constraint on the user's transmission power; constraint (5) is a constraint on the user's bandwidth allocation.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any one of claims 1-5.

8. A communication resource allocation device, characterized in that, include: Memory, used to store instructions; A processor for executing the instructions, causing the device to perform operations implementing the joint optimization method for energy consumption and federated learning performance based on simulated annealing as described in any one of claims 1-5.