1. Introduction
More and more fields are being impacted by the rapid development of the Internet of Things (IoT), artificial intelligence (AI), and 5G communication technologies [
1], and mobile edge computing (MEC) has become an important cornerstone for supporting these emerging technologies and applications. By deploying computing and storage resources at the edge of the network, MEC can significantly reduce the latency of data processing, improve computing efficiency [
2], and support a variety of real-time applications, such as smart cities [
3], autonomous driving, healthcare, and industrial IoT. MEC has attracted widespread attention as an emerging computing paradigm. By pushing computing and storage resources from the cloud to the network edge, MEC significantly reduces latency and improves the responsiveness of services. However, due to the limited resources of edge devices, how to efficiently manage and allocate these resources has become an urgent issue.
Unmanned aerial vehicles (UAVs) are widely used in MEC environments as flexible and mobile computing nodes [
4]. Drones can not only provide computing resources for users on the ground, but also act as relay nodes to enhance the coverage and quality of communication. Drones can be dynamically deployed in areas that require computing resources to provide users on the ground with low-latency, high-bandwidth computing services. Drones can also act as relay nodes to extend network coverage, especially in disaster areas or remote areas where traditional infrastructure is difficult to cover. Drones can dynamically adjust task offloading and resource allocation strategies based on real-time network and user requirements to improve overall system efficiency [
5].
Blockchain technology has attracted increasing attention due to its decentralized, tamper-proof, and transparent characteristics [
6]. By introducing blockchain technology into MEC, the security and trust of the system can be significantly improved. Through the distributed ledger technology of blockchain, decentralized resource management and transactions can be realized, avoiding single points of failure. Blockchain ensures the privacy and security of user data through encryption technology and smart contracts, preventing data leakage and tampering. Smart contracts automate resource transactions and management, improving the efficiency and transparency of resource allocation and reducing manual intervention. Overall, blockchain-based systems have the characteristics of decentralization and tamper-proof data recording, laying a solid foundation for information security. This security has enabled blockchain technology to be widely used in many scenarios with extremely high system security and confidentiality requirements [
7].
In the UAV-based MEC environment, resource allocation is a multi-level decision problem with significant hierarchical characteristics. The Stackelberg game, as a typical hierarchical game model, is suitable for this scenario. The Stackelberg game model optimizes resource pricing and allocation strategies through a hierarchical decision-making process between the leader (server) and the followers (drones). The leader sets the price and the followers respond to the price. The Stackelberg game model can effectively optimize the balance between resource supply and demand, improve system utility, and through reasonable strategy adjustments during the Stackelberg game process, the system can reach a Nash equilibrium and maximize the utility of each participant [
8,
9].
Most existing resource allocation methods focus on static or single optimization strategies, which have difficulty coping with dynamic and complex system environments. In addition, traditional centralized resource allocation methods have trust and security problems, making it difficult to ensure system reliability and stability in an open environment. To overcome these problems, this paper proposes a two-stage optimization algorithm (DSO) based on blockchain smart contracts, which combines Stackelberg games and auction algorithms to optimize resource allocation among servers, drones, and users, and improve the computational efficiency and reliability of the system.
In practical applications, blockchain-based UAV-assisted mobile edge computing (UAV-MEC) faces many challenges. The first is network latency and performance bottlenecks. Because blockchain relies on consensus mechanisms such as PoW or PoS, the process requires a lot of time for transaction verification and data synchronization, which may affect the efficiency of UAVs in performing real-time computing tasks. Especially in a high-concurrency environment, system throughput and response speed will be severely constrained. The next challenge is the limitation of computing and storage resources. Due to their small size and hardware limitations, drones cannot store the blockchain ledger and verify transactions for a long time, especially as the blockchain scales, the problem of resource consumption becomes more and more prominent. In addition, energy efficiency is also a major challenge. Blockchain operations and computing tasks require a lot of energy, and drones rely on battery power. The increase in computing and communication loads will significantly shorten the drone’s battery life and affect the stability and continuity of its tasks. In terms of system scalability, as the number of drones and user requests increases, the blockchain network needs to have efficient scalability to ensure that transactions can still be processed in a timely manner and data consistency can be maintained in a multi-node environment. However, existing blockchain technologies face problems such as insufficient throughput and synchronization delays in large-scale scenarios. In order to reduce the impact of these problems on the experimental results, the experimental parameters in this paper are applicable to scenarios with large-scale user needs. The following text also verifies the rationality of the blockchain in this system through designed experiments.
Specifically, first, a resource allocation mechanism between the server (leader) and the drone (follower) is constructed based on the Stackelberg game model. The resource allocation strategy is optimized based on a comprehensive consideration of factors such as the computing power, energy consumption, and task processing time of the drone to maximize the overall system efficiency. Second, this paper introduces an auction algorithm to optimize resource pricing between drones and users, making resource allocation more efficient and fairer. Finally, blockchain smart contract technology is used to automate task assignment, result verification, and reward management, enhancing the security, reliability, and transparency of the system.
The main contributions of this paper are as follows:
(1) We propose a two-stage DSO game algorithm to optimize resource allocation and improve resource utilization. In the first stage, we express the trading interactions between servers and drones as a Stackelberg game, where ECSs are leaders and drones are followers. ECSs control the unit price of edge computing resources to maximize the profit earned by drones. Drones control the amount of edge computing resources needed to maximize their goals. For the game between drones and users, we use an auction algorithm to optimize the resource allocation between the two.
(2) We propose a blockchain-based secure resource trading framework in the proposed network. ECS acts as an edge computing resource provider and a mining task publisher in the blockchain-based network, where the drone is an edge computing resource requester. Transaction information about edge computing resource transactions, including resource request and resource price, is recorded in the blockchain.
(3) Experimental results demonstrate that the proposed two-stage optimization (DSO) algorithm outperforms traditional approaches, including the single-stage optimization algorithm (SSO), equal allocation algorithm (EAA), and dynamic resource pricing algorithm (DRP). Specifically, the DSO algorithm achieves the following advantages:
Improved resource utilization: the DSO algorithm increases computing resource utilization by approximately 7–10% compared to SSO and EAA, ensuring more efficient use of available resources.
Reduced task processing latency: by optimizing resource allocation and leveraging UAV mobility, the DSO algorithm reduces task processing delays by 3–5% compared to DRP and SSO, meeting the low-latency requirements of time-sensitive applications.
Lower energy consumption: the DSO algorithm minimizes energy consumption by 4–8% compared to traditional methods, extending UAV operational endurance and reducing operational costs.
The rest of this paper is organized as follows.
Section 2 first discusses related studies, followed by the system model and blockchain framework in
Section 3.
Section 4 is the simulation design and experimental analysis, and the Conclusion follows.
3. Model of a Drone-Assisted Mobile Edge Computing System
3.1. System Model
We consider a UAV-supported MEC network consisting of multiple edge servers (ECSs), unmanned aerial vehicles (UAVs), and users (UEs). The set of ECSs is denoted by E, E = {1, 2,..., E}, and the set of UAVs served by ECS m is denoted by U m, U m = {1, 2,..., U m}, as shown in
Figure 1. The entire network can be divided into three layers: the ECS layer, the UAV layer, and the UE layer. In the ECS layer, there are multiple ECSs that are responsible for allocating edge computing resources to UAVs. They can control the transaction price of the allocated edge computing resources. In the UAV layer, each UAV can provide computing services to mobile users. To improve the quality of service (QoS) provided to mobile users, UAVs with limited on-board resources should apply to ECSs for edge computing resources. At the user layer, each mobile user will upload service requests to UAVs. The service requests include computation tasks, communication requests, and so on. It is assumed that each UAV accesses its nearest ECS, and each mobile user accesses its nearest UAV. Then, all the service requests of the mobile users can be transmitted to the drones, and all the drones can use the edge computing resources obtained from the ECS to provide satisfactory services to the mobile users.
This paper introduces a multi-layer architecture and key parameter settings in the simulated system model, as shown in
Table 1, to fully reproduce the core features of the actual deployment. Specifically, we simulate the dynamic movement of the drone, in which the drone flies according to a preset trajectory, combined with random path deviations to simulate changes in mobility in complex environments. For resource and communication constraints, the computing power and bandwidth of the edge server (ECS) and the drone are set to finite values. The relevant parameters are based on the existing literature and actual systems to ensure the reliability and reference value of the simulation results. In terms of task characteristics, user service requests include two types: computation-intensive and communication-intensive. Task requirements are generated randomly, following the distribution characteristics of user requests in the real environment. In addition, it is assumed that each drone and user accesses its nearest ECS and drone, simulating the access mechanism in the real environment. Although this paper has verified the effectiveness of the proposed algorithm by simulating a detailed environment to restore the operational characteristics of the real UAV-assisted MEC system as much as possible, we also recognize that there are still complex factors in real deployment, such as multipath interference, resource heterogeneity, and dynamic changes in the environment. Future work will further promote the implementation and testing of the algorithm in actual UAV networks, evaluate its applicability and performance in complex dynamic environments, and enhance the practical value of the research for engineering.
The server, as the leader of the system, first sets the price of each task based on the current task demand and resource maintenance costs. The server’s goal is to maximize its utility function, i.e., to optimize its revenue through a rational pricing strategy. After the server sets the prices, the drones, as followers, decide how to respond to those prices. Each drone sets its service price for each task. The goal of the drones is to maximize their utility function. The users, as consumers, have their demands affected by the prices of the drones’ services. In the proposed system, since the drones are supposed to provide computing services to mobile users using resources obtained from the ECS, we assume that there are enough resources available in the ECS for resource allocation. In the communication model, we assume that the uplink and downlink channels between the ECS and the UAV are symmetric. The available transmission capacity of the allocated resources calculated by Shannon’s theorem is considered sufficient. Each UAV is responsible for collecting service requests from users within its coverage area. Then, based on the amount of service demands collected from the mobile users, the UAVs make a decision to request edge computing resources from the ECS. In order to obtain the edge computing resources from the ECS, the drones have to pay a certain amount of revenue to the ECS, which can make a profit by allocating the edge computing resources to the drones by setting a reasonable transaction price for the allocated edge computing resources. In the above process, the transaction price of the edge computing resources is an important factor in determining the resource trading behavior, which is controlled by the ECS.
3.2. Model Safety Analysis
In traditional centralized systems, the resource allocation process can be controlled and interfered with by a single central node, which can lead to problems such as unfair resource allocation and data tampering. In contrast, the decentralized nature of blockchain allows every node in the system to participate in the data recording and verification process, avoiding the risks of single point of failure and data tampering. Using distributed ledger technology, blockchain stores a record of every transaction and resource allocation at every participating node. Each node can verify the legitimacy of the transaction and work together to maintain a tamper-proof ledger, increasing the transparency and trustworthiness of the system. The process of resource allocation and transactions between drones and mobile users involves a large amount of sensitive data, which must be protected from leakage and unauthorized access. Blockchain uses cryptographic algorithms and consensus mechanisms that can effectively secure data. Blockchain uses cryptographic algorithms (e.g., SHA-256) to encrypt data and consensus mechanisms (e.g., PoW, PoS, etc.,) to ensure the authenticity and reliability of data [
33]. Only verified transactions are recorded on the blockchain, ensuring data security. In the UAV-assisted MEC resource allocation system, the resource allocation and transaction process must be performed efficiently and accurately. Traditional manual operation is not only inefficient, but also prone to errors. Smart contracts, on the other hand, can automatically execute transactions according to pre-set rules, eliminating human intervention and improving efficiency and accuracy. A smart contract is a self-executing code running on the blockchain that automatically executes transactions and allocates resources based on pre-set rules. Between drones and servers and between drones and users, resource allocation and transaction processes can be automated through smart contracts.
3.3. Blockchain Resource Transaction Framework
There are a total of three roles in this system, namely the edge computing resource allocator, the edge computing resource requester, and the final demander of edge computing resources. As shown in
Figure 2, the user is the final demander of edge computing resources and sends a resource request to the UAV, specifically including the service demand and the price it is willing to pay [
34]. As the demander of edge computing resources, the UAV collects and summarizes the user’s demand and sends it to the ECS.Server (ECS). The ECS is the edge computing resource allocator that receives and processes the UAV’s resource requests, records the transaction information, executes the smart contract for resource allocation, and maintains the transaction records in the blockchain. For the resource allocation process and user request sending, the user sends the resource request to the drone. For drone request aggregation, the drone collects requests from multiple users and requests resources from the ECS. The ECS records transactions, recording and encrypting all incoming resource requests and packaging them into blocks. The ECS creates and verifies the blocks through the PoW consensus mechanism and adds them to the blockchain. The ECS executes the resource allocation through the smart contract and receives rewards from the blockchain system.
Blockchain integration significantly enhances the security and transparency of the UAV-MEC system through its tamperability, authentication, smart contracts, decentralized architecture, and transaction transparency. Specifically, distributed ledger and cryptographic hashing technologies ensure that transaction data cannot be tampered with, and public–private key encryption and digital signatures enable authentication of UAVs, edge servers, and users to prevent illegal access. Smart contracts automatically execute resource allocation and transaction settlement, reducing human intervention and guaranteeing the fairness and transparency of transactions. The decentralization mechanism improves the system’s anti-attack capability, prevents DDoS attacks and single points of failure, and enhances system robustness. In addition, the open ledger of the blockchain makes all transaction records auditable and traceable, ensuring a transparent and verifiable resource allocation process. Together, these features enhance the security, reliability, and transparency of the UAV-MEC system in complex environments.
The drone sends an edge computing resource request to the ECS, including its requirements and the price of the service. The ECS records these requests as transaction information, including the request time, requester identity, resource requirements, service price, and so on [
35]. When the transaction information reaches a certain number or time interval, the ECS starts to create a new block and packs the collected transaction information into the block. The transaction information is encrypted with a public key and a private key to ensure data security and privacy. According to the set PoW consensus mechanism, ECS generates a computational puzzle as a mining task. ECS uses its computing resources to perform hash operations and tries to solve the PoW puzzle to find an appropriate hash value (i.e., the “proof of work” for the block). Once the ECS finds a valid hash value, it sends it to other nodes in the blockchain network for verification. Other nodes verify the validity of the hash. If a majority of nodes (e.g., more than 50%) confirm its validity, a consensus is reached and the block is considered valid. The verified block is added to the blockchain and becomes part of it [
36,
37,
38]. All nodes update their local ledgers by adding the newly generated block to ensure the consistency of the blockchain data. The ECS that successfully mines is rewarded with the appropriate credit currency as an incentive to participate in maintaining the blockchain and verifying transactions. As shown in pseudocode Algorithm 1, this is the process of trading star blocks between the server and the drone in this model.
Algorithm 1: Blockchain Resource Transaction Process |
- 1:
Initialize blockchain network: - 2:
Generate public/private keys for each ECS and UAV node - 3:
Set initial blockchain parameters (e.g., consensus mechanism, difficulty) - 4:
While (system is running): - 5:
For each user request: - 6:
User sends resource request to UAV - 7:
UAV collects user demands and forwards request to ECS - 8:
For each UAV request: - 9:
ECS records transaction (timestamp, requester, demand, price) - 10:
Encrypt transaction data with public/private keys - 11:
If (transaction pool size > = threshold or time interval reached): - 12:
Create new block - 13:
Add encrypted transactions to block - 14:
While (block not validated): - 15:
Generate PoW puzzle - 16:
Solve PoW puzzle by finding valid hash - 17:
Broadcast solution to other nodes - 18:
If (majority of nodes validate solution): - 19:
Add block to blockchain - 20:
Update local ledger - 21:
Reward ECS node with cryptocurrency - 22:
Broadcast new transactions to all nodes - 23:
Receive confirmation from nodes - 24:
Deploy and execute smart contracts for resource allocation - 25:
Optimize algorithms and system performance as needed - 26:
Expand system by adding more ECS nodes or enabling cross-chain interoperability - 27:
End While
|
3.4. Utility Function Definition
Taking into account the changing payment capabilities and needs of users and drones, the server controls the allocation of resources for each task by setting prices to find the optimal balance between revenue and cost and maximize server utility. The utility function of the server consists of two parts: total revenue and total resource maintenance cost. Specifically, the utility function of the server is shown in Equation (1).
Among them, is the price set by the server for the ith task. is the demand for the ith task. is the resource maintenance cost of the ith task, and is the possibility that the resources traded between the drone and the ECS can be written into a valid block.
Taking into account the user’s ability to pay and changes in demand, the UAV controls resource allocation and revenue for each task by setting the price of the service. The linear functional form of the energy cost rationally reflects the direct relationship between the energy required to provide the service and the demand. The utility function of the UAV consists of four parts: the total revenue that the UAV earns by providing the service, the total cost that it must pay to purchase computing resources from the server, the cost of the energy consumed, and the system reward obtained by completing a resource allocation. Among them, the total cost to be paid for purchasing computing resources from the server can directly affect its revenue, and the system reward can motivate the UAV to perform a large number of resource exchanges to improve resource utilization. In particular, the utility function of the UAV can be expressed by Equation (2).
where
is the service price set by the UAV for the ith task, and
is the energy cost of the ith task.
,
are the elasticity coefficients.
,
are the impact factors.
The user’s utility function describes the benefits and expenditures that the user receives in the process of using the services provided by the UAV, and consists of two parts: the user’s valuation of each task in the process of using the UAV’s services, and the fee paid to the UAV for each task. In this case, the user valuation can be determined based on the quality of the service, the urgency of the need, and other factors, and the fee paid to the drone reflects the user’s utility or satisfaction with the service. Users will consider the cost of the service when choosing the service to ensure that the cost paid does not exceed the utility gained, and find the best balance between the valuation and the cost paid by optimizing the demand to maximize their total utility. Specifically, the user’s utility function can be expressed in Equation (3).
In the resource allocation problem, we model the relationship between the server (ECS) and the UAV as a leader–follower structure. The server acts as a leader; the server has more computational resources and decision-making power, and is able to set the price of resources and control the resource allocation strategy. The UAVs act as followers, and the UAVs need to decide their resource requirements and service prices based on the prices and strategies set by the server.
The server’s goal is to maximize its utility function, which can be expressed in Equation (4).
The goal of the UAV is to maximize its utility function, which can be expressed in Equation (5).
In the game between the UAV (unmanned aerial vehicle) and the user, we have applied the auction algorithm to optimize the resource allocation between the two. The following explains the auction process of the game between the UAV and the user.
1. User puts forward resource demand:
(1) Each user submits a resource request to the UAV with a bid according to their needs and budget.
(2) Remember that user j bid for task i is .
2. The drone collects bids from all users:
(1) The drone collects all users’ bids for each task and organizes them into a bid matrix B, where .
3. The drone conducts an auction:
(1) For each task i, the drone conducts an auction based on the user’s bids, and selects the user j with the highest bid as the winning bidder for the task.
(2) The drone allocates the resources of task i to user j and collects the bid .
4. Resource allocation results:
(1) The drone announces the auction results, including the winning user for each task and its bid.
(2) The winning user obtains the required resources and pays the corresponding bids.
The auction algorithm ensures that resources are allocated to the user who needs them most and is willing to pay the highest price through a competitive mechanism, thus improving the efficiency of resource utilization.
In the auction algorithm, the utility function of the UAV can be expressed in Equation (6).
The user’s utility function can be expressed in Equation (7).
where
is the value that user j obtains from task i.
is user j’s bid for task i.
is the cost of the UAV to provide resources for task i.
The goal of the UAV is to maximize its utility function, which can be expressed in Equation (8).
The user’s goal is to maximize his utility function, which can be expressed in Equation (9).
3.5. DSO Algorithm Two-Stage Equalisation Analysis
In a Stackelberg game, there is a leader (server) and followers (drones). Each has a different utility function: the leader’s utility function depends on its own strategy and the followers’ response strategies, while the followers’ utility function depends on the leader’s strategy and their own strategy.
First, determine the follower’s optimal response strategy after observing the leader’s strategy. This is achieved by maximizing the follower’s utility function. Differentiating and setting the derivative to zero solves for the follower’s optimal response function, which indicates how the follower chooses the optimal strategy given the leader’s strategy. After obtaining the follower’s optimal response, the leader chooses the optimal strategy by maximizing its utility function. The leader’s utility function depends on its own strategy and the follower’s optimal response. The leader’s optimal strategy is solved by differentiating the leader’s utility function and setting the derivative to zero.
Finally, the leader’s optimal strategy is substituted into the follower’s response function to obtain the follower’s optimal strategy. At this point, the strategies of the leader and the follower form an equilibrium, which is the Stackelberg equilibrium solution. In this equilibrium, neither party can unilaterally change its strategy to increase its utility. So next, we will first analyze the utility function of the drone.
The drone utility function can be expressed by Equation (10).
The robot will choose the demand
that maximizes its utility. The optimization of
can be expressed by Equation (11).
Substituting the reward function
and the energy cost function
gives Equation (12).
It can be found that the utility function of the drone is a convex function because of C. Substituting A into the utility function of the server gives Equation (13).
Simplification yields Equation (14).
We optimize for p. Let
, and let
. Then, we can get Equation (15).
Let
,
, we derive the Equation (16) for
.
Let , solve for . Substituting into the response function of the UAV gives .
In summary, we can obtain the Stackelberg equilibrium solution between the server and the drone. The server first chooses its optimal price and then the drone chooses the optimal demand based on the server’s price. This approach ensures an equilibrium resource allocation between the server and the drone, where the server maximizes its utility by setting the optimal price and the drone maximizes its utility by choosing the optimal demand in response to the server’s price.
To solve the Vickrey auction equilibrium solution, first set the valuation of the bidders and assume that each bidder i has a true valuation of the item. Each bidder chooses its bid price [
39,
40,
41,
42,
43]. Then the optimal strategy is set and the utility functions of the bidders are analyzed and it is found that the optimal strategy is to use the true valuation as the bidding price. This strategy is optimal in the Vickrey auction because deviation from this strategy leads to lower utility. This results in an equilibrium solution where all bidders bid at their true valuations, and this combination of strategies is a Nash equilibrium, i.e., no bidder is able to increase utility by changing strategies. The highest bidder then wins, but pays the second highest bid. Next, we analyze the auction process for drones and users.
In the auction algorithm, the user utility function can be defined as Equation (17).
The utility function of the UAV can be defined as Equation (18).
Here N denotes the number of users, M is the number of drones, is user i’s bid for drone j, is the service price of drone j, determined by the second highest bid, indicates the variable, if user i chooses drone j, otherwise , user i’s valuation of drone j, and is the cost of drone j’s service.
The user’s goal is to maximize their utility function, which can be expressed in Equation (19).
User i will choose the UAV that maximizes its utility, which can be represented by Equation (20).
For each drone j, the price is determined by the second highest bid. The drone adjusts its service strategy according to its service cost and the revenue it receives.
The objective of the drone is to maximize its utility function, which can be expressed in Equation (21).
Drone j selects the user with the highest bid and takes the second highest bid as the price, which can be expressed in Equation (22).
In equilibrium, the combination of the user’s and drone’s strategies maximize both drone utility and user utility. This means that under the current strategy, drones and users have no incentive to unilaterally change their strategies. User i will choose the drone j that maximizes its utility, i.e., the drone of choice. Drone j will select the user with the highest bid based on the user’s bid and use the second highest bid as the service price [
44,
45,
46,
47]. This ensures that the drone maximizes its revenue. In equilibrium, all users and drones are chosen such that their utility functions are maximized and no unilateral strategy change can increase their utility.
3.6. DSO Double-Decker Game Rationality Analysis
The main difference between the DSO (two-stage optimization) algorithm and existing resource allocation strategies lies in its innovative design of a hierarchical optimization framework, a dynamic game combined with auction, real-time dynamic pricing, complex environment adaptability, and blockchain integration. First, the DSO algorithm uses a two-stage optimization framework that combines Stackelberg games and multi-attribute auction mechanisms to hierarchically address the resource allocation problem among ECSs, UAVs, and UEs. It takes into account resource pricing and bidding, improving the efficiency and fairness of the system. Existing strategies, on the other hand, mostly use a single-stage centralized approach, which is difficult to handle dynamic competition among multiple entities. Second, the DSO algorithm uses a Stackelberg game model in the first stage to achieve dynamic pricing of resources by ECS, and in the second stage uses a multi-attribute auction mechanism to ensure that users bid for resources according to demand, optimizing revenue and resource utilization. Existing methods usually use fixed pricing or static optimization and cannot adaptively respond to changes in demand. In addition, the DSO algorithm is more robust in complex dynamic environments and can adjust resource allocation in real-time according to user needs and drone movement. Traditional methods usually assume a static environment and are not adaptable enough. More importantly, the DSO algorithm combines blockchain technology to use smart contracts to automate and transparently trade resources, ensuring data immutability and secure authentication, and avoiding the single point of failure and data tampering risks of centralized methods. In summary, the DSO algorithm solves the deficiencies of existing resource allocation strategies in terms of dynamics, incentives, adaptability, and security through multi-level dynamic games and blockchain integration, significantly improving the efficiency, fairness, robustness, and transparency of resource allocation in the UAV-MEC system.
The proposed two-tier game-based resource allocation approach offers significant improvements over existing security frameworks for drone-assisted mobile edge computing (MEC) in several ways. Existing security frameworks typically focus on static resource allocation or a single security mechanism, which often fails to effectively address dynamically changing environments and complex resource requirements. In these frameworks, resource allocation decisions are often inflexible and vulnerable to malicious node attacks or system overload. In contrast, the optimization algorithm based on the two-layer game proposed in this study optimizes the resource allocation between servers and UAVs through the Stackelberg game theory, and further optimizes the resource allocation between UAVs and users through the auction algorithm, which forms a multilevel resource scheduling system that can better cope with different levels of demands. This method not only improves the efficiency of resource allocation, but also can deal with the interests of multiple parties more fairly and avoid the possible bias of a single decision-making mechanism. The proposed optimization method considers the resource scheduling problem in dynamic and heterogeneous environments, and can dynamically adjust the resource allocation strategy according to the real-time network state and user demand, with stronger adaptability and robustness. This feature enables the method to better meet the changing demands in practical deployment, especially in rapidly changing application scenarios such as urban air transportation and disaster emergency response. Therefore, the proposed method not only enhances safety while improving system performance, but also provides a more flexible and efficient solution for future UAV-assisted MEC systems.
The combination of a Stackelberg game and an auction mechanism effectively improves the fairness and efficiency of resource pricing through hierarchical decision making, dynamic pricing, and multi-attribute bidding. In this framework, the Stackelberg game first dynamically adjusts resource pricing through the leader–follower model. The edge computing server (ECS) acts as the leader and sets the resource price based on the system’s supply and demand to ensure that the price can adapt to changing market conditions, while the unmanned aerial vehicle (UAV) acts as the follower and decides the resource application based on these prices and its own needs. This dynamic pricing mechanism ensures efficient resource allocation and avoids waste and scarcity. Then, a multi-attribute auction mechanism is used to allocate resources between UAVs and user equipment (UE). By considering multiple factors such as price, compute demand, latency, and task priority, fairness is ensured. This prevents low-demand users from being squeezed out of resources by high-demand users, while also preventing resources from being concentrated among a small number of users, thus ensuring fairness and differentiation in resource allocation. This combination mechanism can adjust prices in real-time as market demand changes, thereby balancing supply and demand and avoiding the problems of overpricing or wasting low-priced resources. At the same time, the auction mechanism guides users to bid reasonably, reduces false demand, improves resource utilization, and optimizes the overall revenue of the system through incentives. Ultimately, the combination of the Stackelberg game and the auction mechanism not only improves the efficiency and fairness of resource allocation, but also ensures that the algorithm can converge quickly in a dynamic environment, improving the flexibility and responsiveness of the system.
To evaluate the feasibility of the proposed two-stage optimization (DSO) algorithm in actual deployment, we conducted a detailed analysis of the computational complexity of the algorithm. The DSO algorithm includes Stackelberg game solving, auction mechanism execution, and blockchain consensus process. For the Stackelberg game, since each drone needs to bid for resources and make pricing decisions with the edge servers it covers, the complexity is (where U denotes the number of drones and E denotes the number of edge servers). In the auction mechanism phase, each mobile user bids for computing resources through drones, with a complexity of (where M is the number of mobile users). The blockchain consensus adopts the practical Byzantine fault tolerance (PBFT) mechanism, and the complexity of message exchange between nodes is (where n is the number of nodes participating in the consensus). Therefore, the total complexity of the DSO algorithm is , it has good computational efficiency in a medium-scale UAV-assisted MEC network, and meets the needs of practical applications. In order to reduce system complexity and enhance the applicability of the algorithm in the actual UAV-assisted MEC environment, we propose various simplification and heuristic optimization methods. First, we use approximate solution methods (such as particle swarm optimization, genetic algorithms, etc.) to replace the exact solution of the original Stackelberg game, which significantly reduces the calculation time. Second, a partitioned auction mechanism is used to divide UAVs and users according to geographical regions, and local auctions are executed in parallel to allocate resources, avoiding the computational bottleneck of large-scale centralized auctions. In addition, we introduce a hierarchical blockchain architecture, where local subchains are deployed within regions to complete the preliminary verification of resource transactions, reducing the delay overhead caused by full network consensus. Finally, based on the urgency of tasks, we propose a priority task scheduling strategy that prioritizes the processing of high-priority tasks when resources are limited, ensuring that the system can still provide high-quality computing services for critical tasks under high loads.
4. Analysis of Resource Allocation Experiments
4.1. Simulation Design
In the UAV resource allocation system, there is a problem of resource allocation and utility optimization between the server (edge computing server, ECS) and the UAV (unmanned aerial vehicle). Specifically, the server provides edge computing resources, and the UAV requests these resources to complete its respective tasks. The power gap between the server and the UAV is large, so the Stackelberg game model is suitable for resource allocation optimization. In this model, the server, as the leader, first sets the price of the task, and then the UAV, as the follower, makes a resource request decision based on the price set by the server.
In addition, the resource allocation between the drone and the user also needs to be optimized. Since the gap in strength between the drone and the user is relatively small, an auction algorithm is suitable for optimization. In this model, the drone acts as the bidder, and the user acts as the auctioneer, with the final allocation of resources determined through a bidding mechanism.
Table 2 shows all the parameters used in the experiment.
This simulation is designed to verify the performance of the algorithm in different network environments by simulating a blockchain-based resource trading system based on the DSO algorithm, focusing on key factors such as resource allocation efficiency, fairness, system stability, and security. The simulation model includes three main participants: resource providers (servers), intermediaries (drones), and consumers (users). Among them, the server and drone conduct the initial allocation of resources through the Stackelberg game model, and users bid for the required resources through an auction mechanism. Blockchain technology is used to ensure the transparency and immutability of all transaction records, as well as to provide security for resource allocation. The simulation process not only examines the efficiency of resource allocation, but also focuses on the impact of factors such as network bandwidth and latency on system stability, as well as the impact of the transaction confirmation time of the blockchain platform on the timeliness of overall resource allocation.
The simulation results will be evaluated using a number of indicators, including resource utilization, system fairness, transaction confirmation time, user satisfaction, etc., to comprehensively analyze the advantages and disadvantages of the DSO algorithm. In addition, the simulation will also evaluate the stability of the algorithm under changes in the network environment (such as network delays and bandwidth fluctuations), to verify whether the algorithm is highly adaptable. These simulation results can provide a basis for system optimization, such as optimizing game strategies, improving the fairness of the auction mechanism, or improving the blockchain consensus mechanism to reduce transaction delays, thereby improving the overall performance and application feasibility of the system.
4.2. Convergence Analysis
First, as shown in
Figure 3, in the system with the participation of only one drone, in the Stackelberg game phase, the demand for the drone decreases with the number of iterations, and converges at a demand of 7 after almost 60 iterations. While in the auction algorithm phase, the demand of the UAV first rises and then tends to equilibrate and converges at the seventh iteration. It can be concluded from the results of this experiment that both phases of the game lead to an equilibrium solution.
Next, in order to better verify the convergence of the two-stage algorithm, we increase the number of UAVs and analyze the two stages in separate experiments. We analyze the process of the Stackelberg game separately, as shown in
Figure 4, and we increase the number of drones—there are three drones involved in resource allocation. As the game progresses, each drone’s demand decreases and then converges to the equilibrium as the number of iterations increases, so the drones all have the highest demand at the beginning and then gradually decrease to a stable value, and almost all of the drones iterate more than 70 times before they start to converge. Because the drones initially received many resource requests from users, the demand for drones was relatively high, but as many users were satisfied, the demand for drones gradually decreased and eventually converged to equilibrium.
By analyzing the convergence of the Stackelberg game above, we can observe that the first stage can already converge, next, Let’s analyze separately the change in UAV demand with the number of iterations during the auction algorithm. As shown in
Figure 5, due to the introduction of the auction mechanism, at the beginning, each user has introduced resource requests and bid against each other, which makes the demand for UAVs significantly increase, and the demand for UAVs gradually tends to balance as most users obtain resources.
In the aforementioned experiments, we have verified the convergence of the DSO two-stage optimization algorithm through three sets of independent tests, proving that the algorithm is able to converge stably to the optimal solution within a limited number of iterations, ensuring the effectiveness of resource allocation and the reliability of computation. To further assess the advantages and applicability of the DSO algorithm in practical applications, the next work will systematically analyze the performance of the DSO algorithm in comparison with other mainstream resource allocation algorithms by focusing on three key dimensions, namely user demand, convergence speed, and the rate of change in the utility function. This multi-dimensional evaluation will not only reveal the performance and limitations of the DSO algorithm in different scenarios, but also verify its stability and efficiency in dynamic, multi-user environments, providing a more comprehensive theoretical basis and practical support for resource management in UAV-assisted MEC systems.
First, in terms of user demand, we will analyze the performance of the DSO algorithm when facing different numbers, complexities, and dynamically changing user tasks, and evaluate its adaptability and scalability in high demand density and complex environments. Secondly, convergence speed is a core indicator of algorithm efficiency, which affects the real-time response and computational cost of the system. We will verify whether the DSO algorithm can reach a stable solution at a faster speed and improve the efficiency of resource allocation by comparing the number of iterations and convergence time. In addition, the utility function change rate reflects the performance improvement speed and final utility value of the algorithm during the iteration process, which directly affects the system revenue and user satisfaction. We will track the change in utility value of the DSO algorithm over time, compare its speed and effectiveness in achieving the optimal solution for resource allocation, and ensure that the algorithm maximizes the overall system revenue while satisfying individual interests. These analyses will provide a comprehensive demonstration of the effectiveness and benefits of the DSO algorithm in a real-world UAV-assisted MEC environment, laying the groundwork for the future design of more efficient, fair, and scalable resource management systems.
4.3. DSO Algorithm Comparison Experiment
In the next section, we verify the superiority of the DSO algorithm by designing comparative experiments. The experiments are conducted through three aspects: user requirements, convergence speed, and rate of change in the utility function.
We compare the DSO algorithm with other algorithms by designing experiments, as shown in
Figure 6, we compare the DSO algorithm with three algorithms, namely DRP, EAA, and SSP, where the algorithm, DRP, dynamically adjusts the price of resources according to the change in resource supply and demand in order to optimize the allocation. It is usually used in cloud computing or distributed computing environments. In the EAA algorithm, resources are evenly distributed to all participants without considering specific demand or utility functions. In the SSO algorithm, resources are allocated directly between servers and UAVs without considering user demand or secondary optimization. As can be seen in
Figure 6, the DSO algorithm reaches its maximum value at 27 iterations and levels off later. The final experimental result is the
.
As shown in
Figure 7, the DSO algorithm shows significant advantages in convergence speed, which not only can quickly reach a stable solution, but also always outperforms other compared algorithms in the whole iteration process. Specifically, the DSO algorithm completes convergence in about 30 iterations, which is much faster than the number of iterations required by other algorithms, reflecting the high efficiency of the algorithm in complex resource allocation scenarios. In addition, from the convergence trend after each iteration, it can be observed that the DSO algorithm shows faster utility improvement in the initial stage and rapidly approaches the optimal solution with less computational cost, which is suitable for UAV-assisted MEC environments with high requirements for real-time and computational efficiency. This improvement in convergence speed is mainly due to the synergistic optimization of the Stackelberg game and auction mechanism in the DSO algorithm, which accelerate the resource allocation process between the edge server and the UAV and the UAV and the user, respectively, and thus effectively reduce the number of iterations and improve the overall efficiency.
Next, we will further analyze the average change in the utility function over time to verify the performance advantages of the DSO algorithm in terms of resource utilization and system efficiency. The comparison will comprehensively reflect the utility growth rate and final utility value of the DSO algorithm in different time scales, and further evaluate its adaptability and stability in real UAV-assisted MEC environments.
As shown in
Figure 8, in terms of the average change in the utility function over time, the utility values of all the algorithms show a gradual upward trend with the increase in the number of iterations, indicating that all the algorithms are able to enhance the system benefits in the process of continuously optimizing the resource allocation. However, the DSO algorithm consistently maintains a higher average utility value throughout the iteration process, and its utility enhancement speed and final utility level are significantly better than those of the other compared algorithms. This advantage suggests that the DSO algorithm is able to allocate resources among edge servers, UAVs, and users more efficiently, ensuring that the benefits of all parties are maximized while improving the overall system benefits.
4.4. Blockchain Experiment
Next, we verified the security role played by the blockchain in the system from multiple aspects through a design comparison experiment.
Table 3 lists all the parameters used in the blockchain experiment. In these parameter settings, we simulate high user demand and more complex drone networks as much as possible.
Figure 9 clearly shows that the introduction of blockchain has a significant impact on the attack defense capability of the MEC system. The experimental results show that without the use of blockchain, the number of successful attacks remains at a high level, with an average of about 30% successful attacks per experiment, reflecting the vulnerability of the system to malicious behavior. After the introduction of blockchain, the number of successful attacks decreased significantly to about 5%, indicating that the decentralized and tamper-resistant nature of blockchain effectively enhances the security of the system and reduces the success rate of malicious attacks. Although blockchain introduces additional computational overhead and slightly increases the resource burden on the server, this cost is acceptable in terms of improving system security. The results of multiple comparative experiments are consistent, further verifying the stability and effectiveness of blockchain in enhancing the system’s ability to resist attacks. This shows that the use of blockchain in MEC systems not only significantly improves data security and tamper resistance, but also helps to enhance the overall defensive performance of the system.
The experimental results shown in
Figure 10 indicate that the introduction of blockchain technology significantly improves the security and stability of the system. First, in terms of data integrity verification, after using blockchain, the number of verification failures is greatly reduced. Without blockchain, the number of verification failures is high, with an average of 20 verification failures per experiment. After the introduction of blockchain, this number drops to about two. This shows that the immutability and encryption technology of the blockchain significantly improves the credibility of the data, effectively preventing data from being tampered with or damaged during transmission and storage, thereby improving the security of the system. On the other hand, the success rate of identity verification has also improved significantly. Without the blockchain, the average number of successful identity verifications was 80, while after using the blockchain, this number increased to 98. The decentralized identity authentication mechanism of the blockchain reduces the risk of forgery and unauthorized access, thereby greatly improving the reliability of identity verification.
From the perspective of system resource utilization and task scheduling, although the blockchain introduces additional computational overhead (approximately 10% overhead), the experimental results, as shown in
Figure 11, show that the overall performance of the system remains good. Without the blockchain, the system’s server resource utilization is high, with an average resource utilization rate of 92%. However, with the blockchain, the resource utilization rate decreases slightly to 90%, but this does not significantly affect the operating efficiency of the system. At the same time, task latency increased after the introduction of the blockchain, but the increase was limited, with latency increasing from an average of 1.5 times to 2 times when the blockchain was not used. This shows that although the blockchain brings certain computational overheads and latency, its negative impact on the system is relatively small, and its improved security, especially in terms of data protection and identity authentication, more than makes up for these effects. Therefore, the blockchain not only effectively enhances the security of the system, but also maintains high resource utilization efficiency and task execution capabilities.
The above experiments systematically analyze the impact of blockchain technology on key aspects such as attack defense, data integrity and authentication, and resource utilization and task latency, and comprehensively evaluate the role of blockchain in improving system security and overall performance. First, in terms of attack defense, the distributed architecture of the blockchain significantly enhances the system’s resistance to malicious attacks, especially against DDoS attacks and data tampering. Experimental results show that when blockchain is not used, the system is successfully invaded an average of 15 times in 50 simulated attacks, with a success rate of 30%, while after the introduction of blockchain, the number of successful attacks significantly reduced to 2.5 times, and the success rate of attacks is reduced to 5%, effectively improving the system’s defense capabilities and reducing the risk of data breaches and service disruptions. In terms of data integrity and identity verification, blockchain ensures data integrity and the authenticity of user identity by leveraging its tamper-resistant data and decentralized verification mechanism. Experiments have shown that the blockchain-based identity verification solution reduces the risk of identity forgery and data tampering by 60%, and there has been no data inconsistency during multiple verification processes, which proves its high reliability in sensitive data protection and access control.
In terms of resource utilization and task latency, although blockchain introduces additional computing and communication overheads (about 10%), the overall system performance remains at a high level, and there is no significant impact on task execution efficiency and resource consumption. The experimental results show that when blockchain is not used, the average resource utilization of the system is 92%, while after blockchain is introduced, the resource utilization rate decreases slightly to 90% due to the additional computing consumption, but it is still at a high level, indicating that blockchain has a limited impact on the system’s computing resources. In addition, task latency increased after the introduction of blockchain, from an average of 1.5 times when blockchain was not used to 2 times, an increase of about 3%. However, the overall latency fluctuation range remained stable within a reasonable range, and did not significantly affect task scheduling efficiency. It is worth noting that although blockchain technology has brought about a slight increase in computing and time overheads, its improvement in data security and authentication reliability has more than compensated for the negative impact of these overheads on system performance. To sum up, while significantly enhancing system security and improving data protection and authentication accuracy, blockchain technology can still maintain high resource utilization efficiency and controllable task execution latency, demonstrating its broad application prospects in high-security, distributed computing environments.
5. Conclusions
In this paper, a two-stage optimization algorithm (DSO algorithm) based on the combination of a Stackelberg game and an auction mechanism is proposed for the problem of resource allocation among servers, drones, and users, and blockchain technology is introduced to enhance the security and transparency of the resource transaction process. The algorithm first optimizes the resource pricing and allocation between the server and the UAV through the Stackelberg game, and then further optimizes the resource transaction between the UAV and the user through the auction mechanism, which realizes the collaborative optimization between multiple levels and multiple subjects.
In order to verify the superiority of the DSO algorithm, we designed and carried out a series of comparative experiments from the key indexes such as user utility function, utility function optimization effect and algorithm convergence speed. The experimental results show that the DSO algorithm significantly outperforms the traditional resource allocation algorithm in several performance metrics. Specifically, the experimental data on the change in utility function over time show that the DSO algorithm is able to achieve higher utility values with fewer iterations and maintain the stability of the results in a dynamic environment. Meanwhile, the comparison results of convergence speed show that the DSO algorithm converges significantly faster than other baseline algorithms, and exhibits significant advantages in resource allocation efficiency and computational complexity. This indicates that the DSO algorithm not only allocates resources more efficiently, but also realizes the global optimal solution more quickly in complex environments, thus effectively improving the response speed and service quality of the system.
In future research on UAV-assisted MEC security frameworks, possible directions of work include achieving adaptive resource allocation through machine learning to improve the system’s dynamic adaptive capability; using blockchain technology to solve scalability issues, optimizing the consensus mechanism and combining with second-layer solutions to improve throughput; enhancing privacy protection and security, such as combining differential privacy and quantum cryptography algorithms; optimizing network slicing and load balancing to improve resource scheduling efficiency; and research on multi-UAV collaboration and group intelligence to improve computational task scheduling and air–ground collaboration to ensure efficient system operation and anti-attack capability. These directions will provide the UAV-assisted MEC framework with enhanced performance, security, and scalability, and promote its extensive development in practical applications.
Despite the significant theoretical advantages of the proposed UAV-assisted MEC security framework, its practical implementation faces many challenges. First, the combination of machine learning and blockchain requires a large amount of computational resources and efficient algorithm design, which may lead to an increase in system complexity and computational burden; second, the enhancement of privacy protection and security may affect the system’s responsiveness and energy efficiency, especially in large-scale UAV collaboration environments; furthermore, the dynamic optimization of network slicing and load balancing requires highly accurate real-time monitoring and scheduling, which in a multi-user, dynamic environments may be difficult to achieve. Nevertheless, with the development of 5G and future 6G networks and the advancement of intelligent algorithms, the proposed approach has great potential to provide solutions for efficient and secure edge computing in real-world applications such as drone swarm collaboration, smart cities, disaster relief, and telemedicine.