A UAV-Assisted Federated Learning Resource Allocation Method

By constructing the optimization problem P with the minimized total cost function, optimizing the position and height of the drone, the problem of high user energy consumption in federated learning is solved, and the learning performance guarantee and energy consumption reduction is achieved. It is suitable for drone assistance federated learning scenarios.

CN116321389BActive Publication Date: 2024-11-12NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310113221.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2024-11-12
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

In federated learning, how to reduce the total energy consumption of users while ensuring learning performance, especially in the drone-assisted federated learning scenario, considering the impact of drone altitude on coverage, optimize resource allocation to reduce User energy consumption.

Method used

Construct the optimization problem P for minimizing the total cost function, determine the optimal level position decision of the UAV based on the user status and local accuracy, determine the optimal local accuracy and user resource allocation decision based on the status of the UAV and the user, and optimize the non-resources through iterative optimization. The flight altitude of the human-machine is obtained to obtain the optimal drone altitude to reduce the total energy consumption of the users participating in the study.

Benefits of technology

By optimizing the location and height of the drone, the federated learning performance is guaranteed, while significantly reducing the total energy consumption of users, improving resource utilization efficiency, and balancing user energy consumption and learning performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116321389B_ABST
    Figure CN116321389B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for allocating resources for federated learning assisted by unmanned aerial vehicles. For the wireless network scenario of unmanned aerial vehicle-assisted federated learning, the influence of the height of unmanned aerial vehicles on the coverage range is taken into consideration to achieve a balance between the total energy consumption of users and the performance of federated learning. The method considers the total energy consumption of users and the performance of federated learning at the same time, defines the total cost function of the system, wherein the total cost function is composed of the weighted inverse of the total energy consumption of users and the number of users participating in the federated learning, and forms an optimization problem for minimizing the total cost function, which is decomposed into three optimization sub-problems of the horizontal position of the unmanned aerial vehicle, the local accuracy, and the communication and computing resources. The three sub-problems are solved respectively by using successive convex approximation, Dinkelbach Method, dichotomy and KKT conditions, and finally a reasonable resource allocation scheme is obtained through iteration of the three sub-problems to achieve the goal of reducing the total energy consumption of users while ensuring the performance of federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method for joint learning performance and resource allocation based on unmanned aerial vehicle-assisted federated learning. Background Art

[0002] In recent years, with the popularization of smart devices and the continuous expansion of the Internet of Things, the amount of data has shown an exponential growth trend. By analyzing and processing this data, some smart applications (face recognition, smart driving, voice recognition) have developed at the speed of light, but it has also caused data security and privacy issues. As people gradually pay more attention to privacy issues, more and more entities begin to emphasize the ownership and use rights of data, which reduces the data exchange between different entities and gradually makes each entity become a "data island". In order to solve the above problems, make the value of data more effective, and improve the performance of artificial intelligence algorithms, Federated Learning (FL) came into being.

[0003] Federated learning can coordinate all parties to conduct joint learning without exposing their data. Compared with traditional centralized learning, it improves resource utilization and protects user privacy. In the process of federated learning, participants do not need to upload local original data, but only need to upload neural network model parameters related to the data. The main server will then securely aggregate the model parameters and feed them back to the participants. The participants will update the global model based on their own data sets, effectively ensuring the security and privacy of sensitive data of each participant. In order to further improve the performance of federated learning, drones have begun to be combined with federated learning as aerial base stations. As aerial mobile base stations, drones can quickly build regional wireless networks and provide emergency communication services. Compared with the scenario of fixed base stations, the combination of drones and federated learning can find a suitable location to reduce the user's energy consumption, which to a certain extent alleviates the competition for wireless resources among users. At the same time, a reasonable resource allocation plan can effectively reduce the user's energy consumption and improve the efficiency of federated learning. Summary of the invention

[0004] The purpose of this invention is to propose a resource allocation method for UAV-assisted federated learning. The method considers the impact of the UAV's flight altitude on the coverage range and proposes a resource allocation mechanism to ensure learning performance while reducing the user's total energy consumption.

[0005] To achieve the above functions, the present invention designs a UAV-assisted federated learning resource allocation method, constructs an optimization problem P for minimizing the total cost function, determines the optimal UAV horizontal position decision according to the user status and local accuracy, determines the optimal local accuracy according to the status of the UAV and the user, determines the optimal user resource allocation decision according to the UAV position and local accuracy, changes the flight altitude of the UAV, repeats the above iterative steps, and obtains the optimal altitude of the UAV to reduce the total energy consumption of users participating in the learning.

[0006] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:

[0007] In a first aspect, the present invention provides a method for allocating resources of federated learning assisted by a drone, comprising:

[0008] S1. Determine the total cost function and constraints of the system according to the total energy consumption of users participating in federated learning and the inverse of the number of users participating in learning, and construct an optimization problem P for minimizing the total cost function;

[0009] S2. Solve the optimization problem P to obtain the optimal horizontal position q of the UAV m , optimal local accuracy η, optimal user resource allocation decision, optimal UAV height h;

[0010] S3. The drone flies to the optimal horizontal position q of the drone obtained m and height h, users within the range of the drone participate in federated learning according to the optimal user resource allocation decision and the optimal local accuracy η decision obtained.

[0011] In some embodiments, the step S1, constructing an optimization problem P for minimizing the total cost function, includes:

[0012] S11. The set of users is represented as The users within the service range of drone m are represented by a set Total N m users; the distance between user i and drone m is:

[0013]

[0014] Where h is the height of the drone, q m ={x m ,y m} represents the horizontal position of the UAV m, q i ={x i ,y i} represents the position of user i, and the channel gain of user i is:

[0015]

[0016] Where g0 is the channel interference power when d0=1m, and α is the path loss exponent;

[0017] S12. The energy consumption of user terminals during federated learning includes training energy consumption and communication energy consumption;

[0018] S13. Use D i represents the amount of data of user i, f i Indicates the number of revolutions per second of the CPU of user i, C i Indicates the number of CPU revolutions when user i processes a sample of data. l Indicates the number of rounds of local training when the local accuracy reaches η;

[0019]

[0020] Where L and γ are related parameters of the neural network loss function, and δ is the learning step size of federated learning training;

[0021] The training energy consumption of user i in one round of federated learning It is expressed as:

[0022]

[0023] S14. After the user completes the local training, the trained model is uploaded to the drone via FDMA; i represents the bandwidth allocated to user i, p i represents the transmission power of user i, N0 represents the noise power spectrum density, and according to Shannon's formula, the transmission rate R that user i can achieve is i for:

[0024]

[0025] Assume that the data size of the neural network model w is s, and the communication energy consumption of user i is for:

[0026]

[0027] S15. When the global model accuracy is required to reach ε0, the number of communication rounds I g for:

[0028]

[0029] Where ξ represents the relevant parameters in the local neural network training, so the total energy consumption of the entire federated learning process is E total for:

[0030]

[0031] S16. The total cost function C is defined as:

[0032]

[0033] The objective function is:

[0034]

[0035] in, represents a fixed value, ρ represents a weighting coefficient;

[0036] S17. Considering the total energy consumption of users and the performance of federated learning, the optimization problem P of the system is:

[0037]

[0038] The constraints are:

[0039] C1:0≤f i ≤f i max

[0040] C2:

[0041] C3:

[0042] C4:

[0043] C5:

[0044] C6:h min ≤h≤h max

[0045] C7:

[0046] C8:0≤η≤1

[0047] Where T is the total time budget for completing federated learning, B is the total bandwidth owned by the drone, and f i max represents the maximum computation frequency of user i, represents the maximum transmission power of user i, h min 、h max Represent the lowest and highest altitudes of the UAV flight respectively; Under the constraint of the maximum delay allowed by federated learning, the position of the UAV (horizontal position q m = {x, y} and height h), the user's transmission power Calculate frequency Transmission bandwidth Transfer time and local accuracy η, minimizing the objective function; constraints C1 and C2 represent the constraints on user computing frequency and transmission power; constraint C3 indicates that the total delay of users participating in federated learning cannot exceed the preset maximum value; constraint C4 is a constraint on transmission delay, that is, the model must be transmitted within the specified transmission time, R i is the transmission rate that user i can achieve; constraint C5 represents the location constraint of the UAV, and the distance between the user and the UAV cannot exceed the coverage range of the UAV; constraint C6 limits the flight altitude range of the UAV; constraint C7 indicates that the sum of the bandwidth allocated to all users within the coverage range of the UAV cannot exceed the total bandwidth B; constraint C8 stipulates the constraint range of the local training accuracy η.

[0048] In some embodiments, the step S2. using the optimization problem P to solve the problem includes:

[0049] S2.1. Set the initial UAV horizontal flight position q m and minimum flight altitude h;

[0050] S2.2. Set the initial user resource allocation decision and local accuracy η within the coverage area of ​​the drone, where the user resource allocation decision includes calculating the frequency f, transmission time t, transmission power p and transmission bandwidth b;

[0051] S2.3. Based on h, f, t, p, b, η, the optimization problem P is used to solve the optimal UAV horizontal position q m ;

[0052] S2.4. The optimal UAV horizontal position q obtained based on h, f, t, p, b and S2.3 m , using the optimization problem P to solve the optimal local accuracy η;

[0053] S2.5. The optimal horizontal position q of the UAV obtained based on h and S2.3 m and η obtained in S2.4, and using the optimization problem P to solve the optimal user resource allocation decision f, t, p and b;

[0054] S2.6. Repeat steps S2.3 to S2.5 until the target total cost function reaches convergence;

[0055] S2.7. Minimum value Δh according to height change min , change the height h of the drone;

[0056] S2.8. In response to the height of the UAV not exceeding the preset maximum height, repeat steps S2.2-S2.7 until the height of the UAV exceeds the maximum height, and obtain the optimal UAV horizontal position q with the minimum total cost function m, optimal local accuracy η, optimal user resource allocation decision, optimal UAV height h.

[0057] In some embodiments, in step S2.3, the optimization problem P is used to solve the optimal drone horizontal position q m ,include:

[0058] The flight altitude of the drone is h, the angle is θ, and the coverage radius r of the drone is:

[0059] r = htan(θ)

[0060] When h, f, t, p, b, η are determined, optimize the horizontal position q of the drone m ; Since the optimization of the drone's horizontal position only affects the user's communication energy consumption; the optimization problem P is equivalent to the optimization problem P1:

[0061]

[0062] The constraints are:

[0063] C4:

[0064] C5:

[0065] By introducing the slack variable β, the optimization problem P1 is equivalent to the optimization problem P2:

[0066]

[0067] The constraints are:

[0068] C5:

[0069] C9:sβ i ≤t i

[0070] C10:

[0071] Introducing slack variables Constrain C10 in the feasible solution Use a first-order Taylor expansion at:

[0072]

[0073]

[0074]

[0075] Where λ and κ represent intermediate variables; the optimization problem P2 is further transformed into the optimization problem P3:

[0076]

[0077] The constraints are:

[0078] C5:

[0079] C9:sβ i ≤t i

[0080] C11:

[0081] The optimization problem P3 is transformed into a convex problem, and the successive convex approximation SCA method is used to solve the optimal UAV horizontal position.

[0082] In some embodiments, in step S2.4, solving the optimization problem P to obtain the optimal local accuracy η includes:

[0083] When h, q m , after f, t, p, b are determined, the optimization problem P is transformed into the local precision η optimization problem P4:

[0084]

[0085] The constraints are:

[0086] C3:

[0087] C8:0≤η≤1

[0088] in

[0089] Constraint C3 is equivalent to t i ≤υ(η i ),in Since υ(η) is a convex function, constraint C3 is transformed into η min ≤η≤η max ,in The optimization problem P4 is transformed into the optimization problem P5:

[0090]

[0091] The constraints are:

[0092] min max

[0093] C12:η≤η≤η

[0094] Solving the optimization problem P5 is equivalent to finding the nonlinear function The root of is solved using the Dinkelbach Method.

[0095] In some embodiments, in step S2.5, solving the optimization problem P to obtain the optimal user resource allocation decision includes:

[0096] When m , h and η are determined, f, t, p and b are optimized, and the optimization problem P is transformed into the optimization problem P6:

[0097]

[0098] The constraints are:

[0099] C1:0≤f i ≤f i max

[0100] C2:

[0101] C3:

[0102] C4:

[0103] C7:

[0104] Split the optimization problem P6 into two optimization sub-problems;

[0105] The first sub-problem is to solve the remaining variables f, t, and p of the optimization problem P6 given the transmission bandwidth b, which is expressed as sub-problem P6-1:

[0106]

[0107] The constraints are:

[0108] C1:0≤f i ≤f i max

[0109] C2:

[0110] C3:

[0111] C4:

[0112] According to constraints C3 and C4, we get and Substituting it into constraints C1 and C2, subproblem P6-1 is transformed into P7:

[0113]

[0114] The constraints are:

[0115] C13:

[0116] C14:

[0117] The t obtained by C13 and C14 constraints i Maximum and minimum values; so P7 is further transformed into P8:

[0118]

[0119] The constraints are:

[0120] C15:

[0121] According to the optimization problem P8, when t i satisfy The optimal solution is Using the dichotomy method, we get At this point, we can further obtain f i * and

[0122] The second sub-problem is to solve the transmission bandwidth b of the optimization problem given the variables f, t, and p; this is expressed as sub-problem P6-2:

[0123]

[0124] The constraints are:

[0125] C7:

[0126] Since this optimization problem is convex, the KKT condition is used to solve the optimal expression of b;

[0127] Optimizing subproblem P6-2 will cause the bandwidth b to change, which in turn affects f, t, and p in subproblem P6-1. Subproblems P6-1 and P6-2 are solved iteratively to obtain the optimal f, t, p, and b.

[0128] In a second aspect, the present invention provides a UAV-assisted federated learning resource allocation device, including a processor and a storage medium;

[0129] The storage medium is used to store instructions;

[0130] The processor is used to operate according to the instructions to execute the steps of the method according to the first aspect.

[0131] In a third aspect, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0132] In a fourth aspect, the present invention provides a computing device, comprising:

[0133] One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described in the first aspect.

[0134] Beneficial effects: Compared with the prior art, the advantages of the present invention include:

[0135] 1. The present invention is aimed at the UAV-assisted federated learning wireless network scenario. Taking into account the impact of the UAV height on the coverage range, the total energy consumption of the user and the inverse of the number of participating users are comprehensively considered and defined as the cost function of the system.

[0136] 2. The present invention jointly considers the learning performance and the interests of users in the federated learning process. By jointly optimizing the position of the drone (horizontal position, altitude), the user's transmission power, computing frequency, transmission bandwidth, transmission time and local accuracy, it ensures the performance of federated learning while reducing the user's energy consumption.

[0137] 3. Different from the federated learning method in traditional scenarios, this method makes full use of the mobility of drones and achieves a balanced optimization of user energy consumption and federated learning performance by optimizing the horizontal position and height of drones. BRIEF DESCRIPTION OF THE DRAWINGS

[0138] Figure 1 is a schematic diagram of a flow chart provided according to an embodiment of the present invention;

[0139] Figure 2 Schematic diagram of a system model provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0140] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0141] In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0142] Example 1

[0143] like Figure 1 As shown, a UAV-assisted federated learning resource allocation method includes:

[0144] S1. Determine the total cost function and constraints of the system according to the total energy consumption of users participating in federated learning and the inverse of the number of users participating in learning, and construct an optimization problem P for minimizing the total cost function;

[0145] S2. Solve the optimization problem P to obtain the optimal horizontal position q of the UAV m , optimal local accuracy η, optimal user resource allocation decision, optimal UAV height h;

[0146] In some embodiments, the S2. using the optimization problem P to solve specifically includes:

[0147] S2.1. Set the initial UAV horizontal flight position q m and minimum flight altitude h;

[0148] S2.2. Set the initial user resource allocation decision and local accuracy η within the coverage area of ​​the drone, where the user resource allocation decision includes calculating the frequency f, transmission time t, transmission power p and transmission bandwidth b;

[0149] S2.3. Based on h, f, t, p, b, η, the optimization problem P is used to solve the optimal UAV horizontal position q m ;

[0150] S2.4. The optimal UAV horizontal position q obtained based on h, f, t, p, b and S2.3 m , using the optimization problem P to solve the optimal local accuracy η;

[0151] S2.5. The optimal horizontal position q of the UAV obtained based on h and S2.3 m and η obtained in S2.4, and using the optimization problem P to solve the optimal user resource allocation decision f, t, p and b;

[0152] S2.6. Repeat steps S2.3 to S2.5 until the target total cost function reaches convergence;

[0153] S2.7. Minimum value Δh according to height change min , change the height h of the drone;

[0154] S2.8. In response to the height of the UAV not exceeding the preset maximum height, repeat steps S2.2-S2.7 until the height of the UAV exceeds the maximum height, and obtain the optimal UAV horizontal position q with the minimum total cost function m , optimal local accuracy η, optimal user resource allocation decision, optimal UAV height h.

[0155] S3. The drone flies to the optimal horizontal position q of the drone obtained m and height h, users within the range of the drone participate in federated learning according to the optimal user resource allocation decision and the optimal local accuracy η decision obtained.

[0156] In some embodiments, the step S1, constructing an optimization problem P for minimizing the total cost function, includes:

[0157] S11. The set of users is represented as The users within the service range of drone m are represented by a set Total N m users; the distance between user i and drone m is:

[0158]

[0159] Where h is the height of the drone, q m ={x m ,y m} represents the horizontal position of the UAV m, q i ={x i ,y i} represents the position of user i, and the channel gain of user i is:

[0160]

[0161] Where g0 is the channel interference power when d0=1m, and α is the path loss exponent;

[0162] S12. The energy consumption of terminal devices directly affects the user experience, so we mainly focus on the energy consumption of user terminals during federated learning. The energy consumption of user terminals during federated learning includes training energy consumption and communication energy consumption.

[0163] S13. Use D i represents the amount of data of user i, f iIndicates the number of revolutions per second of the CPU of user i, C i Indicates the number of CPU revolutions when user i processes a sample of data. l Indicates the number of rounds of local training when the local accuracy reaches η;

[0164]

[0165] Where L and γ are related parameters of the neural network loss function, and δ is the learning step size of federated learning training;

[0166] The training energy consumption of user i in one round of federated learning It is expressed as:

[0167]

[0168] S14. After the user completes the local training, the trained model is uploaded to the drone via FDMA; i represents the bandwidth allocated to user i, p i represents the transmission power of user i, N0 represents the noise power spectrum density, and according to Shannon's formula, the transmission rate R that user i can achieve is i for:

[0169]

[0170] Assume that the data size of the neural network model w is s, and the communication energy consumption of user i is for:

[0171]

[0172] S15. When the global model accuracy is required to reach ε0, the number of communication rounds I g for:

[0173]

[0174] Where ξ represents the relevant parameters in the local neural network training, so the total energy consumption of the entire federated learning process is E total for:

[0175]

[0176] S16. Considering that the user's battery capacity is limited, the energy consumption of the terminal device directly affects the user's experience, so the user's total energy consumption is defined as part of the cost function. Since the performance of federated learning is related to the number of participating users, the more participating users there are, the faster the learning convergence will be. At the same time, the more diverse the data of the participating users is, the stronger the generalization ability of the obtained model will be. Therefore, the inverse of the number of participating users is defined as another part of the cost function, which represents the performance of federated learning. In order to achieve a balance between the user's energy consumption and the performance of federated learning, the total cost function C is defined as:

[0177]

[0178] The objective function is:

[0179]

[0180] in, represents a fixed value, ρ represents a weighting coefficient;

[0181] S17. Considering the total energy consumption of users and the performance of federated learning, the optimization problem P of the system is:

[0182]

[0183] The constraints are:

[0184] C1:0≤f i ≤f i max

[0185] C2:

[0186] C3:

[0187] C4:

[0188] C5:

[0189] C6:h min ≤h≤h max

[0190] C7:

[0191] C8:0≤η≤1

[0192] Where T is the total time budget for completing federated learning, B is the total bandwidth owned by the drone, and f i max represents the maximum computation frequency of user i, represents the maximum transmission power of user i, h min 、hmax Represent the lowest and highest altitudes of the UAV flight respectively; Under the constraint of the maximum delay allowed by federated learning, the position of the UAV (horizontal position q m = {x, y} and height h), the user's transmission power Calculate frequency Transmission bandwidth Transfer time and local accuracy η, minimizing the objective function; constraints C1 and C2 represent the constraints on user computing frequency and transmission power; constraint C3 indicates that the total delay of users participating in federated learning cannot exceed the preset maximum value; constraint C4 is a constraint on transmission delay, that is, the model must be transmitted within the specified transmission time, R i is the transmission rate that user i can achieve; constraint C5 represents the location constraint of the drone, and the distance between the user and the drone cannot exceed the coverage range of the drone; constraint C6 limits the flight altitude range of the drone. If the altitude is too low, the number of participating users will be too small, and if it is too high, there will be a shortage of wireless resources, resulting in an increase in learning energy consumption and delay, both of which will slow down the convergence of federated learning; constraint C7 means that the sum of the bandwidth allocated to all users within the coverage range of the drone cannot exceed the total bandwidth B; constraint C8 stipulates the constraint range of the local training accuracy η.

[0193] An embodiment of the present invention provides a UAV-assisted federated learning resource allocation method, which obtains the optimal resource allocation decision through successive convex approximation, Dinkelbach Method, dichotomy and KKT conditions in turn, so as to encourage more users to join federated learning.

[0194] In some embodiments, in step S2.3, the optimization problem P is used to solve the optimal drone horizontal position q m ,include:

[0195] The flight altitude of the drone is h, the angle is θ, and the coverage radius r of the drone is:

[0196] r = htan(θ)

[0197] When h, f, t, p, b, η are determined, optimize the horizontal position q of the drone m ; Since the optimization of the drone's horizontal position only affects the user's communication energy consumption; the optimization problem P is equivalent to the optimization problem P1:

[0198]

[0199] The constraints are:

[0200] C4:

[0201] C5:

[0202] By introducing the slack variable β, the optimization problem P1 is equivalent to the optimization problem P2:

[0203]

[0204] The constraints are:

[0205] C5:

[0206] C9:sβ i ≤t i

[0207] C10:

[0208] Introducing slack variables Constrain C10 in the feasible solution Use a first-order Taylor expansion at:

[0209]

[0210]

[0211]

[0212] Where λ and κ represent intermediate variables; the optimization problem P2 is further transformed into the optimization problem P3:

[0213]

[0214] The constraints are:

[0215] C5:

[0216] C9:sβ i ≤t i

[0217] C11:

[0218] The optimization problem P3 is transformed into a convex problem, and the successive convex approximation SCA method is used to solve the optimal UAV horizontal position.

[0219] When the drone arrives at a new location, the coverage position of the drone changes. Due to the existence of constraint C5, the original user is still within the range of the drone, but new users may join. At this time, the values ​​of each variable are reinitialized and the algorithm is iterated again.

[0220] In some embodiments, in step S2.4, solving the optimization problem P to obtain the optimal local accuracy η includes:

[0221] When h, q m , after f, t, p, b are determined, the optimization problem P is transformed into the local precision η optimization problem P4:

[0222]

[0223] The constraints are:

[0224] C3:

[0225] C8:0≤η≤1

[0226] in

[0227] Constraint C3 is equivalent to t i ≤υ(η i ),in Since υ(η) is a convex function, constraint C3 is transformed into η min ≤η≤η max ,in The optimization problem P4 is transformed into the optimization problem P5:

[0228]

[0229] The constraints are:

[0230] min max

[0231] C12:η≤η≤η

[0232] Solving the optimization problem P5 is equivalent to finding the nonlinear function The root of is solved using the Dinkelbach Method.

[0233] In some embodiments, in step S2.5, solving the optimization problem P to obtain the optimal user resource allocation decision includes:

[0234] When m , h and η are determined, f, t, p and b are optimized, and the optimization problem P is transformed into the optimization problem P6:

[0235]

[0236] The constraints are:

[0237] C1:0≤f i ≤f i max

[0238] C2:

[0239] C3:

[0240] C4:

[0241] C7:

[0242] Split the optimization problem P6 into two optimization sub-problems;

[0243] The first sub-problem is to solve the remaining variables f, t, and p of the optimization problem P6 given the transmission bandwidth b, which is expressed as sub-problem P6-1:

[0244]

[0245] The constraints are:

[0246] C1:0≤f i ≤f i max

[0247] C2:

[0248] C3:

[0249] C4:

[0250] According to constraints C3 and C4, we get and Substituting it into constraints C1 and C2, subproblem P6-1 is transformed into P7:

[0251]

[0252] The constraints are:

[0253] C13:

[0254] C14:

[0255] The t obtained by C13 and C14 constraints i Maximum and minimum values; so P7 is further transformed into P8:

[0256]

[0257] The constraints are:

[0258] C15:

[0259] According to the optimization problem P8, when t i satisfy The optimal solution is Using the dichotomy method, we get At this point, we can further obtain f i * and

[0260] The second sub-problem is to solve the transmission bandwidth b of the optimization problem given the variables f, t, and p; this is expressed as sub-problem P6-2:

[0261]

[0262] The constraints are:

[0263] C7:

[0264] Since this optimization problem is convex, the KKT condition is used to solve the optimal expression of b;

[0265] Optimizing subproblem P6-2 will cause the bandwidth b to change, which in turn affects f, t, and p in subproblem P6-1. Subproblems P6-1 and P6-2 are solved iteratively to obtain the optimal f, t, p, and b.

[0266] Example 2

[0267] In a second aspect, this embodiment provides a UAV-assisted federated learning resource allocation device, including a processor and a storage medium;

[0268] The storage medium is used to store instructions;

[0269] The processor is used to operate according to the instructions to execute the steps of the method according to embodiment 1.

[0270] Example 3

[0271] In a third aspect, this embodiment provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in Example 1 are implemented.

[0272] Example 4

[0273] In a fourth aspect, the present invention provides a computing device, comprising:

[0274] One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods described in Example 1.

[0275] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0276] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0277] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0278] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0279] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A UAV-assisted federated learning resource allocation method, characterized in that: include: S1. Determine the total cost function and constraints of the system according to the total energy consumption of users participating in federated learning and the inverse of the number of users participating in learning, and construct an optimization problem P for minimizing the total cost function; S2. Solve the optimization problem P to obtain the optimal horizontal position of the UAV, the optimal local accuracy, the optimal user resource allocation decision, and the optimal UAV height; S3. The drone flies to the optimal horizontal position and height of the drone obtained by the solution, and the users within the range of the drone participate in the federated learning according to the optimal user resource allocation decision and the optimal local accuracy decision obtained by the solution; In step S1, constructing the optimization problem P for minimizing the total cost function includes: S11. The set of users is represented as The users within the service range of drone m are represented by a set Total N m users; the distance between user i and drone m is: Where h is the height of the drone, q m ={x m ,y m } represents the horizontal position of the UAV m, q i ={x i ,y i } represents the position of user i, and the channel gain of user i is: Where g0 is the channel interference power when d0 = 1m, and α is the path loss exponent; S12. The energy consumption of user terminals during federated learning includes training energy consumption and communication energy consumption; S13. Use D i represents the amount of data of user i, f i Indicates the number of revolutions per second of the CPU of user i, C i Indicates the number of CPU revolutions when user i processes a sample of data. l Indicates the number of rounds of local training when the local accuracy reaches η; Where L and γ are related parameters of the neural network loss function, and δ is the learning step size of federated learning training; The training energy consumption of user i in one round of federated learning It is expressed as: S14. After the user completes the local training, the trained model is uploaded to the drone via FDMA; i represents the bandwidth allocated to user i, p i represents the transmission power of user i, N0 represents the noise power spectrum density, and according to Shannon's formula, the transmission rate R that user i can achieve is i for: Assume that the data size of the neural network model w is s, and the communication energy consumption of user i is for: S15. When the global model accuracy is required to reach ε0, the number of communication rounds I g for: Where ξ represents the relevant parameters in the local neural network training, so the total energy consumption of the entire federated learning process is E total for: S16. The total cost function C is defined as: The objective function is: in, represents a fixed value, ρ represents a weighting coefficient; S17. Considering the total energy consumption of users and the performance of federated learning, the optimization problem P of the system is: The constraints are: C1:0≤f i ≤f i max C2: C3: C4: C5: C6:h min ≤h≤h max C7: C8:0≤η≤1 Where T is the total time budget for completing federated learning, B is the total bandwidth owned by the drone, and f i max represents the maximum computation frequency of user i, represents the maximum transmission power of user i, h min 、h max Represent the lowest and highest altitudes of the UAV flight respectively; Under the constraint of the maximum delay allowed by federated learning, the horizontal position q of the UAV is jointly optimized m = {x, y} and height h, user's transmission power Calculate frequency Transmission bandwidth Transfer time and local accuracy η, minimizing the objective function; constraints C1 and C2 represent the constraints on user computing frequency and transmission power; constraint C3 indicates that the total delay of users participating in federated learning cannot exceed the preset maximum value; constraint C4 is a constraint on transmission delay, that is, the model must be transmitted within the specified transmission time, R i is the transmission rate that user i can achieve; constraint C5 represents the location constraint of the UAV, and the distance between the user and the UAV cannot exceed the coverage range of the UAV; constraint C6 limits the flight altitude range of the UAV; constraint C7 indicates that the sum of the bandwidth allocated to all users within the coverage range of the UAV cannot exceed the total bandwidth B; constraint C8 stipulates the constraint range of the local training accuracy η.

2. The method for allocating resources of federated learning assisted by a drone as claimed in claim 1, characterized in that: The step S2. using the optimization problem P to solve the problem includes: S2.

1. Set the initial UAV horizontal flight position q m and minimum flight altitude h; S2.

2. Set the initial user resource allocation decision and local accuracy η within the coverage area of ​​the drone, where the user resource allocation decision includes calculating the frequency f, transmission time t, transmission power p and transmission bandwidth b; S2.

3. Based on h, f, t, p, b, η, the optimization problem P is used to solve the optimal UAV horizontal position q m ; S2.

4. The optimal UAV horizontal position q obtained based on h, f, t, p, b and S2.3 m , using the optimization problem P to solve the optimal local accuracy η; S2.

5. The optimal horizontal position q of the UAV obtained based on h and S2.3 m and η obtained in S2.4, and using the optimization problem P to solve the optimal user resource allocation decision f, t, p and b; S2.

6. Repeat steps S2.3 to S2.5 until the target total cost function reaches convergence; S2.

7. Minimum value Δh according to height change min , change the height h of the drone; S2.

8. In response to the height of the UAV not exceeding the preset maximum height, repeat steps S2.2-S2.7 until the height of the UAV exceeds the maximum height, and obtain the optimal UAV horizontal position q with the minimum total cost function m , optimal local accuracy η, optimal user resource allocation decision, optimal UAV height h.

3. The method for allocating resources of federated learning assisted by a drone as claimed in claim 2, characterized in that: In step S2.3, the optimization problem P is used to solve the optimal UAV horizontal position q m ,include: The flight altitude of the drone is h, the angle is θ, and the coverage radius r of the drone is: r = htan(θ) When h, f, t, p, b, η are determined, optimize the horizontal position q of the drone m ; Since the optimization of the drone's horizontal position only affects the user's communication energy consumption; the optimization problem P is equivalent to the optimization problem P1: The constraints are: C4: C5: By introducing the slack variable β, the optimization problem P1 is equivalent to the optimization problem P2: The constraints are: C5: C9:sβ i ≤t i C10: Introducing slack variables Constrain C10 in the feasible solution Use a first-order Taylor expansion at: Where λ and κ represent intermediate variables; the optimization problem P2 is further transformed into the optimization problem P3: The constraints are: C5: C9:sβ i ≤t i C11: The optimization problem P3 is transformed into a convex problem, and the successive convex approximation SCA method is used to solve the optimal UAV horizontal position.

4. The method for allocating resources of federated learning assisted by a drone as claimed in claim 2, characterized in that: In step S2.4, the optimization problem P is used to solve the optimal local accuracy η, including: When h, q m , after f, t, p, b are determined, the optimization problem P is transformed into the local precision η optimization problem P4: The constraints are: C3: C8:0≤η≤1 in Constraint C3 is equivalent to t i ≤υ(η i ),in Since υ(η) is a convex function, constraint C3 is transformed into η min ≤η≤η max ,in The optimization problem P4 is transformed into the optimization problem P5: The constraints are: C12: η min≤η≤ηmax Solving the optimization problem P5 is equivalent to finding the nonlinear function The root of is solved using the Dinkelbach Method.

5. The method for allocating resources of federated learning assisted by a drone as claimed in claim 2, characterized in that: In step S2.5, the optimization problem P is used to solve the optimal user resource allocation decision, including: When m , h and η are determined, f, t, p and b are optimized, and the optimization problem P is transformed into the optimization problem P6: The constraints are: C1:0≤f i ≤f i max C2: C3: C4: C7: Split the optimization problem P6 into two optimization sub-problems; The first sub-problem is to solve the remaining variables f, t, and p of the optimization problem P6 given the transmission bandwidth b, which is expressed as sub-problem P6-1: The constraints are: C1:0≤f i ≤f i max C2: C3: C4: According to constraints C3 and C4, we get and Substituting it into constraints C1 and C2, subproblem P6-1 is transformed into P7: The constraints are: C13: C14: The t obtained by C13 and C14 constraints i Maximum and minimum values; so P7 is further transformed into P8: The constraints are: C15: According to the optimization problem P8, when t i satisfy The optimal solution is Using the dichotomy method, we get At this point, we can further obtain f i * and The second sub-problem is to solve the transmission bandwidth b of the optimization problem given the variables f, t, and p; this is expressed as sub-problem P6-2: The constraints are: C7: Since this optimization problem is convex, the KKT condition is used to solve the optimal expression of b; Optimizing subproblem P6-2 will cause the bandwidth b to change, which in turn affects f, t, and p in subproblem P6-1. Subproblems P6-1 and P6-2 are solved iteratively to obtain the optimal f, t, p, and b.

6. A UAV-assisted federated learning resource allocation device, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 5.

7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computing device, characterized in that: include, One or more processors, one or more memories, and one or more programs, wherein the one or more programs are stored in the one or more memories and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods according to claims 1 to 5.