Non-stationary time sequence prediction method and system based on multi-granularity collaborative diffusion

By employing a multi-granularity collaborative diffusion method, dynamic granularity selection, and feature fusion, the shortcomings of existing time series prediction methods in capturing multi-granularity features in non-stationary data are addressed, achieving higher accuracy and more stable time series prediction.

CN121256262APending Publication Date: 2026-01-02HARBIN ENG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511421821.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Existing time series forecasting methods struggle to effectively capture multi-granular features when dealing with non-stationary data, especially when faced with sudden fluctuations and periodic changes, resulting in insufficient forecast accuracy and stability.

Method used

We employ a multi-granularity collaborative diffusion approach, which combines dynamic granularity selection and multi-granularity feature fusion with differentiable probability modeling, perturbation-aware conditional encoder, and multi-granularity guided diffusion generator to capture short-term fluctuations and long-term trends in time series data, thereby improving prediction accuracy and model stability.

Benefits of technology

It effectively captures multi-level dynamic changes in time series data, improves the prediction accuracy and robustness of non-stationary time series data, and can better handle complex time series data without introducing noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121256262A_ABST
    Figure CN121256262A_ABST
Patent Text Reader

Abstract

The invention provides a non-stationary time sequence prediction method and system based on multi-granularity collaborative diffusion, and belongs to the technical field of time sequence prediction.The method comprises the steps that firstly, non-stationary time sequence data are obtained and preprocessed, and time sequence data of multiple granularity levels are generated; then, designing and applying a dynamic granularity decomposition module to perform multi-granularity data decomposition, and extracting data features of different granularities; thirdly, processing the multi-granularity features through a disturbance perception condition encoder, and reconstructing non-stationary components; and finally, diffusion modeling is carried out through a multi-granularity guide diffusion generator, and accurate prediction of the time series data is finally realized. According to the method, multi-level dynamic changes in time series data are fully captured, and especially in a non-stationary data environment, prediction precision and model robustness can be effectively improved; the method is suitable for time series data prediction with multi-granularity characteristics and non-stationary characteristics, and is widely applied to multiple fields of meteorology, finance, energy and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of time series prediction technology, specifically, it relates to a non-stationary time series prediction method and system based on multi-granularity cooperative diffusion. Background Technology

[0002] Time series forecasting is widely used in various fields such as meteorology, energy consumption, and financial markets. However, existing time series forecasting methods have certain limitations when dealing with non-stationary data, especially when the data contains sudden fluctuations or periodic changes, traditional methods struggle to effectively capture the multi-granularity characteristics of the data. Existing diffusion models typically can only handle time series data with fixed granularity and fail to effectively address the multi-scale dynamic characteristics of time series data. Therefore, accurately capturing short-term fluctuations and long-term trends in time series data has become a significant challenge in the field of time series forecasting.

[0003] The performance of time series prediction models is constrained by a variety of factors, including: (1) The statistical characteristics of non-stationary time series data, such as mean and variance, change over time and may exhibit trends, periodicity, and volatility. (2) Time series data often contain a large amount of noise, missing values, and outliers, which can affect the quality of the data and reduce the accuracy of the model. Data preprocessing methods such as denoising, interpolation, and outlier detection, as well as feature selection, play an important role in time series prediction models. If data preprocessing and feature selection are inappropriate, information loss or misleading during model training can occur, thereby affecting the performance of the model. (3) Complex models (such as deep neural networks) require a large amount of training data to fully learn the patterns and rules in the data. When the amount of data is small, the model is prone to overfitting, leading to a decrease in prediction performance. On the other hand, simple models may not be able to capture complex patterns and features in the data, resulting in underfitting. The interaction and influence of these factors determine the prediction accuracy and reliability of the model. Therefore, to improve the performance of time series prediction models, it is necessary to find a balance among these constraints and adopt appropriate technical means and strategies for optimization.

[0004] In the field of time series forecasting, commonly used analytical methods mainly include traditional statistical methods and machine learning-based forecasting methods. Traditional time series forecasting methods, such as the Autoregressive Moving Average (ARIMA) model, are widely used for modeling and forecasting linear time series data. The ARIMA model predicts future time series values ​​through autoregressive and error terms, but its applicability presupposes that the data must be stationary. For non-stationary time series data with trends or seasonal fluctuations, ARIMA models typically require differencing the data. Although this method works well in some simple scenarios, its predictive performance is often limited for complex, nonlinear, and variable time series data.

[0005] With the rise of machine learning, an increasing number of data-driven prediction methods are being applied to the analysis of time series data. Artificial Neural Networks (ANNs) are powerful nonlinear modeling tools capable of representing complex nonlinear relationships through multi-layered structures. In time series prediction, ANNs utilize backpropagation to adjust weights, adapting them to complex time series data. However, the performance of ANNs depends on the initial weights and network structure and is susceptible to insufficient training data or noise, leading to model instability. Support Vector Machines (SVMs) are nonlinear analysis methods that map input data to a high-dimensional space using kernel functions. They can improve the accuracy of time series prediction to some extent, especially when dealing with complex data. However, SVMs are sensitive to parameter selection, require optimization based on domain knowledge, and have high computational costs, making them difficult to apply to large-scale time series data.

[0006] Random forest is an ensemble learning method that uses multiple decision trees to predict time series data. Its advantages lie in its ability to extract nonlinear features from high-dimensional data and its strong robustness. However, random forest is prone to overfitting when dealing with noisy data, and it struggles to model long-term dependencies in time series data, failing to fully capture the temporal correlations within the data.

[0007] With the development of deep learning technology, Convolutional Neural Networks (CNNs) and Long Short-Term Memory Networks (LSTMs) have become popular methods in the field of time series prediction. CNNs, through convolution and pooling operations, can effectively extract local features from time series data and have good prediction performance for time series data with short-term fluctuations. However, CNNs can usually only handle local dependencies and have difficulty capturing dependencies over long periods. LSTMs, on the other hand, are recurrent neural networks (RNNs) specifically designed to handle long-term dependency problems. LSTMs avoid the gradient vanishing problem that traditional RNNs encounter in long sequences through gating mechanisms, thus effectively capturing long-term dependencies in time series data. However, LSTMs also have problems such as high computational complexity and long training time, and still face certain challenges when dealing with time series data with complex spatial dependencies or cross-domain influences.

[0008] In recent years, Transformer models have made significant progress in the field of natural language processing and have begun to be applied to time-series data analysis. Transformers process long sequences of data through a self-attention mechanism, enabling them to capture long-range dependencies and offering high parallel computational efficiency. However, Transformer models typically require substantial training data and computational resources, and their performance may be inferior to other methods for small sample sizes or noisy time-series data.

[0009] In summary, existing time series prediction methods still face certain limitations when dealing with non-stationary time series data that have multi-granularity characteristics, complex nonlinear relationships, and dynamic changes. Summary of the Invention

[0010] To address the shortcomings of existing technologies, this invention proposes a non-stationary time series prediction method and system based on multi-granularity collaborative diffusion. By dynamically selecting granularity and fusing multi-granularity features, it can better capture short-term fluctuations and long-term trends in time series data, thereby improving prediction accuracy and the model's uncertainty quantification capability.

[0011] This invention is achieved through the following technical solution: a non-stationary time series prediction method based on multi-granularity cooperative diffusion; the method specifically includes the following steps: Step 1: Obtain the non-stationary time series dataset and preprocess the data; Step 2: Construct a granularity selection mechanism based on differentiable probability modeling to generate time series data at multiple granularity levels. Perform multi-granularity decomposition on the time series data through dynamic granularity decomposition to transform the time series data into feature representations at multiple granularity levels. Step 3: Based on the output of Step 2, design a perturbation-aware conditional encoder to process multi-granularity features and reconstruct non-stationary components; Step 4: Based on the output of Step 3, perform diffusion modeling using a multi-granularity guided diffusion generator to achieve prediction of time series data.

[0012] Further, step 1 includes: Step 1.1: Obtain raw datasets containing non-stationary time-series data from energy consumption, financial market, or meteorological data fields; the non-stationary characteristics include disturbances caused by sudden events, volatile data distribution, and long-term trend changes; Step 1.2: Preprocess the original dataset to remove invalid data and outliers, and fill in missing values; Step 1.3: Divide the dataset into training set, validation set and test set.

[0013] Further, step 2 includes: Step 2.1: Perform multi-granularity decomposition on the input data, dividing it into different granularity levels, and construct a granularity selection mechanism based on differentiable probability modeling to achieve adaptive generation of multi-granularity features; Step 2.2: After data decomposition, multi-scale features of time series data are extracted through multiple granular levels. Coarse-grained features capture the long-term dependencies of the data to reduce short-term fluctuations, while fine-grained features capture the instantaneous changes and local fluctuations of the data. Step 2.3: Use an adaptive attention mechanism to perform weighted fusion of features at each granularity level: calculate the importance of features at each granularity level and dynamically adjust the contribution weight of each granularity level in the model; Step 2.4: Using gradient descent and backpropagation algorithms, the granularity selection mechanism and feature extraction network are optimized by minimizing the loss function to obtain the optimized multi-granularity feature representation.

[0014] Further, in step 2.1, the granularity selection mechanism based on differentiable probability modeling specifically refers to: Construct a candidate granular window set covering fine-grained short-time windows and coarse-grained long-time windows, maintain a learnable parameter vector for each granularity level, and generate the selection probability distribution of each candidate granular window through the Softmax function; Noise is introduced and a cosine-scheduled temperature annealing strategy is used to achieve differentiable discrete sampling. During training, the gradient is calculated based on the selected probability distribution. During inference, the window corresponding to the highest probability is selected as the target window at the current time. Based on the target window, the original sequence is processed by moving average to generate coarse and fine-grained representations.

[0015] Further, step 3.1: Stabilize the time series data at each granularity level; Step 3.2: Construct a perturbation recovery mechanism based on gated linear units (GLUs) to extract dynamic change features from historical time series and reconstruct non-stationary components; Step 3.3: Adopt an adaptive attention mechanism to generate appropriate conditional representations at each time step by weighted aggregation of features from different granularities, and dynamically adjust the weights of each granularity.

[0016] Furthermore, in step 3.1, the stabilization process specifically involves: using normalization operations to reduce the distribution differences of time series data at different granularity levels, thereby reducing non-stationarity in the data; In step 3.2, the perturbation recovery mechanism is specifically as follows: local features are extracted from historical time series data through one-dimensional convolution operations, perturbation factors are generated based on the GLU activation function, and the perturbation factors are used to dynamically adjust the time series data at each granularity level to recover the non-stationary components caused by external perturbations and trend changes.

[0017] Furthermore, step 4 includes: Step 4.1: Use a multi-granularity guided diffusion generator to perform diffusion modeling on time series data; based on the multi-granularity time series features extracted in Step 3, construct a conditionally constrained Markov chain model. In the early stage of the diffusion process, introduce the coarse-grained data generated in Step 2 as a conditional constraint into the diffusion process, so that the model focuses on the overall trend and long-term dependency information of the data. Establish the objective function by evaluating the marginal distribution of the coarse-grained data to ensure that the coarse-grained data generated in the intermediate state during the diffusion process approximates the real coarse-grained data. Step 4.2: During the training of the diffusion model, a coarse-grained trend alignment and fine-grained fluctuation correction strategy is adopted for time series data of different granularities to denoise the data; coarse-grained data helps the model recover long-term trends, while fine-grained data corrects for short-term fluctuations and sudden events. Step 4.3: In each diffusion step, adjust the noise propagation path according to the current granularity level to gradually remove unnecessary noise components; in the reverse denoising process, gradually guide the model to restore the fine fluctuation pattern and retain the overall trend information; Step 4.4: In the final stage of the diffusion generator, the model ensures that the generated data can accurately reflect the time series patterns at different granularities through multi-granularity guided optimization objectives; through the conditional diffusion process, prediction results are generated, and by combining the features of each granular level, accurate time series prediction data is generated.

[0018] A nonstationary time series prediction system based on multi-granularity cooperative diffusion: The system includes a preprocessing module, a granularity decomposition module, a reconstruction module, and a prediction module. The preprocessing module is used to acquire non-stationary time series datasets and preprocess the data; The granularity decomposition module constructs a granularity selection mechanism based on differentiable probability modeling, generates time-series data at multiple granularity levels, and performs multi-granularity decomposition on the time-series data through dynamic granularity decomposition, transforming the time-series data into feature representations at multiple granularity levels. The reconstruction module designs a perturbation-aware conditional encoder to process multi-granularity features based on the output of the granularity decomposition module, and reconstructs non-stationary components. The prediction module performs diffusion modeling through a multi-granularity guided diffusion generator based on the output of the reconstruction module, thereby enabling the prediction of time series data.

[0019] An electronic device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the above method.

[0020] A computer-readable storage medium for storing computer instructions that, when executed by a processor, implement the steps of the above-described method.

[0021] Compared with the prior art, the beneficial effects of the present invention are as follows: Existing methods often neglect information at different granular levels within time-series data, leading to significant shortcomings in prediction accuracy and uncertainty estimation. This invention addresses the problem of non-stationary time-series prediction, resolving the performance issues faced by existing technologies when processing non-stationary time-series data, particularly in handling multi-granularity features. It provides a non-stationary time-series prediction method based on multi-granularity cooperative diffusion. This method combines multi-granularity feature extraction, cooperative diffusion modeling, and denoising optimization techniques. Through a dynamic granularity selection mechanism, it fully captures long-term trends and short-term fluctuations in the data, effectively improving the prediction performance of non-stationary time-series data.

[0022] Without introducing noise, a multi-granularity collaborative diffusion model can fully mine the feature information at different granularity levels in time series data, and capture the multiple dynamic relationships between long-term trends and short-term fluctuations in the data.

[0023] This invention can also simultaneously consider complex features such as periodicity and abrupt change in time series data, and use dynamic granularity decomposition and collaborative diffusion modeling techniques to accurately capture the spatiotemporal dependencies in the data, thereby improving the prediction accuracy of non-stationary time series data.

[0024] Furthermore, this invention effectively improves the robustness and stability of the model through collaborative modeling of multi-granularity data and adaptive denoising methods, demonstrating significant advantages in processing complex time-series data. Attached Figure Description

[0025] Figure 1 This is a structural diagram of a nonstationary time series prediction method based on multi-granularity cooperative diffusion. Figure 2 This is a diagram of the dynamic granularity selection method; Figure 3 This is a flowchart of a nonstationary time series prediction method based on multi-granularity cooperative diffusion. Detailed Implementation

[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] Combination Figures 1 to 3This invention, without introducing noise, can fully utilize multi-granularity hierarchical data features, fuse data of different granularities, and capture multi-level dynamic changes in time-series data. It employs a multi-granularity collaborative diffusion generator for time-series data modeling, accurately capturing the spatiotemporal dependencies in the data, particularly short-term fluctuations and long-term trends. Through a perturbation-aware conditional encoder, it reconstructs the volatile components in non-stationary data, ensuring accurate modeling of non-stationary data.

[0028] Implementation Method 1: A non-stationary time series prediction method based on multi-granularity collaborative diffusion. In order to enable different granularity levels in time series data to contain rich time series information, the data representations of different granularities are input into a multilayer perceptron (MLP), the output of the multilayer perceptron is obtained, and this output is used as the embedded representation of time series features for subsequent diffusion modeling and prediction.

[0029] Step 1: Obtain the non-stationary time series dataset and preprocess the data; Step 1.1: Obtain the original dataset containing non-stationary time-series data from real-world application scenarios. This data typically comes from fields such as energy consumption, financial markets, and meteorological data, and exhibits significant non-stationary characteristics, such as sudden disturbances and volatile data distribution. The non-stationarity of this data manifests in the presence of sudden events (such as equipment failures or extreme weather) and long-term trend changes in the time series data.

[0030] Step 1.2: Perform data preprocessing to ensure data quality. During the cleaning process, invalid data and outliers are removed, and missing values ​​are filled. Missing value filling uses methods such as linear interpolation or forward imputation to ensure data integrity and consistency.

[0031] Step 1.3: Divide the dataset into training, validation and test sets, using appropriate partitioning methods to ensure the diversity and representativeness of the training and test sets.

[0032] Step 2: Construct a granularity selection mechanism based on differentiable probability modeling to generate time series data at multiple granularity levels. Perform multi-granularity decomposition on the time series data through dynamic granularity decomposition to transform the time series data into feature representations at multiple granularity levels. Step 2.1: A granularity selection mechanism based on differentiable probability modeling was designed. This mechanism dynamically determines the size of the time window to be used at the current moment by learning the weights and features of each granularity level. The candidate granularity window set includes multiple time scales, and the module generates the selection probability of each granularity window through a softmax function. Through the training process, the model automatically selects the most appropriate granularity level in order to extract the most informative features from the time series data.

[0033] The main task of the dynamic granularity decomposition module is to perform multi-granularity decomposition on the input time series data, dividing it into different granularity levels. Adaptive generation of multi-granularity features is achieved using differentiable probability modeling.

[0034] Given a set of candidate windows ,in Indicates the first The time span of each candidate window covers analytical needs from fine-grained to coarse-grained. For each granularity level... Maintaining the learnable parameter vector The window selection probability distribution is generated using Softmax: , In the formula Indicates particle size Select window The probability, parameter Optimization is achieved through gradient descent. To achieve differentiable discrete sampling, Gumbel noise is introduced and a temperature annealing strategy is employed.

[0035] in For independent and identically distributed noise, Temperature parameters are adjusted according to cosine from Annealing to During training, through Calculate the gradient, and take the maximum probability window during inference: Based on the selected window For the original sequence A moving average is used to generate a coarse-grained representation. The granularity is then adjusted. Data replication This aligns multi-granularity features along the temporal dimension.

[0036] Step 2.2: After data decomposition, the dynamic granularity decomposition module extracts multi-scale features from the time-series data through multiple granularity levels. Coarse-grained features are used to capture long-term dependencies in the data and reduce the impact of short-term fluctuations on the model. Fine-grained features help the model capture instantaneous changes and local fluctuations.

[0037] Step 2.3: Weighted fusion of features at each granularity level is performed. The weights are automatically learned during training to ensure that features of different granularities can effectively work together in the model. An adaptive attention mechanism is adopted, which dynamically adjusts the contribution of different granularity levels in the model by calculating the importance of features at each granularity level. This mechanism allows the model to automatically focus on granularity levels with more information, thus optimizing prediction performance.

[0038] Step 2.4: During training, the dynamic granularity decomposition module optimizes the granularity selection mechanism and feature extraction network using gradient descent and backpropagation algorithms. By minimizing the loss function, the training model progressively optimizes the feature representation and granularity selection strategy at each granularity level to improve the accuracy and stability of time series prediction.

[0039] Through the processing of the dynamic granularity decomposition module, time-series data is transformed into feature representations at multiple granular levels. These feature representations will serve as input to subsequent models, helping them to comprehensively understand the multi-level dynamic changes in the time-series data.

[0040] Step 3: Based on the output of Step 2, design a perturbation-aware conditional encoder to process multi-granularity features and reconstruct non-stationary components; Step 3.1: Use a perturbation-aware conditional encoder to extract features from multi-granularity time series data. By stabilizing the time series data at each granularity level, non-stationarity in the data is reduced, ensuring the consistency of time series features at each granularity level in the overall model. The perturbation-aware conditional encoder plays a core role. It aims to further process the different granularity time series obtained from the multi-granularity feature extraction module, and through the perception and recovery of perturbations, help the model better adapt to the volatility and sudden events in non-stationary data. This module contains two key parts: stabilization processing and perturbation recovery mechanism. The stabilization module specifically includes: each granularity level The input sequence undergoes normalization to make the statistical properties of the time series more stable, thereby reducing model instability caused by volatility or disturbances. This process is achieved through the following formula:

[0041]

[0042]

[0043] ⊙ represents element-wise multiplication. The normalization module reduces the distribution differences between each input sequence, making the distribution of the model input more stable.

[0044] in, Representing data mean Indicates the number of samples in the dataset. Indicates the first Data values ​​for each sample Indicates the first Standardized data of each sample It is the standard deviation of the data; Step 3.2: A perturbation recovery mechanism based on gated linear units (GLU) is employed to extract dynamic features from historical time series data and reconstruct non-stationary components. Through dynamic adjustment of the data, non-stationary components caused by external perturbations, trend changes, and other factors are recovered. This process extracts local features through one-dimensional convolution operations and generates perturbation factors using the GLU activation function, thereby optimizing the time series data at each granular level.

[0045] The perturbation recovery processing module specifically involves designing a perturbation factor generator based on gated linear units (GLUs) to effectively extract non-stationary features from time series data. The core idea of ​​this generator is to utilize one-dimensional convolution operations to learn the dynamic characteristics of the time series and generate perturbation factors through the GLU activation function.

[0046] in, This represents a one-dimensional convolution operation used to extract local features from historical sequences. The GLU function is widely used to generate dynamically adjustable activation functions, and its form is:

[0047] in, It is the Sigmoid activation function. and These are learnable parameters in the convolution operation that control the generation of perturbation factors. In this way, non-stationary components in time series can be effectively captured and recovered, ensuring that the model can better cope with sudden changes in dynamic data.

[0048] Step 3.3: Employ an adaptive attention mechanism. By weighted aggregation of features from different granularities, appropriate conditional representations are generated at each time step, and the weights of each granularity are dynamically adjusted.

[0049] While generating perturbation factors, a Transformer self-attention mechanism is used to weightedly aggregate multi-granularity information, further improving model performance. Specifically, an adaptive attention calculation method based on perturbation factors is designed to generate appropriate conditional representations at each time step. For each granularity level feature, the model calculates the query using the following formula ( ),key( ) and value ( ): ,

[0050] in, Indicates the first Layer granularity characteristics, and It is a weight matrix obtained through learning.

[0051] Next, the calculation results of the query and key are adjusted by a perturbation factor, thereby enhancing the model's ability to handle non-stationary time-series data. The self-attention matrix is ​​calculated using the following formula. :

[0052] in, For the first The perturbation factor of layer granularity characteristics. and These are vectors representing the query and the key, respectively. For the feature dimension, the final self-attention calculation uses a softmax operation to normalize the attention weights.

[0053] This process utilizes perturbation factors and By dynamically adjusting the attention mechanism, the model can effectively capture and fuse features from different granularities while preserving key signals in non-stationary data.

[0054] Step 4: Based on the output of Step 3, perform diffusion modeling using a multi-granularity guided diffusion generator to achieve prediction of time series data; Step 4.1: Use a multi-granularity guided diffusion generator to model diffusion in time series data. Based on the multi-granularity time series features extracted in Step 3, a conditionally constrained Markov chain model is constructed to guide the use of coarse-grained data in the early stages of the diffusion process. Coarse-grained data is introduced as a conditional constraint into the diffusion process, helping the model focus on the overall trend and long-term dependency information of the data. The multi-granularity guided diffusion generator module constructs a conditionally constrained Markov chain to align coarse-grained trends with fine-grained fluctuations at different denoising stages, achieving progressive optimization of multi-level time series features. The specific implementation method is as follows: First, the multi-granularity guided diffusion is implemented as follows: Granularity-guided diffusion explains how coarser-grained data is introduced into the diffusion process. The purpose of guidance is to ensure that intermediate steps in the diffusion process are consistent with the coarse-grained data at a specific time step. This approach enables the model to retain high-level features in the data during the learning process, thereby enhancing the model's stability and guiding the model to focus more on key trends in the time series during training.

[0055] In the initial stage of the diffusion process (i.e., the denoising step with significant noise), the model prioritizes coarse-grained features to capture the global trend. Coarse-grained data, generated by a dynamic granularity decomposition module, is injected into the diffusion process as a constraint. This is achieved through the diffusion step... To evaluate the marginal distribution of coarse-grained data To establish the objective function, the diffusion step is selected appropriately. The coarse-grained features recovered during the denoising process can provide information from real coarse-grained samples. (Diffusion step) The marginal distribution of the latent variables at a location can be obtained through To indicate:

[0056] in In this model, the goal of coarse-grained guidance is to ensure that the coarse-grained data generated from intermediate states approximates the actual coarse-grained data. This refers to a certain time step in the diffusion process. The generated data It can be consistent with the distribution of coarse-grained data.

[0057] Step 4.2: During the training of the diffusion model, a strategy of "coarse-grained trend alignment - fine-grained fluctuation correction" is adopted to denoise the time series data at different granularities. Coarse-grained data helps the model recover long-term trends, while fine-grained data corrects for short-term fluctuations and sudden events.

[0058] The idea of ​​coarse-grained guidance is extended to multiple different granularities. After multi-granularity generation and feature extraction, a result is generated. Data at each granularity level Each level corresponds to time series data of different granularities, which can guide different steps in the diffusion model. Coarse-grained data loses more fine-grained features, so they are closer to the data in the early stages of the diffusion model's reverse process. For coarser-grained data, a larger noise variance coefficient and a smaller diffusion step should be predetermined.

[0059] Therefore, for a diffusion process with a particle size of g, when hour, ,on the contrary, .

[0060] Use diffusion scheduling The conditional distribution of the forward process at all other time steps can be defined as:

[0061] In practical applications, directly from In any time step sampling :

[0062] The diffusion process can be conceptualized as a process in real data and condition representation The interpolation process between them.

[0063] This process starts from real data Start, and gradually transition to This method effectively utilizes the reliable conditional mean estimate provided by the condition extraction module. In the corresponding inverse process, the initialization incorporates conditional information extracted at different granularities, significantly simplifying the generation process. If the provided conditions are good enough, the model can focus on uncertainty estimation.

[0064] Step 4.3: In each diffusion step, the model adjusts the noise propagation path according to the current granularity level, gradually removing unnecessary noise components and focusing on useful information. During the reverse denoising process, the model is gradually guided to restore the fine-grained fluctuation pattern while preserving overall trend information, thereby obtaining more accurate time series prediction results.

[0065] Step 4.4: In the final stage of the diffusion generator, the model ensures that the generated data accurately reflects the temporal patterns at different granularities through multi-granularity guided optimization objectives. Through a conditionally constrained diffusion process, prediction results are generated, and by combining features from each granular level, accurate time-series prediction data is produced.

[0066] The specific optimization method is as follows: the disturbance-aware conditional encoding module and the multi-granularity diffusion model are integrated into a unified optimization objective. The conditional generation model incorporates the transformer structure related to the latent variable z. And the network. In the diffusion model component, a multi-granularity denoising model was trained. The optimization objective can be divided into the following parts:

[0067] The denoising model is guided to predict uncertainty, while the conditional generative model is fine-tuned to provide a more suitable conditional representation. This multi-granular guidance process can be represented as follows: , It is a hyperparameter that controls the granularity g and guides the scale. Therefore, the final training objective of the diffusion process is... ,in .

[0068] To ensure the capabilities of the conditional feature extraction module, the following was introduced: This helps guide the condition generation process during diffusion, and its calculation method is as follows:

[0069] The final optimization objective can be expressed as:

[0070] in, It is a hyperparameter used to adjust the relative importance between diffusion loss and conversion loss.

[0071] Implementation Method 2: A non-stationary time series prediction system based on multi-granularity cooperative diffusion. The system includes a preprocessing module, a granularity decomposition module, a reconstruction module, and a prediction module. The preprocessing module is used to acquire non-stationary time series datasets and preprocess the data; The granularity decomposition module constructs a granularity selection mechanism based on differentiable probability modeling, generates time-series data at multiple granularity levels, and performs multi-granularity decomposition on the time-series data through dynamic granularity decomposition, transforming the time-series data into feature representations at multiple granularity levels. The reconstruction module designs a perturbation-aware conditional encoder to process multi-granularity features based on the output of the granularity decomposition module, and reconstructs non-stationary components. The prediction module performs diffusion modeling through a multi-granularity guided diffusion generator based on the output of the reconstruction module, thereby enabling the prediction of time series data.

[0072] An electronic device includes a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the above method.

[0073] A computer-readable storage medium for storing computer instructions that, when executed by a processor, implement the steps of the above-described method.

[0074] The memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory of the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0075] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means such as coaxial cable, optical fiber, digital subscriber line, DSL, or wireless means such as infrared, wireless, microwave, etc. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium such as a floppy disk, hard disk, magnetic tape; an optical medium such as a high-density digital video disc, DVD; or a semiconductor medium such as a solid-state disk, SSD, etc.

[0076] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.

[0077] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0078] The foregoing has provided a detailed description of the non-stationary time series prediction method and system based on multi-granularity cooperative diffusion proposed in this invention, and has elucidated the principles and implementation methods of this invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A non-stationary time series prediction method based on multi-granularity collaborative diffusion, characterized in that: The method specifically comprises the following steps: Step 1: Obtain a non-stationary time series dataset and preprocess the data; Step 2: Construct a granular selection mechanism based on differentiable probabilistic modeling to generate time series data at multiple granularity levels, and perform multi-granularity decomposition on the time series data through dynamic granularity decomposition to convert the time series data into multi-granularity feature representation; Step 3: According to the output of step 2, design a perturbation-aware conditional encoder to process the multi-granularity features and reconstruct the non-stationary components; Step 4: According to the output of step 3, perform diffusion modeling through a multi-granularity guided diffusion generator to achieve prediction of the time series data.

2. The prediction method of claim 1, wherein: In step 1, it includes: Step 1.1: Obtain an original dataset containing non-stationary time series data from the fields of energy consumption, financial markets, or meteorological data; the non-stationary features include disturbances caused by sudden events, volatile data distribution, and long-term trend changes; Step 1.2: Preprocess the original dataset to remove invalid data and outliers and fill in missing values; Step 1.3: Divide the dataset into training, validation, and test sets.

3. The method of claim 2, wherein: In step 2, it includes: Step 2.1: Perform multi-granularity decomposition on the input data to divide it into different granularity levels and construct a granular selection mechanism based on differentiable probabilistic modeling to achieve adaptive generation of multi-granularity features; Step 2.2: After data decomposition, extract multi-scale features of time series data through multiple granularity levels, where coarse-grained features capture long-term dependencies of data to reduce short-term fluctuation disturbances, and fine-grained features capture instantaneous changes and local fluctuations of data; Step 2.3: Use an adaptive attention mechanism to weight and fuse features at each granularity level: calculate the importance of features at each granularity level and dynamically adjust the contribution weight of each granularity level in the model; Step 2.4: Use gradient descent and backpropagation algorithms to optimize the granular selection mechanism and feature extraction network by minimizing the loss function to obtain optimized multi-granularity feature representation.

4. The prediction method of claim 3, characterized in that: In step 2.1, the granular selection mechanism based on differentiable probabilistic modeling is specifically: Construct a candidate granularity window set covering multiple time scales of fine-grained short time windows and coarse-grained long time windows, maintain a learnable parameter vector for each granularity level, and generate a selection probability distribution for each candidate granularity window through a Softmax function; Introduce noise and use a cosine-scheduled temperature annealing strategy to realize differentiable discrete sampling, calculate the gradient based on the selection probability distribution during training, select the window corresponding to the maximum probability as the target window for the current time during inference, and generate coarse and fine-grained representations based on the target window through sliding average on the original sequence.

5. The prediction method of claim 4, characterized in that: Step 3.1: Perform stationary processing on time series data at each granularity level; Step 3.2: Construct a perturbation recovery mechanism based on gated linear unit (GLU) to extract dynamic change features from historical time series and reconstruct non-stationary components; Step 3.3: Adopt an adaptive attention mechanism to generate appropriate conditional representations at each time step by weighted aggregation of features from different granularities, and dynamically adjust the weight of each granularity.

6. The prediction method according to claim 5, wherein: In step 3.1, the stationarization process specifically includes: using a normalization operation to reduce the distribution difference of time series data at each granularity level, and reduce the non-stationarity in the data; In step 3.2, the perturbation recovery mechanism specifically includes: extracting local features from historical time series data through one-dimensional convolution operation, generating perturbation factors based on GLU activation function, and dynamically adjusting the time series data at each granularity level through the perturbation factors to recover non-stationary components caused by external disturbances and trend changes.

7. The prediction method of claim 6, wherein: In step 4, it includes: Step 4.1: Use a multi-granularity guided diffusion generator to model the diffusion of time series data; based on the multi-granularity time series features extracted in step 3, construct a Markov chain model with conditional constraints, introduce the coarse-grained data generated in step 2 as a conditional constraint into the diffusion process in the early stage of the diffusion process, so that the model focuses on the overall trend and long-term dependence information of the data, and establishes an objective function by evaluating the marginal distribution of coarse-grained data to ensure that the coarse-grained data generated in the intermediate state of the diffusion process approximates the true coarse-grained data; Step 4.2: In the training process of the diffusion model, for time series data of different granularities, adopt the strategy of coarse-grained trend alignment and fine-grained fluctuation correction to denoise the data; wherein the coarse-grained data helps the model recover the long-term trend, while the fine-grained data corrects the short-term fluctuations and sudden events; Step 4.3: In each diffusion step, adjust the propagation path of noise according to the current granularity level, and gradually remove unnecessary noise components; in the reverse denoising process, gradually guide the model to recover fine fluctuation patterns and retain overall trend information; Step 4.4: In the final stage of the diffusion generator, the model ensures that the generated data accurately reflects the time series patterns at different granularities through the optimization target of multi-granularity guidance; through the conditional constraint diffusion process, the prediction result is generated, and combined with the features of each granularity level, accurate time series prediction data is generated.

8. A non-stationary time series prediction system based on multi-granularity synergistic diffusion, characterized in that: The system is used to perform the non-stationary time series prediction method based on multi-granularity collaborative diffusion of any one of claims 1-7 The system includes a preprocessing module, a granularity decomposition module, a reconstruction module, and a prediction module: The preprocessing module is used to obtain a non-stationary time series dataset and preprocess the data; The granularity decomposition module constructs a granularity selection mechanism based on differentiable probability modeling to generate time series data at multiple granularity levels, and performs multi-granularity decomposition on the time series data through dynamic granularity decomposition to convert the time series data into feature representations at multiple granularity levels; The reconstruction module processes the multi-granularity features using a perturbation-aware conditional encoder based on the output of the granularity decomposition module to reconstruct non-stationary components; The prediction module performs diffusion modeling through a multi-granularity guided diffusion generator according to an output of the reconstruction module, to realize prediction of time series data. 9.An electronic device comprising a memory and a processor, the memory storing a computer program, wherein, The processor implements the steps of the method in any one of claims 1 to 7 when executing the computer program.

10. A computer readable storage medium for storing computer instructions, characterized in that, The computer instructions implement the steps of the method in any one of claims 1 to 7 when executed by the processor.