Meteorological prediction method and system based on multi-scale time sequence analysis
The meteorological data is preprocessed and decomposed through multi-scale timing analysis method, and inter-scale fusion and prediction are carried out, which solves the problem of low accuracy of meteorological prediction in the prior art, and achieves higher prediction accuracy and model prediction capabilities.
Patent Information
- Application Number
- CN202411432393.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art is difficult to fully capture the relationship between meteorological data at various scales, resulting in low accuracy in meteorological prediction.
The meteorological prediction method based on multi-scale timing analysis is adopted. By constructing a meteorological prediction data set, preprocessing is performed to obtain multi-scale data, seasonal data and trend data are decomposed to obtain inter-scale fusion, and the difference is upsampled and the prediction module is input to predict, and the L1-L2 mixed loss function is constructed to update the network parameters.
This method can more comprehensively capture the multi-scale relationship of meteorological data, improving the accuracy of meteorological prediction and model prediction capabilities.
Smart Images

Figure CN119596418A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of meteorological forecasting, and in particular to a meteorological forecasting method and system based on multi-scale time series analysis. Background Art
[0002] As an important part of the new energy power system, meteorological forecasting is an important technical support for the rational planning and full utilization of meteorological resources. So far, according to the theories and technologies of existing meteorological forecasting by scholars at home and abroad, there are mainly three types of methods: physical methods, traditional statistical methods and artificial intelligence methods. Physical methods mainly refer to the use of numerical models and different physical process schemes to predict meteorological resources; traditional statistical methods mainly refer to the use of traditional statistical models and theories to predict meteorological resources; based on deep learning methods, it mainly refers to the use of deep learning models that can realize human learning behavior to predict meteorological resources.
[0003] Traditional statistical methods are mainly based on analyzing the characteristics of meteorological element values, such as time series, periodicity, and autocorrelation. These methods extract the meteorological information contained in the data itself and establish some simple mathematical models to obtain prediction results for different time periods in the future. However, this method has large errors. Traditional machine learning methods are often not ideal in extracting the temporal correlation and spatial dependence of meteorological data, while deep learning methods can effectively improve the accuracy of weather forecasts by automatically extracting features through artificial neural networks. However, for meteorological data, different sampling scales show different rules. For example, meteorological data at the hourly scale show the rule of low temperature in the morning, high temperature at noon, and low temperature at night, while meteorological data at the daily scale has a strong seasonal rule, such as low temperature in winter and high temperature in summer. Current deep learning methods generally treat meteorological data as a whole and fail to fully capture the relationship between meteorological data at various scales. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a weather forecasting method and system based on multi-scale time series analysis to solve the problem of low forecasting accuracy caused by the difficulty in fully capturing the relationship between meteorological data at various scales in the prior art.
[0005] In order to achieve the above object, on the one hand, an embodiment of the present invention provides a weather forecasting method based on multi-scale time series analysis, the weather forecasting method comprising:
[0006] Construct a weather forecast dataset, weather forecast dataset X = {x1,…,x t …,x T}∈R T×N , where x t ∈R 1×Nis the data of the tth time step, T is the total time step, and N is the number of features;
[0007] Preprocessing the meteorological forecast data set to obtain multi-scale data;
[0008] Inputting the multi-scale data into a sequence decomposer to obtain seasonal data and trend data;
[0009] Inputting the seasonal data and trend data into a multi-scale fusion module for inter-scale and intra-scale fusion to obtain fused data;
[0010] Perform difference upsampling on the fused data to obtain interpolated data;
[0011] The interpolated upsampled data is input into the prediction module for prediction to obtain the predicted value, wherein the prediction module is composed of a fully connected layer, which is the nn.Linear component in PyTorch;
[0012] Based on the predicted value and the true value, construct an L1-L2 mixed loss function;
[0013] The L1-L2 mixed loss function is calculated to update the network parameters in the above steps until the loss converges, thereby obtaining a meteorological prediction model corresponding to the optimal network parameters, which is used to predict the input meteorological data and obtain the corresponding prediction results.
[0014] Optionally, preprocessing the meteorological forecast data set to obtain multi-scale data includes:
[0015] Inputting the weather forecast data set into a denoising module for processing to obtain denoised data;
[0016] Perform the Embedding operation on the denoised data and input it into the Encoder module of the Transformer network to obtain the encoded data;
[0017] The encoded data is downsampled using one-dimensional average pooling to obtain multi-scale data.
[0018] Optionally, the weather forecast data set is input into a denoising module for processing to obtain denoised data, including:
[0019] Select a wavelet basis, and input the weather forecast data set into the wavelet decomposition module of the wavelet basis to obtain the first layer high frequency coefficient CD1 and the first layer low frequency coefficient CA1, and then perform wavelet decomposition on the first layer low frequency coefficient CA1 to obtain the second layer low frequency coefficient CA2 and the second layer high frequency coefficient CD2, and so on, until the specified j-th layer low frequency coefficient CA1 is obtained. j and the j-th layer high frequency coefficient CDj ;
[0020] All high frequency coefficients {CD1,…,CD j} and the j-th layer low-frequency coefficient CA j Input to the threshold processing module;
[0021] Denoising is performed according to the set threshold type and size to obtain the denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j ;
[0022] The denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j Enter the reconstruction module;
[0023] The reconstruction module recombines the denoised coefficients through inverse wavelet transform to obtain denoised data.
[0024] Optionally, inputting the multi-scale data into a sequence decomposer to obtain seasonal data and trend data includes:
[0025] The multi-scale data is calculated according to formula (1) to obtain the trend data of the multi-scale data:
[0026]
[0027] Among them, w is the pooling window size, the stride is s, and x padded Represents the data after the original data is padded at both ends, q represents the relative position inside the pooling window, and m is the position index of the pooling window;
[0028] The trend data is subtracted from the multi-scale data to obtain seasonal data of the multi-scale data.
[0029] Optionally, the seasonal data and the trend data are input into a multi-scale fusion module for inter-scale and intra-scale fusion to obtain fused data including:
[0030] The seasonal data of each scale and the trend data of each scale are integrated across scales;
[0031] After inter-scale fusion, the trend data and seasonal data within the same scale are fused to obtain the fused data.
[0032] Optionally, the seasonal data and the trend data are input into a multi-scale fusion module for inter-scale and intra-scale fusion to obtain fused data including:
[0033] According to formula (2), seasonal data and trend data of various scales are integrated:
[0034]
[0035] in is the fused seasonal data of scale n, S n is the seasonal data with scale n before fusion, DownSample is a downsampling operation, S n-1 is the seasonal data with a scale of n-1 before fusion, is the trend data with scale n after fusion, T n is the trend data with a scale of n before fusion, UpSample is an upsampling operation, T n-1 is the trend data with a scale of n-1 before fusion;
[0036] According to formula (3), seasonal data and trend data of uniform scale are integrated:
[0037]
[0038] Among them, X n Represents the fused data.
[0039] Optionally, for seasonal data S with scale n-1 n-1 Downsampling involves:
[0040] The seasonal data S with scale n-1 n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the first projection n-1 The lengths before and after projection are
[0041] For the projected seasonal data S' n-1 Perform a GELU activation function transformation to obtain the transformed seasonal data S" n-1 ;
[0042] For the transformed seasonal data S" n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the second projection n-1 The lengths before and after projection are
[0043] Optional, for trend data T with scale n-1 n-1 Upsampling involves:
[0044] For trend data T with scale n-1 n-1Perform linear projection to obtain trend data T' with a scale of n-1 after the first projection n-1 The lengths before and after projection are
[0045] For the projected trend data T' n-1 Perform a GELU activation function transformation to obtain the transformed trend data T" n-1 ;
[0046] Perform linear projection on the transformed trend data to obtain the trend data T"' with a scale of n-1 after the second projection n-1 The lengths before and after projection are
[0047] Optionally, the L1-L2 mixed loss function is shown in formula (4):
[0048]
[0049] Among them, pred d is the predicted value at the dth time step, true d is the true value of the dth time step, l is the predicted time step, tanh represents the hyperbolic tangent function, |pred d -true d | indicates that pred d -true d The operation result is taken as the absolute value.
[0050] On the other hand, the present invention also provides a weather forecasting system based on multi-scale time series analysis, the weather forecasting system comprising:
[0051] The denoising module processes the weather forecast data set to obtain denoised data;
[0052] The Encoder module of Transformer encodes the denoised data to obtain encoded data and obtain multi-scale data;
[0053] A sequence decomposer, which obtains seasonal data and trend data according to the multi-scale data;
[0054] Multi-scale fusion module, which performs inter-scale and intra-scale fusion of seasonal data and trend data;
[0055] Prediction module, obtains the predicted value based on the upsampled data;
[0056] Loss function module, constructs loss functions for predicted values and true values;
[0057] Adam optimizer trains the above modules and updates the network parameters of the above modules according to the convergence of the loss function of the loss function module.
[0058] Through the above technical scheme, a meteorological forecasting method and system based on multi-scale time series analysis provided by the present invention can construct a meteorological forecasting data set, and then pre-process the meteorological forecasting data set to obtain multi-scale data. After obtaining the multi-scale data, the multi-scale data can be input into the sequence decomposer to obtain seasonal data and trend data, and then the seasonal data and trend data can be input into the multi-scale fusion module to perform inter-scale-intra-scale fusion to obtain the fused data. After the fused data is differentially upsampled, the data can be input into the prediction module for prediction, so that the predicted value can be obtained. According to the predicted value and the true value, a mixed loss function can be constructed, and then the network parameters can be updated according to the convergence of the mixed loss function, so that the meteorological forecasting model corresponding to the optimal network parameters can be obtained, and then the input meteorological data can be predicted to obtain the corresponding prediction result. The prediction method can decouple complex meteorological data, fully extract multiple inter-scale and intra-scale features, and improve the model prediction ability.
[0059] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0061] Figure 1 is a flow chart of a meteorological forecasting method based on multi-scale time series analysis according to one embodiment of the present invention;
[0062] Figure 2 is a flowchart of preprocessing meteorological data in a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0063] Figure 3 is a flowchart of denoising meteorological data according to a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0064] Figure 4 is a flowchart of obtaining seasonal data and trend data of a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0065] Figure 5is a first flow chart of obtaining fused data in a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0066] Figure 6 is a second flow chart of obtaining fused data in a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0067] Figure 7 is a flowchart of downsampling of a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention;
[0068] Figure 8 The present invention is a flowchart of an upsampling method of a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0070] Figure 1 1 is a flow chart of a meteorological forecasting method based on multi-scale time series analysis according to an embodiment of the present invention. In the present invention, the process may include:
[0071] In step S1, a weather forecast dataset is constructed, the weather forecast dataset X = {x1,…,x t …,x T}∈R T×N , where x t ∈R 1×N is the data of the tth time step, T is the total time step, and N is the number of features.
[0072] In step S2, the meteorological forecast data set is preprocessed to obtain multi-scale data.
[0073] In step S3, the multi-scale data is input into the series decomposer to obtain seasonal data and trend data.
[0074] In step S4, the seasonal data and trend data are input into the multi-scale fusion module for inter-scale and intra-scale fusion to obtain fused data.
[0075] In step S5, the fused data is subjected to difference upsampling to obtain interpolated data.
[0076] In step S6, the interpolated upsampled data is input into a prediction module for prediction to obtain a predicted value, wherein the prediction module is composed of a fully connected layer, which is a nn.Linear component in PyTorch.
[0077] In step S7, an L1-L2 hybrid loss function is constructed based on the predicted value and the true value.
[0078] In step S8, the L1-L2 mixed loss function is calculated to update the network parameters in the above steps until the loss converges, thereby obtaining a meteorological prediction model corresponding to the optimal network parameters, which is used to predict the input meteorological data and obtain the corresponding prediction results.
[0079] In the present invention, when performing weather forecasting, a weather forecast data set can be first constructed, and then the weather forecast data set can be preprocessed. The preprocessing method can first perform denoising on the data. During the denoising process, the data can first be subjected to multi-level wavelet decomposition to obtain high-frequency coefficients and low-frequency coefficients, and then threshold processing is performed on the obtained coefficients, and finally the denoised data is reconstructed. After the denoising is completed, the data can be encoded again and then downsampled, so that multi-scale data can be obtained. After obtaining the multi-scale data, it can be input into a sequence decomposer to obtain seasonal data and trend data, and then the seasonal data and trend data are fused. This method can make complex time data easy to analyze, thereby enhancing the prediction ability of the weather forecasting method. After fusion, the fused data can be interpolated and upsampled to obtain interpolated data. The fused data can be The interpolated data {Y n |n∈{0,1,2…k}}, where Y n ={y n1 ,…,y nt ,…,y nT}∈R T×N×E ,y nt ∈R N×E Represents the data of the tth time step with a scale of n after interpolation and upsampling.
[0080] The interpolation upsampling technology is used to unify the scale of multi-scale data, enhance the correlation within the scale, and thus improve the model prediction ability. We can choose the interpolation method according to the characteristics of the data set. We can choose nearest neighbor interpolation, linear interpolation, quadratic interpolation, spline interpolation, Lagrange interpolation, Kriging interpolation. If high-precision prediction is required without considering computing resources, Kriging interpolation can be selected. If the data is relatively smooth, linear interpolation or spline interpolation can be selected.
[0081] The interpolated upsampled data {Y n |n∈{0,1,2…k}} is input into the prediction module for prediction and the predicted value P={p t+1 ,…,p t+h ,…,p t+l}∈R l×N , where the prediction module consists of a fully connected layer, which is the nn.Linear component in PyTorch, p t+h ∈R 1×N It represents the h-th predicted value after the t-th time step, and l represents the prediction step length.
[0082] In a specific implementation, the scale k can be 3, plus the original scale, the total number of scales is 4. After interpolation, the time steps of multi-scale data are unified to the time steps of the original scale. The four data of the same scale are predicted separately, and finally the predicted values are added together to obtain the final predicted value P.
[0083] Based on the predicted value P and the true value X={x t+1 ,…,x t+h ,…,x t+l}∈R l×N We can construct an L1-L2 mixed loss function, where x t+h ∈R 1×N Represents the hth true value after the tth time step. After constructing the L1-L2 mixed loss function, the Adam optimizer can be used to train the multi-scale fusion module and the prediction module, and the L1-L2 mixed loss function can be calculated to update the network parameters until the loss converges. In this way, the meteorological prediction model corresponding to the optimal network parameters can be obtained, which is used to predict the input meteorological data and obtain the corresponding prediction results.
[0084] In one embodiment of the present invention, Figure 2 As shown, the process of preprocessing meteorological data may include:
[0085] In step S9, the weather forecast data set is input into a denoising module for processing to obtain denoised data.
[0086] In step S10, the denoised data is subjected to an Embedding operation and then input into the Encoder module of the Transformer network to obtain the encoded data.
[0087] In step S11, the encoded data is downsampled using one-dimensional average pooling to obtain multi-scale data.
[0088] In the present invention, when the meteorological data set is preprocessed, the meteorological data set can be denoised to obtain denoised data. in, is the data x at the tth time step t After denoising, the denoised data can be used to reduce the negative impact of noise data on prediction. After the Embedding operation, the data is input into the Encoder module of the Transformer network to obtain the encoded data. in, is the data of the tth time step after encoding, and E represents the number of dimensions after the Embedding operation. Use one-dimensional average pooling for downsampling to obtain multi-scale data Among them, k represents the number of different scales, Represents the data of the tth time step with a scale of n. This multi-scale data can facilitate subsequent predictions.
[0089] Among them, for the downsampling operation, the pooling window size is set to 2. In this implementation case, the scale k value is assigned to 3, the data of scale 1 is obtained by one-dimensional average pooling of the data of scale 0, the data of scale 2 is obtained by one-dimensional average pooling of the data of scale 1, and the data of scale 3 is obtained by one-dimensional average pooling of the data of scale 2.
[0090] In one embodiment of the present invention, Figure 3 As shown, the process of denoising meteorological data may include:
[0091] In step S12, a wavelet base is selected, and the weather forecast data set is input into the wavelet decomposition module of the wavelet base to obtain the first layer high frequency coefficient CD1 and the first layer low frequency coefficient CA1, and then the first layer low frequency coefficient CA1 is subjected to wavelet decomposition to obtain the second layer low frequency coefficient CA2 and the second layer high frequency coefficient CD2, and so on, until the specified j-th layer low frequency coefficient CA1 is obtained. j and the j-th layer high frequency coefficient CD j .
[0092] In step S13, all high frequency coefficients {CD1, ..., CD j} and the j-th layer low-frequency coefficient CA j Input to the thresholding module.
[0093] In step S14, denoising is performed according to the set threshold type and size to obtain the denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j .
[0094] In step S15, the denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j Enter the Reconstruction module.
[0095] In step S16, the reconstruction module recombines the denoised coefficients through inverse wavelet transform to obtain denoised data.
[0096] In the present invention, denoising is to reduce the negative impact of noise in the data on the prediction, and the denoising module may include a wavelet decomposition module, a threshold processing module and a reconstruction module. According to the selected different wavelet bases, such as Haar wavelet, Daubechies wavelet, Symlets wavelet, Coiflets wavelet, the weather forecast data set X is input into the wavelet decomposition module of the specified wavelet base to obtain the first layer high-frequency coefficient CD1 and the first layer low-frequency coefficient CA1, and then the first layer low-frequency coefficient CA1 is subjected to wavelet decomposition to obtain the second layer low-frequency coefficient CA2 and the second layer high-frequency coefficient CD2, and so on, until the specified j-th layer low-frequency coefficient CA1 is obtained. j and the j-th layer high frequency coefficient CD j Then all high-frequency coefficients {CD1,…,CD j} and the j-th layer low-frequency coefficient CA j Input to the threshold processing module, denoise according to the set threshold type and size, and obtain the denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j The denoised high-frequency coefficients {CD′1,…,CD′ j} and low frequency coefficient CA′ j Input the reconstruction module, which can recombine these coefficients through inverse wavelet transform to obtain denoised data In this embodiment, the value assigned to j can be 4.
[0097] In one embodiment of the present invention, Figure 4 As shown, the process of obtaining seasonal data and trend data may include:
[0098] In step S17, the multi-scale data is calculated according to formula (1) to obtain the trend data of the multi-scale data:
[0099]
[0100] Among them, w is the pooling window size, the stride is s, and x padded It represents the data after the original data is padded at both ends, q represents the relative position inside the pooling window, and m is the position index of the pooling window.
[0101] In step S18, the trend data is subtracted from the multi-scale data to obtain seasonal data of the multi-scale data.
[0102] In the present invention, the sequence decomposer can decompose the multi-scale data to obtain trend data by using the formula (1). Then, the seasonal data of the multi-scale data can be obtained by subtracting the trend data from the multi-scale data. n |n∈{0,1,2…k}} and trend data {T n |n∈{0,1,2…k}}, where n∈{0,1,2…k},s nt ∈R N×E represents the seasonal data at the t-th time step with scale n, t nu ∈R N×E Represents the trend data of the u-th time step with a scale of n. Meteorological data belongs to time series data. Time series usually contain one or more components of seasonal components, trend components, periodic components and irregular components. Seasonal components refer to time patterns that repeat throughout the time series. Trends refer to the gradual increase, decrease or horizontal movement of the observed values of the time series. Seasonality, trends and periodic time patterns show more obvious regularity at different time scales and have strong predictability. Therefore, decoupling meteorological data into seasonal data and trend data and conducting multi-scale analysis is more conducive to subsequent prediction work.
[0103] In one embodiment of the present invention, Figure 5 As shown, the first process of obtaining fused data may include:
[0104] In step S19, seasonal data at each scale and trend data at each scale are fused between scales.
[0105] In step S20, after the inter-scale fusion, the trend data and seasonal data in the same scale are fused to obtain fused data.
[0106] In the present invention, when seasonal data and trend data are fused between scales and within scales, seasonal data of each scale and trend data of each scale can be fused between scales first. After the seasonal data fusion and trend data fusion of each scale are completed, the trend data and seasonal data within the same scale can be fused, so that the fused data can be obtained. in, Represents the fused data of the tth time step with a scale of n.
[0107] In one embodiment of the present invention, Figure 6 As shown, the second process of obtaining the fused data may include:
[0108] In step S21, seasonal data and trend data of each scale are fused according to formula (2):
[0109]
[0110] in is the fused seasonal data of scale n, S n is the seasonal data with scale n before fusion, DownSample is a downsampling operation, S n-1 is the seasonal data with a scale of n-1 before fusion, is the trend data with scale n after fusion, T n is the trend data with a scale of n before fusion, UpSample is an upsampling operation, T n-1 It is the trend data with a scale of n-1 before fusion.
[0111] In step S22, seasonal data and trend data of uniform scale are fused according to formula (3):
[0112]
[0113] Among them, X n Represents the fused data.
[0114] In the present invention, when calculating the seasonal data of each scale {S n |n∈{0,1,2…k}} fusion and trend data {T n |n∈{0,1,2…k}}, it can be calculated according to formula (2), and the fusion of seasonal data and trend data of the same scale can be calculated according to formula (3). For trend data, the trend of large scale has more macro trend information, which can be used to guide the data fusion of trend data of smaller scale, so upsampling is used; while for seasonal data, small scale seasonal data can be aggregated into larger scale seasonal data, so downsampling is used for data fusion.
[0115] In one embodiment of the present invention, Figure 7 As shown, the downsampling process may include:
[0116] In step S23, the seasonal data S with a scale of n-1 is n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the first projection n-1 The lengths before and after projection are
[0117] In step S24, the projected seasonal data S' n-1 Perform a GELU activation function transformation to obtain the transformed seasonal data S" n-1 .
[0118] In step S25, the transformed seasonal data S" n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the second projection n-1 The lengths before and after projection are
[0119] In the present invention, the seasonal data S with size n-1 is n-1 When downsampling, the seasonal data S with a scale of n-1 can be n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the first projection n-1 After obtaining the seasonal data with a scale of n-1 after the first projection, the seasonal data after the first projection can be transformed by a GELU activation function to obtain the transformed seasonal data, and then the transformed seasonal data can be linearly projected again to obtain the seasonal data with a scale of n-1 after the second projection.
[0120] In one embodiment of the present invention, Figure 8 As shown, the upsampling process may include:
[0121] In step S26, the trend data T with a scale of n-1 is n-1 Perform linear projection to obtain trend data T' with a scale of n-1 after the first projection n-1 The lengths before and after projection are
[0122] In step S27, the projected trend data T' n-1 Perform a GELU activation function transformation to obtain the transformed trend data T" n-1 .
[0123] In step S28, the transformed trend data is linearly projected to obtain trend data T"' with a scale of n-1 after the second projection. n-1 The lengths before and after projection are
[0124] In the present invention, when the trend data of size n-1 is upsampled, the trend data of scale n-1 can be linearly projected, so as to obtain the trend data of scale n-1 after the first projection, and then the trend data after the projection can be transformed by a GELU activation function, so as to obtain the transformed trend data. After obtaining the transformed trend data, the data can be linearly projected for the second time, so as to obtain the trend data of scale n-1 after the second projection.
[0125] In one embodiment of the present invention, the L1-L2 hybrid loss function may be as shown in formula (4):
[0126]
[0127] Among them, pred d is the predicted value at the dth time step, true d is the true value of the dth time step, l is the predicted time step, tanh represents the hyperbolic tangent function, |pred d -true d | indicates that pred d -true d The operation result is taken as the absolute value.
[0128] On the other hand, the present invention also provides a weather forecasting system based on multi-scale time series analysis, which may include:
[0129] The denoising module processes the weather forecast data set to obtain denoised data.
[0130] The Encoder module of Transformer encodes the denoised data to obtain encoded data and obtain multi-scale data.
[0131] A sequence decomposer obtains seasonal data and trend data according to the multi-scale data.
[0132] Multi-scale fusion module, which performs inter-scale and intra-scale fusion of seasonal data and trend data;
[0133] The prediction module obtains the predicted value based on the upsampled data.
[0134] Loss function module, constructs loss functions for predicted values and true values.
[0135] Adam optimizer trains the above modules and updates the network parameters of the above modules according to the convergence of the loss function of the loss function module.
[0136] The present invention proposes a weather forecasting method based on multi-scale time series analysis (Multi-Scale Time-Series Analysis Method for Weather Forecasting, hereinafter referred to as MSWF).
[0137] In the experimental part, the MSWF method proposed in this invention is compared with four influential prediction algorithms in recent years.
[0138] iTransformer is included in ICLR 2024. This method mainly inverts the token to improve the model's prediction ability.
[0139] PatchTST is included in AAAI 2023. This method processes the data into patches.
[0140] FEDformer is included in ICML 2022. This method processes data in the frequency domain.
[0141] SCINet is included in NeurlPS2022. This method adopts a recursive downsampling-convolution-interaction architecture, in which multiple convolution filters are used to extract different temporal features from the downsampled subsequences.
[0142] In order to verify the effectiveness of the meteorological forecasting method based on multi-scale time series analysis proposed in the present invention in the field of meteorological forecasting, the prediction accuracy of MSWF, iTransformer, PatchTST, FEDformer and SCINet was experimentally compared.
[0143] This application tests these methods on the weather dataset, and each algorithm is run ten times on the dataset to take the average accuracy as the final result.
[0144] Table 1 describes the main features of the above weather dataset in detail.
[0145] Table 1 Datasets used in the experiments
[0146]
[0147] Table 2 shows the prediction results of each method on each dataset. Each row in bold font indicates the best prediction method on the corresponding dataset in that row.
[0148] Table 2 Prediction comparison results of each algorithm in the experiment (the results are the average of MSE and MAE of all prediction steps)
[0149]
[0150] From the experimental results in Table 2, we can see that:
[0151] The meteorological forecasting method based on multi-scale time series analysis proposed in this patent has the best forecasting effect on the weather data set. This shows that the meteorological forecasting method based on multi-scale time series analysis can improve the model prediction ability by removing noise from the data, decoupling it, and then fusing the data between and within multiple scales.
[0152] Through the above technical scheme, a meteorological forecasting method and system based on multi-scale time series analysis provided by the present invention can construct a meteorological forecasting data set, and then pre-process the meteorological forecasting data set to obtain multi-scale data. After obtaining the multi-scale data, the multi-scale data can be input into the sequence decomposer to obtain seasonal data and trend data, and then the seasonal data and trend data can be input into the multi-scale fusion module to perform inter-scale-intra-scale fusion to obtain the fused data. After the fused data is differentially upsampled, the data can be input into the prediction module for prediction, so that the predicted value can be obtained. According to the predicted value and the true value, a mixed loss function can be constructed, and then the network parameters can be updated according to the convergence of the mixed loss function, so that the meteorological forecasting model corresponding to the optimal network parameters can be obtained, and then the input meteorological data can be predicted to obtain the corresponding prediction result. The prediction method can decouple complex meteorological data, fully extract multiple inter-scale and intra-scale features, and improve the model prediction ability.
[0153] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0154] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0155] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0157] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0158] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0159] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0160] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0161] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A meteorological forecasting method based on multi-scale time series analysis, characterized in that: The weather forecasting method comprises: Construct a weather forecast dataset, weather forecast dataset X = {x1,…,x t …,x T }∈R T×N , where x t ∈R 1×N is the data of the tth time step, T is the total time step, and N is the number of features; Preprocessing the meteorological forecast data set to obtain multi-scale data; Inputting the multi-scale data into a sequence decomposer to obtain seasonal data and trend data; Inputting the seasonal data and trend data into a multi-scale fusion module for inter-scale and intra-scale fusion to obtain fused data; Perform difference upsampling on the fused data to obtain interpolated data; The interpolated upsampled data is input into the prediction module for prediction to obtain the predicted value, wherein the prediction module is composed of a fully connected layer, which is the nn.Linear component in PyTorch; Based on the predicted value and the true value, construct an L1-L2 mixed loss function; The L1-L2 mixed loss function is calculated to update the network parameters in the above steps until the loss converges, thereby obtaining a meteorological prediction model corresponding to the optimal network parameters, which is used to predict the input meteorological data and obtain the corresponding prediction results.
2. The weather forecasting method according to claim 1, characterized in that: Preprocessing the meteorological forecast data set to obtain multi-scale data includes: Inputting the weather forecast data set into a denoising module for processing to obtain denoised data; Perform the Embedding operation on the denoised data and input it into the Encoder module of the Transformer network to obtain the encoded data; The encoded data is downsampled using one-dimensional average pooling to obtain multi-scale data.
3. The weather forecasting method according to claim 2, characterized in that: The weather forecast data set is input into the denoising module for processing to obtain denoised data including: Select a wavelet basis, and input the weather forecast data set into the wavelet decomposition module of the wavelet basis to obtain the first layer high frequency coefficient CD1 and the first layer low frequency coefficient CA1, and then perform wavelet decomposition on the first layer low frequency coefficient CA1 to obtain the second layer low frequency coefficient CA2 and the second layer high frequency coefficient CD2, and so on, until the specified j-th layer low frequency coefficient CA1 is obtained. j and the j-th layer high frequency coefficient CD j ; All high-frequency coefficients {CD1,…,CD j } and the j-th layer low-frequency coefficient CA j Input to the threshold processing module; Denoising is performed according to the set threshold type and size to obtain the denoised high-frequency coefficients {CD′1,…,CD′ j } and low frequency coefficient CA′ j ; The denoised high-frequency coefficients {CD′1,…,CD′ j } and low frequency coefficient CA′ j Enter the reconstruction module; The reconstruction module recombines the denoised coefficients through inverse wavelet transform to obtain denoised data.
4. The weather forecasting method according to claim 1, characterized in that: Inputting the multi-scale data into the sequence decomposer to obtain seasonal data and trend data includes: The multi-scale data is calculated according to formula (1) to obtain the trend data of the multi-scale data: Among them, w is the pooling window size, the stride is s, and x padded Represents the data after the original data is padded at both ends, q represents the relative position inside the pooling window, and m is the position index of the pooling window; The trend data is subtracted from the multi-scale data to obtain seasonal data of the multi-scale data.
5. The weather forecasting method according to claim 1, characterized in that: The seasonal data and trend data are input into the multi-scale fusion module for inter-scale and intra-scale fusion, so that the fused data includes: The seasonal data of each scale and the trend data of each scale are integrated across scales; After inter-scale fusion, the trend data and seasonal data within the same scale are fused to obtain the fused data.
6. The weather forecasting method according to claim 5, characterized in that: The seasonal data and trend data are input into the multi-scale fusion module for inter-scale and intra-scale fusion, so that the fused data includes: According to formula (2), seasonal data and trend data of various scales are integrated: in is the fused seasonal data of scale n, S n is the seasonal data with scale n before fusion, DownSample is a downsampling operation, S n-1 is the seasonal data with a scale of n-1 before fusion, is the trend data with scale n after fusion, T n is the trend data with a scale of n before fusion, UpSample is an upsampling operation, T n-1 is the trend data with a scale of n-1 before fusion; According to formula (3), seasonal data and trend data of uniform scale are integrated: Among them, X n Represents the fused data.
7. The weather forecasting method according to claim 6, characterized in that: For seasonal data S with scale n-1 n-1 Downsampling involves: The seasonal data S with scale n-1 n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the first projection n-1 The lengths before and after projection are For the projected seasonal data S' n-1 Perform a GELU activation function transformation to obtain the transformed seasonal data S" n-1 ; For the transformed seasonal data S" n-1 Perform linear projection to obtain seasonal data S' with a scale of n-1 after the second projection n-1 The lengths before and after projection are 8. The weather forecasting method according to claim 6, characterized in that: For trend data T with scale n-1 n-1 Upsampling involves: For trend data T with scale n-1 n-1 Perform linear projection to obtain trend data T' with a scale of n-1 after the first projection n-1 The lengths before and after projection are For the projected trend data T' n-1 Perform a GELU activation function transformation to obtain the transformed trend data T" n-1 ; Perform linear projection on the transformed trend data to obtain the trend data T"' with a scale of n-1 after the second projection n-1 The lengths before and after projection are 9. The weather forecasting method according to claim 1, characterized in that: The L1-L2 mixed loss function is shown in formula (4): Among them, pred d is the predicted value at the dth time step, true d is the true value of the dth time step, l is the predicted time step, tanh represents the hyperbolic tangent function, |pred d -true d | indicates that pred d -true d The operation result is taken as the absolute value.
10. A meteorological forecasting system based on multi-scale time series analysis, characterized in that: The weather forecast system comprises: The denoising module processes the weather forecast data set to obtain denoised data; The Encoder module of Transformer encodes the denoised data to obtain encoded data and obtain multi-scale data; A sequence decomposer, which obtains seasonal data and trend data according to the multi-scale data; Multi-scale fusion module, which performs inter-scale and intra-scale fusion of seasonal data and trend data; Prediction module, obtains the predicted value based on the upsampled data; Loss function module, constructs loss functions for predicted values and true values; Adam optimizer trains the above modules and updates the network parameters of the above modules according to the convergence of the loss function of the loss function module.
Citation Information
Cited By
Incoming rainfall forecasting method based on C-band radar networking and deep learning
CN120876956A