The task offloading technology in mobile edge computing can improve the benefits of each device. Moreover, designing reasonable prices for computing resources is critical to balancing the interests of end servers and devices. However, unbalanced information availability complicates this issue. To address this problem, the Stackelberg game is introduced to describe the relationship between the MEC server and end users (EUs). Then, the task offloading decision problem of EUs is simplified and proved by derivation. Last, uniform pricing and differentiated pricing algorithms are proposed. The differentiated pricing strategy is proposed by the PSO-based pricing optimization algorithm (DPOA), which can precisely constrain the offloading of each EU. Simulation results show the DPOA effectively improve profit of the server, and reduce latency of EUs.