A method for minimizing system energy consumption of non-orthogonal multiple access narrowband Internet of Things based on mobile edge computing, which is realized by jointly optimizing transmit power, computing resource allocation, and decoding sequencing in a narrowband Internet of Things network with both MEC and NOMA technologies System energy consumption minimization, the optimization problem is described as a multivariate optimization; P1 is decomposed into two sub-optimization problems: optimizing resource allocation and optimizing decoding sorting, wherein, for the optimization of resource allocation, firstly, according to the one-to-one logarithmic transformation Transform the P1 problem into a P2 convex problem, and then use the gradient descent algorithm to optimize the problem of transmission power and computing resource allocation; secondly, for the optimization of device decoding sorting, the tabu search algorithm is used to optimize variables. The present invention provides a method for minimizing energy consumption of the entire system by designing an optimization algorithm for joint transmission power, computing resource allocation, and device decoding and sorting in the narrowband Internet of Things with both MEC and NOMA technologies.