Mobile edge computing (MEC) is a new computing approach in which computation tasks carried by mobile devices (MDs) can be offloaded to MEC servers or computed locally. Since the MDs are always battery limited and computation tasks have strict deadlines, how to schedule the execution of each task energy effectively is important. Comparing with existing works, we consider a much more complexed scenario, in which multiple moving MDs sharing multiple heterogeneous MEC servers, and a problem named as minimum energy consumption problem in deadline-aware MEC system is formulated. Such problem is proved to be NP-hard, and two approximation algorithms are proposed focusing on single and multiple MD scenarios, respectively. The performances of these algorithms are varied by theoretical analysis and simulations.