Time sequence prediction method and system based on frequency filtering and multi-view modeling
Through the methods of frequency filtering and multi-perspective modeling, the problems of noise removal and multi-scale information representation in time series prediction are solved, and higher prediction accuracy and robustness are achieved, especially when dealing with complex time series, which significantly improves the prediction effect.
Patent Information
- Application Number
- CN202510995554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-10
AI Technical Summary
Existing time series prediction methods have difficulty in effectively removing noise and retaining detailed information when processing high-frequency features, and their ability to represent multi-scale information is insufficient, resulting in low prediction accuracy.
The frequency filtering and multi-view modeling methods are adopted to remove noise through frequency filtering, and the intra-patch recurrent attention module and cross-patch residual attention module in the multi-view Transformer model are used to capture the periodic features within the time series segments and the long-term dependencies between segments, respectively.
It improves the accuracy and robustness of the prediction, prevents the impact of noise on the prediction results, enhances the ability to capture local dynamic changes and long-term correlations, and improves the smoothness and accuracy of the prediction curve.
Smart Images

Figure CN120764786A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of time series prediction, and in particular relates to a time series prediction method and system based on frequency filtering and multi-view modeling. Background Art
[0002] Multivariate time series forecasting plays a key role in many real-world applications involving temporal components, including predicting future weather phenomena, energy consumption, financial indicators, disease prevention measures, traffic congestion, and power dispatch. Accurate forecasting has been shown to improve resource allocation efficiency and optimize decision-making processes. It can also effectively mitigate potential risks.
[0003] Traditional time series modeling methods, including ARIMA, exponential smoothing, and state-space models, have been widely adopted for decades due to their strong theoretical foundations and interpretability. However, these methods have certain limitations when dealing with complex nonlinear structures and long-term dependencies in multivariate series.
[0004] Deep learning methods have attracted considerable attention in recent years. In particular, convolutional neural networks (CNNs), recurrent neural networks (RNNs), LSTMs, and Transformer models have demonstrated remarkable capabilities in modeling complex time series. These models are capable of discerning temporal features from a wide range of datasets, significantly improving forecasting accuracy. However, existing methods suffer from two problems: First, high-frequency features are insufficiently represented. Real sequences often contain both noise and detail in their high-frequency information. Removing the noise while preserving the sequence details is a challenge.
[0005] Second, although existing methods consider the extraction of local and global information at multiple scales, they are insufficient in representing information at specific scales. For example, within the same scale, short-term local changes occur within the same time series segment, while long-term correlations exist between different time series segments. Summary of the Invention
[0006] To overcome the shortcomings of the above-mentioned prior art, the present invention provides a time series prediction method and system based on frequency filtering and multi-view modeling. The frequency filtering method is used to remove noise while retaining effective high-frequency details. At the same time, a multi-view Transformer model is constructed, and the internal patch recurrent attention module (WPCA) is used to extract periodic features and local dynamic changes within time series segments. The cross-patch residual attention module (APRA) is used to model the long-term dependencies between different time segments.
[0007] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: A first aspect of the present invention provides a time series prediction method based on frequency filtering and multi-view modeling.
[0008] The time series prediction method based on frequency filtering and multi-view modeling includes the following steps: Obtain historical time series data and preprocess it to obtain the seasonal component; Filter the frequency domain information of the seasonal component to obtain the filtered seasonal component; The filtered seasonal components are divided into multiple scales to obtain multi-scale sequences, each of which includes multiple segments. In each scale sequence, an embedding is introduced, and multiple fragments are cyclically translated in the time dimension to generate fragments from multiple perspectives. Based on the fragments from multiple perspectives, the internal attention of the current scale sequence is calculated and aggregated to obtain the cyclic attention of the multi-scale sequence. Based on the segments in each scale sequence, the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments are calculated and fused to obtain the residual attention of the multi-scale sequence; The recurrent attention of each scale sequence and the corresponding residual attention are fused to obtain the feature representation of each scale sequence. The feature representation of multi-scale sequences is aggregated to obtain a multi-scale comprehensive feature representation. Future time series are predicted based on multi-scale comprehensive feature representation.
[0009] A second aspect of the present invention provides a time series prediction system based on frequency filtering and multi-view modeling.
[0010] Time series prediction system based on frequency filtering and multi-perspective modeling, including: The data preprocessing module is configured to: obtain historical time series data and preprocess it to obtain the seasonal component; The frequency domain filtering module is configured to: filter the frequency domain information of the seasonal component to obtain a filtered seasonal component; The multi-scale partitioning module is configured to: partition the filtered seasonal component into multiple scales to obtain a multi-scale sequence, where each scale sequence includes multiple segments; The recurrent attention calculation module is configured to: introduce an embedding within each scale sequence and perform a cyclic translation of multiple segments in the time dimension to generate segments from multiple perspectives; based on the segments from multiple perspectives, calculate the internal attention of the current scale sequence and aggregate it to obtain the recurrent attention of the multi-scale sequence; The residual attention calculation module is configured to: based on the segments in each scale sequence, calculate the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments and fuse them to obtain the residual attention of the multi-scale sequence; a polymerization module configured to fuse the cyclic attention and the corresponding residual attention of each scale sequence to obtain a feature representation corresponding to each scale sequence, and aggregate the feature representations of the multi-scale sequences to obtain a multi-scale comprehensive feature representation; a prediction module configured to predict the future time sequence based on the multi-scale comprehensive feature representation. The third aspect of the present application provides a computer readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the time series prediction method based on frequency filtering and multi-view modeling according to the first aspect of the present application.
[0011] The fourth aspect of the present application provides an electronic device comprising a memory, a processor, and a program stored on the memory and executable on the processor, wherein the processor implements the steps in the time series prediction method based on frequency filtering and multi-view modeling according to the first aspect of the present application when executing the program.
[0012] The above one or more technical solutions have the following beneficial effects: The present application provides a time series prediction method and system based on frequency filtering and multi-view modeling. Firstly, the trend component and the seasonal component in the historical time series data are separated. The trend component changes more obviously and is easier to predict. For the seasonal component, the frequency domain information of the seasonal component is filtered based on the defined critical frequency, only the most important frequency domain information is retained, noise is reduced, prediction accuracy is increased, and the obtained prediction curve is smoother and more accurate.
[0013] The present application provides a multi-view patch Transformer block (MVPB) comprising a parallel Within-Patch Cyclic Attention (WPCA) and Across-Patch Residual Attention (APRA). Overall, the WPCA introduces a cyclic shift strategy to model within the patch, fully capturing the information of each patch from each view. The APRA models between patches by combining the residual of adjacent patches, fills in the captured information, and prevents sudden changes from affecting the prediction results.
[0014] In the WPCA, an embedding quantity is introduced for each scale sequence, a periodic shift strategy is adopted, and multiple patches are cyclically shifted in the time dimension. Multiple view sequences are constructed for each patch to generate multiple view patches. Attention mechanism is used to extract and fuse information under multiple views to enhance the representation ability.
[0015] In APRA, based on each scale sequence, the original patch representation and the lagged differential representation are used for parallel modeling. The attention within the current scale sequence and the lagged differential attention between adjacent scale sequences are calculated separately. The two attention outputs are fused through a gating mechanism to enhance the perception of mutations and changing trends.
[0016] The present invention filters the frequency domain amplitude information, retains only the amplitude useful for prediction, and then fuses it with the original sequence through energy weighting, effectively preventing information loss.
[0017] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0019] Figure 1 This is a diagram of the overall algorithm framework of the time series prediction method based on FMVformer described in an embodiment of the present invention.
[0020] Figure 2 This is a comparison chart of the Weather dataset before and after FFB processing in Example 1 of the present invention.
[0021] Figure 3 Schematic diagram of the structure of the frequency filter module (FFB) in the first embodiment of the present invention.
[0022] Figure 4 Schematic diagram of the structure of the internal patch recurrent attention (WPCA) in the second embodiment of the present invention.
[0023] Figure 5 This is a structural diagram of the Across-Patch Residual Attention (APRA) in the second embodiment of the present invention.
[0024] Figure 6 Schematic diagram of the overall process of multi-scale segmentation and multi-scale aggregation in the second embodiment of the present invention. DETAILED DESCRIPTION
[0025] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0026] It should be noted that the terms used herein are for describing particular embodiments only and are not intended to limit the exemplary embodiments according to the present invention.
[0027] In the case of no conflict, the embodiments in the application and the features in the embodiments can be combined with each other.
[0028] The overall idea proposed in the application is: The application provides a time series prediction method and system based on frequency filtering and multi-view modeling, which proposes the following two targeted solutions from multiple aspects of data preprocessing, feature modeling to feature fusion: First, the insufficient representation of historical sequence features is the main bottleneck in current prediction models. High-frequency components usually contain important details, but are also mixed with a large amount of noise. How to exclude interference while retaining effective information is a long-standing problem that has not been fully solved. To this end, the application designs a frequency filtering module to effectively filter high-frequency components, improve the noise immunity of the model, and prevent the loss of detailed information.
[0029] Second, the existing methods still lack the ability to model multi-scale time structures. Although some works try to combine local and global information together, it is still insufficient to capture information at a specific scale. At the same scale, a time series segment may contain short-term local fluctuations and long-term correlation structures, and the dynamics of these features are not consistent between segments. In order to solve this problem, the application proposes a multi-view patch Transformer block (MVPB) to consider different angles and scales in a unified framework. For time series segments, the application models multiple views within a segment through a time dimension cyclic shift strategy, and models multiple views between segments by combining the residuals of adjacent patches, thereby realizing multi-view modeling.
[0030] Embodiment one The embodiment discloses a time series prediction method based on frequency filtering and multi-view modeling.
[0031] As shown in Figure 1 The time series prediction method based on frequency filtering and multi-view modeling comprises the following steps: Obtain historical time series data, and preprocess to obtain seasonal components therein; Filter the frequency domain information of the seasonal components to obtain filtered seasonal components; Divide the filtered seasonal components into multiple scales, and obtain multiple scale sequences, each scale sequence comprising multiple segments; In each scale sequence, an embedding quantity is introduced, and multiple segments are cyclically shifted in the time dimension to generate multiple view segments; based on the multiple view segments, the internal attention of the current scale sequence is calculated, and the cyclic attention of the multi-scale sequence is aggregated; Based on the segments in each scale sequence, the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments are calculated and fused to obtain the residual attention of the multi-scale sequence; The recurrent attention of each scale sequence and the corresponding residual attention are fused to obtain the feature representation of each scale sequence. The feature representation of multi-scale sequences is aggregated to obtain a multi-scale comprehensive feature representation. Future time series are predicted based on multi-scale comprehensive feature representation.
[0032] This embodiment proposes a new time series prediction framework FMVformer, which consists of two parts: a frequency filter module (FFB) and a multi-view Transformer module (MVPB) to solve the modeling problem of filtered multi-view time series.
[0033] The frequency filtering module (FFB) reduces the impact of noise on the prediction results, and adopts a new adaptive fusion method to combine the time domain information of the input sequence with the frequency domain information to reduce the loss of detail information.
[0034] MVPB consists of two parallel modules to capture multi-view features of a sequence. On the one hand, the intra-patch recurrent attention (WPCA) introduces a temporal recurrent translation strategy to model within patches, aiming to comprehensively perceive local dynamic changes. On the other hand, the inter-patch residual attention (APRA) extracts long-term features by combining the residual attention of adjacent patches with the original sequence attention.
[0035] Next, the technical solution of this embodiment will be explained in detail with reference to the accompanying drawings.
[0036] The embodiment of the present invention provides a method for preprocessing sequence data, such as Figure 1 As shown in the figure, the input sequence is processed from the time domain to the frequency domain by fast Fourier transform, and then the sequence is converted from the frequency domain back to the time domain by inverse fast Fourier transform. A new adaptive fusion method is used to combine the time domain information of the input sequence with the frequency domain information to reduce the loss of detail information.
[0037] Given a historical sequence of input The present invention performs the following steps in sequence: first, the present invention uses the sliding mean to decompose the sequence, The sliding mean of the time steps is:
[0038] in is the size of the sliding window, is the time step in the sliding window, For the past The present invention uses multiple windows of different sizes and then calculates the mean of multiple trend sequences to obtain the final trend component. , to improve robustness:
[0039]
[0040] This gives the seasonal components:
[0041] Because the trend component changes more obviously and is easier to predict, the present invention only processes the seasonal component during the modeling process. First, the present invention uses fast Fourier transform to Switching to the frequency domain for analysis can effectively capture the periodicity of the sequence, separate the noise, and retain more useful periodic information:
[0042] in is the frequency information of the seasonal component, The seasonal component is transformed into a complex spectrum of frequency domain information. The present invention only retains the amplitude information, such as Figure 2 As shown, taking the weather dataset as an example, the time series curve (red curve) exhibits many small fluctuations. These small fluctuations only have a side effect on time series prediction and do not increase prediction accuracy. Instead, they cause the predicted curve (blue curve) to exhibit many small fluctuations, reducing performance. In the frequency domain, these small fluctuations represent high-frequency information. Therefore, the present invention filters the frequency domain information of the time series, retaining only the most important frequency domain information to reduce noise and increase prediction accuracy. As shown in the figure, the prediction curve after processing using the Frequency Filter Block in the present invention is relatively smooth and has higher accuracy. The filtered amplitude information can be expressed as:
[0043] in The number of harmonics is defined, and then the filtered amplitude information is inverse fast Fourier transformed to restore the time domain signal:
[0044] In order to further optimize and prevent the loss of some important details, the present invention calculates the energy proportion of the main harmonics as the weight. and To perform the fusion:
[0045]
[0046]
[0047]
[0048] in, for Maximum amplitude frequency, is the sum of the energy of multiple harmonic frequencies of the maximum amplitude frequency. The overall process is as follows Figure 3 shown.
[0049] This example also proposes a Multi-View Patch Transformer Block to capture multi-scale features of sequences. This module consists of two parallel modules: Within-Patch Cyclic Attention (WPCA), which introduces a cyclic translation strategy to model the interior of the patch, fully capturing information from each patch across all viewpoints. Across-Patch Residual Attention (APRA), which combines the residuals of adjacent patches to model the inter-patch space, fills in the captured information and prevents sudden changes from affecting the prediction results.
[0050] Multi-scale Division: Previous work has emphasized the importance of multi-scale modeling. In order to capture the dynamic characteristics of time series at different time granularities, this paper divides the time series into Univariate series For example, the present invention defines a patch set , where each Represents a defined patch size, for each scale , will Divided into non-overlapping patches, each patch fragment Independent input to the model to capture the features inside the patch in detail, where , by considering each variable, it is extended to the multivariate case. By performing this operation in parallel on the input sequence, a set of multi-scale sequences can be obtained, providing rich contextual information for the subsequent designed attention module.
[0051] It can be understood that each of the above Represents a defined patch size, that is, the multiple different fragments included in each scale sequence mentioned above.
[0052] Within-Patch Cyclic Attention (WPCA): like Figure 4 This module aims to model local temporal features within a patch. Unlike traditional attention mechanisms, the WPCA module introduces a cyclic translation strategy in the time dimension. For a patch, it constructs multiple versions of its internal sequence. This helps better capture the cyclical characteristics of the sequence, improves the model's ability to perceive dynamic changes in the sequence, and enhances robustness. Compared to standard attention, WPCA uses multiple time series to enhance the query's contextual representation capabilities and reduces computational complexity without losing important information. The following describes this process in detail: Consider one of the patches at a scale , introduce a learnable embedding , inserted into the original patch sequence Before, formed ,Will Along the feature dimension Embed, get the embedding result , this process can be described as:
[0053]
[0054] in represents the dimension of the embedding, in terms of period length For units, Perform cyclic translation in the time dimension to generate patch sequences of multiple perspectives:
[0055]
[0056] in For the generated patch sequences of multiple perspectives, represents the number of cyclic translations, and then the present invention stacks the patch sequences of multiple perspectives and takes the first time step to form a set, thereby obtaining and , That is ,calculate Attention output of the first time step under multiple views , and obtain the characteristic manifestation of the patch. This approach of the present invention can reflect the overall expressive ability of "this patch at different starting points" and is a multi-angle observation of the patch.
[0057]
[0058] Will Different patch sequences are subjected to the above operations to obtain the internal attention outputs of various patches at different perspectives, and finally these attention outputs are aggregated to obtain The overall output is the representation of the inter-patch information of the sequence at this scale:
[0059] Across-Patch Residual Attention (APRA): In time series prediction, dividing the time series into multiple patches can effectively capture the long-term characteristics of the time series, but there are complex cross-time dynamic interactive relationships between patches, which are complex and changeable. In order to effectively model these relationships, the present invention designs an APRA module to capture the dependencies and coordinated changes between multiple patches. Compared with simply paying attention to the original patch, the method of the present invention can effectively reduce the impact of noise on the prediction results, and can also provide information for subsequent predictions by capturing the change relationship between adjacent patches. The present invention designs a dual-branch attention mechanism: one branch acts on the original patch representation, and the other acts on the lagged difference representation, and the two are fused through a gating mechanism. The lagged difference can pay close attention to the rate of change between patches and improve sensitivity to mutation trends. The overall process is as follows Figure 5 As shown: After multi-scale division, the input sequence is divided into multiple scales. Considering one of the scales, the input sequence is further divided into multiple patches, each of which contains continuous observations of multiple variables. This paper first performs linear embedding on each patch. Each patch is flattened and then encoded through a linear layer as:
[0060] After stacking all the patch representations, we get , which is the encoding representation of the current scale, where To embed the dimension, the present invention then calculates the lagged difference of the patch:
[0061] in, is the difference between the encoding representations of adjacent segments, i.e., the lagged difference; is the encoding representation of the fragment at the current time step; is the encoded representation of the fragment at the previous time step.
[0062] The present invention adopts two paths for parallel modeling. One path is based on Calculate attention for the input, and the other is based on Compute the lagged differential attention for the input, and The key and value in the attention operation are obtained respectively. The present invention uses a trainable query matrix to merge the context information between patches. The detailed process is as follows:
[0063] .
[0064] is the attention between segments of the current scale sequence; is the lagged differential attention between adjacent segments of the current scale sequence.
[0065] To avoid information discontinuity after differencing, the outputs of the lagged paths are aligned backward in time and then added back to the original sequence:
[0066]
[0067] for lagged differential attention after right alignment; Optimized lagged differential attention.
[0068] ShiftRight is a tensor right shift operation, which shifts the time series to the right by one position in the time dimension and fills the front with zeros. Finally, the present invention fuses the outputs of the two paths through a gating mechanism:
[0069]
[0070]
[0071] Fusion: At each scale, intra-patch attention output and cross-patch attention output are extracted separately and then fused after being mapped to a unified dimension through a linear transformation. This process integrates local details with global dependencies.
[0072] Multi-scale Aggregation: like Figure 6As shown, at each scale, the present invention extracts the intra-patch attention output and the inter-patch attention output, maps them to a unified dimension via a linear transformation, and then fuses them to integrate local details and global dependencies. Finally, the present invention concatenates the fused outputs obtained at all scales along the feature dimension to form a multi-scale comprehensive feature representation. This is then compressed into a unified representation vector via a shared linear transformation (i.e., a fully connected layer) for subsequent prediction tasks. This allows the model to extract rich dynamic representations from multiple temporal scales and attention dimensions, significantly improving its ability to model complex time series patterns.
[0073] After acquiring the historical time series data to be predicted, this implementation uses a frequency filtering module to preprocess the (FFB) historical time series to obtain seasonal and trend series. The seasonal series is frequency filtered to preserve periodicity and local variation. A multi-view Transformer model is constructed to encode and model the processed sequence data and output predictions. Before modeling, the input sequence is partitioned into multiple scales, and segments at each scale are fed into separate WPCA and APRA modules for modeling. After modeling is complete at all scales, the output features from multiple scales are fused, concatenated, and compressed into a unified representation vector using a fully connected layer for the final prediction.
[0074] The multi-view Transformer model consists of two parallel submodules: (1) The internal patch recurrent attention module (WPCA) is used to extract periodic features and local dynamic changes within time series segments. The WPCA module introduces a periodic translation strategy to construct multiple view sequences for each patch. The attention mechanism is used to extract and fuse information from multiple viewpoints to enhance representation capabilities.
[0075] (2) The Across-Patch Residual Attention (APRA) module is used to model long-term dependencies between different time segments. The APRA module uses the original patch representation and the lagged differential representation for parallel modeling, and fuses the two attention outputs through a gating mechanism to enhance the perception of mutations and changing trends.
[0076] Example 2 This embodiment discloses a time series prediction system based on frequency filtering and multi-view modeling.
[0077] Time series prediction system based on frequency filtering and multi-perspective modeling, including: The data preprocessing module is configured to: obtain historical time series data and preprocess it to obtain the seasonal component; The frequency domain filtering module is configured to: filter the frequency domain information of the seasonal component to obtain a filtered seasonal component; The multi-scale partitioning module is configured to: partition the filtered seasonal component into multiple scales to obtain a multi-scale sequence, where each scale sequence includes multiple segments; The recurrent attention calculation module is configured to: introduce an embedding within each scale sequence and perform a cyclic translation of multiple segments in the time dimension to generate segments from multiple perspectives; based on the segments from multiple perspectives, calculate the internal attention of the current scale sequence and aggregate it to obtain the recurrent attention of the multi-scale sequence; The residual attention calculation module is configured to: based on the segments in each scale sequence, calculate the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments and fuse them to obtain the residual attention of the multi-scale sequence; The aggregation module is configured to: fuse the recurrent attention of each scale sequence with the corresponding residual attention to obtain the feature representation of each scale sequence, and aggregate the feature representations of multi-scale sequences to obtain a multi-scale comprehensive feature representation; The prediction module is configured to predict future time series based on multi-scale comprehensive feature representation. Example 3 The purpose of this embodiment is to provide a computer-readable storage medium.
[0078] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the time series prediction method based on frequency filtering and multi-perspective modeling as described in Example 1 of the present disclosure.
[0079] Example 4 The purpose of this embodiment is to provide an electronic device.
[0080] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps of the time series prediction method based on frequency filtering and multi-perspective modeling as described in Example 1 of the present disclosure are implemented.
[0081] The steps involved in the apparatuses of Examples 2, 3, and 4 above correspond to those of Method Example 1. For detailed implementations, please refer to the relevant description of Example 1. The term "computer-readable storage medium" should be understood to mean a single medium or multiple media containing one or more instruction sets; it should also be understood to include any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and causing the processor to perform any method of the present invention.
[0082] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computer device. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0083] Although the above describes the specific embodiments of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without any creative work are still within the scope of protection of the present invention.
Claims
1. A time series prediction method based on frequency filtering and multi-view modeling, characterized by: The following steps are involved: Obtain historical time series data and preprocess it to obtain the seasonal component; Filter the frequency domain information of the seasonal component to obtain the filtered seasonal component; The filtered seasonal components are divided into multiple scales to obtain multi-scale sequences, each of which includes multiple segments. In each scale sequence, an embedding is introduced, and multiple fragments are cyclically translated in the time dimension to generate fragments from multiple perspectives. Based on the fragments from multiple perspectives, the internal attention of the current scale sequence is calculated and aggregated to obtain the cyclic attention of the multi-scale sequence. Based on the segments in each scale sequence, the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments are calculated and fused to obtain the residual attention of the multi-scale sequence; The recurrent attention of each scale sequence and the corresponding residual attention are fused to obtain the feature representation of each scale sequence. The feature representation of multi-scale sequences is aggregated to obtain a multi-scale comprehensive feature representation. Future time series are predicted based on multi-scale comprehensive feature representation.
2. The time series prediction method based on frequency filtering and multi-view modeling according to claim 1, characterized in that: Obtain historical time series data and preprocess it to obtain the seasonal component, including: Set windows of different sizes and use sliding mean to decompose the historical time series to obtain multiple trend series; Calculate the mean of multiple trend series to obtain trend components; The trend component is separated from the historical time series to obtain the seasonal component.
3. The time series prediction method based on frequency filtering and multi-view modeling according to claim 1, characterized in that: The frequency domain information of the seasonal component is filtered to obtain the filtered seasonal component, which specifically includes: Based on the defined critical frequency, the frequency domain information of the seasonal component is filtered to obtain the filtering result; The weight is calculated based on the energy proportion of the main harmonics, and the filtered results and the original seasonal components are adaptively weighted fused to obtain the filtered seasonal components.
4. The time series prediction method based on frequency filtering and multi-view modeling according to claim 3, characterized in that: The frequency domain information of the seasonal component is filtered based on the following formula: ; in is the number of harmonics defined, is the frequency information of the seasonal component, is the complex spectrum transformed from seasonal component to frequency domain information, for Maximum amplitude frequency; represents the frequency domain amplitude after filtering; The filtered results and the original seasonal components are adaptively weighted and fused based on the following formula: ; ; ; ; in, It is the sum of the energy of multiple harmonic frequencies of the maximum amplitude frequency; For the original seasonal component; for The result obtained after frequency domain filtering; is the final output after adaptive fusion.
5. The time series prediction method based on frequency filtering and multi-view modeling according to claim 1, characterized in that: In each scale sequence, an embedding is introduced and multiple segments are cyclically shifted in the time dimension to generate segments from multiple perspectives, including: First, the introduced embedding q is inserted before the first segment of the current scale sequence; Embed the embedding along the feature dimension of the first segment to obtain the embedding result ; The embedding result is calculated along the time dimension with the set period length as the unit. Perform circular translation on other clips following the first clip to obtain clips with multiple perspectives , K is the number of translations.
6. The time series prediction method based on frequency filtering and multi-view modeling according to claim 5, characterized in that: Based on the fragments of multiple perspectives, the internal attention of the current scale sequence is calculated and the recurrent attention of the multi-scale sequence is aggregated, which includes: The fragments of multiple perspectives in the corresponding scale sequence Stack and take the first time step to form a set, and get and , where p is the p-th segment of each scale sequence; The introduced embedding amount q is taken as ; Calculate the embedding q and the attention output of the first time step under multiple views , get the features of the corresponding scale sequence, that is, the internal attention of the current scale sequence; Aggregate multiple internal attentions corresponding to multi-scale sequences to obtain the recurrent attention of multi-scale sequences.
7. The time series prediction method based on frequency filtering and multi-view modeling according to claim 1, characterized in that: Based on the segments in each scale sequence, the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments are calculated and fused to obtain the residual attention of the multi-scale sequence, which specifically includes: Multiple segments of the current scale sequence are linearly embedded and stacked to obtain the encoding representation of the current scale; Calculate the difference between the encoded representations of adjacent segments in the current scale sequence to obtain the lagged difference; Based on the encoding representation of the current scale, calculate the inter-fragment attention of the current scale sequence; Based on the lagged difference, the lagged difference attention between adjacent segments of the current scale sequence is calculated; Align the lagged differential attention backward in the time dimension and then add it to the encoding representation of the current scale to obtain the optimized lagged differential attention; Based on the gating mechanism, the inter-fragment attention of the current scale sequence and the optimized lagged differential attention are fused to obtain the residual attention of the current scale sequence.
8. A time series prediction system based on frequency filtering and multi-view modeling, characterized by: include: The data preprocessing module is configured to: obtain historical time series data and preprocess it to obtain the seasonal component; The frequency domain filtering module is configured to: filter the frequency domain information of the seasonal component to obtain a filtered seasonal component; The multi-scale partitioning module is configured to: partition the filtered seasonal component into multiple scales to obtain a multi-scale sequence, where each scale sequence includes multiple segments; The recurrent attention calculation module is configured to: introduce an embedding within each scale sequence and perform a cyclic translation of multiple segments in the time dimension to generate segments from multiple perspectives; based on the segments from multiple perspectives, calculate the internal attention of the current scale sequence and aggregate it to obtain the recurrent attention of the multi-scale sequence; The residual attention calculation module is configured to: based on the segments in each scale sequence, calculate the inter-segment attention of the current scale sequence and the lagged differential attention between adjacent segments and fuse them to obtain the residual attention of the multi-scale sequence; The aggregation module is configured to: fuse the recurrent attention of each scale sequence with the corresponding residual attention to obtain the feature representation of each scale sequence, and aggregate the feature representations of multi-scale sequences to obtain a multi-scale comprehensive feature representation; The prediction module is configured to predict future time series based on multi-scale comprehensive feature representation.
9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps of the time series prediction method based on frequency filtering and multi-view modeling as described in any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the time series prediction method based on frequency filtering and multi-perspective modeling as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Long time sequence prediction method based on time-varying period coding and hierarchical channel fusion
CN121744245A
Long sequence prediction method based on time-varying period encoding and hierarchical channel fusion
CN121744245B