Abstract:This paper designs a data-driven smooth switching control algorithm for off-grid/grid-connected modes of photovoltaic-storage-charging stations. The algorithm first integrates multi-source operational data to construct a feature system of system operating status, and uses a grid status identification model to achieve early prediction of anomalies. Secondly, it synchronously references four types of parameters—energy storage SOC, photovoltaic output power, charging load, and grid quality—to establish a dynamic switching decision mechanism. Finally, in the mode switching stage, it integrates three types of technologies—virtual synchronous machine control, PCS power gradient control, and STS synchronous reclosing control—to achieve seamless transition between off-grid and grid-connected modes. Test results show that the algorithm can control the system switching time within 20 ms, reduce voltage fluctuation amplitude by approximately 40%, stabilize frequency deviation within ±0.2 Hz, and increase SOC utilization by approximately 18%. The power supply continuity and system operational stability of photovoltaic-storage-charging stations are effectively optimized.