Abstract:Mobile Edge Computing (MEC) assisted by Unmanned Aerial Vehicle (UAV) has been widely investigated as a promising system for future Internet-of-Things (IoT) networks. In this context, delay-sensitive tasks of IoT devices may either be processed locally or offloaded for further processing to a UAV or to the cloud. This paper, by attributing task queues to each IoT device, the UAV, and the cloud, proposes a real-time resource allocation framework in a UAV-aided MEC system. Specifically, aimed at characterizing a long-term trade-off between the time-averaged aggregate processed data (PD) and the time-averaged aggregate communication delay (CD), a resource allocation optimization problem is formulated. This problem optimizes communication and computation resources as well as the UAV motion trajectory, while guaranteeing queue stability. To address this long-term time-averaged problem, a Lyapunov optimization framework is initially leveraged to obtain an equivalent short-term optimization problem. Subsequently, we reformulate the short-term problem in a Markov Decision Process (MDP) form, where a Deep Q Network (DQN) model is trained to optimize its variables. Extensive simulations demonstrate that the proposed resource allocation scheme improves the system performance by up to 36\% compared to baseline models.