Time sequence prediction method and system based on dynamic hypergraph and multi-scale coding
Through the dynamic hypergraph and multi-scale coding methods, the problem of insufficient interactive modeling between variables by multivariate time series prediction model is solved, and high-precision prediction of ocean surface temperature data is achieved, which improves the dynamic adaptability and noise robustness of the model.
Patent Information
- Application Number
- CN202510724436.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing multivariate time series prediction models lack interaction modeling among variables, ignore dynamic changes in variable correlations, are susceptible to false correlations, and lack multi-time scale modeling capabilities, making it difficult to accurately characterize the complex interaction and dynamic correlations between variables.
Using a method based on dynamic hypergraph and multi-scale coding, the multi-variable time series prediction model is constructed through dynamic cluster hypergraph construction and correlation information dissemination, combined with multi-scale time characterization learning, and a multi-variable time series prediction model is constructed to realize accurate modeling of high-order interactions between variables and collaborative modeling of multi-time scales.
The prediction accuracy of multivariate time series data such as ocean surface temperature data is improved, the pairwise connection limitations of traditional graph learning is broken, and the precise modeling of complex space-time dependencies is realized, which significantly improves the model's adaptability to dynamic correlation and noise robustness.
Smart Images

Figure CN120278037A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multivariate time series prediction, and in particular, to a time series prediction method and system based on dynamic hypergraph and multi-scale coding. Background Art
[0002] Time series prediction technology is also playing an increasingly important role in marine environmental monitoring and scientific decision-making, especially in key scenarios such as global climate change assessment, marine disaster warning, fishery resource management, and coastal engineering planning. From the spatial dimension, SST usually exhibits significant regional linkage and diffusivity. The temperature changes in different sea areas are not isolated but interact with each other through various ocean physical processes. From the time dimension, even the SST records at a single measurement point often show diverse and complex evolution characteristics. On the one hand, its change has a clear periodicity. On the other hand, there are also long-term trend changes in SST. Therefore, the prediction task of SST not only requires modeling the single-point temperature sequence but also needs to systematically grasp the multi-point, multi-scale, and dynamically coupled spatio-temporal structure in the ocean. Deeply understanding the diffusion mechanism and regional linkage relationship of SST in space, as well as its trend, periodicity, and mutation characteristics in time, is the key foundation for building a modern marine information service system and improving the disaster warning and resource scheduling capabilities.
[0003] In recent years, deep learning technology has shown great potential in the field of time series modeling, especially in dealing with complex characteristics such as time lag, seasonality, and non-linearity, and has achieved remarkable results. Among them, the Transformer model based on the attention mechanism has made breakthroughs in multiple fields and also demonstrated excellent modeling capabilities in time series prediction. However, most existing Transformer-based multivariate prediction methods have not fully considered the correlation modeling between variables and are difficult to accurately depict the complex interaction relationships between variables. Therefore, how to effectively mine and model the dynamic associations between variables has become a hot issue in current research.
[0004] Graph neural networks (GNNs) provide a new solution idea for this. This method represents multivariate time series as a graph structure, regards variables as nodes in the graph, and the edge weights between nodes are used to characterize the degree of association between variables. However, in practical applications, the dependence relationships between variables are often highly dynamic and complex, and there are still huge challenges in constructing an accurate and effective dynamic graph structure.
[0005] In summary, the current multivariate time series prediction models mainly have the following prominent problems: 1) Insufficient interaction modeling between variables. Traditional graph structures usually only express the direct connections between two variables and are difficult to capture more complex high-order interaction patterns among multiple variables; 2) Ignoring the dynamic changes in variable correlations. Most methods use static graph structures and are difficult to handle the fluctuations in variable relationships over time stages, which affects the prediction accuracy. 3) Prone to interference from spurious correlations. In complex environments, external factors may cause variables that are not originally related to exhibit apparent correlations on the surface, thus interfering with the transmission of effective information. 4) Lack of multi-time scale modeling ability. Existing methods mostly model based on a single time scale, ignoring the potential information differences and complementary features at different scales. Summary of the Invention
[0006] To solve the above-mentioned problem of multi-variable time series data prediction, the present invention provides a time series prediction method and system based on dynamic hypergraphs and multi-scale encoding.
[0007] In a first aspect, a time series prediction method based on dynamic hypergraphs and multi-scale encoding provided by the present invention adopts the following technical solutions: A time series prediction method based on dynamic hypergraphs and multi-scale encoding includes: Obtaining sea surface temperature data; Performing data preprocessing on the obtained data; Constructing a multi-variable time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, and outputting variables; Performing multi-scale time representation learning on the output variables; Performing iterative training on the multi-variable time series prediction model; Using the trained model for data prediction.
[0008] Further, the data preprocessing of the obtained data includes calculating the mean and standard deviation of each variable at all time steps, standardizing all variables using the mean and standard deviation, and finally using the sliding window method to construct training-validation sample pairs, and then dividing each input in the time dimension into subsequence-level time segments of length to obtain the preprocessed data , and constructing a multi-variable time series historical database.
[0009] Further, the dynamic clustering hypergraph construction and correlation information propagation includes first preparing for the clustering operation by changing the data dimension. For the preprocessed data, all subsequences are unfolded into a node matrix and the membership matrix is randomly initialized, and the fuzzy C-means algorithm FCM is used to update the membership. Among them, the FCM algorithm is executed in each layer of the spatio-temporal correlation learning block, and the super-edge clustering center and node membership are iteratively updated using the superscript tDenotes the current number of iterative updates. In the th update, according to the current membership degree , first calculate the clustering center of each hyperedge : , where is the feature vector of the i th time segment in , and m is the fuzzy coefficient, which is used to control the fuzziness of the membership degree. Increasing
[0010] will make the membership degree distribution smoother, and vice versa, it tends to binary assignment. Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also include recalculating the membership matrix , where it is ensured that the node has a higher membership degree with the closer clustering center, and at the same time satisfies .
[0011] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also include dividing the given time series data into N variables of S time segments, each segment is represented as P dimensional feature vector, and constructing a hypergraph ; where represents the node set, , and each node corresponds to a time segment; represents the hyperedge set, , and each hyperedge is dynamically generated by fuzzy c-means clustering, representing a specific time series pattern. Define the hyperedge incidence matrix as , where the element represents the membership degree of the node belonging to the hyperedge , and is obtained through the membership matrix : .
[0012] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also include information transmission through hypergraph convolution, transforming and preliminarily aggregating the node features, which is represented as: , where is a learnable parameter matrix for the linear transformation of node features, For normalizing node features is an activation function, is the hyperedge feature representation after preliminary aggregation, and a hyperedge feature matrix is obtained , expressed as: , where is a learnable parameter matrix, used to normalize the hyperedge features.
[0013] Furthermore, the multi-scale temporal representation learning of the output variables includes re-splitting the obtained output according to the number of variables and performing temporal representation learning in a variable-independent manner. Among them, the data of different variables are separately input into the Transformer encoder, and the time series of the th variable is transposed and used to represent; then a trainable linear projection is used to map these variables into the Transformer hidden space with a dimension of , and the multi-head attention mechanism is adopted to model the temporal correlation between different time segments. By linearly transforming the input , a query matrix , a key matrix and a value matrix are obtained, and the calculation formula of the attention output is expressed as: .
[0014] Furthermore, the multi-scale temporal representation learning of the output variables also includes, after the output of each layer of the Transformer encoder, the model determines whether the encoder meets the requirements of the stacked number of layers. If it meets the requirements, a representation containing time series features is obtained, where, between every two layers, the adjacent time segments of the previous layer of the Transformer encoder are merged and concatenated to form a larger time segment and used as the input of the next layer. The process is expressed as: .
[0015] Finally, a representation containing time series features is obtained.
[0016] Furthermore, the iterative training of the multi-variable time series prediction model includes flattening the time segments in the representation containing time series features and using a linear layer to transform it to obtain the predicted value of the model output. By continuously using the obtained different monitoring data and inputting it into the model for iterative training of the model parameters, the predicted value of the model output Calculate the mean squared error loss function with the corresponding true value Y and determine whether it converges. If the model converges, save the optimal parameter model; otherwise, continue iterative training.
[0017] In a second aspect, a time series data prediction system based on dynamic clustering and multi-scale includes: A data acquisition module configured to acquire sea surface temperature data; A preprocessing module configured to preprocess the acquired data; A model construction module configured to construct a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, output variables; perform multi-scale time characterization learning on the output variables; A training module configured to perform iterative training on the multivariate time series prediction model; A prediction module configured to use the trained model for data prediction.
[0018] In a third aspect, the present invention provides a computer-readable storage medium storing multiple instructions, which are adapted to be loaded and executed by a processor of a terminal device for the time series prediction method based on dynamic hypergraph and multi-scale coding.
[0019] In a fourth aspect, the present invention provides a terminal device including a processor and a computer-readable storage medium. The processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, which are adapted to be loaded and executed by the processor for the time series prediction method based on dynamic hypergraph and multi-scale coding.
[0020] In summary, the present invention has the following beneficial technical effects: To improve the prediction accuracy of multivariate time series data such as ocean surface temperature data, the present invention proposes an innovative prediction method that combines dynamic clustering hypergraph learning and multi-scale time coding. Traditional graph learning methods are limited by binary relationship modeling and are difficult to capture the high-order interaction features between multiple variables. However, this method realizes accurate modeling of complex spatio-temporal dependence relationships through dynamic clustering hypergraph learning. Its core advantages are: High-order relationship modeling: Break through the pairwise connection limit of traditional graphs, simultaneously associate multiple time segments through hyperedges, and accurately depict the high-order interactions of multivariate systems; Dynamic adaptive modeling: Automatically generate the optimal hypergraph structure according to the real-time characteristics of the input data, significantly improving the model's adaptability to dynamic correlations; Noise robustness: Distinguish core features from redundant noise through a threshold screening mechanism, effectively suppressing the propagation of irrelevant information; Multi-scale time series analysis: Combine the time coding module to realize the collaborative modeling of short-term fluctuations and long-term trends.
[0021] This method is applicable to prediction tasks with strong spatio-temporal correlation, such as ocean surface temperature data, and provides a more accurate and robust solution for multivariate time series analysis of complex systems. Brief Description of the Drawings
[0022] Figure 1 It is the overall flowchart of the present invention.
[0023] Figure 2 It is the flowchart of the data preprocessing module in Step 1 of the present invention.
[0024] Figure 3 It is the flowchart of training the multivariate time series prediction model proposed by the present invention.
[0025] Figure 4 It is the flowchart of the dynamic clustering hypergraph construction and correlation information propagation module in Step 2 of the present invention.
[0026] Figure 5 It is the flowchart of the multi-scale time representation learning module in Step 3 of the present invention. Detailed Description of the Preferred Embodiments
[0027] The present invention will be further described in detail below with reference to the accompanying drawings.
[0028] Embodiment 1 Referring to Figure 1 , a time series prediction method based on dynamic hypergraph and multi-scale coding in this embodiment includes: Obtaining sea surface temperature data; Performing data preprocessing on the obtained data; Constructing a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, and outputting variables; performing multi-scale time representation learning on the output variables; Performing iterative training on the multivariate time series prediction model; Using the trained model for data prediction.
[0029] Specifically: Figure 1 shows the overall flowchart of the multivariate time series data prediction method based on dynamic clustering hypergraph learning and multi-scale time coding proposed by the present invention when predicting the sea surface temperature. S1 corresponds to historical data preprocessing. S2, S3, and S4 correspond to iterative training of the model and saving the model, and S4 corresponds to using the model to predict future data.
[0030] We first perform data preprocessing on the historical database. According to the legend, we enter S1, historical data preprocessing.
[0031] S1 Historical data preprocessing.
[0032] Figure 2 shows the overall process of the data preprocessing module. In the prediction of sea surface temperature, the measurement data of
[0033] spatial observation points constitute a multivariate time series with spatio-temporal correlation characteristics: the temperature values are synchronously recorded every hour at each measurement point, forming a two-dimensional data matrix with rows representing time steps and columns corresponding to spatial dimensions. This data structure contains both the continuous evolution law in the time dimension and the interaction relationship in the spatial dimension.
[0034] Specifically, the historical database can be represented as a spatio-temporal matrix: the row vectors of the matrix correspond to the global observation snapshots at a single moment, completely recording the temperature distribution of all spatial points at that moment; the column vectors represent the temperature evolution trajectories of a single spatial point over a historical period. Due to sampling at a fixed time interval (every hour), the data matrix has a strict time alignment property - the increasing row index corresponds to the natural extension of the time series, and adjacent row vectors form continuous observation records with equal time differences.
[0035] The data preprocessing module includes four steps: calculating the mean and standard deviation of each variable over all time steps, standardizing all variables, constructing training-validation sample pairs using the sliding window method, and dividing each input sample into time segments in the time dimension, aiming to improve data quality and meet the requirements of the model for the input format. Especially in the modeling task of multivariate time series, these processing operations help to retain the time dependence and spatial correlation structure between variables, providing good basic data support for subsequent model training.
[0036] S1.1 Calculate the mean and standard deviation of each variable over all time steps. Data standardization is a crucial preprocessing step, and its core purpose is to make the processed data conform to the standard normal distribution with a mean of 0 and a standard deviation of 1 through linear transformation of the original data. This process can effectively solve the model deviation problem caused by the difference in scale between different features.
[0037] For a historical data set with variables and time steps , represents the th variable value at the one time step, and are the mean and standard deviation of the th variable respectively. The calculation formulas for the mean and standard deviation are as follows: , (1) S1.2 Standardize all variables. We standardize all variables using the mean and standard deviation: , (2) S1.3 Use the sliding window method to construct training-validation sample pairs. We use consecutive time points as the input values for model training , and then take out time point data for testing the output prediction results. Perform row-by-row sliding sampling on the original data sequence to ensure that the starting point of each new sample is shifted one time unit backward from the previous sample, thus constructing a complete set of training-validation sample pairs.
[0038] S1.4 Divide each input sample into time segments in the time dimension. Time series data usually has local correlations, such as short-term trends, periodic or seasonal patterns, and these patterns may exhibit different characteristics at different time scales. Similarly, sea surface temperature data usually shows diverse and complex evolution characteristics. On the one hand, its changes have clear periodicity. For example, the annual cycle is controlled by the solar radiation intensity, and the semi-annual cycle may be due to the alternation of the monsoon system or the tidal mixing process. On the other hand, there are also long-term trend changes in sea surface temperature, such as the regional warming phenomenon under the background of global warming. Therefore, a single time point often cannot fully reflect these complex time-dependent relationships. By dividing the time series into time segments, data can be modeled at the subsequence level, thereby better expressing the local structure and enhancing the model's ability to model complex time dependencies. We divide each input into subsequence-level time segments of length , obtaining the preprocessed data , and forming a multivariate time series historical database.
[0039] After obtaining the multivariate time series historical database, we train the multivariate time series prediction model proposed in the present invention according to Figure 3 . Model training corresponds to S2, S3, and S4. In each iterative training, we first select a batch of training-validation sample pairs from the processed multivariate time series historical database, and then input them into S2 first, for dynamic clustering hypergraph construction and correlation information propagation.
[0040] S2 Dynamic Clustering Hypergraph Construction and Correlation Information Propagation.
[0041] In multivariate time series data, there is not only temporal correlation. From a spatial dimension perspective, it also reflects the interaction between different variables at the same moment, as well as the dynamic coupling relationship between variables across different time scales. In the marine environment, Sea Surface Temperature (SST) is a typical multivariate time series data, which often exhibits significant regional linkage and diffusivity. This spatio-temporal correlation is not limited to the direct influence between geographically adjacent regions, but also includes teleconnection phenomena, that is, the indirect connection between regions that are far apart geographically due to processes such as ocean circulation and atmospheric transmission.
[0042] For example, in adjacent sea areas such as the East China Sea and the South China Sea, affected by monsoon circulation, tidal exchange, and seawater mixing, the sea surface temperature often shows synchronous increases or decreases. Such phenomena can be regarded as synchronous changes caused by local spatial adjacency relationships. On a larger scale, such as during the El Niño event, the increase in the surface sea temperature in the central equatorial Pacific will have a delayed impact on the sea temperature in the far western Pacific or Indian Ocean regions through the equatorial current and atmospheric circulation. This cross-regional and cross-time diffusivity change precisely reflects the dynamic correlation between non-adjacent regions.
[0043] Traditional methods usually model all historical data based on static graphs, ignoring both the dynamic evolution of correlations and the effective separation of noise signals. However, in the modeling process, it is difficult to fully capture the complex spatio-temporal dependence structure in the sea surface temperature time series data by relying solely on a fixed topological structure or a static adjacency matrix. By constructing a hypergraph structure through the method of dynamic clustering, the associated patterns evolving over time between variables can be represented more flexibly; at the same time, combined with the correlation propagation mechanism, it can more effectively model the interaction effects of sea surface temperature between different regions, providing a more expressive structural representation for subsequent prediction and analysis. Therefore, for each batch of input data, we propose to model this complex interaction through the dynamic clustering hypergraph construction and correlation information propagation mechanism: using a stack of spatio-temporal correlation learning blocks, each layer containing two parts: hypergraph generation (dynamically capturing high-order associations) and hypergraph convolution (learning associated features), and fusing the original data and deep features through residual connections to achieve progressive spatio-temporal pattern extraction. In this part, we assume as the input of the th spatio-temporal correlation learning block, as the output of the th spatio-temporal correlation learning block.
[0044] S2.1 Perform data dimension transformation and initialize the membership matrix. We change the data dimension to prepare for the clustering operation. For the preprocessed data , we expand all subsequences into a node matrix: , (3) In addition, we need to randomly initialize the membership matrix : , (4) where is the preset number of hyperedges (the number of clustering clusters), represents the membership degree that the i -th time segment belongs to the k -th hyperedge. The initialization process ensures that the membership degrees of each node are evenly distributed among the hyperedges through a uniform distribution.
[0045] S2.2 Update the membership using the Fuzzy C-Means (FCM) algorithm. Different from the hard clustering method that only allows each node to belong to a single cluster, FCM allows nodes to belong to multiple hyperedges in the form of continuous probabilities. This "soft assignment" is more in line with the complexity of sea surface temperature changes in the real ocean environment.
[0046] Specifically, within a certain time period, an SST data segment may be affected by multiple physical processes simultaneously. For example, a certain sea area may be under the control of large-scale monsoons and at the same time be disturbed by local ocean currents or river inflows, and its sea temperature evolution pattern may be close to multiple dynamic clusters simultaneously. It is difficult to accurately model this local multimodal feature through fixed neighborhood methods (such as KNN based on geographical distance). The fuzzy clustering mechanism of FCM weakens the limitations of this subjective neighborhood setting to a certain extent. By adaptively optimizing the clustering centers and node membership degrees, each data segment can obtain a suitable expression among multiple potential dynamic patterns.
[0047] In addition, the iterative update mechanism of FCM also helps to characterize the spatio-temporal semantic structure gradually emerging in the sea surface temperature data. For example, although the correlation between some distant sea areas is not strong in the initial state, over time, due to the transmission effect of ocean circulation or atmospheric processes, their dynamic association may gradually increase. By continuously updating the membership degrees and clustering centers, using FCM for time segments can dynamically capture this "delayed correlation" feature, and then optimize the semantic expression of hyperedges in the hypergraph, improving the model's ability to depict the spatio-temporal evolution law of sea surface temperature data.
[0048] In this process, each layer of spatio-temporal correlation learning block executes the FCM algorithm, and will iteratively update the hyperedge clustering centers and node membership degrees. For the sake of simplicity in description, we omit the layer superscript of the spatio-temporal correlation learning block here and use the superscriptt denotes the current number of iterative updates. In the th update, according to the current membership degree , we first calculate the clustering center of each hyperedge : , (5) where is the feature vector of the th time segment in i , and is the fuzzy coefficient (default m = 2), which is used to control the fuzziness of the membership degree. Increasing m will make the membership degree distribution smoother, and vice versa, it tends to be a binary assignment. Then we need to recalculate the membership matrix : , (6)
[0049] ensures that the node has a higher membership degree with the closer clustering center, while satisfying . By introducing the ratio of the Euclidean distance, the algorithm adaptively adjusts the membership relationship of the node to multiple hyperedges, enhancing the expression ability for complex time series patterns. The iteration termination condition is that the change in the membership matrix between two adjacent times is less than the preset threshold or reaches the maximum number of iterations : , (7) where represents the Frobenius norm, and is usually set to 10 -6 to ensure optimization stability. If the convergence condition is not met and < , then continue the iteration; otherwise, output the final membership matrix of the spatio-temporal correlation learning block at the th layer and the clustering center .
[0050] S2.3 Construct a hypergraph by using the membership matrix. Given the time series data divided into N variables of S time segments, each segment is represented as a P -dimensional feature vector, construct a hypergraph ; where represents the node set, , and each node corresponds to a time segment; represents the hyperedge set, , and each hyperedge is formed by fuzzy Mean clustering dynamic generation represents a specific time series pattern. We define the hyperedge incidence matrix as , where the element represents the membership degree of node belonging to the hyperedge , and is obtained through the membership matrix : . (8) In addition, the spurious correlations between observed nodes may significantly interfere with modeling. Such spurious associations mainly stem from two aspects: First, the chaotic characteristics of the ocean system cause local transient events (such as sudden vortices, short-term heavy precipitation) that may trigger similar temperature fluctuations in non-adjacent regions, forming spatial pseudo-correlations; Second, the statistical biases caused by sensor noise and data missing lead to occasional numerical synchronization between some nodes. The weight coefficients of such pseudo-correlations usually exhibit low values and high fluctuations. If directly input into the model without screening, they may mislead the feature extraction process and reduce the prediction robustness. To remove the spurious correlations caused by noise information, we use a threshold (usually = 0.5) to screen the membership degree and construct hyperedges only for the time segments with core high correlations. According to the obtained incidence matrix, we calculate the node degree matrix and the hyperedge degree matrix : . (9) . (10) S2.4 Information transfer through hypergraph convolution. Generally speaking, hypergraph convolution follows the "node → hyperedge → node" paradigm to achieve efficient information exchange and feature learning optimization. First, transform and preliminarily aggregate the node features: . (11) where is a learnable parameter matrix for the linear transformation of node features, is used to normalize the node features is an activation function (such as ReLU), is the hyperedge feature representation after preliminary aggregation. We use the following formula to obtain the hyperedge feature matrix : . (12) where is a learnable parameter matrix, is used to normalize the hyperedge features. Then, we back-diffuse the hyperedge features to the nodes and perform a residual connection with the original input to obtain the output of this layer's time correlation learning block: , (13) Among them Control the proportion of the original input retained to ensure that the propagated nodes can maintain certain original features, avoid the over-smoothing problem that may be caused by deep neural networks, improve the expression ability of the model, and improve the stability and convergence speed during model training.
[0051] S2.5 Determine whether the stacking layer requirement is met. After each hypergraph convolution ends, the model will make a judgment. If the stacking repetition times requirement of the spatio-temporal correlation learning block is met, the data will be output; otherwise, it will return to repeat S2.2. After layers of spatio-temporal correlation learning blocks are stacked, the hypergraph structure update and the time segment representation learning are alternated. The time segment representation output by the upper layer is input to the lower layer for fuzzy C-means clustering operation to update the hypergraph G(I). This iterative process ensures that the two continuously improve and optimize each other. The final output of S2 .
[0052] S3 Multi-scale time representation learning.
[0053] Figure 5 shows the program flow chart of S3 multi-scale time representation learning. To better capture the time patterns in time series data, such as the periodic and trend changes presented by sea surface temperature data according to time changes, we use a multi-scale time series Transformer encoder to perform targeted learning on time representations.
[0054] S3.1 Split the data according to the number of variables. We re-split the output obtained in S2 according to the number of variables: . (14) We perform time representation learning in a variable-independent manner, that is, we input the data of different variables into the Transformer encoder separately. For the time series of the th variable, we transpose it and use to represent it.
[0055] S3.2 Map the data to the latent space and add learnable position encoding. We first use a trainable linear projection to map these variables to the Transformer latent space with a dimension of . In addition, we also use a learnable position encoding to capture the order of time segments: , (15) Among them represents the single-variable input of the Transformer encoder, and the multi-variable input can be expressed as 。
[0056] S3.3 Use the Transformer encoder to learn. We use the classical Transformer encoder architecture. We adopt the multi-head attention mechanism to model the temporal correlation between different time segments. By linearly transforming the input we can obtain the query matrix the key matrix and the value matrix . The calculation formula for the attention output is as follows: . (16) Subsequently, the attention output will go through the processing of the residual connection and the normalization layer, which improves the training stability and convergence by integrating the residual connection and batch normalization. The mathematical expression for this operation is: . (17) where Norm represents batch normalization (BatchNorm). After passing through the residual connection and the normalization layer, the intermediate representation will be further refined by a position-wise feed-forward network (FFN). This feed-forward network consists of two linear transformations connected by a non-linear activation function in the middle. The output of this stage can be expressed as: . (18) Finally, the Transformer encoder generates a multi-variable output containing the temporal representation of the input sequence.
[0057] We stack layers of the Transformer encoder. In this part, each layer includes a multi-head attention mechanism, a batch normalization (BatchNorm) layer, and a feed-forward neural network. Let be the output of the th layer of the Transformer encoder: . (19) where the input of the first layer directly uses .
[0058] S3.4 Determine whether the requirement for the number of stacked layers is met. After the output of each layer of the Transformer encoder, the model determines whether the encoder meets the requirement for the number of stacked layers. If the requirement is met, a representation containing the time series features is obtained and input into S4 to obtain the predicted value and perform iterative training. If the requirement is not met, it enters S3.5.
[0059] S3.5 Merge adjacent time segments. Time series data usually has local correlations, such as short-term trends, periodic or seasonal patterns, which may exhibit different characteristics at different time scales. In the ocean surface temperature prediction task, this property is manifested as the nesting of dynamic patterns at different time scales. At the short time scale, affected by the daily cycle of solar radiation, the temperature series shows a sinusoidal fluctuation trend within 24 hours; at the medium time scale, the movement of weather systems forms continuous warming / cooling segments of 3-7 days; at longer time scales, seasonal ocean current changes lead to progressive trend shifts at the inter-monthly scale. These cross-scale local patterns often have different correlation radii, and it is difficult for traditional single-scale modeling methods to capture them comprehensively. Therefore, by dividing the time series into time segments of different sizes, we can model the data at the subsequence level, thus better expressing the local structure. Time segments of different sizes contain different numbers of time steps, which helps to capture multi-scale time series patterns from short-term to long-term, thereby enhancing the model's ability to model complex time dependencies. For this purpose, between every two layers, we merge and splice adjacent time segments of the previous layer's Transformer encoder to make them into larger time segments and use them as the input of the next layer. This process can be expressed as: .(20) Finally, obtain the representation containing time series features .
[0060] S4 Iteratively train the model and save the model.
[0061] We flatten the time segments in and use a linear layer to transform them to obtain the predicted values of the model output . We continuously use the different data obtained in step one, input them into the model implemented in steps two and three for iterative training of the model parameters. Each time, we use the obtained model output predicted values to calculate the mean square error loss function with the corresponding true value Y and determine whether to converge. If the model converges, save the optimal parameter model; if not, continue with iterative training.
[0062] S5 Use the model to predict future data.
[0063] When using the model to predict future data, we set the number of time steps in the input current time period and the number of time steps to be predicted, input the data of the current time period into the optimal model saved in S4, and make it output the future prediction data of the required multi-variable time series, that is, ocean surface temperature data.
[0064] Embodiment 2 This embodiment provides a time series data prediction system based on dynamic clustering and multi-scale, including: A data acquisition module, configured to: A computer-readable storage medium storing a plurality of instructions adapted to be loaded and executed by a processor of a terminal device for the time series prediction method based on dynamic hypergraph and multi-scale coding.
[0065] A terminal device, comprising a processor and a computer-readable storage medium, the processor being configured to implement the respective instructions; the computer-readable storage medium being configured to store a plurality of instructions adapted to be loaded and executed by the processor for the time series prediction method based on dynamic hypergraph and multi-scale coding.
[0066] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention shall be covered within the protection scope of the present invention.
Claims
1. A time series prediction method based on dynamic hypergraph and multi-scale coding, characterized in that, Including: Obtain sea surface temperature data; Perform data preprocessing on the obtained data; Construct a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, and output variables; Perform multi-scale time representation learning on the output variables; Iteratively train the multivariate time series prediction model; Use the trained model for data prediction.
2. A time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 1, characterized in that, The data preprocessing of the acquired data includes calculating the mean and standard deviation of each variable over all time steps, standardizing all variables using the mean and standard deviation, and finally constructing training-validation sample pairs using the sliding window method. Then, each input is divided in the time dimension into sub-sequence level time segments of length , obtaining the preprocessed data , and forming a multi-variable time series historical database.
3. The time series prediction method based on dynamic hypergraph and multi-scale encoding according to claim 2, wherein The construction of the dynamic clustering hypergraph and the propagation of correlation information include first performing data dimension transformation and initializing the membership matrix. For the preprocessed data, all subsequences are first expanded into a node matrix and the membership matrix is randomly initialized. During the initialization process, the membership degrees of all nodes are evenly distributed among the hyperedges through a uniform distribution. Then, the fuzzy C-means algorithm (FCM) is used to update the membership degrees. Among them, the FCM algorithm is executed for each layer of spatio-temporal correlation learning block, and the superscript is used for the iterative update of the hyperedge clustering center and the node membership degree t to represent the current number of iterative updates. In the -th update, according to the current membership degree , the clustering center of each hyperedge is first calculated , which is expressed as: , Among them, is the feature vector of the i th time segment in is the fuzzy coefficient, which is used to control the fuzziness of the membership degree. Increasing m will make the membership degree distribution smoother, and vice versa, it will tend to binary assignment.
4. The time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 3, characterized in that The construction of the dynamic clustering hypergraph and the propagation of correlation information also include recalculating the membership degree matrix according to the clustering centers of each hyperedge calculated , which is expressed as: , Among them, it is ensured that the node has a higher membership degree with the closer cluster center while satisfying .
5. A time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 4, characterized in that The construction of the dynamic clustering hypergraph and the propagation of correlation information also include constructing a hypergraph by using a membership matrix. Among them, the given time series data is divided into N variables of S time segments, and each segment is represented as P -dimensional feature vectors to construct a hypergraph ; where represents the node set, , and each node corresponds to a time segment; represents the hyperedge set, , and each hyperedge is dynamically generated by fuzzy c-means clustering, representing a specific time series pattern. The hyperedge incidence matrix is defined as , where the element represents the membership degree of node belonging to hyperedge , and is obtained through the membership matrix , which is expressed as: 。 6. The time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 5, characterized in that The construction of the dynamic clustering hypergraph and the propagation of correlation information also include information transfer through hypergraph convolution. Among them, the node features are transformed and preliminarily aggregated to obtain the hyperedge feature matrix. By back-diffusing the hyperedge features to the nodes and performing a residual connection with the original input, the output of the time correlation learning block at this layer is obtained , which is expressed as: , Among them Control the proportion of the original input retained to ensure that the propagated nodes can maintain certain original features and avoid the over-smoothing problem that may be caused by deep neural networks.
7. A time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 6, characterized in that, The multi-scale temporal representation learning of the output variable includes re-splitting the obtained output variable according to the number of variables and performing temporal representation learning in a variable-independent manner. Among them, the data of different variables are separately input into the Transformer encoder, and the time series of the th variable is transposed and used to represent; then a trainable linear projection is used to map the variable into the Transformer latent space with a dimension of , and the multi-head attention mechanism is adopted to model the temporal correlation between different time segments; by linearly transforming the input to obtain the query matrix , the key matrix and the value matrix , and the calculation formula of the attention output is expressed as: 。 8. A time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 7, characterized in that The multi-scale temporal representation learning of the output variable further includes, after the output of each layer of the Transformer encoder, the model determines whether the encoder meets the requirement of the stacking layer number. If the requirement is met, a representation containing time series features is obtained. , where, between every two layers, the adjacent time segments of the previous layer of the Transformer encoder are merged and concatenated to form a larger time segment, which is used as the input of the next layer. The process is expressed as: , Finally, a representation containing time series features is obtained .
9. A time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 8, characterized in that, The iterative training of the multi-variable time series prediction model includes flattening the time segments in the representation containing time series features and using a linear layer to transform them to obtain the predicted values output by the model. By continuously using different monitoring data obtained, inputting them into the model for iterative training of model parameters, and using the predicted values of the model output each time. Calculate the mean square error loss function with the corresponding true value Y and determine whether it converges. If the model converges, save the optimal parameter model; if not, continue the iterative training.
10. A time series data prediction system based on dynamic clustering and multi-scale, characterized in that, Including: A data acquisition module, configured to obtain sea surface temperature data; A preprocessing module, configured to perform data preprocessing on the obtained data; A model construction module, configured to construct a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, and output variables; Perform multi-scale time representation learning on the output variables; A training module, configured to iteratively train the multivariate time series prediction model; A prediction module, configured to use the trained model for data prediction.
Citation Information
Patent Citations
Abnormity detection method based on dynamic hypergraph neural network
CN116502161A
Time sequence anomaly detection method and system based on hypergraph attention network
CN117290800A
Graph aggregation model-based multivariate time sequence prediction method, system and equipment, and medium
CN119025855A
Group division method and system based on individual moving mode dynamic hypergraph clustering
CN119830056A
Multi-modal traffic flow prediction method based on dynamic space-time hypergraph and large language model
CN119942803A
Cited By
Flotation grade prediction method based on dynamic hypergraph and Informer-GRU
CN120822671A
A flotation grade prediction method based on dynamic hypergraph and informer-gru
CN120822671B