With the rapid development of electric vehicles, the infrastructure for charging stations is also expanding quickly, and the failure rate of charging piles is increasing. To address the effective operation and maintenance of charging stations, a method based on the XGBoost algorithm for electric vehicle DC charging stations is proposed. An operation and maintenance system is constructed based on state analysis, considering the operational status of the charging stations and users’ charging habits. Factors such as driving and charging habits, road traffic, and charging station equipment are taken into account. The training sample data are established using historical data, online monitoring data, and external environmental data, and the charging station status evaluation model is trained using the XGBoost algorithm. Based on the condition assessment results, a risk assessment model is established in combination with fault parameters. Risk tracking of the charging stations is conducted using the energy not charged (ENC), evaluating the risk level of each station and determining the operation and maintenance order. The optimal operation and maintenance model for DC charging stations, aimed at achieving both economic and reliability goals, is constructed to determine the operation and maintenance schedule for each station. The results of the case study demonstrate that the state evaluation and operation and maintenance strategy can significantly improve the reliability of the system and the overall benefits of operation and maintenance while meeting the required standards.