With widespread use in areas such as electric vehicles and portable electronic devices, lithium-ion batteries are favored for their high energy density and long cycle life. However, accurate prediction of battery life remains a challenging issue and is critical to the effective management and use of these energy storage devices. Battery degradation phenomena can lead to performance degradation, which in turn negatively impacts battery applications. Traditional research methods are often limited by time and resource constraints, making it difficult to conduct long-term life prediction studies. To overcome these problems, this paper proposes an optimization method based on Particle Swarm Optimization and Simulated Annealing algorithms. The method aims to search for the optimal parameter combinations by the SA algorithm and further finetune the parameters by the PSO algorithm to optimize the Least Squares Support Vector Machine (LS-SVM) model and achieve more accurate battery life prediction. The experimental results, based on real battery aging data sets, show that the proposed hybrid optimization method outperforms the traditional optimization method and the independent LS-SVM model in terms of accuracy and robustness. The method can be applied to a variety of Li-ion battery systems and provides a valuable tool for battery management and decision making. Future work will further validate the proposed method on a larger dataset and integrate it with a real-time battery monitoring system for online lifetime prediction.