The invention discloses a method for obtaining the optimal energy trading scheme of PHEV based on fog calculation, comprising the following steps: S1, establishing an energy trading system of PHEV based on fog calculation, and introducing an energy center of fog calculation; S2, dividing the energy center of fog calculation into non-profit driving and profit driving; S3, carrying out the energy transaction managed by the non-profit-driven fog computing energy center, establishing a non-profit-driven optimization problem model and optimizing, and obtaining the optimal solution; S4, carrying outthe energy transaction managed by the benefit-driven fog computing energy center, establishing the benefit-driven optimization problem model and optimizing, and obtaining the optimal solution set; S5, according to the optimal solution and the optimal solution set, outputting the PHEV optimal energy trading scheme. The invention solves the problems of low practicability, large capital investment,low optimization of energy transaction between PHEV and power network, low real-time performance and low efficiency existing in the prior art.