Blockchain-based multi-unmanned aerial vehicle assisted federated learning method, device and medium
By optimizing transmission strategies, model training, and resource allocation, and combining them with blockchain consensus mechanisms, the problem of high energy consumption in drone-assisted federated learning has been solved, achieving better resource allocation and system utility, reducing system energy consumption, and improving data collection efficiency and communication capacity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2025-05-06
- Publication Date
- 2026-04-21
AI Technical Summary
In drone-assisted federated learning under blockchain, there is a lack of research on the energy consumption of resource allocation, and the limited energy of drones leads to high system energy consumption, insufficient trajectory optimization, and affects data collection efficiency and communication costs.
A multi-UAV-assisted federated learning system is constructed. By optimizing transmission strategies, model training strategies, and computing resource allocation, and combining blockchain consensus mechanisms, UAV trajectories and energy consumption are optimized. Block coordinate descent and continuous convex approximation algorithms are used to solve non-convex optimization problems, thereby reducing system energy consumption.
It achieves better resource allocation in a multi-drone-assisted federated learning scenario under blockchain, reduces total system energy consumption, improves system efficiency, increases data collection efficiency and communication capacity, and reduces terminal transmission latency.
Smart Images

Figure CN120409739B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) communication technology, and specifically to a blockchain-based multi-UAV assisted federated learning method, device, and storage medium. Background Technology
[0002] Federated learning is an innovative distributed machine learning paradigm designed to resolve the conflict between data privacy and collaborative learning. Its core concept involves multiple participants training a model locally and securely exchanging model parameters to collaboratively optimize a global model without sharing the original data. This approach avoids the risk of sensitive data leakage, breaks down data silos, and leverages the diversity of distributed data to improve the model's generalization ability. Key features of federated learning include: privacy protection, distributed collaboration, efficient communication, and flexible adaptation.
[0003] Its typical applications cover multiple fields: in the medical field, hospitals can jointly train disease prediction models without sharing patient privacy data; in the financial industry, multiple banks collaborate to build anti-fraud models to protect customer transaction information; in smart terminal scenarios, mobile phone input methods update models through local data, avoiding the upload of user input content to the cloud; in the Industrial Internet of Things, edge devices jointly optimize equipment fault detection models, reducing dependence on central servers. Key technologies include federated averaging algorithms, differential privacy, heterogeneous data alignment, and asynchronous training mechanisms. Compared with traditional centralized training, federated learning achieves a balance between privacy protection and model performance while reducing communication costs and enhancing the real-time performance of edge computing. Despite challenges such as communication efficiency and heterogeneous data fusion, its application potential in smart cities, smart healthcare, fintech, and other fields is enormous, making it a cutting-edge direction for the cross-integration of artificial intelligence and data security.
[0004] In recent years, unmanned aerial vehicles (UAVs) have been applied to federated learning in wireless scenarios due to their advantages in mobility and cost. By using federated learning technology, UAVs, as executors of federated learning tasks, can perform distributed model training without compromising their own data privacy. Although UAV-assisted federated learning has broad application prospects, UAVs, as aggregation devices, may face the risk of being attacked, leading to malicious tampering of the global model. Therefore, in recent years, some have begun to introduce blockchain technology into this process. Blockchain blocks need to be verified by a majority of nodes before being added to the chain. After being added to the chain, hash encryption technology ensures that the content of each block is immutable, thus ensuring the authenticity and verifiability of the model.
[0005] However, with the increasing demand for terminals and services, drones, as energy-constrained devices, are facing increasing pressure in assisted federated learning scenarios.
[0006] Current research on drone-assisted federated learning under blockchain technology has several shortcomings. Firstly, there is a lack of research on the energy consumption of resource allocation in drone-assisted federated learning under blockchain. Since the drones themselves and the terminals have limited energy, studying the overall energy consumption of the system is essential. Secondly, there is insufficient research on drone trajectories in federated learning scenarios. Drones can collect terminal data while in motion, which improves the scope and efficiency of data collection in federated learning while reducing usage costs. Summary of the Invention
[0007] This invention proposes a blockchain-based multi-UAV assisted federated learning method, device, and medium. However, some shortcomings exist in blockchain-based UAV assisted federated learning research, particularly regarding the energy consumption of UAVs in resource allocation during flight scenarios. Since the energy of the UAVs themselves and the terminal is limited, research on the overall system energy consumption is essential. Furthermore, research on training strategies for UAV federated learning is lacking.
[0008] To address the aforementioned technical problems, this invention provides the following technical solution: a blockchain-based multi-UAV assisted federated learning method, characterized by comprising the following steps:
[0009] Step 1: Establish a system model including M drones, K users, blockchain, and federated learning. Multiple drones equipped with MEC servers are deployed at the edge to provide federated learning services to the cloud. The cloud will send the initial model and initial sample data to the drones and deploy a blockchain system on the MEC server, enabling the drones to act as blockchain nodes to reach consensus on blocks and upload them to the chain.
[0010] Step 2: Each UAV, acting as an airborne FL node, collects sample data from the terminal for federated learning model training, which generates terminal transmission energy consumption and model training energy consumption. While collecting terminal sample data, the UAV also moves along its trajectory to reduce the transmission energy consumption of communication between the terminal and the UAV, which generates UAV propulsion energy consumption.
[0011] Step 3: Each UAV acts as an aerial blockchain node, processing the generated model update information into transaction information and sending it to other UAVs, and selecting a block-producing UAV. The block-producing UAV will propagate the block, which is packaged from the model update information, to the non-block-producing UAVs. The non-block-producing UAVs verify the block, and after successful verification, send a response and add the block to the blockchain. This will generate the verification energy consumption of the non-block-producing UAVs and the block-producing energy consumption and block propagation energy consumption of the block-producing UAVs in the blockchain model.
[0012] Step 4: Each UAV acts as an airborne FL node, performing global aggregation using the model update information stored in the block, and generating a new global model as the initial model for the next round of training.
[0013] Step 5: Based on the energy consumption of the UE layer and UAV-MEC layer, construct a joint optimization problem of transmission strategy, model training strategy, computing resource allocation, and trajectory optimization, and solve the optimization problem to obtain the optimal solution that minimizes system energy consumption.
[0014] Furthermore, each UAV, acting as an airborne FL node, collects sample data from the terminal for federated learning model training. This generates terminal transmission energy consumption and model training energy consumption. By optimizing the transmission strategy to reduce transmission energy consumption and optimizing the number of model training iterations for each UAV in each time slot, the latency of FL training for each UAV in each time slot is minimized, thereby reducing FL training energy consumption. First, the UAV's flight period T is discretized and divided into N time slots, with the length of each time slot denoted as . The size of the sample data transmitted by ground terminal k to UAV m in the nth time slot is denoted as . The correlation variable between the two is denoted as The range of values is A value of 1 indicates a connection between the two parties, while a value of 0 indicates otherwise. The channel power gain of terminal k and drone m in the nth time slot is: , It is the distance from terminal k in the nth time slot to drone m. Indicates reference distance = 1, which represents the channel gain. The transmission rate of terminal k and UAV m in the nth time slot can be expressed as:
[0015]
[0016] This represents the channel bandwidth between terminal k and drone m. It is the transmit power of terminal k. This refers to noise power. Since the objective is to minimize energy consumption, the following constraints must be satisfied: This indicates that the amount of data transmitted must be greater than or equal to the total amount of sample data. The transmission delay between terminal k and drone m is:
[0017]
[0018] The transmission energy consumption of terminal k in the nth time slot can be expressed as:
[0019]
[0020] The re-discretization of FL is based on the formulas for the number of local training iterations and the number of global rounds:
[0021] ,
[0022] ,
[0023] The number of time slots in each global round can be denoted as... The starting slot index of the r-th global round is denoted as... , The drone, acting as an aerial FL node, records the FL training task as... ,in It represents the number of samples used by the drone for model training in the nth time slot. This is the number of CPU cycles required to train one sample, assuming each sample has 100 bits. Therefore there is .
[0024] The number of times drone m is trained in the nth time slot is denoted as... The computing resources allocated to federated learning by drone m in the nth time slot are denoted as... Therefore, the training latency of FL is:
[0025]
[0026] Training energy consumption is:
[0027]
[0028] The number of local training sessions should meet the following requirements: .
[0029] Furthermore, each UAV described in this invention acts as an aerial blockchain node, sending the generated model update information to other UAVs and selecting a block-producing UAV. The block-producing UAV then propagates a block, packaged with the model update information, to non-block-producing UAVs. The non-block-producing UAVs verify the block, and upon successful verification, send a response and add the block to the blockchain. Definition This is a block-producing flag; a value of 1 indicates that the drone has been selected as a block-producing drone, while a value of 0 indicates that it has not. It is also recorded... Let n be the size of the transaction information in the nth time slot. It is the number of CPU cycles required to process each bit of transaction information. The block generation latency is due to the computing resources allocated to the blockchain layer by the drone in the nth time slot.
[0030]
[0031] Block production energy consumption: There are also issues with the energy consumption and time required for block propagation by drones. ,in It is the block size of the nth time slot. This refers to the transmission rate between drones, therefore the energy consumption of the propagation block is... For non-block-producing drones to complete block verification, the verification time is... Verify energy consumption: Therefore, the total energy consumption of a blockchain task is:
[0032]
[0033] Since both the system runtime T and the FL process are discretized, the following constraint needs to be satisfied:
[0034]
[0035] In other words, the total time for drone training, block generation, verification, and block propagation within a single time slot cannot exceed the length of that time slot. Specifically: ,
[0036] Furthermore, step 5 of this invention constructs a joint optimization problem of transmission strategy, model training strategy, computing resource allocation, and trajectory optimization based on the energy consumption of the UE layer and UAV-MEC layer, thereby minimizing system energy consumption. The solution steps first divide the joint optimization problem into two sub-problems: sub-problem P1.1 for optimizing trajectory and transmission strategy, and sub-problem P1.2 for optimizing computing resources and model training strategy. For sub-problem P1.1, the terminal transmission strategy is first optimized given the optimized computing resources, model training strategy, and trajectory. Then, based on this optimized value, the UAV trajectory is optimized using the SCA continuous convex approximation algorithm. Next, sub-problem P1.2 is solved. Based on the trajectory and transmission strategy optimization values obtained from solving P1.1, and given the model training strategy, the computing resource allocation is solved using the KKT conditions. Then, the model training strategy is solved using the optimized values of trajectory, transmission strategy, and computing resource allocation. The block coordinate descent method is used to iteratively update until the terminal transmission strategy, UAV trajectory, computing resource allocation, and model training strategy converge, yielding the minimum system energy consumption.
[0037] Furthermore, the method described in this invention includes: the total energy consumption for completing the data collection task, FL task, and blockchain task processing can be expressed as:
[0038]
[0039] in It is a mapping factor that ensures that the energy consumption of the drone's propulsion system and other parts of the system have the same level. Then, according to the blockchain-based multi-drone assisted federated learning method claimed in the above claims, the characteristic is to construct an optimization problem with the objective of minimizing the energy consumption of the entire system. The optimization problem can be specifically expressed as:
[0040]
[0041] ST
[0042] (1)
[0043] (2)
[0044] (3)
[0045] (4)
[0046] (5)
[0047] (6)
[0048] (7)
[0049] (8)
[0050] (9)
[0051] (10)
[0052] (11)
[0053] (12)
[0054] (13)
[0055] (14)
[0056] (15)
[0057] (16)
[0058] It is a terminal data transmission variable. It is the drone's trajectory. These are computational resource variables for the federated learning layer. These are computational resource variables at the blockchain layer. It refers to the model training strategy of the UAV, that is, the number of times the UAV selects to train the model in the nth time slot.
[0059] Constraints (1)-(5) are constraints related to the speed and acceleration of the UAV; among which It is the velocity of drone m in the nth time slot; It is the acceleration of drone m in the nth time slot; It is gravitational acceleration; and These are parameters related to drones. It is the maximum acceleration. That is the maximum speed.
[0060] Constraints (6) and (7) correspond to the initial / final position constraints and initial / final velocity constraints of the UAV, respectively; constraints (8)-(9) are the trajectory constraints of the UAV. This represents the minimum safe distance between drones to avoid collisions; constraint (10) ensures that the data transmitted by the terminal should not be less than the sample data size. The constraint (11) indicates the sample data size; constraint (12) indicates that the amount of data transmitted by each time slot terminal will not exceed the maximum transmission capacity of each time slot; constraints (13) ensure that the allocated computing resources are not negative; constraint (14) is the maximum computing resource constraint, where Represents the maximum computing resources; constraint (15) means that the sum of the UAV training time, block generation time, verification time, and block propagation time in a time slot cannot exceed the length of a time slot. Constraint (16) means that the sum of the number of training iterations in each time slot in a round should not be less than the number of local training iterations.
[0061] Furthermore, the method described in this invention includes: because the objective function and the constraints are non-convex, the optimization problem is a non-convex optimization problem, which is solved by finding the terminal data transmission strategy. Drone flight trajectory Computational resources allocated to the federated learning layer Computing resources allocated to the blockchain layer Model training strategy To minimize the total energy consumption of the system, the entire problem is decomposed into two large sub-optimization problems, which are then further decomposed into smaller sub-problems. The UAV trajectory optimization algorithm based on block coordinate descent (BCD) and continuous convex approximation (SCA) is used to alternately optimize and solve the problem, and finally the approximate optimal solution of the problem is obtained.
[0062] In another aspect, the present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method described above.
[0063] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0064] As described above, the present invention provides a blockchain-based multi-drone assisted federated learning method that constructs a blockchain-based drone-assisted federated learning framework. In this blockchain-based drone-assisted federated learning system, multiple drones equipped with MEC servers are deployed at the edge to provide federated learning services to the cloud. The drones collect sample data from terminals to train the federated learning model and send the generated model update information to other drones for global aggregation. Simultaneously, a blockchain system is deployed on these MEC servers. The drones, acting as blockchain nodes, reach consensus on blocks packaged with model update information and upload them to the blockchain, thereby preventing data tampering and improving system robustness. This invention achieves a superior model training and resource allocation strategy in a blockchain-based multi-drone mobile assisted federated learning scenario, thereby reducing total system energy consumption and improving system efficiency.
[0065] This invention proposes a blockchain-based UAV-assisted federated learning system model and studies the energy consumption of the system under blockchain-based UAV-assisted federated learning. It not only reduces terminal energy consumption by optimizing the terminal's data transmission strategy but also further optimizes the UAV's flight trajectory to reduce energy consumption during propulsion. Compared to systems without optimized UAV trajectories, the system constructed in this method allows the UAV to autonomously approach the terminal with an optimal trajectory, reducing the distance and increasing communication capacity. Even for remote terminals, data can be easily uploaded, thereby reducing terminal transmission latency and energy consumption. This invention also considers the dual role of the UAV as both a blockchain node and a task executor in federated learning. By optimizing the allocation strategy of computing resources consumed in task execution at both the blockchain and federated learning layers, it reduces the energy consumed by the UAV during task execution, enabling the UAV to adopt the optimal computing resource allocation strategy to improve execution efficiency and reduce latency. This invention considers how a drone adjusts its sample training strategy in each time slot when performing federated learning training tasks during flight, thereby affecting the allocation strategy of computing resources in the federated learning layer and the blockchain layer and reducing energy consumption. This invention analyzes and models the entire system, proposes a multivariate non-convex optimization problem to minimize system energy consumption, and uses an algorithm combining block descent coordinates and continuous convex approximation method to solve the optimization problem, thereby obtaining the optimal strategy that the drone and terminal should execute in each time slot. Attached Figure Description
[0066] Figure 1A flowchart illustrating a blockchain-based multi-UAV assisted federated learning method is provided as an embodiment of the present invention;
[0067] Figure 2 A flowchart of the blockchain workflow for a blockchain-based multi-UAV assisted federated learning method provided in the first embodiment of the present invention;
[0068] Figure 3 A system model diagram of a blockchain-based multi-UAV assisted federated learning method is provided for the second embodiment of the present invention;
[0069] Figure 4 The second embodiment of the present invention provides a comparative experimental simulation diagram showing the change of the objective function value of a blockchain-based multi-UAV assisted federated learning method with different parameters and the number of iterations. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0071] Reference Figure 1 As one embodiment of the present invention, a blockchain-based multi-UAV assisted federated learning method is provided, comprising:
[0072] S1: Construct a system model for multi-drone-assisted federated learning under blockchain.
[0073] A system model for blockchain-based multi-drone-assisted federated learning, such as Figure 2 As shown, consider a having A collection of terminals The collection of drones that serve as blockchain nodes is denoted as... The quantity is ,terminal The coordinates are In addition, each drone is equipped with a small MEC server, so the drone can serve as a blockchain node and an edge node for federated learning. The drone can execute the consensus process of the blockchain and also perform related tasks of federated learning.
[0074] The entire model can be divided into three layers: the cloud layer, the UAV layer, and the terminal layer. The model's workflow is as follows:
[0075] (1) The terminal transmits sample data to the drone;
[0076] (2) The drone performs federated learning training and generates model update information;
[0077] (3) Each drone acts as a blockchain node and sends model update information to other drones;
[0078] (4) Use a consensus mechanism to select a block-producing drone;
[0079] (5) Block-producing drones broadcast blocks to non-block-producing drones;
[0080] (6) Non-block-producing drones verify blocks;
[0081] (7) After verification, the drone will add the block to the chain and aggregate the global model.
[0082] S2: Construct a communication model based on wireless communication theory and analyze the terminal transmission energy consumption.
[0083] The coordinates of the m-th drone are ,in As a constant, continuous time Divided into Each time slot, time slot Thus, the position of the m-th time slot of the drone is The drone trajectory is .
[0084] For convenience, the communication link between the UAV and the terminal device is considered as line-of-sight (LoS) transmission. This means that the channel quality is only related to the distance between the UAV and the terminal device. Furthermore, assuming that the Doppler effect caused by the UAV's maneuverability can be effectively compensated at the receiver, the channel power gain of the terminal k and the UAV m at the nth time slot follows the free-space path loss model as follows:
[0085]
[0086] It is the distance from terminal k in the nth time slot to drone m. Indicates reference distance = 1 is the channel gain. Furthermore, assuming the UAV uses frequency division multiple access to share spectrum resources, and multiple terminals associated with the same UAV use orthogonal resource blocks for data transmission, the transmission rate between terminal k and UAV m in the nth time slot can be expressed as:
[0087]
[0088] This represents the channel bandwidth between terminal k and drone m. It is the transmit power of terminal k. This is noise power. The transmission rate between terminal k and UAV m in the nth time slot can be expressed as:
[0089]
[0090] This represents the channel bandwidth between terminal k and drone m. It is the transmit power of terminal k. This refers to noise power. Since the objective is to minimize energy consumption, the following constraints must be satisfied: This indicates that the amount of data transmitted must be greater than or equal to the total amount of sample data. The transmission delay between terminal k and drone m is:
[0091]
[0092] The transmission energy consumption of terminal k in the nth time slot can be expressed as:
[0093]
[0094] S3: Discretize the FL process based on the local training iteration formula and the global rounds formula, and analyze the FL training energy consumption.
[0095] Number of local training sessions:
[0096]
[0097] Global round formula:
[0098]
[0099] The number of time slots in each global round can be denoted as... The starting slot index of the r-th global round is denoted as... , The drone, acting as an aerial FL node, records the FL training task as... ,in It represents the number of samples used by the drone for model training in the nth time slot. This is the number of CPU cycles required to train one sample, assuming each sample has 100 bits. Therefore there is .
[0100] The number of times drone m is trained in the nth time slot is denoted as... The computing resources allocated to federated learning by drone m in the nth time slot are denoted as... Therefore, the training latency of FL is:
[0101]
[0102] Training energy consumption is:
[0103]
[0104] The number of local training sessions should meet the following requirements: .
[0105] S4: Establishing a blockchain model based on a drone-supported MEC network
[0106] (1) Block generation
[0107] definition This is a block-producing flag; a value of 1 indicates that the drone has been selected as a block-producing drone, while a value of 0 indicates that it has not. It is also recorded... Let n be the size of the transaction information in the nth time slot. It is the number of CPU cycles required to process each bit of transaction information. The block generation latency is due to the computing resources allocated to the blockchain layer by the drone in the nth time slot.
[0108]
[0109] Block production energy consumption: .
[0110] (2) Consensus Process
[0111] Before a newly generated block is added to the blockchain, it needs to be verified to achieve consensus across the entire blockchain. The consensus process includes transaction propagation, block propagation, and block verification. Transaction propagation has a relatively small impact on system energy consumption, so it is neglected. The following section will model the block propagation and block verification processes.
[0112] For block-producing drones, there are also energy consumption and time consumption for block propagation:
[0113] ,
[0114] in It is the block size of the nth time slot. This refers to the transmission rate between drones, therefore the energy consumption of the propagation block is... .
[0115] For non-block-producing drones to complete block verification, the verification time is...
[0116] ,
[0117] Verify energy consumption: .
[0118] Therefore, the total energy consumption of a blockchain task is:
[0119]
[0120] Since both the system runtime T and the FL process are discretized, the following constraint needs to be satisfied:
[0121]
[0122] In other words, the total time for drone training, block generation, verification, and block propagation within a single time slot cannot exceed the length of that time slot. Specifically: ,
[0123] S5: Construct drone models based on drone parameters.
[0124] The energy consumption for completing computational and blockchain tasks should include the propulsion energy consumption generated by the drone's movement. The drone's propulsion energy consumption accounts for a significant portion of the total system energy consumption. The propulsion energy consumption of drone m in the nth time slot can be expressed as:
[0125]
[0126] The velocity of drone m in the nth time slot: The acceleration of drone m in the nth time slot: Gravitational acceleration: Drone-related parameters: and
[0127] Velocity and acceleration satisfy the following constraints:
[0128]
[0129]
[0130]
[0131]
[0132]
[0133] It is the maximum acceleration. That is the maximum speed.
[0134] S6: Propose a non-convex joint optimization problem.
[0135] In mathematics, a formulaic problem can be represented as:
[0136] Question P1:
[0137]
[0138] ST
[0139] (1)
[0140] (2)
[0141] (3)
[0142] (4)
[0143] (5)
[0144] (6)
[0145] (7)
[0146] (8)
[0147] (9)
[0148] (10)
[0149] (11)
[0150] (12)
[0151] (13)
[0152] (14)
[0153] (15)
[0154] (16)
[0155] It is a terminal data transmission variable. It is the drone's trajectory. These are computational resource variables for the federated learning layer. These are computational resource variables at the blockchain layer. It refers to the model training strategy of the UAV, that is, the number of times the UAV selects to train the model in the nth time slot.
[0156] Constraints (1)-(5) are constraints related to the speed and acceleration of the UAV; among which It is the velocity of drone m in the nth time slot; It is the acceleration of drone m in the nth time slot; It is gravitational acceleration; and These are parameters related to drones. It is the maximum acceleration. That is the maximum speed.
[0157] Constraints (6) and (7) correspond to the initial / final position constraints and initial / final velocity constraints of the UAV, respectively; constraints (8) and (9) are the trajectory constraints of the UAV. This represents the minimum safe distance between drones to avoid collisions; constraint (10) ensures that the data transmitted by the terminal should not be less than the sample data size. The constraint (11) indicates the sample data size; constraint (12) indicates that the amount of data transmitted by each time slot terminal will not exceed the maximum transmission capacity of each time slot; constraints (13) ensure that the allocated computing resources are not negative; constraint (14) is the maximum computing resource constraint, where Represents the maximum computing resources; constraint (15) means that the sum of the UAV training time, block generation time, verification time, and block propagation time in a time slot cannot exceed the length of a time slot. Constraint (16) means that the sum of the number of training iterations in each time slot in a round should not be less than the number of local training iterations.
[0158] S7: An optimization algorithm combining block coordinate descent and continuous convex approximation is adopted. Multiple slack variables are introduced to decouple the non-convex optimization problem into multiple sub-convex optimization problems, and the optimal solution is obtained through iterative optimization.
[0159] Since the objective function of problem P1 is non-convex, the problem itself is also non-convex and difficult to solve directly using traditional convex optimization techniques. This invention decomposes the objective problem into multiple sub-problems and employs an algorithm combining continuous convex approximation and block coordinate descent to solve problem P1. First, P1 is decomposed into two sub-problems, P2 and P3. Firstly, given the computational resource allocation and model training strategy, solving problem (P2) yields the UAV trajectory and terminal transmission strategy. Secondly, using the optimized UAV trajectory and terminal transmission strategy, problem (P3) can be solved to obtain the computational resource allocation and model training strategy.
[0160] P2:
[0161]
[0162] ST
[0163] (1)-(11),(15)
[0164] P3:
[0165]
[0166] ST
[0167] (12)-(16)(1) Optimization of terminal data transmission volume
[0168] For any given UAV trajectory and training strategy and computational allocation The data transmission of the terminal can be optimized by solving the following problem, denoted as P2.1:
[0169]
[0170] st
[0171] (10)
[0172] (11)
[0173] (15) The objective function of problem P2.1 is an affine function, which is a convex function. The two constraint functions are three inequality constraints, which are obviously convex functions. Therefore, problem P2.1 is a standard LP and can be solved effectively by existing optimization tools (such as CVX).
[0174] (2) Drone trajectory optimization
[0175] For any given terminal data transmission strategy, sample training strategy, and computational resource allocation The UAV trajectory can be optimized by addressing issue P2.2:
[0176]
[0177] st(1)-(9), (11)
[0178] The objective function of this problem is not a convex problem because 1 / for This is a non-convex term. An auxiliary variable can be introduced. = ,Will This whole thing is replaced with Assuming The value of the r-th iteration is For ease of calculation, let's assume:
[0179]
[0180]
[0181]
[0182] For 1 / Its upper bound can be obtained by performing a first-order Taylor expansion:
[0183]
[0184] The right side of the above inequality is denoted as .
[0185] In order to handle constraint (11) Its lower bound can be obtained by performing a first-order Taylor expansion:
[0186]
[0187] The right side of the above inequality is denoted as .
[0188] Because of the introduction of auxiliary variables, the drone trajectory also needs to satisfy the following constraints:
[0189]
[0190] After introducing the auxiliary variable, problem P2.2.1 actually becomes an upper bound of problem P2.2. Problem P2.2.1 is shown below:
[0191]
[0192] st(1)-(9)
[0193] (17)
[0194] (18)
[0195] Will Recorded as .
[0196] At this point, constraints (4) and (8) are non-convex constraints, namely:
[0197]
[0198]
[0199] Constraint (4), rearranging terms yields The right side of the inequality, according to the composition rule, is a concave function. Therefore, this constraint defines a lower level set for concave functions. Furthermore, because... It must be greater than 0, so the lower level set of this concave function must be a non-convex set.
[0200] Looking at constraint (8) again, the left side of the inequality is the composition of an affine function and the L2 norm, followed by the composition of a power function. The composition of an affine function and the L2 norm is actually a simple composition-affine composition, resulting in a convex function. The composition of the power function in the non-negative quadrant also results in a convex function. After rearranging the terms, we can obtain:
[0201]
[0202] This is another lower level set of a concave function, and It must be greater than 0, so this set is also a non-convex set.
[0203] To handle constraint (4), new auxiliary variables can be introduced. The auxiliary variable satisfies the following conditions: and Auxiliary variables are introduced to better solve the original problem. However, it's crucial that the new constraints don't significantly impact the optimal solution. The new constraints are designed to limit the auxiliary variables, because if they continuously increase, the optimal solution can continuously take smaller values. Therefore, an upper bound constraint is added. This ensures that when the optimal solution is found, it must be a sum of the auxiliary variables and the optimal value. When they are equal, the upper bound of the auxiliary variable is constrained, and the square form is for easier processing later. It is a convex constraint, but a new non-convex constraint is introduced. Therefore, problem P2.2.1 becomes P2.2.2:
[0204]
[0205] st(1)-(2),(5)-(9),(17)-(18)
[0206] (19)
[0207] (20)
[0208] remember for The objective function of problem P2.2.2 is a convex function because the sum of convex functions is still a convex function. Now, let's deal with the newly introduced non-convex constraint (20), at any local point in the r-th iteration. ,right exist Using a first-order Taylor expansion, we can obtain:
[0209]
[0210] Define the right-hand side as This is In The global lower bound at that location. Thus, constraint (20) can be written as... This constraint is a convex constraint because the right side of the inequality is An affine function with a power function on the left can be rearranged to obtain the lower level set of a convex function, so it is a convex set.
[0211] Looking at constraint (8) again, it can be determined by... exist Performing a first-order Taylor expansion at this point yields its lower bound, resulting in:
[0212]
[0213] Therefore, constraint (8) can be rewritten as:
[0214]
[0215] This is a convex constraint.
[0216] After two constraint transformations, problem P2.2.2 becomes P2.2.3, as follows:
[0217]
[0218] st(1)-(2),(5)-(7),(9),(15),(17)-(19)
[0219] (twenty one)
[0220] (twenty two)
[0221] It can be seen that the objective function and constraints of problem (P2.2.3) are related to The path is convex, which indicates that problem (P2.2.3) is a convex problem. Therefore, the original problem (P2.2) can be solved using local trajectories. The iterative optimization problem (P2.2.3) is used to solve this problem.
[0222]
[0223] (3) Optimization of computing resource allocation
[0224] For a given terminal data transmission UAV trajectory Training sample number strategy The allocation of computational resources in the federated learning layer of the problem can be optimized by solving the following problem, denoted as P3.1:
[0225]
[0226] st
[0227] (12)
[0228] (13)
[0229] (14)
[0230] (15)
[0231] Problem P3.1 is a convex function, and the constraint function is an affine function, so it must be a convex set. It can be seen that problem P3.1 is a standard convex optimization problem, so the KKT conditions can be used to help solve it.
[0232] Note that the objective function and constraints in P3.1 are decoupled over the time interval. Therefore, P3.1 can be solved by solving the problem corresponding to each time slot separately. The sub-problem related to the nth time slot is:
[0233] (twenty three)
[0234] st
[0235] (23a)
[0236] (23b)
[0237] (23c)
[0238] (23d)
[0239] To solve the convex problem P3.1, the Lagrange method and the Karush-Kuhn-Tucker (KKT) conditions are used. Defined as the Lagrange multiplier of constraint (23c). Therefore, the Lagrange function of P3.1 is...
[0240]
[0241] Add a superscript * to the optimization variable to indicate its optimal value. Using the KKT conditions, let the function L be about... and The partial derivatives of are all zero. Therefore, we have
[0242] (twenty four)
[0243] (25)
[0244] From (24), we can conclude that According to the complementary relaxation condition, constraint (23c) becomes an equality constraint, so we can obtain:
[0245] (26)
[0246] Substituting (26) into (23) simplifies the optimization problem to P3.1.1:
[0247]
[0248] st
[0249] (23a),(23b),(23d)
[0250] As can be seen, problem P3.1.1 is a standard convex optimization problem, which can be solved using the CVX solver.
[0251] Training sample quantity strategy optimization
[0252] For a given terminal data transmission UAV trajectory and federated learning layer computational allocation and blockchain layer computation allocation The strategy for increasing the number of training samples can be optimized by solving the following problem, denoted as P3.2:
[0253]
[0254] st
[0255] (15)
[0256] Noting that problem P3.2 is decoupled in every global round, we can then derive a subproblem P3.2.1 that is decoupled in the r-th global round:
[0257]
[0258] st
[0259] (15)
[0260] in The objective function is clearly a convex function with respect to the number of training iterations in the nth time slot, and the constraint function is affine. Therefore, problem P3.2 is a standard convex optimization problem that can be solved efficiently using existing optimization tools such as CVX.
[0261] Based on the above decomposition and local convex approximation of the P1 problem, the block coordinate descent method can be used to optimize the solution of the problem. The specific iterative process is shown in Algorithm 1.
[0262] Algorithm 1 is a four-stage iterative optimization algorithm based on block coordinate descent and SCA techniques.
[0263] Initialize the current iteration count And set the maximum number of iterations. Iteration accuracy Given optimization variables , , , , and slack variables initial value
[0264] Start iteration
[0265] 1) Given the first The second iteration optimizes the initial values of the variables. , , , Based on subproblem P2.1, the optimized data size that the terminal should transmit in each time slot is obtained. .
[0266] 2) Given , , , The optimized terminal computing resource allocation is obtained based on subproblem P3.2.1.
[0267] 3) Given , , The optimized terminal computing resource allocation is obtained based on subproblem P3.1.1. ,
[0268] 4) Given , , , , The optimized trajectory is obtained based on subproblem P2.2. and slack variables
[0269] 6) , , , , Substituting these values into the objective function yields the optimal result.
[0270] 7) Update (Return to step 1)
[0271] 8) Objective function Convergence, convergence conditions or
[0272] The following are examples:
[0273] Reference Figure 2-3 This invention provides a blockchain-based multi-UAV assisted federated learning method as one embodiment. To verify the beneficial effects of this invention, scientific demonstration is conducted through economic benefit calculations and simulation experiments. The main simulation parameters are as follows: In this simulation, it is assumed that K=7 mobile terminals are randomly distributed in an area of 3 × 1 square kilometers, and M=2 UAVs are distributed within this area at a height of H = 50 m. The maximum transmit power of the mobile terminals is set to 0.3W, and the channel bandwidth is... Hz, noise power is -110 dBm. Maximum speed of the drone. Minimum speed of drone Maximum acceleration of drone Drone safety distance Time slot length Reference channel gain power Weighting factor The processing speed of block data in each time slot Chip energy efficiency Number of CPU cycles required to train one sample Effective switched capacitor . Figure 3 The convergence performance of the proposed algorithm was analyzed. In the figure, with T = 100 seconds, the legend shows... The parameters represent the magnitude of the model update information. It's worth noting that as the number of iterations increases, the objective function value gradually decreases, and the proposed algorithm eventually converges to a stable value. Furthermore, the objective function value of the proposed algorithm increases with the size of the sample data parameters. This is because as the sample data parameters increase, the number of time slots required for transmission also increases.
[0274] In another aspect, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method described above.
[0275] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the blockchain-based multi-drone assisted federated learning methods described in the above embodiments.
[0276] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above methods.
[0277] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0278] It should be noted that in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0279] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0280] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A blockchain-based multi-unmanned aerial vehicle (UAV) assisted federated learning method, characterized in that, Includes the following steps, Step 1: Establish a system model including M drones, K users, blockchain, and federated learning. Multiple drones equipped with MEC servers are deployed at the edge to provide federated learning services to the cloud. The cloud will send the initial model and initial sample data to the drones and deploy a blockchain system on the MEC server, enabling the drones to act as blockchain nodes to reach consensus on blocks and upload them to the chain. Step 2: Each UAV, acting as an airborne FL node, collects sample data from the terminal for federated learning model training, which generates terminal transmission energy consumption and model training energy consumption. While collecting terminal sample data, the UAV also moves along its trajectory to reduce the transmission energy consumption of communication between the terminal and the UAV, which generates UAV propulsion energy consumption. Step 3: Each UAV acts as an aerial blockchain node, processing the generated model update information into transaction information and sending it to other UAVs, and selecting a block-producing UAV. The block-producing UAV will propagate the block, which is packaged from the model update information, to the non-block-producing UAVs. The non-block-producing UAVs verify the block, and after successful verification, send a response and add the block to the blockchain. This will generate the verification energy consumption of the non-block-producing UAVs and the block-producing energy consumption and block propagation energy consumption of the block-producing UAVs in the blockchain model. Step 4: Each UAV acts as an airborne FL node, performing global aggregation using the model update information stored in the block, and generating a new global model as the initial model for the next round of training. Step 5: Based on the energy consumption of the UE layer and UAV-MEC layer, construct a joint optimization problem of transmission strategy, model training strategy, computing resource allocation, and trajectory optimization, and solve the optimization problem to obtain the optimal solution that minimizes system energy consumption; Each UAV, acting as an airborne FL node, collects sample data from the terminals to train the federated learning model. This includes first discretizing the UAV's flight period T, dividing it into N time slots, with the length of each time slot denoted as . The size of the sample data transmitted by ground terminal k to UAV m in the nth time slot is denoted as . The correlation variable between the two is denoted as The range of values is A value of 1 indicates a connection between the two parties, while a value of 0 indicates otherwise; the channel power gain of terminal k and drone m in the nth time slot is... , It is the distance from terminal k in the nth time slot to drone m. Indicates reference distance The channel gain when = 1; the transmission rate of terminal k and UAV m in the nth time slot is expressed as: denotes the channel bandwidth between terminal k and drone m, is the transmit power of terminal k, is the noise power; since the objective is to minimize the energy consumption, the constraint needs to be satisfied: denotes that the amount of data transmitted must be greater than or equal to the total amount of sample data, and the transmission delay between terminal k and drone m is: The transmission energy consumption of terminal k in the nth time slot is expressed as: The re-discretization of FL is based on the formulas for the number of local training iterations and the number of global rounds: , , Let the number of time slots of each global round be denoted as ; the starting time slot index of the rth global round be denoted as , , the FL training task of the UAV as an aerial FL node is denoted as , where is the number of samples for model training by the UAV in the nth time slot, is the number of CPU cycles required to train one sample, assuming that the bit number of each sample is , so there is ; The number of times that the UAV m is trained in the nth time slot is denoted as The computing resources allocated to federated learning by the UAV m in the nth time slot are denoted as Therefore, the training latency of FL is Training energy consumption is: The local training number satisfies: . 2.The blockchain-based multi-UAV federated learning method of claim 1, wherein: Step 3 involves optimizing the allocation of computing resources at the blockchain layer and the drone's trajectory. The drone's trajectory affects the propagation latency of blocks in the blockchain, thus impacting system energy consumption. This energy consumption is optimized by balancing the allocation of computing resources at the blockchain layer and the FL layer. This is a block-producing flag; a value of 1 indicates that the drone has been selected as a block-producing drone, while a value of 0 indicates that it has not. It is also recorded... The size of the transaction information in the nth time slot. It is the number of CPU cycles required to process each bit of transaction information. The block generation latency is due to the computing resources allocated to the blockchain layer by the drone in the nth time slot. Block generation energy consumption: There is also the energy consumption of block propagation for block generation UAVs, and the block propagation time , where is the block size of the nth time slot, is the transmission rate between UAVs, so the energy consumption of block propagation is For non-block generation UAVs, the verification of the block needs to be completed, and the verification time is , and the verification energy consumption is ; therefore, the total energy consumption of the blockchain task is: ; Since both the system runtime T and the FL process are discretized, the following constraint needs to be satisfied: That is, the sum of the UAV training time, the block time, the verification time, and the block propagation time in one time slot cannot exceed the length of one time slot, wherein: , . 3.The blockchain-based multi-UAV federated learning method of claim 2, wherein: Step 5 includes first dividing the joint optimization problem into two sub-problems: a sub-problem P2 of optimizing the trajectory and transmission strategy, and a sub-problem P3 of optimizing computational resources and model training strategy. For subproblem P2, first optimize the terminal transmission strategy given the optimized computing resources, model training strategy, and trajectory. Then, based on this optimized value, use the SCA continuous convex approximation algorithm to optimize the UAV trajectory. Next, solve subproblem P3. Based on the trajectory and transmission strategy optimization values obtained from solving P2, and given the model training strategy, solve the computing resource allocation using the KKT conditions. Then, use the trajectory, transmission strategy, and computing resource allocation optimization values to solve the model training strategy. Iterate and update the terminal transmission strategy, UAV trajectory, computing resource allocation, and model training strategy until they converge, and obtain the minimum energy consumption of the system. 4.The blockchain-based multi-UAV federated learning method of claim 3, wherein: The total energy consumption for completing the data collection task, FL task, and blockchain task processing is expressed as: wherein is a mapping factor that ensures the propulsion energy consumption of the UAV is at the same level as the other parts of the energy consumption, and then constructs an optimization problem that minimizes the energy consumption of the entire system as an objective, and the optimization problem is specifically expressed as: ST (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) is a terminal data transmission variable, is a drone trajectory, is a computing resource variable of a federated learning layer, is a computing resource variable of a blockchain layer, is a model training strategy of a drone, i.e., a number of model training times selected by the drone in the nth time slot; Constraints (1)-(5) are constraints related to the speed and acceleration of the UAV; where is the speed of the UAV m at the n-th time slot; is the acceleration of the UAV m at the n-th time slot; is the gravitational acceleration; and are parameters related to the UAV, is the maximum acceleration, is the maximum speed; Constraints (6) and (7) correspond to the initial / final position constraints and initial / final velocity constraints of the UAV, respectively; constraints (8)-(9) are the trajectory constraints of the UAV. This represents the minimum safe distance between drones to avoid collisions; constraint (10) ensures that the data transmitted by the terminal should not be less than the sample data size. The constraint (11) indicates the sample data size; constraint (12) indicates that the amount of data transmitted by each time slot terminal will not exceed the maximum transmission capacity of each time slot; constraints (13) ensure that the allocated computing resources are not negative; constraint (14) is the maximum computing resource constraint, where Represents the maximum computing resources; constraint (15) means that the sum of the UAV training time, block generation time, verification time and block propagation time in a time slot cannot exceed the length of a time slot; constraint (16) means that the sum of the number of training times in each time slot in a round should not be less than the number of local training times. 5.The blockchain-based multi-UAV federated learning method of claim 1, wherein: Due to the non-convexity of the objective function and the non-convexity of the constraint conditions, the optimization problem in step S5 is a non-convex optimization problem, which is solved by solving the terminal data transmission strategy , the UAV trajectory , the computing resources of the federated learning layer , the computing resources of the blockchain layer , the model training strategy to minimize the total energy consumption of the system, the entire problem is decomposed into two large sub-optimization problems, which are then decomposed into smaller sub-problems and solved by using the UAV trajectory optimization algorithm based on the block coordinate descent (BCD) algorithm and the successive convex approximation (SCA) algorithm to alternately optimize, and finally the approximate optimal solution of the problem is solved.
6. A computer readable storage medium storing a computer program, characterized in that, The computer program, which when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 5. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The computer program, which when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and device and computer readable storage medium
CN115348022A
Distributed co-evolution method, UAV (Unmanned Aerial Vehicle) and intelligent routing method and device thereof
CN115412992A
Federal learning resource allocation method assisted by unmanned aerial vehicle
CN116321389A
Task processing method and device, computer equipment, storage medium and program product
CN116560828A
Air-space-ground network optimization method and system based on block chain and edge intelligence
CN118870431A