Stock price prediction method based on deep decomposition autocorrelation model

By introducing trend cycle feature decomposition module and autocorrelation mechanism into deep learning models, the problem that existing models fail to effectively decompose trend characteristics in stock price prediction is solved, the prediction accuracy and calculation efficiency are improved, multivariate and univariate prediction are supported, and real-time data updates and risk warnings are provided.

CN120471709APending Publication Date: 2025-08-12YUNNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510363849.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing deep learning models fail to effectively decompose trend characteristics in stock price prediction, resulting in insufficient performance when processing non-cyclical stock market data, high computational complexity and limited generalization ability.

Method used

A trend cycle feature decomposition module is introduced, and the time series is decomposed into trend terms and seasonal terms through the sliding average method. The autocorrelation mechanism is used to extract features. The decoder performs detailed decomposition layer by layer, combining the autocorrelation mechanism to replace the traditional attention mechanism to reduce the computational complexity.

Benefits of technology

It improves the accuracy and stability of stock price prediction, enhances the adaptability to non-periodic data, reduces the computational complexity, supports multivariate and univariate prediction, and provides real-time data updates and risk warning functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471709A_ABST
    Figure CN120471709A_ABST
Patent Text Reader

Abstract

The invention discloses a stock price prediction method based on a deep decomposition autocorrelation model, and relates to the technical field of financial time series prediction, and the method comprises the steps: S1, data acquisition and preprocessing, S2, model architecture design, S3, model training and parameter configuration, S4, prediction generation and post-processing, and S5, deployment and application. According to the invention, a trend period characteristic decomposition module is introduced, the model can display long-term trend and short-term fluctuation in a separation time sequence, complex dynamic characteristics of a stock market are effectively captured, the prediction precision is improved, a trend period progressive decomposition mechanism in a decoder avoids information loss by refining characteristic components layer by layer, and the prediction precision is improved. The adaptive capacity to non-periodic data is enhanced, the long-term prediction result is more stable and reliable, an autocorrelation mechanism is adopted to replace a traditional attention mechanism, the sequence periodic dependence is efficiently captured through fast Fourier transform, the calculation complexity is reduced, and the training and reasoning efficiency of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of financial time series prediction, and in particular relates to a stock price prediction method based on a deep decomposition autocorrelation model. Background Art

[0002] Stock price prediction has always been an important research topic in the financial market. Stock prices are influenced by a variety of factors, including market supply and demand, company financial status, macroeconomic environment, policies and regulations, and investor sentiment. The complex nonlinear relationships between these factors make accurate stock price prediction a challenging task.

[0003] In recent years, deep learning techniques have been widely applied to financial time series forecasting tasks. The Transformer-based Autoformer model, which introduces decomposition and autocorrelation mechanisms, can be used for long-term time series forecasting. However, the Autoformer only gradually decomposes seasonal features and fails to effectively decompose trend features, making it inadequate for non-cyclical stock market data. Furthermore, existing deep learning models often suffer from high computational complexity and limited generalization capabilities when processing multivariate time series data. To address these issues, the following solutions are proposed. Summary of the Invention

[0004] The purpose of the present invention is to provide a stock price prediction method based on a deep decomposition autocorrelation model. By introducing a trend-cycle feature decomposition module, the model can display and separate long-term trends and short-term fluctuations in time series, effectively capture the complex dynamic characteristics of the stock market, and improve the prediction accuracy. It solves the problem that the existing model only gradually decomposes seasonal characteristics but fails to effectively decompose trend characteristics, resulting in its insufficient performance when processing non-periodic stock market data.

[0005] To solve the above technical problems, the present invention is achieved through the following technical solutions:

[0006] The present invention is a stock price prediction method based on a deep decomposition autocorrelation model, comprising:

[0007] Step S1, data acquisition and preprocessing: historical stock data (such as opening price, closing price, etc.) is obtained from the financial platform, outliers are cleaned and missing data is filled, and normalization processing (Z-score) is performed, and the data is divided into training set, validation set and test set (6:2:2) in chronological order;

[0008] Step S2, model architecture design: The encoder decomposes the input sequence into trend terms and seasonal terms through sliding average, and uses the autocorrelation mechanism to extract long-term trend and periodic features respectively. The decoder introduces a trend progressive decomposition module, integrates the encoder's latent variables, and gradually refines the predicted seasonal and trend components, and finally generates a weighted prediction result.

[0009] Step S3, model training and parameter configuration: use mean square error as the loss function, use Adam optimizer, and set hyperparameters such as input sequence length, hidden layer dimension, and number of attention heads;

[0010] Step S4, prediction generation and post-processing: supports single-variable (closing price only) and multi-variable prediction (multiple features input), restores the predicted value to the original price dimension through denormalization, and outputs the stock price curve;

[0011] Step S5, Deployment and Application: Real-time access to the latest data dynamically updates the model input, generates a visual price trend forecast for the next 1-30 days, and triggers automated trading signals or risk warnings based on volatility thresholds.

[0012] Furthermore, the step S1, data acquisition and preprocessing, specifically includes the following steps:

[0013] Step S11, data acquisition: acquiring historical trading data of the target stock from a financial data platform, including but not limited to opening price, highest price, lowest price, and closing price, with a time span covering at least 10 years;

[0014] Step S12, data cleaning: remove missing values or outliers (such as prices of zero or extreme fluctuation points), and use linear interpolation to fill missing data; standardize the data and use the Z-score normalization method to scale each feature to a distribution with a mean of 0 and a variance of 1;

[0015] Step S13, data segmentation: divide the dataset into training set, validation set and test set in chronological order, with the ratio set to 6:2:2 to ensure that the temporal continuity is not destroyed;

[0016] Ensuring the integrity and quality of input data provides a reliable foundation for model training. Data cleaning and standardization eliminate the impact of noise and outliers, making the data distribution more even and facilitating model learning. Data segmentation ensures the temporal continuity of training, validation, and test sets, preventing future information leakage.

[0017] Furthermore, the step S2, model architecture design specifically includes the following steps:

[0018] Step S21: Model input definition, specifically:

[0019] Encoder input: length L seq Time series data Where d is the feature dimension (such as opening price, closing price, etc.);

[0020] Decoder input: seasonal part X output by encoder des and the trend part X det Spliced together, specifically:

[0021] X des =Concat(X ens ,X0);

[0022] X det =Concat(X ent ,X mean );

[0023] Where X0 is a placeholder for all zeros, X ens , X ent are the seasonal part and the trend part after decomposition, X mean It is a placeholder for the mean value of historical data;

[0024] Step S22, encoder design, specifically includes the following steps:

[0025] Step S221, sequence decomposition module: use sliding average method to decompose the input sequence X en Decomposed into trend term X t and seasonal term X s , the formula is as follows:

[0026] X t =AvgPool(Padding(X))(Trend Item);

[0027] X s =XX t (seasonal item);

[0028] Where X is the original time series input;

[0029] Step S222, hierarchical feature extraction, specifically includes:

[0030] Seasonal branch: Capture periodic dependencies through auto-correlation mechanism and extract seasonal features layer by layer

[0031] Trend branch: Added trend decomposition block to extract trend features through autocorrelation mechanism and sliding average operation

[0032] Each layer of encoder outputs a latent variable containing season and trend and Used for decoder cross information transmission;

[0033] Step S23, decoder design: trend cycle progressive decomposition module, specifically including the following steps:

[0034] Step S231, initialization decomposition: perform autocorrelation calculation on the season and trend parts of the decoder input respectively to generate initial decomposition components and in, is the decomposition result of the i-th step of the l-th layer seasonal decoder, is the decomposition result of the i-th step of the trend decoder of the l-th layer;

[0035] Step S232, cross information fusion: the encoder's latent variables Perform autocorrelation calculation with the intermediate result of the decoder, the formula is as follows:

[0036]

[0037] Where, is the trend component that is gradually eliminated;

[0038] Step S233, feedforward refinement: further refine the decomposition result through a feedforward neural network, the formula is as follows:

[0039]

[0040] Step S234, multi-step prediction generation: the final prediction result is the seasonal component S de With the trend component T de The weighted sum of is:

[0041]

[0042] Where Y pred is the final prediction output of the model;

[0043] By designing the core structure of the model, it can effectively extract trend and seasonal characteristics in time series; through the hierarchical design of encoders and decoders, the model can gradually decompose and refine the input data, capture long-term trends and short-term fluctuations, thereby improving the accuracy of predictions.

[0044] Furthermore, the step S3, model training and parameter configuration, specifically includes the following steps:

[0045] Step S31, loss function definition: use mean square error as the loss function, the formula is:

[0046]

[0047] Where L is the value of the loss function, N is the total number of training samples, is the true value of the i-th sample, is the predicted value of the i-th sample;

[0048] Step S32, optimizer settings: use the Adam optimizer, set the initial learning rate and weight decay coefficient, and input hyperparameters;

[0049] By optimizing the loss function and setting reasonable hyperparameters, we ensure that the model can converge quickly and achieve optimal performance during training; the combination of the Adam optimizer and the learning rate scheduling strategy can avoid overfitting while ensuring training efficiency.

[0050] Furthermore, the step S4, prediction generation and post-processing specifically includes the following steps:

[0051] Step S41, single variable prediction: using the closing price as the only input feature, the encoder-decoder structure generates the predicted value for the next O steps;

[0052] Step S42, multi-variable prediction: input the opening price, highest price, lowest price, and closing price at the same time, and the model automatically learns the nonlinear relationship between multiple variables and outputs a multi-dimensional prediction result;

[0053] Step S43, result post-processing: performing denormalization processing on the predicted value, restoring it to the original price dimension, and generating a stock price prediction curve;

[0054] Use the trained model to predict future stock prices. Univariate and multivariate forecasts are suitable for different application scenarios, meeting user needs for single price or multi-dimensional price trends. The post-processing step restores the forecast results to the original dimension for intuitive understanding.

[0055] Furthermore, the step S5, deployment and application, specifically includes the following steps:

[0056] Step S51, real-time data access: obtain the latest stock data in real time through the API interface and dynamically update the input sequence;

[0057] Step S52: Output prediction results: Display the prediction values in a visual chart format, supporting price trend predictions for the next 1 to 30 days.

[0058] Step S53, risk warning: combining the prediction results with a preset threshold (such as a volatility threshold) to trigger an automated trading signal or risk warning;

[0059] Apply the model to actual scenarios to provide real-time prediction and risk warning functions; by accessing real-time data through the API interface, the model can dynamically update the prediction results to help investors adjust their trading strategies in a timely manner.

[0060] The present invention has the following beneficial effects:

[0061] 1. By introducing a trend cycle feature decomposition module, the present invention enables the model to display and separate long-term trends and short-term fluctuations in time series, effectively capture the complex dynamic characteristics of the stock market, and improve prediction accuracy. The trend cycle progressive decomposition mechanism in the decoder refines the feature components layer by layer to avoid information loss, enhance the adaptability to non-periodic data, and make long-term prediction results more stable and reliable. In addition, the autocorrelation mechanism is adopted to replace the traditional attention mechanism, and the fast Fourier transform is used to efficiently capture the periodic dependency of the sequence, reduce the computational complexity, and improve the training and inference efficiency of the model.

[0062] 2. The present invention supports both multivariable and single-variable prediction tasks. By adaptively learning the nonlinear correlations between multi-source features, it possesses excellent generalization capabilities and can flexibly adapt to different market environments and data types. Furthermore, the model has the functions of real-time data dynamic update and result denormalization, and can generate intuitive and interpretable prediction curves, providing timely and reliable technical support for investment decisions. The overall solution not only improves prediction performance but also takes into account computational efficiency and practicality.

[0063] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0065] Figure 1 It is a schematic diagram of the process of the present invention;

[0066] Figure 2 This is the Deep-Decomposition-Autoformer model architecture diagram of the present invention;

[0067] Figure 3 This is an experimental framework diagram of the present invention;

[0068] Figure 4 A multivariate prediction display diagram of the present invention;

[0069] Figure 5 This is a univariate prediction display diagram of the present invention. DETAILED DESCRIPTION

[0070] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0071] See also Figure 1 As shown, the present invention is a stock price prediction method based on a deep decomposition autocorrelation model, comprising:

[0072] Step S1: Data acquisition and preprocessing:

[0073] Step S11, data acquisition: acquiring historical trading data of the target stock from a financial data platform, including but not limited to opening price, highest price, lowest price, and closing price, with a time span covering at least 10 years;

[0074] Step S12, data cleaning: remove missing values or outliers, and use linear interpolation to fill missing data; standardize the data and use the Z-score normalization method to scale each feature to a distribution with a mean of 0 and a variance of 1;

[0075] Step S13, data segmentation: Divide the dataset into training set, validation set and test set in chronological order, with the ratio set to 6:2:2 to ensure that the temporal continuity is not destroyed.

[0076] Step S2: Model architecture design:

[0077] Step S21: Model input definition, specifically:

[0078] Encoder input: length L seq Time series data Where d is the feature dimension;

[0079] Decoder input: seasonal part X output by encoder des and the trend part X det Spliced together, specifically:

[0080] X des =Concat(X ens ,X0);

[0081] X det =Concat(X ent ,X mean );

[0082] Where X0 is a placeholder for all zeros, X ens , X entare the seasonal part and the trend part after decomposition, X mean It is a placeholder for the mean value of historical data;

[0083] Step S22, encoder design, specifically includes the following steps:

[0084] Step S221, sequence decomposition module: use sliding average method to decompose the input sequence X en Decomposed into trend term X t and seasonal term X s , the formula is as follows:

[0085] X t =AvgPool(Padding(X));

[0086] X s =XX t ;

[0087] Where X is the original time series input;

[0088] Step S222, hierarchical feature extraction, specifically includes:

[0089] Seasonal branch: Captures periodic dependencies through autocorrelation mechanisms and extracts seasonal features layer by layer

[0090] Trend branch: Added trend decomposition block to extract trend features through autocorrelation mechanism and sliding average operation

[0091] Each layer of encoder outputs a latent variable containing season and trend and Used for decoder cross information transmission;

[0092] Step S23, decoder design: trend cycle progressive decomposition module, specifically including the following steps:

[0093] Step S231, initialization decomposition: perform autocorrelation calculation on the season and trend parts of the decoder input respectively to generate initial decomposition components and in, is the decomposition result of the i-th step of the l-th layer seasonal decoder, is the decomposition result of the i-th step of the trend decoder of the l-th layer;

[0094] Step S232, cross information fusion: the encoder's latent variables Perform autocorrelation calculation with the intermediate result of the decoder, the formula is as follows:

[0095]

[0096] Where, is the trend component that is gradually eliminated;

[0097] Step S233, feedforward refinement: further refine the decomposition result through a feedforward neural network, the formula is as follows:

[0098]

[0099] Step S234, multi-step prediction generation: the final prediction result is the seasonal component S de With the trend component T de The weighted sum of is:

[0100]

[0101] Where Y pred is the final prediction output of the model.

[0102] Step S3: Model training and parameter configuration:

[0103] Step S31, loss function definition: use mean square error as the loss function, the formula is:

[0104]

[0105] Where L is the value of the loss function, N is the total number of training samples, is the true value of the i-th sample, is the predicted value of the i-th sample;

[0106] Step S32, optimizer settings: Use the Adam optimizer, set the initial learning rate and weight decay coefficient, and input hyperparameters.

[0107] Step S4: prediction generation and post-processing:

[0108] Step S41, single variable prediction: using the closing price as the only input feature, the encoder-decoder structure generates the predicted value for the next O steps;

[0109] Step S42, multi-variable prediction: input the opening price, highest price, lowest price, and closing price at the same time, and the model automatically learns the nonlinear relationship between multiple variables and outputs a multi-dimensional prediction result;

[0110] Step S43, result post-processing: Denormalize the predicted value to restore it to the original price dimension and generate a stock price prediction curve.

[0111] Step S5: Deployment and application:

[0112] Step S51, real-time data access: obtain the latest stock data in real time through the API interface and dynamically update the input sequence;

[0113] Step S52: Output prediction results: Display the prediction values in a visual chart format, supporting price trend predictions for the next 1 to 30 days.

[0114] Step S53: Risk warning: combining the prediction results with the preset threshold to trigger an automated trading signal or risk warning.

[0115] This example uses the decomposition concept to transform the Autoformer into a deep decomposition architecture (Figure 1). The trend and seasonal components of the encoder sequence decomposition are retained and used in the decoder to perform progressive decomposition of trend initialization and seasonal initialization.

[0116] Sequence decomposition block: Sequence decomposition is one of the most important methods for analyzing and processing time series. The sequence decomposition block uses traditional decomposition operations to decompose time series into seasonal and trend parts. This design greatly simplifies long-term complex patterns, which is conducive to learning and better training of neural networks. It uses the sliding average concept to deal with extreme fluctuations in stock market price data. Figure 2 As shown in the Deep-Decomposition-Autoformer model, the seasonal part and the trend part are alternately decomposed progressively, that is, the trend part and the seasonal part are gradually decomposed from the latent variables to make better predictions; for a time series X∈R L×d , decomposed into:

[0117] X t =AvgPool(Padding(X));

[0118] X s =XX t ;

[0119] Among them, for a time series X∈R with a length of L L×d , perform AvgPool(·) moving average operation and fill operation at the same time, and get X t ∈R L×d , that is, the trend part; X s ∈R L×d It is the seasonal part of the time series X minus the trend part; the whole process is expressed as X s ,X t =SeriesDecomp(X);

[0120] Model input: such as Figure 2 As shown, the input of the model includes the input of the encoder and the input of the decoder; the input of the encoder is of length L seqTime series data The decoder input consists of the seasonal part and trend part Two parts; X des and X det They are respectively en The second half of the time series and a placeholder of length O;

[0121]

[0122] X des =Concat(X ens ,X0);

[0123] X det =Concat(X ent ,X mean );

[0124] in, Represents the encoder's input time series data X en After the seasonal part and trend part of the series decomposition, andX0,X mean ∈R O×d Represents all 0 placeholders and X respectively en The average value placeholder of ;

[0125] Encoder: As Figure 2 As shown, Deep-Decomposition-Autoformer has N encoder blocks, and the input of the encoder is of length L seq Time series data The encoder consists of two parts, one of which focuses on modeling the seasonal part and the other focuses on modeling the trend part. At the same time, the seasonal part and the trend part are used as cross information to help the decoder predict. Assume that the latent variable of the encoder focusing on seasonal part modeling is The encoder latent variable that focuses on modeling the trend part is The overall process of the lth layer in the encoder is

[0126]

[0127] Among them, “_” is the trend part eliminated by the encoder that focuses on modeling the seasonal part, and “*” is the seasonal part eliminated by the encoder that focuses on modeling the trend part; represents the seasonal part of the i-th sequence decomposition of the l-th layer encoder module; Represents the trend part of the i-th sequence decomposition of the l-th layer encoder module;

[0128] Decoder: Such as Figure 2 As shown in Figure 2, Deep-Decomposition-Autoformer has M decoder blocks. The decoder has a multi-layer Auto-Correlation decomposition mechanism for the seasonal part and a multi-layer Auto-Correlation decomposition mechanism for the trend part. The multi-layer Auto-Correlation decomposition mechanism for the seasonal part includes an Auto-Correlation block for initializing the seasonal part, an encoder-decoder related block for eliminating the trend part, three decomposition blocks for eliminating the trend part, and a feedforward neural network. The multi-layer Auto-Correlation decomposition mechanism for the trend part includes an Auto-Correlation block for initializing the trend part, an encoder-decoder related block for eliminating the seasonal part, three decomposition blocks for eliminating the seasonal part, and a feedforward neural network. Assuming that the latent variables of the encoder are Based on , the whole process of the decoder block of the seasonal part of the lth layer can be expressed as:

[0129]

[0130] The whole process of the decoder block of the trend part of the lth layer can be expressed as:

[0131]

[0132]

[0133] in, Represents the output of the decoder of the lth layer to eliminate the trend part and the output of the decoder of the lth layer to eliminate the seasonal part; represent the seasonal part and trend part of the decoder block of the seasonal part of the lth layer respectively; The seasonal part and the trend part of the decoder block representing the trend part of the lth layer respectively; the final prediction result is the sum of the two refined decomposition components, including the seasonal part and the trend part;

[0134] Auto-correlation mechanism:

[0135] The core of the Autoformer is the auto-correlation mechanism, which replaces the self-attention mechanism to capture the periodic dependencies between time series. The auto-correlation mechanism consists of periodic dependencies and time-delay aggregation. This mechanism breaks the bottleneck of information utilization and improves computational efficiency.

[0136] Periodic dependence can be found by calculating the autocorrelation coefficient R between sequences, which can reflect the similarity between two sequences. The autocorrelation coefficient R can be obtained by mapping the input Q, K and V. Based on the Winer–Khinchin theory, Fast Fourier Transforms (FFT) operations are performed on Q and K respectively, and conjugate operations are performed on K. This operation on Q and K can improve the computational efficiency. Inspired by the stochastic process theory, by calculating R XX (τ) to find the sequence X t and its lagged sequence X t-τ The specific formula is as follows:

[0137] S XX (f) = F(W Q X t )F * (W K X t );

[0138] R XX (τ)=F -1 (S XX (f));

[0139] In the above equation, F stands for Fast Fourier Transform, F -1 represents the inverse transform, F * represents the conjugate operation, S XX (f) in the frequency domain;

[0140] Based on the periodic dependency, the optimal K time-delay sequences are selected and aligned using the Roll(·) operation. Finally, the subsequences are aggregated and the softmax operation is performed to normalize the confidence. The auto-correlation mechanism calculation process is different from traditional calculations and breaks the point aggregation mechanism.

[0141] A specific application of this embodiment is:

[0142] Environment: To demonstrate the effectiveness of Deep Decomposition Autoformer, all experiments were conducted in the same environment, using the same training and test data. All methods were implemented in Python and PyTorch. All experiments were conducted on an NVIDIA RTX A4000 GPU with 16GB of video memory and an Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz with 60GB of RAM.

[0143] Dataset: We selected Intel Corporation's stock prices from the Yahoo Finance website from January 3, 1983, to December 30, 2022. Each data entry contains four items: opening price, highest price, lowest price, and closing price. Some of the data is shown in Table 1. The training set, validation set, and test set are divided into a ratio of 6:2:2.

[0144] The opening price refers to the first per-share transaction price of a stock after the market opens on a trading day. The high price refers to the highest price a stock has ever traded from the opening to the closing of a trading day. The low price refers to the lowest price a stock has ever traded from the opening to the closing of a trading day. The closing price refers to the volume-weighted average price of all transactions in the minute before the last trade of the day.

[0145]

[0146]

[0147] Table 1 Part of sample data

[0148] Evaluation metrics: This paper uses mean square error (MSE) and mean absolute error (MAE) as core metrics for comparing performance;

[0149] Baselines: This example uses three benchmark methods. The first benchmark is Autoformer, the second benchmark is Transformer, Informer, and Reformer, and the third is the latest time series prediction benchmark DLinear, NLinear, and Linear.

[0150] Experimental Framework: Reference Figure 3 The experimental framework of the Deep-Decomposition-Autoformer model proposed in this paper consists of four parts: data pre-processing, data dividing, model training, and results evaluation and analysis. The parameter settings of the Deep-Decomposition-Autoformer model are as follows: the initial learning rate is 4×10 -4 The ADAM

[23] optimizer is used for L2 Loss training, and the batch size is set to 32. The training process is early stopped within 10 epochs, as shown in Table 2;

[0151]

[0152]

[0153] Table 2 Parameter settings for all models

[0154] Key results:

[0155] To compare the performance of predicting future time lengths, this experiment fixed the input length to 48 and the predicted output lengths to 12, 24, 48, 96, and 144. This example conducted two types of experiments: one for multivariate prediction and the other for univariate prediction. The experimental results are shown in Tables 3-3 and 3-4 below.

[0156] The model of the present invention shows higher prediction accuracy and stronger robustness in single-variable prediction tasks, especially in short prediction lengths. Through comparative analysis of multivariate and single-variable experimental results, it can be concluded that the model proposed in the present invention is significantly better than the benchmark models such as Autoformer, Transformer, Informer, Reformer, DLinear and Linear in multiple data sets and different prediction lengths. Specifically, the model of the present invention shows stronger generalization ability and stability in multivariate prediction tasks, especially in long prediction lengths. For example, when the prediction length of the Intel dataset is 144, the MSE of the proposed model is 0.214, which is 9.32% lower than the 0.236 of the Autoformer. In addition, the proposed model also performs well in single-variable prediction tasks, especially when the prediction length is short. For example, when the prediction length of the Intel dataset is 12, the MSE of the proposed model is 0.034, which is 50.72% lower than the 0.069 of the Autoformer. These results show that the improvement strategy proposed in this paper effectively improves the prediction performance of the model.

[0157] Tables 3-5 show the accuracy performance comparison between the proposed model and the baseline model on four datasets (INTEL, FCHI, NVDA and GOOG); in the experimental setting, the input length is fixed at 48 and the prediction length is set to 12; the experimental results show that the proposed model achieves the best accuracy performance on all datasets and significantly outperforms other baseline models; specifically, on the INTEL dataset, the accuracy of the proposed model is 0.5702±0.0142, which is 10.48% higher than the Autoformer's 0.5161±0.0065; on the GOOG dataset, the accuracy of the proposed model reaches 0.5921±0.0294, which is 13.54% higher than the Autoformer's 0.5303±0.0167; in addition, the proposed model also achieves accuracies of 0.5698±0.0195 and 0.5840±0.0177 on the FCHI and NVDA datasets, respectively, which are significantly higher than other comparison models;

[0158] The model of the present invention not only outperforms existing methods in prediction accuracy, but also performs well in computational efficiency and robustness. Compared with Transformer and its variants, the model of the present invention significantly reduces computational complexity by introducing a deep decomposition mechanism and an adaptive optimization strategy, while improving the modeling ability for long sequence data. In addition, compared with the latest linear models (such as DLinear and Linear), the model of the present invention has obvious advantages in nonlinear relationship modeling and can better capture complex patterns in time series.

[0159] Table 3-3 Multivariate prediction results: Performance under different prediction lengths O∈{12, 24, 48, 96, 144}. The input length I is fixed at 48. The lower the MSE or MAE value, the higher the accuracy of the prediction model.

[0160]

[0161] Table 3-4 Univariate prediction results: Performance under different prediction lengths O∈{12, 24, 48, 96, 144}. The input length I is fixed to 48. The lower the MSE or MAE value, the higher the accuracy of the prediction model.

[0162]

[0163] Table 3-5 shows the performance of the model in terms of accuracy. The input length I is set to 48 and the prediction length O is set to 12.

[0164]

[0165] Multivariate prediction display chart: By plotting the first dimension of the test set prediction results, it is convenient to compare the results; Figure 4 As shown in Figure 3, among the different models, the model gives the best results. As the prediction length increases, the fluctuation of the prediction becomes smaller and smoother;

[0166] Univariate prediction display chart: Figure 5 The single-variable prediction graph is shown. In the single-variable prediction, as the prediction length increases, the model of the present invention is more accurate than the Autoformer and Transformer models. Compared with NLinear, the model of the present invention is more accurate, and the fluctuation of the prediction is smaller and smoother.

[0167] Model input length selection: Since the length of the predicted stock market price needs to be adjusted according to actual needs, research shows (Tables 3-6) that the relationship between the input length and model performance of different models under the same dataset varies significantly. Therefore, it is necessary to select an appropriate input length for different models. For example, based on the dataset used in this embodiment, an input length of 48 for the model of the present invention and the Autoformer can provide sufficient information for the model to support prediction. However, for the Linear model and the DLinear model, the input length needs to be set to 720; and for the NLinear model, the input length is 192.

[0168] This result shows that different models have different sensitivities to input length. Our model and the Autoformer can achieve higher prediction accuracy with shorter input lengths, while the Linear series models require longer input lengths to capture sufficient time series information. Therefore, in practical applications, choosing the right input length is crucial for optimizing model performance.

[0169] Table 3-6, the prediction length is set to 24, and the value range of input length I is {48, 96, 192, 336, 720};

[0170]

[0171] in conclusion:

[0172] The present invention proposes a Deep-Decomposition-Autoformer model for predicting stock prices. This model improves upon the Autoformer model by adding a trend feature decomposition block to the encoder and a trend feature progressive decomposition block to the basic inner block of the decoder for stock market price prediction. The model uses the opening price, highest price, lowest price, and closing price as inputs, and utilizes two encoders to eliminate seasonality and trend components from the inputs. In the decoder, the seasonal component and trend component are progressively decomposed, i.e., the trend component and seasonal component are gradually decomposed from latent variables, enabling better prediction. Experimental results demonstrate that the model achieves state-of-the-art accuracy compared to three other benchmarks. Furthermore, as the prediction length increases, the model becomes more stable, and the fluctuations in the prediction graph become smaller and smoother.

[0173] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0174] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better understand and utilize the present invention. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. A stock price prediction method based on deep decomposition autocorrelation model, characterized in that: The following steps are involved: Step S1, data acquisition and preprocessing: obtain historical stock data from the financial platform, clean outliers and fill missing data, perform normalization, and divide into training set, validation set and test set in chronological order; Step S2, model architecture design: The encoder decomposes the input sequence into trend terms and seasonal terms through sliding average. The decoder introduces a trend progressive decomposition module to fuse the encoder's latent variables, refine the predicted seasonal and trend components, and generate weighted prediction results. Step S3: Model training and parameter configuration: Use mean square error as the loss function, use the Adam optimizer, and set input hyperparameters; Step S4, prediction generation and post-processing: supports single-variable and multi-variable prediction, restores the predicted value to the original price dimension through denormalization, and outputs the stock price curve; Step S5, Deployment and Application: Real-time access to the latest data dynamically updates the model input, generates a visual price trend forecast for the next 1-30 days, and triggers automated trading signals or risk warnings based on volatility thresholds.

2. The method for predicting stock prices based on a deep decomposition autocorrelation model according to claim 1, characterized in that: The step S1, data acquisition and preprocessing, specifically includes the following steps: Step S11, data acquisition: acquiring historical trading data of the target stock from a financial data platform, including but not limited to opening price, highest price, lowest price, and closing price, with a time span covering at least 10 years; Step S12, data cleaning: remove missing values or outliers, and use linear interpolation to fill missing data; standardize the data and use the Z-score normalization method to scale each feature to a distribution with a mean of 0 and a variance of 1; Step S13, data segmentation: Divide the dataset into training set, validation set and test set in chronological order, with the ratio set to 6:2:2 to ensure that the temporal continuity is not destroyed.

3. The method for predicting stock prices based on a deep decomposition autocorrelation model according to claim 1, characterized in that: The step S2, model architecture design specifically includes the following steps: Step S21: Model input definition, specifically: Encoder input: length L seq Time series data Where d is the feature dimension; Decoder input: seasonal part X output by encoder des and the trend part X det Spliced together, specifically: X des =Concat(X ens ,X0); X det =Concat(X ent ,X mean ); Where X0 is a placeholder for all zeros, X ens , X ent are the seasonal part and the trend part after decomposition, X mean It is a placeholder for the mean value of historical data; Step S22, encoder design, specifically includes the following steps: Step S221, sequence decomposition module: use sliding average method to decompose the input sequence X en Decomposed into trend term X t and seasonal term X s , the formula is as follows: X t =AvgPool(Padding(X)); X s =X-X t ; Where X is the original time series input; Step S222, hierarchical feature extraction, specifically includes: Seasonal branch: Captures periodic dependencies through autocorrelation mechanisms and extracts seasonal features layer by layer Trend branch: Added trend decomposition block to extract trend features through autocorrelation mechanism and sliding average operation Each layer of encoder outputs a latent variable containing season and trend and Used for decoder cross information transmission; Step S23, decoder design: trend cycle progressive decomposition module, specifically including the following steps: Step S231, initialization decomposition: perform autocorrelation calculation on the season and trend parts of the decoder input respectively to generate initial decomposition components and in, is the decomposition result of the i-th step of the l-th layer seasonal decoder, is the decomposition result of the i-th step of the trend decoder of the l-th layer; Step S232, cross information fusion: the encoder's latent variables Perform autocorrelation calculation with the intermediate result of the decoder, the formula is as follows: Where, is the trend component that is gradually eliminated; Step S233, feedforward refinement: further refine the decomposition result through a feedforward neural network, the formula is as follows: Step S234, multi-step prediction generation: the final prediction result is the seasonal component Sde and the trend component T de The weighted sum of is: Where Y pred is the final prediction output of the model.

4. The method for predicting stock prices based on a deep decomposition autocorrelation model according to claim 1, wherein: The step S3, model training and parameter configuration, specifically includes the following steps: Step S31, loss function definition: use mean square error as the loss function, the formula is: Where L is the value of the loss function, N is the total number of training samples, is the true value of the i-th sample, is the predicted value of the i-th sample; Step S32, optimizer settings: Use the Adam optimizer, set the initial learning rate and weight decay coefficient, and input hyperparameters.

5. The method for predicting stock prices based on a deep decomposition autocorrelation model according to claim 1, wherein: The step S4, prediction generation and post-processing, specifically includes the following steps: Step S41, single variable prediction: using the closing price as the only input feature, the encoder-decoder structure generates the predicted value for the next O steps; Step S42, multi-variable prediction: The opening price, highest price, lowest price, and closing price are input simultaneously. The model automatically learns the nonlinear relationship between multiple variables and outputs a multi-dimensional prediction result. Step S43, result post-processing: Denormalize the predicted value to restore it to the original price dimension and generate a stock price prediction curve.

6. The method for predicting stock prices based on a deep decomposition autocorrelation model according to claim 1, wherein: The step S5, deployment and application, specifically includes the following steps: Step S51, real-time data access: obtain the latest stock data in real time through the API interface and dynamically update the input sequence; Step S52: Output prediction results: Display the prediction values in a visual chart format, supporting price trend predictions for the next 1 to 30 days. Step S53: Risk warning: combining the prediction results with the preset threshold to trigger an automated trading signal or risk warning.