A time series 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 in multi-variable time series prediction is solved, and the precise modeling of complex space-time dependencies is realized, which improves prediction accuracy and robustness.

CN120278037BActive Publication Date: 2025-08-08OCEAN UNIV OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510724436.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-08-08
Estimated Expiration
2045-06-03

AI Technical Summary

Technical Problem

The existing multivariate time series prediction methods 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.

Method used

Using dynamic hypergraphs and multi-scale coding methods, dynamic cluster hypergraph construction and correlation information dissemination, combined with multi-scale time characterization learning, a multi-variable time series prediction model is constructed to achieve accurate modeling of complex space-time dependencies.

Benefits of technology

It improves the prediction accuracy of multivariate time series data, breaks through the paired connection limitations of traditional graphs, realizes high-order relationship modeling, dynamic adaptive modeling, strong noise robustness, can effectively suppress the propagation of false information, and collaboratively model short-term fluctuations and long-term trends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278037B_ABST
    Figure CN120278037B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of multivariate time series prediction, and more particularly to a time series prediction method and system based on dynamic hypergraphs and multi-scale encoding. The method comprises preprocessing acquired data; constructing a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, to output variables; learning multi-scale temporal representations of the output variables; iteratively training the multivariate time series prediction model; and using the trained model to perform data prediction. This method, through dynamic clustering hypergraph learning, achieves accurate modeling of complex spatiotemporal dependencies.
Need to check novelty before this filing date? Find Prior Art

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 playing an increasingly important role in marine environmental monitoring and scientific decision-making, particularly in key scenarios such as global climate change assessments, marine disaster warnings, fishery resource management, and coastal engineering planning. From a spatial perspective, SST often exhibits significant regional linkages and diffusion. Temperature changes in different ocean regions are not isolated but rather mutually influenced by a variety of oceanographic processes. From a temporal perspective, even SST records from a single observation point often exhibit diverse and complex evolutionary characteristics. While their variations exhibit clear periodicity, SST also exhibits long-term trends. Therefore, SST prediction requires not only modeling single-point temperature series but also systematically understanding the multi-point, multi-scale, and dynamically coupled spatiotemporal structure of the ocean. A deep understanding of the spatial diffusion mechanisms and regional linkages of SST, as well as its temporal trends, cycles, and mutations, is a key foundation for building a modern marine information service system and enhancing disaster warning and resource allocation capabilities.

[0003] In recent years, deep learning techniques have demonstrated significant potential in time series modeling, particularly in addressing complex features such as time lags, seasonality, and nonlinearity. The attention-based Transformer model has achieved breakthroughs in multiple fields and demonstrated excellent modeling capabilities in time series forecasting. However, most existing Transformer-based multivariate forecasting methods fail to fully consider the correlation modeling between variables, making it difficult to accurately characterize the complex interactions between variables. Therefore, effectively exploring and modeling the dynamic relationships between variables has become a hot research topic.

[0004] Graph neural networks (GNNs) offer a new solution to this problem. This approach represents multivariate time series as a graph structure, treating the variables as nodes within the graph and using edge weights between nodes to characterize the degree of correlation between the variables. However, in practical applications, the dependencies between variables are often highly dynamic and complex, and constructing accurate and effective dynamic graph structures remains a significant challenge.

[0005] In summary, the current multivariate time series forecasting model has the following prominent problems:

[0006] 1) Inadequate modeling of interactions between variables. Traditional graph structures typically only express the direct connection between two variables and are unable to capture more complex, high-order interaction patterns between multiple variables.

[0007] 2) Ignoring the dynamic changes in variable correlations. Most methods use static graph structures, which are difficult to cope with fluctuations in variable relationships over time, affecting prediction accuracy.

[0008] 3) Susceptible to false correlations. In complex environments, external factors may cause unrelated variables to appear superficially correlated, thereby interfering with effective information transmission;

[0009] 4) Lack of multi-time-scale modeling capabilities. Existing methods are mostly based on single-time-scale modeling, ignoring the potential information differences and complementary features at different scales. Summary of the Invention

[0010] In order to solve the above-mentioned multivariate time series data prediction problem, the present invention provides a time series prediction method and system based on dynamic hypergraph and multi-scale coding.

[0011] In a first aspect, the present invention provides a time series prediction method based on dynamic hypergraph and multi-scale coding, which adopts the following technical solutions:

[0012] A time series prediction method based on dynamic hypergraph and multi-scale coding, comprising:

[0013] Obtain sea surface temperature data;

[0014] Perform data preprocessing on the acquired data;

[0015] Construct a multivariate time series forecasting model, including dynamic clustering hypergraph construction and correlation information propagation, output variables;

[0016] Learn multi-scale temporal representations of output variables;

[0017] Iteratively train multivariate time series forecasting models;

[0018] Use the trained model to make data predictions.

[0019] Furthermore, the data is preprocessed, including calculating the mean and standard deviation of each variable at all time steps, and standardizing all variables using the mean and standard deviation. Finally, a sliding window method is used to construct a training-validation sample pair, and each input In the time dimension, it is divided into The length is Subsequence-level time segments are obtained to obtain preprocessed data , and constitute a multivariate time series historical database.

[0020] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation include first changing the data dimension to prepare for the clustering operation, expanding all subsequences into node matrices and randomly initializing the membership matrix for the preprocessed data, and using the fuzzy C-means algorithm FCM to update the membership, wherein each layer of spatiotemporal correlation learning block executes the FCM algorithm, and iteratively updates the hyperedge cluster center and the node membership using the superscript t Indicates the current number of iterative updates, In the update, according to the current membership , first calculate the cluster center of each hyperedge :

[0021] ,

[0022] in, for Middle i The feature vector of each time segment, is the fuzzy coefficient, which is used to control the fuzziness of the membership and increase m It will make the membership distribution smoother, otherwise it will tend to binary distribution.

[0023] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also includes recalculating the membership matrix , expressed as:

[0024] ,

[0025] Among them, ensure that the node has a higher degree of membership with the closer cluster center, while satisfying .

[0026] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also include dividing the given time series data into N variables S time segments, each segment is represented by P dimensional feature vector, constructing a hypergraph ;in represents a node set, , each node Corresponds to a time segment; represents a hyperedge set, , each hyperedge By blur Mean clusters are generated dynamically to represent a specific temporal pattern, and the hyperedge correlation matrix is defined as , where the elements Representation node Belong to the super edge The membership degree of get:

[0027] .

[0028] Furthermore, the dynamic clustering hypergraph construction and correlation information propagation also include information transmission through hypergraph convolution, transformation and preliminary aggregation of node features, which can be expressed as:

[0029] ,

[0030] in is a learnable parameter matrix for linear transformation of node features, Used to normalize node features is the activation function, It is the hyperedge feature representation after preliminary aggregation, and the hyperedge feature matrix is obtained , expressed as:

[0031] ,

[0032] in is the learnable parameter matrix, Used to normalize hyperedge features.

[0033] 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 independence manner, wherein the data of different variables are input into the Transformer encoder separately, and the first The time series of the variables is transposed using Representation; then using a trainable linear projection Map these variables to a In the latent space of the Transformer, a multi-head attention mechanism is used to model the temporal correlation between different time segments. Perform linear changes to obtain the query matrix , key matrix Sum Matrix , and the attention output The calculation formula is expressed as:

[0034] .

[0035] Furthermore, the multi-scale temporal representation learning of the output variables also includes, after each layer of the Transformer encoder outputs, the model determines whether the encoder meets the stacking layer requirement, and if so, obtains a representation containing time series features. , where between every two layers, the adjacent time segments of the previous layer Transformer encoder are merged and spliced to form larger time segments, which are used as the input of the next layer. The process is expressed as:

[0036] .

[0037] Finally, we obtain a representation containing time series features .

[0038] Furthermore, the multivariate time series prediction model is iteratively trained, including flattening the time segments in the representation containing the time series features and transforming them using a linear layer to obtain the predicted value of the model output, and continuously using different monitoring data to input them into the model for iterative training of model parameters, and each time using the obtained model output predicted value 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 it does not converge, continue iterative training.

[0039] The second aspect is a time series data prediction system based on dynamic clustering and multi-scale, including:

[0040] The data acquisition module is configured to acquire sea surface temperature data;

[0041] The preprocessing module is configured to perform data preprocessing on the acquired data;

[0042] The model building module is configured to build a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, output variables; and learn multi-scale temporal representations of the output variables;

[0043] The training module is configured to iteratively train the multivariate time series forecasting model;

[0044] The prediction module is configured to use the trained model to make data predictions.

[0045] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a time series prediction method based on dynamic hypergraph and multi-scale coding.

[0046] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to implement the time series prediction method based on dynamic hypergraph and multi-scale coding.

[0047] In summary, the present invention has the following beneficial technical effects:

[0048] To improve the prediction accuracy of multivariate time series data, such as sea surface temperature data, this paper proposes an innovative prediction method that combines dynamic clustering hypergraph learning with multi-scale time coding. Traditional graph learning methods are limited by binary relationship modeling and have difficulty capturing high-order interaction features between multiple variables. However, this method achieves accurate modeling of complex spatiotemporal dependencies through dynamic clustering hypergraph learning. Its core advantages are:

[0049] High-order relational modeling: Breaking through the pairwise connection limitations of traditional graphs, it simultaneously connects multiple time segments through hyperedges to accurately characterize the high-order interactions of multi-systems;

[0050] Dynamic adaptive modeling: Automatically generates the optimal hypergraph structure based on the real-time characteristics of input data, significantly improving the model's adaptability to dynamic correlations;

[0051] Noise robustness: A threshold screening mechanism is used to distinguish core features from redundant noise, effectively suppressing the spread of irrelevant information.

[0052] Multi-scale time series analysis: Combined with the time coding module, it can achieve collaborative modeling of short-term fluctuations and long-term trends.

[0053] This method is suitable for prediction tasks with strong spatiotemporal correlation, such as sea surface temperature data, and provides a more accurate and robust solution for multivariate time series analysis of complex systems. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0055] Figure 2 This is a flow chart of the data preprocessing module in step 1 of the present invention.

[0056] Figure 3 This is the training flow chart of the multivariate time series prediction model proposed in this invention.

[0057] Figure 4 This is a flow chart of the dynamic clustering hypergraph construction and correlation information propagation module in step 2 of the present invention.

[0058] Figure 5 This is the flowchart of the multi-scale time representation learning module in step 3 of the present invention. DETAILED DESCRIPTION

[0059] The present invention will be further described in detail below with reference to the accompanying drawings.

[0060] Example 1

[0061] Reference Figure 1, a time series prediction method based on dynamic hypergraph and multi-scale coding in this embodiment includes:

[0062] Obtain sea surface temperature data;

[0063] Perform data preprocessing on the acquired data;

[0064] Construct a multivariate time series prediction model, including dynamic clustering hypergraph construction and correlation information propagation, and output variables; learn multi-scale temporal representations of output variables;

[0065] Iteratively train multivariate time series forecasting models;

[0066] Use the trained model to make data predictions.

[0067] Specifically:

[0068] Figure 1 This figure shows the overall flow chart of the multivariate time series data prediction method based on dynamic clustering hypergraph learning and multi-scale time encoding proposed in this paper for predicting seawater surface temperature. S1 corresponds to historical data preprocessing. S2, S3, and S4 correspond to iterative model training and saving. S4 uses the model to predict future data.

[0069] We first preprocess the historical database. According to the diagram, we proceed to S1, historical data preprocessing.

[0070] S1 Historical data preprocessing.

[0071] Figure 2 The overall process of the data preprocessing module is shown. In the prediction of sea surface temperature, The measurement data from each spatial observation point forms a multivariate time series with spatiotemporal correlation characteristics: each measuring point records temperature values synchronously every hour, forming a two-dimensional data matrix with rows representing time steps and columns corresponding to spatial dimensions. This data structure embodies both the continuous evolutionary laws in the temporal dimension and the interactive relationships in the spatial dimension.

[0072] Specifically, the historical database can be represented as a spatiotemporal matrix: the row vectors of the matrix correspond to a global observation snapshot at a single moment in time, fully recording the temperature distribution of all spatial points at that moment; the column vectors represent the temperature evolution trajectory of a single spatial point over the historical period. Because sampling is performed at a fixed interval (hourly), the data matrix has a strict time alignment property: increasing row indices correspond to the natural extension of the time series, and adjacent row vectors constitute a continuous observation record with equal time difference.

[0073] The data preprocessing module includes four steps: calculating the mean and standard deviation of each variable across all time steps, normalizing all variables, constructing training-validation sample pairs using a sliding window method, and partitioning each input sample into time segments along the temporal dimension. These steps aim to improve data quality and meet the model's input format requirements. In particular, in multivariate time series modeling tasks, these processing operations help preserve the temporal dependencies and spatial correlation structures between variables, providing a sound foundation for subsequent model training.

[0074] Through this preprocessing process, the original multivariate time series historical data is effectively converted into a multivariate time series input format with standardized structure and clear features. It is not only suitable for time series modeling tasks, but also facilitates the further introduction of graph structure modeling methods to explore the dynamic relationships and spatial coupling characteristics between variables.

[0075] S1.1 calculates the mean and standard deviation of each variable across all time steps. Data standardization is a crucial preprocessing step. Its core purpose is to linearly transform the raw data so that the processed data conforms to a standard normal distribution with a mean of 0 and a standard deviation of 1. This process effectively addresses model bias caused by scale differences between different features.

[0076] For having variables and historical dataset of time steps , Indicates the The variable value of time steps, and Respectively The mean and standard deviation of the variables. The calculation formulas for the mean and standard deviation are:

[0077] , (1)

[0078] S1.2 Standardize all variables. We use the mean and standard deviation to standardize all variables:

[0079] , (2)

[0080] S1.3 uses the sliding window method to construct training-validation sample pairs. We use continuous time points as input values for model training , then take out Time point data Used to test the output prediction results. The original data sequence is sampled row by row, ensuring that the starting point of each new sample is one time unit later than the previous sample, thereby constructing a complete training-validation sample pair.

[0081] S1.4 divides each input sample into time segments in the time dimension. Time series data usually have local correlations, such as short-term trends, periodic or seasonal patterns, and these patterns may show different characteristics at different time scales. Similarly, sea surface temperature data usually show diverse and complex evolutionary characteristics. On the one hand, its changes have clear periodicity, such as the annual cycle is controlled by the intensity of solar radiation, and the semi-annual cycle may be caused by the alternation of monsoon systems or tidal mixing processes. On the other hand, sea water shows that temperature also has long-term trend changes, such as regional warming under the background of global warming. Therefore, a single time point often cannot fully reflect these complex time dependencies. By dividing the time series into time segments, the data can be modeled at the subsequence level, thereby better expressing the local structure and improving the model's ability to model complex time dependencies. We divide each input In the time dimension, it is divided into The length is Subsequence-level time segments are obtained to obtain preprocessed data , and constitute a multivariate time series historical database.

[0082] After obtaining the multivariate time series historical database, we Figure 3 The proposed multivariate time series prediction model is trained. Model training corresponds to S2, S3, and S4. In each training iteration, a batch of training-validation sample pairs is first selected from the processed multivariate time series historical database. These pairs are then input into S2 for dynamic clustering hypergraph construction and correlation information propagation.

[0083] S2 dynamic clustering hypergraph construction and correlation information propagation.

[0084] Multivariate time series data not only exhibit temporal correlation but also, from a spatial perspective, reveal interactions between different variables at the same moment in time, as well as dynamic coupling between variables across time scales. In the marine environment, sea surface temperature (SST) is a typical example of multivariate time series data, often exhibiting significant regional linkage and diffusion. This spatial-temporal correlation is not limited to direct influences between geographically adjacent regions but also includes teleconnections—indirect connections between geographically distant regions due to processes such as ocean circulation and atmospheric transport.

[0085] For example, in adjacent waters such as the East China Sea and the South China Sea, sea surface temperatures often rise or fall synchronously due to the influence of monsoon circulation, tidal exchange, and seawater mixing. This phenomenon can be viewed as a synchronized change caused by local spatial proximity. On a larger scale, during the onset of El Niño, rising surface temperatures in the central equatorial Pacific can have a delayed impact on sea temperatures in distant western Pacific or Indian Ocean regions through the equatorial current and atmospheric circulation. This diffuse change across regions and time reflects the dynamic correlation between non-adjacent regions.

[0086] Traditional methods usually model all historical data based on static graphs, which not only ignores the dynamic evolution of correlations, but also fails to effectively separate noise signals. However, in the modeling process, it is difficult to fully capture the complex spatial-temporal dependency structure in sea surface temperature time series data by relying solely on fixed topological structures or static adjacency matrices. By constructing a hypergraph structure through dynamic clustering methods, the correlation pattern between variables that evolves over time can be more flexibly represented; at the same time, combined with the correlation propagation mechanism, it can more effectively model the interactive effects of sea surface temperatures in different regions, providing a more expressive structural expression for subsequent predictions and analysis. Therefore, for each batch of input data, we propose to model this complex interaction through dynamic clustering hypergraph construction and correlation information propagation mechanism: using The spatiotemporal correlation learning block is a stacked layer. Each layer consists of two parts: hypergraph generation (dynamically capturing high-order correlation) and hypergraph convolution (learning correlation features). It fuses the original data with deep features through residual connections to achieve progressive spatiotemporal pattern extraction. In this section, we assume that For the The input of the spatiotemporal correlation learning block of the layer, For the The output of the spatiotemporal correlation learning block of the layer.

[0087] S2.1 performs data dimension conversion and initializes the membership matrix. We change the data dimension to prepare for clustering operation. , we expand all subsequences into node matrices:

[0088] , (3)

[0089] In addition, we need to randomly initialize the membership matrix :

[0090] , (4)

[0091] in is the preset number of hyperedges (the number of clusters), Indicates the i The time segment belongs tok The initialization process ensures that the membership of each node is evenly distributed among the hyperedges through uniform distribution.

[0092] S2.2 uses the fuzzy C-means (FCM) algorithm to update membership. Unlike hard clustering, which only allows each node to belong to a single cluster, FCM allows nodes to belong to multiple hyperedges simultaneously in the form of continuous probabilities. This "soft assignment" better reflects the complexity of sea temperature changes in real ocean environments.

[0093] Specifically, within a given time period, a segment of SST data may be affected by multiple physical processes simultaneously. For example, a particular ocean region may be under the control of both the large-scale monsoon and the disturbances of local currents or rivers entering the sea, resulting in its SST evolution pattern approaching multiple dynamic clusters simultaneously. This local multimodal nature is difficult to accurately model using fixed-neighborhood methods (such as KNN based on geographic distance). The fuzzy clustering mechanism of FCM mitigates the limitations of this subjective neighborhood setting to a certain extent. By adaptively optimizing cluster centers and node membership, each data segment is appropriately represented among multiple potential dynamic patterns.

[0094] Furthermore, the iterative update mechanism of FCM also helps capture the emerging spatial-temporal semantic structure in sea surface temperature data. For example, although some distant ocean regions may initially have weak correlations, their dynamic connections may gradually strengthen over time due to the transmission effects of ocean circulation or atmospheric processes. By continuously updating membership degrees and cluster centers, applying FCM to time segments can dynamically capture this "delayed correlation" feature, thereby optimizing the semantic representation of hyperedges in the hypergraph and improving the model's ability to capture the spatiotemporal evolution of sea surface temperature data.

[0095] In this process, each layer of spatiotemporal correlation learning block executes the FCM algorithm to iteratively update the hyperedge cluster center and node membership. For the sake of simplicity, we omit the superscript of the layer number of spatiotemporal correlation learning block and use the superscript t Indicates the current number of iterative updates. In the update, according to the current membership , we first calculate the cluster center of each hyperedge :

[0096] , (5)

[0097] in, for Middle i The feature vector of each time segment, is the fuzzy coefficient (default m =2), used to control the fuzziness of membership.m It will make the membership distribution smoother, otherwise it will tend to binary distribution. Then we need to recalculate the membership matrix :

[0098] , (6)

[0099] Ensure that nodes have higher membership with closer cluster centers, while satisfying By introducing the ratio of Euclidean distance, the algorithm adaptively adjusts the membership of nodes to multiple hyperedges, enhancing the ability to express complex time series patterns. The iterative termination condition is that the change of the membership matrix between two adjacent times is less than the preset threshold. or the maximum number of iterations is reached :

[0100] , (7)

[0101] in, represents the Frobenius norm, Usually set to 10 -6 To ensure the stability of the optimization. If the convergence conditions are not met and < , then continue to iterate; otherwise, output the Final membership matrix of layer spatiotemporal correlation learning block and cluster centers .

[0102] S2.3 constructs a hypergraph by using the membership matrix. Given time series data is divided into N variables S time segments, each segment is represented by P dimensional feature vector, constructing a hypergraph ;in represents a node set, , each node Corresponds to a time segment; represents a hyperedge set, , each hyperedge By blur Mean clusters are generated dynamically, representing a specific temporal pattern. We define the hyperedge correlation matrix as , where the elements Representation node Belong to the super edge The membership degree of get:

[0103] (8)

[0104] In addition, false correlations between observation nodes may significantly interfere with modeling. This false correlation mainly comes from two aspects: first, the chaotic characteristics of the ocean system cause local transient events (such as sudden vortices and short-term heavy rainfall) to cause similar temperature fluctuations in non-adjacent areas, forming spatial pseudo-correlations; second, the statistical deviations caused by sensor noise and data loss cause occasional numerical synchronization between some nodes. The weight coefficients of such pseudo-correlations usually have low values and high volatility characteristics. If they are directly input into the model without screening, they may mislead the feature extraction process and reduce the robustness of the prediction. In order to remove the false correlations caused by noise information, we use a threshold (generally = 0.5) to filter the membership and construct hyperedges only for the core high-correlation time segments. Based on the obtained correlation matrix, we calculate the node degree matrix and hyperedge degree matrix :

[0105] , (9)

[0106] (10)

[0107] S2.4 transfers information through hypergraph convolution. In general, hypergraph convolution follows the "node → hyperedge → node" paradigm to achieve efficient information exchange and feature learning optimization. First, the node features are transformed and initially aggregated:

[0108] , (11)

[0109] in is a learnable parameter matrix for linear transformation of node features, Used to normalize node features is the activation function (such as ReLU), is the hyperedge feature representation after preliminary aggregation. We use the following formula to obtain the hyperedge feature matrix :

[0110] , (12)

[0111] in is the learnable parameter matrix, Used to normalize the hyperedge features. Then, we diffuse the hyperedge features back to the nodes and perform residual linking with the original input to obtain the output of the temporal correlation learning block of this layer. :

[0112] , (13)

[0113] in Control the proportion of original input retained to ensure that the propagated nodes can maintain certain original characteristics, 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 of the model during training.

[0114] S2.5 determines whether the stacking layer requirements are met. After each hypergraph convolution is completed, the model will make a judgment. If the stacking repetition number requirements of the spatiotemporal correlation learning block are met, the data will be output. Otherwise, it will return to repeat S2.2. The layer-by-layer spatiotemporal correlation learning blocks are stacked, and the hypergraph structure update and time segment representation learning are performed alternately. 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 continue to improve and optimize each other. The final output of S2 is .

[0115] S3 Multi-scale temporal representation learning.

[0116] Figure 5 The flowchart for learning multi-scale temporal representations in S3 is shown. To better capture temporal patterns in time series data, such as the periodic and trending changes in sea surface temperature data over time, we use a multi-scale temporal Transformer encoder to learn temporal representations.

[0117] S3.1 splits the data according to the number of variables. We split the output of S2 according to the number of variables:

[0118] (14)

[0119] We learn temporal representations in a variable-independent manner, that is, we input data of different variables into the Transformer encoder separately. We transpose the time series of the variables using express.

[0120] S3.2 maps the data into a latent space and adds a learnable positional encoding. We first apply a trainable linear projection to it using Map these variables to a In addition, we also use a learnable positional encoding To capture the order of time slices:

[0121] , (15)

[0122] in represents the single variable input of the Transformer encoder, and the multivariate input can be expressed as .

[0123] S3.3 uses Transformer encoder learning. We use the classic Transformer encoder architecture. We use a multi-head attention mechanism to model the temporal correlation between different time segments. We can get the query matrix by performing linear transformation , key matrix Sum Matrix , and the attention output The calculation formula is as follows:

[0124] (16)

[0125] The attention output is then processed by the residual connection and normalization layer, which improves training stability and convergence by integrating residual connections and batch normalization. The mathematical expression of this operation is:

[0126] , (17)

[0127] Among them, Norm represents batch normalization (BatchNorm). After the residual connection and normalization layers, the intermediate representation is further refined through a position-wise feedforward network (FFN). This feedforward network consists of two linear transformations connected by a nonlinear activation function. The output of this stage can be expressed as:

[0128] (18)

[0129] Finally, the Transformer encoder generates a multivariate output that contains a temporal representation of the input sequence .

[0130] We stacked Layer Transformer encoder. In this part, each layer includes a multi-head attention mechanism, a batch normalization (BatchNorm) layer and a feedforward neural network. For the Layer Transformer Encoder The output:

[0131] , (19)

[0132] The input of the first layer is directly used .

[0133] S3.4 Determine whether the stacking layer requirements are met. After each layer of Transformer encoder outputs, the model determines whether the encoder meets the stacking layer requirements. If it does, a representation containing time series features is obtained. . And input to S4, obtain the predicted value and perform iterative training. If it does not meet the requirements, go to S3.5.

[0134] S3.5 Merge adjacent time segments. Time series data often exhibit local correlations, such as short-term trends, cyclical, or seasonal patterns, which may exhibit different characteristics at different time scales. In the sea surface temperature forecasting task, this characteristic manifests as the nesting of dynamic patterns at different time scales. On the short-term scale, influenced by the diurnal cycle of solar radiation, the temperature series exhibits a sinusoidal fluctuation trend within 24 hours; on the medium-term scale, the movement of weather systems creates continuous warming / cooling segments lasting 3-7 days; on the longer-term scale, seasonal ocean current changes lead to gradual trend shifts at the inter-month scale. These cross-scale local patterns often have different correlation radii, making them difficult to fully capture using traditional single-scale modeling methods. Therefore, by dividing the time series into time segments of different sizes, we can model the data at the subsequence level, thereby better expressing local structure. Time segments of different sizes contain different numbers of time steps, which helps capture multi-scale temporal patterns from the short-term to the long-term, thereby improving the model's ability to model complex temporal dependencies. To this end, between every two layers, we merge and concatenate the adjacent time segments of the previous layer's Transformer encoder into larger time segments and use them as input to the next layer. This process can be expressed as:

[0135] (20)

[0136] Finally, we obtain a representation containing time series features .

[0137] The S4 model iteratively trains and saves the model.

[0138] we will Flatten the time segments in and transform them using a linear layer to get the predicted values of the model output We continue to use the different data obtained in step 1 and input them into the model implemented in steps 2 and 3 to iteratively train the model parameters, and each time we use the model to obtain the output prediction value 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 it does not converge, continue iterative training.

[0139] S5 uses the model to predict future data.

[0140] When using the model to predict future data, we set the number of time steps in the current time period of the input and the number of time steps that need to be predicted, and input the data of the current time period into the optimal model saved in S4, so that it outputs the required multivariate time series future prediction data, namely the sea surface temperature data.

[0141] Example 2

[0142] This embodiment provides a time series data prediction system based on dynamic clustering and multi-scale, including:

[0143] The data acquisition module is configured as follows:

[0144] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, for performing a time series prediction method based on a dynamic hypergraph and multi-scale coding.

[0145] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor. A time series prediction method based on dynamic hypergraph and multi-scale coding is described.

[0146] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A time series prediction method based on dynamic hypergraph and multi-scale coding, characterized in that: include: Obtain sea surface temperature data; Perform data preprocessing on the acquired data; Construct a multivariate time series forecasting model, including dynamic clustering hypergraph construction and correlation information propagation, output variables; Learn multi-scale temporal representations of output variables; Iteratively train multivariate time series forecasting models; Use the trained model to make data predictions; The dynamic clustering hypergraph construction and correlation information propagation include first converting the data dimension and initializing the membership matrix. First, for the preprocessed data, all subsequences are expanded into node matrices and the membership matrix is randomly initialized. The initialization process ensures that the membership of each node is evenly distributed among the hyperedges through uniform distribution. Then, the fuzzy C-means algorithm FCM is used to update the membership. Among them, each layer of spatiotemporal correlation learning block executes the FCM algorithm, and the iterative update of the hyperedge cluster center and the node membership is performed using the superscript t Indicates the current number of iterative updates, In the update, according to the current membership , first calculate the cluster center of each hyperedge , expressed as: in, for Middle i The feature vector of each time segment, is the fuzzy coefficient, which is used to control the fuzziness of the membership and increase m It will make the membership distribution smoother, otherwise it will tend to binary distribution; The dynamic clustering hypergraph construction and correlation information propagation also includes recalculating the membership matrix based on the calculated cluster centers of each hyperedge , expressed as: Among them, ensure that the node has a higher degree of membership with the closer cluster center, while satisfying ; The dynamic clustering hypergraph construction and correlation information propagation also includes constructing a hypergraph by using a membership matrix, wherein the given time series data is divided into N variables S time segments, each segment is represented by P dimensional feature vector, constructing a hypergraph ;in Represents a node set, , each node Corresponds to a time segment; represents a hyperedge set, , each hyperedge By blur Mean clusters are generated dynamically to represent a specific temporal pattern, and the hyperedge correlation matrix is defined as , where the elements Representation node Belong to the super edge The membership degree of Obtained, expressed as: ; The dynamic clustering hypergraph construction and correlation information propagation also include information transmission through hypergraph convolution, wherein the node features are transformed and preliminarily aggregated to obtain a hyperedge feature matrix, and the output of the time correlation learning block of this layer is obtained by back-diffusion of the hyperedge features to the nodes and residual linking with the original input. , expressed as: in Control the proportion of 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; The multi-scale temporal representation learning of the output variables includes re-splitting the obtained output variables according to the number of variables and performing temporal representation learning in a variable independence manner, wherein the data of different variables are input into the Transformer encoder separately, and the first The time series of the variables is transposed using Representation; then using a trainable linear projection Map the variables to the dimension In the Transformer latent space, a multi-head attention mechanism is used to model the temporal correlation between different time segments; by Perform linear transformation to obtain the query matrix , key matrix Sum Matrix , and the attention output The calculation formula is expressed as: 。 2. The time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 1, characterized in that: The data is preprocessed, including calculating the mean and standard deviation of each variable at all time steps, and standardizing all variables using the mean and standard deviation. Finally, a sliding window method is used to construct a training-validation sample pair, and then each input In the time dimension, it is divided into The length is Subsequence-level time segments are obtained to obtain preprocessed data , and constitute a multivariate time series historical database.

3. The time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 2, characterized in that: The multi-scale time representation learning of the output variable also includes, after each layer of Transformer encoder outputs, the model determines whether the encoder meets the stacking layer requirement. 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 Transformer encoder are merged and spliced to form larger time segments, which are used as the input of the next layer. The process is expressed as: , Finally, we obtain a representation containing time series features .

4. The time series prediction method based on dynamic hypergraph and multi-scale coding according to claim 3, characterized in that: The multivariate time series prediction model is iteratively trained, including flattening the time segments in the representation containing the time series features and transforming them using a linear layer to obtain the predicted value of the model output, and continuously using different monitoring data to input them into the model for iterative training of the model parameters, and obtaining the model output predicted value 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 it does not converge, continue iterative training.

5. A time series data prediction system based on dynamic clustering and multi-scale, executing the time series data prediction method based on dynamic clustering and multi-scale according to claim 1, characterized in that: include: The data acquisition module is configured to acquire sea surface temperature data; The preprocessing module is configured to perform data preprocessing on the acquired data; The model building module is configured to,build a multivariate time series forecasting model, including dynamic,clustering hypergraph construction and correlation information propagation,on the output variables; Learn multi-scale temporal representations of output variables; The training module is configured to iteratively train the multivariate time series forecasting model; The prediction module is configured to use the trained model to make data predictions.

Citation Information

Patent Citations

  • 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