An optimal strategy for distribution networks considering EVs (Electric Vehicles) was proposed in this paper. Firstly, a behavioral model of EV based on HMM is established. Secondly, the corresponding data of EVs are obtained according to the model, including real-time state, spatial location, real-time energy, and so on. Next, an optimal strategy considering multi-source cooperation is established. Finally, the modified IEEE33 is taken as an example to obtain the Spatio-temporal state of the EV cluster in a day and conduct the distribution network optimization analysis. The results verify the effectiveness of the proposed model and strategy.