With the swift progression of industrial automation and Internet of Things technologies, the importance of multivariate time series anomaly detection has markedly increased, serving as a vital tool for identifying abnormal behaviors within complex datasets to prevent potential risks. Traditional anomaly detection methods often struggle to deal with multivariable and unlabeled data environments, especially in the context of real-time dynamic data streams, where traditional models require frequent retraining to adapt to new anomaly patterns. To address this challenge, our work proposes an online anomaly detection model for multivariate time series based on a contrastive learning framework:ODAnomaly, utilizing a dual autocorrelation mechanism to effectively extract features of normal data and distinguish anomalous data. The model features an online learner that uses gradient updates and Pearson correlation coefficients to rapidly adapt to new anomaly patterns, boosting its real-time learning efficiency. A contrastive loss function, informed by homoscedastic uncertainty, aids in anomaly detection through data representation. This approach reduces reliance on extensively labeled data and enhances the model's adaptability and accuracy in real-time data streams. It provides an efficient and cost-effective solution for advancing multivariate time series anomaly detection in both research and practical applications.