Cross-condition multivariate time series anomaly detection method based on phase-aware migration diffusion

By employing a stage-aware migration diffusion method, utilizing temporal local normalization and dynamic graph construction, and combining image variational autoencoders and stage encoders, the problem of multivariate temporal anomaly detection in cross-operating condition migration diffusion is solved. This method achieves dynamic graph construction of complex spatiotemporal dependencies between variables, addresses the stability and accuracy issues of cross-operating condition migration adaptation in existing technologies, and improves the anomaly detection capability of industrial equipment.

CN121980476BActive Publication Date: 2026-07-10HUAQIAO UNIVERSITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAQIAO UNIVERSITY
Filing Date
2026-04-07
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing industrial multivariate time-series anomaly detection methods struggle to effectively characterize the complex spatiotemporal dependencies between variables when dealing with industrial equipment monitoring data that is high-dimensional, strongly coupled, non-stationary, and multi-condition. Furthermore, they are prone to false alarms during cross-condition migration and are difficult to achieve stable and effective adaptation under limited sample conditions.

Method used

A phase-aware transfer diffusion approach is adopted, which constructs a cross-operating condition anomaly detection model by combining temporal local standardization, dynamic graph construction and spatiotemporal joint feature extraction, graph variational autoencoder and phase encoder. The model utilizes phase conditional diffusion and a phased normal prototype library to achieve cross-operating condition transfer adaptation under conditions with few samples.

Benefits of technology

It improves the accuracy and robustness of anomaly detection for industrial equipment under various operating conditions, reduces false alarms during mode switching, and enhances the adaptability of the model at different operating stages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121980476B_ABST
    Figure CN121980476B_ABST
Patent Text Reader

Abstract

The application provides a cross-condition multivariate time series anomaly detection method based on phase-aware transfer diffusion, comprising: obtaining historical monitoring multivariate time series data, preprocessing and cutting to obtain a source domain training sample set, a target domain adaptation sample set and a to-be-detected sample set; performing time local standardization on each sample set, combining BallTree to construct a dynamic graph structure, performing spatial neighborhood weighted standardization, using a time convolution network and a graph attention network to extract spatio-temporal joint features; training a graph variational autoencoder and a phase encoder to obtain a phase probability representation; using a phase conditional diffusion model to train a source domain pre-training model, constructing a phased normal prototype library and a source domain prior threshold; performing cross-condition transfer adaptation through phase-aware statistical alignment, prototype-driven constraint and parameter efficient fine-tuning to obtain a final detection model and output a detection result. The method realizes stable cross-condition anomaly detection under a few sample conditions, and improves the accuracy and robustness of detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of anomaly detection technology, specifically to a cross-condition multivariate time-series anomaly detection method based on stage-aware migration and diffusion. Background Technology

[0002] As industrial equipment becomes larger, more complex, and more intelligent, the demands for real-time monitoring and reliability of equipment operation are increasing in manufacturing, energy, process industries, and intelligent operation and maintenance. During long-term operation, industrial equipment is susceptible to performance degradation, operational anomalies, and even shutdowns due to various factors such as mechanical wear, environmental interference, load fluctuations, component aging, and switching operating conditions. In severe cases, this can lead to safety accidents or significant economic losses. Therefore, multi-sensor monitoring systems are widely deployed in industrial settings to continuously collect data from various sensors, including temperature, pressure, flow rate, and vibration, generating massive amounts of multivariate time-series data. This provides the foundation for data-driven anomaly detection.

[0003] In the field of industrial multivariate temporal anomaly detection, existing methods are mainly divided into three categories: supervised methods, unsupervised methods, and semi-supervised or hybrid methods. Supervised methods rely on a large number of high-quality labeled samples to achieve anomaly identification through classification or regression models. However, in real-world industrial scenarios, anomaly samples are scarce and labeling costs are high, making it difficult to meet the training requirements of supervised learning. Unsupervised methods typically only use normal data for distribution modeling and identify anomalies through reconstruction error or density estimation, avoiding the labeling dependency problem. However, their ability to represent normal patterns directly affects detection performance. Semi-supervised or hybrid methods attempt to balance the ability to identify known anomalies and discover unknown anomalies, striving to improve generalization performance with limited supervised information.

[0004] However, existing technologies still have significant shortcomings in multivariate temporal anomaly detection scenarios for industrial equipment. First, industrial multivariate monitoring data is characterized by high dimensionality, strong coupling, non-stationarity, and multiple operating conditions. Anomalies often manifest not only as single-variable amplitude exceeding limits but also as changes in the correlation structure between variables and dynamic response patterns. Traditional methods typically struggle to simultaneously characterize the complex spatiotemporal dependencies between variables and the normal multimodal structure under different operating stages, easily leading to false alarms during normal mode switching. Second, in practical deployments, models often need to migrate from source operating conditions to target operating conditions. Distribution shifts are common between the source and target domains, and the target domain usually only has a small number of normal samples available. Existing methods struggle to achieve stable and effective cross-operating condition adaptation under limited sample conditions. Furthermore, existing methods often rely on single reconstruction errors and fixed thresholds for anomaly detection, failing to fully utilize reconstruction uncertainty information and adapting to differences in normal sample error distributions under different operating stages. Consequently, the accuracy, robustness, and practicality of anomaly detection still require improvement.

[0005] In view of the above, this application is hereby submitted. Summary of the Invention

[0006] This invention provides a method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion, which can at least partially improve the above-mentioned problems.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A multivariate time-series anomaly detection method based on stage-aware migration and diffusion across operating conditions, comprising:

[0009] Acquire historical monitoring multivariate time series data collected by a preset sensor group, and perform data preprocessing and segmentation on the historical monitoring multivariate time series data in sequence to obtain source domain training window sample set, target domain adaptation window sample set and target domain detection window sample set;

[0010] Temporal local normalization is performed on the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set to obtain the temporally normalized window data corresponding to each sample set.

[0011] Based on the time-normalized window data corresponding to each sample set, k-nearest neighbor search is performed using the BallTree data structure to construct a dynamic graph structure corresponding to the window samples of each sample set.

[0012] Based on the dynamic graph structure, the time-normalized window data corresponding to each sample set is spatially neighborhood-weighted normalized, and combined with the preset temporal convolutional network and graph attention network, spatiotemporal joint feature extraction is performed to obtain the window-level spatiotemporal feature representation corresponding to each sample set.

[0013] The graph variational autoencoder and the stage encoder are trained using the window-level spatiotemporal feature representation of the source domain training window sample set. The window-level spatiotemporal feature representation corresponding to each sample set is then input into the trained graph variational autoencoder and the stage encoder in sequence to obtain the latent variable representation and stage probability representation corresponding to each sample set.

[0014] The latent variable representation and stage probability representation corresponding to the source domain training window sample set are used to train the stage conditional diffusion model to obtain the source domain pre-trained anomaly detection model, and a staged normal prototype library and source domain prior threshold are constructed.

[0015] The target domain adaptation window sample set is input into the source domain pre-trained anomaly detection model, and cross-working condition transfer adaptation is performed through stage-aware statistical alignment, prototype-driven constraints and efficient parameter fine-tuning to obtain the final anomaly detection model.

[0016] The time series data to be detected is obtained and input into the final anomaly detection model to obtain the anomaly detection results.

[0017] In summary, this invention improves the representation of normal modes in different operating stages and reduces false alarms during mode switching by employing temporal local standardization, dynamic graph construction, and spatiotemporal joint feature extraction, and introducing stage-based conditional diffusion reconstruction, a staged normal prototype library, and a staged threshold mechanism. Furthermore, through stage-aware statistical alignment, prototype-driven constraints, and efficient parameter fine-tuning, it achieves cross-condition migration and adaptation under limited sample conditions. Compared with existing technologies, this invention offers the following advantages: It effectively improves the accuracy, robustness, and adaptability of anomaly detection in industrial equipment under multi-condition scenarios, even in the absence of anomaly labels. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the process for cross-condition multivariate temporal anomaly detection based on stage-aware migration diffusion provided in the first embodiment of the present invention.

[0019] Figure 2 This is a training and testing framework diagram for cross-condition multivariate temporal anomaly detection based on stage-aware migration diffusion provided in the first embodiment of the present invention.

[0020] Figure 3 This is a flowchart of the cross-condition multivariate temporal anomaly detection based on stage-aware migration diffusion provided in the first embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] refer to Figure 1 As shown in Figure 3, the first embodiment of the present invention discloses a method for detecting multivariate time-series anomalies across operating conditions based on stage-aware migration and diffusion. This method can be executed by a multivariate time-series anomaly detection device based on stage-aware migration and diffusion (hereinafter referred to as the detection device), specifically by one or more processors within the detection device, to implement the following method:

[0023] S1, acquire historical monitoring multivariate time series data collected by the preset sensor group, perform data preprocessing and segmentation on the historical monitoring multivariate time series data in sequence, and obtain source domain training window sample set, target domain adaptation window sample set and target domain detection window sample set;

[0024] Specifically, step S1 further includes: acquiring historical monitoring multivariate time series data of industrial equipment under source domain and target domain operating conditions collected by a preset sensor group. , , ,in, In the first The state observation vector at each sampling time point is jointly collected by N sensors, where T is the total length of the time series. This is a univariate time series acquired by the first sensor. This is a univariate time series acquired by the second sensor. For the univariate time series collected by the i-th sensor, Let N be a real number, and let N be the number of sensors. For the i-th sensor at the th The observations collected at each sampling time;

[0025] The historical monitoring multivariate time series data were divided into source domain raw sequences according to the operating conditions. and the original sequence of the target domain , The length of the original sequence in the source domain. The length of the original sequence in the target domain;

[0026] Data preprocessing is performed on the original source domain sequence and the original target domain sequence, wherein the data preprocessing includes timestamp alignment, resampling, missing value detection, completion, deduplication, and sensor channel validity screening.

[0027] The preprocessed source domain original sequence and target domain original sequence are segmented using a sliding window method to obtain the source domain window sample set. and target domain window sample set The mathematical expressions for the two techniques can be written as follows: , , The number of samples in the source domain window. The number of samples in the target domain window. For the w-th source domain window sample, This is the w-th target domain window sample.

[0028] The normal window samples in the source domain window sample set are used as source domain training window samples to obtain the source domain training window sample set. A portion of the normal window samples in the target domain window sample set are used as target domain adaptation window samples. The remaining normal window samples and abnormal window samples in the target domain window sample set are used as target domain detection window samples to obtain the target domain adaptation window sample set and the target domain detection window sample set.

[0029] In this embodiment, since each sensor forms a multivariate observation sequence arranged in chronological order during continuous sampling, it constitutes the original multivariate time series dataset, thus obtaining historical monitoring multivariate time series data. Subsequently, the historical monitoring multivariate time series data is divided into source domain data and target domain data according to the source of the operating conditions. The source domain data is used for pre-training of the anomaly detection model, while the target domain data is used for few-shot transfer learning and subsequent anomaly detection.

[0030] Before performing sliding window segmentation, data preprocessing operations are performed on the original sequences of the source and target domains. Specifically, the timestamps of each sensor channel are aligned according to a unified time axis; for sensor data with inconsistent sampling frequencies, all sensor sequences are resampled according to a preset unified sampling frequency to obtain multivariate time series with consistent time intervals. Subsequently, missing value detection is performed on the resampled data; when a sensor observation is missing at a certain moment, linear interpolation is used to fill it in; when the missing position is located at the beginning or end of the sequence and two-sided linear interpolation cannot be performed, forward padding or backward padding is used to fill it in, respectively.

[0031] After completing the missing value completion, duplicate sampling points in the sequence are deduplicated. If multiple sampling values ​​exist for the same timestamp, the first valid sampling value under that timestamp is retained, and the remaining duplicate records are deleted. Next, each sensor channel is screened for validity: if a sensor channel continuously outputs a constant value within a preset detection interval, and its variance is below a preset threshold, the channel is determined to be invalid and removed from the current multivariate time series. Let the number of valid variables after removing invalid channels be... Then, the preprocessed source domain sequence and target domain sequence can be obtained.

[0032] Furthermore, the preprocessed source and target domain sequences are segmented using a sliding window method; the window length is set to W, and the sliding step size is... From the preprocessed multivariate time series, local subsequences of length W are sequentially extracted to form window samples. In simple terms, the unified formula for segmentation can be expressed as: In this formula Let u represent the u-th window sample corresponding to any starting time u; that is, when the input data is a source domain sequence. This represents a window sample of the source domain sequence; when the input data is the target domain sequence, This represents a window sample of the target domain sequence. M represents the total number of windows obtained by the sliding window division, which satisfies: .

[0033] Based on this formula, the preprocessed source domain sequence and target domain sequence are processed separately to obtain the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set. Specifically, the normal window samples in the source domain window sample set are used as source domain training window samples for source domain pre-training; a small number of normal window samples in the target domain window sample set are used as target domain adaptation window samples for target domain few-sample transfer adaptation; and the window samples in the target domain window sample set used for actual discrimination are used as target domain detection window samples, which are used as input to the target domain anomaly detection model after transfer adaptation and output anomaly detection results.

[0034] S2, perform temporal local normalization on the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set to obtain the temporally normalized window data corresponding to each sample set;

[0035] Specifically, step S2 further includes: splitting the window samples of the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set according to the dimension of the univariate time series, and obtaining the observation value corresponding to each window sample;

[0036] Based on the observations corresponding to each window sample, extract the window sample corresponding to the i-th sensor. As an object of time-local normalization, its formula is: W is the window length, and V is the number of time points obtained after segmenting the univariate time series according to the window length W. Let be the observation value of the univariate time series of the i-th sensor at the first split time within the current window. This represents the observation value of the univariate time series from the second sensor at the second split point within the current window. For the univariate time series of the i-th sensor, the observation value at the t-th segmentation time within the current window;

[0037] The local mean of the window sample corresponding to the i-th sensor is obtained by recursively calculating the exponential moving average method. and local variance Its formula is as follows: , , , The smoothing coefficient is used to control the weight of the influence of historical and current observations on local statistics.

[0038] Based on local mean and local variance The window samples corresponding to the i-th sensor are normalized time-by-time to obtain the time-normalized value of the i-th sensor at the t-th segmentation time. , It is a numerical stability constant greater than 0, used to avoid the denominator being zero or too small;

[0039] The time-normalized values ​​corresponding to all sensors are recombine in their original time order to obtain time-normalized window data for each sample set. The formula for the time-normalized window data is as follows: , The effective number of sensors, For the first The time-normalized value of a sensor at the t-th segmentation time.

[0040] In this embodiment, all of the above-mentioned window samples (i.e., source domain training window samples, target domain adaptation window samples, and target domain detection window samples) need to be processed sequentially according to the same temporal local standardization step process before being input into the subsequent dynamic graph construction and spatiotemporal feature extraction module.

[0041] Specifically, for each valid sensor variable and its corresponding univariate time series within the current window, the local mean and local variance of that variable at each time point are recursively calculated using an exponential moving average method. It should be noted that... , These represent the initial mean and initial variance, respectively, and are taken at the time of initialization: This completes the estimation of local statistics for each effective sensor variable within the current window. Subsequently, based on the local mean and local variance, each effective sensor variable in the window sample is normalized time-by-time to obtain time-standardized variable values. Through the above processing, the original observations are converted into standardized deviations relative to their local statistical background, thereby reducing the dimensional differences between different sensor variables.

[0042] The results of time-by-time normalization of each effective sensor variable are recombined according to the original time order and variable order to obtain time-standardized window data. Through the aforementioned local time standardization process, each sensor variable is centered and scale-normalized within its respective local time range, thereby suppressing the influence of dimensional differences between different variables, slow drift during operation, and local random noise on subsequent modeling.

[0043] S3. Based on the time-normalized window data corresponding to each sample set, k-nearest neighbor search is performed using the BallTree data structure to construct a dynamic graph structure corresponding to the window samples of each sample set.

[0044] Specifically, step S3 further includes: based on the time-standardized window data corresponding to each sample set, extracting the time-standardized sequence corresponding to the i-th sensor within the current window according to the dimension of univariate time series. ;

[0045] Based on time-normalized series Extract several statistical measures that reflect its local dynamic characteristics, specifically including: mean. Standard deviation Root mean square value Peak-to-peak value Trend coefficient , , This represents the average of the time indices within the window.

[0046] Combine all statistics to form the statistical feature vector of the graph node corresponding to the i-th sensor. , For transpose, For statistical feature dimension, ;

[0047] The statistical feature vectors of graph nodes corresponding to all valid sensors are summarized to obtain the statistical feature set of graph nodes corresponding to the current window sample. ;

[0048] Based on the statistical feature set of graph nodes Using the pre-defined BallTree data structure, a k-nearest neighbor search is performed on the point statistical feature vector to generate the k-nearest neighbor search results.

[0049] Based on the k-nearest neighbor search results, construct the adjacency matrix of the current window samples. , , Let k be the index set of the k nearest neighbor graph nodes corresponding to the i-th sensor. For graph node pairs Adjacency relationship;

[0050] Symmetric processing of the adjacency matrix yields an undirected dynamic graph structure. After determining the adjacency relationship, the edge weight is calculated based on the feature distance between the statistical feature vectors of the graph nodes. For nodes satisfying the following conditions... Graph node pairs Its edge weight is defined as , For graph node pairs Adjacency relationship, It is an exponential function. For the first The graph node and the first Feature distance between graph nodes For the first The graph node and the first Feature distance between graph nodes A scale parameter greater than 0, used to control the degree of distance attenuation;

[0051] For graph node pairs that do not satisfy the adjacency relationship, set their edge weights to 0 to obtain the edge weight matrix of the current window sample. ;

[0052] The adjacency matrix and edge weight matrix together form the dynamic graph structure corresponding to the current window sample. The above steps are repeated to obtain the dynamic graph structure corresponding to the window sample of each sample set.

[0053] Preferably, based on the statistical feature set of graph nodes Using a pre-defined BallTree data structure, a k-nearest neighbor search is performed on the statistical feature vectors of points to generate the k-nearest neighbor search results. Specifically, the statistical feature vectors of graph nodes are used as the basis for the search. As a query point, statistical feature set of graph nodes In the constructed feature space, the BallTree data structure is used to perform a k-nearest neighbor search on the statistical feature vectors of the remaining graph nodes to obtain the index set of the k nearest neighbor graph nodes that are closest to the graph node corresponding to the i-th sensor. k is the number of nearest neighbor node indices. Let be the first adjacent graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor. Let be the second adjacent graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor. The kth neighboring graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor;

[0054] Calculate the feature distance between the graph node corresponding to the i-th sensor and the graph node corresponding to the j-th sensor. , Let j be the statistical feature vector of the graph node corresponding to the j-th sensor. It is an L2 norm;

[0055] When judged When the graph node corresponding to the j-th sensor and the graph node corresponding to the i-th sensor have a local spatial relationship in the current window, it is determined that they are related.

[0056] Determine the feature distances between all graph nodes and generate the k-nearest neighbor search results.

[0057] In this embodiment, the time-normalized window numbers corresponding to the above-mentioned window samples (i.e., source domain training window samples, target domain adaptation window samples, and target domain detection window samples) all need to be constructed in sequence according to the same steps to form a dynamic graph structure.

[0058] Specifically, based on the time-standardized window data, the time series corresponding to each sensor within the current window is extracted according to the variable dimension. The standardized sequences corresponding to each variable are used as inputs for subsequent statistical feature extraction. Here, the variable refers to the univariate time series collected by the sensor. Subsequently, for the time-standardized sequence corresponding to each valid sensor variable in the current window sample, statistics reflecting its local dynamic characteristics are extracted, and the node statistical feature vector corresponding to the variable is constructed using the statistics.

[0059] In this embodiment, each valid sensor variable in the current window sample is considered a graph node. The statistical feature vectors of all valid sensor variables are aggregated to obtain the node statistical feature set corresponding to the current window sample. This set characterizes the distribution of each graph node in the statistical feature space under the current window and serves as input for subsequent k-nearest neighbor search using a BallTree. Specifically, based on this set, a k-nearest neighbor search is performed on the node statistical feature vectors corresponding to each graph node using the BallTree data structure to determine the local adjacency relationships between graph nodes in the current window sample. The local adjacency relationships between graph nodes in the current window sample can be determined from the set of nearest neighbor node indices corresponding to all graph nodes.

[0060] The feature distance between graph nodes is calculated. Based on the nearest neighbor relationships between the statistical feature vectors of each node in the node statistical feature set, a local dynamic graph adjacency relationship is established between the effective sensor variables in the current window sample, providing a foundation for the subsequent construction of the adjacency matrix and edge weight matrix. The adjacency matrix of the current window sample is constructed based on the k-nearest neighbor search results, and the edge weight matrix is ​​further calculated. According to the above formula, the smaller the feature distance between nodes, the larger the corresponding edge weight, indicating a stronger local correlation between the two nodes within the current window.

[0061] Finally, these two matrices together form the dynamic graph structure corresponding to the current window sample, which is used to characterize the local spatial correlation of each effective sensor variable under the current window, and serves as the structural input for subsequent spatial neighborhood weighted normalization and spatiotemporal joint feature extraction.

[0062] S4. Based on the dynamic graph structure, the time-normalized window data corresponding to each sample set is subjected to spatial neighborhood weighted normalization, and combined with the preset temporal convolutional network and graph attention network to extract spatiotemporal joint features, so as to obtain the window-level spatiotemporal feature representation corresponding to each sample set.

[0063] Specifically, step S4 further includes: based on the i-th sensor corresponding to the i-th sensor... The dynamic graph structure of each node determines its neighborhood set. And calculate the t-th time. The neighborhood weighted average of each graph node neighborhood weighted variance , For the j-th sensor, the j-th sensor is the j-th sensor. The time-normalized value of a graph node at time t within the window;

[0064] Based on the neighborhood-weighted mean and neighborhood-weighted variance, spatial neighborhood-weighted standardization is performed on the corresponding time-standardized window data. The spatial standardization result of the i-th sensor at time t is given by the following formula: ;

[0065] All spatial standardization results corresponding to each sample set are reorganized in their original chronological order to obtain spatially neighborhood-weighted standardized window data. , The window data of the spatial neighborhood of the i-th sensor at time t is the weighted and normalized window data.

[0066] Based on the window data after spatial neighborhood weighting and standardization, determine the univariate sequence corresponding to the i-th sensor. and univariate sequences The time-dependent features of the input sensor are extracted through multiple layers of causal convolution and dilated convolution to obtain the time feature vector corresponding to the i-th sensor. , This is the mapping function for temporal convolutional networks. The time feature dimension is as follows:

[0067] Let the first The input sequence of a multi-layered temporal convolutional network is represented as: , among which, when Sometimes, ;

[0068] No. The output of the dilated causal convolution of the layer can be represented as: ,in, Indicates the first The sensor at the first Layer, Time Output features at the location; Indicates the first kernel size; Indicates the first Layer expansion coefficient; Indicates the first Layer The weight parameters corresponding to each convolution position; Indicates the bias term; This represents a non-linear activation function.

[0069] go through After stacking layers of temporal convolutional networks, the first layer is obtained. High-level temporal feature sequences corresponding to each sensor: Furthermore, the high-level time feature sequences are aggregated to obtain the first... The time feature vectors corresponding to each sensor: .in, This indicates a sequence pooling operation, preferably global average pooling.

[0070] Therefore, the first The time feature vectors corresponding to each sensor can be uniformly represented as: ,in, This represents the mapping function of a temporal convolutional network consisting of multiple layers of causal convolution, dilated convolution, nonlinear activation, and convergence operations.

[0071] By summing up all the temporal feature vectors, we obtain the node-level temporal feature matrix of the current window sample. , For the first The time feature vector corresponding to each sensor;

[0072] The dynamic graph structure corresponding to the node-level time feature matrix is ​​input into a pre-defined graph attention network to model the spatial interaction relationships between univariate time series. This involves computing graph nodes... With graph nodes Attention relevance score , It is a linear rectified activation function. For attention parameter vectors, The characteristic linear transformation matrix, This is a vector concatenation operation. For the i-th sensor, the i-th... The time feature vector of each graph node For the j-th sensor, the corresponding to the j-th sensor is the j-th sensor. The time feature vector of each graph node;

[0073] By combining the dynamic graph structure to normalize the neighborhood attention coefficients, graph nodes are obtained. For graph nodes Normalized attention weights , For graph nodes With graph nodes Attention relevance score For graph node pairs The right of the border;

[0074] Based on normalized attention weights We perform weighted aggregation to obtain the node-level spatial interaction features corresponding to the i-th sensor. , It is a non-linear activation function;

[0075] A multi-head graph attention mechanism is employed to concatenate the node-level spatial interaction features output by multiple attention heads, resulting in a final node-level spatiotemporal joint feature representation. , For the first The node-level spatial interaction features corresponding to each sensor The spatiotemporal joint feature dimension at the node level;

[0076] The node-level spatiotemporal joint feature representations are aggregated to obtain the window-level spatiotemporal feature representations corresponding to the current window samples. , The preferred method is pooling; and the above steps are repeated to obtain the window-level spatiotemporal feature representations corresponding to the window samples of each sample set.

[0077] In this embodiment, all of the above-mentioned window samples (i.e., source domain training window samples, target domain adaptation window samples, and target domain detection window samples) need to be processed sequentially according to the same window-level spatiotemporal feature representation calculation steps.

[0078] Specifically, for any variable node, its neighborhood set is determined based on the adjacency relationships and edge weights obtained above. This involves calculating the neighborhood-weighted mean and neighborhood-weighted variance of the node, and then performing spatial neighborhood-weighted standardization on the time-standardized window data based on these two data points. This yields a window sample representation that simultaneously considers temporal local stability and spatial neighborhood consistency. Through this process, the observed values ​​of each variable node are standardized not only relative to its own temporal local statistical background but also re-standardized relative to its spatial neighborhood distribution within the current window, thereby suppressing the influence of isolated noise and local extrema on subsequent feature extraction.

[0079] The spatially neighborhood-weighted and standardized window data is input into a temporal convolutional network to extract temporal features of the dynamic evolution of each variable within the window, resulting in a node-level temporal dynamic feature representation. This node-level temporal dynamic feature representation, along with a dynamic graph structure, is then input into a graph attention network to model the spatial interactions between variables, yielding a node-level spatiotemporal joint feature representation. Subsequently, these node-level spatiotemporal joint feature representations are aggregated to obtain the window-level spatiotemporal feature representation corresponding to the current window sample, which is used as input for subsequent latent space modeling. This results in a window-level spatiotemporal feature representation that characterizes the overall operational state of the current window. This window-level spatiotemporal feature representation comprehensively reflects the temporal dynamic patterns of each variable within the window and their intervariate spatial interactions.

[0080] S5, use the window-level spatiotemporal feature representation of the source domain training window sample set to train the graph variational autoencoder and the stage encoder, and input the window-level spatiotemporal feature representation corresponding to each sample set into the trained graph variational autoencoder and the stage encoder in sequence to obtain the latent variable representation and stage probability representation corresponding to each sample set.

[0081] Specifically, step S5 further includes: representing the window-level spatiotemporal features corresponding to the source domain training window sample set. The input is fed into the encoding network of a preset graph variational autoencoder to obtain the mean vector of the corresponding latent variable posterior distribution. Sum of logarithmic variance vector , , For the mapping network used to generate the mean of latent variables, For the mapping network used to generate the log-variance of latent variables, For latent space dimension, It is the logarithmic variance vector;

[0082] Let prior noise satisfy This yields the training latent variable representations corresponding to the window samples in the source domain training window sample set. for: , For element-wise multiplication, It is a standard multivariate Gaussian distribution with zero mean and covariance matrix I.

[0083] Representing training latent variables The input is fed into the decoding network of the graph variational autoencoder to reconstruct the corresponding window-level spatiotemporal feature representation, thereby obtaining the reconstructed window-level spatiotemporal feature representation corresponding to the window samples of the source domain training window sample set. , For the decoding network of the graph variational autoencoder;

[0084] Training loss for constructing a graph variational autoencoder , And by minimizing the training loss The parameters of the encoding and decoding networks of the graph variational autoencoder are jointly and iteratively updated to obtain the trained graph variational autoencoder. , , To reconstruct the loss, The weight coefficients that minimize the training loss, For KL divergence loss, Kullback–Leibler divergence is used to measure the posterior distribution of latent variables learned by the encoder. Compared with the preset standard Gaussian prior distribution The differences between them The posterior distribution learned by the encoding network, It follows a standard Gaussian prior distribution;

[0085] The window-level spatiotemporal feature representation corresponding to the source domain training window sample set The input is fed into the encoding network of the trained graph variational autoencoder to obtain the corresponding latent variable representation. Summarize all latent variable representations To obtain the set of latent variables ;

[0086] Clustering is performed on the latent variable set to divide the distribution of window samples in the latent space of the source domain training window sample set into K clusters, thus obtaining the stage pseudo-labels corresponding to the source domain training window sample set. K represents the total number of stages;

[0087] Use the stage pseudo-labels corresponding to the source domain training window sample set. The predefined stage encoder is trained to obtain the stage probability representation corresponding to the source domain training window sample set, where the latent variables are represented... The input stage encoder yields the stage probability vectors corresponding to the source domain training window sample set (i.e., the predicted probability vectors of the window samples at each stage). , , For normalized exponential functions, For stage encoders, The window samples of the source domain training window sample set are in the th... The probability of each stage;

[0088] The stage pseudo-labels corresponding to the source domain training window sample set As supervisory information, the encoder training loss during the construction phase , For indicator functions, The number of window samples in the source domain training window sample set is determined by minimizing the stage encoder training loss. The parameters of the stage encoder are iteratively updated to obtain the trained stage encoder.

[0089] The target domain adaptation window sample set and the target domain detection window sample set are sequentially input into the encoding network of the trained graph variational autoencoder. The latent variable representations corresponding to each sample set are extracted, and the latent variable representations corresponding to each sample set are sequentially input into the trained stage encoder to obtain the stage probability representations corresponding to each sample set.

[0090] In this embodiment, the window-level spatiotemporal feature representations corresponding to normal window samples in the source domain training window samples are input into the encoding network of the graph variational autoencoder, which outputs the mean vector and log-variance vector of the latent variable posterior distribution, respectively. Thus, the encoding network learns the corresponding latent variable posterior distribution parameters for each input window sample, which characterize the probability distribution position of that window sample in the latent space. Next, based on the latent variable posterior distribution parameters, the latent variables of this window sample are sampled using a reparameterization method to obtain the latent space representation corresponding to the window sample; these latent variable representations are used to characterize the overall spatiotemporal operating state corresponding to the current window sample.

[0091] The latent variable representation of the source domain is input into the decoding network of the graph variational autoencoder (GVA), reconstructing the window-level spatiotemporal feature representation of the input. The GVA is then trained using a combination of reconstruction loss and KL divergence loss to learn the continuous distribution structure of normal window samples in the latent space. By minimizing the training loss of the GVA, the parameters of the encoding and decoding networks are jointly and iteratively updated, ensuring that the normal window samples from the source domain form a smooth, continuous, and separable latent representation structure in the latent space. After training the GVA, the trained encoding network parameters are fixed, and this network is used again to forward encode the normal window samples from the source domain, extracting their stable latent variable representations as input for subsequent clustering stages.

[0092] After training the graph variational autoencoder, the latent variable representations corresponding to normal window samples in the source domain training window samples are extracted using the trained encoding network, and then clustered to generate stage pseudo-labels. K-means clustering is preferred for this clustering process, and its optimization objective is expressed as: , Let represent the k-th cluster center. Through the above clustering process, the multimodal distribution of normal window samples from the source domain in the latent space is divided into multiple stages, and the obtained stage pseudo-labels are... As a supervision signal for encoder training in subsequent stages.

[0093] The stage encoder is trained using stage pseudo-labels, and the stage probability representation corresponding to the window samples is output. The predicted probability vector mentioned above is the stage probability representation, used to characterize the soft assignment result of the window samples to the normal patterns of each stage. This stage probability representation will be used as stage conditional input in subsequent steps for latent space conditional diffusion modeling, staged prototype library construction, and staged threshold estimation.

[0094] Finally, the stage pseudo-labels generated by clustering are used as supervision information to construct the stage encoder training loss; and the stage encoder parameters are iteratively updated by minimizing the stage encoder training loss so that it can output the corresponding stage probability representation based on the latent variable representation of the window samples.

[0095] After the stage encoder is trained, for the target domain adaptation window samples and the target domain detection window samples, the latent variable representations are first extracted using the trained graph variational autoencoder network, and then input into the trained stage encoder to obtain their corresponding stage probability representations, which are used for subsequent cross-condition transfer adaptation and anomaly detection.

[0096] S6. The latent variable representation and stage probability representation corresponding to the source domain training window sample set are used to train the stage conditional diffusion model to obtain the source domain pre-trained anomaly detection model, and a staged normal prototype library and source domain prior threshold are constructed.

[0097] Specifically, step S6 further includes: converting the stage probability vector corresponding to the source domain training window sample set. As a conditional control signal, it is embedded in a preset mapping module to obtain stage condition embedding. , For conditional embedding mapping functions, For conditional embedding dimensions;

[0098] Representing latent variables as initial latent variables Set the total number of diffusion steps to The noise scheduling sequence is A forward diffusion noise-adding process is performed in the latent space to obtain noisy latent variables at different diffusion times. Each diffusion step satisfies the following conditions: , For the first The noise intensity injected into the latent variable by each diffusion step, wherein, as the number of diffusion steps increases, the original structural information in the latent variable representation is gradually disturbed by random noise;

[0099] Among them, setting , , For the first The proportion of the original signal retained after each diffusion step From the first diffusion step to the second The proportion of the original signal retained after each diffusion step;

[0100] In the At each diffusion step, the initial latent variable Corresponding noisy latent variables The formula is: , , For random noise that follows a standard Gaussian distribution;

[0101] Regarding the first Number of diffusion steps to reduce noisy latent variables Diffusion time encoding and stage condition embedding A common input diffusion denoising network is used to obtain the network's prediction results for the noise term. , For parameters diffusion denoising network;

[0102] Calculate the prediction results With real random noise The differences between them are used to construct a diffusion denoising loss function. , Furthermore, by minimizing the diffusion denoising loss, the parameters of the diffusion denoising network are iteratively updated to obtain the trained stage conditional diffusion model and the source domain pre-trained anomaly detection model.

[0103] Based on the stage pseudo-labels corresponding to the source domain training window sample set The source domain training window sample set is divided into parts to obtain... The normal latent variable subset corresponding to each stage and for the normal latent variable subset Clustering is performed to obtain Prototype set under stage , For the first The m-th normal prototype center in each stage This represents the number of prototypes in this stage.

[0104] The prototype sets corresponding to all stages are aggregated to form a phased normal prototype library. ;

[0105] Representing latent variables and stage condition embedding Inputting the pre-trained staged conditional diffusion model, J independent backsampling operations are performed on the window samples of each source domain training window sample set to obtain J sets of reconstruction results, which are represented as follows: , This is the reconstruction result for group 1. This is the reconstruction result for the second group. This is the reconstruction result for group J;

[0106] The reconstruction error between each set of reconstruction results and the original latent variable representations is calculated using the following formula: , For the reconstruction error of group l, For the reconstruction results of the l-th group, calculate the average reconstruction error of the samples in that window. and restructuring uncertainty Construct the anomaly score for the samples in this window. , These are the weighting coefficients for the average reconstruction error. The weighting coefficient for outlier scores;

[0107] According to the stage pseudo-label All anomaly scores corresponding to the source domain training window sample set are divided into stages to obtain... Set of abnormal scores for normal samples under each stage And according to the preset quantiles ,calculate The source domain prior thresholds corresponding to each stage This yields the set of source domain prior thresholds for all stages. .

[0108] In this embodiment, the stage probability representation corresponding to the normal window sample in the source domain is first used as a conditional control signal to perform soft characterization of the stage to which the current window sample is located. Specifically, stage conditional embedding maps the probability information of the stage to which the window sample belongs to a continuous conditional vector that can be received by the diffusion denoising network. Since the stage probability representation reflects the soft assignment result of the sample to each stage, rather than a single hard label, the stage conditional embedding can more precisely characterize the transition state of the sample between normal modes in different stages, thereby providing explicit stage constraints for subsequent latent space diffusion modeling.

[0109] Secondly, the latent variables corresponding to the normal window samples in the source domain are used as initial latent variables. A forward diffusion noise-adding process is performed in the latent space to obtain noisy latent variables at different diffusion times. At the diffusion time... (i.e., the first) When the number of diffusion steps is 1, the noisy latent variable is obtained by a linear combination of two parts: one part is the original latent variable retained proportionally, and the other part is Gaussian noise added proportionally. When When smaller, Larger latent variables still retain more original normal structural information; when As it gradually increases, As the number of latent variables gradually decreases, the noise component in the latent variables increases, and the original structural information is gradually submerged.

[0110] Through the aforementioned forward diffusion process, the latent variables corresponding to the normal window samples in the source domain are gradually perturbed in the latent space, thereby providing training samples for the subsequent training of the diffusion denoising network to learn how to recover normal latent variables under given stage conditions. This embodiment chooses to perform diffusion denoising in the latent space rather than the original data space. This reduces the dimensionality complexity of diffusion modeling and utilizes the compact latent variable representation learned by the aforementioned graph variational autoencoder, improving the stability and efficiency of subsequent reconstruction learning.

[0111] Next, the noisy latent variables, diffusion time information, and stage conditional embeddings are jointly input into the diffusion denoising network to learn the latent space denoising trajectory of normal window samples in the source domain under different stages, thus obtaining the stage-conditional diffusion model. The parameters of the diffusion denoising network are iteratively updated by minimizing the diffusion denoising loss. Since the diffusion denoising network receives stage conditional embeddings simultaneously at its input, the model does not learn a uniform denoising distribution for all normal samples during training; instead, it learns the denoising trajectory of normal latent variables under given stage conditions. Normal latent variables corresponding to different stages will form different conditional generation paths within the same diffusion framework, enabling the model to distinguish between normal stage transitions and truly abnormal deviations. After training, the diffusion denoising network constitutes the stage-conditional diffusion model, used for subsequent target domain adaptation and conditional backdiffusion reconstruction of the samples to be detected.

[0112] Based on the latent variable representation and stage partitioning results of normal window samples in the source domain, a staged normal prototype library is constructed to characterize the normal multimodal structure within different stages. The stage partitioning results are obtained from the stage label results output by the stage encoder. Since normal samples within the same stage may still exhibit multiple local sub-modes, this embodiment further performs clustering processing within each stage to extract multiple normal prototype centers. For the... Clustering is performed on the normal latent variable subsets of each stage to obtain the prototype set for that stage. Further, the prototype sets corresponding to all stages are aggregated to form a staged normal prototype library. This staged normal prototype library is used to characterize the multimodal latent space distribution structure of normal samples in the source domain at different stages, and will serve as a reference constraint for maintaining the normal structure during subsequent target domain migration and adaptation.

[0113] Finally, based on the normal window samples in the source domain training window, conditional backdiffusion reconstruction is performed using the trained staged conditional diffusion model to statistically analyze the abnormal score distribution of normal samples at each stage and estimate the staged prior thresholds. The resulting source domain prior threshold set is used to characterize the prior upper bound of the abnormal score distribution of normal samples in the source domain at different stages, serving as an initialization reference for subsequent target domain threshold calibration.

[0114] S7. Input the target domain adaptation window sample set into the source domain pre-trained anomaly detection model, and perform cross-working condition transfer adaptation processing through stage-aware statistical alignment, prototype-driven constraints and efficient parameter fine-tuning to obtain the final anomaly detection model.

[0115] Specifically, step S7 further includes: freezing the encoding backbone parameters in the source domain pre-trained anomaly detection model, and updating only the low-rank adaptation parameters and some normalization layer parameters in the diffusion denoising network. The source domain pre-trained anomaly detection model includes a trained temporal local normalization module, a dynamic graph construction module, a spatial neighborhood weighted normalization module, a spatiotemporal joint feature extraction module, a graph variational autoencoder, and a stage encoder.

[0116] The window samples in the target domain adaptation window sample set are in the first... The probability of each stage The latent variable representation corresponding to the window samples in the target domain adaptation window sample set. Calculate the weighted mean of the target domain at this stage. and weighted covariance matrix I is the identity matrix. The number of normal window samples for the target domain participating in the adaptation;

[0117] Based on the window samples of the source domain training window sample set, in the... The probability of each stage The latent variable representation corresponding to the window samples in the source domain training window sample set. Calculate the weighted mean of the source domain at this stage. and weighted covariance matrix ;

[0118] By comparing the differences in mean and covariance between the source and target domains at each stage, a stage-aware statistical alignment loss is constructed. , For the first Weighting coefficients for each stage It is the Frobenius norm;

[0119] Prototype-driven constraints are applied to window samples in the target domain adaptation window sample set based on the phased normal prototype library. While completing the stage-level statistical alignment, the stability of the multimodal structure within the stage of the target domain normal samples during the adaptation process is maintained.

[0120] The stage-specific conditional diffusion denoising network is conditionally fine-tuned using a target domain adaptation window sample set, and combined with the target domain diffusion denoising loss. Stage-aware statistical alignment loss and prototype-driven constraint loss Constructing the total loss for target domain adaptation , Denoising loss for diffusion in the target domain The weighting coefficients, Stage-aware statistical alignment loss The weighting coefficients, Prototype-driven constraint loss Weighting coefficients;

[0121] By minimizing the total loss of target domain adaptation, the parameters in the source domain pre-trained anomaly detection model are iteratively optimized to obtain the target domain anomaly detection model after transfer adaptation.

[0122] Multiple conditional diffusion backsampling reconstructions are performed using normal window samples from the target domain adaptation window sample set to obtain the abnormal score distribution of normal samples in the target domain. The target domain stage calibration threshold is calculated according to the stage division. The fusion stage threshold is then obtained by combining the source domain prior threshold and the target domain stage calibration threshold.

[0123] The sample set of the target domain to be detected window is input into the target domain anomaly detection model, and anomaly determination is performed in combination with the threshold of the fusion stage to obtain the test anomaly detection result; the test anomaly detection result is compared with the real anomaly label of the sample set of the target domain to be detected window to generate a comparison result;

[0124] When the comparison result reaches the preset index, the target domain anomaly detection model and its corresponding fusion stage threshold are used as the final anomaly detection scheme.

[0125] If the comparison result does not meet the preset index, return to the target domain migration and adaptation step, and re-perform parameter optimization, threshold calibration and result evaluation until the comparison result meets the preset index.

[0126] In this embodiment, the target domain adaptation window samples are sequentially input into the temporal local normalization module, dynamic graph construction module, spatial neighborhood weighted normalization module, spatiotemporal joint feature extraction module, graph variational autoencoder, and stage encoder in the source domain pre-trained anomaly detection model to obtain the target domain window samples and the stage probability representation. These steps have been explained above. The latent variable representation and stage probability representation are used to subsequently construct the stage-aware statistical alignment term, prototype constraint term, and conditional diffusion fine-tuning term.

[0127] Subsequently, the encoding backbone parameters in the source domain pre-trained anomaly detection model are frozen, and only the low-rank adaptation parameters and some normalization layer parameters in the diffusion denoising network are updated to achieve efficient parameter fine-tuning. During target domain adaptation, the parameters of the temporal local normalization module, dynamic graph construction module, spatial neighborhood weighted normalization module, temporal convolutional network, graph attention network, graph variational autoencoder, and stage encoder are kept constant; only the trainable low-rank incremental parameters and some normalization layer parameters in the stage conditional diffusion denoising network are optimized. For any linear transform layer in the diffusion denoising network, its adapted weights are expressed as: In this formula, W is the original weight matrix obtained from the source domain pre-training, and A and B are both low-rank adaptation matrices. This step optimizes only the low-rank increment term AB and some normalized layer parameters, without updating all backbone parameters. This reduces the parameter size, suppresses overfitting, and maintains the normal latent space structure and stage division ability learned by the source domain pre-trained model, given a limited sample size in the target domain.

[0128] Subsequently, based on the stage probability representation of the target domain adaptation window samples, weighted statistics for the target domain at each stage are calculated and aligned with the statistics of the corresponding stage in the source domain. This constructs a stage-aware statistical alignment loss to reduce the stage-level distribution shift between the source and target domains under cross-condition conditions. Through this stage-aware statistical alignment loss, the stage-level statistical distribution of normal samples in the latent space of the target domain is brought closer to the normal distribution of the corresponding stage in the source domain, thereby reducing the overall distribution shift caused by changes in operating conditions. The stage-aware statistical alignment primarily constrains the consistency of stage-level means and covariance. However, relying solely on statistical alignment may still lead to problems such as the internal structure of normal samples in the target domain being fragmented at a certain stage, multiple local modes overlapping, or mode collapse under low-sample conditions. Therefore, in addition to completing the stage-level statistical alignment constraints, prototype-driven constraints need to be further introduced to maintain the stability of the normal multimodal structure within each stage.

[0129] Next, using the aforementioned phased normal prototype library, prototype-driven constraints are applied to the target domain window samples to maintain the stability of the intra-phase multimodal structure of the target domain normal samples during the adaptation process, while completing phase-level statistical alignment. Specifically, for any target domain adaptation window sample... According to its stage probability representation Calculate the nearest prototype distance to each stage prototype set. Next, based on the stage probability representation, the nearest prototype distances for each stage are weighted to obtain the prototype constraint term corresponding to the sample. Sum the prototype constraint terms for all normal window samples in the target domain to construct the prototype-driven constraint loss. Through the prototype-driven constraints, the target domain normal samples maintain a multimodal structure consistent with the source domain normal samples within each stage of the migration adaptation process. Specifically, the prototype-driven constraints guide the target domain normal samples to move closer to the normal prototype neighborhood in the stage to which they belong with high probability, so that their latent variable representations fall near the normal sub-patterns already learned in the source domain. This prevents a small number of target domain normal samples from undergoing latent space drift due to sample scarcity during the adaptation process, and also prevents multiple normal sub-patterns within the same stage from being incorrectly compressed into a single pattern, resulting in pattern collapse.

[0130] In this embodiment, a small number of normal adaptation window samples from the target domain are used to fine-tune the stage-based conditional diffusion denoising network. The target domain diffusion denoising loss, stage-aware statistical alignment loss, and prototype-driven constraint loss are combined to construct the total target domain adaptation loss. Specifically, the latent variable representations of the normal adaptation window samples in the target domain, the corresponding time t, and the conditional embeddings generated from the stage probability representation are input into the diffusion denoising network to obtain the noise prediction results in the target domain. .

[0131] Furthermore, a diffusion denoising loss is constructed for the target domain: The target domain diffusion denoising loss is used to constrain the diffusion denoising network to learn the recovery law of normal latent variables under the target operating condition on a small number of normal samples in the target domain, enabling the model to reconstruct the trajectory of normal latent variables under the target domain conditions. The target domain adaptation total loss is used to uniformly characterize the following three optimization objectives during the target domain migration adaptation process: 1) the ability to reconstruct normal data in the target domain; 2) the ability to align distributions across operating condition stages; and 3) the ability to maintain normal structure within stages. These three aspects serve as the basis for parameter updates. By minimizing the target domain adaptation total loss, the aforementioned low-rank adaptation parameters and some normalization layer parameters are iteratively optimized, thereby enabling the stage-conditional diffusion denoising network to gradually adapt to the data distribution under the target domain operating condition while maintaining the normal latent space structure of the source domain, stage prior knowledge, and multimodal normal patterns.

[0132] In this embodiment, the target domain anomaly detection model needs to be detected using a sample set of the target domain's detection window to determine whether the model has been properly trained; that is, the target domain stage threshold calibration is completed based on a small number of normal window samples in the target domain and the prior threshold of the source domain. Specifically, after the efficient fine-tuning of parameters in the above steps, the parameters of the stage conditional diffusion denoising network in the source domain pre-trained anomaly detection model have been adapted and updated for the target domain conditions, while the temporal local normalization module, dynamic graph construction module, spatial neighborhood weighted normalization module, spatiotemporal joint feature extraction module, graph variational autoencoder, and stage encoder still retain the stable feature extraction and stage representation capabilities learned in the source domain pre-training stage.

[0133] Specifically, for the w-th normal window sample in the target domain, J independent conditional diffusion backsampling operations are performed to obtain J sets of reconstruction results. The reconstruction error, average reconstruction error, and reconstruction uncertainty for each operation are calculated to construct the anomaly score for the normal samples in the target domain. Based on the stage division results of the normal window samples in the target domain, the anomaly score is divided into stages to obtain the w-th normal window sample. The set of normal and abnormal scores for the target domain under each stage. The first stage is calculated based on preset quantiles. The target domain calibration thresholds corresponding to each stage are used to obtain the target domain stage threshold set. To improve the stability of threshold estimation in scenarios with few samples, the source domain prior thresholds and target domain calibration thresholds are weighted and fused to obtain the fused stage thresholds. , For threshold fusion weight coefficients, Indicates the first The source domain prior thresholds corresponding to each stage Indicates the first The target domain calibration thresholds corresponding to each stage; thus forming the fusion stage threshold set. Furthermore, the corresponding dynamic mixing threshold is obtained. ,in The window sample of the target domain detection window sample set is in the th... The probability of each stage. The dynamic mixing threshold and the target domain anomaly detection model after transfer adaptation together constitute the final detection model for the target domain operating conditions, which is used for anomaly determination of subsequent target domain samples in the detection window.

[0134] Finally, anomaly detection is completed by comparing the anomaly score of the sample in the detection window with the corresponding dynamic mixing threshold. When the anomaly score of the sample in the detection window is greater than the dynamic mixing threshold, it indicates that the model is inaccurate and needs to be trained further. In this way, anomaly detection for target domain conditions is achieved by utilizing the conditional diffusion reconstruction bias of the sample in the latent space and its corresponding stage-related dynamic mixing threshold.

[0135] Preferably, in this embodiment, the preset indicators include accuracy, precision, recall, F1 score, cross-condition performance improvement rate, and adaptation time. Specifically, the formula for calculating accuracy is: The formula for calculating precision is: The formula for calculating recall is: The formula for calculating the F1 score is: The formula for calculating the performance improvement rate PG across operating conditions is: The formula for calculating the adaptation time AT is: Wherein, TP represents the true positive count, which is the number of samples that are normal in both the actual situation and the test results; FP represents the false positive count, which is the number of samples that are abnormal in the actual situation but normal in the test results; TN represents the true negative count, which is the number of samples that are abnormal in both the actual situation and the test results; and FN represents the false negative count, which is the number of samples that are normal in the actual situation but abnormal in the test results. This represents the F1 score of the model on the target operating condition test set without target domain adaptation. This represents the F1 score of the model on the target operating condition test set after target domain transfer adaptation. This indicates that the adaptation time is long when there are few samples in the target domain.

[0136] When Accuracy is not lower than the first preset threshold, Precision is not lower than the second preset threshold, Recall is not lower than the third preset threshold, F1-score is not lower than the fourth preset threshold, PG is not lower than the fifth preset threshold and AT is not higher than the sixth preset threshold, the anomaly detection model is deemed to be qualified.

[0137] S8: Obtain the time series data to be detected, input the time series data to be detected into the final anomaly detection model, and obtain the anomaly detection result.

[0138] Specifically, in this embodiment, to further verify the effectiveness of the method, the SWaT (Secure Water Treatment) dataset, used for industrial control system security research, was selected as the research object. This dataset contains 51 dimensions and records 11 consecutive days of operational data from a secure water treatment system. The first 7 days represent normal operation data, while the last 4 days contain abnormal operation data including 36 typical attack scenarios. The data covers various sensor and actuator variables in the industrial control system, including liquid level, flow rate, pressure, conductivity, pH value, and state variables such as valves and pumps. The data is recorded in multivariate time series format with a sampling period of 1 second. Each record includes a timestamp and the measured and state values ​​of each variable at the corresponding time.

[0139] In the experimental setup, the data from the first 7 days of normal operation was used as the basic set of normal samples, and further divided into the source domain and the target domain in chronological order. Specifically, the data from the first 5 days of normal operation was used as the source domain training set for model pre-training; the data from days 6 and 7 was used as the target domain normal sample set for target domain adaptation. A scenario with fewer samples in the target domain was set up, where a fixed proportion of normal samples were extracted from the normal operation data from days 6 and 7 as adaptation data, while the remaining normal samples did not participate in the adaptation. The data from the last 4 days was divided into the target domain test set, which included both normal operation samples and attack / abnormal samples, used to evaluate the model's anomaly detection performance under target domain conditions. The relevant parameter settings are shown in Table 1.

[0140] Table 1. Experimental Parameter Settings

[0141]

[0142] The experimental results are shown in Table 2.

[0143] Table 2. Experimental Results

[0144]

[0145] In this preferred embodiment, the first preset threshold is 90%, the second preset threshold is 90%, the third preset threshold is 75%, the fourth preset threshold is 80%, the fifth preset threshold is 5%, and the sixth preset threshold is 60s. As shown in Table 2, the anomaly detection method proposed in this invention achieves high accuracy and precision, indicating that this invention can accurately distinguish between normal and abnormal samples and has good anomaly detection performance. Furthermore, the cross-condition performance improvement rate is positive and the adaptation time is short, indicating that this invention has good cross-condition adaptability and practical application value under conditions of few samples in the target domain.

[0146] In summary, compared with existing technologies, this invention enhances the modeling ability of temporal dynamic features and spatial coupling relationships of variables in multivariate time-series data of industrial equipment through temporal local standardization, dynamic graph construction, and spatiotemporal joint feature extraction. By introducing stage-based conditional diffusion reconstruction, a staged normal prototype library, and a staged threshold mechanism, it improves the representation ability of normal modes in different operating stages and reduces false alarms caused by mode switching. Through stage-aware statistical alignment, prototype-driven constraints, and efficient parameter fine-tuning, it achieves cross-condition migration adaptation under few-sample conditions. It enables anomaly detection even in the absence of anomaly labels, achieving cross-condition migration adaptation under few-sample conditions and improving the accuracy, robustness, and adaptability of anomaly detection for industrial equipment in multi-condition scenarios.

[0147] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion, characterized in that, include: Acquire historical monitoring multivariate time series data collected by a preset sensor group, and perform data preprocessing and segmentation on the historical monitoring multivariate time series data in sequence to obtain source domain training window sample set, target domain adaptation window sample set and target domain detection window sample set; Temporal local normalization is performed on the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set to obtain the temporally normalized window data corresponding to each sample set. Based on the time-normalized window data corresponding to each sample set, k-nearest neighbor search is performed using the BallTree data structure to construct a dynamic graph structure corresponding to the window samples of each sample set. Based on the dynamic graph structure, the time-normalized window data corresponding to each sample set is spatially neighborhood-weighted normalized, and combined with the preset temporal convolutional network and graph attention network, spatiotemporal joint feature extraction is performed to obtain the window-level spatiotemporal feature representation corresponding to each sample set. The graph variational autoencoder and the stage encoder are trained using the window-level spatiotemporal feature representation of the source domain training window sample set. The window-level spatiotemporal feature representation corresponding to each sample set is then input into the trained graph variational autoencoder and the stage encoder in sequence to obtain the latent variable representation and stage probability representation corresponding to each sample set. The latent variable representation and stage probability representation corresponding to the source domain training window sample set are used to train the stage conditional diffusion model to obtain the source domain pre-trained anomaly detection model, and a staged normal prototype library and source domain prior threshold are constructed. The target domain adaptation window sample set is input into the source domain pre-trained anomaly detection model, and cross-condition transfer adaptation processing is performed through stage-aware statistical alignment, prototype-driven constraints, and efficient parameter fine-tuning to obtain the final anomaly detection model. The stage-aware statistical alignment is as follows: the weighted mean and weighted covariance matrix of the target domain and the source domain at different stages are calculated respectively, and the differences between the mean and covariance of the source domain and the target domain at each stage are compared to construct the stage-aware statistical alignment loss. The efficient parameter fine-tuning is to freeze the encoding backbone parameters in the source domain pre-trained anomaly detection model and only update the low-rank adaptation parameters and some normalization layer parameters in the diffusion denoising network. The time series data to be detected is obtained and input into the final anomaly detection model to obtain the anomaly detection results.

2. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 1, characterized in that, Acquire historical monitoring multivariate time series data collected by a preset sensor group. Perform data preprocessing and segmentation on the historical monitoring multivariate time series data sequentially to obtain a source domain training window sample set, a target domain adaptation window sample set, and a target domain detection window sample set, specifically: Acquire historical multivariate time series data of industrial equipment under source domain and target domain operating conditions, collected by a preset sensor group. , , ,in, In the first The state observation vector at each sampling time point is jointly collected by N sensors, where T is the total length of the time series. This is a univariate time series acquired by the first sensor. This is a univariate time series acquired by the second sensor. For the univariate time series collected by the i-th sensor, Let N be a real number, and let N be the number of sensors. For the i-th sensor at the i-th time The observations collected at each sampling time; The historical monitoring multivariate time series data were divided into source domain raw sequences according to the operating conditions. and the original sequence of the target domain , The length of the original sequence in the source domain. The length of the original sequence in the target domain; Data preprocessing is performed on the original source domain sequence and the original target domain sequence, wherein the data preprocessing includes timestamp alignment, resampling, missing value detection, completion, deduplication, and sensor channel validity screening. The preprocessed source domain original sequence and target domain original sequence are segmented using a sliding window method to obtain the source domain window sample set. and target domain window sample set ; The normal window samples in the source domain window sample set are used as source domain training window samples to obtain the source domain training window sample set. A portion of the normal window samples in the target domain window sample set are used as target domain adaptation window samples. The remaining normal window samples and abnormal window samples in the target domain window sample set are used as target domain detection window samples to obtain the target domain adaptation window sample set and the target domain detection window sample set.

3. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 2, characterized in that, Temporal local normalization is performed on the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set to obtain the temporally normalized window data for each sample set, as follows: Based on the dimension of the univariate time series, the window samples of the source domain training window sample set, the target domain adaptation window sample set, and the target domain detection window sample set are split into observations corresponding to each window sample. Based on the observations corresponding to each window sample, extract the window sample corresponding to the i-th sensor. As an object of time-local normalization, its formula is: W is the window length, and V is the number of time points obtained after segmenting the univariate time series according to the window length W. Let be the observation value of the univariate time series of the i-th sensor at the first split time within the current window. Let be the observation value of the univariate time series of the i-th sensor at the second split time within the current window. For the univariate time series of the i-th sensor, the observation value at the t-th segmentation time within the current window; The local mean of the window sample corresponding to the i-th sensor is obtained by recursively calculating the exponential moving average method. and local variance Its formula is: , , , For smoothing coefficients; Based on local mean and local variance The window samples corresponding to the i-th sensor are normalized time-by-time to obtain the time-normalized value of the i-th sensor at the t-th segmentation time. , It is a numerical stability constant greater than 0; The time-normalized values ​​corresponding to all sensors are recombine in their original time order to obtain time-normalized window data for each sample set. The formula for the time-normalized window data is as follows: , The effective number of sensors, For the first The time-normalized value of a sensor at the t-th segmentation time.

4. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 3, characterized in that, Based on the time-normalized window data corresponding to each sample set, and combined with the BallTree data structure, a k-nearest neighbor search is performed to construct a dynamic graph structure corresponding to the window samples of each sample set, specifically: Based on the time-standardized window data corresponding to each sample set, and according to the dimension of univariate time series, extract the time-standardized sequence corresponding to the i-th sensor within the current window. ; Based on time-normalized series Extract several statistical measures that reflect its local dynamic characteristics, specifically including: mean. Standard deviation Root mean square value Peak-to-peak value Trend coefficient , , This represents the average of the time indices within the window. Combine all statistics to form the statistical feature vector of the graph node corresponding to the i-th sensor. , For transpose, Dimension of statistical features; The statistical feature vectors of graph nodes corresponding to all valid sensors are summarized to obtain the statistical feature set of graph nodes corresponding to the current window sample. ; Based on the statistical feature set of graph nodes Using the pre-defined BallTree data structure, a k-nearest neighbor search is performed on the point statistical feature vector to generate the k-nearest neighbor search results. Based on the k-nearest neighbor search results, construct the adjacency matrix of the current window samples. , , Let k be the index set of the k nearest neighbor graph nodes corresponding to the i-th sensor. For graph node pairs Adjacency relationship; Symmetric processing of the adjacency matrix yields an undirected dynamic graph structure. After determining the adjacency relationship, the edge weight is calculated based on the feature distance between the statistical feature vectors of the graph nodes. For nodes satisfying the following conditions... Graph node pairs Its edge weight is defined as , For graph node pairs Adjacency relationship, It is an exponential function. For the first The graph node and the first Feature distance between nodes in a graph For the first The graph node and the first Feature distance between nodes in a graph A scale parameter that is greater than 0; For graph node pairs that do not satisfy the adjacency relationship, set their edge weights to 0 to obtain the edge weight matrix of the current window sample. ; The adjacency matrix and edge weight matrix together form the dynamic graph structure corresponding to the current window sample. The above steps are repeated to obtain the dynamic graph structure corresponding to the window sample of each sample set.

5. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 4, characterized in that, Based on the statistical feature set of graph nodes Using a pre-defined BallTree data structure, a k-nearest neighbor search is performed on the point statistical feature vectors to generate the k-nearest neighbor search results, specifically: Statistical feature vectors of graph nodes As a query point, the statistical feature set of graph nodes In the constructed feature space, the BallTree data structure is used to perform a k-nearest neighbor search on the statistical feature vectors of the remaining graph nodes to obtain the index set of the k nearest neighbor graph nodes corresponding to the i-th sensor. k is the number of nearest neighbor node indices. Let be the first adjacent graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor. Let be the second adjacent graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor. The kth neighboring graph node that has a local similarity relationship with the graph node corresponding to the i-th sensor; Calculate the feature distance between the graph node corresponding to the i-th sensor and the graph node corresponding to the j-th sensor. , Let j be the statistical feature vector of the graph node corresponding to the j-th sensor. It is an L2 norm; When judged When the graph node corresponding to the j-th sensor and the graph node corresponding to the i-th sensor have a local spatial relationship in the current window, it is determined that they are related. Determine the feature distances between all graph nodes and generate the k-nearest neighbor search results.

6. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 5, characterized in that, Based on a dynamic graph structure, spatial neighborhood weighted normalization is applied to the temporally normalized window data corresponding to each sample set. Then, a pre-defined temporal convolutional network and graph attention network are used for spatiotemporal joint feature extraction to obtain the window-level spatiotemporal feature representation for each sample set, specifically: According to the i-th sensor corresponding to the i-th sensor The dynamic graph structure of each node determines its neighborhood set. And calculate the t-th time. The neighborhood weighted average of each graph node neighborhood weighted variance , For the j-th sensor, the j-th sensor is the j-th sensor. The time-normalized value of a graph node at time t within the window; Based on the neighborhood-weighted mean and neighborhood-weighted variance, spatial neighborhood-weighted standardization is performed on the corresponding time-standardized window data. The spatial standardization result of the i-th sensor at time t is given by the following formula: ; All spatial standardization results corresponding to each sample set are reorganized in their original chronological order to obtain spatially neighborhood-weighted standardized window data. , The window data of the spatial neighborhood of the i-th sensor at time t is the weighted and normalized window data. Based on the window data after spatial neighborhood weighting and standardization, determine the univariate sequence corresponding to the i-th sensor. and univariate sequences The temporal dependency features are extracted from the input one-dimensional temporal convolutional network through multiple layers of causal convolution and dilated convolution. Obtain the time feature vector corresponding to the i-th sensor , This is the mapping function for temporal convolutional networks. The dimension of the time feature; By summing up all the temporal feature vectors, we obtain the node-level temporal feature matrix of the current window sample. , For the first The time feature vector corresponding to each sensor; The dynamic graph structure corresponding to the node-level time feature matrix is ​​input into a pre-defined graph attention network to model the spatial interaction relationships between univariate time series. This involves computing graph nodes... With graph nodes Attention relevance score , It is a linear rectified activation function. For attention parameter vectors, The characteristic linear transformation matrix, This is a vector concatenation operation. For the i-th sensor, the i-th... The time feature vector of each graph node For the j-th sensor, the corresponding to the j-th sensor is the j-th sensor. The time feature vector of each graph node; By combining the dynamic graph structure to normalize the neighborhood attention coefficients, graph nodes are obtained. For graph nodes Normalized attention weights , For graph nodes With graph nodes Attention relevance score For graph node pairs The right of the border; Based on normalized attention weights We perform weighted aggregation to obtain the node-level spatial interaction features corresponding to the i-th sensor. , It is a non-linear activation function; A multi-head graph attention mechanism is employed to concatenate the node-level spatial interaction features output by multiple attention heads, resulting in a final node-level spatiotemporal joint feature representation. , For the first The node-level spatial interaction features corresponding to each sensor The spatiotemporal joint feature dimension at the node level; The node-level spatiotemporal joint feature representations are aggregated to obtain the window-level spatiotemporal feature representations corresponding to the current window samples. , This is a pooling operation; and the above steps are repeated to obtain the window-level spatiotemporal feature representations corresponding to the window samples of each sample set.

7. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 6, characterized in that, The graph variational autoencoder and stage encoder are trained using the window-level spatiotemporal feature representation of the source domain training window sample set. Then, the window-level spatiotemporal feature representation corresponding to each sample set is sequentially input into the trained graph variational autoencoder and stage encoder to obtain the latent variable representation and stage probability representation corresponding to each sample set, specifically: The window-level spatiotemporal feature representation corresponding to the source domain training window sample set The input is fed into the encoding network of a preset graph variational autoencoder to obtain the mean vector of the corresponding latent variable posterior distribution. Sum of logarithmic variance vector The formula for the logarithmic variance vector is: , , For the mapping network used to generate the mean of latent variables, For the mapping network used to generate the log-variance of latent variables, For latent space dimensions; Let prior noise satisfy This yields the training latent variable representations corresponding to the window samples in the source domain training window sample set. for: , For element-wise multiplication, It is a standard multivariate Gaussian distribution with zero mean and covariance matrix I. Representing training latent variables The input is fed into the decoding network of the graph variational autoencoder to reconstruct the corresponding window-level spatiotemporal feature representation, thereby obtaining the reconstructed window-level spatiotemporal feature representation corresponding to the window samples of the source domain training window sample set. , For the decoding network of the graph variational autoencoder; Training loss for constructing a graph variational autoencoder , And by minimizing the training loss The parameters of the encoding and decoding networks of the graph variational autoencoder are jointly and iteratively updated to obtain the trained graph variational autoencoder. , , To reconstruct the loss, The weight coefficients that minimize the training loss, For KL divergence loss, For Kullback–Leibler divergence, The posterior distribution learned by the encoding network, It follows a standard Gaussian prior distribution; The window-level spatiotemporal feature representation corresponding to the source domain training window sample set The input is fed into the encoding network of the trained graph variational autoencoder to obtain the corresponding latent variable representation. Summarize all latent variable representations To obtain the set of latent variables ; Clustering is performed on the latent variable set to divide the distribution of window samples in the latent space of the source domain training window sample set into K clusters, thus obtaining the stage pseudo-labels corresponding to the source domain training window sample set. K represents the total number of stages; Use the stage pseudo-labels corresponding to the source domain training window sample set. The predefined stage encoder is trained to obtain the stage probability representation corresponding to the source domain training window sample set, where the latent variables are represented... The input stage encoder yields the stage probability vector corresponding to the source domain training window sample set. , , For normalized exponential functions, For stage encoders, The window samples of the source domain training window sample set are in the th... The probability of each stage; The stage pseudo-labels corresponding to the source domain training window sample set As supervisory information, the encoder training loss during the construction phase , For indicator functions, The number of window samples in the source domain training window sample set is determined by minimizing the stage encoder training loss. The parameters of the stage encoder are iteratively updated to obtain the trained stage encoder. The target domain adaptation window sample set and the target domain detection window sample set are sequentially input into the encoding network of the trained graph variational autoencoder. The latent variable representations corresponding to each sample set are extracted, and the latent variable representations corresponding to each sample set are sequentially input into the trained stage encoder to obtain the stage probability representations corresponding to each sample set.

8. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 7, characterized in that, The staged conditional diffusion model is trained using the latent variable representation and stage probability representation corresponding to the source domain training window sample set to obtain the source domain pre-trained anomaly detection model. A staged normal prototype library and source domain prior thresholds are then constructed, specifically as follows: The stage probability vector corresponding to the sample set of the source domain training window As a conditional control signal, it is embedded in a preset mapping module to obtain stage condition embedding. , For conditional embedding mapping functions, For conditional embedding dimensions; Representing latent variables as initial latent variables Set the total number of diffusion steps to The noise scheduling sequence is A forward diffusion noise-adding process is performed in the latent space to obtain noisy latent variables at different diffusion times. Each diffusion step satisfies the following conditions: , For the first The noise intensity injected into the latent variable by each diffusion step, wherein, as the number of diffusion steps increases, the original structural information in the latent variable representation is gradually disturbed by random noise; Among them, setting , , For the first The proportion of the original signal retained after each diffusion step From the first diffusion step to the second The proportion of the original signal retained after each diffusion step; In the At each diffusion step, the initial latent variable Corresponding noisy latent variables The formula is: , , For random noise that follows a standard Gaussian distribution; Regarding the first Number of diffusion steps to reduce noisy latent variables Diffusion time encoding and stage condition embedding A common input diffusion denoising network is used to obtain the network's prediction results for the noise term. , For parameters diffusion denoising network; Calculate the prediction results With real random noise The differences between them are used to construct a diffusion denoising loss function. Furthermore, by minimizing the diffusion denoising loss, the parameters of the diffusion denoising network are iteratively updated to obtain the trained stage conditional diffusion model and the source domain pre-trained anomaly detection model. Based on the stage pseudo-labels corresponding to the source domain training window sample set The source domain training window sample set is divided into parts to obtain... The normal latent variable subset corresponding to each stage and for the normal latent variable subset Clustering is performed to obtain Prototype set under stage , For the first The m-th normal prototype center in each stage This represents the number of prototypes in this stage. The prototype sets corresponding to all stages are aggregated to form a phased normal prototype library. ; Representing latent variables and stage condition embedding Inputting the pre-trained staged conditional diffusion model, J independent backsampling operations are performed on the window samples of each source domain training window sample set to obtain J sets of reconstruction results, which are represented as follows: , This is the reconstruction result for group 1. This is the reconstruction result for the second group. This is the reconstruction result for group J; The reconstruction error between each set of reconstruction results and the original latent variable representations is calculated using the following formula: , For the reconstruction error of group l, For the reconstruction results of the l-th group, calculate the average reconstruction error of the samples in that window. and restructuring uncertainty Construct the anomaly score for the samples in this window. , These are the weighting coefficients for the average reconstruction error. The weighting coefficient for outlier scores; According to the stage pseudo-label All anomaly scores corresponding to the source domain training window sample set are divided into stages to obtain... Set of abnormal scores for normal samples under each stage And according to the preset quantiles ,calculate The source domain prior thresholds corresponding to each stage This yields the set of source domain prior thresholds for all stages. .

9. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 8, characterized in that, The target domain adaptation window sample set is input into the source domain pre-trained anomaly detection model, and cross-condition transfer adaptation is performed through stage-aware statistical alignment, prototype-driven constraints, and efficient parameter fine-tuning to obtain the final anomaly detection model, as follows: The encoding backbone parameters in the source domain pre-trained anomaly detection model are frozen, and only the low-rank adaptation parameters and some normalization layer parameters in the diffusion denoising network are updated. The source domain pre-trained anomaly detection model includes a trained temporal local normalization module, a dynamic graph construction module, a spatial neighborhood weighted normalization module, a spatiotemporal joint feature extraction module, a graph variational autoencoder, and a stage encoder. The window samples in the target domain adaptation window sample set are in the first... The probability of each stage The latent variable representation corresponding to the window samples in the target domain adaptation window sample set. Calculate the weighted mean of the target domain at this stage. and weighted covariance matrix ; Based on the window samples of the source domain training window sample set, in the... The probability of each stage The latent variable representation corresponding to the window samples in the source domain training window sample set. Calculate the weighted mean of the source domain at this stage. and weighted covariance matrix ; By comparing the differences in mean and covariance between the source and target domains at each stage, a stage-aware statistical alignment loss is constructed. , For the first Weighting coefficients for each stage It is the Frobenius norm; Prototype-driven constraints are applied to window samples in the target domain adaptation window sample set based on the phased normal prototype library. While completing the stage-level statistical alignment, the stability of the multimodal structure within the stage of the target domain normal samples during the adaptation process is maintained. The stage-specific conditional diffusion denoising network is conditionally fine-tuned using a target domain adaptation window sample set, and combined with the target domain diffusion denoising loss. Stage-aware statistical alignment loss and prototype-driven constraint loss Constructing the total loss for target domain adaptation , Denoising loss for diffusion in the target domain The weighting coefficients, Stage-aware statistical alignment loss The weighting coefficients, Prototype-driven constraint loss Weighting coefficients; By minimizing the total loss of target domain adaptation, the parameters in the source domain pre-trained anomaly detection model are iteratively optimized to obtain the target domain anomaly detection model after transfer adaptation. Multiple conditional diffusion backsampling reconstructions are performed using normal window samples from the target domain adaptation window sample set to obtain the abnormal score distribution of normal samples in the target domain. The target domain stage calibration threshold is calculated according to the stage division. The fusion stage threshold is then obtained by combining the source domain prior threshold and the target domain stage calibration threshold. The sample set of the target domain to be detected window is input into the target domain anomaly detection model, and anomaly determination is performed in combination with the threshold of the fusion stage to obtain the test anomaly detection result; the test anomaly detection result is compared with the real anomaly label of the sample set of the target domain to be detected window to generate a comparison result; When the comparison result reaches the preset index, the target domain anomaly detection model and its corresponding fusion stage threshold are used as the final anomaly detection scheme. If the comparison result does not meet the preset index, return to the target domain migration and adaptation step, and re-perform parameter optimization, threshold calibration and result evaluation until the comparison result meets the preset index.

10. The method for detecting multivariate temporal anomalies across operating conditions based on stage-aware migration and diffusion according to claim 9, characterized in that, The preset metrics include accuracy, precision, recall, F1 score, cross-condition performance improvement rate, and adaptation time.