# Blockchain-Based UAV-Assisted Mobile Edge Computing for Dual Game Resource Allocation
## 4 Analysis of Resource Allocation Experiments  
### 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.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter Name** & **Symbol** & **Value** \\ \hline Number of Drones & N\({}_{\text{UAV}}\) & 3 \\ Number of Tasks & N\({}_{\text{Tasks}}\) & 100 \\ Maximum Number of Iterations & T\({}_{\text{MAX}}\) & 100 \\ Price Per Task (Server Decision) & P\({}_{\text{i}}\) & Random Number \\ Price of Service (Drone Decision) & s\({}_{\text{i}}\) & Random Number \\ Resource Maintenance Cost Function & C(D\({}_{\text{i}}\)) & 0.5 \(\cdot\) D\({}_{\text{i}}^{2}\) \\ Energy Cost Function & E(D\({}_{\text{i}}\)) & 0.2 \(\cdot\) D\({}_{\text{i}}^{2}\) \\ Reward Function & R(D\({}_{\text{i}}\)) & 0.1 \(\cdot\) D\({}_{\text{i}}^{2}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Model parameters.