Based on the arrangement principle of energy-saving generation dispatching, restricted by the security operation for the power grid, synthetically considering the factors of market and policy, the price of real-time purchasing electricity for the power grid is accurately calculated and analyzed. With the introduction of calculation for the marginal cost of purchasing electricity, an integrated decision-making model is proposed with the objective of minimizing energy consumption under the real-time generation adjustment for the power grid, which can be used to evaluate the economy of the trans-provincial or trans-regional electric power short-term trade of the electricity consumption. Meanwhile, the paper describes in detail the structure and main functions of the power grid real-time purchasing electricity price analysis calculation system, and shows the innovation of the system marginal cost of real-time purchasing electricity calculation and the practical features in automatic data optimization and system maintenance-free. The system proposed has already been applied into Sichuan power grid and the results show the practicality and effectiveness of the system.