A time series prediction method, system, device and storage medium

CN122470931BActive Publication Date: 2026-10-16INNER MONGOLIA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610625512.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-08
Publication Date
2026-10-16
Estimated Expiration
2046-05-08

AI Technical Summary

Technical Problem

[0005]为了解决现有模型在进行多变量时间序列预测时存在的不足,本发明提供了一种时间序列预测方法、系统、设备及存储介质

Benefits of technology

本发明基于海洋捕食者算法进行改进,利用Circle混沌映射改进初始化质量,对连续型超参数添加微小随机扰动,避免个体完全重复,提升局部探索能力。引入步长因子和权重因子随迭代变化进行动态参数调整,平衡全局探索与局部开发;并结合基于最差双向的邻域改进策略提升跳出局部最优的能力,得到改进型海洋捕食者算法CRMPA。利用改进型海洋捕食者算法实现了TimesNet关键超参数的全局优化,提升了超参数搜索的覆盖性、收敛效率与跳出局部最优的能力,从而增强了TimesNet在多元时序预测任务中的泛化性能与预测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122470931B_ABST
    Figure CN122470931B_ABST
Patent Text Reader

Abstract

The application provides a time series prediction method, system, device and storage medium, and belongs to the technical field of computers, and comprises the following steps: introducing a Circle chaotic mapping to improve the quality of an initial population based on a marine predator algorithm; introducing a step factor and a weight factor to change with iterations for dynamic parameter adjustment in global exploration and local development; and adopting a worst two-way neighborhood improvement strategy in each stage to obtain an improved marine predator algorithm. Taking a root mean square error RMSE of a prediction error of a model as a fitness function, using the improved marine predator algorithm to iteratively obtain super parameters of a TimesNet model, and obtaining an optimized TimesNet model. Time series data is obtained, the time series data is input into the TimesNet model, and future time series prediction data is obtained. The application realizes automatic global optimization of key super parameters of the TimesNet model, and improves multivariate time series prediction precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, and specifically relates to a time series forecasting method, system, device and storage medium. Background Technology

[0002] Time series forecasting is one of the core tasks in data science and artificial intelligence. In practical engineering applications such as smart grids, traffic flow forecasting, and financial risk assessment, the data involved are typically multivariate time series (MTS) containing multiple interacting features. MTS data often exhibits high nonlinearity, nonstationarity, and complex intervariate dependencies, posing significant technical challenges to feature learning and prediction in models.

[0003] Deep learning models, with their powerful hierarchical feature extraction and nonlinear fitting capabilities, have become a mainstay in solving the MTS prediction problem. Following RNN, LSTM, and Transformer architectures, the task-versatile time series model TimesNet was proposed. It transforms one-dimensional time series signals into two-dimensional tensors through Fourier analysis and uses two-dimensional convolutional kernels for feature extraction, demonstrating superior performance in handling time series prediction tasks with multiple periodicities. However, achieving excellent performance in deep learning models often relies on complex network structures and a large number of parameters. Advanced time series models, represented by TimesNet, have high-dimensional, complex key hyperparameter spaces containing discrete options, and these parameters have a decisive impact on the model's final prediction accuracy.

[0004] Traditional methods for MTS prediction primarily rely on statistical models such as Vector Autoregression (VAR) and Autoregressive Moving Average (ARMA). However, these methods, due to their linear assumptions and stationarity requirements, struggle to effectively handle the high-dimensional, nonlinear, and non-stationary dynamic MTS data prevalent in the real world. With advancements in machine learning, various network models have been proposed to address the insufficient modeling of spatial dependencies among multiple variables. As the complexity of prediction models increases, the selection of hyperparameters and initial weights has a significant impact on model performance, becoming crucial for improving the accuracy and robustness of MTS predictions. Summary of the Invention

[0005] To address the shortcomings of existing models in multivariate time series forecasting, this invention provides a time series forecasting method, system, device, and storage medium.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A time series forecasting method includes the following steps: Based on the marine predator algorithm, a Circle chaotic mapping is introduced for population initialization; the step size factor and weight factor are dynamically adjusted as the iteration changes; and a worst-case bidirectional neighborhood improvement strategy is introduced to obtain an improved marine predator algorithm. The improved marine predator algorithm is used to iteratively optimize the hyperparameters of the TimesNet model, resulting in an optimized TimesNet model. Specifically, during initial population distribution, a uniformly distributed population is generated iteratively using Circle chaotic mapping. In the exploration phase, a step size factor is used to regulate individual jumps in the search space for global exploration, and a worst-case bidirectional guided update strategy is adopted for inferior individuals. In the transition phase, a weight factor is introduced to control the degree of inheritance of individuals from historical positions or the guidance of the best individual, and neighborhood-optimal guidance is used to update the positions of all individuals. Inferior individuals are defined as those within a set ranking range based on fitness in each iteration. The population refers to n sets of TimesNet model hyperparameters, with one set of TimesNet model hyperparameters corresponding to one individual. Using historical time series data as input and future time series data as output, the optimized TimesNet model is trained to obtain a time series prediction model.

[0007] Preferably, the process of iteratively generating a uniformly distributed population using the Circle chaotic mapping is as follows: Chaotic sequences generated from time series data, with uniform traversal within the interval [0,1], are produced using the following formula: ; Map the chaotic sequence to the search range of each hyperparameter. The mapping formula is as follows: ; in, Represents the first iteration in the iterative process. Step state value, For modulo operation, These are the final hyperparameter values. It is a chaotic value generated by a chaotic mapping; For random perturbations; Output a uniformly initialized population of individuals.

[0008] Preferably, during the transition phase, the weighting factor is specifically: ; in, This represents the number of iterations. Based on the aforementioned weighting factors, the position update formula during the transition phase is as follows: ; ; in, and A random number between 0 and 1 Positions for elite individuals.

[0009] Preferably, the step size factor The specific method of using exponential decrease is as follows: ; in, It is the current iteration number. It represents the maximum number of iterations.

[0010] Preferably, the worst-case bidirectional guided update strategy for disadvantaged individuals is specifically implemented through the following formula: ; in, As an attractiveness weight, For the current individual, It is the best individual in the neighborhood; It is the worst individual in the neighborhood.

[0011] Preferably, the step of updating the position for all individuals using neighborhood-optimal guidance is specifically achieved through the following formula: ; in, It is a random number , The best individual in the neighborhood Preferably, when iteratively optimizing the hyperparameters of the TimesNet model, the root mean square error (RMSE), a quantitative index of the model's prediction error, is used as the fitness function to calculate the fitness value of the population.

[0012] The present invention also provides a time series prediction system, specifically comprising: The algorithm improvement module is used to initialize the population based on the marine predator algorithm by introducing Circle chaotic mapping; dynamically adjust the parameters by changing the step size factor and weight factor with iteration; and introduce a worst-case bidirectional neighborhood improvement strategy to obtain an improved marine predator algorithm.

[0013] The optimization module is used to iteratively optimize the hyperparameters of the TimesNet model using the improved marine predator algorithm, and obtain an optimized TimesNet model based on the optimized hyperparameters. Specifically, during initialization, a distributed population is generated iteratively using Circle chaotic mapping to generate a uniformly distributed population. During the exploration phase, a step size factor is used to adjust the individuals' jumps in the search space for global exploration, and a worst-case bidirectional guided update strategy is adopted for inferior individuals. During the transition phase, a weight factor is introduced to control the degree to which individuals inherit guidance from historical positions or the best individual, and neighborhood-optimal guidance is used to update the positions of all individuals. The inferior individuals are defined as those within a set ranking range in each iteration, ranked according to fitness. The population refers to n sets of TimesNet model hyperparameters, with one set of TimesNet model hyperparameters corresponding to one individual.

[0014] The prediction module is used to train the optimized TimesNet model with historical time series data as input and future time series data as output target to obtain a time series prediction model.

[0015] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps described in the time series forecasting method.

[0016] The present invention also provides a computer-readable storage medium storing a computer program that, when loaded by a processor, can execute the steps described in the time series forecasting method.

[0017] The time series forecasting method provided by this invention has the following beneficial effects: This invention improves upon the Ocean Predator algorithm by utilizing Circle chaotic mapping to enhance initialization quality and adding small random perturbations to continuous hyperparameters to avoid complete repetition of individuals, thereby improving local exploration capabilities. A step size factor and weight factor are introduced for dynamic parameter adjustment based on iteration, balancing global exploration and local exploitation. Furthermore, a worst-case bidirectional neighborhood improvement strategy is combined to enhance the ability to escape local optima, resulting in the improved Ocean Predator algorithm CRMPA. The improved Ocean Predator algorithm achieves global optimization of key TimesNet hyperparameters, improving the coverage, convergence efficiency, and ability to escape local optima of hyperparameter search, thus enhancing the generalization performance and prediction accuracy of TimesNet in multivariate time series prediction tasks. Attached Figure Description

[0018] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of a time series prediction method according to an embodiment of the present invention.

[0020] Figure 2 This is a diagram of the overall architecture of TimesNet in an embodiment of the present invention.

[0021] Figure 3 This is a visual comparison of chaotic and randomly initialized circles in an embodiment of the present invention.

[0022] Figure 4 This is a graph showing the optimal fitness convergence curves of various heuristic algorithms on the Stopic dataset in this embodiment of the invention.

[0023] Figure 5 This is a graph showing the optimal fitness convergence curves of various heuristic algorithms on the Ettset dataset in this embodiment of the invention.

[0024] Figure 6 This is a graph showing the optimal fitness convergence curves of various heuristic algorithms on the Weaset dataset in this embodiment of the invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0026] Example This invention provides a time series forecasting method, such as... Figure 1 As shown, the specific steps include: Step 1: Perform time-series processing on the data and divide it into training, validation, and test sets.

[0027] Multivariate time series Represented as a set of random vectors ,in In timestamp Observed The values ​​of each variable. A collection of timestamps. It is a set of equally spaced time points. Each univariate in the sequence Follows a conditional or multivariate probability distribution Its evolution pattern reflects the dynamic characteristics of the sequence.

[0028] Multivariate time series forecasting is for the future Estimate the sequence values ​​within a given time step. Given a historical observation length of... sequence The task of the predictive model is to learn a mapping function. To estimate the future A sequence of time steps :

[0029] (1); in, It is the length of the input sequence. It predicts the sequence length. It is a variable dimension. The aim is to maximize this mapping function using the proposed CRMPA-TimesNet model. The accuracy.

[0030] Step 2: Hyperparameter optimization.

[0031] S21: TimesNet is a deep neural network architecture based on two-dimensional time series modeling, such as... Figure 2 As shown, its overall architecture employs residual connections and is composed of multiple core components called TimesBlock stacked together. Each TimesBlock reshapes one-dimensional time series data into a two-dimensional tensor, capturing temporal variation patterns in two-dimensional space. Subsequently, multi-scale features are extracted through the lightweight Inception module and fused based on normalized amplitudes to enhance the expressive power of complex time series patterns.

[0032] TimesBlock is the basic processing unit of TimesNet, and its structure is organized in a residual manner. Given a one-dimensional input time series... ,in For the backtracking window length, The feature dimension is for multivariate input. The model first maps the original input to a high-dimensional feature space through an embedding layer, obtaining an initial deep feature representation. Subsequently, the first Each TimeBlock receives the feature tensor output from the previous layer. As input, this process can be represented as:

[0033] (2); TimesBlock's internal processing begins with adaptive period discovery. The model uses Fast Fourier Transform (FFT) to analyze the input sequence. The frequency domain characteristics are used to determine the largest value in the sequence based on the amplitude. Frequency components and its corresponding cycle This step can be summarized by equation (4), which is achieved through... Estimate the cycle length. Specifically, The calculated amplitude for each frequency is obtained through equation (3). and These represent the calculations of FFT and amplitude, respectively. Indicates in Calculate the average across all dimensions.

[0034] (3); (4); Then, TimesBlock enters the crucial one-dimensional to two-dimensional transformation step. TimesNet argues that complex temporal variations can be decoupled into intraperiod-variation and interperiod-variation. Intraperiod-variation describes short-term patterns within a single period, while interperiod-variation reflects long-term evolution across periods but at the same relative point in time. To capture both patterns simultaneously, in equation (5), the model first... Perform zero-filling, i.e. Then utilize the cycle and frequency The sequence is reshaped into a two-dimensional tensor. In this two-dimensional tensor, the column direction encodes the intra-period variation of the sequence, while the row direction encodes the inter-period variation, successfully unifying complex time series patterns into a two-dimensional space.

[0035] (5); In the extraction of temporal two-dimensional variation features, for the two-dimensional tensors obtained from k transformations TimesBlock utilizes two-dimensional Inception blocks for feature learning. Inception can extract features in both row and column directions using two-dimensional convolutional kernels of different scales in parallel, thereby capturing multi-scale, multi-granular intra- and inter-period variation features. Then, in preparation for aggregation, the two-dimensional features processed by the Inception block are... By truncation and reshaping operation Reverse back to one-dimensional space .

[0036] (6); (7); TimesBlock then uses an adaptive aggregation mechanism to fuse features from k different periods for use in the next layer. As shown in equations (8) and (9), using... The processed amplitude is used as the aggregation weight for the one-dimensional features extracted over all k periods. Perform adaptive fusion:

[0037] (8); (9).

[0038] S22: Using the root mean square error (RMSE) of the model's prediction error as the fitness function, the hyperparameters of TimesNet are iteratively optimized using the CRMPA algorithm.

[0039] The key hyperparameters that have a significant impact on TimesNet performance are shown in Table 1: TimesNet's performance depends on multi-dimensional hyperparameter settings, where structural hyperparameters determine the model's feature extraction capability, and training hyperparameters determine the training convergence speed and generalization performance.

[0040] S23: The Marine Predators Algorithm (MPA) is a metaheuristic optimization method based on swarm intelligence, inspired by the foraging behavior of marine predators. This algorithm simulates the interaction between predators and prey using two typical stochastic motion methods: Brownian motion and Lévy flight. Based on the speed ratio of predator to prey, the optimization process is divided into three stages: exploration, transition, and development. Specifically:

[0041] In the exploration phase ( In this population dynamic, prey moves faster than predators, while predators remain stationary (Firouze et al., 2022). The population performs a global search using Brownian motion, with the position update formula as follows:

[0042] (10); in, This represents a Brownian motion vector based on a normal distribution. Positions for elite individuals For the current individual, , for A random vector between [variables].

[0043] During the transition phase ( The population is updated based on different roles. Half of the individuals use Levi's flight for exploration, as shown in equation (11), where This refers to the Levy strategy.

[0044] (11); The other half of the population approaches elite individuals through Brownian motion to enhance local development, as shown in equation (12), where Control the predator's stride length.

[0045] (12); During the development phase ( In this predator-dominated search, the algorithm primarily uses Levy's flight to locally reinforce the vicinity of elite solutions. At this point, the algorithm focuses more on neighborhood development to improve the accuracy of the final solution. (13); Furthermore, MPA introduces the fish aggregation devices (FADs) effect to simulate random perturbations in the environment, updating individual positions using the following formula: (14); here, and These represent the upper and lower bounds of the search space, respectively. It is a binary vector. It is a random number. This represents the probability of environmental interference, with a default value of 0.2. , Two individuals were randomly selected.

[0046] S24: An improved Marine Predators Algorithm (CRMPA) is proposed. Based on the original MPA framework, three key enhancement strategies are introduced: improving initialization quality using Circle chaotic mapping; balancing global exploration and local exploitation through a dynamic adaptive parameter mechanism; and enhancing the ability to escape local optima by combining a worst-case bidirectional neighborhood improvement strategy. The synergistic effect of these three improvements makes CRMPA significantly superior to the original MPA in both global optimization capability and solution refinement, providing strong support for efficient optimization of subsequent TimesNet hyperparameters. The pseudocode of CRMPA is shown in Algorithm 1. The algorithm first uses Circle chaotic mapping to uniformly generate the initial population, and updates the step size factor and weight factor in stages during iteration: the first third of iterations performs bidirectional guidance of neighborhood optimal attraction and worst-case repulsion on the worst-case individuals; the middle third alternates between Lévy exploration and Brownian exploitation; and the last third performs a refined Lévy search around elite solutions, while introducing FADs (Factors in Demand) environmental perturbations with a fixed probability. Finally, the globally optimal solution is output as the hyperparameter configuration for TimesNet.

[0047] (1) Circle Chaotic Map Initialization. For deep learning models, the hyperparameter space often has high dimensionality and complex coupling relationships. Their values ​​are not only wide-ranging, but also have complex nonlinear effects between different hyperparameters. In this case, a high-quality initial population should ensure coverage and uniformity; otherwise, the algorithm may get stuck in local optima in the early stages of iteration. The original MPA algorithm uses the traditional random initialization method, which is simple to implement, but often results in uneven population distribution: some regions are densely populated, leading to redundant search, while other regions are completely empty, leading to search blind spots. This situation is particularly unfavorable in hyperparameter optimization, because the interaction between different parameters is likely to be hidden in these uncovered regions.

[0048] To improve the distribution quality of the initial population, CRMPA introduces Circle chaotic mapping as an initialization method, the mathematical expression of which is shown in equation (15). The generated sequence after iteration... Uniform traversal within the interval ensures the quality of the initial population distribution in the search space.

[0049] (15); in, Represents the first iteration in the iterative process. Step state value, This is a modulo operation.

[0050] Unlike traditional random methods, the Circle chaotic map is a typical way to generate chaotic sequences, exhibiting good ergodicity and nonlinear dynamics. Its greatest advantage lies in the fact that the sequence... The Circle mapping not only uniformly covers the search space within the interval but also possesses a certain degree of pseudo-randomness, resulting in an irregular distribution of generated individuals while avoiding predictable patterns. Compared to commonly used chaotic mappings such as Logistic and Tent, the Circle mapping produces a smoother and more uniform sequence distribution, avoiding excessive clustering at boundary or periodic points, thus demonstrating greater stability in high-dimensional hyperparameter optimization tasks.

[0051] The generated chaotic sequence is mapped to the search range of each hyperparameter. The mapping formula is as follows: (16); here, These are the final hyperparameter values. These are chaotic values ​​generated by the chaotic mapping. To further enhance the diversity and exploration capabilities of the initial population, a small random perturbation is introduced into the continuous hyperparameters. This perturbation originates from a uniform distribution that ranges from 1% of the hyperparameter value range. This allows for fine adjustments to the position of each individual based on the chaotic mapping, thereby avoiding completely duplicated individuals and further enhancing the algorithm's local exploration capability.

[0052] Through the above methods, the Circle chaotic mapping can provide a better starting point for CRMPA in the initialization stage, making the distribution of individuals more uniform in the search space and effectively avoiding regular clustering phenomena. Figure 3 Scatter plots and kernel density estimation (KDE) curves compare the hyperparameters of random initialization and Circle chaotic initialization. and The sampling distribution on, where the hyperparameter values ​​are normalized to As can be seen, the randomly initialized sample points exhibit obvious local clustering, while the sample points initialized by Circle's chaotic initialization are more evenly and thoroughly distributed throughout the parameter space. Especially in the KDE curve, chaotic initialization covers the search range more flatly, effectively avoiding the sharp density concentrations common in random initialization.

[0053] (2) Dynamic adaptive parameter design. In swarm intelligence optimization algorithms, how to balance global exploration and local exploitation is the key to determining its optimization performance. The original MPA uses a fixed step size parameter of 0.5. The step size factor is difficult to dynamically adjust with iterations, leading to insufficient exploration in the early stages or premature convergence in the later stages. To address this issue, CRMPA introduces two dynamic parameters that change with iteration: the step size factor. With weighting factors This is to achieve a smooth transition from global exploration to local development.

[0054] Dynamic step size factor Using an exponentially decreasing form: (17); in, It is the current iteration number. This is the maximum number of iterations. In the early stages of iteration, The value approaches 1, the step size is large, and individuals can make large jumps, thereby enhancing global exploration capabilities and quickly discovering regions with different hyperparameter combinations. As the iteration progresses, The value gradually increases. The value of decreases rapidly and non-linearly, eventually approaching 0. This causes the algorithm's step size to become smaller and smaller, prompting individuals to perform refined local searches within discovered advantageous areas, thereby improving convergence accuracy. Compared to linear decreasing or other simple decreasing functions, the exponential function can more effectively simulate the different needs of the algorithm for exploration and development at different stages, achieving a better dynamic balance.

[0055] During the transition phase ( Introducing weighting factors Its definition is: (18); in, This represents the number of iterations.

[0056] This factor is primarily used to control the degree to which an individual inherits historical position or elite guidance during mid-term position updates. The corresponding update formula is modified as follows:

[0057] (19); (20); in, and A random number between 0 and 1. As can be seen, unlike the original MPA, the weighting factor... By attaching to the current individual location during the update Or elite position Above, it served a "memory" function. In the early stages of iteration, Larger values ​​indicate a stronger inheritance of historical position or elite guidance, thus maintaining population evolutionary stability; as iterations proceed, As the number of individual updates gradually decreases, they become more dependent on the difference term. or This accelerates convergence to a better solution.

[0058] In summary, adaptive parameters Control the size of the search step. By adjusting the memory component during updates, the two work synergistically to enable the algorithm to automatically and smoothly transition from "stable global exploration" to "efficient local development" at different stages. This dynamic adjustment mechanism significantly improves the convergence efficiency and solution accuracy of CRMPA in complex hyperparameter optimization.

[0059] (3) Although dynamic parameters can balance exploration and exploitation, the algorithm may still get trapped in local optima in multimodal complex spaces. To effectively address this problem, a neighborhood improvement strategy based on worst-performing bidirectional guidance is proposed. This strategy draws on the idea of ​​individual selection based on inverse learning (OBL) and is inspired by neighborhood-based multi-operator OBL variants. This strategy focuses on generating an opposite population around the neighbors of the worst-performing individual, concentrating on the members with the lowest fitness in the population. Therefore, a bidirectional guidance update mechanism is designed to fully utilize the information of individuals of different qualities in the neighborhood and enhance the ability of inferior individuals to escape local traps.

[0060] First, in each iteration, the population is sorted according to fitness, and the worst 20% are defined as inferior individuals. These individuals are usually located in the inferior region of the solution space or near local minima, and their inefficient optimization behavior may slow down the convergence speed of the entire population. Therefore, they need to be guided to move closer to superior individuals in their neighborhood. The neighborhood is defined based on a combination of spatial distance and fitness, specifically:

[0061] (twenty one); in, This represents the Euclidean distance between individuals. Individual fitness value, and These represent the global optimum and the worst fitness, respectively. It is a very small constant. The lower the score, the closer the neighbor is to the current individual, and the better its fitness value. The five individuals with the lowest scores are selected as... The dynamic neighbor set.

[0062] Based on this, a phased hybrid update mechanism was designed. During the exploration phase, the worst-case bidirectional guided update strategy is adopted for the weakest individual, specifically calculated using the following formula:

[0063] (twenty two); in, For the current individual, the best individual in the neighborhood. Generate attraction; the worst individual in the neighborhood This generates a repulsive force. The formula uses the first term to push inferior individuals closer to superior solutions and the second term to move them away from inferior solutions, thereby increasing the probability of escaping local traps.

[0064] During the intermediate transition phase, all individuals are guided by neighborhood optima to generate candidate solutions. Specifically, for each individual, the optimal individual within its dynamic neighborhood is first found, and then the following update formula generates a new candidate position, causing the current individual to move closer to the optimal individual in that neighborhood:

[0065] (twenty three); During this stage, the population gradually converges to a better region through information exchange, laying the foundation for subsequent convergence. Finally, in the later stages of iteration, the algorithm focuses on optimizing the global optimum locally, based on the original MPA update mechanism.

[0066] This phased hybrid update mechanism combines bidirectional guidance with neighborhood-optimal guidance, enabling CRMPA to flexibly adjust its evolutionary strategy at different stages. During the intermediate update process, a mechanism is introduced to preserve a better solution between candidate and original positions. This is a common technique in evolutionary algorithms to ensure stable population evolution and further enhance the algorithm's robustness. Through this strategy, CRMPA effectively avoids premature convergence and improves its global optimization capability.

[0067] Step 3: Time Series Prediction. The optimal hyperparameters output by CRMPA are written into the corresponding fields of TimesNet. The model is retrained using the training set until convergence. Then, the trained model is used for forward computation on the test set to obtain the final time series prediction result. The trained time series prediction model is then applied to the test set to predict future time series data.

[0068] To verify the effectiveness of CRMPA-TimesNet in multivariate time series forecasting tasks, three real-world datasets were used, covering multiple fields such as social media sentiment analysis, energy system monitoring, and meteorological observation, ensuring the model's generalization ability under different time granularities and variable complexity scenarios. The Stopic dataset, collected independently, focuses on the dynamics of public opinion risk on specific topics on social media platforms. This dataset has 18 fields, with timestamps serving as time indices, and the remaining 17 variables including the number of comments, comment change rate, number of positive comments, and public opinion risk assessment value, reflecting user behavior and sentiment tendencies. This dataset is characterized by its small sample size, volatile fluctuations, and strong suddenness, making it suitable for testing the model's ability to capture and predict complex social dynamic trends. Ettset and Weaset are subsets of the publicly available ETTh1 and weather datasets, respectively. Detailed information about the datasets is summarized in Table 2.

[0069] Table 2 Dataset Description Before model training, all datasets underwent linear interpolation to impute missing values, and Z-score normalization was used to normalize each variable to eliminate dimensional differences and improve model training stability. Each dataset was divided into training and test sets in an 8:2 ratio.

[0070] To verify the effectiveness and convergence of the proposed CRMPA algorithm in optimizing the hyperparameters of TimesNet models, it is compared with seven representative heuristic algorithms, including the Ocean Predator Algorithm (MPA), Eagle Optimization (AO), Whale Optimization (WOA), Particle Swarm Optimization (PSO), Differential Evolution (DE), Hunger Games Search (HGS), and Sine-Cosine Algorithm (SCA). These algorithms are widely used in optimization tasks, covering different search strategies and convergence characteristics.

[0071] To balance convergence and computational complexity, the population size and number of iterations for all heuristic algorithms were uniformly set to 20. The optimization was performed on three datasets, with the goal of minimizing the root mean square error (RMSE) on the validation set. The algorithm parameters were compared as follows: DE's weight factor (wf) was 0.1, and the crossover rate (cr) was 0.9; PSO's local learning factor (c1) was 2.05, the global learning factor (c2) was 2.05, and the minimum inertia weight (w) was 0.4; HGS's position update probability (PUP) was 0.09, and the maximum starvation value (LH) was 10000. Other algorithm parameters were set to default.

[0072] As shown in Table 3, CRMPA achieved the minimum fitness value on all three datasets and performed best across the three evaluation metrics, fully demonstrating its powerful ability to find the global optimum. In the Stopic dataset, CRMPA's best fitness value is significantly better than the second-best algorithm, SCA, and 1.72% lower than the original MPA algorithm. In the Ettset dataset, CRMPA achieved a best fitness value of 0.6827, showing a significant advantage over the second-best HGS algorithm, a decrease of 2.30%, and a decrease of 2.91% compared to the original MPA algorithm. Similarly, in the Weaset dataset, CRMPA's best fitness value is 0.5441, a decrease of 1.11% compared to the second-best PSO algorithm, and a decrease of 1.79% compared to the original MPA algorithm.

[0073] Table 3 Results of various heuristic algorithms for optimizing TimesNet like Figure 4 , Figure 5 and Figure 6The best fitness convergence curves of all heuristic algorithms over 25 iterations are shown on three datasets. Among the convergence curves of all datasets, CRMPA eventually converges stably to the lowest fitness value among all algorithms.

[0074] To verify the effectiveness and necessity of the various improvement strategies in the proposed CRMPA algorithm, a series of ablation experiments were designed and conducted. This experiment aims to quantify the contribution of each improvement module to the final optimization performance. The improvement modules include: (1) C: Circle chaotic mapping initialization; (2) W: Dynamic adaptive parameter design; (3) N: Worst-case bidirectional guided neighborhood improvement mechanism.

[0075] The results are shown in Table 4. CRMPA, which integrates all the improvement strategies, achieved the lowest fitness value, the lowest MAE and MSE, and the highest DA on all three datasets, demonstrating the synergistic effect and overall necessity of all the proposed improvement modules in improving the algorithm performance.

[0076] Table 4 Ablation experimental results of CRMPA on different datasets To comprehensively evaluate the convergence performance and generalization ability of the proposed CRMPA-TimesNet method in multivariate time series prediction tasks, comparative experiments were conducted with six current state-of-the-art (SOTA) models on the aforementioned three datasets, specifically including: Informer: A model based on Transformer that introduces a sparse self-attention mechanism to handle long sequence dependencies, but has limited computational efficiency and generalization ability for high-dimensional multivariate data.

[0077] LightTS: A lightweight MLP-based deep learning architecture that extracts key features from time series data using two downsampling strategies, reducing computational cost.

[0078] DLinear: A minimalist linear decomposition model that models the trend and seasonal components using separate linear layers, but it lacks the ability to capture non-linearity and is susceptible to noise in multivariate scenarios.

[0079] MAGNN: A graph neural network-based model that extracts features across time scales through a multi-scale pyramid network and combines it with an adaptive graph learning module to dynamically infer variable dependencies at each time scale. However, it has high computational complexity and poor adaptability to small sample datasets.

[0080] DE-TSMCL: A distillation-enhanced teacher-student network framework that uses learnable data augmentation and momentum contrastive learning to explore inter-sample and intra-temporal correlations.

[0081] TimesNet: The TimesNet model with default hyperparameters.

[0082] All models were trained and tested under the same data partitioning and evaluation criteria to ensure consistency and fairness in the experimental environment. Table 5 shows the key evaluation metrics results for each model on the three datasets.

[0083] Table 5 Comparison of SOTA model and CRMPA-TimesNet The CRMPA method proposed in this invention achieves state-of-the-art performance on three datasets. Specifically, compared with other baseline models, CRMPA-TimesNet reduces the average MAE and MSE by 25.67% and 14.98% respectively on the Stopic dataset, while improving the average DA by 7.46%; on the Ettset dataset, it reduces the average MAE and MSE by 19.99% and 36.25% respectively, while improving the average DA by 8.51%; and on the Weaset dataset, it reduces the average MAE and MSE by 24.47% and 36.17% respectively, while improving the average DA by 9.64%.

[0084] Compared to TimesNet, CRMPA-TimesNet demonstrates a comprehensive improvement, particularly a significant reduction in MAE and MSE, strongly proving that introducing CRMPA significantly enhances the performance of the TimesNet baseline model. Notably, CRMPA-TimesNet maintains its leading position compared to state-of-the-art models MAGNN and DE-TSMCL, which focus on spatiotemporal dependency graph structures and contrastive learning, indicating that the proposed method possesses excellent prediction accuracy and trend-judgment capabilities in multivariate time series forecasting tasks.

[0085] The present invention also provides a time series prediction system, comprising: The algorithm improvement module is used to initialize the population based on the marine predator algorithm by introducing Circle chaotic mapping; dynamically adjust the parameters by changing the step size factor and weight factor with iteration; and introduce a worst-case bidirectional neighborhood improvement strategy to obtain an improved marine predator algorithm.

[0086] The optimization module iteratively optimizes the hyperparameters of the TimesNet model using an improved marine predator algorithm, resulting in an optimized TimesNet model. Specifically, during initial population distribution, a uniformly distributed population is generated iteratively using a Circle chaotic mapping. In the exploration phase, a step size factor is used to regulate individual jumps in the search space for global exploration, and a worst-case bidirectional guided update strategy is adopted for inferior individuals. In the transition phase, a weight factor is introduced to control the degree to which individuals inherit guidance from historical positions or the best individual, and neighborhood-optimal guidance is used to update the positions of all individuals. Inferior individuals are defined as those within a specified ranking range based on fitness in each iteration. The population refers to n sets of TimesNet model hyperparameters, with one set of TimesNet model hyperparameters corresponding to one individual.

[0087] The prediction module is used to train an optimized TimesNet model with historical time series data as input and future time series data as output to obtain a time series prediction model.

[0088] The modules in the aforementioned time series forecasting system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0089] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps in an embodiment of a time series forecasting method. Specific implementation methods can be found in the method embodiments, and will not be repeated here.

[0090] Furthermore, the present invention also provides a non-transitory computer-readable storage medium containing instructions on which a computer program is stored. For example, a memory containing instructions that can be executed by a processor of a computer device to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc. When the computer program is executed by the processor, it can implement the steps in an embodiment of a time series forecasting method. Specific implementation methods can be found in the method embodiments, which will not be repeated here.

[0091] Those skilled in the art will understand that embodiments of the present invention can provide methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the present invention patent. No reference numerals in the claims should be construed as limiting the scope of the claims. Any simple variations or equivalent substitutions of technical solutions that can be readily obtained by those skilled in the art within the scope of the technology disclosed in the present invention are within the protection scope of the present invention.

Claims

1. A time series forecasting method for social media sentiment analysis, using timestamps as indexes, with variables including the number of sentiment comments, comment change rate, number of positive comments, and sentiment risk assessment value, characterized in that... Includes the following steps: Based on the marine predator algorithm, a Circle chaotic mapping is introduced for population initialization; dynamic parameter adjustment is performed by using step size factor and weight factor as the iteration changes. Furthermore, a worst-case bidirectional neighborhood improvement strategy is introduced to obtain an improved marine predator algorithm; The improved marine predator algorithm is used to iteratively optimize the hyperparameters of the TimesNet model, resulting in an optimized TimesNet model. Specifically, during population initialization, a uniformly distributed population is generated iteratively using a Circle chaotic mapping. In the exploration phase, a step size factor is used to regulate individual jumps in the search space for global exploration, and a worst-case bidirectional guided update strategy is adopted for inferior individuals. In the transition phase, a weight factor is introduced to control the degree of inheritance of guidance from historical positions or the best individual, and neighborhood-optimal guidance is used to update the positions of all individuals. Inferior individuals are defined as those within a set ranking range based on fitness in each iteration. The population refers to n sets of TimesNet model hyperparameters, with one set of TimesNet model hyperparameters corresponding to one population individual. Using historical time series data as input and future time series data as output, the optimized TimesNet model is trained to obtain a time series prediction model.

2. The time series forecasting method according to claim 1, characterized in that, The specific method for iteratively generating a uniformly distributed population using the Circle chaotic mapping is as follows: Chaotic sequences generated from time series data, with uniform traversal within the interval [0,1], are produced using the following formula: ; Map the chaotic sequence to the search range of each hyperparameter. The mapping formula is as follows: ; in, Represents the first iteration in the iterative process. Step state value, For modulo operation, These are the final hyperparameter values. It is a chaotic value generated by a chaotic mapping; For random perturbations; and These represent the upper and lower bounds of the search space, respectively. Output a uniformly initialized population of individuals.

3. The time series forecasting method according to claim 1, characterized in that, During the transition phase, the weighting factors are specifically: ; in, This represents the number of iterations. Based on the aforementioned weighting factors, the position update formula during the transition phase is as follows: ; ; in, This represents a Brownian motion vector based on a normal distribution, where R is a random number between 0 and 1. For Levi's strategy, CF represents the position of the elite individual, P represents the stride length controlling the predator's movement, and P represents the stride length factor.

4. The time series forecasting method according to claim 1, characterized in that, The step size factor The specific method of using exponential decrease is as follows: ; in, It is the current iteration number. It represents the maximum number of iterations.

5. The time series forecasting method according to claim 1, characterized in that, The worst-case bidirectional guided update strategy for disadvantaged individuals is specifically implemented using the following formula: ; in, As an attractiveness weight, For the current individual, It is the best individual in the neighborhood; It is the worst individual in the neighborhood.

6. The time series forecasting method according to claim 1, characterized in that, The method of updating the position of all individuals using neighborhood-optimal guidance is specifically achieved through the following formula: ; in, It is a random number , The best individual in the neighborhood. For the current individual.

7. The time series forecasting method according to claim 1, characterized in that, When iteratively optimizing the hyperparameters of the TimesNet model, the root mean square error (RMSE), a quantitative index of the model's prediction error, is used as the fitness function to calculate the fitness value of the population.

8. A time series forecasting system for social media sentiment analysis, using timestamps as indexes, with variables including the number of sentiment comments, comment change rate, number of positive comments, and sentiment risk assessment value, characterized in that... include: The algorithm improvement module is used to initialize the population by introducing Circle chaotic mapping based on the marine predator algorithm; Dynamic parameter adjustment is performed by utilizing the step size factor and weight factor as the iteration changes; Furthermore, a worst-case bidirectional neighborhood improvement strategy is introduced to obtain an improved marine predator algorithm; The optimization module is used to iteratively optimize the hyperparameters of the TimesNet model using the improved marine predator algorithm, and obtain an optimized TimesNet model based on the optimized hyperparameters. Specifically, during population initialization, a uniformly distributed population is generated iteratively using a Circle chaotic mapping. During the exploration phase, a step size factor is used to adjust the individuals' jumps in the search space for global exploration, and a worst-case bidirectional guided update strategy is adopted for inferior individuals. During the transition phase, a weight factor is introduced to control the degree of inheritance of individuals from historical positions or the guidance of the best individual, and neighborhood-optimal guidance is used to update the positions of all individuals. The inferior individuals are defined as those within a set ranking range in each iteration, ranked according to fitness. The population refers to n sets of TimesNet model hyperparameters, with one set of TimesNet model hyperparameters corresponding to one individual. The prediction module is used to train the optimized TimesNet model with historical time series data as input and future time series data as output target to obtain a time series prediction model.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is loaded by the processor, it is able to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Robot optimal path planning method based on improved Hemma optimization algorithm

    CN120779949A

  • Grinding wheel state recognition method and system based on multi-strategy improved DBO algorithm

    CN121834193A