In the smart grid environment, demand side management makes it possible to encourage consumers participating more actively via proper pricing schemes. In this paper, we analyze previous real-time pricing models and then provide a comprehensive model. A new criterion for designing real-time pricing models is proposed, which can guarantee that the optimal solution obtained from centralized algorithms is the same as that from the distributed algorithms. Furthermore, a fast distributed dual gradient algorithm is proposed to achieve the optimal solution. Compared with the widely used distributed dual sub-gradient algorithm, theoretically, the proposed one does not only accelerate the convergence rate, but also overcome the possible non-convergence during iteration process, which is a demerit in the traditional method. This new solver is of great importance in the application of dynamic pricing mechanism due to real-time requirement. More specifically, this new algorithm can largely reduce the information exchange between the energy provider and its customers, making the proposed method more practical. The simulations also validate its effectiveness and efficiency in solving real-time pricing problems.