Prediction method and prediction device for time series and electronic equipment

By performing wavelet decomposition and attention weight adjustment on multivariate time series data, the problem of low prediction accuracy caused by uniform attention distribution in the prior art is solved, and higher prediction accuracy is achieved.

CN119646443APending Publication Date: 2025-03-18BINZHOU WEIQIAO NATIONAL SCIENCE & TECHNOLOGY ADVANCED TECHNOLOGY RESEARCH INSTITUTE +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411727578.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When processing multivariate time series data in the prior art, the prediction model based on the self-attention mechanism is too uniform to accurately focus on key information in the time series, resulting in low prediction accuracy.

Method used

By performing learning wavelet decomposition on the received original time series, identifying the power spectrum of low- and high-frequency components, determining the dominant period of each variable, and adjusting the attention weight distribution of the prediction model based on periodic characteristics.

Benefits of technology

Improve the prediction accuracy of multivariate time series data, ensure that the attention weight distribution is compatible with the input data, and can accurately focus on key information in the time series.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646443A_ABST
    Figure CN119646443A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of time sequence prediction, and discloses a prediction method and a prediction device for a time sequence, and electronic equipment. The prediction method comprises the following steps: performing learnable wavelet decomposition processing on a received original time sequence to obtain a low-frequency component power spectrum and a high-frequency component power spectrum of the original time sequence; identifying peak values of the low-frequency component power spectrum and the high-frequency component power spectrum, and determining a dominant period of each variable in the original time sequence; according to the periodic characteristics of the dominant period, adjusting the attention weight distribution of the prediction model according to a periodic attenuation attention strategy; and inputting the original time sequence into the prediction model after the attention weight distribution is adjusted to obtain a time sequence prediction result. According to the method and the device, in the face of multivariable time sequence data, the attention weight distribution of the prediction model adapts to the data condition of the original time sequence, so that the condition that the attention distribution is too uniform is avoided, and the accuracy of the obtained time sequence prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of time series prediction, for example, to a prediction method and prediction device and electronic equipment for time series. Background Art

[0002] Currently, time series forecasting has been widely used in many key fields such as finance, healthcare, and the Internet of Things.

[0003] In the related art, a subsequent time series is usually predicted based on a pre-built prediction model and input time series data.

[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:

[0005] The prediction models in related technologies are usually based on the self-attention mechanism to globally model the interaction between variables. However, when processing multivariate time series data, this approach will cause the attention to be too evenly distributed, and it will not be able to accurately focus on the key information in the time series data, resulting in low accuracy of the predicted time series. Therefore, when performing subsequent time series predictions based on multivariate time series data, how to improve the accuracy of the obtained time series prediction results has become a technical problem that needs to be solved urgently. Summary of the invention

[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0007] The embodiments of the present disclosure provide a prediction method and prediction device and electronic device for time series, which can improve the accuracy of the obtained time series prediction results when performing subsequent time series prediction based on multivariate time series data.

[0008] In some embodiments, a prediction method for time series includes: performing learnable wavelet decomposition processing on the received original time series to obtain the low-frequency component power spectrum and the high-frequency component power spectrum of the original time series; identifying the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum to determine the dominant period of each variable in the original time series; adjusting the attention weight distribution of the prediction model according to the periodic characteristics of the dominant period and the periodic attenuation attention strategy; inputting the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0009] Optionally, the received original time series is subjected to learnable wavelet decomposition processing to obtain the low-frequency component power spectrum and the high-frequency component power spectrum of the original time series, including: using a Morlet wavelet filter to identify the real convolution value and the imaginary convolution value of the original time series; calculating the power of the low-frequency component in the original time series according to the real convolution value to determine the low-frequency component power spectrum of the original time series; calculating the power of the high-frequency component in the original time series according to the imaginary convolution value to determine the high-frequency component power spectrum of the original time series.

[0010] Optionally, a Morlet wavelet filter is used to identify the real convolution value and the imaginary convolution value of the original time series, including: using the real function of the Morlet wavelet filter to process the original time series to determine the real convolution value; using the imaginary function of the Morlet wavelet filter to process the original time series to determine the imaginary convolution value.

[0011] Optionally, the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum are identified to determine the dominant period of each variable in the original time series, including: for each variable in the original time series, determining the maximum peak among the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum; determining the dominant period of each variable based on the scale associated with the maximum peak.

[0012] Optionally, according to the periodic characteristics of the dominant cycle, the attention weight distribution of the prediction model is adjusted according to the periodic attenuation attention strategy, including: calculating the Gaussian attenuation matrix of the original time series according to the periodic characteristics of the dominant cycle, and calculating the vector adjustment matrix for the query vector Q in the attention mechanism; calculating the attention score matrix according to the Gaussian attenuation matrix and the vector adjustment matrix; calculating the attention weights corresponding to the original time series according to the attention score matrix, and adjusting the attention weight distribution of the prediction model based on the attention weights.

[0013] Optionally, the Gaussian attenuation matrix of the original time series is calculated according to the periodic characteristics of the dominant period, including: determining the position difference matrix according to the periodic characteristics of the dominant period; substituting the position difference matrix into the Gaussian attenuation function to determine the Gaussian attenuation weight matrix corresponding to the original time series.

[0014] Optionally, a vector adjustment matrix for the query vector Q in the attention mechanism is calculated based on the periodic characteristics of the dominant period, including: constructing a periodic function corresponding to the periodic characteristics of the dominant period; calculating a weight adjustment matrix based on the periodic function; and calculating a vector adjustment matrix based on the weight adjustment matrix and the query vector Q in the attention mechanism.

[0015] In some embodiments, a prediction device for time series includes: a wavelet decomposition module, configured to perform a learnable wavelet decomposition process on a received original time series to obtain a low-frequency component power spectrum and a high-frequency component power spectrum of the original time series; the wavelet decomposition module is also configured to identify the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum to determine the dominant period of each variable in the original time series; an attention adjustment module, configured to adjust the attention weight distribution of the prediction model according to a periodic attenuation attention strategy based on the periodic characteristics of the dominant period; and a prediction module, configured to input the original time series into the prediction model after adjusting the attention weight distribution to obtain a time series prediction result.

[0016] In some embodiments, a prediction device for time series includes a processor and a memory storing program instructions, and the processor is configured to execute the prediction method for time series as described above.

[0017] In some embodiments, an electronic device includes: a device body; and a prediction device for time series as described above, which is disposed in the device body.

[0018] The prediction method, prediction device, and electronic device for time series provided by the embodiments of the present disclosure can achieve the following technical effects:

[0019] In the embodiment of the present disclosure, after receiving the original time series, first, the original time series will be subjected to learnable wavelet decomposition to determine the power of the low-frequency component (i.e., the power spectrum of the low-frequency component) and the power of the high-frequency component (i.e., the power spectrum of the high-frequency component) in the original time series, and the dominant period of each variable in the original time series will be identified according to the peak values ​​of the power spectrum of the low-frequency component and the power spectrum of the high-frequency component. Then, the attention weight distribution of the prediction model will be adjusted according to the periodic attenuation attention strategy according to the periodic characteristics of the dominant period of each variable. Finally, the original time series is input into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result. In this way, when facing multivariate time series data, the attention weight distribution of the prediction model is adapted to the data situation of the input original time series, and there will be no situation where the attention distribution is too uniform, resulting in the inability to focus on the key information in the original time series. Therefore, when the embodiment of the present disclosure performs subsequent time series prediction based on multivariate time series data, the accuracy of the obtained time series prediction results can be improved.

[0020] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:

[0022] Figure 1 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure;

[0023] Figure 2 is a schematic diagram of a prediction method for time series provided by an embodiment of the present disclosure;

[0024] Figure 3 is a schematic diagram of another prediction method for time series provided by an embodiment of the present disclosure;

[0025] Figure 4 is a schematic diagram of another prediction method for time series provided by an embodiment of the present disclosure;

[0026] Figure 5 is a schematic diagram of a multi-level prediction model provided by an embodiment of the present disclosure;

[0027] Figure 6 is a schematic diagram of a prediction device for time series provided by an embodiment of the present disclosure;

[0028] Figure 7 It is a schematic diagram of another prediction device for time series provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0030] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0031] Unless otherwise stated, the term "plurality" of a feature means two or more.

[0032] In the embodiment of the present disclosure, the character " / " feature indicates that the preceding and following objects are in an "or" relationship. For example, the A / B feature indicates: A or B.

[0033] The term "and / or" is a description of the association relationship between objects, and the characteristic indicates that there can be three relationships. For example, A and / or B, the characteristic indicates: A or B, or, A and B.

[0034] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0035] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0036] like Figure 1 As shown, the electronic device 100 provided by the embodiment of the present disclosure includes a device body 110 and a prediction device 600 (700) for time series.

[0037] Specifically, the prediction device 600 ( 700 ) for time series is disposed in the device body 110 .

[0038] Optionally, the prediction device 700 for time series includes a processor. After receiving the original time series, the processor can perform Learnable Wavelet Decomposition (LWT) processing on the original time series to obtain the low-frequency component power spectrum and the high-frequency component power spectrum of the original time series, and can determine the dominant period of each variable in the original time series by identifying the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum. After identifying the dominant period of each variable in the original time series, the processor can adjust the attention weight distribution of the prediction model according to the periodic characteristics of the dominant period and the periodic decay attention (PDA) strategy, and can input the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0039] In combination with the above electronic device, the present disclosure provides a method for predicting time series, such as Figure 2 As shown, the prediction method includes:

[0040] S201, the processor performs learnable wavelet decomposition processing on the received original time series to obtain a low-frequency component power spectrum and a high-frequency component power spectrum of the original time series.

[0041] Specifically, the original time series is obtained by Indicates that L is the sequence length and C is the total number of channels (i.e. the total number of variables).

[0042] Specifically, the original time series is the multivariate time series data to be processed. Taking the original time series as the time series data in the financial field as an example, the variables of the time series may include variables such as price, transaction volume and profit rate.

[0043] Specifically, low-frequency components can reflect long-term trends or periodic changes in the original time series, while high-frequency components can reflect short-term fluctuations or noise in the original time series.

[0044] Specifically, a learnable wavelet decomposition unit is pre-deployed in the electronic device. After receiving the original time series, the processor can perform wavelet decomposition on the original time series through the learnable wavelet decomposition unit, capture the low-frequency components and high-frequency components in the original time series, and determine the low-frequency component power spectrum and high-frequency component power spectrum of the original time series.

[0045] S202, the processor identifies the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum, and determines the dominant period of each variable in the original time series.

[0046] Specifically, the peak in the power spectrum represents the frequency component with the highest energy, that is, the most significant periodic feature. Therefore, the frequency component corresponding to the peak can be considered as the dominant frequency in the original time series, and the relationship between frequency and period is certain. Therefore, based on the peak values ​​of the power spectrum of the low-frequency component and the power spectrum of the high-frequency component, the dominant period of each variable in the original time series can be determined.

[0047] S203, the processor adjusts the attention weight distribution of the prediction model according to the periodic characteristics of the dominant period and the periodic attenuation attention strategy.

[0048] Specifically, the periodic decay attention strategy is a pre-set strategy that dynamically adjusts the attention weight distribution in the prediction model using Gaussian decay according to the periodic characteristics of the dominant period of each variable in the original time series.

[0049] Specifically, after determining the periodic characteristics of the dominant period of each variable in the original time series, it can be determined which variables need to be focused on when predicting the subsequent time series based on the original time series. Therefore, the processor can adjust the attention weight distribution of the prediction model according to the periodic decay attention strategy based on the determined periodic characteristics of the dominant period.

[0050] S204, the processor inputs the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0051] In the embodiment of the present disclosure, after receiving the original time series, first, the original time series will be subjected to learnable wavelet decomposition to determine the power of the low-frequency component (i.e., the power spectrum of the low-frequency component) and the power of the high-frequency component (i.e., the power spectrum of the high-frequency component) in the original time series, and the dominant period of each variable in the original time series will be identified according to the peak values ​​of the power spectrum of the low-frequency component and the power spectrum of the high-frequency component. Then, the attention weight distribution of the prediction model will be adjusted according to the periodic attenuation attention strategy according to the periodic characteristics of the dominant period of each variable. Finally, the original time series is input into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result. In this way, when facing multivariate time series data, the attention weight distribution of the prediction model is adapted to the data situation of the input original time series, and there will be no situation where the attention distribution is too uniform, resulting in the inability to focus on the key information in the original time series. Therefore, when the embodiment of the present disclosure performs subsequent time series prediction based on multivariate time series data, the accuracy of the obtained time series prediction results can be improved.

[0052] The present disclosure provides another method for predicting time series. Figure 3 As shown, the prediction method includes:

[0053] S301, the processor uses a Morlet wavelet filter to identify the real convolution value and the imaginary convolution value of the original time series.

[0054] Specifically, the Morlet wavelet filter is a filter constructed using the Morlet wavelet as a basic wavelet function. Specifically, the Morlet wavelet function is shown in the following expression (1).

[0055]

[0056] Among them, t is time, ω0 is the center frequency of the wavelet, and σ represents the bandwidth, which is used to control the degree of diffusion of the wavelet in the time domain.

[0057] Specifically, the original time series is input into the Morlet wavelet filter to obtain the real convolution value and the imaginary convolution value of the original time series.

[0058] Optionally, a Morlet wavelet filter is used to identify the real convolution value and the imaginary convolution value of the original time series, including: using the real function of the Morlet wavelet filter to process the original time series to determine the real convolution value; using the imaginary function of the Morlet wavelet filter to process the original time series to determine the imaginary convolution value.

[0059] Specifically, the real part function of the Morlet wavelet filter is as shown in the following expression (2), and the imaginary part function of the Morlet wavelet filter is as shown in the following expression (3).

[0060]

[0061] Among them, w real (t) is the real part function of the Morlet wavelet filter, w imag (t) is the real part function of the Morlet wavelet filter, and ψ(t; ω0, σ) is the Morlet wavelet function.

[0062] Specifically, after the real part function of the Morlet wavelet filter is used to process the original time series data, the real part convolution value of the original time series is calculated using the following expression (4).

[0063] l out (t) = (X t *w real (t)), expression (4);

[0064] Among them, l out (t) is the real part convolution value of the original time series, X t is the time series data at time t in the original time series, and “*” represents the convolution operation.

[0065] Specifically, after the original time series data is processed by the imaginary function of the Morlet wavelet filter, the imaginary convolution value of the original time series is calculated using the following expression (5).

[0066] h out (t) = (X t *w imag (t)), Expression (5);

[0067] Among them, h out (t) is the imaginary convolution value of the original time series, X t is the time series data at time t in the original time series, and “*” represents the convolution operation.

[0068] S302: The processor calculates the power of the low-frequency component in the original time series according to the real part convolution value to determine the power spectrum of the low-frequency component of the original time series.

[0069] Specifically, based on the real part convolution value, the power of the low-frequency component in the original time series is calculated according to the following expression (6).

[0070] P low (t) = l out (t) 2, Expression (6);

[0071] Among them, P low (t) is the power of the low-frequency component, l out (t) is the real convolution value.

[0072] S303, the processor calculates the power of the high-frequency component in the original time series according to the imaginary convolution value to determine the power spectrum of the high-frequency component of the original time series.

[0073] Specifically, based on the imaginary convolution value, the power of the high-frequency component in the original time series is calculated according to the following expression (7).

[0074] P high (t) = h out (t) 2 , expression (7);

[0075] Among them, P high (t) is the power of the high frequency component, h out (t) is the imaginary convolution value.

[0076] S304, the processor identifies the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum, and determines the dominant period of each variable in the original time series.

[0077] S305, the processor adjusts the attention weight distribution of the prediction model according to the periodic attenuation attention strategy based on the periodic characteristics of the dominant period.

[0078] S306, the processor inputs the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0079] In the disclosed embodiment, the real convolution value and the imaginary convolution value of the original time series identified by the Morlet wavelet filter are used to determine the low-frequency component and the high-frequency component of the original time series. In this way, the accuracy of the determined low-frequency component power spectrum and the high-frequency component power spectrum is guaranteed, and the accuracy of the determined dominant period of each variable in the original time series is further guaranteed.

[0080] In some embodiments, the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum are identified, and the dominant period of each variable in the original time series is determined, including: for each variable in the original time series, determining the maximum peak among the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum; determining the dominant period of each variable based on the scale associated with the maximum peak.

[0081] Specifically, the maximum peak refers to a peak with the largest value determined by comparing the peak of the low-frequency component power spectrum and the peak of the high-frequency component power spectrum together.

[0082] Specifically, for each variable in the original time series, the maximum peak value among the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum can represent the most significant periodic characteristics of the variable. Therefore, it is necessary to determine the dominant period of each variable based on the scale associated with the maximum peak value.

[0083] Specifically, based on the scale associated with the maximum peak value, the dominant period of each variable is determined according to the following expression (8).

[0084]

[0085] Among them, P i is the dominant period of the ith variable, P peak is the scale associated with the maximum peak, and ω0 is the central frequency of the wavelet.

[0086] The present disclosure provides another method for predicting time series. Figure 4 As shown, the prediction method includes:

[0087] S401, the processor performs learnable wavelet decomposition processing on the received original time series to obtain a low-frequency component power spectrum and a high-frequency component power spectrum of the original time series.

[0088] S402, the processor identifies the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum, and determines the dominant period of each variable in the original time series.

[0089] S403, the processor calculates the Gaussian attenuation matrix of the original time series according to the periodic characteristics of the dominant period, and calculates the vector adjustment matrix for the query vector Q in the attention mechanism.

[0090] Optionally, the Gaussian attenuation matrix of the original time series is calculated according to the periodic characteristics of the dominant period, including: determining the position difference matrix according to the periodic characteristics of the dominant period; substituting the position difference matrix into the Gaussian attenuation function to determine the Gaussian attenuation weight matrix corresponding to the original time series.

[0091] Specifically, the position difference matrix can reflect the relative distance between the positions of different features within a dominant period. The Gaussian attenuation matrix is ​​a matrix used to apply attenuation to weights in space. Therefore, when determining the Gaussian attenuation matrix, the position difference matrix needs to be determined first. Specifically, the position difference matrix is ​​shown in the following expression (9).

[0092] M(j,k)=min(|jk|modP i ,P i -(|jk|modP i )), expression (9);

[0093] Among them, M(j,k) is the position difference matrix, j and k are the indexes of the rows and columns of the position difference matrix.

[0094] Specifically, the Gaussian attenuation function is shown in the following expression (10).

[0095] w(x,σ)=exp(-x 2 / (2σ 2 )), expression (10);

[0096] Where x is the input value, w(x,σ) represents the weight given the input x and standard deviation σ; σ controls the decay rate.

[0097] Specifically, by substituting the position difference matrix into the above expression (10), a Gaussian attenuation matrix as shown in the following expression (11) can be obtained.

[0098]

[0099] Among them, W(j,k) is the Gaussian attenuation matrix, M(j,k) is the position difference matrix, σ i is a learnable parameter used to represent the attenuation scale.

[0100] Optionally, a vector adjustment matrix for the query vector Q in the attention mechanism is calculated based on the periodic characteristics of the dominant period, including: constructing a periodic function corresponding to the periodic characteristics of the dominant period; calculating a weight adjustment matrix based on the periodic function; and calculating a vector adjustment matrix based on the weight adjustment matrix and the query vector Q in the attention mechanism.

[0101] Specifically, in the attention mechanism, the query vector Q plays an important role in guiding attention. Therefore, it is necessary to calculate the vector adjustment matrix for the query vector Q in the attention mechanism.

[0102] Specifically, the periodic function corresponding to the periodic characteristics of the constructed dominant period is shown in the following expression (12).

[0103]

[0104] Among them, f(P i ) is the periodic function of the ith dominant period, P i is the dominant period, and γ and μ are used to adjust the curve shape of the function.

[0105] Specifically, based on the periodic function, the weight adjustment matrix is ​​calculated according to the following expression (13).

[0106] W′=f(P)×V, Expression (13);

[0107] Among them, W′ is the weight adjustment matrix, f(P) is the periodic function of the original time series, and V is a random matrix.

[0108] Specifically, based on the weight adjustment matrix and the query vector Q in the attention mechanism, the vector adjustment matrix is ​​calculated according to the following expression (14).

[0109] Q′=Q⊙W′, Expression (14);

[0110] Among them, Q′ is the vector adjustment matrix, Q is the query vector, W′ is the weight adjustment matrix, and “⊙” represents element-by-element matrix multiplication.

[0111] S404: The processor calculates an attention score matrix according to the Gaussian attenuation matrix and the vector adjustment matrix.

[0112] Specifically, based on the Gaussian attenuation matrix and the vector adjustment matrix, the attention score matrix is ​​calculated according to the following expression (15).

[0113] Scores = Q′K T ⊙W, expression (15);

[0114] Among them, Scores is the attention score matrix, Q′ is the vector adjustment matrix, W is the Gaussian attenuation matrix, K T Transpose of the key matrix in the attention mechanism. “⊙” indicates element-wise matrix multiplication.

[0115] S405, the processor calculates the attention weight corresponding to the original time series according to the attention score matrix, and adjusts the attention weight distribution of the prediction model based on the attention weight.

[0116] Specifically, according to the attention score matrix, the attention weight corresponding to the original time series is calculated according to the following expression (16).

[0117]

[0118] Among them, A is the attention weight corresponding to the original time series, Scores is the attention score matrix, is the scaling factor.

[0119] S406, the processor inputs the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0120] In the disclosed embodiment, the attention weight distribution of the prediction model is comprehensively adjusted by calculating the Gaussian decay matrix and the vector adjustment matrix of the query vector Q in the attention mechanism. In this way, the attention weight distribution of the prediction model can be more closely combined with the periodic structure of the original time series, thereby improving the accuracy of the adjustment of the attention weight distribution of the prediction model.

[0121] In some embodiments, the prediction method for time series proposed in the embodiments of the present disclosure can be constructed as follows: Figure 5 The multi-level prediction model for time series prediction shown in FIG. The multi-level prediction model includes: a learnable wavelet decomposition unit (LWT), an embedding layer, an encoder with a periodic information fusion attention module (PDA), and a linear mapping layer.

[0122] Specifically, the learnable wavelet decomposition unit is used to perform cross-channel filtering on the received original time series, and the filtered output is used to calculate the power spectrum to determine the dominant period of each variable in the original time series. The embedding layer is used to convert the periodic features of the dominant period of each variable in the original time series into a high-dimensional representation. The encoder is used to adjust the attention weight distribution according to the periodic attenuation attention strategy based on the periodic features of the converted dominant period. The linear mapping layer is used to perform the final processing on the data output by the encoder to generate the prediction result.

[0123] Exemplarily, in order to verify the prediction effect of the multi-level prediction model constructed based on the above-mentioned prediction method for time series on time series, the embodiment of the present disclosure used 6 known data sets (including Electricity, Solar, ETTh2, ETTm2, PEMS04 and Weather) to verify the multi-level prediction model.

[0124] Specifically, the disclosed embodiments input the above six data sets into the above multi-level analysis model Ours, the variable attention-based models FEDformer, iTransformer and SDformer, the model TimesNet using periodic information, and the well-performing models PatchTST, DLinear and TiDE.

[0125] Specifically, MSE (mean square error) and MAE (absolute square error) are used as model evaluation indicators, and the evaluation results are shown in Table 1 below, where the bold ones are the best results and the underlined ones are the second best results.

[0126] Table 1

[0127]

[0128] It can be seen from Table 1 that the multi-level prediction model Ours achieves the best performance in most cases. This shows that the prediction method for time series proposed in the embodiment of the present disclosure can improve the accuracy of the obtained time series prediction results when performing subsequent time series prediction based on multivariate time series data.

[0129] Combination Figure 6 As shown, an embodiment of the present disclosure provides a prediction device for time series, including: a wavelet decomposition module 601, an attention adjustment module 602 and a prediction module 603. The wavelet decomposition module 601 is configured to perform a learnable wavelet decomposition process on the received original time series to obtain the low-frequency component power spectrum and the high-frequency component power spectrum of the original time series. The wavelet decomposition module 601 is also configured to identify the peak values ​​of the low-frequency component power spectrum and the high-frequency component power spectrum, and determine the dominant period of each variable in the original time series. The attention adjustment module 602 is configured to adjust the attention weight distribution of the prediction model according to the periodic characteristics of the dominant period and the periodic attenuation attention strategy. The prediction module 603 is configured to input the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

[0130] Combination Figure 7 As shown, the embodiment of the present disclosure provides a prediction device 700 for time series, including: a processor (processor) 701 and a memory (memory) 702. Optionally, the device may also include a communication interface (Communication Interface) 703 and a bus 704. Among them, the processor 701, the communication interface 703, and the memory 702 can communicate with each other through the bus 704. The communication interface 703 can be used for information transmission. The processor 701 can call the logic instructions in the memory 702 to execute the prediction method for time series of the above embodiment.

[0131] In addition, the logic instructions in the memory 702 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0132] The memory 702 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 701 executes the function application and data processing by running the program instructions / modules stored in the memory 702, that is, the prediction method for time series in the above embodiment is implemented.

[0133] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 702 may include a high-speed random access memory and may also include a non-volatile memory.

[0134] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned prediction method for time series.

[0135] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.

[0136] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0137] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0138] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0139] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A prediction method for time series, characterized in that: include: Perform learnable wavelet decomposition on the received original time series to obtain the low-frequency component power spectrum and high-frequency component power spectrum of the original time series; Identify the peaks of the power spectra of low-frequency components and high-frequency components, and determine the dominant period of each variable in the original time series; According to the periodic characteristics of the dominant cycle, the attention weight distribution of the prediction model is adjusted according to the periodic attenuation attention strategy; The original time series is input into the prediction model after adjusting the attention weight distribution to obtain the time series prediction results.

2. The prediction method according to claim 1, characterized in that: Perform learnable wavelet decomposition on the received original time series to obtain the low-frequency component power spectrum and high-frequency component power spectrum of the original time series, including: The Morlet wavelet filter is used to identify the real and imaginary convolution values ​​of the original time series; The power of the low-frequency component in the original time series is calculated according to the real part convolution value to determine the power spectrum of the low-frequency component of the original time series; The power of the high-frequency component in the original time series is calculated according to the imaginary convolution value to determine the power spectrum of the high-frequency component of the original time series.

3. The prediction method according to claim 2, characterized in that: The Morlet wavelet filter is used to identify the real and imaginary convolution values ​​of the original time series, including: The real function of the Morlet wavelet filter is used to process the original time series and determine the real convolution value; The imaginary function of the Morlet wavelet filter is used to process the original time series and determine the imaginary convolution value.

4. The prediction method according to claim 1, characterized in that: Identify the peaks of the low-frequency component power spectrum and the high-frequency component power spectrum, and determine the dominant period of each variable in the original time series, including: For each variable of the original time series, determine the maximum peak value among the peak values ​​of the power spectrum of the low-frequency component and the power spectrum of the high-frequency component; The dominant period for each variable was determined based on the scale associated with the largest peak.

5. The prediction method according to any one of claims 1 to 4, characterized in that: According to the periodic characteristics of the dominant cycle, the attention weight distribution of the prediction model is adjusted according to the periodic attenuation attention strategy, including: Calculate the Gaussian decay matrix of the original time series according to the periodic features of the dominant period, and calculate the vector adjustment matrix for the query vector Q in the attention mechanism; Calculate the attention score matrix according to the Gaussian decay matrix and the vector adjustment matrix; The attention weight corresponding to the original time series is calculated according to the attention score matrix, and the attention weight distribution of the prediction model is adjusted based on the attention weight.

6. The prediction method according to claim 5, characterized in that: The Gaussian decay matrix of the original time series is calculated according to the periodic characteristics of the dominant period, including: Determine the position difference matrix according to the periodic characteristics of the dominant period; Substitute the position difference matrix into the Gaussian decay function to determine the Gaussian decay weight matrix corresponding to the original time series.

7. The prediction method according to claim 5, characterized in that: The vector adjustment matrix of the query vector Q in the attention mechanism is calculated according to the periodic features of the dominant period, including: Construct the periodic function corresponding to the periodic characteristics of the dominant period; Calculate the weight adjustment matrix according to the periodic function; The vector adjustment matrix is ​​calculated based on the weight adjustment matrix and the query vector Q in the attention mechanism.

8. A prediction device for time series, characterized in that: include: The wavelet decomposition module is configured to perform a learnable wavelet decomposition process on the received original time series to obtain a low-frequency component power spectrum and a high-frequency component power spectrum of the original time series; The wavelet decomposition module is also configured to identify the peaks of the power spectra of the low-frequency components and the power spectra of the high-frequency components, and determine the dominant period of each variable in the original time series; an attention adjustment module, configured to adjust the attention weight distribution of the prediction model according to the periodic decay attention strategy based on the periodic characteristics of the dominant period; The prediction module is configured to input the original time series into the prediction model after adjusting the attention weight distribution to obtain the time series prediction result.

9. A prediction device for time series, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to be able to execute the prediction method for time series according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: Equipment body; The prediction device for time series as described in claim 8 or 9 is arranged in the device body.

Citation Information

Cited By

  • Incoming rainfall forecasting method based on C-band radar networking and deep learning

    CN120876956A