Large-scale electric vehicles (EVs) connected to the micro grid would cause many problems. In this paper, with the consideration of vehicle to grid (V2G), two charging and discharging load modes of EVs were constructed. One was the disorderly charging and discharging mode based on travel habits, and the other was the orderly charging and discharging mode based on time-of-use (TOU) price; Monte Carlo method was used to verify the case. The scheme of the capacity optimization of photovoltaic charging station under two different charging and discharging modes with V2G was proposed. The mathematical models of the objective function with the maximization of energy efficiency, the minimization of the investment and the operation cost of the charging system were established. The range of decision variables, constraints of the requirements of the power balance and the strategy of energy exchange were given. NSGA-II and NSGA-SA algorithm were used to verify the cases, respectively. In both algorithms, by comparing with the simulation results of the two different modes, it shows that the orderly charging and discharging mode with V2G is obviously better than the disorderly charging and discharging mode in the aspects of alleviating the pressure of power grid, reducing system investment and improving energy efficiency.