# Blockchain-Based UAV-Assisted Mobile Edge Computing for Dual Game Resource Allocation
## 3 Model of a Drone-Assisted Mobile Edge Computing System
### DSO Double-Decker Game Rationality Analysis
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 \(\mathrm{O}\left(\mathrm{U}^{2}\times\mathrm{E}\right)\) (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 \(\mathrm{O}(\mathrm{U}\times\mathrm{M})\)(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 \(\mathrm{O}\left(\mathrm{n}^{2}\right)\) (where n is the number of nodes participating in the consensus). Therefore, the total complexity of the DSO algorithm is \(\mathrm{O}\left(\mathrm{U}^{2}\times\mathrm{E}+\mathrm{U}\times\mathrm{M}\right)\), 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.