The invention discloses a joint optimization method for task unloading and resource allocation in a mobile edge computing network, which comprises the following steps of 1, establishing an OFDMA (Orthogonal Frequency Division Multiple Access)-based multi-MEC (Mobile Edge Computing) base station and a multi-user scene model, wherein the MEC base station supports the multi-user access; 2, introducing an unloading decision mechanism; Meanwhile, constructing a local calculation model and a remote calculation model, selecting a user needing to perform calculation unloading, and establishing a calculation task unloading and resource allocation scheme based on minimum energy consumption under the condition of meeting the time delay constraint according to the conditions; 3, carrying out variablefusion on three mutually constrained optimization variables, namely an unloading decision variable, a wireless resource distribution variable and a computing resource distribution variable, so as to simplify the problem; and 4, obtaining an unloading decision and a resource allocation result which enable the total energy consumption of the user in the MEC system to be minimum through a branch andbound algorithm. The method has the advantage that the energy consumption of the system can be effectively reduced on the premise that strict time delay limitation is guaranteed.