The battery failure diagnosis methods are the main algorithms for online battery management system, but the conventional methods are mainly developed from calibrated thresholds detection, which will suffer from the degradation for full-lifespan operation and have no consideration of utilization for battery system information. Here we show innovative diagnosis methods for detecting battery failure both from online battery management system and cloud monitoring platform based on a particle swarm optimization-simulated annealing- density based spatial clustering of applications with noise (PSO-SA-DBSCAN) algorithm. By using the battery electrochemical impedance spectroscopy and voltage, the proposed method can solve the problem of battery abnormal degradation diagnosis, thermal runaway diagnosis and sampling failure diagnosis. Compared against conventional methods, the proposed method has less reliance on parameterization with better precision, which is validated from commercial prismatic cells and cloud data from a 117 serial-cell pack, with high accuracy and lower misinformation compared against conventional detecting methods, confirming the actual effectiveness for online battery pack.