Lithium-ion batteries serve as critical energy storage devices and are extensively utilized across diverse applications. The accurate estimation of State of Charge (SOC) is critically important for Battery Management Systems. Traditional SOC estimation methods have achieved progress, such as the Extended Kalman Filter (EKF) and particle filter. However, when there exist uncertainties in battery model parameters and the parameters change dynamically with operating conditions, the EKF tends to produce accumulated errors, which leads to a decline in estimation accuracy. This paper proposes a hybrid approach integrating the EKF with a Hidden Markov Factor Graph (HMM-FG). First, this method uses the EKF to achieve a real-time estimation of the SOC. Then, it treats the EKF-estimated value as an observation through the HMM-FG and combines current and voltage measurement data. It also introduces a factor function to describe the temporal correlation of the SOC and the uncertainty of EKF modeling errors, thereby performing Maximum A Posteriori (MAP) estimation correction on the SOC. Different from the traditional EKF, this method can use future observation information to suppress the error accumulation of the EKF under dynamic parameter changes. Experiments were conducted under different temperatures (0 °C, 25 °C, 45 °C), and a variety of different dynamic operating conditions (FUDS, DST), and comparisons were made with the EKF, Extended Kalman Smoother (EKS), and data-driven method based on LSTM.