With the increasing number of electric vehicles (EVs), the disordered charging of a large number of EVs will have a large influence on the power grid. The problems of charging and discharging optimization management for EVs are studied in this paper. The distribution of characteristic quantities of charging behaviour such as the starting time and charging duration are analysed. The results show that charging distribution is in line with a logarithmic normal distribution. An EV charging behaviour model is established, and error calibration is carried out. The result shows that the error is within its permitted scope. The daily EV charge load is obtained by using the Latin hypercube Monte Carlo statistical method. Genetic particle swarm optimization (PSO) is proposed to optimize the proportion of AC 1, AC 2 and DC charging equipment, and the optimal solution can not only meet the needs of users but also reduce equipment investment and the EV peak valley difference, so the effectiveness of the method is verified.