Crude oil future price prediction method based on Dens-TCN and CNN

By combining the features of Dens-TCN and CNN, a comprehensive prediction model is constructed, which solves the problem that traditional methods are difficult to capture long-term trends and short-term features at the same time, and achieves higher prediction accuracy and adaptability.

CN119444282APending Publication Date: 2025-02-14HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411533888.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Traditional crude oil price prediction methods are difficult to capture long-term trends and short-term characteristics at the same time, resulting in unstable prediction results and difficult to adapt to nonlinear changes and emergencies in the market.

Method used

Using a comprehensive prediction model based on Dens-TCN and CNN, the features of Dens-TCN and CNN are deeply fused through a full connection layer, the long-term trend features of the time series are extracted using Dens-TCN, and the short-term features within the local time window are extracted using CNN. feature.

Benefits of technology

It has achieved the ability to steadily capture long-term trends and quickly respond to short-term fluctuations in a complex financial market environment, with higher prediction accuracy and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444282A_ABST
    Figure CN119444282A_ABST
Patent Text Reader

Abstract

A crude oil futures price prediction method based on Dens-TCN and CNN comprises the following steps: step 1, obtaining crude oil time series data and related macroscopic data, constructing a comprehensive data set, and preprocessing the data; 2, decomposing the preprocessed data by adopting EEMD (Ensemble Empirical Mode Decomposition), and extracting fine price fluctuation characteristics; 3, constructing a comprehensive prediction model based on the Dens-TCN and the CNN; 4, training a comprehensive prediction model, and performing parameter optimization on the model; and 5, combining the prediction results of the Dens-TCN and the CNN by adopting an equal weight method to generate a high-precision prediction result of the future crude oil future price. According to the method, the advantages of the Dens-TCN and the CNN are fused, the multi-level characteristics of the crude oil price can be effectively captured, emergencies and nonlinear fluctuation in a complex market environment can be dealt with, high prediction precision and stability are achieved, and reliable decision support is provided for investors, enterprises and policy formulators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of financial forecasting, and in particular to a crude oil futures price forecasting method based on Dens-TCN and CNN. Background Art

[0002] With the rapid development of the global energy market, crude oil, as a key energy resource, has a profound impact on the global economy and financial markets due to its price fluctuations. Crude oil prices are affected by a variety of factors, such as supply and demand, geopolitics, economic policies, and natural disasters, and are highly nonlinear and complex. Therefore, accurately predicting crude oil futures prices is of great strategic significance to investors, companies, and policymakers. However, traditional statistical and economic models often have difficulty in providing accurate prediction results when dealing with such complex market dynamics.

[0003] Traditional crude oil price forecasting methods mainly include models based on time series analysis, regression analysis models, and economic theory models. These methods have certain advantages in capturing historical trends and correlations, but they show limitations when facing high-frequency fluctuations and emergencies. With the development of big data and artificial intelligence technology, deep learning methods have shown strong capabilities in the field of time series forecasting. In particular, Dens-TCN and CNN perform well in capturing the complex features of time series data. Dens-TCN captures the long-term dependencies of time series through multi-layer convolution operations, while CNN is good at extracting local features and is suitable for processing short-term fluctuations and emergencies. However, when a single model processes complex financial data, it still has the limitations of long-term trends and short-term features that are difficult to capture at the same time and limited feature extraction capabilities, making it difficult to capture long-term trends and short-term features at the same time. For example, when capturing the long-term trend of crude oil prices, the traditional model ARIMA and the single deep learning model are easily affected by noise and emergencies in the market, resulting in unstable forecasting results and difficulty in adapting to nonlinear changes and emergencies in the market. Summary of the invention

[0004] In response to the technical problem that the results of crude oil price prediction by the above-mentioned model are unstable, this technical solution provides a crude oil futures price prediction method based on Dens-TCN and CNN. By constructing a comprehensive prediction model based on Dens-TCN and CNN, the features of Dens-TCN and CNN are deeply integrated through a fully connected layer, and Dens-TCN is used to extract the long-term trend features of the time series, and CNN is used to extract the short-term features within the local time window. This enables the comprehensive model to maintain a robust capture of long-term trends and quickly respond to short-term fluctuations when dealing with complex financial market environments, with higher prediction accuracy and adaptability, effectively solving the above-mentioned problems.

[0005] The present invention is achieved through the following technical solutions:

[0006] A crude oil futures price prediction method based on Dens-TCN and CNN, characterized by comprising the following steps:

[0007] Step 1: Obtain crude oil time series data and related macro data, build a comprehensive data set, and preprocess the data;

[0008] Step 2: Use EEMD to decompose the preprocessed data and extract the delicate price fluctuation characteristics;

[0009] Step 3: Build a comprehensive prediction model based on Dens-TCN and CNN;

[0010] Step 3.1: Build an improved Dens-TCN model, introduce the global attention mechanism GAM, use the dense module as the module of the overall framework, and provide long-term features for the comprehensive prediction model;

[0011] Step 3.2: Build an improved CNN model, optimize the network structure, increase parameters, improve activation functions or training algorithms to adapt to crude oil futures price forecasting; through correlation analysis, screen out the influencing factors that are highly correlated with crude oil prices to provide short-term features for the comprehensive forecasting model;

[0012] Step 3.3: Obtain a comprehensive prediction model based on Dens-TCN and CNN;

[0013] Step 4: Train the comprehensive prediction model and optimize the model parameters;

[0014] Step 5: Fusion the long-term trend features extracted by Dens-TCN with the short-term features extracted by CNN to generate the prediction results of future crude oil futures prices.

[0015] Furthermore, the improved Dens-TCN model described in step 3.1 is constructed, and the specific operation method includes:

[0016] Step 3.1.1: Introduce the densely linked DenseNet network structure to connect each layer of the model, strengthen the relationship between each layer, facilitate the transmission of information between each layer, reduce the feature loss of network transmission, and enable the Dens-TCN model to effectively capture the long-term trend characteristics of the time series. The specific formula is:

[0017] xi=H(xi -1 )+xi -1 ;

[0018] xi=H([x0,x1,…,xi -1 ]);

[0019] Among them, xi is the input feature of the i-th layer, [x0,x1,…,xi -1 ] is the fusion of the output features from the 0th layer to the i-1th layer, H(·) represents the function after the nonlinear transformation of the BN layer, Relu activation function and convolution layer;

[0020] Step 3.1.2: Introduce the attention model GAM, multiply the input features with the features output by the channel attention mechanism ChannelAttention, and use the same method to pass the channel attention Spatial

[0021] After Attention, the output features lay the foundation for the entire prediction framework. The specific formula is:

[0022]

[0023] Among them, F1 is the model input feature; F2 is the intermediate state; F3 is the output feature; M c is channel attention; M S for spatial attention; is the symbol of multiplication operation; W0∈R c / r×c , where R is the scaling ratio of the number of channels, c is the number of channels of the input feature, and r is the compression ratio; W1∈r c / r×c ;

[0024] Step 3.1.3: Integrate the GAM attention module in each TCN block layer, so that each convolution module has a GAM attention module, which greatly improves the operation efficiency of the input features through each layer. The TCN block module of each layer is the original improved temporal convolution module; the overall framework of the densely connected temporal convolution network Dens-TCN with global attention is densely connected;

[0025] Step 3.1.4: Under dense connection, the improved module TCN-GAM block with global attention GAM and two layers of 3*3 convolution are used as conv block modules in dense connection to improve the efficiency of the model in feature extraction and provide more accurate long-term prediction capabilities for the comprehensive model.

[0026] Furthermore, the construction of the improved CNN model described in step 3.2 is specifically performed as follows:

[0027] Step 3.2.1: Optimize the network structure to adjust the traditional CNN network by increasing the number of layers or changing the configuration of the layers to make it more suitable for processing the short-term prediction needs of crude oil futures prices;

[0028] Step 3.2.2: In the process of improving the CNN network, the Pearson correlation coefficient and the Spearman correlation coefficient are calculated to evaluate the correlation between crude oil futures prices and related influencing factors. If the correlation coefficient is close to 1 or -1, it means that there is a strong correlation between the two variables; if the correlation coefficient is close to 0, it means that there is basically no correlation between the two variables; the specific formula is:

[0029]

[0030] Where r(X,Y) is the Pearson correlation coefficient between X and Y; X is the crude oil price; Y is the relevant influencing factor; C(X,Y) is the covariance of X and Y; V[X] is the variance of X; V[Y] is the variance of Y;

[0031] Step 3.2.3: Based on the above price factors, an improved CNN model is constructed, and the mutual entropy method is used to solve the optimal solution of the neural network, so that the model can respond sensitively to short-term fluctuations in crude oil prices. The specific formula is:

[0032]

[0033] Where M is the mapping matrix; A n , B n , C n , D n These four rows represent the changes in different influencing factors and crude oil prices over time; A1, B1, C1, and D1 are the values ​​of different influencing factors and crude oil prices at time t.

[0034] Furthermore, the specific operation method of training the comprehensive prediction model described in step 4 and optimizing the model parameters is as follows: using the long-term dependence characteristics of crude oil prices to train the Dens-TCN model; extracting short-term features through convolution and pooling operations, and performing correlation analysis to screen influencing factors; extracting the short-term features of crude oil futures prices, constructing an improved CNN model, and capturing the price fluctuation characteristics within the local time window through convolution and pooling operations.

[0035] Furthermore, the training of the improved Dens-TCN model uses the Adam optimizer, sets the initial learning rate to 0.001, and trains for 100 epochs; the training of the improved CNN model uses the same training parameters as the training of the improved Dens-TCN model, and trains for 100 epochs.

[0036] Furthermore, in step 5, the long-term trend features extracted by Dens-TCN are fused with the short-term features extracted by CNN. The specific operation method is as follows:

[0037] The prediction results of Dens-TCN and CNN are combined by equal weight method to construct a comprehensive model; the weight coefficients of Dens-TCN and CNN are set to 0.5, and the specific formula is:

[0038] combinVal j =W cnn Cn pre j +W tcn Tcn pre j ,j=1,2,..6

[0039] Among them, combinVal j is the combined prediction value at the jth time point; W cnn is the prediction weight of CNN; Cnn pre j is the predicted value of CNN at the jth time point; W tcn is the prediction weight of TCN; Tcn pre j is the predicted value of TCN at the jth time point; j = 1, 2, .. 6 represents the index of the time point.

[0040] Furthermore, the step 1 of obtaining the crude oil time series data and related macroeconomic data is performed by crawling the crude oil time series data and related macroeconomic data from multiple data source websites.

[0041] Furthermore, the specific operation method of step one includes:

[0042] Step 1.1: Crawl crude oil futures trading data, including: user's date, close closing price, open opening price, high highest price, low lowest price, vol trading volume and pct_chg increase rate;

[0043] Step 1.2: Use Min-max normalization to preprocess the data set. The specific formula is:

[0044]

[0045] Among them, α′ t Represents the data after Min-max normalization, α t represents the data in the initial data set that has not been processed, α min Represents the minimum value data in the original data set, α max Represents the maximum value in the original data set.

[0046] Furthermore, in step 2, EEMD is used to decompose the preprocessed data to extract delicate price fluctuation characteristics; EEMD is used to decompose the crude oil futures transaction price time series into multiple IMF components. The specific decomposition steps are as follows:

[0047] Step 2.1: Add white noise to the original signal:

[0048] I i (t)=I(t)+α i (t);

[0049] Among them, I i (t) represents the signal obtained after the i-th noise addition, I(t) represents the original signal, and α i (t) represents the white noise added for the ith time, and t represents the time variable;

[0050] Step 2.2: Add noise to the I i (t) Perform EMD decomposition to obtain IMFs:

[0051]

[0052] Among them, I i (i) represents the signal obtained after the i-th noise addition, imf ij (t) represents the jth intrinsic mode function obtained by the i-th decomposition, r in (t) represents the residual term of the i-th decomposition, i represents the i-th decomposition with noise added, j represents the j-th intrinsic mode function, and n represents the number of IMFs obtained by decomposition;

[0053] Step 2.3: Repeat the process of step 2.1 and step 2.2, add different white noises multiple times to change the original signal, and decompose it using EMD;

[0054] Step 2.4: Calculate the average of the results obtained after repeated decomposition for m times. The specific operation is to calculate the average of the IMF and trend items of the same order to obtain the final IMF and trend items:

[0055]

[0056] Among them, IMF j (t) represents the final j-th IMF, m is the number of times different noises are added and decomposed repeatedly, imf ij (t) represents the jth IMF obtained from the i-th decomposition, r n (t) is the final residual term;

[0057] Step 2.5: Finally, the result of EEMD decomposition of the original signal is obtained:

[0058]

[0059] Among them, I(t) represents the final decomposition result of the original signal, imf j (t) represents the final j-th IMF, r n (t) is the final residual term.

[0060] Beneficial Effects

[0061] The crude oil futures price prediction method based on Dens-TCN and CNN proposed in the present invention has the following beneficial effects compared with the prior art:

[0062] (1) The present invention combines the advantages of Dens-TCN and CNN by constructing a comprehensive prediction model based on Dens-TCN and CNN. The long-term trend features of the time series are extracted by Dens-TCN, and the short-term features in the local time window are extracted by CNN. Specifically, the Dens-TCN part captures the long-term dependency through multi-layer time convolution, while the CNN part extracts local features through convolution and pooling operations. After the features of the two parts are fused, Dens-TCN can capture the long-term trend features in the time series, providing a stable prediction basis for the comprehensive model. CNN is good at extracting short-term features in the local time window, so that the comprehensive model can keenly respond to short-term fluctuations and emergencies in the market. This fusion is not just a simple accumulation of the advantages of the two, but a deep fusion of the two features through the fully connected layer, thereby achieving feature complementarity and enhancement. This complementary fusion enables the comprehensive model to maintain a robust capture of long-term trends and quickly respond to short-term fluctuations when dealing with complex financial market environments, with higher prediction accuracy and adaptability.

[0063] (2) The combination of Dens-TCN and CNN models in the present invention forms a synergistic effect through feature complementarity and fusion: Dens-TCN can extract long-term trend information in time series through its long-term dependent modeling ability, while CNN can quickly capture short-term volatility characteristics through local convolution operations. This fusion not only enables the model to work effectively at different time scales, but also enables the information of short-term features to be fed back into the long-term trend extraction process through joint optimization weight sharing, further correcting the model's prediction of future trends. Similarly, long-term trend features can enhance the robustness of short-term volatility predictions through interaction with short-term features, allowing the model to show better stability and responsiveness when facing sudden market changes.

[0064] (3) The present invention can not only effectively capture the multi-level characteristics of crude oil prices, but also cope with emergencies and nonlinear fluctuations in complex market environments. Dens-TCN captures long-term dependencies in time series through multi-layer convolution operations, can filter out short-term noise, and provide more robust predictions when emergencies occur. CNN extracts local features in time series through convolution and pooling operations, enabling the model to perceive and respond to sudden changes in the market in a timely manner. In the comprehensive model, by utilizing the sensitivity of CNN and the robustness of Dens-TCN, the model can effectively distinguish short-term abnormal fluctuations from long-term trends when facing emergencies, providing more accurate judgments for predictions. Crude oil prices have obvious nonlinear characteristics. Dens-TCN can capture nonlinear trends in data through time convolution, while CNN can cope with short-term nonlinear fluctuations by extracting local features. By integrating the features of Dens-TCN and CNN, the comprehensive model has the ability to capture long-term and short-term nonlinear features at the same time, and can more accurately predict price trends. Experimental verification shows that the comprehensive prediction model based on Dens-TCN and CNN performs significantly better than traditional methods and single deep learning models in crude oil futures price prediction, and has higher prediction accuracy.

[0065] (4) The present invention combines EEMD decomposition, Dens-TCN model and CNN model to form a powerful comprehensive prediction framework. First, EEMD decomposition effectively removes market noise, extracts multi-scale crude oil price fluctuation characteristics, and ensures the quality of input data. The Dens-TCN model uses densely connected networks (DenseNet) and global attention mechanisms (GAM), so that the model can effectively capture the long-term trend characteristics of crude oil prices, especially when dealing with nonlinearities and complex dependencies in time series. At the same time, the improved CNN model extracts features closely related to short-term fluctuations in crude oil prices from local time windows through convolution and pooling operations, and ensures that only key factors useful for prediction are retained through correlation analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is the overall flow chart of the present invention.

[0067] Figure 2 This is a price diagram of the improved Dens-TCN model in the present invention.

[0068] Figure 3 Schematic diagram of the improved CNN model architecture in the present invention.

[0069] Figure 4 This is a graph showing the prediction results of crude oil futures prices based on the comprehensive prediction model based on Dens-TCN and CNN in the present invention. DETAILED DESCRIPTION

[0070] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Under the premise of not departing from the design concept of the present invention, various modifications and improvements made by ordinary persons in the art to the technical solutions of the present invention should all fall within the protection scope of the present invention.

[0071] Embodiment 1:

[0072] like Figure 1 As shown, a crude oil futures price prediction method based on Dens-TCN and CNN includes the following steps:

[0073] Step 1: Obtain crude oil time series data and related macro data, build a comprehensive data set, and pre-process the data; the specific operations include:

[0074] Step 1.1: Crawl crude oil futures trading data, including: user's date, close closing price, open opening price, high highest price, low lowest price, vol trading volume and pct_chg increase rate.

[0075] Step 1.2: Use Min-max normalization to preprocess the data set. The specific formula is:

[0076]

[0077] Among them, α′ t Represents the data after Min-max normalization, α t represents the data in the initial data set that has not been processed, α min Represents the minimum value data in the original data set, α max Represents the maximum value in the original data set.

[0078] Step 2: Use EEMD to decompose the preprocessed data and extract the delicate price fluctuation characteristics; use EEMD decomposition to decompose the crude oil futures trading price time series into multiple IMF components. The specific decomposition steps are as follows:

[0079] Step 2.1: Add white noise to the original signal:

[0080] I i (t)=I(t)+α i (t);

[0081] Among them, I i (t) represents the signal obtained after the i-th noise addition, I(t) represents the original signal, and α i(t) represents the white noise added for the ith time, and t represents the time variable.

[0082] Step 2.2: Add noise to the I i (t) Perform EMD decomposition to obtain IMFs:

[0083]

[0084] Among them, I i (i) represents the signal obtained after the i-th noise addition, imf ij (t) represents the jth intrinsic mode function obtained by the i-th decomposition, r in (t) represents the residual term of the i-th decomposition, i represents the i-th decomposition with noise added, j represents the j-th intrinsic mode function, and n represents the number of IMFs obtained by decomposition.

[0085] Step 2.3: Repeat the process of step 2.1 and step 2.2, add different white noises multiple times to change the original signal, and decompose it using EMD.

[0086] Step 2.4: Calculate the average of the results obtained after repeated decomposition for m times. The specific operation is to calculate the average of the IMF and trend items of the same order to obtain the final IMF and trend items:

[0087]

[0088] Among them, IMF j (t) represents the final j-th IMF, m is the number of times different noises are added and decomposed repeatedly, imf ij (t) represents the jth IMF obtained from the i-th decomposition, r n (t) is the final residual term.

[0089] Step 2.5: Finally, the result of EEMD decomposition of the original signal is obtained:

[0090]

[0091] Among them, I(t) represents the final decomposition result of the original signal, imf j (t) represents the final j-th IMF, r n (t) is the final residual term.

[0092] Step 3: Build a comprehensive prediction model based on Dens-TCN and CNN; specifically include the following steps:

[0093] Step 3.1: Build an improved Dens-TCN model, introduce the global attention mechanism GAM, use the dense module as the module of the overall framework, and provide long-term features for the comprehensive prediction model; the specific operation methods include:

[0094] Step 3.1.1: Introduce the densely linked DenseNet network structure to connect each layer of the model, strengthen the relationship between each layer, facilitate the transmission of information between each layer, reduce the feature loss of network transmission, and enable the Dens-TCN model to effectively capture the long-term trend characteristics of the time series. The specific formula is:

[0095] x i =H(x i-1 )+x i-1 ;

[0096] x i =H([x0,x1,…,x i-1 ]);

[0097] Among them, x i is the input feature of the i-th layer, [x0,x1,…,x i-1 ] is the fusion of the output features from the 0th layer to the i-1th layer, and H(·) represents the function after the nonlinear transformation of the BN layer, Relu activation function and convolution layer.

[0098] Step 3.1.2: Introduce the attention model GAM, multiply the input features with the features output by the channel attention mechanism ChannelAttention, and use the same method to output features after the channel attention Spatial Attention, laying the foundation for the entire prediction framework. The specific formula is:

[0099]

[0100] Among them, F1 is the model input feature; F2 is the intermediate state; F3 is the output feature; M c is channel attention; M S for spatial attention; is the symbol of multiplication operation; W0∈R c / r×c , where R is the scaling ratio of the number of channels, c is the number of channels of the input feature, and r is the compression ratio; W1∈r c / r×c ;

[0101] Step 3.1.3: Integrate the GAM attention module into the TCN block layer of each layer, so that each layer of the convolution module has a GAM attention module, which greatly improves the running efficiency of the input features through each layer. The TCN block module of each layer is the original improved temporal convolution module; the overall framework of the densely connected temporal convolution network Dens-TCN with global attention is densely connected.

[0102] Step 3.1.4: Under dense connection, the improved module TCN-GAM block with global attention GAM and two layers of 3*3 convolution are used as conv block modules in dense connection to improve the efficiency of the model in feature extraction and provide more accurate long-term prediction capabilities for the comprehensive model.

[0103] Step 3.2: Build an improved CNN model, optimize the network structure, increase parameters, improve activation functions or training algorithms to adapt to crude oil futures price forecasting; through correlation analysis, screen out the influencing factors that are highly correlated with crude oil prices to provide short-term features for the comprehensive forecasting model; the specific operation method is:

[0104] Step 3.2.1: Optimize the network structure to adjust the traditional CNN network by increasing the number of layers or changing the configuration of the layers to make it more suitable for processing the short-term prediction needs of crude oil futures prices;

[0105] Step 3.2.2: In the process of improving the CNN network, the Pearson correlation coefficient and the Spearman correlation coefficient are calculated to evaluate the correlation between crude oil futures prices and related influencing factors. If the correlation coefficient is close to 1 or -1, it means that there is a strong correlation between the two variables; if the correlation coefficient is close to 0, it means that there is basically no correlation between the two variables; the specific formula is:

[0106]

[0107] Where r(X,Y) is the Pearson correlation coefficient between X and Y; X is the crude oil price; Y is the relevant influencing factor; C(X,Y) is the covariance of X and Y; V[X] is the variance of X; V[Y] is the variance of Y;

[0108] Step 3.2.3: Based on the above price factors, an improved CNN model is constructed, and the mutual entropy method is used to solve the optimal solution of the neural network, so that the model can respond sensitively to short-term fluctuations in crude oil prices. The specific formula is:

[0109]

[0110] Where M is the mapping matrix; A n , B n , C n , D n These four rows represent the changes in different influencing factors and crude oil prices over time; A1, B1, C1, and D1 are the values ​​of different influencing factors and crude oil prices at time t.

[0111] Step 3.3: Obtain a comprehensive prediction model based on Dens-TCN and CNN.

[0112] Step 4: Train the comprehensive prediction model and optimize the model parameters; the specific operation method is:

[0113] The Dens-TCN model is trained using the long-term dependency characteristics of crude oil prices. The Adam optimizer is used, the initial learning rate is set to 0.001, and 100 epochs are trained. Short-term features are extracted through convolution and pooling operations, and correlation analysis is performed to screen influencing factors.

[0114] The short-term features of crude oil futures prices were extracted and an improved CNN model was constructed. Through convolution and pooling operations, the price fluctuation features within the local time window were captured. The model used the same training parameters and was trained for 100 epochs.

[0115] Step 5: Fusion of the long-term trend features extracted by Dens-TCN and the short-term features extracted by CNN is to combine the prediction results of Dens-TCN and CNN by equal weight method to construct a comprehensive model; the prediction results of future crude oil futures prices are generated through the comprehensive model.

[0116] The weight coefficients of Dens-TCN and CNN are set to 0.5. The specific formula is:

[0117] combinVal j =W cnn Cn pre j +W tcn Tcn pre j ,j=1,2,..6

[0118] where combinVal j is the combined prediction value at the jth time point; W cnn is the prediction weight of CNN; Cnn pre j is the predicted value of CNN at the jth time point; W tcn is the prediction weight of TCN; Tcn pre j is the predicted value of TCN at the jth time point; j = 1, 2, .. 6 represents the index of the time point.

[0119] In order to verify the feasibility and superiority of this solution, the inventor conducted a comparative experiment for comparison. The specific experimental steps are as follows:

[0120] A comparative experiment was designed and conducted. The data set was divided into a training set and a test set, with the training set accounting for 80% and the test set accounting for 20%. In order to verify the effectiveness of the comprehensive model, the ARIMA model, LSTM model, and RNN model were selected as comparison objects. These models are representative in time series prediction. The root mean square error (MSE) and square absolute error (MAE) were used as evaluation indicators to calculate the performance of each model on the test set. The specific formula is:

[0121]

[0122] Where N is the number of samples, t is the time step index, and y t is the true value, is the predicted value. MSE is the average of the sum of squared errors, and MAE is the average of the absolute values ​​of the errors.

[0123] After the experimental operation, the following experimental data were obtained:

[0124] Model MSE MAE ARIMA 0.05685 0.19356 LSTM 0.04213 0.16272 RNN 0.04854 0.17847 Dens-TCN+CNN 0.03945 0.14319

[0125] According to the experimental data in the above table, the experimental conclusion can be drawn: the MSE of the comprehensive prediction model based on Dens-TCN and CNN designed in this embodiment is 0.03945, and the MAE is 0.14319, which is significantly better than other models.

[0126] Figure 4 The actual effect of the comprehensive prediction model based on Dens-TCN and CNN in the prediction of crude oil futures prices is demonstrated, wherein the red curve represents the actual crude oil futures price, and the blue curve represents the prediction result of the comprehensive model of Dens-TCN and CNN. It can be seen from the figure that the prediction curve of the comprehensive model has a high degree of fit with the actual price trend, especially in the period of drastic price fluctuations. The comprehensive model effectively captures the price trend and shows good adaptability to the complex market environment; it verifies that the comprehensive prediction model based on Dens-TCN and CNN proposed in the present invention has a good prediction effect in the prediction of crude oil futures prices.

[0127] The experimental results show that the comprehensive model exhibits higher stability and adaptability in dealing with emergencies and market fluctuations. In summary, the present invention provides reliable decision support for investors, enterprises and policy makers, and significantly improves the accuracy and robustness of crude oil futures price forecasting.

[0128] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the present invention.

Claims

1. A crude oil futures price prediction method based on Dens-TCN and CNN, characterized by: Including steps: Step 1: Obtain crude oil time series data and related macro data, build a comprehensive data set, and preprocess the data; Step 2: Use EEMD to decompose the preprocessed data and extract the delicate price fluctuation characteristics; Step 3: Build a comprehensive prediction model based on Dens-TCN and CNN; Step 3.1: Build an improved Dens-TCN model, introduce the global attention mechanism GAM, use the dense module as the module of the overall framework, and provide long-term features for the comprehensive prediction model; Step 3.2: Build an improved CNN model, optimize the network structure, increase parameters, improve activation functions or training algorithms to adapt to crude oil futures price forecasting; through correlation analysis, screen out influencing factors that are highly correlated with crude oil prices to provide short-term features for the comprehensive forecasting model; Step 3.3: Obtain a comprehensive prediction model based on Dens-TCN and CNN; Step 4: Train the comprehensive prediction model and optimize the model parameters; Step 5: Fusion the long-term trend features extracted by Dens-TCN with the short-term features extracted by CNN to generate the prediction results of future crude oil futures prices.

2. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: The improved Dens-TCN model described in step 3.1 is constructed, and the specific operation methods include: Step 3.1.1: Introduce the densely linked DenseNet network structure to connect each layer of the model and strengthen the relationship between each layer, so that the Dens-TCN model can effectively capture the long-term trend characteristics of the time series. The specific formula is: x i =H(x i-1 )+x i-1 ; x i =H([x0,x1,...,x i-1 ]); Among them, x i is the input feature of the i-th layer, [x0, x1, ..., x i-1 ] is the fusion of the output features from the 0th layer to the i-1th layer, H(·) represents the function after the nonlinear transformation of the BN layer, Relu activation function and convolution layer; Step 3.1.2: Introduce the attention model GAM, multiply the input features with the features output by the channel attention mechanism Channel Attention, and use the same method to output features after the channel attention Spatial Attention, laying the foundation for the entire prediction framework. The specific formula is: Among them, F1 is the model input feature; F2 is the intermediate state; F3 is the output feature; M c is channel attention; M S for spatial attention; is the symbol of multiplication operation; W0∈R c / r×c , where R is the scaling ratio of the number of channels, c is the number of channels of the input feature, and r is the compression ratio; W1∈r C / r×c ; Step 3.1.3: Integrate the GAM attention module in each TCN block layer, so that each convolution module has a GAM attention module, and each TCN block module is the original improved temporal convolution module; the overall framework of the densely connected temporal convolution network Dens-TCN with global attention is densely connected; Step 3.1.4: Under dense connection, the improved module TCN-GAM block with global attention GAM and two layers of 3*3 convolution are used as conv block modules in dense connection to improve the efficiency of the model in feature extraction and provide more accurate long-term prediction capabilities for the comprehensive model.

3. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: The specific operation method of building the improved CNN model described in step 3.2 is as follows: Step 3.2.1: Optimize the network structure to adjust the traditional CNN network by increasing the number of layers or changing the configuration of the layers to make it more suitable for processing the short-term prediction needs of crude oil futures prices; Step 3.2.2: In the process of improving the CNN network, the Pearson correlation coefficient and the Spearman correlation coefficient are calculated to evaluate the correlation between crude oil futures prices and related influencing factors. If the correlation coefficient is close to 1 or -1, it means that there is a strong correlation between the two variables; if the correlation coefficient is close to 0, it means that there is basically no correlation between the two variables; the specific formula is: Where r(X, Y) is the Pearson correlation coefficient between X and Y; X is the crude oil price; Y is the relevant influencing factor; C(X, Y) is the covariance of X and Y; V[X] is the variance of X; V[Y] is the variance of Y; Step 3.2.3: Based on the above price factors, an improved CNN model is constructed, and the mutual entropy method is used to solve the optimal solution of the neural network, so that the model can respond sensitively to short-term fluctuations in crude oil prices. The specific formula is: Where M is the mapping matrix; A n , B n , C n , D n These four rows represent the changes in different influencing factors and crude oil prices over time series; A1, B1, C1, and D1 are the values ​​of different influencing factors and crude oil prices at time t.

4. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: The specific operation method of training the comprehensive prediction model and optimizing the model parameters as described in step 4 is as follows: using the long-term dependence characteristics of crude oil prices to train the Dens-TCN model; extracting short-term features through convolution and pooling operations, and performing correlation analysis to screen influencing factors; extracting the short-term features of crude oil futures prices, constructing an improved CNN model, and capturing the price fluctuation characteristics within the local time window through convolution and pooling operations.

5. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 4, characterized in that: The improved Dens-TCN model is trained using the Adam optimizer, with the initial learning rate set to 0.001, and trained for 100 epochs; the improved CNN model is trained using the same training parameters as the improved Dens-TCN model, and trained for 100 epochs.

6. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: Step 5 describes the fusion of the long-term trend features extracted by Dens-TCN and the short-term features extracted by CNN. The specific operation method is as follows: The prediction results of Dens-TCN and CNN are combined by equal weight method to construct a comprehensive model; the weight coefficients of Dens-TCN and CNN are set to 0.5, and the specific formula is: combinVal j =W cnn Cnn pre j +W tcn Tcn pre j ,j=1,2,..6 Among them, combinVal j is the combined prediction value at the jth time point; W cnn is the prediction weight of CNN; Cnn pre j is the predicted value of CNN at the jth time point; W tcn is the prediction weight of TCN; Tcn pre j is the predicted value of TCN at the jth time point; j = 1, 2, .. 6 represents the index of the time point.

7. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: The step 1 of obtaining crude oil time series data and related macroeconomic data is to crawl crude oil time series data and related macroeconomic data from multiple data source websites.

8. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1 or 7, characterized in that: The specific operation method of step one includes: Step 1.1: Crawl crude oil futures trading data, including: user's date, close closing price, open opening price, high highest price, low lowest price, vol trading volume and pct_chg increase rate; Step 1.2: Use Min-max normalization to preprocess the data set. The specific formula is: Among them, α′ t Represents the data after Min-max normalization, α t represents the data in the initial data set that has not been processed, α min Represents the minimum value data in the original data set, α max Represents the maximum value in the original data set.

9. The crude oil futures price prediction method based on Dens-TCN and CNN according to claim 1, characterized in that: In the step 2, EEMD is used to decompose the preprocessed data to extract delicate price fluctuation characteristics; EEMD is used to decompose the crude oil futures transaction price time series into multiple IMF components. The specific decomposition steps are as follows: Step 2.1: Add white noise to the original signal: I i (t)=I(t)+α i (t); Among them, I i (t) represents the signal obtained after the i-th noise addition, I(t) represents the original signal, and α i (t) represents the white noise added for the ith time, and t represents the time variable; Step 2.2: Add noise to the I i (t) Perform EMD decomposition to obtain IMFs: Among them, I i (t) represents the signal obtained after the i-th noise addition, imf ij (t) represents the jth intrinsic mode function obtained by the i-th decomposition, rin(t) represents the residual term of the i-th decomposition, i represents the i-th decomposition with noise added, j represents the j-th intrinsic mode function, and n represents the number of IMFs obtained by decomposition; Step 2.3: Repeat the process of step 2.1 and step 2.2, add different white noises multiple times to change the original signal, and decompose it using EMD; Step 2.4: Calculate the average of the results obtained after repeated decomposition for m times. The specific operation is to calculate the average of the IMF and trend items of the same order to obtain the final IMF and trend items: Among them, IMF j (t) represents the final j-th IMF, m is the number of times different noises are added and decomposed repeatedly, imf ij (t) represents the jth IMF obtained from the i-th decomposition, r n (t) is the final residual term; Step 2.5: Finally, the result of EEMD decomposition of the original signal is obtained: Among them, I(t) represents the final decomposition result of the original signal, imf j (t) represents the final j-th IMF, r n (t) is the final residual term.