A spatiotemporal sequence prediction method and device based on frozen spatiotemporal pattern anchors
Patent Information
- Application Number
- CN202611461179.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-20
- Publication Date
- 2026-10-23
AI Technical Summary
[0008]因此,现有技术仍存在如下不足:第一,直接预测原始未来序列会混合稳定时空模式和动态残差偏差,增加模型学习难度;第二,周期性和节点异质性通常作为输入特征或嵌入信息使用,缺少面向目标空间的冻结锚点表示;第三,现有模型在在线推理阶段通常依赖较复杂的神经结构生成完整预测结果,计算开销较大;第四,在观测延迟、传感器失效、校准漂移等实际部署场景下,完全依赖当前历史观测的预测模型可能对输入扰动较敏感;第五,长预测步场景中,缺少一种能够为每个未来时间步提供稳定参考并在此基础上进行残差校正的统一机制
[0029](1)冻结时空模式锚点层面:
Smart Images

Figure CN122964443A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and spatiotemporal data processing technology, and particularly relates to a spatiotemporal sequence prediction method and apparatus based on frozen spatiotemporal pattern anchor points. Background Technology
[0002] Spatiotemporal series prediction is a crucial technical challenge in fields such as traffic management, urban sensing, environmental monitoring, and energy dispatching. These tasks typically target multiple spatial entities deployed across roads, regions, stations, or sensor networks, utilizing their historical observation sequences, spatial connectivity, and temporal context to predict observations over a future period. Taking traffic prediction as an example, the system usually collects data such as flow rate, speed, or occupancy from multiple road sensors over consecutive time steps and predicts traffic conditions for future time steps based on observations from past time steps. Because of spatial correlations between different sensors or regions, and temporal patterns such as daily, weekly, and weekday / weekend variations between different time periods, spatiotemporal series prediction usually requires simultaneously modeling spatial dependence, temporal dependence, node heterogeneity, and periodic changes.
[0003] Existing spatiotemporal sequence prediction methods can be broadly categorized as follows. The first category is prediction methods based on spatiotemporal graph neural networks. These methods typically model sensors or regions as graph nodes, and road connections, distance relationships, or correlations obtained through adaptive learning as graph edges. They then combine recurrent neural networks, temporal convolutional networks, or attention mechanisms for multi-step prediction. For example, DCRNN models traffic dynamics as a diffusion process on a directed graph and combines it with a recurrent network for sequence-to-sequence prediction; STGCN combines graph convolution with temporal convolution to capture spatial propagation and temporal evolution; Graph WaveNet learns latent spatial dependencies through an adaptive adjacency matrix and uses dilated temporal convolution to model temporal relationships; AGCRN further introduces node-adaptive graph structures and node-adaptive parameters to enhance the characterization of node heterogeneity. The basic implementation process of this type of method typically includes: constructing or learning a spatial graph structure, inputting historical spatiotemporal observations into the neural network, extracting spatial features through graph convolution or graph propagation modules, extracting temporal features through recurrent, convolutional, or attention modules, and finally directly outputting the predicted values for each future node.
[0004] The second category of methods primarily utilizes temporal context, periodic patterns, or spatiotemporal embeddings to enhance the prediction model. Since traffic and urban sensing data generally exhibit clear daily and weekly cycles, some methods input recent patterns, daily cycles, and weekly cycles into the model separately, or encode information such as time location, date type, and node identity into embedding vectors. For example, ASTGCN models recent, daily, and weekly dependencies separately; STID uses spatial and temporal identity information to construct a simple yet effective multivariate time series prediction model; and STAEformer utilizes spatiotemporal adaptive embeddings to enhance the expressive power of the Transformer in traffic prediction. A common implementation of this type of method is to use time periods, days of the week, node numbers, or other contextual information as input features or latent spatial embeddings, inputting them along with historical observations into the neural prediction model to help the model identify prediction patterns under different times and spatial locations.
[0005] The third category of methods attempts to mitigate the heterogeneity of spatiotemporal data through decomposition, decoupling, normalization, or frequency domain modeling. These methods assume that traffic spatiotemporal signals are not a single homogeneous process, but rather contain various factors such as trends, periods, diffusion, inherent variations, frequency components, or normalized statistics. For example, D2STGNN decouples traffic signals into diffuse and inherent signals; STWave separates and models traffic signals using wavelet or spectral correlation mechanisms; STDN introduces trend-seasonal decomposition to characterize traffic flow changes; and methods such as ST-Norm, RevIN, and DLinear improve time series prediction from the perspectives of normalization, reversible statistical transformation, or simple decomposition. These methods typically decompose or normalize the signal within the input space, latent representation space, or model structure, and then output the final prediction result through a neural network.
[0006] While the aforementioned methods have made significant progress in prediction accuracy, existing schemes still generally adopt the paradigm of "direct prediction of raw values," which directly uses future real observations as the supervision target, with the neural network outputting the future raw sequence end-to-end from historical inputs. Under this paradigm, the model needs to simultaneously recover two types of information with different properties in the same target space: one is a stable recurring pattern determined by temporal context and spatial entities, such as the typical flow level of a sensor at a specific time and week; the other is a sample-specific bias caused by recent states, local perturbations, sensor anomalies, spatial propagation, and random noise. Stable recurring patterns can usually be summarized by long-term statistical regularities in historical training data, while sample-specific biases need to be dynamically inferred based on the current historical window. Existing direct prediction methods mix these two in the same prediction target, easily leading to repeated learning and reconstruction of already relatively stable periodic patterns by the model, thus increasing the online prediction burden and potentially weakening the model's robustness to real-world deployment scenarios such as long prediction steps, input delays, sensor failures, or calibration drift.
[0007] Furthermore, existing methods utilizing periodic information or temporal embeddings mostly treat daily periods, weekly periods, and node identities as input features or internal model representations, rather than explicitly constructing a frozen spatiotemporal pattern anchor point in the target space that is estimated from training data, queryable during prediction, and does not participate in gradient updates. Therefore, although these methods can utilize temporal context information, they usually still require the neural network to directly output complete future observations, and have not yet fully distinguished between the "stable part that can be summarized offline from historical statistical patterns" and the "dynamic residual part that needs to be corrected online based on the current samples." Existing decomposition or normalization methods also mostly process signals at the input or implicit representation level, or transform them based on sample-level statistics, without constructing a fixed anchor point buffer for the node-specific periodicity in graph-structured spatiotemporal sequence prediction, nor forming a prediction process that combines offline pattern summarization with online residual correction.
[0008] Therefore, existing technologies still have the following shortcomings: First, directly predicting the original future sequence will mix stable spatiotemporal patterns and dynamic residual biases, increasing the difficulty of model learning; Second, periodicity and node heterogeneity are usually used as input features or embedded information, lacking a frozen anchor representation oriented towards the target space; Third, existing models usually rely on complex neural structures to generate complete prediction results during the online inference stage, resulting in high computational overhead; Fourth, in practical deployment scenarios such as observation delays, sensor failures, and calibration drift, prediction models that rely entirely on current historical observations may be sensitive to input perturbations; Fifth, in long prediction step scenarios, there is a lack of a unified mechanism that can provide a stable reference for each future time step and perform residual correction based on this. Summary of the Invention
[0009] To address the aforementioned technical challenges, this invention proposes a spatiotemporal sequence prediction method and apparatus based on frozen spatiotemporal pattern anchors. This method is designed for graph-structured spatiotemporal sequence data such as traffic sensor networks, urban sensing networks, environmental monitoring networks, and energy monitoring networks. The core idea is to first construct frozen spatiotemporal pattern anchors offline based on training data, representing specific recurring spatiotemporal patterns of nodes. During the prediction phase, the corresponding future anchors are queried using available future time indication information. Then, the anchors are corrected through spatial pattern bias correction and temporal dynamic residual correction, ultimately yielding the predicted future spatiotemporal sequence.
[0010] In other words, this invention transforms the spatiotemporal sequence prediction process from "directly predicting future raw values" to "freezing anchor point querying and residual correction." Specifically, freezing the spatiotemporal model anchor point provides a stable, queryable, and lightweight future reference; spatial model bias correction corrects stable biases caused by finite sample statistics and spatial heterogeneity of the graph structure; and temporal dynamic residual correction predicts sample-specific dynamic deviations based on the current historical observation window. The final predicted value is obtained by adding the frozen spatiotemporal model anchor point, the spatial model bias correction, and the temporal dynamic residual correction.
[0011] The specific technical solution is as follows:
[0012] A spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors includes the following steps:
[0013] Acquire spatiotemporal sequence data of graph structure and perform preprocessing, including: acquiring the observation values of spatial entities at time steps and the spatial graph structure, and extracting time indication information based on the time steps; forming spatiotemporal sequence data of graph structure using the observation values; and dividing the data into training set, validation set and test set according to time order.
[0014] Construct frozen spatiotemporal pattern anchor points and frozen spatiotemporal pattern anchor buffers based on the training set;
[0015] Based on historical and future time indicators, query the corresponding frozen spatiotemporal pattern anchor point to obtain the historical frozen anchor point and the future frozen anchor point;
[0016] The spatial model deviation correction is calculated based on the frozen spatiotemporal model anchor point buffer and the spatial graph structure. Using the frozen spatiotemporal model anchor point buffer and the spatial graph structure as input, the frozen spatiotemporal model anchor point buffer is corrected, and the corrected anchor point buffer is subtracted from the original frozen spatiotemporal model anchor point buffer to obtain the spatial model deviation correction buffer. The future spatial model deviation correction is retrieved from this buffer based on future time indication information, and the historical spatial model deviation correction is retrieved based on historical time indication information. The historical frozen anchor point is added to the historical spatial model deviation correction to obtain the historical correction anchor point reference, and the future frozen anchor point is added to the future spatial model deviation correction to obtain the future correction anchor point reference.
[0017] The dynamic residual correction amount is calculated based on historical observations and historical correction anchor points;
[0018] The prediction result is obtained by adding the future frozen anchor point, the future space model bias correction, and the time dynamic residual correction.
[0019] A spatiotemporal sequence prediction device based on frozen spatiotemporal pattern anchors includes the following modules:
[0020] The preprocessing module acquires and preprocesses graph-structured spatiotemporal sequence data, including: acquiring observations of spatial entities at time steps and the spatial graph structure, and extracting time indication information based on the time steps; forming graph-structured spatiotemporal sequence data using the observations; and dividing the data into training, validation, and test sets according to time order.
[0021] Anchor point construction module, which constructs frozen spatiotemporal pattern anchor points and frozen spatiotemporal pattern anchor point buffers based on the training set;
[0022] The query module queries the corresponding frozen anchor points based on historical and future time indicators, and obtains the historical frozen anchor points and future frozen anchor points;
[0023] The correction calculation module calculates the spatial model deviation correction based on the frozen spatiotemporal model anchor point buffer and the spatial graph structure. Using the frozen spatiotemporal model anchor point buffer and the spatial graph structure as input, it corrects the frozen spatiotemporal model anchor point buffer and subtracts the corrected buffer from the original to obtain the spatial model deviation correction buffer. It then queries the future spatial model deviation correction from this buffer based on future time indication information and queries the historical spatial model deviation correction based on historical time indication information. Finally, it adds the historical frozen anchor point to the historical spatial model deviation correction to obtain the historical correction anchor point reference, and adds the future frozen anchor point to the future spatial model deviation correction to obtain the future correction anchor point reference.
[0024] The residual calculation module uses historical observations and historical correction anchor points as references to calculate dynamic residual correction amounts over time.
[0025] The structural prediction module adds the future frozen anchor point, the future spatial pattern deviation correction, and the time dynamic residual correction to obtain the prediction result.
[0026] An electronic device includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors.
[0027] A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to implement the spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors.
[0028] The present invention has the following beneficial effects:
[0029] (1) Freezing the anchor point level of the spacetime pattern:
[0030] Technical aspect: This application constructs node-specific frozen spatiotemporal pattern anchors based on training data, and queries the corresponding future anchors through future available time indication information.
[0031] Effect: It can explicitly separate stable recurring patterns such as intraday and intraweek patterns from the prediction target, providing a stable and data-leakage-free prediction reference for each future prediction step, and reducing the model's repeated learning of stable cyclical patterns.
[0032] (2) Spatial mode bias correction aspect:
[0033] Technical aspect: This application introduces a spatial mode bias correction branch with invariant samples based on the frozen anchor point, and combines the spatial graph structure to correct the stability bias under different node and time modes.
[0034] Effect: It can alleviate the statistical bias of anchor points caused by limited training samples, node heterogeneity and graph structure correlation, so that the frozen anchor points are not just simple historical averages, but spatial pattern references constrained by graph structure.
[0035] (3) Time-dynamic residual correction level:
[0036] Technical aspect: This application constructs the historical context of anchor conditions based on historical observations, historical anchor references, and historical anchor residuals, and predicts the dynamic residuals specific to future samples.
[0037] Effects: It can focus on modeling dynamic changes such as recent state, short-term disturbances, local propagation, observation anomalies and noise, so that the model no longer generates a complete future sequence from scratch, but learns residual corrections near stable anchor points.
[0038] (4) Overall prediction framework level:
[0039] Technical aspect: This application reconstructs future prediction results into "future frozen spatiotemporal model anchor point + spatial model bias correction amount + temporal dynamic residual correction amount".
[0040] Results: Compared with existing end-to-end direct prediction methods, this application can more clearly distinguish between stable patterns, spatial biases and dynamic perturbations, which is beneficial to improving prediction accuracy, robustness and inference efficiency in scenarios with long prediction steps, input anomalies and online deployment. Attached Figure Description
[0041] Figure 1 This is an overall flowchart of the spatiotemporal sequence prediction method of the present invention;
[0042] Figure 2 for Figure 1 Detailed flowchart of steps S102 to S103;
[0043] Figure 3 for Figure 1 Detailed flowchart of steps S104 to S106. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above objectives, this invention adopts the following technical solution.
[0045] like Figure 1 As shown, this invention proposes a spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors, comprising the following six steps:
[0046] Step S101: Obtain the spatiotemporal sequence data of the graph structure and complete the preprocessing;
[0047] Step S102: Construct and freeze the spatiotemporal pattern anchor buffer based solely on the training set;
[0048] Step S103: Query the corresponding frozen anchor point based on historical and future time indications;
[0049] Step S104: Calculate the spatial mode deviation correction amount based on the frozen anchor point buffer and the spatial map;
[0050] Step S105: Calculate the dynamic residual correction amount based on historical observations and historical correction anchor points;
[0051] Step S106: Add the future frozen anchor point, spatial mode bias correction amount, and temporal dynamic residual correction amount to obtain the prediction result.
[0052] Step S101: Obtain spatiotemporal sequence data of graph structure and complete preprocessing, including:
[0053] First, graph-structured spatiotemporal sequence data is acquired. This data comprises observations of multiple spatial entities at consecutive time steps. Spatial entities can be traffic sensors, road cross-sections, urban areas, monitoring stations, power nodes, or other spatially related observation units. Each spatial entity can contain one or more observation features at each time step, including at least the target variable to be predicted. For example, in a traffic prediction scenario, the target variable could be traffic flow, traffic speed, road occupancy, etc.; in an environmental monitoring scenario, the target variable could be air quality indicators, temperature, humidity, etc.
[0054] Simultaneously, spatial association information between spatial entities is acquired, and a spatial graph structure is constructed accordingly. The spatial graph structure can be constructed based on road topology, physical distances between sensors, regional adjacency relationships, historical correlations, or manually given connection relationships. The spatial graph structure is used to describe the spatial dependencies between different spatial entities and can be represented as an adjacency matrix, distance matrix, connectivity matrix, or a normalized graph propagation matrix.
[0055] In step S101, the original spatiotemporal observation data undergoes time alignment and formatting. Specifically, the observation records of different spatial entities are aligned according to a uniform time interval to form a multi-node spatiotemporal sequence with consistent time steps. For data with a fixed sampling interval, such as traffic sensor data sampled every 5 minutes, each day can be divided into a fixed number of time slots; if the original data contains missing timestamps, duplicate records, or out-of-order records, it is first sorted, deduplicated, and time-aligned.
[0056] During preprocessing, missing and invalid values also need to be addressed. For missing or invalid observations, a valid value mask can be constructed to exclude invalid locations in the training loss and evaluation metrics. Different processing strategies can be adopted for different data types. For example, in traffic flow data, zero flow may represent a true valid observation and should be retained as a valid value; in traffic speed data, zero speed readings may represent missing or anomalies and can be excluded through masking. For general spatiotemporal series data, missing values can also be processed by interpolation, forward imputation, mean imputation, or direct masking according to business rules.
[0057] Furthermore, the data is divided into training, validation, and test sets in chronological order. This division should maintain chronological order to prevent future data leakage into the training phase. Statistics such as mean, standard deviation, maximum, and minimum values required for data standardization or normalization are calculated only from the training set and applied to the training, validation, and test sets. This ensures that the model training and testing processes conform to real-world prediction scenarios.
[0058] Simultaneously, time indication information is extracted based on the timestamp of each time step. This time indication information includes, but is not limited to, time period indices, weekday indices, weekday / weekend identifiers, holiday identifiers, season identifiers, weather categories, or other contextual information obtainable in advance during forecasting. Specifically, the time period indices and weekday indices are used to construct anchor points for the frozen spatiotemporal model; other time indication information can serve as auxiliary input for the time dynamic residual correction branch.
[0059] Finally, supervised learning samples are constructed based on the preprocessed spatiotemporal sequences. For each prediction starting point, the observations of the preceding L consecutive time steps are taken as the historical input window, and the target variable of the following H consecutive time steps is taken as the prediction target. Historical time indication information and future time indication information are retained. Thus, each sample contains historical observation window, future prediction target, historical time context, future time context, and spatial graph structure information.
[0060] Step S102: Construct and freeze the spatiotemporal pattern anchor buffer based solely on the training set, including:
[0061] After data preprocessing, frozen spatiotemporal pattern anchors are constructed using only the target variables from the training set. These anchors characterize the typical observation level of a spatial entity within a specific temporal context, reflecting stable and recurring spatiotemporal patterns in the training data.
[0062] Let the first A spatial entity at time step The target observation value is The index of the time period within a day corresponding to time step t is The weekday index is .
[0063] First, construct node-specific intraday pattern anchor points. For spatial entities and intraday time period Filter all intraday time period indices from the training set equal to The time steps, and calculate the spatial entities at these time steps. The mean of the target variable is used to obtain the intraday pattern anchor point:
[0064] ;
[0065] in, This indicates that the index of all intraday time periods in the training set is... The time step set. This intraday pattern anchor point is used to represent the typical changing patterns of spatial entities at different times of the day.
[0066] Then, node-specific intra-week residual pattern anchor points are constructed. For spatial entities Intraday time period and weekday index Filter from the training set all data that simultaneously satisfy the intraday time period index. Weekday index is Time steps, calculate spatial entities at these time steps The target variable mean is calculated, and the corresponding intraday model anchor point is subtracted to obtain the weekly residual model anchor point:
[0067] ;
[0068] in, This indicates that the training set also contains intraday time period indexes. and weekday index The time step set. The intra-week residual pattern anchor points are used to characterize the additional offset of different weekdays or date types relative to the intra-day pattern.
[0069] Finally, the intraday model anchor point and the intraweek residual model anchor point are added together to obtain the frozen spatiotemporal model anchor point:
[0070] ;
[0071] The anchor point of this frozen spacetime mode can be understood as a spatial entity. In the context of time The above anchor points are statistical reference values for the training set. After the above anchor points are constructed, they are stored in the form of a fixed statistical buffer. In the subsequent model training and prediction process, these anchor points do not participate in gradient updates, are not used as learnable parameters, but serve as a stable spatiotemporal pattern reference obtained offline from the training data.
[0072] like Figure 2 As shown, Figure 2 for Figure 1 The detailed flowcharts for steps S102 and S103 are as follows: S201, obtaining the target value, node index, and time index of the training set; S202, grouping by node, intraday time period, and weekday index; S203, statistically analyzing intraday pattern anchor points by group; S204, statistically analyzing intraweek residual pattern anchor points based on intraday pattern anchor points; S205, synthesizing the two types of anchor points and writing them into the frozen anchor point buffer; S206, querying the corresponding frozen anchor points based on historical and future time indicators.
[0073] In other alternative implementations, the statistical method for freezing spatiotemporal pattern anchors is not limited to the mean, but can also use the median, truncated mean, weighted mean, exponential moving average or other robust statistical methods; the time context is not limited to intraday time periods and weekday indexes, but can also include contextual information that can be obtained during prediction, such as holidays, seasons, weather, event types, etc.
[0074] When the number of training samples for a certain node and time context combination is less than the preset threshold, the corresponding intraday pattern anchor, adjacent time period anchor, or global statistical value can be used to supplement it according to the preset rollback rules.
[0075] Step S103: Query the corresponding frozen anchor point based on historical and future time indications, including:
[0076] During the model training or prediction phase, for each sample, the corresponding anchor point is queried from the frozen spatiotemporal pattern anchor point buffer based on its historical time indication information and future time indication information.
[0077] For the historical input window, it corresponds to the historical time step. and Query historical frozen anchor points:
[0078] ;
[0079] For future forecast windows, based on the corresponding future time steps and Query future frozen anchor points:
[0080] ;
[0081] Among them, historical frozen anchor points Used to construct historical residual states and future frozen anchor points. It is used as a basic reference for predictive reconstruction. Since future time indication information can be obtained in advance during prediction, such as future time periods and weekday information being calendar information, future anchor point queries do not need to access future actual observations, thus avoiding data leakage.
[0082] Through this step, the present invention transforms the original task of directly predicting future raw values into the task of residual correction around the anchor point of the future frozen spatiotemporal pattern.
[0083] Step S104: Calculate the spatial mode bias correction based on the frozen anchor point buffer and the spatial map, including:
[0084] While freezing spatiotemporal pattern anchors can summarize stable and recurring patterns in the training data, systematic biases may still exist due to the limited training samples, fixed time slot divisions, and graph-structure correlations between spatial entities. For example, some spatial entities may be consistently underestimated or overestimated by anchors under specific temporal patterns, and similar bias patterns may exist between adjacent or related nodes in the graph structure. To address this, this invention constructs a spatial pattern bias correction branch to learn a spatial pattern bias correction amount that remains constant across samples.
[0085] The spatial model bias correction branch takes the frozen anchor buffer and spatial map structure as input and does not access the historical observation window of the current sample. Therefore, the correction output by this branch is only related to the spatial entities, the temporal model, and the spatial map structure, and does not change with the historical observations of the current sample.
[0086] In one implementation, two non-shared spatial model bias correction sub-branches are constructed for the intraday model anchor point and the intraweek residual model anchor point, respectively. Let... This represents a certain type of frozen anchor buffer, where This can represent intraday pattern anchor points or intraweek residual pattern anchor points. First, the frozen anchor point buffer is enhanced:
[0087] ;
[0088] in, A learnable residual table is used to provide learnable corrections for each temporal pattern and spatial entity. For time pattern factor, These are node factors, and together they constitute a low-rank node-time pattern adaptation term. Used to control the strength of this adapter; It is a low-rank dimension.
[0089] Then, the enhanced anchor buffer Input the graph-aware correction function to obtain the corrected anchor buffer:
[0090] ;
[0091] in, This represents the adjacency matrix or graph propagation matrix corresponding to the spatial graph structure. This represents the graph-aware correction function. This function can include components such as graph propagation, node-dimensional projection, temporal pattern-dimensional self-attention, node-dimensional self-attention, and feature fusion layers, and can also be implemented using other graph neural networks, convolutional networks, or attention networks.
[0092] Then, the corrected anchor point buffer buffer zone with the original frozen anchor point Subtraction yields the spatial mode bias correction buffer:
[0093] ;
[0094] This subtraction operation causes the spatial pattern bias correction branch to learn the correction amount relative to the frozen anchor point, rather than directly generating a new learnable periodic template.
[0095] When predicting future time steps, the above method is used to correct the intraday spatial deviation buffer based on future time indication information. and intra-week spatial deviation correction buffer The corresponding correction amount is retrieved from the database, and the two are added together to obtain the future space mode bias correction amount:
[0096] ;
[0097] in, Indicates the next time step The intraday time period and weekday index are combined to obtain the intraday time pattern index.
[0098] Similarly, using the above method, the historical spatial model bias correction amount can be queried based on historical time indication information. Based on future time indication information, the future space model deviation correction amount can be queried. From this, we can obtain the historical correction anchor point references. and future correction anchor reference :
[0099] ;
[0100] ;
[0101] in, and These represent the frozen spatiotemporal pattern anchor points obtained by querying based on historical time indication information and future time indication information, respectively. Used to calculate the residuals of historical observations relative to the correction anchor point. Both are used for reconstructing the final prediction results. They are both obtained by adding the frozen anchor points for the corresponding time period to the corresponding spatial model bias correction.
[0102] Step S105: Calculate the time dynamic residual correction based on historical observations and historical correction anchor points, including:
[0103] Even after freezing anchor points and spatial model bias correction, future spatiotemporal sequences still exhibit sample-specific dynamic biases caused by factors such as recent states, short-term disturbances, anomalous changes, local propagation, and noise. These biases cannot be determined solely by fixing anchor points or using spatial corrections that do not change the samples. Therefore, this application constructs a temporal dynamic residual correction branch to predict the dynamic residual correction amounts for each future time step based on the current historical observation window.
[0104] First, calculate the historical anchor point residuals based on the historical correction anchor point references. :
[0105] ;
[0106] in, This represents the observed values of the target variable in the history window. This represents the historical correction anchor reference. The historical anchor residual indicates the degree of deviation of the current sample's historical observations from the stable spatiotemporal model reference.
[0107] Then, construct the anchor condition history context:
[0108] ;
[0109] This context contains three types of information: the target variable observations in the history window. Historical anchor point residuals and historical correction anchor reference In this way, the time-dynamic residual correction branch can clarify the direction and extent to which the current sample deviates from the stable pattern, while understanding the changes in the current actual observations.
[0110] Furthermore, to avoid the time-dynamic residual correction branch completely degenerating into prediction based directly on the original historical observations, this application constructs anchor point coordinate input:
[0111] ;
[0112] in, This represents the input of anchor point conditions after integrating stable anchor point references and historical dynamic residual information. This represents the gating coefficient, used to control the strength of injecting historical residual information into the model. This represents element-wise multiplication. The expression can also be written as:
[0113] ;
[0114] when When the value is smaller, the model input is closer to the stable anchor reference; when When the value is large, the model input contains more real historical observation information. This gated anchor point coordinate representation can balance between stable model reference and recent observational changes, allowing the time dynamic residual correction branch to focus on learning the dynamic bias around the anchor point.
[0115] Subsequently, the anchor point condition historical context, spatial graph structure, and future time indication information are input into the time dynamic residual correction function:
[0116] ;
[0117] in, This represents the dynamic residual correction amount for each prediction step and each spatial entity in the future. Representing the spatial diagram structure, This indicates future time information. The time-based dynamic residual correction function can be implemented using causal temporal convolution, dilated temporal convolution, recurrent neural networks, attention networks, Transformers, graph propagation networks, or combinations thereof. In one implementation, this branch first extracts historical dynamic residual features through a causal temporal encoder, then models spatial propagation relationships using a graph propagation module, and finally outputs the dynamic residual correction amount for each future time step through a multi-step predictive decoder.
[0118] Step S106: Add the future frozen anchor point, spatial model bias correction, and temporal dynamic residual correction to obtain the prediction result, including:
[0119] For each time step in the future forecast window and every spatial entity The final predicted value is obtained by adding the future frozen spatiotemporal model anchor point, the future spatial model bias correction, and the time dynamic residual correction.
[0120] ;
[0121] in, This represents the anchor point of the frozen spatiotemporal pattern obtained from the query of future time indication information. This represents the spatial pattern bias correction amount, which is constant for the sample. This represents the dynamic residual correction amount for a specific time period of the sample, predicted from the current historical window.
[0122] This predictive reconstruction method allows the neural network to correct residuals based on a stable spatiotemporal pattern reference obtained from training data, rather than reconstructing the complete future sequence from scratch. As a result, the model can learn more effectively short-term dynamic biases, anomalous perturbations, and spatial propagation changes.
[0123] like Figure 3 As shown, Figure 3 for Figure 1 Detailed flowchart of steps S104 to S106: Step 301: Obtain the historical anchor points and future anchor points output in step 103, as well as the spatial map, historical observation window, and future time indication. In step S302: Calculate the spatial model bias correction based on the frozen anchor point buffer and the spatial map, and form historical correction anchor point references and future correction anchor point references accordingly. In step S303: Calculate the time dynamic residual correction based on the historical observation window and the historical correction anchor point references. In step S304: Add the future frozen anchor points, future spatial model bias correction, and time dynamic residual correction to obtain the prediction result. Therefore, step S105 uses the historical correction anchor point references formed in the previous step as input, and the two are sequentially connected.
[0124] The model training and optimization of the present invention (corresponding to the parameter training of the learnable correction branch in steps S104 and S105)
[0125] During model training, the frozen spatiotemporal model anchor points remain fixed and are not updated via gradient descent. Learnable parameters primarily include those in the spatial model bias correction branch and the temporal dynamic residual correction branch. The model uses only the error between the final reconstructed prediction and the actual future observations as the supervision signal; no independent supervision targets are set for the frozen anchor points, spatial bias corrections, or temporal dynamic residual corrections.
[0126] In one implementation, the masked mean absolute error is used as the primary loss function:
[0127] ;
[0128] in, This represents the future sequence predicted by the model. Represents the true future sequence. This represents the valid value mask. This mask is used to exclude missing or invalid observation locations.
[0129] Furthermore, to enhance the consistency of the fluctuation patterns of the predicted sequence over future time dimensions, a frequency domain amplitude consistency loss can be introduced between the final predicted sequence and the actual future sequence. Specifically, a real-valued Fast Fourier Transform is performed on the predicted sequence and the actual sequence along the prediction step dimension. The frequency domain representation is obtained as follows:
[0130] ;
[0131] Then, the consistency of their spectral amplitudes is constrained:
[0132] ;
[0133] Where B represents the batch size, N represents the number of spatial entities, and K represents the number of non-negative frequency components. The final loss function can be expressed as:
[0134] ,
[0135] in, This is the frequency domain loss weight. This frequency domain loss is applied to the final reconstructed prediction result to enhance the morphological consistency of the predicted trajectory, but it does not provide individual supervision for each component branch.
[0136] The prediction process of this invention includes (an explanation of the execution of steps S103 to S106 in actual deployment):
[0137] In actual forecasting deployment, the following steps are first performed: First, the historical observation windows for the latest consecutive L time steps are obtained, and the time indication information for the next H time steps is also obtained. Then, step S103 is executed to query the historical frozen anchor points and the future frozen anchor points. Step S104 is executed to query or generate the historical space model bias correction and the future space model bias correction, forming historical correction anchor point references and future correction anchor point references. Step S105 is executed to predict the time dynamic residual correction using the current historical observation windows and the historical correction anchor point references. Finally, step S106 is executed to add the future frozen anchor points, the future space model bias correction, and the time dynamic residual correction to obtain the forecast results for the next H time steps.
[0138] Since frozen spatiotemporal model anchors and spatial model bias correction buffers can be pre-built and stored, the prediction phase only requires table lookup operations based on future time indication information and processing of the current historical window through a time dynamic residual correction branch. This reduces the computational burden of the online prediction phase. Even if current historical observations are affected by delays, partial sensor failures, or calibration offsets, future anchors can still provide a stable time model reference, thereby improving prediction robustness.
[0139] This invention offers the following alternative methods: without altering the overall concept of "frozen anchor point query + residual correction," the anchor point statistics can employ the mean, median, truncated mean, weighted mean, or exponential moving average; the time context can include intraday time periods, weekdays, holidays, seasons, weather, or event types; the spatial graph structure can be obtained from physical topology, distance relationships, regional adjacency, historical correlation, or adaptive learning; and the residual correction module can be implemented using graph neural networks, temporal convolutional networks, recurrent networks, attention networks, Transformers, frequency domain networks, or combinations thereof.
[0140] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchor points, characterized in that, Includes the following steps: Acquire spatiotemporal sequence data of graph structure and perform preprocessing, including: acquiring the observation values of spatial entities at time steps and the spatial graph structure, and extracting time indication information based on the time steps; forming spatiotemporal sequence data of graph structure using the observation values; and dividing the data into training set, validation set and test set according to time order. Construct frozen spatiotemporal pattern anchor points and frozen spatiotemporal pattern anchor buffers based on the training set; Based on historical and future time indicators, query the corresponding frozen spatiotemporal pattern anchor point to obtain the historical frozen anchor point and the future frozen anchor point; The spatial model deviation correction is calculated based on the frozen spatiotemporal model anchor point buffer and the spatial graph structure. Using the frozen spatiotemporal model anchor point buffer and the spatial graph structure as input, the frozen spatiotemporal model anchor point buffer is corrected, and the corrected anchor point buffer is subtracted from the original frozen spatiotemporal model anchor point buffer to obtain the spatial model deviation correction buffer. The future spatial model deviation correction is retrieved from this buffer based on future time indication information, and the historical spatial model deviation correction is retrieved based on historical time indication information. The historical frozen anchor point is added to the historical spatial model deviation correction to obtain the historical correction anchor point reference, and the future frozen anchor point is added to the future spatial model deviation correction to obtain the future correction anchor point reference. The dynamic residual correction amount is calculated based on historical observations and historical correction anchor points; The prediction result is obtained by adding the future frozen anchor point, the future space model bias correction, and the time dynamic residual correction.
2. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchor points according to claim 1, characterized in that, The method for constructing the frozen spatiotemporal pattern anchor point is as follows: construct the intraday pattern anchor point and the intraweek residual pattern anchor point of the node; add the two together to obtain the frozen anchor point.
3. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchor points according to claim 2, characterized in that, Correcting the frozen spatiotemporal pattern anchor point buffer includes: Two spatial model bias correction sub-branches with non-shared parameters are constructed for intraday model anchor points and intraweek residual model anchor points respectively. For each type of frozen spatiotemporal model anchor point buffer, an enhancement process is first performed, which includes superimposing a learnable residual table and a low-rank node-time model adaptation term. Then, the enhanced anchor point buffer is input into the graph-aware correction function to obtain the corrected anchor buffer.
4. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors according to claim 1, characterized in that, The specific method for calculating the time dynamic residual correction is as follows: calculate the historical anchor point residual based on the historical correction anchor point reference, construct an anchor point condition historical context that includes historical observations, historical anchor point residuals, and historical correction anchor point references, and predict the time dynamic residual correction based on the anchor point condition historical context, spatial graph structure, and future time indication information.
5. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors according to claim 1, characterized in that, Spatial entities include traffic sensors, road cross-sections, urban areas, monitoring stations, power nodes, or other observation units with spatial relationships.
6. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors according to claim 1, characterized in that, Each spatial entity contains one or more observed features at each time step, including at least the target variable to be predicted.
7. The spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors according to claim 1, characterized in that, Time indication information includes time period indexes within a day, weekday indexes, weekday or weekend identifiers, holiday identifiers, season identifiers, weather categories, or other contextual information that can be obtained in advance for forecasting.
8. A spatiotemporal sequence prediction device based on frozen spatiotemporal pattern anchor points, characterized in that, Includes the following modules: The preprocessing module acquires and preprocesses graph-structured spatiotemporal sequence data, including: acquiring observations of spatial entities at time steps and the spatial graph structure, and extracting time indication information based on the time steps; forming graph-structured spatiotemporal sequence data using the observations; and dividing the data into training, validation, and test sets according to time order. Anchor point construction module, which constructs frozen spatiotemporal pattern anchor points and frozen spatiotemporal pattern anchor point buffers based on the training set; The query module queries the corresponding frozen anchor points based on historical and future time indicators, and obtains the historical frozen anchor points and future frozen anchor points; The correction calculation module calculates the spatial model deviation correction based on the frozen spatiotemporal model anchor point buffer and the spatial graph structure. Using the frozen spatiotemporal model anchor point buffer and the spatial graph structure as input, it corrects the frozen spatiotemporal model anchor point buffer and subtracts the corrected buffer from the original to obtain the spatial model deviation correction buffer. It then queries the future spatial model deviation correction from this buffer based on future time indication information and queries the historical spatial model deviation correction based on historical time indication information. Finally, it adds the historical frozen anchor point to the historical spatial model deviation correction to obtain the historical correction anchor point reference, and adds the future frozen anchor point to the future spatial model deviation correction to obtain the future correction anchor point reference. The residual calculation module uses historical observations and historical correction anchor points as references to calculate dynamic residual correction amounts over time. The structural prediction module adds the future frozen anchor point, the future spatial pattern deviation correction, and the time dynamic residual correction to obtain the prediction result.
9. An electronic device, characterized in that, include: One or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, cause the processor to implement the spatiotemporal sequence prediction method based on frozen spatiotemporal pattern anchors as described in any one of claims 1 to 7.