Cloud-as-the-center computing paradigms face multiple challenges in the 5G and Internet of Things scenarios, where the service requests are usually initiated by the end-user devices located at network edge and have rigid time constraints. Therefore, Fog computing, or mobile edge computing, is introduced as a promising solution to the service provision in the tiered IoT infrastructure to compensate the shortage of traditional cloud-only architecture. In this cloud-to-things continuum, several cloudlet or mobile edge server entities are placed at the access network to handle the task offloading and processing problems at the network edge. This raises the resource scheduling problem in this tiered system, which is vital for the promotion of the system efficiency. Therefore, in this paper, a scheduling mechanism for the cloudlets or fog nodes are presented, which takes the mobile tasks' deadline and resources requirements at the same time while promoting the overall profit of the system. First, the problem at the cloudlet, to which IoT devices offload their tasks, is formulated as a multi-dimensional 0-1 knapsack problem. Second, based on ant colony optimization, a scheduling algorithm is presented which treat this problem as a subset selection problem. Third, to promote the performance of the system in the dynamic environments, a churn-refined algorithm is further put forward. A series of simulation experiments have shown that out proposal outperforms many state-of-the-art algorithms in both profit and guarantee ratio.