Safety is a significant indicator of the cascade storage power station operation, accurate State of Charge (SOC) estimation can help people formulate reasonable charging and discharging strategies, which is crucial to ensure the safe operation of lithium batteries and prevent lithium batteries from overcharging and overdischarging. To address the problem of the accuracy of the extended Kalman filter (EKF) algorithm being easily affected by complex conditions with fixed parameters, this paper proposes PID-EKF algorithm to improve the prediction accuracy and robustness of the algorithm. Taking lithium iron phosphate battery as an example, the error of actual terminal voltage measurement covariance and theoretical covariance is taken as PID input, and the system measurement noise covariance of EKF is taken as output. The Kalman gain of the algorithm in the iteration process is adjusted by optimizing the measurement noise in real time to achieve the adaptive optimization control of the algorithm. The experimental results show that compared with the traditional extended Kalman filtering (EKF) method, the PID-EKF algorithm can better improve the SOC prediction accuracy, significantly improve the robustness of the algorithm, and be more practical in SOC online estimation.