A data stream online signal decomposition method based on multi-order harmonic prior and state recursive memory cooperation
Patent Information
- Application Number
- CN202611170488.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-23
AI Technical Summary
当实际存在周期长度未知、周期结构变化以及趋势成分连续低频演化等特征时,固定周期先验、有限偏移建模及窗口平滑机制容易造成周期结构对齐误差、分量间信息泄漏以及趋势动态响应不足,从而影响非平稳数据流场景下趋势分量、周期分量和残差分量在线分解的准确性与适应性
[0101]有益效果:本发明将时序信号连续到达、周期成分动态变化以及趋势成分非线性演化特征纳入考虑,提出了一种基于多阶谐波先验与状态递归记忆协同的数据流在线信号分解方法,包含基于多阶谐波先验的周期分量提取模块和基于状态递归记忆的趋势分量提取模块,通过设计谐波先验引导的周期分量建模方法,并施加基于结构特征的正则化约束,同时利用自适应动量递推进行在线辨识,实现对时变周期分量的精准分解;结合基于状态递归记忆机制的趋势分量建模方法,利用模型内部状态递推提取数据流在线信号中的低频分量,并通过周期均值偏置校准,实现对局部动态变化快速响应下的趋势分量的精准分解。
Smart Images

Figure CN122964486A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series data processing and data stream analysis technology, specifically to an online signal decomposition method for data streams based on multi-order harmonic priors and state recursive memory collaboration. Background Technology
[0002] Seasonal-Trend Decomposition (STD) of time series signals can decompose the original sequence into trend components, periodic components, and residual components, and is widely used in downstream tasks such as anomaly detection, change point identification, state monitoring, time series forecasting, and soft sensing. By separating long-term variation patterns, recurring periodic patterns, and random perturbation information, STD can reduce the coupling between different components in complex time series signals, improving the accuracy and interpretability of subsequent anomaly identification, trend judgment, and predictive modeling. However, existing STD methods are mostly geared towards given finite-length sequences or analysis windows, estimating trend, periodic, and residual components through processes such as LOESS local regression smoothing, periodic subsequence smoothing, and robust weight iteration. The decomposition results usually depend on the observed samples within the window, the preset period length, and the smoothing scale parameter, making it difficult to directly apply to data stream processing under online conditions. Although some online decomposition methods can achieve online application based on asymmetric trend filtering, periodic filtering, window state maintenance, or fixed-state recursive solutions, they usually still require a pre-given or initialized estimated period length and periodic structure alignment under the assumption of fixed period or finite period offset. When there are characteristics such as unknown period length, changing period structure, and continuous low-frequency evolution of trend components, fixed period prior, finite offset modeling, and window smoothing mechanism are prone to causing period structure alignment errors, information leakage between components, and insufficient dynamic response of trends, thereby affecting the accuracy and adaptability of online decomposition of trend components, period components, and residual components in non-stationary data flow scenarios. Summary of the Invention
[0003] Objective of the Invention: The technical problem to be solved by this invention is to address the shortcomings of existing technologies by providing a data stream online signal decomposition method based on multi-harmonic prior and state recursive memory collaboration. The objectives are: to propose a decomposition method for online data stream signals, solving the problem that traditional STD methods rely on historical batch data processing or sliding window statistics, leading to increased computational and storage overhead with batch size or window length; to propose a periodic component modeling method based on multi-harmonic prior guidance, solving the problem of extracting periodic components from time-varying time-series signals; and to propose a trend component modeling method based on a state recursive memory mechanism, combined with periodic mean compensation calibration, to achieve accurate decomposition of trend components under rapid response to local dynamic changes.
[0004] The method includes the following steps:
[0005] Step S1: Establish a collaborative recursive decomposition architecture, set hyperparameters and initialize model parameters;
[0006] Step S2: Modeling periodic components based on prior guidance of multi-order harmonics;
[0007] Step S3: Regularization constraint of periodic components based on structural mean characteristics;
[0008] Step S4: Online identification of periodic components based on adaptive momentum recursion;
[0009] Step S5: Model the trend components based on the state recursive memory mechanism;
[0010] Step S6, calibrate the trend component based on periodic mean compensation;
[0011] Step S7: Online decomposition of time-series signals based on cooperative recursion.
[0012] In step S1, the collaborative recursive decomposition architecture includes a periodic component extraction module based on multi-harmonic priors and a trend component extraction module based on state recursive memory. The trend component extraction module includes a trend component estimation model based on internal state recursion. This model generates a priori trend estimate for the current moment based on the set of trend model parameters retained from the previous moment and the model's internal state. After obtaining the periodic component estimate for the current moment, it uses the de-periodized trend model input signal and the model's internal state from the previous moment as inputs, generates the model's internal state for the current moment through state update mapping, and then obtains the original trend component estimate for the current moment through trend output mapping. The periodic component extraction module and the trend component extraction module achieve online decomposition of the data stream by executing steps S2 to S7. To support the normal operation of the above decomposition architecture, the global hyperparameters of the model need to be pre-set, and the model parameters and recursive states involved in the periodic component extraction module and the trend component extraction module need to be initialized. Specifically, this includes the following steps:
[0013] Step S11: Configure the online update strategy and internal structure of the periodic component extraction module and the trend component extraction module. For the periodic component extraction module, set the order of the Fourier series of the periodic basis function. Initial fundamental frequency Fourier coefficients and learning rate Frequency and learning rate Phase sensitivity state attenuation coefficient Exponentially Weighted Moving Average (EMA) with zero mean regularization coefficient Fourier coefficients L1 regularization intensity coefficients Gradient variational smoothing coefficient With gradient prediction coefficients And the Adaptive Moment Estimation (Adam) momentum coefficient of the periodic component extraction module. For the trend component extraction module, set the trend model learning rate. Trend mean compensation strength coefficient ;
[0014] Step S12: Initialize model parameters and recursive state, initialize the coefficients of each order basis function in the periodic component extraction module to 0, and initialize the logarithm of the angular frequency to 0. The phase state, phase sensitivity state, periodic exponentially weighted moving average (EMA) mean state, gradient variational state, first-order momentum, second-order momentum, and gradient of the previous time step are initialized to 0. The model parameters and internal state of the trend component estimation model are initialized. The model parameters include state update mapping parameters and trend output mapping parameters. The internal state of the model is used to recursively pass historical trend information between adjacent time steps, and the internal state of the model is initialized to a preset initial state.
[0015] Step S2 specifically includes:
[0016] Step S21: Based on the model parameters and internal state inherited from the trend component estimation model at the previous time step, obtain the trend prior estimate at the current time step, and subtract the trend prior estimate from the current time step input signal to obtain the detrended signal used for periodic component learning. ,in This represents the sampled value of the data stream arriving at the current time t, and serves as the input signal at the current time. This represents the prior trend estimate obtained by recursively predicting the trend component at the current moment based on the model parameters and internal state of the model used to estimate the trend component at the previous moment.
[0017] Step S22: Construct a Fourier series of constant order as the periodic basis function, representing the periodic component as a weighted combination of sine and cosine terms. This can describe simple periodic fluctuations at a single frequency, and also approximate the complex periodic structure of real time-series signals that are non-sinusoidal, irregular, but have repetitive patterns through the superposition of multiple harmonics. This achieves online parametric modeling of the periodic component, with the expression:
[0018] ,
[0019] in, This represents a periodic basis function mapping, which is a function of t, where t represents the time index of the current moment. They represent the first The Fourier coefficients of the cosine term and the Fourier coefficients of the sine term. This represents the periodic angular frequency; therefore, the parameters to be identified for the periodic model at the current time t are... Including the Fourier cosine coefficients, sine coefficients, and periodic angular frequency, it is expressed as:
[0020] ,
[0021] The known function structure of the periodic components was determined based on the Fourier series expression;
[0022] Step S23: Logarithmically parameterize the angular frequency and replace the original time index with a recursive phase variable in the Fourier series calculation. Through the mapping from logarithmic parameters to positive angular frequencies, the periodic angular frequency remains positive throughout the online identification process. Simultaneously, explicit phase recursion avoids the amplification of frequency gradients over time caused by directly using the time index. Furthermore, a phase sensitivity state is introduced to preserve the influence of frequency changes on the cumulative phase effect, thereby improving the stability of online frequency parameter updates. The periodic angular frequency is expressed as:
[0023] ,
[0024] in, This represents the logarithmic parameter of the frequency to be identified online at the current moment. The periodic angular frequency is obtained by mapping the frequency logarithmic parameter; exp represents the natural exponential function; the phase at the current time is recursively expressed as:
[0025] ,
[0026] ,
[0027] in Indicates the phase at time t. This represents the phase sensitivity state at time t, which is propagated back to the next time step along with the current model state, and serves as the inherited phase sensitivity state in the next time step, participating in the chain gradient calculation of the frequency logarithmic parameter; substituting the recursive phase into the Fourier series expression in step S22, we obtain:
[0028] ,
[0029] The parameters to be identified at this point have changed to:
[0030] ,
[0031] The online identification of periodic components is transformed from frequency learning based on the original time index to frequency learning based on the recursive phase.
[0032] Step S3 specifically includes:
[0033] Step S31: Based on the detrended input signal at the current moment and the prior estimate of the period obtained from the period parameters at the previous moment, calculate the learning error of the periodic model at the current single point. This error is used to measure the degree of fit of the current Fourier periodic response to the detrended input signal. The learning error is expressed as:
[0034] ,
[0035] ,
[0036] in, This represents the reconstruction error of the periodic model at the current moment, used to measure the degree of fit of the Fourier periodic components to the detrended input signal. Indicates using The period parameter at time t predicts the period value at the current time t;
[0037] Step S32: Construct the periodic learning target for the current single point based on the learning error. To suppress overfitting noise in the online update of Fourier coefficients, an L1 sparse regularization term is introduced for the periodic basis function coefficients. Simultaneously, the periodic exponentially weighted moving average (EMA) mean of the periodic components is maintained, forming a zero-mean constraint regularization for the periodic components, causing them to tend towards zero. The periodic components are responsible for the repetitive structure oscillating around the zero point, ensuring the uniqueness of the periodic decomposition. The recursive estimation of the periodic exponentially weighted moving average (EMA) mean is as follows:
[0038] ,
[0039] The target for online identification of periodic parameters is:
[0040] ,
[0041] in This represents the loss function of the periodic model at the current time. This indicates the state of the exponentially weighted moving average (EMA) at time t, maintained by the periodic module. This represents the periodic mean smoothing coefficient.
[0042] Step S4 specifically includes:
[0043] Step S41: Identify the target online based on the periodic parameters constructed in step S32. Calculate the single-point gradient at the current time t, and update the single-point gradient online based on the gradient adaptive momentum of the prediction mechanism. The formula is as follows:
[0044] ,
[0045] in This represents the single-point gradient of the periodic parameter at the current time t. Represents the set of periodic parameters The gradient operator; the gradient variational state is used to sense the magnitude of gradient changes between adjacent time steps. When the gradient change increases, the update step size is reduced to enhance the stability of online identification of periodic parameters. The state is represented as:
[0046] ,
[0047] The current adaptive learning rate is obtained from the gradient variational state:
[0048] ,
[0049] in, This represents the gradient variational state at time t. This represents the Fourier coefficients corresponding to the current time t, and the adaptive learning rate. This represents the frequency adaptive learning rate corresponding to the current time t;
[0050] Step S42 introduces gradient prediction correction based on the current single-point gradient. It uses the gradient difference between adjacent time steps to predict the changing trend of the periodic parameter update direction, compensating for the response lag of traditional momentum updates in dynamic time-varying periodic tracking. Combining first-order and second-order momentum, a stable online update direction is obtained, thereby improving the periodic parameter's tracking ability and update stability for time-varying periodic components; predicting the gradient. for:
[0051] ,
[0052] Adam's first-order momentum and second-order momentum are respectively:
[0053] ,
[0054] ,
[0055] ,
[0056] Finally, recursively update the parameters:
[0057] ,
[0058] in, and Let represent the first-order momentum estimate and the second-order momentum estimate at time t, respectively. This is a stabilizing term, used to prevent the denominator from being affected. When the value approaches zero, it results in division by zero; This is the first-order momentum estimate after bias correction. This is the second-order momentum estimate after bias correction; This represents the adaptive learning rate for the periodic parameters to be updated at the current moment, and for the Fourier coefficients... The value is obtained from the calculation in step S41. For the frequency logarithmic parameter The value is obtained from the calculation in step S41. ;
[0059] Step S43: Based on the updated periodic parameters and recursive phase at the current time, calculate the final periodic component estimate at the current time.
[0060] ,
[0061] in For the current moment The final output of the cycle module.
[0062] Step S5 specifically includes:
[0063] Step S51: Subtract the periodic component estimate from the current time periodic model output from the current time input signal to obtain the de-periodized trend model input signal. This allows the trend component estimation model to extract low-frequency changes and long-term evolution information from the signal after removing periodic oscillations, reducing the interference of periodic oscillations on the trend component estimation. The calculation formula is as follows:
[0064] ,
[0065] in, This represents the input signal of the trend model after de-periodization;
[0066] Step S52: Input the current time-de-periodized trend recursive input signal and the previous time-end model internal state into the trend component estimation model, and generate the current time-end model internal state through the state update mapping determined by the trend model parameter set.
[0067] ,
[0068] in, and These represent the model's internal state at the previous time step and the model's internal state at the current time step, respectively. This represents the set of trend model parameters from the previous time step. A defined state update mapping; the state update mapping adjusts the retention of historical trend information and the writing of current trend information according to the current de-periodic input signal, so that the current internal state of the model simultaneously represents historical trend evolution information and current local change information;
[0069] Step S53: Map the current time-internal state of the model to the trend output to obtain the original trend component estimate for the current time:
[0070] ,
[0071] in This indicates a trend output mapping. This represents the original trend component estimate at the current moment. Through the above state update mapping and trend output mapping, the trend component estimation model can utilize the historical trend information carried by the internal state of the model to achieve trend component extraction with both long-term smoothness and local dynamic response under the condition of single-point online update.
[0072] Step S6 specifically includes:
[0073] Step S61: Based on the original trend component estimate obtained in S5 and the periodic component estimate obtained in S4, construct a temporary reconstructed value of the input signal at the current time. Then, use the error between the temporary reconstructed value and the input signal at the current time to construct the online learning objective of the trend component estimation model. The calculation formula is as follows:
[0074] ,
[0075] ,
[0076] in, This represents the reconstructed value at the current moment obtained by combining the original trend component estimate and the periodic component estimate. This represents the learning objective for the reconstruction error of the trend component estimation model at the current moment;
[0077] Step S62: Calculate the gradient of the trend model parameters based on the online learning objective of the trend component estimation model, and perform a single-point online update of the trend model parameter set. The calculation formula is as follows:
[0078] ,
[0079] ,
[0080] in, This indicates that the trend component estimation model is at time [time]. gradient information, Represents the set of parameters relative to the trend model. gradient operator, This indicates a single point of online update operation for the standard Adam optimizer. This represents the set of trend model parameters at time t, used to determine the state update mapping and trend output mapping;
[0081] Step S63: Call the state of the periodic exponentially weighted moving average (EMA) mean value recursively maintained in step S32. ,Will The mean compensation information required for trend component calibration is used to characterize the low-frequency mean bias remaining in the periodic component. It is added as a compensation term to the original trend component to obtain the current time. The final trend component shifts the low-frequency mean bias in the periodic component to the trend component, reducing the absorption of the trend by the periodic module. The calculation formula is as follows:
[0082] ,
[0083] in, Indicates the trend mean compensation strength coefficient. This represents the final trend component estimate at the current moment.
[0084] Step S7 specifically includes:
[0085] Step S71: Based on the updated state of the periodic component model and the trend component model at the current moment, construct a recursive state set for online decomposition at the next moment. The calculation formula is as follows:
[0086] ,
[0087] ,
[0088] ,
[0089] in, This represents the set of state of the periodic component model at the current moment. These represent the first-order momentum estimate and the second-order momentum estimate maintained by the Adam momentum update strategy when the trend model performs online parameter updates in step S62; This represents the set of trend component model states at the current moment. This represents the set of model recursive states formed after the online decomposition is completed at the current moment;
[0090] Step S72: Pass the current model recursive state set back to the next time step as the initial state when the signal arrives at the next time step. The calculation formula is as follows:
[0091] ,
[0092] in This indicates the initial model state invoked when the online decomposition begins at the next moment; through state backpropagation, the periodic component model can inherit the periodic parameters, phase state, mean statistics and optimizer state of the previous moment, and the trend component estimation model can inherit the trend model parameters, internal model state and optimizer state of the current moment.
[0093] Step S73: Based on the periodic component estimate obtained in step S4 and the trend component estimate obtained in step S6, the residual component of the input signal at the current time is calculated to obtain the residual disturbance at the current time that is not explained by the trend component and the periodic component.
[0094] ,
[0095] in, Indicates the current time Residual component estimation;
[0096] Step S74: Decompose the input signal at the current time into three parts: trend component, periodic component, and residual component, and form the online decomposition result at the current time t. ,satisfy As the data stream arrives at each sampled value in sequence, steps S2 to S7 are repeated to complete periodic component learning, online identification of periodic parameters, periodic component output, trend component extraction, trend calibration, residual calculation, and status feedback for each sampled point, thus obtaining the result up to the current time. The online decomposition result sequence is expressed as:
[0097] ,
[0098] in, This represents the sequence of online decomposition results formed from the initial time to the current time. Through the above model state backpropagation and continuous online decomposition process, this method can output trend components, periodic components, and residual components point by point for continuously arriving data streams without historical data caching.
[0099] The present invention also provides an electronic device, including a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method.
[0100] The present invention also provides a storage medium storing a computer program or instructions that, when the computer program or instructions are run on a computer, execute the steps of the method described.
[0101] Beneficial Effects: This invention takes into account the continuous arrival of time-series signals, the dynamic changes of periodic components, and the nonlinear evolution characteristics of trend components. It proposes an online signal decomposition method for data streams based on the collaboration of multi-harmonic priors and state recursive memory. The method includes a periodic component extraction module based on multi-harmonic priors and a trend component extraction module based on state recursive memory. By designing a harmonic prior-guided periodic component modeling method and applying regularization constraints based on structural features, while using adaptive momentum recursion for online identification, accurate decomposition of time-varying periodic components is achieved. Combined with the trend component modeling method based on the state recursive memory mechanism, low-frequency components in the online data stream signal are extracted using internal state recursion of the model, and accurate decomposition of trend components under rapid response to local dynamic changes is achieved through periodic mean bias calibration. Attached Figure Description
[0102] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.
[0103] Figure 1 This is a flowchart of the method of the present invention.
[0104] Figure 2 This is a graph showing the decomposition results of the actual data. Detailed Implementation
[0105] like Figure 1 As shown, this embodiment of the invention provides an online signal decomposition method for data streams based on multi-order harmonic priors and state recursive memory collaboration, comprising the following steps:
[0106] Step S1: Establish a collaborative recursive decomposition architecture, set hyperparameters and initialize model parameters;
[0107] Step S2: Modeling periodic components based on prior guidance of multi-order harmonics;
[0108] Step S3: Regularization constraint of periodic components based on structural mean characteristics;
[0109] Step S4: Online identification of periodic components based on adaptive momentum recursion;
[0110] Step S5: Model the trend components based on the state recursive memory mechanism;
[0111] Step S6, calibrate the trend component based on periodic mean compensation;
[0112] Step S7: Online decomposition of time-series signals based on cooperative recursion.
[0113] In step S1, the collaborative recursive decomposition architecture includes a periodic component extraction module based on multi-harmonic priors and a trend component extraction module based on state recursive memory. The trend component extraction module includes a trend component estimation model based on internal state recursion. This model generates a priori trend estimate for the current moment based on the set of trend model parameters retained from the previous moment and the model's internal state. After obtaining the periodic component estimate for the current moment, it uses the de-periodized trend model input signal and the model's internal state from the previous moment as inputs, generates the model's internal state for the current moment through state update mapping, and then obtains the original trend component estimate for the current moment through trend output mapping. The periodic component extraction module and the trend component extraction module achieve online decomposition of the data stream by executing steps S2 to S7. To support the normal operation of the above decomposition architecture, the global hyperparameters of the model need to be pre-set, and the model parameters and recursive states involved in the periodic component extraction module and the trend component extraction module need to be initialized. Specifically, this includes the following steps:
[0114] Step S11: Configure the online update strategy and internal structure of the periodic component extraction module and the trend component extraction module. For the periodic component extraction module, set the order of the Fourier series of the periodic basis function. Initial fundamental frequency Fourier coefficients and learning rate Frequency and learning rate Phase sensitivity state attenuation coefficient Exponentially Weighted Moving Average (EMA) with zero mean regularization coefficient Fourier coefficients L1 regularization intensity coefficients Gradient variational smoothing coefficient With gradient prediction coefficients And the Adaptive Moment Estimation (Adam) momentum coefficient of the periodic component extraction module. For the trend component extraction module, set the trend model learning rate. Trend mean compensation strength coefficient ;
[0115] Step S12: Initialize model parameters and recursive state, initialize the coefficients of each order basis function in the periodic component extraction module to 0, and initialize the logarithm of the angular frequency to 0. The phase state, phase sensitivity state, periodic exponentially weighted moving average (EMA) mean state, gradient variational state, first-order momentum, second-order momentum, and gradient of the previous time step are initialized to 0. The model parameters and internal state of the trend component estimation model are initialized. The model parameters include state update mapping parameters and trend output mapping parameters. The internal state of the model is used to recursively pass historical trend information between adjacent time steps, and the internal state of the model is initialized to a preset initial state.
[0116] Step S2 specifically includes:
[0117] Step S21: Based on the model parameters and internal state inherited from the trend component estimation model at the previous time step, obtain the trend prior estimate at the current time step, and subtract the trend prior estimate from the current time step input signal to obtain the detrended signal used for periodic component learning. ,in This represents the sampled value of the data stream arriving at the current time t, and serves as the input signal at the current time. This represents the prior trend estimate obtained by recursively predicting the trend component at the current moment based on the model parameters and internal state of the model used to estimate the trend component at the previous moment.
[0118] Step S22: Construct a Fourier series of constant order as the periodic basis function, representing the periodic component as a weighted combination of sine and cosine terms. This can describe simple periodic fluctuations at a single frequency, and also approximate the complex periodic structure of real time-series signals that are non-sinusoidal, irregular, but have repetitive patterns through the superposition of multiple harmonics. This achieves online parametric modeling of the periodic component, with the expression:
[0119] ,
[0120] in, This represents a periodic basis function mapping, which is a function of t, where t represents the time index of the current moment. They represent the first The Fourier coefficients of the cosine term and the Fourier coefficients of the sine term. This represents the periodic angular frequency; therefore, the parameters to be identified for the periodic model at the current time t are... Including the Fourier cosine coefficients, sine coefficients, and periodic angular frequency, it is expressed as:
[0121] ,
[0122] The known function structure of the periodic components was determined based on the Fourier series expression;
[0123] Step S23: Logarithmically parameterize the angular frequency and replace the original time index with a recursive phase variable in the Fourier series calculation. Through the mapping from logarithmic parameters to positive angular frequencies, the periodic angular frequency remains positive throughout the online identification process. Simultaneously, explicit phase recursion avoids the amplification of frequency gradients over time caused by directly using the time index. Furthermore, a phase sensitivity state is introduced to preserve the influence of frequency changes on the cumulative phase effect, thereby improving the stability of online frequency parameter updates. The periodic angular frequency is expressed as:
[0124] ,
[0125] in, This represents the logarithmic parameter of the frequency to be identified online at the current moment. The periodic angular frequency is obtained by mapping the frequency logarithmic parameter; exp represents the natural exponential function; the phase at the current time is recursively expressed as:
[0126] ,
[0127] ,
[0128] in Indicates the phase at time t. This represents the phase sensitivity state at time t, which is propagated back to the next time step along with the current model state, and serves as the inherited phase sensitivity state in the next time step, participating in the chain gradient calculation of the frequency logarithmic parameter; substituting the recursive phase into the Fourier series expression in step S22, we obtain:
[0129] ,
[0130] The parameters to be identified at this point have changed to:
[0131] ,
[0132] The online identification of periodic components is transformed from frequency learning based on the original time index to frequency learning based on the recursive phase.
[0133] Step S3 specifically includes:
[0134] Step S31: Based on the detrended input signal at the current moment and the prior estimate of the period obtained from the period parameters at the previous moment, calculate the learning error of the periodic model at the current single point. This error is used to measure the degree of fit of the current Fourier periodic response to the detrended input signal. The learning error is expressed as:
[0135] ,
[0136] ,
[0137] in, This represents the reconstruction error of the periodic model at the current moment, used to measure the degree of fit of the Fourier periodic components to the detrended input signal. Indicates using The period parameter at time t predicts the period value at the current time t;
[0138] Step S32: Construct the periodic learning target for the current single point based on the learning error. To suppress overfitting noise in the online update of Fourier coefficients, an L1 sparse regularization term is introduced for the periodic basis function coefficients. Simultaneously, the periodic exponentially weighted moving average (EMA) mean of the periodic components is maintained, forming a zero-mean constraint regularization for the periodic components, causing them to tend towards zero. The periodic components are responsible for the repetitive structure oscillating around the zero point, ensuring the uniqueness of the periodic decomposition. The recursive estimation of the periodic exponentially weighted moving average (EMA) mean is as follows:
[0139] ,
[0140] The target for online identification of periodic parameters is:
[0141] ,
[0142] in This represents the loss function of the periodic model at the current time. This indicates the state of the exponentially weighted moving average (EMA) at time t, maintained by the periodic module. This represents the periodic mean smoothing coefficient.
[0143] Step S4 specifically includes:
[0144] Step S41: Identify the target online based on the periodic parameters constructed in step S32. Calculate the single-point gradient at the current time t, and update the single-point gradient online based on the gradient adaptive momentum of the prediction mechanism. The formula is as follows:
[0145] ,
[0146] in This represents the single-point gradient of the periodic parameter at the current time t. Represents the set of periodic parameters The gradient operator; the gradient variational state is used to sense the magnitude of gradient changes between adjacent time steps. When the gradient change increases, the update step size is reduced to enhance the stability of online identification of periodic parameters. The state is represented as:
[0147] ,
[0148] The current adaptive learning rate is obtained from the gradient variational state:
[0149] ,
[0150] in, This represents the gradient variational state at time t. This represents the Fourier coefficients corresponding to the current time t, and the adaptive learning rate. This represents the frequency adaptive learning rate corresponding to the current time t;
[0151] Step S42 introduces gradient prediction correction based on the current single-point gradient. It uses the gradient difference between adjacent time steps to predict the changing trend of the periodic parameter update direction, compensating for the response lag of traditional momentum updates in dynamic time-varying periodic tracking. Combining first-order and second-order momentum, a stable online update direction is obtained, thereby improving the periodic parameter's tracking ability and update stability for time-varying periodic components; predicting the gradient. for:
[0152] ,
[0153] Adam's first-order momentum and second-order momentum are respectively:
[0154] ,
[0155] ,
[0156] ,
[0157] Finally, recursively update the parameters:
[0158] ,
[0159] in, and Let represent the first-order momentum estimate and the second-order momentum estimate at time t, respectively. This is a stabilizing term, used to prevent the denominator from being affected. When the value approaches zero, it results in division by zero; This is the first-order momentum estimate after bias correction. This is the second-order momentum estimate after bias correction; This represents the adaptive learning rate for the periodic parameters to be updated at the current moment, and for the Fourier coefficients... The value is obtained from the calculation in step S41. For the frequency logarithmic parameter The value is obtained from the calculation in step S41. ;
[0160] Step S43: Based on the updated periodic parameters and recursive phase at the current time, calculate the final periodic component estimate at the current time.
[0161] ,
[0162] in For the current moment The final output of the cycle module.
[0163] Step S5 specifically includes:
[0164] Step S51: Subtract the periodic component estimate from the current time periodic model output from the current time input signal to obtain the de-periodized trend model input signal. This allows the trend component estimation model to extract low-frequency changes and long-term evolution information from the signal after removing periodic oscillations, reducing the interference of periodic oscillations on the trend component estimation. The calculation formula is as follows:
[0165] ,
[0166] in, This represents the input signal of the trend model after de-periodization;
[0167] Step S52: Input the current time-de-periodized trend recursive input signal and the previous time-end model internal state into the trend component estimation model, and generate the current time-end model internal state through the state update mapping determined by the trend model parameter set.
[0168] ,
[0169] in, and These represent the model's internal state at the previous time step and the model's internal state at the current time step, respectively. This represents the set of trend model parameters from the previous time step. A defined state update mapping; the state update mapping adjusts the retention of historical trend information and the writing of current trend information according to the current de-periodic input signal, so that the current internal state of the model simultaneously represents historical trend evolution information and current local change information;
[0170] Step S53: Map the current time-internal state of the model to the trend output to obtain the original trend component estimate for the current time:
[0171] ,
[0172] in This indicates a trend output mapping. This represents the original trend component estimate at the current moment. Through the above state update mapping and trend output mapping, the trend component estimation model can utilize the historical trend information carried by the internal state of the model to achieve trend component extraction with both long-term smoothness and local dynamic response under the condition of single-point online update.
[0173] Step S6 specifically includes:
[0174] Step S61: Based on the original trend component estimate obtained in S5 and the periodic component estimate obtained in S4, construct a temporary reconstructed value of the input signal at the current time. Then, use the error between the temporary reconstructed value and the input signal at the current time to construct the online learning objective of the trend component estimation model. The calculation formula is as follows:
[0175] ,
[0176] ,
[0177] in, This represents the reconstructed value at the current moment obtained by combining the original trend component estimate and the periodic component estimate. This represents the learning objective for the reconstruction error of the trend component estimation model at the current moment;
[0178] Step S62: Calculate the gradient of the trend model parameters based on the online learning objective of the trend component estimation model, and perform a single-point online update of the trend model parameter set. The calculation formula is as follows:
[0179] ,
[0180] ,
[0181] in, This indicates that the trend component estimation model is at time [time]. gradient information, Represents the set of parameters relative to the trend model. gradient operator, This indicates a single point of online update operation for the standard Adam optimizer. This represents the set of trend model parameters at time t, used to determine the state update mapping and trend output mapping;
[0182] Step S63: Call the state of the periodic exponentially weighted moving average (EMA) mean value recursively maintained in step S32. ,Will The mean compensation information required for trend component calibration is used to characterize the low-frequency mean bias remaining in the periodic component. It is added as a compensation term to the original trend component to obtain the current time. The final trend component shifts the low-frequency mean bias in the periodic component to the trend component, reducing the absorption of the trend by the periodic module. The calculation formula is as follows:
[0183] ,
[0184] in, Indicates the trend mean compensation strength coefficient. This represents the final trend component estimate at the current moment.
[0185] Step S7 specifically includes:
[0186] Step S71: Based on the updated state of the periodic component model and the trend component model at the current moment, construct a recursive state set for online decomposition at the next moment. The calculation formula is as follows:
[0187] ,
[0188] ,
[0189] ,
[0190] in, This represents the set of state of the periodic component model at the current moment. These represent the first-order momentum estimate and the second-order momentum estimate maintained by the Adam momentum update strategy when the trend model performs online parameter updates in step S62; This represents the set of trend component model states at the current moment. This represents the set of model recursive states formed after the online decomposition is completed at the current moment;
[0191] Step S72: Pass the current model recursive state set back to the next time step as the initial state when the signal arrives at the next time step. The calculation formula is as follows:
[0192] ,
[0193] in This indicates the initial model state invoked when the online decomposition begins at the next moment; through state backpropagation, the periodic component model can inherit the periodic parameters, phase state, mean statistics and optimizer state of the previous moment, and the trend component estimation model can inherit the trend model parameters, internal model state and optimizer state of the current moment.
[0194] Step S73: Based on the periodic component estimate obtained in step S4 and the trend component estimate obtained in step S6, the residual component of the input signal at the current time is calculated to obtain the residual disturbance at the current time that is not explained by the trend component and the periodic component.
[0195] ,
[0196] in, Indicates the current time Residual component estimation;
[0197] Step S74: Decompose the input signal at the current time into three parts: trend component, periodic component, and residual component, and form the online decomposition result at the current time t. ,satisfy As the data stream arrives at each sampled value in sequence, steps S2 to S7 are repeated to complete periodic component learning, online identification of periodic parameters, periodic component output, trend component extraction, trend calibration, residual calculation, and status feedback for each sampled point, thus obtaining the result up to the current time. The online decomposition result sequence is expressed as:
[0198] ,
[0199] in, This represents the sequence of online decomposition results formed from the initial time to the current time. Through the above model state backpropagation and continuous online decomposition process, this method can output trend components, periodic components, and residual components point by point for continuously arriving data streams without historical data caching.
[0200] In this embodiment, the d-q coordinate transformed voltage signal of the motor drive system from the ElectricMotorTemperature dataset is selected, which can reflect the electromagnetic dynamic characteristics and control response changes of the motor under different operating conditions. The time-series data decomposition results are as follows: Figure 2 As shown, the original voltage signal exhibits a slow downward trend overall, coupled with significant periodic fluctuations. The online decomposition method proposed in this invention effectively decomposes the original signal into three parts: a trend component, a periodic component, and a residual component. The trend component stably characterizes the long-term direction of signal change, exhibiting a smooth and continuous downward process. The periodic component effectively extracts the high-frequency oscillation characteristics caused by the motor's operating mechanism and control strategy, maintaining a relatively stable amplitude structure on the time axis. These results demonstrate that the method of this invention can achieve real-time and stable online decomposition of time-series signals without relying on historical batch data, thus providing a reliable data foundation for subsequent condition monitoring and fault analysis.
[0201] This invention provides an online signal decomposition method for data streams based on the collaboration of multi-order harmonic priors and state recursive memory. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A dataflow online signal decomposition method based on multi-order harmonic prior and state recursive memory collaboration, characterized in that, Includes the following steps: Step S1: Establish a collaborative recursive decomposition architecture, set hyperparameters and initialize model parameters; Step S2: Modeling periodic components based on prior guidance of multi-order harmonics; Step S3: Regularization constraint of periodic components based on structural mean characteristics; Step S4: Online identification of periodic components based on adaptive momentum recursion; Step S5: Model the trend components based on the state recursive memory mechanism; Step S6, calibrate the trend component based on periodic mean compensation; Step S7: Online decomposition of time-series signals based on cooperative recursion.
2. The method according to claim 1, characterized in that, In step S1, the collaborative recursive decomposition architecture includes a periodic component extraction module based on multi-harmonic priors and a trend component extraction module based on state recursive memory. The trend component extraction module includes a trend component estimation model based on internal state recursion. This model generates a priori trend estimate for the current moment based on the trend model parameter set retained from the previous moment and the model's internal state. After obtaining the periodic component estimate for the current moment, it uses the de-periodized trend model input signal for the current moment and the model's internal state from the previous moment as input. It then generates the model's internal state for the current moment through state update mapping and obtains the original trend component estimate for the current moment through trend output mapping. The periodic component extraction module and the trend component extraction module achieve online decomposition of the data stream by executing steps S2 to S7. The global hyperparameters of the model are set, and the model parameters and recursive states involved in the periodic component extraction module and the trend component extraction module are initialized. The specific steps include: Step S11: Configure the online update strategy and internal structure of the periodic component extraction module and the trend component extraction module. For the periodic component extraction module, set the order of the Fourier series of the periodic basis function. Initial fundamental frequency Fourier coefficients and learning rate Frequency and learning rate Phase sensitivity state attenuation coefficient Cyclical exponential weighted moving average (EMA) zero mean regularization coefficient Fourier coefficients L1 regularization intensity coefficients Gradient variational smoothing coefficient With gradient prediction coefficients And the adaptive moment estimation of Adam momentum coefficient in the periodic component extraction module. For the trend component extraction module, set the trend model learning rate. Trend mean compensation strength coefficient ; Step S12: Initialize model parameters and recursive state, initialize the coefficients of each order basis function in the periodic component extraction module to 0, and initialize the logarithm of the angular frequency to 0. The phase state, phase sensitivity state, periodic exponentially weighted moving average (EMA) mean state, gradient variational state, first-order momentum, second-order momentum, and gradient of the previous time step are initialized to 0. The model parameters and internal state of the trend component estimation model are initialized. The model parameters include state update mapping parameters and trend output mapping parameters. The internal state of the model is used to recursively pass historical trend information between adjacent time steps, and the internal state of the model is initialized to a preset initial state.
3. The method according to claim 2, characterized in that, Step S2 specifically includes: Step S21: Based on the model parameters and internal state inherited from the trend component estimation model at the previous time step, obtain the trend prior estimate at the current time step, and subtract the trend prior estimate from the current time step input signal to obtain the detrended signal used for periodic component learning. ,in This represents the sampled value of the data stream arriving at the current time t, and serves as the input signal at the current time. This represents the prior trend estimate obtained by recursively predicting the trend component at the current moment based on the model parameters and internal state of the model used to estimate the trend component at the previous moment. Step S22: Construct a Fourier series of constant order as the periodic basis function, and express the periodic components as a weighted combination of sine and cosine terms to achieve online parametric modeling of the periodic components. The expression is: , in, This represents a periodic basis function mapping, which is a function of t, where t represents the time index of the current moment. They represent the first The Fourier coefficients of the cosine term and the Fourier coefficients of the sine term. Represents the periodic angular frequency; the parameters to be identified for the periodic model at the current time t. Including the Fourier cosine coefficients, sine coefficients, and periodic angular frequency, it is expressed as: ; Step S23: Logarithmically parameterize the angular frequency and replace the original time index with a recursive phase variable in the Fourier series calculation. Through the mapping from logarithmic parameters to positive angular frequencies, the periodic angular frequency remains positive throughout the online identification process. Simultaneously, explicit phase recursion avoids the amplification of frequency gradients over time caused by directly using the time index. Furthermore, a phase sensitivity state is introduced to preserve the influence of frequency changes on the cumulative phase effect, thereby improving the stability of online frequency parameter updates. The periodic angular frequency is expressed as: , in, This represents the logarithmic parameter of the frequency to be identified online at the current moment. The periodic angular frequency is obtained by mapping the frequency logarithmic parameter; exp represents the natural exponential function; the phase at the current time is recursively expressed as: , , in Indicates the phase at time t. This represents the phase sensitivity state at time t; substituting the recursive phase into the Fourier series expression in step S22, we obtain: , The parameters to be identified at this point have changed to: 。 4. The method according to claim 3, characterized in that, Step S3 specifically includes: Step S31: Based on the detrended input signal at the current moment and the prior estimate of the period obtained from the period parameters at the previous moment, calculate the learning error of the periodic model at the current single point. This error is used to measure the degree of fit of the current Fourier periodic response to the detrended input signal. The learning error is expressed as: , , in, This represents the reconstruction error of the periodic model at the current time. Indicates using The period parameter at time t predicts the period value at the current time t; Step S32: Construct the periodic learning target for the current single point based on the learning error. To suppress overfitting noise in the online update of Fourier coefficients, an L1 sparse regularization term is introduced for the periodic basis function coefficients. Simultaneously, the periodic exponentially weighted moving average (EMA) mean of the periodic components is maintained, forming a zero-mean constraint regularization for the periodic components, causing them to tend towards zero. The periodic components are responsible for the repetitive structure oscillating around the zero point, ensuring the uniqueness of the periodic decomposition. The recursive estimation of the periodic exponentially weighted moving average (EMA) mean is as follows: , The target for online identification of periodic parameters is: , in This represents the loss function of the periodic model at the current time. This indicates the state of the exponentially weighted moving average (EMA) at time t, maintained by the periodic module. This represents the periodic mean smoothing coefficient.
5. The method according to claim 4, characterized in that, Step S4 specifically includes: Step S41: Identify the target online based on the periodic parameters constructed in step S32. Calculate the single-point gradient at the current time t, and update the single-point gradient online based on the gradient adaptive momentum of the prediction mechanism. The gradient variational state is used to sense the gradient change magnitude at adjacent times. When the gradient change increases, the update step size is reduced. The current adaptive learning rate is obtained from the gradient variational state. Step S42: Based on the current single-point gradient, gradient prediction correction is introduced. The gradient difference between adjacent time steps is used to predict the changing trend of the periodic parameter update direction, which compensates for the response lag of traditional momentum update in dynamic time-varying periodic tracking. The first-order momentum and second-order momentum are combined to obtain a stable online update direction. Finally, the parameters are recursively updated. Step S43: Calculate the final periodic component estimate at the current time based on the updated periodic parameters and recursive phase at the current time.
6. The method according to claim 5, characterized in that, Step S5 specifically includes: Step S51: Subtract the periodic component estimate output by the periodic model at the current time from the input signal at the current time to obtain the de-periodized trend model input signal, so that the trend component estimation model can extract the low-frequency changes and long-term evolution information from the signal after removing the periodic oscillations. Step S52: Input the current de-periodized trend recursive input signal and the model internal state of the previous time into the trend component estimation model, and generate the current model internal state through the state update mapping determined by the trend model parameter set; the state update mapping adjusts the retention of historical trend information and the writing of current trend information according to the current de-periodized input signal, so that the current model internal state simultaneously represents historical trend evolution information and current local change information. Step S53: Map the current time-internal state input trend output of the model to obtain the original trend component estimate for the current time.
7. The method according to claim 6, characterized in that, Step S6 specifically includes: Step S61: Based on the original trend component estimate obtained in S5 and the periodic component estimate obtained in S4, construct a temporary reconstructed value of the input signal at the current time, and construct the online learning target of the trend component estimation model with the error between the temporary reconstructed value and the input signal at the current time. Step S62: Calculate the gradient of the trend model parameters based on the online learning target of the trend component estimation model, and perform single-point online update of the trend model parameter set; Step S63: Call the state of the periodic exponentially weighted moving average (EMA) mean value recursively maintained in step S32. ,Will The mean compensation information required for trend component calibration is used to characterize the low-frequency mean bias remaining in the periodic component. It is added as a compensation term to the original trend component to obtain the current time. The final trend component causes the low-frequency mean bias in the periodic component to shift to the trend component.
8. The method according to claim 7, characterized in that, Step S7 specifically includes: Step S71: Based on the updated state of the periodic component model and the state of the trend component model at the current moment, construct a recursive state set for online decomposition at the next moment. Step S72: The current recursive state set of the model is passed back to the next time step as the initial state when the signal arrives at the next time step. Through state backpassing, the periodic component model can inherit the periodic parameters, phase state, mean statistics and optimizer state of the previous time step, and the trend component estimation model can inherit the trend model parameters, internal state of the model and optimizer state of the current time step. Step S73: Based on the periodic component estimate obtained in step S4 and the trend component estimate obtained in step S6, perform residual component calculation on the input signal at the current time to obtain the residual disturbance at the current time that is not explained by the trend component and the periodic component. Step S74: Decompose the input signal at the current time into three parts: trend component, periodic component, and residual component, and form the online decomposition result at the current time t. As the data stream arrives at the sampled values at each time point, repeat steps S2 to S7 to complete the periodic component learning, online identification of periodic parameters, periodic component output, trend component extraction, trend calibration, residual calculation, and status feedback for each sample point, obtaining the result up to the current time. The online decomposition result sequence.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing program code that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, It stores a computer program or instructions that, when run on a computer, perform the steps of the method as described in any one of claims 1 to 8.