Time sequence prediction method based on frequency shift linear network
By performing frequency domain segmentation and frequency shift operations on time series data and using multiple linear networks to model them separately, the problem of uneven frequency component learning in existing time series prediction methods is solved, and the prediction accuracy and efficiency are improved. It is particularly suitable for end-side applications with limited resources.
Patent Information
- Application Number
- CN202510808388.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-10-03
AI Technical Summary
Existing time series prediction methods based on deep learning have weak learning capabilities for mid- and high-frequency components due to the unbalanced energy distribution of different frequency components, which affects the prediction accuracy.
A method based on frequency-shift linear network is used to convert time series data from the time domain to the frequency domain, split the frequency band data and perform frequency shift operation, move the non-low-frequency area data to the low-frequency area, use multiple linear networks to perform modeling respectively, and finally restore the data to the time domain to obtain the prediction results.
It improves the learning ability of different frequency components, reduces interference between frequency bands, improves prediction accuracy, and reduces time and space complexity, making it suitable for end-side applications with limited resources.
Smart Images

Figure CN120744351A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of time series prediction in data mining, and more particularly to a time series prediction method based on a frequency-shift linear network. Background Art
[0002] Time series forecasting, a technique for predicting future data based on historical data, has broad application value in a variety of fields. For example, in the commercial sector, companies can use time series forecasting to predict sales or market demand, thereby optimizing resource allocation. In meteorological monitoring, time series forecasting can provide early warning of meteorological disasters, effectively preventing secondary damage caused by natural disasters.
[0003] Existing time series forecasting methods primarily rely on deep learning techniques, using neural networks to model temporal relationships within a sequence to predict future values. However, due to the uneven energy distribution of different frequency components in time series data, neural networks struggle to achieve full-band learning capabilities. This means they are more capable of learning low-frequency components in the data than mid- and high-frequency components, which impacts the ultimate forecasting performance of these methods. Therefore, it is necessary to perform targeted processing on the different frequency components in time series data and design proprietary network models to ensure balanced learning across these components, thereby improving overall forecasting accuracy. Summary of the Invention
[0004] The purpose of the present invention is to solve the problem that the existing time series prediction method based on deep learning has different learning abilities for different frequency components in the data, resulting in low prediction accuracy. A time series prediction method based on a frequency-shifted linear network is creatively proposed.
[0005] The present invention adopts the following technical solutions:
[0006] The present invention provides a time series prediction method based on a frequency-shifted linear network, comprising the following steps:
[0007] S1, convert time series data from time domain to frequency domain;
[0008] S2, segmenting the frequency domain data in S1 to obtain multiple continuous frequency band data;
[0009] S3, performing a frequency shift operation on the frequency band data in the non-low-frequency area after segmentation, and moving it to the low-frequency area;
[0010] S4, converting all frequency band data in the low-frequency region into the time domain;
[0011] S5, inputting the time domain data in S4 into multiple trained linear networks for temporal relationship modeling;
[0012] S6, converting the modeling results in S5 into the frequency domain;
[0013] S7, restoring the frequency domain data in S6 to the original frequency band position;
[0014] S8. Convert the frequency domain data restored in S7 to the time domain to obtain the corresponding prediction results in the time domain.
[0015] Furthermore, the S1 specifically includes:
[0016] S11. Read time series data in Represents a real number, L represents the sequence length of the time series data, and N represents the number of sequences in the time series data;
[0017] S12, perform frequency domain transformation operation ρ on the time series data X along the time axis to obtain the corresponding frequency domain data
[0018] Furthermore, the S2 specifically includes:
[0019] S21, define the number of frequency bands to be divided M, and the corresponding division frequency points l1, l2, ..., l M-1 ;
[0020] S22, frequency domain data Divide into M segments according to the corresponding split frequency points, expressed as:
[0021]
[0022] in, Indicates the Mth frequency band data.
[0023] Furthermore, in the S3, the first frequency band data in the frequency domain is in the low frequency region, and the remaining frequency band data except the first frequency band data is converted to the low frequency region, which is expressed as:
[0024]
[0025] in, Indicates the Mth frequency band data in the low-frequency area.
[0026] Furthermore, the S4 specifically includes:
[0027] Perform frequency domain inverse transform operations on all frequency band data in the low-frequency region along the time axis Convert each segment of frequency domain data to time domain; expressed as:
[0028]
[0029] in, Indicates that The corresponding M-th segment of time domain data after conversion to the time domain; and
[0030] Furthermore, the S5 specifically includes:
[0031] Will As the input of M linear networks, we can get the corresponding modeling results. Expressed as:
[0032]
[0033] Furthermore, the S6 specifically includes: performing a frequency domain transformation operation ρ on the modeling result in S5 to obtain corresponding frequency domain data; expressed as:
[0034]
[0035] in, Indicates that the modeling results The corresponding frequency domain data obtained after conversion to the frequency domain.
[0036] Furthermore, the S7 specifically includes:
[0037] Perform a frequency shift operation on the frequency domain data in S6, shifting it from the low-frequency region to its original position; this is expressed as:
[0038]
[0039] in, Indicates that the frequency domain data Frequency domain data after position restoration.
[0040] Furthermore, the S8 specifically includes:
[0041] S81, after restoring the position in S7 Splice and get the output
[0042] S82, output Perform an inverse frequency domain transform operation Convert it to the time domain and get the output in the time domain
[0043] Furthermore, during the training process, the multiple different linear networks convert the output Y in the time domain into out and the true value Y real Subtract and construct the loss function; optimize the weight parameters w of each linear network by minimizing the loss function (i) and bias parameter b(i) , and finally output the optimal value to obtain the corresponding multiple linear networks.
[0044] It can be seen from the above technical solution that, compared with the prior art, the present invention discloses a time series prediction method based on a frequency-shifted linear network, which has the following beneficial effects:
[0045] (1) In order to solve the problem of insufficient full-band learning in existing time series prediction methods, the present invention shifts the non-low-frequency data of time series data to the low-frequency area through a simple frequency shift operation, and utilizes the low-frequency learning ability of the linear model to solve the problem of insufficient learning ability in the non-low-frequency area.
[0046] (2) The present invention simultaneously uses multiple linear layers to focus on modeling different frequency components, avoiding mutual interference between different frequency components, improving prediction accuracy, and reducing time and space complexity.
[0047] (3) Compared with the traditional time series prediction method based on the time domain, the method of the present invention has the characteristics of being lightweight, having fewer parameters, and running at a fast speed, and is particularly suitable for the end side with limited resources.
[0048] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0050] Figure 1 A schematic flow chart of a time series prediction method based on a frequency-shifted linear network provided in an embodiment of the present invention.
[0051] Figure 2 A schematic diagram of time-frequency domain conversion provided by an embodiment of the present invention.
[0052] Figure 3 A schematic diagram of frequency domain data segmentation provided by an embodiment of the present invention.
[0053] Figure 4 A schematic diagram of frequency shift of high-frequency components provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0055] The embodiment of the present invention discloses a time series prediction method based on a frequency shift linear network, see Figure 1 As shown, the specific steps include:
[0056] S1, convert time series data from time domain to frequency domain;
[0057] S2, segmenting the frequency domain data in S1 to obtain multiple continuous frequency band data;
[0058] S3, performing a frequency shift operation on the frequency band data in the non-low-frequency area after segmentation, and moving it to the low-frequency area;
[0059] S4, converting all frequency band data in the low-frequency region into the time domain;
[0060] S5, inputting the time domain data in S4 into multiple trained linear networks for temporal relationship modeling;
[0061] S6, converting the modeling results in S5 into the frequency domain;
[0062] S7, restoring the frequency domain data in S6 to the original frequency band position;
[0063] S8. Convert the frequency domain data restored in S7 to the time domain to obtain the corresponding prediction results in the time domain.
[0064] Next, the training process of the linear network is described in detail:
[0065] Step 1: Convert the time series data from the time domain to the frequency domain; specifically including:
[0066] Step 11: Reading Time Series Data in Represents a real number, L represents the sequence length of the time series data, and N represents the number of sequences in the time series data;
[0067] Step 12: Perform frequency domain transformation operation ρ on the time series data X along the time axis to obtain the corresponding frequency domain data Expressed as in Indicates plural.
[0068] Step 2: Segment the frequency domain data in step 1 to obtain multiple continuous frequency band data; specifically, the following steps are performed:
[0069] Step 21: Define the number of frequency bands to be divided M and the corresponding division frequency points l1, l2, ..., l M-1 ;
[0070] Step 22: Convert the frequency domain data Divide into M segments according to the corresponding split frequency points, expressed as:
[0071]
[0072] in, Indicates the Mth frequency band data.
[0073] Step 3: Perform frequency shift operation on the frequency band data in the non-low-frequency area after segmentation and move it to the low-frequency area; specifically:
[0074] The first frequency band data in the frequency domain is in the low-frequency area. The remaining frequency band data except the first frequency band data are converted to the low-frequency area, which is expressed as:
[0075]
[0076] in, Indicates the Mth frequency band data in the low-frequency area.
[0077] Step 4: Convert all frequency band data in the low-frequency region to the time domain; specifically,
[0078] Perform frequency domain inverse transform operations on all frequency band data in the low-frequency region along the time axis Convert each segment of frequency domain data to time domain; expressed as:
[0079]
[0080] in, Indicates that The corresponding M-th segment of time domain data after conversion to the time domain; and
[0081] Step 5: Input the time domain data in step 4 into multiple trained linear networks to perform temporal relationship modeling;
[0082] Step 51: Define M linear networks: Linear (1) (x),Linear (2) (x),…,Linear (M) (x); where the i-th linear network Linear (i) (x) = w (i)x+b (i) , w (i) and b (i) are the weight parameters and bias parameters of the i-th linear network, respectively, and x is the input of the linear network;
[0083] Step 52: Randomly initialize the weight parameters and bias parameters of the M linear networks;
[0084] Step 53: They are respectively used as inputs of M linear networks to obtain the corresponding modeling results (i.e. the output of the linear network) Expressed as:
[0085]
[0086] Step 6: Convert the modeling results in step 5 above to the frequency domain; that is, perform a frequency domain transformation operation ρ on the modeling results in step 5 to obtain the corresponding frequency domain data; expressed as:
[0087]
[0088] in, Indicates that the modeling results The corresponding frequency domain data obtained after conversion to the frequency domain.
[0089] Step 7: Restore the frequency domain data in step 6 to its original frequency band position; that is, perform a frequency shift operation on the frequency domain data in step 6, shifting it from the low-frequency region to its original position; expressed as:
[0090]
[0091] in, Indicates that the frequency domain data Frequency domain data after position restoration.
[0092] Step 8: Convert the frequency domain data restored in step 7 above to the time domain to obtain the corresponding prediction results in the time domain; specifically including:
[0093] Step 81: Restore the position in step 7 Splice and get the output
[0094] Step 82: Output Perform an inverse frequency domain transform operation Convert it to the time domain and get the output in the time domain
[0095] During the training process, the above M different linear networks convert the output Y in the time domain into out and the true value Y realSubtract and construct the loss function; optimize the weight parameters w of each linear network by minimizing the loss function (i) and bias parameter b (i) , and finally output the optimal value to obtain the corresponding M linear networks.
[0096] The prediction is performed using the trained M linear network models. Specifically, the steps 1 to 4 are executed (i.e., S1 to S4 in the time series prediction method based on frequency shift linear network provided by the present invention), and M time series data are output. These M time series data are respectively used as the input of M trained linear networks, that is, Get M outputs; perform steps 6-8 (i.e., S6-S8 in the time series prediction method based on frequency-shifted linear network provided by the present invention) on these M outputs to obtain the predicted value Y out .
[0097] In summary, the present invention addresses the technical problem that the energy distribution of different frequency components in time series data is uneven, which makes it difficult for neural networks to effectively learn in the entire frequency band. A time series prediction method based on a frequency-shifted linear network is proposed. This mechanism uses a simple frequency shift operation to uniformly map the frequency components of each frequency band to a low-frequency region, thereby processing them at a similar frequency scale. At the same time, multiple independent linear networks are used to model the data of each frequency band separately, avoiding mutual interference between different frequency components and effectively improving modeling efficiency and frequency domain learning capabilities.
[0098] The method provided by the present invention can be applied to multiple fields. For example, if it is applied to market demand forecasting, the time series data in the method can be sales time series data; if it is applied to the meteorological field, the time series data in the method can be temperature time series data, humidity time series data, etc. Next, the embodiment of the present invention will take the public data set ETTh1 Dataset as an example to predict the temperature of the power transformer, wherein the input sequence length of the historical power transformer temperature time series data is L=96, and the prediction sequence length τ=96; Based on this, the embodiment of the present invention provides a time series prediction method based on a frequency-shifted linear network, such as Figure 1 As shown, the following steps are included:
[0099] Step 1: Convert the time series data from the time domain to the frequency domain; specifically including:
[0100] Step 11: Reading Time Series Data in Represents a real number, 96 represents the sequence length of the time series data, and 21 represents the number of sequences in the time series data;
[0101] Step 12: Perform frequency domain transform operation DFT on the time series data X along the time axis, such as Figure 2 As shown, the corresponding frequency domain data is obtained Expressed as in Indicates plural.
[0102] Step 2: Segment the frequency domain data in step 1 to obtain multiple continuous frequency band data; specifically, the following steps are performed:
[0103] Step 21: Define the number of frequency bands to be split, 3, and the corresponding split frequency points, 31, 63, and 95;
[0104] Step 22: Convert the frequency domain data Divide into 3 segments according to the corresponding split frequency points, such as Figure 3 As shown, it is expressed as:
[0105]
[0106] in, Represents the 1st, 2nd and 3rd frequency band data respectively.
[0107] Step 3: Perform frequency shift operation on the frequency band data in the non-low-frequency area after segmentation and move it to the low-frequency area. Specifically, the first frequency band data in the frequency domain is in the low-frequency area, and the second and third frequency band data except the first frequency band data are converted to the low-frequency area. Figure 4 As shown, it is expressed as:
[0108]
[0109] in, and They represent the second and third frequency band data in the low-frequency area respectively.
[0110] Step 4: Convert all frequency band data in the low-frequency region to the time domain; specifically,
[0111] Perform the inverse frequency domain transform operation IFFT on all frequency band data in the low-frequency region along the time axis, and convert each frequency domain data segment into the time domain; it can be expressed as:
[0112]
[0113] in, and Indicates the first, second, and third time domain data corresponding to the first, second, and third frequency band data in the low-frequency region after being converted to the time domain.
[0114] Step 5: Use three different linear networks to model the time relationship of the time domain data in step 4; specifically,
[0115] Step 51: Define 3 linear networks: Linear (1) (x),Linear (2) (x),…,Linear (M) (x); where the i-th linear network Linear (i) (x) = w (i) x+b (i) , w (i) and b (i) are the weight parameters and bias parameters of the i-th linear network, respectively, and x is the input of the linear network;
[0116] Step 52: Randomly initialize the weight parameters and bias parameters of the three linear networks;
[0117] Step 53: As the input of three linear networks, the corresponding modeling results are obtained; expressed as:
[0118]
[0119]
[0120]
[0121] Step 6: Convert the modeling results in step 5 above to the frequency domain; specifically, perform a frequency domain transform operation DFT on the modeling results in step 5 to obtain the corresponding frequency domain data; expressed as:
[0122]
[0123] Step 7: Restore the frequency domain data in step 6 to the original frequency band position; specifically including:
[0124] Perform a frequency shift operation on the frequency domain data in step 6, shifting it from the low-frequency region to its original position; expressed as:
[0125] Step 8: Convert the frequency domain data restored in step 7 above to the time domain to obtain the corresponding prediction results in the time domain; specifically including:
[0126] Step 81: After the position in step 7 is restored and Splice and get the output
[0127] Step 82: Output Perform the inverse frequency domain transform operation IFFT to convert it to the time domain and obtain the output in the time domain
[0128] Y out and the true value Y real Subtract, construct the loss function Loss, and optimize the weight parameters w of each linear network by minimizing the loss function (1) 、w (2) 、w (3) and bias parameter b (1) 、b (2) 、b (3) , and finally output the optimal value to obtain the corresponding 3 linear networks. Use the trained 3 linear network models for prediction. The details are as follows: Execute steps 1 to 4 and output 3 time series data Will As the input of three trained linear networks, namely Perform steps 6-8 on these three outputs to get the predicted value Y out .
[0129] In order to illustrate the effectiveness of the method provided by the present invention, the mean squared error (MSE), mean absolute error (MAE), relative squared error (RSE) and root mean squared error (RMSE) are used for evaluation. The lower the values of the above four indicators, the better the prediction effect of the method. The specific calculation method of the indicators is as follows:
[0130]
[0131]
[0132]
[0133]
[0134] where y l and Representing the real input time series data and the predicted time series data, respectively. In this embodiment of the present invention, the MSE, MAE, RSE, and RMSE are 0.375, 0.398, 0.582, and 0.612, respectively. Compared with the current optimal method, iTransformer, the effect is improved by an average of more than 10%, thus demonstrating the effectiveness of the method provided by this embodiment of the present invention.
[0135] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0136] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A time series prediction method based on a frequency-shifted linear network, characterized in that: The steps include: S1, convert time series data from time domain to frequency domain; S2, segmenting the frequency domain data in S1 to obtain multiple continuous frequency band data; S3, performing a frequency shift operation on the frequency band data in the non-low-frequency area after segmentation, and moving it to the low-frequency area; S4, converting all frequency band data in the low-frequency region into the time domain; S5, inputting the time domain data in S4 into multiple trained linear networks for temporal relationship modeling; S6, converting the modeling results in S5 into the frequency domain; S7, restoring the frequency domain data in S6 to the original frequency band position; S8. Convert the frequency domain data restored in S7 to the time domain to obtain the corresponding prediction results in the time domain.
2. The time series prediction method based on frequency-shifted linear network according to claim 1, characterized in that: Said S1 specifically includes: S11. Read time series data in Represents a real number, L represents the sequence length of the time series data, and N represents the number of sequences in the time series data; S12, perform frequency domain transformation operation ρ on the time series data X along the time axis to obtain the corresponding frequency domain data 3. The time series prediction method based on frequency-shifted linear network according to claim 1, characterized in that: The S2 specifically includes: S21, define the number of frequency bands to be divided M, and the corresponding division frequency points l1, l2, ..., l M-1 ; S22, frequency domain data Divide into M segments according to the corresponding split frequency points, expressed as: in, Indicates the Mth frequency band data.
4. The time series prediction method based on frequency-shifted linear network according to claim 1, characterized in that: In the above S3, the first frequency band data in the frequency domain is in the low frequency region, and the remaining frequency band data except the first frequency band data is converted to the low frequency region, which is expressed as: in, Indicates the Mth frequency band data in the low-frequency area.
5. The time series prediction method based on frequency-shifted linear network according to claim 4, characterized in that: The S4 specifically includes: Perform frequency domain inverse transform operations on all frequency band data in the low-frequency region along the time axis Convert each segment of frequency domain data to time domain; expressed as: in, Indicates that The corresponding M-th segment of time domain data after conversion to the time domain; and 6. The time series prediction method based on frequency-shifted linear network according to claim 5, characterized in that: The S5 specifically includes: Will As the input of M linear networks, we can get the corresponding modeling results. Expressed as:
7. The time series prediction method based on frequency-shifted linear network according to claim 6, characterized in that: S6 specifically includes: performing a frequency domain transformation operation ρ on the modeling result in S5 to obtain corresponding frequency domain data; expressed as: in, Indicates that the modeling results The corresponding frequency domain data obtained after conversion to the frequency domain.
8. The time series prediction method based on frequency-shifted linear network according to claim 7, characterized in that: The S7 specifically includes: Perform a frequency shift operation on the frequency domain data in S6, shifting it from the low-frequency region to its original position; this is expressed as: in, Indicates that the frequency domain data Frequency domain data after position restoration.
9. The time series prediction method based on frequency-shifted linear network according to claim 8, characterized in that: The S8 specifically includes: S81, after restoring the position in S7 Splice and get the output S82, output Perform an inverse frequency domain transform operation Convert it to the time domain and get the output in the time domain 10. The time series prediction method based on frequency-shifted linear network according to claim 1, characterized in that: During the training process, the multiple different linear networks convert the output Y in the time domain into out and the true value Y real Subtract and construct the loss function; optimize the weight parameters w of each linear network by minimizing the loss function (i) and bias parameter b (i) , and finally output the optimal value to obtain the corresponding multiple linear networks.
