Electric vehicles (EVs) are increasingly being valued by countries, but the disorderly charging behaviour of too many EVs poses a huge challenge to the operation of the power grid. First, for EVs, a methodical charging and discharging technique was designed, taking into account the temporal and spatiotemporal characteristics of different EV models, time convenience of owners, and safe operation of power grid. Second, the EV characteristics and safe operation of the grid after EV integration into the grid are presented for vehicle owners to achieve minimal charging station and optimal charging stations selection as well as charging and discharging schemes. Third, simulation calculations and analyses of ordered charging and discharging modes as well as disordered charging modes under various scenarios were performed. This study fully considers the characteristics of different vehicle models and the willingness of users to respond, making the model more realistic. The findings demonstrate that the optimised charging and discharging strategy in this study lowers the cost of charging for vehicle owners, boosts revenue from the charging station and the rate of use of the charging pile, lowers the risk of the safe operation of distribution networks, and effectively relieves pressure on the power grid. While solving the scheduling difficulties of a large number of EVs, it increases the economy between users and the power grid, and improves the safety of power grid operation.