With more and more interconnected smart devices (ISDs) accessing the Internet of Things (IoT), massive and diverse tasks need to be transformed and computed. Mobile edge computing enables the offloading of tasks to nearby servers to enhance processing efficiency, which makes ISDs idle, causing resource waste and failing to satisfy the high realâtime requirements of tasks. Besides, when tasks with different priorities are processed in the order they are generated, it will be difficult for IoT to guarantee a timely response to highâpriority tasks. To address the aforementioned issues, we establish an edgeâterminalâlocal architecture by softwareâdefined networking to centrally manage idle ISD resource (2ISDR). Then the proposed twoâstep scheduling mechanism with preemptive priority queue ensures the realâtime responses to highâpriority tasks, and the minimum resource allocation coefficients make offloading effective. Finally, we also propose a modified NSGAâIII algorithm named MNSGAâIII, which is designed to make decisions about offloading and solve resource allocation for tasks, and we correct infeasible solutions by a twoâstep correction function to ensure the feasibility of MNSGAâIII. Experimental results show that the method can ensure a timely response to highâpriority tasks and optimize processing time, energy consumption, and economic cost through the utilization of 2ISDR.