Currently, Data series forecasting and anomaly detection methods are mostly off-line and no dynamic prediction function, which is quite detrimental to the data series real-time processing. This paper studies the online least squares support vector machine algorithm, based on its sub-block matrix inversion principle, guarantees the data stream processing speed, but also to meet the data sequence stability on-line prediction requirements, at the same time, At the same time, based on the original algorithm on the increase in threshold judgment link, using a type of membership degree method for anomaly judgment, making online least squares support vector machine algorithm can detect abnormal data stream effectively. The simulation results show the effectiveness of online least squares support vector machine algorithm for online prediction and anomaly detection application.