Aiming at the problem of long slopes and weak power grids along the railway in high altitude mountainous areas, an optimization method of power supply mode and access to external power grid of CZ railway traction station is proposed. First, combined with the terrain and altitude along the railway and the characteristics of the regional power grid, a sample library of the power supply mode and access to external power grid of CZ railway traction station is designed. Secondly, combined with the train operation diagram and line ramp parameters, the full-day periodic load of each power supply arm is simulated. Then, according to the sample library, a “source-net-load” integrated simulation model is constructed in Simulink. Then, the three-phase voltage unbalance evaluation model of the power system is constructed in combination with relevant standards. Finally, the optimal wiring scheme is selected by using the evaluation model and the simulated voltage unbalance index.