Multi-unmanned aerial vehicle assisted federal learning method and device based on block chain, and medium

By optimizing drone transmission strategies, computing resource allocation, and trajectory optimization, the problem of high energy consumption of drones in blockchain-assisted federated learning was solved, resulting in reduced system energy consumption and improved execution efficiency.

CN120409739AActive Publication Date: 2025-08-01NANJING UNIV OF POSTS & TELECOMM

Patent Information

Application Number
CN202510577155.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-01
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

Drones in blockchain-assisted federated learning scenarios have high energy consumption and insufficient trajectory research, leading to increased system operational pressure.

Method used

A multi-UAV-assisted federated learning system is constructed. By optimizing the transmission strategy, model training strategy, computing resource allocation, and trajectory optimization, a joint optimization problem is formed. Block coordinate descent and continuous convex approximation algorithms are used to solve the problem to reduce system energy consumption.

Benefits of technology

It reduces the energy consumption of drones in federated learning and blockchain tasks, improves system utility, optimizes drone trajectories to reduce terminal transmission latency and energy consumption, and enhances execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409739A_ABST
    Figure CN120409739A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-unmanned aerial vehicle assisted federated learning method and device based on a block chain, and a medium. According to the method, an unmanned aerial vehicle assisted federated learning framework under the block chain is constructed. In an unmanned aerial vehicle assisted federated learning system under a block chain, a plurality of unmanned aerial vehicles equipped with MEC servers are deployed at the edge to provide federated learning service for a cloud. The unmanned aerial vehicle collects sample data of the terminal to perform model training of federal learning, sends generated model update information to other unmanned aerial vehicles, and then executes global aggregation. And meanwhile, a block chain system is deployed on the MEC servers, and the unmanned aerial vehicle serves as a block chain node to consensus and link the block formed by packaging the model update information, so that data tampering is prevented, and the system robustness is improved. According to the method, a better model training and resource allocation strategy in a multi-unmanned aerial vehicle mobile assisted federal learning scene under the block chain is realized, so that the total energy consumption of the system is reduced, and the effectiveness of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UAV communication, and in particular to a multi-UAV assisted federated learning method, device and storage medium based on blockchain. Background Art

[0002] Federated Learning is an innovative distributed machine learning paradigm aimed at resolving the contradiction between data privacy and collaborative learning. Its core concept is that multiple participants can collaboratively optimize the global model by locally training models and securely exchanging model parameters without sharing the original data. This approach not only avoids the risk of sensitive data leakage but also breaks data silos, leveraging the diversity of decentralized data to enhance the generalization ability of the model. The core 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 the smart terminal scenario, mobile phone input methods update models through local data, avoiding uploading user input content to the cloud; in industrial Internet of Things, edge devices jointly optimize device fault detection models, reducing dependence on the central server. The key technologies include federated averaging algorithm, differential privacy, heterogeneous data alignment, and asynchronous training mechanism. 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 facing challenges such as communication efficiency and heterogeneous data fusion, its application potential in fields such as smart cities, smart healthcare, and fintech is huge, becoming a forefront direction for the cross-integration of artificial intelligence and data security.

[0004] In recent years, however, 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 the 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, resulting in malicious tampering of the global model. Therefore, in recent years, some people have started to introduce blockchain technology into it. Blocks in blockchain need to be verified by most nodes before they can be added to the chain, and after being added to the chain, hash encryption technology ensures that the content of each block cannot be tampered with, which ensures the authenticity and verifiability of the model.

[0005] However, with the continuous increase in terminal and service demands, UAVs, as energy-constrained devices, are under increasing pressure to operate in the scenario of assisting federated learning.

[0006] At present, there are some deficiencies in the research on blockchain-based UAV-assisted federated learning. First, there is a lack of research on the energy consumption of resource allocation in blockchain-based UAV-assisted federated learning. Since the energy of UAVs themselves and terminals is limited, it is very necessary to study the overall energy consumption of the system. Second, there is insufficient research on the UAV trajectory in the federated learning scenario. UAVs can collect terminal data during flight, which improves the scope and efficiency of federated learning data collection and reduces the usage cost at the same time. Summary of the Invention

[0007] A multi-UAV-assisted federated learning method, device, and medium based on blockchain proposed by the present invention have some deficiencies in the research on blockchain-based UAV-assisted federated learning. There is a lack of research on the energy consumption of resource allocation in the flight scenario of UAVs assisting federated learning under blockchain. Since the energy of UAVs themselves and terminals is limited, it is very necessary to study the overall energy consumption of the system. There is a lack of research on the training strategy for UAVs to perform federated learning.

[0008] To solve the above technical problems, the present invention provides the following technical solutions: A multi-UAV-assisted federated learning method based on blockchain, characterized by including the following steps: Step 1: Establish a system model including M UAVs, K users, blockchain, and federated learning. Multiple UAVs equipped with MEC servers are deployed at the edge to provide federated learning services for the cloud. The cloud will send the initial model and initial sample data to the UAVs, and deploy the blockchain system on the MEC server, enabling the UAVs to act as blockchain nodes to conduct consensus on the blocks and upload them to the chain; Step 2: Each UAV, as an aerial FL node, will collect the sample data of the terminals to perform model training for federated learning, which will generate the transmission energy consumption of the terminals and the model training energy consumption; while collecting the sample data of the terminals, the UAV will move its trajectory to reduce the transmission energy consumption of the communication between the terminals and the UAVs, which will generate the propulsion energy consumption of the UAVs; Step 3: Each UAV, as an aerial blockchain node, will process the generated model update information into transaction information and send it to other UAVs, and select the block-producing UAV; the block-producing UAV will broadcast the block formed by the model update information to the non-block-producing UAVs. The non-block-producing UAVs will verify the block. After successful verification, they will send a response and upload the block to the chain; this will generate the verification energy consumption of the non-block-producing UAVs, the block-producing energy consumption of the block-producing UAV, and the block propagation energy consumption in the blockchain model; Step 4: Each UAV, as an aerial FL node, will perform global aggregation through the model update information stored in the block and generate a new global model as the initial model for the next round of training; Step 5: Construct a joint optimization problem for transmission strategy, model training strategy, computing resource allocation, and trajectory optimization based on the energy consumption of the UE layer and the UAV-MEC layer, and solve the optimization problem to obtain the optimal solution that minimizes the system energy consumption.

[0009] Furthermore, each UAV in the present invention, as an aerial FL node, collects sample data of terminals for model training of federated learning, which generates transmission energy consumption and model training energy consumption of the terminals. By optimizing the transmission strategy to reduce the transmission energy consumption and optimizing the number of model training times of the UAV in each time slot, the delay of FL training by the UAV in each time slot is minimized to reduce the energy consumption of FL training. First, discretize the flight cycle T of the UAV, divide it into N time slots, and denote the length of each time slot as , and denote the size of the sample data transmitted from the ground terminal k to the UAV m in the nth time slot as , and denote the association variable between the two as , and its value range is , and when it is 1, it means the two are associated, and vice versa when it is 0. The channel power gain between the terminal k and the UAV m at the nth time slot is , is the distance from the terminal k to the UAV m at the nth time slot, represents the reference distance = 1. The transmission rate between the terminal k and the UAV m at the nth time slot can be expressed as:

[0010] represents the channel bandwidth between the terminal k and the UAV m, is the transmission power of the terminal k, is the noise power. Since the goal is to minimize the energy consumption, the constraint needs to be satisfied: , indicating that the amount of transmitted data must be greater than or equal to the total sample data volume. The transmission delay between the terminal k and the UAV m is:

[0011] The transmission energy consumption of the terminal k at the nth time slot can be expressed as:

[0012] Then, discretize the FL process. According to the local training times formula and the global round formula: , , The number of time slots for each global round can be denoted as . Denote the start time slot index of the rth global round as , As an aerial FL node, the UAV records the FL training task as , where is the number of samples for the UAV to perform model training in the nth time slot, is the number of CPU cycles required to train one sample. Assuming the number of bits of each sample is , so there is .

[0013] The number of times the UAV m trains in the nth time slot is recorded as , and the computing resources allocated by the UAV m to federated learning in the nth time slot are recorded as , so the training delay of FL is:

[0014] The training energy consumption is:

[0015] The number of local training times should satisfy: .

[0016] Furthermore, each UAV described in the present invention, as an aerial blockchain node, sends the generated model update information to other UAVs and selects a block-producing UAV. The block-producing UAV will broadcast the block formed by the model update information to non-block-producing UAVs. The non-block-producing UAVs verify the block. After successful verification, they send a response and chain the block. Define as the block-producing flag. If it is 1, it means being selected as the block-producing UAV; if it is 0, it is not. At the same time, record as the size of the transaction information in the nth time slot, is the number of CPU cycles required to process each bit of transaction information, is the computing resources allocated by the UAV to the blockchain layer in the nth time slot. So the block-producing delay:

[0017] The block-producing energy consumption: . For the block-producing UAV, there is also the energy consumption of broadcasting the block. The time for broadcasting the block is , where is the block size in the nth time slot, is the transmission rate between UAVs. So the energy consumption of broadcasting the block is . For non-block-producing UAVs to complete the verification of the block, the verification time is , and the verification energy consumption: . So the total energy consumption of the blockchain task is:

[0018] Since both the system running time T and the FL process are discretized for consideration, the following constraint needs to be satisfied:

[0019] That is, in one time slot, the sum of the UAV training time, block generation time, verification time, and block propagation time cannot exceed the length of one time slot. Among them: ,

[0020] Furthermore, step 5 of the present invention constructs a joint optimization problem of transmission strategy, model training strategy, computing resource allocation, and trajectory optimization according to the energy consumption of the UE layer and the UAV-MEC layer, so as to minimize the system energy consumption. The solution steps are as follows: First, the joint optimization problem is divided into two sub-problems, namely sub-problem P1.1 for optimizing the trajectory and transmission strategy, and sub-problem P1.2 for optimizing the computing resource and model training strategy. For sub-problem P1.1, first optimize the terminal transmission strategy for the given optimized computing resource, model training strategy, and trajectory, and then according to this optimized value, use the SCA successive convex approximation algorithm to optimize the UAV trajectory. Then solve sub-problem P1.2. According to the trajectory and transmission strategy optimized values obtained by solving P1.1, and given the model training strategy, solve the computing resource allocation through the KKT conditions, and then use the trajectory, transmission strategy, and computing resource allocation optimized values to solve the model training strategy. Through the block coordinate descent method, iterate and update until the terminal transmission strategy, UAV trajectory, computing resource allocation, and model training strategy converge, and obtain the minimum energy consumption of the system.

[0021] Furthermore, the method of the present invention includes: The total energy consumption for completing data collection tasks, FL tasks, and blockchain task processing can be expressed as:

[0022] Where is a mapping factor to ensure that the other parts of the UAV propulsion energy consumption have the same level. Then, according to the multi-UAV assisted federated learning method based on blockchain described in the above claims, it is characterized in that an optimization problem with the goal of minimizing the energy consumption of the entire system is constructed. The optimization problem can be specifically expressed as:

[0023] S.T. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) is the terminal data transmission variable, is the UAV trajectory, is the computing resource variable of the federated learning layer, is the computing resource variable of the blockchain layer, is the model training strategy of the UAV, i.e., the number of model training times selected by the UAV at the nth time slot.

[0024] Constraints (1)-(5) are the constraints related to the speed and acceleration of the UAV; among them is the speed of UAV m at the nth time slot; is the acceleration of UAV m at the nth time slot; is the gravitational acceleration; and are the UAV-related parameters. is the maximum acceleration, is the maximum speed.

[0025] 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 UAV trajectory constraints, represents the minimum safety distance to avoid collision between UAVs; Constraint (10) is to ensure that the data transmitted by the terminal should not be less than the sample data size, represents the sample data size; Constraint (11) means that the amount of data transmitted by the terminal in each time slot will not be greater than its maximum transmission capacity in each time slot; Constraints (12)-(13) are to ensure that the allocated computing resources are not negative; Constraint (14) is the maximum computing resource constraint, among which represents the maximum computing resource; Constraint (15) represents 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) indicates that the total number of training times in each time slot in a round should be no less than the number of local training times.

[0026] Further, the method described in the present invention includes: Because of the non-convexity of the objective function and the non-convexity of the constraint conditions, the optimization problem is a non-convex optimization problem. By solving the terminal data transmission strategy , the UAV flight trajectory , the computing resources allocated to the federated learning layer , the computing resources allocated to the blockchain layer , the model training strategy to minimize the total system energy consumption, the entire problem is decomposed into 2 large sub-optimization problems and then further decomposed into smaller sub-problems, and an alternating optimization solution is performed using a UAV trajectory optimization algorithm based on the block coordinate descent (BCD) algorithm and successive convex approximation (SCA) to finally obtain an approximate optimal solution to the problem.

[0027] On the other hand, the present invention also discloses a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is caused to execute the steps of the above method.

[0028] On yet another aspect, the present invention also discloses a computer device including a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute the steps of the above method.

[0029] As can be seen from the above technical solutions, the multi-UAV assisted federated learning method based on blockchain of the present invention constructs a UAV-assisted federated learning framework under blockchain. In the UAV-assisted federated learning system under blockchain, multiple UAVs equipped with MEC servers are deployed at the edge to provide federated learning services for the cloud. The UAVs will collect sample data from terminals for model training of federated learning, and send the generated model update information to other UAVs, and then perform global aggregation. At the same time, a blockchain system is deployed on these MEC servers. The UAVs, as blockchain nodes, conduct consensus on the blocks formed by the model update information and upload them to the chain, thereby preventing data tampering and improving the system robustness. The present invention realizes a better model training and resource allocation strategy in the multi-UAV mobile assisted federated learning scenario under blockchain, thereby reducing the total system energy consumption and improving the system utility.

[0030] The present invention proposes a blockchain-based unmanned aerial vehicle (UAV)-assisted federated learning system model and studies the energy consumption of the system under UAV-assisted federated learning with blockchain. It not only reduces the energy consumption of the terminal by optimizing the data transmission strategy of the terminal, but also further optimizes the flight trajectory of the UAV to reduce the energy consumed during UAV propulsion. Compared with the system without optimized UAV trajectory, in the system constructed by this method, the UAV can autonomously approach the terminal along the optimal trajectory, shorten the distance to the terminal, improve the communication capacity, and enable remote terminals to easily upload data, thereby reducing the transmission delay and energy consumption of the terminal. The present invention also considers the situation where the UAV serves as both a blockchain node and a task executor of federated learning, and reduces the energy consumed when the UAV executes tasks by optimizing the computing resource allocation strategy consumed by the task execution in the blockchain layer and the federated learning layer, enabling the UAV to adopt the optimal computing resource allocation strategy to improve the execution efficiency and reduce the delay. The present invention considers how the UAV adjusts its sample training strategy in each time slot when performing federated learning training tasks during flight, thereby affecting the computing resource allocation strategies in the federated learning layer and the blockchain layer and reducing the energy consumption. The present invention analyzes the entire system and models it, proposes a multi-variable non-convex optimization problem to minimize the system energy consumption, and uses an algorithm combining the block descent coordinate and successive convex approximation methods to solve the optimization problem, thereby obtaining the optimal strategies that the UAV and the terminal should execute in each time slot. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 FIG. is a flowchart of a blockchain-based multi-UAV-assisted federated learning method provided by an embodiment of the present invention; Figure 2 FIG. is a flowchart of the operation of the blockchain of a blockchain-based multi-UAV-assisted federated learning method provided by the first embodiment of the present invention; Figure 3 FIG. is a system model diagram of a blockchain-based multi-UAV-assisted federated learning method provided by the second embodiment of the present invention; Figure 4 FIG. is a comparative experimental simulation diagram of the change of the objective function value with the number of iterations under different parameters of a blockchain-based multi-UAV-assisted federated learning method provided by the second embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention.

[0033] Refer to Figure 1, as an embodiment of the present invention, provides a multi-UAV-assisted federated learning method based on blockchain, including: S1: Construct a system model of multi-UAV-assisted federated learning under blockchain.

[0034] The system model of multi-UAV-assisted federated learning based on blockchain is as Figure 2 shown. Considering a set of terminals, the set of UAVs as blockchain nodes is denoted as , with the number being . The coordinate of terminal is . In addition, a small MEC server is deployed on each UAV, so the UAV can serve as both a blockchain node and an edge node for federated learning. The UAV can execute the consensus process of the blockchain and also perform related tasks of federated learning.

[0035] The entire model can be divided into three layers, namely the cloud layer, the UAV layer, and the terminal layer. The working process of the model is as follows: (1) The terminal transmits sample data to the UAV; (2) The UAV conducts federated learning training and generates model update information; (3) Each UAV, as a blockchain node, sends the model update information to other UAVs; (4) Use the consensus mechanism to select the block-producing UAV; (5) The block-producing UAV broadcasts the block to the non-block-producing UAVs; (6) The non-block-producing UAVs verify the block; (7) After the verification is completed, the UAVs put the block on the chain and aggregate the global model.

[0036] S2: Construct a communication model based on wireless communication theory and analyze the energy consumption of terminal transmission.

[0037] The coordinate of the m-th UAV is , where is a constant. Divide the continuous time into time slots, and the time slot . In this way, the position of the m-th UAV in the n-th time slot is , and the UAV trajectory is .

[0038] For convenience, the communication link between the UAV and the terminal device is considered as a line-of-sight (LoS) transmission, which means that the channel quality is only related to the distance between the UAV and the terminal device. In addition, it is assumed that the Doppler effect caused by the UAV's mobility can be effectively compensated at the receiving end. Therefore, the channel power gain between terminal k and UAV m at the nth time slot follows the free space path loss model as follows:

[0039] is the distance from terminal k to UAV m at the nth time slot, represents the reference distance is the channel gain when = 1. Further, it is assumed that the UAV uses frequency division multiple access to share the spectrum resources, and multiple terminals associated with the same UAV use orthogonal resource blocks for data transmission. Therefore, the transmission rate between terminal k and UAV m at the nth time slot can be expressed as:

[0040] represents the channel bandwidth between terminal k and UAV m, is the transmit power of terminal k, is the noise power. The transmission rate between terminal k and UAV m at the nth time slot can be expressed as:

[0041] represents the channel bandwidth between terminal k and UAV m, is the transmit power of terminal k, is the noise power. Since the goal is to minimize the energy consumption, the constraint needs to be satisfied: , indicating that the amount of data transmitted must be greater than or equal to the total sample data volume. The transmission delay between terminal k and UAV m is:

[0042] The transmission energy consumption of terminal k at the nth time slot can be expressed as:

[0043] S3: Discretize the FL process according to the local training times formula and the global round formula, and analyze the FL training energy consumption Local training times:<s

[0044] Global round formula: <x

[0045] The number of time slots for each global round can be denoted as 。The start slot index of the r-th global round is denoted as , , and the FL training task is denoted as by the UAV as an aerial FL node, where is the number of samples for model training by the UAV in the n-th slot, is the number of CPU cycles required to train one sample. Assuming the number of bits per sample is , so there is .

[0046] The number of training times of UAV m in the n-th slot is denoted as , and the computing resource allocated to federated learning by UAV m in the n-th slot is denoted as , so the training delay of FL is:

[0047] The training energy consumption is:

[0048] The number of local training times should satisfy: .

[0049] S4: Establish a blockchain model based on the UAV-supported MEC network (1) Block generation Define as the block generation flag. If it is 1, it means the UAV is selected as the block-generating UAV; if it is 0, it is not. At the same time, denote as the size of the transaction information in the n-th slot, is the number of CPU cycles required to process each bit of transaction information, is the computing resource allocated by the UAV to the blockchain layer in the n-th slot. So the block generation delay:

[0050] The block generation energy consumption: .

[0051] (2) Consensus process Before adding the newly generated block to the blockchain, it is necessary to complete the verification of the block to achieve the consensus of the entire blockchain. The consensus process includes transaction propagation, block propagation, and block verification. In fact, the impact of transaction propagation on system energy consumption is relatively small, so it is ignored. Next, the block propagation and block verification processes are modeled.

[0052] For the block-generating UAV, there is also the energy consumption of propagating the block. The time for propagating the block: , where is the block size in the n-th slot, is the transmission rate between UAVs, so the energy consumption of the propagation block is .

[0053] For non-block-producing UAVs to complete the verification of the block, the verification time is , Verification energy consumption: .

[0054] So the total energy consumption of the blockchain task is:

[0055] Since the system operation time T and the FL process are both discretely considered, the following constraint needs to be satisfied:

[0056] That is, the sum of the UAV training time, block production time, verification time, and block propagation time in a time slot cannot exceed the length of a time slot. Among them: ,

[0057] S5: Construct a UAV model based on UAV parameters.

[0058] The energy consumption for completing the computing task and processing the blockchain task should include the propulsion energy consumption generated by the UAV's movement. The propulsion energy consumption of the UAV plays an important role in the total energy consumption of the system. The propulsion energy consumption of UAV m in the nth time slot can be expressed as:

[0059] The speed of UAV m in the nth time slot: , the acceleration of UAV m in the nth time slot: , gravitational acceleration: , UAV-related parameters: and

[0060] The speed and acceleration satisfy the following constraints:

[0061]

[0062]

[0063]

[0064]

[0065] is the maximum acceleration, is the maximum speed.

[0066] S6: Pose a non-convex joint optimization problem.

[0067] Mathematically, the formulated problem can be expressed as: Problem P1:

[0068] S.T. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) is the terminal data transmission variable, is the UAV trajectory, is the computing resource variable of the federated learning layer, is the computing resource variable of the blockchain layer, is the model training strategy of the UAV, i.e., the number of model training times selected by the UAV in the nth time slot.

[0069] Constraints (1)-(5) are constraints related to the speed and acceleration of the UAV; where is the speed of UAV m in the nth time slot; is the acceleration of UAV m in the nth time slot; is the gravitational acceleration; and are UAV-related parameters. is the maximum acceleration, is the maximum speed.

[0070] Constraints (6)-(7) correspond to the initial / final position constraints and initial / final velocity constraints of the UAV, respectively; constraints (8)-(9) are the UAV trajectory constraints, denotes the minimum safety distance to avoid collisions between UAVs; constraint (10) ensures that the data transmitted at the terminal should not be less than the sample data size, denotes the sample data size; constraint (11) means that the amount of data transmitted by the terminal in each time slot will not be greater than its maximum transmission capacity in each time slot; constraints (12)-(13) ensure that the allocated computing resources are not negative; constraint (14) is the maximum computing resource constraint, where represents the maximum computing resource; constraint (15) represents 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 total number of training times in each time slot in one round should not be less than the local training times.

[0071] S7: An optimization algorithm combining a block coordinate descent method and a successive convex approximation algorithm is adopted, and multiple slack variables are introduced to decouple the non-convex optimization problem into multiple sub-convex optimization problems, and the optimal solution is obtained by iterative optimization.

[0072] Since the objective function of problem P1 is non-convex, this problem is non-convex and difficult to be directly solved by traditional convex optimization techniques. The present invention decomposes the objective problem into multiple sub-problems for solution and adopts an algorithm combining successive convex approximation and block coordinate descent method to solve problem P1. First, P1 is decomposed into two sub-problems, namely P2 and P3. First, for the given computing resource allocation and model training strategy, by solving problem (P2), the UAV trajectory and terminal transmission strategy can be obtained. Secondly, using the optimized UAV trajectory and terminal transmission strategy, problem (P3) can be solved to obtain the computing resource allocation and model training strategy.

[0073] P2:

[0074] S.T. (1)-(11),(15) P3:

[0075] S.T. (12)-(16)(1) Optimization of terminal data transmission volume For any given UAV trajectory, training strategy, and computing allocation , the data transmission at the terminal can be optimized by solving the following problem, which is denoted as P2.1:

[0076] s.t. (10) (11) (15) The objective function of problem P2.1 is an affine function, and an affine function is a convex function. The two constraint functions are three inequality constraints, and their constraint functions are obviously convex functions. Therefore, problem P2.1 is a standard LP and can be effectively solved by existing optimization tools (such as CVX).

[0077] (2) UAV trajectory optimization For any given terminal data transmission strategy, sample training strategy, and computing resource allocation , the UAV trajectory can be optimized by solving problem P2.2:

[0078] s.t. (1)-(9), (11) The objective function of this problem is not a convex problem because 1 / For is a non-convex term. An auxiliary variable = [[ID=�¬]] this whole can be replaced with Assume the value of the r-th iteration of is

[0079]

[0080]

[0081] Performing a first-order Taylor expansion on 1 / can obtain its upper bound:

[0082] The right side of the above inequality is denoted as .

[0083] To handle the constraint (11) on performing a first-order Taylor expansion can obtain its lower bound:

[0084] The right side of the above inequality is denoted as .

[0085] Due to the introduction of auxiliary variables, the UAV trajectory also needs to satisfy the following constraints:

[0086] After introducing the auxiliary variables, Problem P2.2.1 is actually an upper bound of Problem P2.2. Problem P2.2.1 is as follows:

[0087] s.t. (1)-(9) (17) (18) Let be denoted as .

[0088] At this time, Constraint (4) and Constraint (8) are non-convex constraints, which are respectively:

[0089]

[0090] For Constraint (4), by transposing terms, we can get . It can be known from the composite rule that the right side of the inequality is a concave function. Therefore, this constraint defines a lower level set of a concave function. Also, since must be greater than 0, the lower level set of this concave function must be a non-convex set.

[0091] Looking at Constraint (8) again, the left side of the inequality is the composition of an affine function and an L2 norm, and then the composition with a power function. The composition of the affine function and the 2-norm is actually a simple composite affine composition, and the result is a convex function. And the composition with the power function in the non-negative quadrant is still a convex function. After transposing terms, we can get:

[0092] This is again a lower level set of a concave function, and must be greater than 0, so this set is also a non-convex set.

[0093] To handle Constraint (4), new auxiliary variables can be introduced. These auxiliary variables satisfy the following conditions: and . The introduction of auxiliary variables is to better solve the original problem. However, it should be noted that the newly introduced constraints should not have a great impact on the optimal solution of the original problem. Therefore, the newly introduced constraints here are to limit the auxiliary variables. Because if the auxiliary variables keep increasing, the optimal solution can keep taking smaller values. So, an upper bound constraint is added. In this way, when looking for the optimal solution of the problem, it must be the case that the auxiliary variables and When they are equal, since the upper bound of the auxiliary variable is constrained and the square form is for more convenient subsequent processing, at this time it is a convex constraint, but a new non-convex constraint is introduced , so problem P2.2.1 becomes P2.2.2:

[0094] s.t.(1)-(2),(5)-(9),(17)-(18) (19) (20) Denote as , the objective function of problem P2.2.2 is a convex function because the sum of convex functions is still a convex function. At this time, to deal with the newly introduced non-convex constraint (20), at any local point in the r-th iteration, for at using the first-order Taylor expansion, we can get:

[0095] Define the right-side expression as , which is the global lower bound of at . In this way, constraint (20) can be written as , and this constraint is a convex constraint because the right side of the inequality is an affine function of

[0096] Looking at constraint (8) again, we can obtain its lower bound by performing the first-order Taylor expansion of at , and the result is:

[0097] So constraint (8) can be rewritten as:

[0098] This is a convex constraint.

[0099] After two constraint conversions, problem P2.2.2 becomes P2.2.3, as follows:

[0100] s.t.(1)-(2),(5)-(7),(9),(15),(17)-(19) (21) (22) It can be seen that the objective function and constraints of problem (P2.2.3) are convex, which indicates that problem (P2.2.3) is a convex problem. Therefore, the original problem (P2.2) can be solved by using the iterative optimization problem (P2.2.3) of the local trajectory .

[0101]

[0102] (3) Optimization of computing resource allocation For the given terminal data transmission , UAV trajectory , and training sample number strategy , the computing resource allocation of the federated learning layer of the problem can be optimized by solving the following problem, which is denoted as P3.1:

[0103] s.t. (12) (13) (14) (15) 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. Therefore, the KKT conditions can be used to help solve it.

[0104] Note that the objective function and constraints of P3.1 are decoupled within the time period. Therefore, P3.1 can be solved by separately solving the problems corresponding to each time slot. The sub-problem related to the nth time slot is: (23) s.t. (23a) (23b) (23c) (23d) To solve the convex problem P3.1, the Lagrangian method and the Karush-Kuhn-Tucker (KKT) conditions are used. Let Define as the Lagrange multiplier of the constraint (23c). Therefore, the Lagrangian function of P3.1 is

[0105] Add an asterisk superscript to the optimization variable to represent the optimal value of the variable. Using the KKT conditions, let the partial derivatives of the function L with respect to and be zero respectively. Therefore, we have (24) (25) From (24), we can obtain . According to the complementary slackness condition, the constraint (23c) becomes an equality constraint, so we can get: (26) Substituting (26) into (23) can simplify the optimization problem to P3.1.1:

[0106] s.t. (23a), (23b), (23d) It can be seen that the problem P3.1.1 is a standard convex optimization problem and can be solved using a CVX solver.

[0107] Training sample number strategy optimization For a given terminal data transmission , UAV trajectory and the calculation allocation of the federated learning layer as well as the calculation allocation of the blockchain layer , the training sample number strategy of the problem can be optimized by solving the following problem, which is denoted as P3.2:

[0108] s.t. (15) Note that the problem P3.2 is decoupled in each global round. Then, a sub-problem P3.2.1 can be obtained that is decoupled in the r-th global round:

[0109] s.t. (15) where , the objective function is clearly a convex function with respect to the number of training times in the n-th time slot, and the constraint function is affine. Therefore, problem P3.2 is a standard convex optimization problem and can be effectively solved by existing optimization tools (such as CVX).

[0110] Based on the above decomposition and local convex approximation processing of problem P1, the block coordinate descent method can be used to optimize and solve the problem. The specific iterative process is shown in Algorithm 1.

[0111] Algorithm 1 Four-stage iterative optimization algorithm based on block coordinate descent and SCA technology Initialize the current iteration number , and set the maximum number of iterations , the iteration accuracy , given the optimization variables 、 、 、 、 and the initial values of the slack variables Start iteration 1) Given the initial values of the optimization variables at the -th iteration 、 、 、 Obtain the data size that the terminal should transmit in each time slot after optimization according to sub-problem P2.1 .

[0112] 2) Given 、 、 、 , obtain the optimized terminal computing resource allocation according to sub-problem P3.2.1

[0113] 3) Given 、 、 Obtain the optimized terminal computing resource allocation according to sub-problem P3.1.1 ,

[0114] 4) Given 、 、 、 、 , obtain the optimized trajectory and the slack variables

[0115] 6) Set 、 、 , , , substituting into the objective function can obtain the optimal

[0116] 7) Update , return to step 1) 8) The objective function converges, and the convergence condition or

[0117] The following is an example: Referring to Figure 2-3 , which is an embodiment of the present invention, a multi-UAV-assisted federated learning method based on blockchain is provided. In order to verify the beneficial effects of the present invention, scientific demonstrations are carried out 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 in this area with a height of H = 50 m. The maximum transmission power of the mobile terminal is set to 0.3 W, the channel bandwidth is Hz, and the noise power is -110 dBm. The maximum speed of the UAV , the minimum speed of the UAV , the maximum acceleration of the UAV , the safety distance of the UAV , the slot length , the reference channel gain power , the weight factor , the processing speed of the block data in each slot , the chip energy consumption coefficient , the number of CPU cycles required to train a sample , the effective switching capacitance . Figure 3 The convergence performance of the proposed algorithm is analyzed. In the figure, T = 100 seconds is set, and the parameter in the legend is the size of the model update information. It should be noted that as the number of iterations increases, the objective function value gradually decreases, and the proposed algorithm can finally converge to a stable value. In addition, the objective function value of the proposed algorithm will increase with the size of the sample data parameters. This is because as the sample data parameters increase, the number of required slots for transmission will also increase.

[0118] On the other hand, the present invention also discloses a computer device, including a memory and a processor. When the computer program stored in the memory is executed by the processor, the processor executes the steps of the above method.

[0119] In another embodiment provided by the present application, a computer program product including instructions is further provided. When it runs on a computer, it causes the computer to execute any one of the blockchain-based multi-UAV assisted federated learning methods in the above embodiments.

[0120] It can be understood that the system, device, and storage medium provided by the embodiments of the present invention correspond to the method provided by the embodiments of the present invention. The explanations, examples, and beneficial effects of the relevant content can refer to the corresponding parts in the above method.

[0121] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of 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, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).

[0122] It should be noted that in the present invention, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.

[0123] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiment.

[0124] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-UAV assisted federated learning method based on blockchain, characterized in that, including the following steps, Step 1: Establish a system model including M unmanned aerial vehicles (UAVs), K users, blockchain, and federated learning. Multiple UAVs equipped with multi-access edge computing (MEC) servers are deployed at the edge to provide federated learning services for the cloud. The cloud sends the initial model and initial sample data to the UAVs, and a blockchain system is deployed on the MEC servers, enabling the UAVs to act as blockchain nodes to reach consensus on blocks and upload them to the chain; Step 2: Each UAV, as an aerial federated learning (FL) node, collects sample data from terminals for model training of federated learning, which incurs transmission energy consumption and model training energy consumption at the terminals. While collecting sample data from terminals, the UAV moves along a trajectory to reduce the transmission energy consumption of communication between the terminals and the UAVs, which incurs propulsion energy consumption of the UAVs; Step 3: Each UAV, as an aerial blockchain node, processes the generated model update information into transaction information and sends it to other UAVs, and selects a block-producing UAV. The block-producing UAV broadcasts the block formed by the model update information to non-block-producing UAVs. The non-block-producing UAVs verify the block. After successful verification, they send responses and upload the block to the chain. This incurs verification energy consumption of non-block-producing UAVs, block production energy consumption, and block propagation energy consumption of the block-producing UAV in the blockchain model; Step 4: Each UAV, as an aerial FL node, performs global aggregation based on the model update information saved in the block and generates a new global model as the initial model for the next round of training; Step 5: According to the energy consumption of the user equipment (UE) layer and the UAV-MEC layer, construct a joint optimization problem for transmission strategy, model training strategy, computing resource allocation, and trajectory optimization, and solve the optimization problem to obtain the optimal solution that minimizes the system energy consumption.

2. The multi-UAV-assisted federated learning method based on blockchain according to claim 1, wherein: Each UAV, as an aerial FL node, collects sample data from terminals for model training of federated learning, First, discretize the flight period T of the UAV into N time slots, and denote the length of each time slot as . Denote the size of the sample data transmitted from ground terminal k to UAV m in the n-th time slot as . Denote the correlation variable between the two as . The value range is . When it is 1, it means the two are correlated; otherwise, it is 0. The channel power gain between terminal k and UAV m at the n-th time slot is , is the distance from terminal k to UAV m at the n-th time slot, represents the reference distance . The channel gain when = 1. The transmission rate between terminal k and UAV m at the n-th time slot is expressed as: denotes the channel bandwidth between terminal k and UAV m, is the transmit power of terminal k, is the noise power; since the goal is to minimize energy consumption, the following constraint needs to be satisfied: , indicating that the amount of data transmitted must be greater than or equal to the total sample data volume. The transmission delay between terminal k and UAV m is: The transmission energy consumption of terminal k in the nth time slot is expressed as: Then discretize the FL process according to the local training times formula and the global round formula: , , Denote the number of time slots in each global round as ; The start time slot index of the r-th global round is denoted as , , the UAV, as an aerial FL node, denotes the FL training task as , where is the number of samples for the UAV to perform model training in the n-th time slot, is the number of CPU cycles required to train one sample. Assuming the number of bits per sample is , so there is ; The number of times the drone m trains in the nth time slot is denoted as , and the computing resources allocated by the drone m to federated learning in the nth time slot are denoted as , so the training delay of FL is as follows: The training energy consumption is: The number of local training times satisfies: .

3. The multi-UAV-assisted federated learning method based on blockchain according to claim 2, characterized in that: Step 3 includes optimizing the computing resource allocation in the blockchain layer and the UAV trajectory. The UAV trajectory affects the propagation delay of blocks in the blockchain, thereby affecting the system energy consumption. The system energy consumption is optimized by balancing the computing resource allocation in the blockchain layer and the FL layer. Define as the block generation flag. If it is 1, it means the UAV is selected as the block-generating UAV; if it is 0, it is not. At the same time, record as the size of the transaction information in the nth time slot, is the number of CPU cycles required to process each bit of transaction information, is the computing resource allocated to the blockchain layer by the UAV in the nth time slot. Therefore, the block generation delay is: Block generation energy consumption: ; For the block - generating UAV, there is also the energy consumption of transmitting the block, and the time for transmitting the block , where is the size of the block in the n - th time slot, is the transmission rate between UAVs, so the energy consumption of transmitting the block is ; For non - block - generating UAVs to complete the verification of the block, the verification time is , and the verification energy consumption: ; Therefore, the total energy consumption of the blockchain task is: ; Discretize both the system running time T and the FL process for consideration. Therefore, the following constraint needs to be satisfied: That is, in one time slot, the sum of the UAV training time, block generation time, verification time, and block propagation time cannot exceed the length of one time slot, where: , .

4. The multi-UAV assisted federated learning method based on blockchain according to claim 3, wherein: Step 5 includes first dividing the joint optimization problem into two sub-problems, namely sub-problem P2 for optimizing the trajectory and transmission strategy, and sub-problem P3 for optimizing the computing resources and model training strategy; For sub-problem P2, first optimize the terminal transmission strategy for the given optimized computing resources, model training strategy, and trajectory. Then, according to this optimized value, use the successive convex approximation (SCA) algorithm to optimize the UAV trajectory. Next, solve sub-problem P3. According to the trajectory and the optimized value of the transmission strategy obtained by solving P2, and given the model training strategy, solve the computing resource allocation through the Karush-Kuhn-Tucker (KKT) conditions. Then, use the optimized values of the trajectory, transmission strategy, and computing resource allocation to solve the model training strategy. Through the block coordinate descent method, iteratively update until the terminal transmission strategy, UAV trajectory, computing resource allocation, and model training strategy converge to obtain the minimum energy consumption of the system.

5. The multi-UAV-assisted federated learning method based on blockchain according to claim 4, wherein: The total energy consumption for completing the data collection task, FL task, and blockchain task processing is expressed as: where is a mapping factor to ensure that the energy consumption of the drone propulsion is at the same level as that of other parts of the energy consumption. Then, an optimization problem is constructed with the goal of minimizing the energy consumption of the entire system. The optimization problem is specifically expressed as: S.T. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) is the terminal data transmission variable, is the UAV trajectory, is the computing resource variable of the federated learning layer, is the computing resource variable of the blockchain layer, is the model training strategy of the UAV, that is, the number of model training times selected by the UAV in the nth time slot; Constraints (1)-(5) are constraints related to the speed and acceleration of the UAV; among them is the speed of UAV m in the nth time slot; is the acceleration of UAV m in the nth 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 the initial / final velocity constraints of the UAV, respectively; constraints (8)-(9) are the UAV trajectory constraints. It represents the minimum safe distance to avoid collision between UAVs; constraint (10) is to ensure that the data transmitted by the terminal should not be less than the sample data size. It represents the sample data size; constraint (11) means that the amount of data transmitted by the terminal in each time slot will not be greater than its maximum transmission capacity in each time slot; constraints (12)-(13) are to ensure that the allocated computing resources are not negative; constraint (14) is the maximum computing resource constraint, where represents the maximum computing resource; constraint (15) represents that the sum of the training time, block generation time, verification time, and block propagation time of the UAV in a time slot cannot exceed the length of a time slot; constraint (16) means that the total number of training times in each time slot in one round should not be less than the number of local training times.

6. The multi-UAV-assisted federated learning method based on blockchain according to 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. 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 system energy consumption, the whole problem is decomposed into two large sub-optimization problems and then further decomposed into smaller sub-problems. An alternating optimization solution is carried out using the UAV trajectory optimization algorithm based on the block coordinate descent (BCD) algorithm and successive convex approximation (SCA), and finally an approximate optimal solution to the problem is obtained.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 6.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Unmanned aerial vehicle position and resource joint optimization method for air-ground integrated federated learning

    CN113625751A

  • 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

  • Management method, system and device for unmanned aerial vehicle mobile crowd sensing and storage medium

    CN116483116A

Cited By

  • Emergency communication resource optimization method for dynamic spectrum allocation

    CN121126547A