Due to the limited computing resources of the mobile edge computing (MEC) server, a massive Internet of things device computing unloading strategy using game theory in mobile edge computing is proposed. First of all, in order to make full use of the massive local Internet of things equipment resources, a new MEC system computing an unloading system model based on device-to-device (D2D) communication is designed and modeled, including communication model, task model, and computing model. Then, by using the utility function, the parameters are substituted into it, and the optimization problem with the goal of maximizing the number of CPU cycles and minimizing the energy consumption is constructed with the unloading strategy and power as constraints. Finally, the game theory is used to solve the problem of computing offload. Based on the proposed beneficial task offload theory, combined with the mobile user device computing offload task amount, transmission rate, idle device performance, and other factors, the computing offload scheme suitable for their own situation is selected. The simulation results show that the proposed scheme has better convergence characteristics, and, compared with other schemes, the proposed scheme significantly improves the amount of data transmission and reduces the energy consumption of the task.