Space-time prediction method and system based on meta-pattern mining and prompt guidance

By constructing a spatiotemporal prediction method based on meta-mode mining and prompt guidance, the spatial and temporal heterogeneity is captured and the modeling process is guided, and the existing methods predict performance degradation in heterogeneity scenarios is solved, achieving efficient and accurate traffic prediction.

CN120596833APending Publication Date: 2025-09-05BEIHANG UNIV +2

Patent Information

Application Number
CN202510686305.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

When existing spatiotemporal prediction methods deal with highly heterogeneous spatiotemporal scenarios, it is difficult to effectively capture local differences and dynamic changes, resulting in degradation of prediction performance, and problems such as difficulty in optimization and high resource consumption.

Method used

Through the method based on meta-mode mining and prompt guidance, a flexible space-time prompt generation module is built, combined with self-supervised learning tasks, the space-time heterogeneity is captured, and the model is carried out through the space-time prompt guidance model to overcome the interference of space-time heterogeneity.

Benefits of technology

It realizes efficient, accurate and comprehensive spatial and temporal prediction of highly heterogeneous scenarios in traffic prediction, and can effectively respond to emergencies and dynamic changes in road networks, reduce prediction deviations, and improve the robustness and adaptability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596833A_ABST
    Figure CN120596833A_ABST
Patent Text Reader

Abstract

The invention relates to a spatio-temporal prediction method and system based on meta-pattern mining and prompt guidance, belongs to the technical field of spatio-temporal data mining, solves the problem of inaccurate prediction of a complex scene with high spatio-temporal heterogeneity in the prior art, and comprises the following steps: S1, collecting historical spatio-temporal data in a to-be-predicted spatial region, performing standardization processing on the historical spatio-temporal data to obtain a standard data set; s2, constructing a prediction model based on meta-mode mining and prompt guidance, wherein the prediction model comprises an encoder, a decoder, a self-supervision meta-mode mining module, a space-time prompt generation module and a space-time prompt guidance module; s3, training the constructed prediction model based on meta-pattern mining and prompt guidance by using a standard data set to obtain a trained prediction model; and S4, applying the trained prediction model to prediction of future spatio-temporal data to obtain a spatio-temporal prediction result of the future traffic road speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of spatiotemporal data mining, and in particular to a spatiotemporal prediction method and system based on meta-pattern mining and prompt guidance. Background Art

[0002] The goal of spatiotemporal forecasting is to predict future trends in specific spatiotemporal dimensions by analyzing and modeling historical spatiotemporal data. Accurate future trend predictions can provide a scientific basis for various decision-making processes, promoting the optimization of social management and resource allocation. Therefore, spatiotemporal forecasting has important application value in the field of traffic forecasting and has garnered widespread attention in recent years.

[0003] Existing spatiotemporal prediction methods for road traffic typically model the spatial characteristics of spatiotemporal data as a graph structure, where nodes and edges represent spatial units and their interdependencies, respectively. Temporal characteristics are modeled as time series of nodes on the graph, capturing spatiotemporal correlations using a spatiotemporal graph network. However, these methods often focus too much on global average characteristics, assuming that pattern variations are uniform across all spatial regions or time periods. This ignores the inherent heterogeneity in spatiotemporal data, namely, the differences and inhomogeneities in data distribution and patterns across different spatial regions or time periods. For example, traffic flow distributions differ significantly between city centers and suburbs due to factors such as geographic location, population density, and transportation infrastructure, reflecting spatial heterogeneity. Traffic flow in the same region also exhibits different patterns during peak and off-peak hours, reflecting temporal heterogeneity. Therefore, although existing methods may exhibit good predictive ability at the macro level after averaging over large datasets, their neglect of spatiotemporal heterogeneity makes it difficult to effectively capture local variations and dynamic changes in spatiotemporal patterns, resulting in significantly reduced prediction performance in highly heterogeneous spatiotemporal scenarios.

[0004] In recent years, several heterogeneity modeling methods have been proposed to fully exploit the inherent heterogeneity in spatiotemporal data. The AGCRN model captures spatial heterogeneity by assigning an independent parameter space to each spatial region, but its large number of parameters can lead to optimization difficulties and overfitting. The DMSTGCN model captures temporal heterogeneity by establishing independent adjacency matrices for different time periods. However, it can only model differences within a fixed time period and cannot effectively capture multi-scale temporal heterogeneity. The MegaCRN model captures spatiotemporal heterogeneity by building a meta-node library to learn a spatiotemporal graph. However, its use of a single meta-node library to simultaneously process both temporal and spatial dimensions can easily lead to feature averaging, which weakens the modeling power of a single feature. The STSSL model captures spatiotemporal heterogeneity by designing additional self-supervised learning tasks, but its fully end-to-end joint optimization poses challenges for spatiotemporal prediction. The HimNet model captures heterogeneity through spatiotemporal embeddings and uses embedding queries to find the most appropriate modeling parameters. However, its parameter count increases exponentially with the complexity of the spatiotemporal model, resulting in significant resource consumption and hindering its widespread application in large-scale spatiotemporal scenarios. Therefore, existing spatiotemporal prediction methods still find it difficult to capture and utilize spatiotemporal heterogeneity in an efficient and comprehensive manner.

[0005] A Chinese patent application, publication number CN 111612243A, titled "Traffic Speed ​​Prediction Method, System, and Storage Medium," constructs two road network graphs to represent two spatial relationships and fuses them to generate a new zero-order matrix, representing the complex spatial relationships within the road network and reducing the complexity of multi-graph processing. However, this method only constructs spatial units based on nodes and edges and their interdependencies, and does not consider the impact of temporal heterogeneity on prediction results.

[0006] The Chinese patent application, publication number CN112183862A, titled "A method and system for predicting traffic flow in urban road networks," extracts local spatial features of traffic flow through a graph wavelet attention gated recurrent neural network model, and integrates time series vectors with local spatial features and an attention mechanism into the gated recurrent neural network. However, this method still does not consider spatiotemporal heterogeneity and has difficulty capturing local differences and dynamic changes in spatiotemporal patterns.

[0007] There is a need in the art for an improved spatiotemporal prediction method that can provide efficient, accurate, and comprehensive spatiotemporal predictions for complex scenarios with high spatiotemporal heterogeneity in traffic forecasting applications. Summary of the Invention

[0008] In view of the above problems, the present invention provides a spatiotemporal prediction method and system based on meta-pattern mining and prompt guidance. It captures spatiotemporal heterogeneity through flexible spatiotemporal prompt generation, constructs an offline self-supervised learning task to mine meta-patterns to enhance spatiotemporal prompts, and finally uses spatiotemporal prompts to efficiently guide the spatiotemporal modeling process, thereby overcoming the interference of spatiotemporal heterogeneity and achieving accurate and robust prediction in traffic road prediction.

[0009] According to one embodiment of the present invention, a spatiotemporal prediction method based on meta-pattern mining and prompt guidance is provided for traffic road speed prediction, comprising the following steps: Step S1, collecting historical spatiotemporal data in the spatial area to be predicted, standardizing the historical spatiotemporal data to obtain a standard data set including historical spatiotemporal sequences, wherein the collected historical spatiotemporal data includes traffic road speed; Step S2: Construct a prediction model based on meta-pattern mining and prompt guidance, including an encoder, a decoder, a self-supervised meta-pattern mining module, a spatiotemporal prompt generation module, and a spatiotemporal prompt guidance module. The model encodes historical spatiotemporal sequences through graph convolutional networks and temporal convolutional networks to capture spatial and temporal dependencies, captures spatiotemporal heterogeneity by generating spatiotemporal prompts, and guides the spatiotemporal modeling process together with the offline mined meta-patterns to overcome the interference of spatiotemporal heterogeneity. Step S3, using a standard data set to train the constructed prediction model based on meta-pattern mining and prompt guidance to obtain a trained prediction model; Step S4: Apply the trained prediction model to the prediction of future spatiotemporal data to obtain spatiotemporal prediction results of future traffic road speeds, and use the spatiotemporal prediction results to plan dynamic traffic management.

[0010] Optionally, in step S1: the collected historical spatiotemporal data in the spatial area to be predicted are standardized, and the processing process is as follows: the spatial area to be predicted is divided into N sub-areas, and the historical spatiotemporal data of each time period in each sub-area are counted; the historical spatiotemporal data of each time period in each sub-area are input into a three-dimensional array in the format of B*T*N to obtain a standard data set including historical spatiotemporal sequences, where B represents the data batch, T represents the time series length, and N represents the number of spatial nodes. The standard data set contains traffic road speeds corresponding to each data batch, spatial node, and time step.

[0011] Optionally, step S2 specifically includes the following steps: Step S2.1, building the backbone network of the prediction model; Step S2.2: construct a self-supervised meta-pattern mining module, which mines discriminative meta-patterns in the feature space through self-supervised learning and stores them as a meta-pattern library. This is used to retrieve local trend information by inputting historical spatiotemporal sequences into the meta-pattern library. Step S2.3: Construct a spatiotemporal cue generation module to capture temporal heterogeneity through multi-scale temporal cue generation, capture spatial heterogeneity through semantic spatial cue generation, and fuse temporal and spatial cues through spatiotemporal interaction modeling to obtain comprehensive spatiotemporal cues. In step S2.4, a spatiotemporal cue guidance module is constructed to perform feature splicing on the meta-pattern and the fused spatiotemporal cue to obtain enhanced spatiotemporal cue. After inputting the cue into the encoder of the prediction model, the encoded spatiotemporal representation is cue-guided to overcome the interference of heterogeneity on spatiotemporal modeling.

[0012] Optionally, step S2.2 specifically includes the following steps: Step S2.2.1: Divide the historical spatiotemporal sequence in the standard dataset into several prediction segments and randomly shuffle them to form the original data, and map the original data from the data space to the feature space to obtain the mapped feature vectors; Step S2.2.2, mining meta-patterns in historical prediction segments based on a soft clustering process in the feature space, using a preset number of randomly initialized trainable parameters as prototypes to establish a meta-pattern library, which serves as cluster centers; Step S2.2.3, selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity, including selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity Select positive and negative sample pairs; Step S2.2.4, constructing a meta-pattern library, including calculating the multi-class cross entropy based on the sample-to-prototype assignment probabilities of the obtained feature vectors and the positive sample pair-to-prototype assignment probabilities of the selected samples, and using the multi-class cross entropy as the optimization target to construct the self-supervisory signal required for the self-supervised learning task; Step S2.2.5, construct the feature enhancement part and obtain the contrastive learning loss; Step S2.2.6, construct the prototype regularization part to obtain the uniform regularization loss and the distance regularization loss; Step S2.2.7, constructing a total loss-based optimization objective of the self-supervised meta-pattern mining module for performing self-supervised meta-pattern mining, the total loss includes contrastive learning loss, uniform regularization loss and distance regularization loss.

[0013] Optionally, step S2.2.5 specifically includes: Add random masks and Gaussian noise to the positive and negative sample pairs selected from the mapped feature vector to obtain the enhanced feature vector; Based on the obtained enhanced feature vector, a contrastive learning strategy is adopted for the positive and negative sample pairs selected from the mapped feature vector, which brings the positive sample pairs closer and pushes the negative sample pairs farther in the feature space, and obtains the contrastive learning loss.

[0014] Optionally, step S2.3 specifically includes: Step S2.3.1, construct the temporal cue generation part, which captures temporal heterogeneity by combining prior embeddings with memory networks and generates temporal cues through embedding queries; Step S2.3.2: Construct the spatial cue generation part, which captures spatial heterogeneity through adaptive spatial node embedding, and constructs a spatial adjacency matrix based on this to perform dependency modeling and representation learning, and fuses the representations to generate semantic spatial cues; In step S2.3.3, the spatiotemporal cue fusion part is constructed, and the complex interaction between the two is modeled using a learnable spatiotemporal interaction tensor. The spatiotemporal cue fusion process is regarded as the reverse process of tensor decomposition, and adaptive updates are achieved through backpropagation to obtain comprehensive spatiotemporal cues.

[0015] Optionally, step S2.4 specifically includes: Step S2.4.1: Input the historical spatiotemporal sequence into the meta-pattern library, perform meta-pattern query and fusion, and obtain the fused meta-pattern; Step S2.4.2, combining the fused spatiotemporal cue and the fused meta-pattern to enhance the spatiotemporal cue and obtain enhanced spatiotemporal cue; In step S2.4.3, the spatiotemporal cue tensor is flexibly mapped to the feature space of each layer of the perception adapter through the multi-layer perception adapter, and the spatiotemporal representation of each layer of the perception adapter after the spatiotemporal cue guidance is obtained through the Hadamard product operation.

[0016] According to another embodiment of the present invention, a spatiotemporal prediction system based on meta-pattern mining and prompt guidance is provided, comprising: The data collection and processing module collects historical spatiotemporal data in the spatial area to be predicted, performs standardization processing on the spatial area to be predicted, and obtains a standard data set including historical spatiotemporal sequences; A prediction model based on meta-pattern mining and cue guidance captures temporal and spatial heterogeneity by generating multi-scale temporal cues and semantic spatial cues, and integrates temporal and spatial cues through spatiotemporal interaction modeling to obtain comprehensive spatiotemporal cues, thereby guiding the spatiotemporal modeling process to overcome the interference of spatiotemporal heterogeneity. The training module uses a standard dataset to train the prediction model.

[0017] Optionally, meta-pattern mining and hint-guided predictive models include: The encoder and decoder capture spatiotemporal dependencies and generate spatiotemporal representations layer by layer through stacked graph convolutional networks and temporal convolutional networks; The self-supervised meta-pattern mining module mines discriminative meta-patterns in the feature space through self-supervised learning and stores them in a meta-pattern library. It then retrieves historical spatiotemporal sequences from the meta-pattern library to obtain local trend information to supplement spatiotemporal cues. The spatiotemporal cue generation module captures temporal heterogeneity through multi-scale temporal cue generation, captures spatial heterogeneity through semantic spatial cue generation, and fuses temporal and spatial cues to obtain comprehensive spatiotemporal cues through complex spatiotemporal interaction modeling; The spatiotemporal cue guidance module performs feature splicing on the meta-pattern and the generated spatiotemporal cue to obtain enhanced spatiotemporal cue. After inputting it into the encoder, it performs cue guidance on the encoded spatiotemporal representation to overcome the interference of heterogeneity on spatiotemporal modeling.

[0018] Compared with the prior art, the spatiotemporal prediction method and system based on meta-pattern mining and prompt guidance provided by the present invention provide spatiotemporal prediction of traffic road speed, and have at least the following beneficial effects.

[0019] 1) We capture spatiotemporal heterogeneity through flexible spatiotemporal cue generation, construct an offline self-supervised learning task to mine meta-patterns to enhance spatiotemporal cues, and ultimately use spatiotemporal cues to efficiently guide the spatiotemporal modeling process, thereby overcoming the interference of spatiotemporal heterogeneity in the field of traffic forecasting and achieving accurate and robust predictions.

[0020] 2) Through the self-supervised meta-pattern mining module, the problem of prediction failure caused by scarce samples in sudden traffic events such as accidents and traffic control is effectively improved. In addition, when migrating across city road networks, the cold start time can be reduced by reusing the historical meta-pattern library.

[0021] 3) The spatiotemporal cue generation module effectively addresses the impact of traditional graph convolution failures caused by the spatiotemporal nonlinear propagation of traffic conditions, such as the ripple effect of congestion, and dynamic changes in road networks, such as temporary construction. The spatiotemporal cue guidance module effectively reduces prediction biases under heterogeneous interference, such as underestimating the diffusion rate of sudden congestion, and the difficulty in modeling long-distance dependencies in complex road networks, such as the impact of inter-regional commuting arteries. This provides a more comprehensive consideration of spatiotemporal heterogeneity, effectively capturing local differences and dynamic changes in spatiotemporal patterns, thereby achieving accurate prediction of traffic speeds in highly heterogeneous spatiotemporal scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention can be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 It is a principle diagram of a spatiotemporal prediction method based on meta-pattern mining and prompt guidance provided according to an embodiment of the present invention.

[0024] Figure 2 The diagram shows a portion of historical spatiotemporal data collected within a spatial region to be predicted in an embodiment of a spatiotemporal prediction method based on meta-pattern mining and prompt guidance provided by an embodiment of the present invention.

[0025] Figure 3 A comparison curve diagram of traffic road speed prediction values ​​and true values ​​obtained by applying an embodiment of the spatiotemporal prediction method based on meta-pattern mining and prompt guidance provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features therein can be combined with each other without conflict.

[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0028] The following describes in detail a spatiotemporal prediction method and system based on meta-pattern mining and prompt guidance according to an embodiment of the present invention with reference to the accompanying drawings.

[0029] refer to Figure 1 According to an embodiment of the present invention, a spatiotemporal prediction method based on meta-pattern mining and prompt guidance is provided for predicting future traffic road speeds, including the following steps.

[0030] Step S1: Collect historical spatiotemporal data within the spatial region to be predicted, standardize the historical spatiotemporal data, and obtain a standard dataset comprising historical spatiotemporal sequences. The historical spatiotemporal data may include traffic road speeds. The collected historical spatiotemporal data within the spatial region to be predicted is standardized as follows: divide the spatial region to be predicted into N subregions, and count the historical spatiotemporal data for each time period within each subregion; input the historical spatiotemporal data for each time period within each subregion into a three-dimensional array in the format of B*T*N to obtain a standard dataset comprising historical spatiotemporal sequences, where B represents the data batch, T represents the time series length, and N represents the number of spatial nodes. The standard dataset contains traffic road speeds corresponding to each data batch, spatial node, and time step. Each data point in the standard dataset represents the traffic road speed of a node within a data batch at a time step.

[0031] Step S2: Construct a meta-pattern mining and prompt-guided prediction model (STMP2G). This model comprises a self-supervised meta-pattern mining module, a spatiotemporal prompt generation module, and a spatiotemporal prompt guidance module. This model is a unified framework with an encoder and decoder. It encodes historical spatiotemporal sequences via graph convolutional networks and temporal convolutional networks to capture spatial and temporal dependencies, captures spatiotemporal heterogeneity by generating spatiotemporal prompts, and jointly guides the spatiotemporal modeling process with offline mined meta-patterns to overcome the interference of spatiotemporal heterogeneity.

[0032] The prediction model based on meta-pattern mining and prompt guidance is as follows:

[0033] in, A prediction model based on meta-pattern mining and prompt guidance, represents all trainable parameters in the prediction model, Indicates from arrive The fragment of the historical space-time sequence of moments, that is, the historical space-time sequence, Indicates from arrive The future space-time sequence fragment of the moment, that is, the future space-time sequence, Represents the historical real time and space sequence, represents the future prediction time-space series, represents the time step, Indicates the history window size, Indicates the future window size.

[0034] Step S2 specifically includes the following steps.

[0035] Step S2.1: Construct the backbone network of the prediction model. The encoder and decoder capture the spatiotemporal dependencies and generate spatiotemporal representations through stacked graph convolutional networks and temporal convolutional networks. Taking the layer as an example, the graph convolution operation and the time convolution operation are defined as:

[0036]

[0037] in, For the Layer space-time representation, when When is the space-time sequence input, is the hidden representation obtained by graph convolution, is the mapping weight, for activation function, and They are two layers of one-dimensional convolution operations, is the adaptive adjacency matrix.

[0038] Adaptive adjacency matrix powered by trainable node embeddings To build: .

[0039] Step S2.2, build a self-supervised meta-pattern mining module, mine meta-patterns with discriminative ability in feature space through self-supervised learning and store them as meta-pattern library, and use historical spatiotemporal sequences to Enter the meta-pattern library for retrieval to obtain local trend information to supplement the spatiotemporal cues. Meta-patterns are discriminative latent feature patterns that can capture the local trends and dynamic changes implicit in spatiotemporal data. They provide fine-grained local trend information to the prediction model, thereby compensating for the lack of global context information and enhancing the model's ability to model complex dependencies.

[0040] Specifically, the self-supervised meta-pattern mining module includes a sample pair selection part, a feature enhancement part, a meta-pattern library construction part, and a prototype regularization part. The sample pair selection part selects positive and negative samples by calculating a dynamic similarity matrix to construct a self-supervisory signal and enhance contrastive learning. The feature enhancement part enhances the robustness of the prototype by adding masks and Gaussian noise, and uses contrastive learning to enhance the representation ability of the prototype. The meta-pattern library construction part calculates the probability of assigning samples to trainable prototypes and uses cross-entropy to optimize the prototypes to construct the meta-pattern library. The prototype regularization part uses a uniform regularization term to prevent the distribution from being too unbalanced and causing the model to crash, and uses a distance regularization term to improve the discriminability of the prototype.

[0041] This step S2.2 specifically includes the following steps.

[0042] Step S2.2.1: Divide the historical spatiotemporal sequence in the standard dataset into several prediction segments and randomly shuffle them as the original data. Then, map the original data from the data space to the feature space to obtain the mapped feature vector:

[0043] in, represents the mapped eigenvector and , is the feature dimension of the hidden layer, is the number of spatial nodes, A fragment of historical time and space sequence The feature mapping network, For future space-time sequence fragments Mapping from data space to feature space can enhance the expressive power of the historical spatiotemporal sequence.

[0044] Step S2.2.2, mining meta-patterns in historical prediction segments based on soft clustering process in feature space, using randomly initialized trainable parameters as prototypes to build a meta-pattern library , and used as the cluster center. The cluster center The feature dimension and the feature vector obtained by mapping The feature dimensions of , represents a domain, where is a prototype index and , Represents the domain. Get the probability of assigning the mapped feature vector to the prototype:

[0045]

[0046] in, The first eigenvector The probability vector of assigning samples to each prototype, The first eigenvector Samples to The probability of assigning prototypes, represents the natural exponential function, is the cosine similarity measure, Represents the first A prototype, represents the prototype index and , is the temperature parameter that controls the smoothness of the distribution, Represents the first feature vector after mapping samples, represents the eigenvector index and , Indicates the A prototype, is a prototype index and , is the number of prototypes.

[0047] The above prototypes can be time series in feature space.

[0048] Step S2.2.3, selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity, including selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity Select positive and negative sample pairs as follows:

[0049]

[0050] in, Represents the feature vector after mapping The selected batch size, represents the sample index in the selected feature vector batch and , Indicates the first feature vector in the selected batch samples, The first eigenvector The positive sample index corresponding to the sample, The first eigenvector The sample and The similarity between samples, Indicates the positive sample selection threshold, The average sample similarity matrix in the currently selected feature vector batch is normalized by translation. With diagonal masking After that, sample selection is performed. The selection of negative samples changes the threshold to Thus, samples with low similarity are selected. represents a random selection from the set. is the nearest neighbor function, Represents the items in the average sample similarity matrix obtained The maximum value corresponding to samples.

[0051] Compared with calculating the correlation of all samples, the above method is more conducive to capturing local dynamic relationships and is more efficient. Random selection helps capture diverse semantic relationships. Limiting the random range can effectively avoid the noise problem caused by excessive randomness, and the nearest neighbor function This ensures training stability in cases of data imbalance (such as sparse high-similarity samples).

[0052] For example, positive samples can be set as consecutive periods of congestion caused by the same accident, while negative samples can be set as congestion caused by different factors, such as accidents versus traffic light failures. Constructing positive and negative sample pairs based on traffic flow similarities, such as speed fluctuation curves and congestion propagation paths, can enhance meta-pattern discrimination.

[0053] Step S2.2.4, constructing a meta-pattern library, including calculating the multi-classification cross entropy based on the sample-to-prototype assignment probability of the obtained feature vector and using the positive sample pair-to-prototype assignment probability of the selected sample as the optimization target, and constructing the self-supervisory signal required for the self-supervised learning task:

[0054] in, The first eigenvector The positive sample of the sample and the The probability of distribution among prototypes, represents the cross entropy loss.

[0055] Step S2.2.5, construct the feature enhancement part and obtain the contrastive learning loss, including adding random masks and Gaussian noise to the positive and negative sample pairs selected from the mapped feature vector to enhance the robustness of the prototype, thereby reducing its over-dependence on certain specific features; and adopting a contrastive learning strategy for the positive and negative sample pairs selected from the mapped feature vector to bring the positive sample pairs closer and push the negative sample pairs further away in the feature space, thereby enhancing the representation ability of the prototype and improving the robustness of the clustering process.

[0056] The mapped feature vector The positive and negative sample pairs selected in are added with random masks and Gaussian noise as follows:

[0057] in, represents the enhanced feature vector, is the element-wise product, is a random mask matrix, is Gaussian noise, Represents a sample of feature vectors positive and negative samples.

[0058] For any sample of feature vector , for its positive and negative samples The feature vector of the sample is enhanced without Perform feature enhancement itself.

[0059] In the above-mentioned feature enhancement part, the adaptability of the meta-pattern to real-world data defects can be improved by adding sensor noise (such as GPS drift) and random masks (simulating data missing).

[0060] Based on the obtained enhanced feature vector, the contrastive learning strategy is performed on the positive and negative sample pairs selected from the mapped feature vector as follows:

[0061]

[0062] in, represents the contrastive learning loss, Indicates the The cosine similarity of the positive sample pairs of samples, Indicates the The cosine similarity of the negative sample pairs of samples, is the temperature parameter.

[0063] Through the above-mentioned self-supervised comparative learning, typical traffic state prototypes are extracted, such as tidal flow during the morning rush hour, global speed reduction during heavy rain, and road network saturation around large-scale events, forming a searchable meta-pattern library.

[0064] Step S2.2.6, construct the prototype regularization part, including constructing a uniform regularization term based on the probability of sample-to-prototype distribution of feature vectors to encourage samples to be evenly distributed among prototypes in order to prevent the collapse of the contrastive learning loss caused by the excessive imbalance of sample-to-prototype distribution; and constructing a distance regularization term to improve the discriminability and representation ability of the prototype.

[0065] Based on the probability of assigning samples to prototypes of feature vectors, a uniform regularization term is constructed:

[0066] in, represents the uniform regularization loss, Indicates the length is A vector of all 1s, Represents KL divergence, which is used to measure the difference between two probability distributions. Indicates the samples The probability vector of assigning θ to each prototype.

[0067] Through the above-mentioned prototype regularization part, we can avoid the pattern library from being biased towards high-frequency simple scenarios, such as off-peak periods, and retain the long-tail but critical sudden congestion patterns.

[0068] Construct a distance regularization term:

[0069] in, represents the distance regularization loss, Represents the first A prototype, is a prototype index and .

[0070] Step S2.2.7, construct the optimization objective of the self-supervised meta-pattern mining module for performing self-supervised meta-pattern mining:

[0071] in, represents the total loss of the self-supervised meta-pattern mining module, is the coefficient of the regularization term.

[0072] Step S2.3 constructs a spatiotemporal cue generation module. This module captures temporal heterogeneity through multi-scale temporal cue generation and spatial heterogeneity through semantic spatial cue generation. It then fuses temporal and spatial cues through spatiotemporal interaction modeling to produce comprehensive spatiotemporal cues. The spatiotemporal cue generation module includes a temporal cue generation component, a spatial cue generation component, and a spatiotemporal cue fusion component. Step S2.3 specifically includes the following steps.

[0073] Step S2.3.1, construct the temporal hint generation part, which captures temporal heterogeneity by combining prior embedding with memory network and generates temporal hints through embedding query.

[0074] First, the multi-scale time prior knowledge is mapped from discrete to continuous feature space to obtain the mapped time prior knowledge:

[0075] in, Indicates the The embedding vector of the temporal prior knowledge, represents the embedding operation, Indicates the The value of the time prior knowledge, represents the index of temporal prior knowledge, and ,as well as, is the total amount of selected time prior knowledge. The multi-scale time prior knowledge may include information such as month, date, time step, week, whether it is a working day, whether it is a holiday, etc., which can be obtained from a standard calendar.

[0076] Then, based on the mapped temporal prior knowledge, the importance of different prior knowledge is adaptively learned through the feature fusion network to obtain a multi-scale temporal fusion representation:

[0077] in, It is a multi-scale temporal fusion representation and , is the weight of the feature fusion network and , represents the summation function, is the bias of the feature fusion network and , Represents the domain, represents the total length of the time step, Indicates the The embedding dimension of temporal prior knowledge, Represents the feature dimension of multi-scale temporal fusion representation, Indicates splicing processing.

[0078] Next, build the memory network Store long-term temporal memories learned from history, comprehensively model complex long-term temporal dependencies, and further enhance temporal fusion representation. Represents the number of memory units stored in the memory network, Represents the feature dimension of the memory unit stored in the memory network.

[0079] The query process of the memory network is as follows:

[0080]

[0081]

[0082]

[0083] in, Representation by time fusion The query vector obtained by mapping , represents the natural exponential function, represents the weight of the query mapping, represents the bias of the query mapping, represents the index of the memory cell and , Indicates the memory units and , For the memory cells The corresponding attention score, represents the weighted sum of the memory cells and , represents the memory-enhanced temporal fusion representation obtained by output mapping and , represents the weight of the output mapping, Represents the bias of the output mapping. The memory unit is a randomly initialized learnable parameter that is automatically stored as long-term memory through model training.

[0084] The memory-enhanced temporal fusion representation obtained by output mapping The generated multi-scale temporal cues capture temporal heterogeneity. Furthermore, unlike spatiotemporal series, temporal priors are known before prediction. Therefore, when performing spatiotemporal predictions, corresponding temporal cues are generated for both historical and future windows, thus comprehensively guiding the spatiotemporal modeling process.

[0085] These time cues can be combined with prior knowledge about traffic, such as rush hour and holiday travel patterns, to dynamically generate time attention weights through a memory network. Specifically, during Friday evening rush hour, for example, cues for roads surrounding commercial areas can be strengthened; on rainy days, speed decay patterns based on historically similar weather patterns can be emphasized.

[0086] In step S2.3.2, the spatial cue generation part is constructed. The spatial heterogeneity is captured through adaptive spatial node embedding, and a spatial adjacency matrix is ​​constructed based on this to perform dependency modeling and representation learning. The representations are then fused to generate semantic spatial cues.

[0087] First, a pair of trainable spatial node embeddings are randomly initialized based on the number of spatial nodes , to capture spatial heterogeneity, represents the feature dimension of spatial node embedding, Represents the number of spatial nodes to more comprehensively model the complex dependencies between nodes from multiple perspectives. A pair of trainable node embeddings are randomly initialized for each spatial node.

[0088] Based on the obtained pair of trainable spatial node embeddings, their interaction is simulated by matrix multiplication, using The activation function eliminates weak correlations and uses Normalized exponential function is used to normalize and construct an adaptive adjacency matrix , as follows: .

[0089] Next, we apply graph convolutional networks to model spatial dependencies and automatically learn node features by aggregating multi-order neighbor information to capture spatial heterogeneity, as shown in the following formula:

[0090]

[0091] in, for activation function, is the input spatiotemporal representation, Indicates the The output features of the convolutional graph are Represents the graph convolution order index, represents a multi-order spatial aggregation representation, For the The weights of the graph convolution are , Represents a multilayer perceptron for output mapping.

[0092] Next, after end-to-end training, the node embedding , Automatically implement representation learning to capture potential spatial heterogeneity from different perspectives. Based on this, feature fusion is performed on spatial node embeddings to automatically perform feature extraction and spatial cue generation, as shown in the following formula:

[0093] in, represents the fused representation of spatial node embedding and , which captures the semantic spatial heterogeneity, is the weight of the feature fusion network and , is the bias of the feature fusion network and .

[0094] The obtained spatial node embedding fusion representation As a space reminder.

[0095] Based on the above spatial cues, adaptive learning of road network node embedding is used to distinguish between critical paths (such as urban expressways) and non-critical paths (such as community branches); the spatial adaptive adjacency matrix is ​​dynamically updated based on real-time traffic flow (such as congestion index) to capture the spatiotemporal coupling effect of congestion propagation.

[0096] In step S2.3.3, the spatiotemporal cue fusion part is constructed, and the complex interaction between the two is modeled using a learnable spatiotemporal interaction tensor. The spatiotemporal cue fusion process is regarded as the reverse process of tensor decomposition, and adaptive updates are achieved through backpropagation to obtain comprehensive spatiotemporal cues.

[0097] First, randomly initialize the learnable tensor , used to model complex spatiotemporal interactions, where is the space-time interaction dimension, and .

[0098] Next, combine the generated time prompt With space prompt , comprehensively models the spatiotemporal interaction process with low computational complexity, achieving effective spatiotemporal cue fusion:

[0099] in, represents the fused spatiotemporal cues and , are weights that map the time tensor to the interaction dimension and ,and are weights that map spatial tensors to interaction dimensions and , represents a learnable tensor after random initialization. The fused spatiotemporal cues capture the comprehensive spatiotemporal heterogeneity.

[0100] By setting up learnable tensors as described above, we can decompose and model complex interactions, such as the combined impact of "peak hours + construction sections", replacing traditional static weighting to fully capture dynamic spatiotemporal heterogeneity.

[0101] Step S2.4, constructing a spatiotemporal prompt guidance module. The meta-pattern and the generated spatiotemporal prompt are feature spliced ​​to obtain enhanced spatiotemporal prompts, and input into the prediction model based on meta-pattern mining and prompt guidance, and the encoded spatiotemporal representation is prompted and guided to overcome the interference of heterogeneity on spatiotemporal modeling. In order to overcome the problems of insufficient modeling of spatiotemporal heterogeneity, high computational and memory costs in traditional spatiotemporal prediction methods, the spatiotemporal prompts generated in the previous article and the mined meta-patterns are combined to jointly guide the spatiotemporal modeling process, thereby overcoming the interference of spatiotemporal heterogeneity, improving prediction accuracy and robustness, and making the model more adaptable to dynamic and complex spatiotemporal changes. This step S2.4 specifically includes the following steps.

[0102] Step S2.4.1: Input the historical spatiotemporal sequence into the meta-pattern library, perform meta-pattern query and fusion, and obtain the fused meta-pattern. The historical spatiotemporal sequence is used as the historical window.

[0103] Specifically, the meta-pattern library obtained by self-supervised meta-pattern mining Perform feature segmentation and linear mapping on each meta-pattern in the , and obtain the meta-pattern groups corresponding to the historical window and the future window, respectively, as follows: ;

[0104] in, are the learnable mapping weights corresponding to the meta-pattern group of history windows, are learnable mapping weights corresponding to the set of future window meta-patterns, and , represents the meta-pattern group corresponding to the history window, Represents the meta-pattern library, i.e. the overall meta-pattern group, Represents the meta-pattern group corresponding to the future window.

[0105] Then, the input historical spatiotemporal sequence is subjected to pattern retrieval to obtain the matching degree between the historical spatiotemporal sequence and each meta-pattern. , as follows:

[0106] in, Represents the feature mapping layer of the historical spatiotemporal sequence, Indicates the matching degree between the historical spatiotemporal sequence and each meta-pattern, Represents the historical real time and space sequence, represents the transposed matrix of the meta-pattern group corresponding to the history window, represents the normalized exponential function.

[0107] Based on this, the meta-patterns are weightedly fused and the meta-pattern most relevant to the input sequence is extracted as the fused meta-pattern:

[0108] in, represents the fully connected layer, represents a fused meta-pattern and The fused meta-patterns supplement the spatiotemporal cues with specific local trend information.

[0109] Step S2.4.2: Combine the fused spatiotemporal cues with the fused meta-patterns to enhance the spatiotemporal cues and obtain enhanced spatiotemporal cues:

[0110] in, represents the feature concatenation operation, Indicates enhanced spatiotemporal cues.

[0111] The above method obtains enhanced spatiotemporal cues by feature splicing meta-patterns with spatiotemporal cues, aiming to comprehensively guide the spatiotemporal modeling process and thus overcome the interference of heterogeneity.

[0112] By combining meta-pattern library retrieval results (e.g., a historical accident pattern currently matching 80% similarity) with real-time fused spatiotemporal cues, the encoder input features can be dynamically modified. For example, the detection of a rainstorm meta-pattern can automatically increase the weight of speed reduction predictions for low-visibility sections.

[0113] In step S2.4.3, the spatiotemporal cue tensor is flexibly mapped to the feature space of each layer of the perceptual adapter through the multi-layer perceptual adapter, thereby enhancing its adaptability and representation ability in the feature space at different levels, and achieving fine-grained cue guidance with the help of the Hadamard product:

[0114] in, For the Mapping weights for layer-aware adapters, For the The spatiotemporal representation of the layer-aware adapter before guidance by spatiotemporal cues, and For the The spatiotemporal representation of the layer-aware adapter after guidance of spatiotemporal cues, Represents the Hadamard product operation.

[0115] Through the multi-layer perceptron adapter described above, enhanced cues are injected layer by layer into the encoder-decoder network. For example, shallow layers can focus on local congestion while deep layers can model the global road network state. Fine-grained spatiotemporal representation adjustments are achieved through Hadamard product operations to avoid oversmoothing or overfitting.

[0116] Step S3: Using the obtained standard data set including the historical spatiotemporal series, the constructed prediction model based on meta-pattern mining and prompt guidance is trained to obtain a trained prediction model.

[0117] First, the total loss of the self-supervised meta-pattern mining module is optimized , to mine discriminative meta-patterns in historical data in the feature space, store them in the meta-pattern library, and then freeze their parameters to avoid interference when optimizing other parts in subsequent stages.

[0118] Then the mean absolute error (MAE) is used as the prediction loss to optimize the prediction model, as shown below:

[0119] in, represents the prediction loss, represents the number of the spatial node and , represents the time step within the prediction window, represents the future window size, represents the predicted value of the future space-time series, Represents the true value of the future space-time series.

[0120] In step S4, the trained prediction model is applied to future spatiotemporal data to generate spatiotemporal predictions of future traffic speeds. These predictions are provided to the intelligent decision-making platform of the urban traffic management system for configuration planning and layout, such as dynamic traffic light timing optimization, congestion relief route recommendations, and emergency vehicle priority. These predictions can also be used to plan solutions for smart travel services, infrastructure optimization, and emergency response.

[0121] The following describes a spatiotemporal prediction system based on meta-pattern mining and prompt guidance according to another embodiment of the present invention with reference to the accompanying drawings.

[0122] like Figure 1 As shown, a spatiotemporal prediction system based on meta-pattern mining and prompt guidance provided according to another embodiment of the present invention includes: a data collection and processing module, which is used to collect historical spatiotemporal data in the spatial area to be predicted, standardize the historical spatiotemporal data, and obtain a standard data set including historical spatiotemporal sequences; a prediction model based on meta-pattern mining and prompt guidance, which captures temporal and spatial heterogeneity by generating multi-scale temporal prompts and semantic spatial prompts respectively, and obtains comprehensive spatiotemporal prompts by fusing temporal and spatial prompts through spatiotemporal interaction modeling, thereby guiding the spatiotemporal modeling process to overcome the interference of spatiotemporal heterogeneity; a training module, which uses a standard data set to train the prediction model.

[0123] The meta-pattern mining and prompt-guided prediction model may include: an encoder and a decoder, which capture spatiotemporal dependencies and generate spatiotemporal representations layer by layer through stacked graph convolutional networks and temporal convolutional networks, thereby performing spatiotemporal predictions; a self-supervised meta-pattern mining module, which mines meta-patterns with discriminative capabilities in feature space through self-supervised learning and stores them as a meta-pattern library, and then retrieves local trend information by inputting historical spatiotemporal sequences into the meta-pattern library to supplement spatiotemporal prompts; a spatiotemporal prompt generation module, which captures temporal heterogeneity through multi-scale temporal prompt generation and spatial heterogeneity through semantic spatial prompt generation, and then fuses temporal prompts and spatial prompts through complex spatiotemporal interaction modeling to obtain comprehensive spatiotemporal prompts; a spatiotemporal prompt guidance module, which performs feature splicing on the meta-pattern and the generated spatiotemporal prompts to obtain enhanced spatiotemporal prompts, and after inputting them into the encoder, performs prompt guidance on the encoded spatiotemporal representations to overcome the interference of heterogeneity on spatiotemporal modeling.

[0124] The self-supervised meta-pattern mining module may include: a sample pair selection part, which selects positive and negative samples by calculating the dynamic similarity matrix for constructing self-supervisory signals and contrastive learning enhancement; a feature enhancement part, which enhances the robustness of the prototype by adding masks and Gaussian noise, and uses contrastive learning to enhance the representation ability of the prototype; a meta-pattern library construction part, which calculates the probability of assigning samples to trainable prototypes, and uses cross-entropy to optimize the prototype to construct the meta-pattern library; a prototype regularization part, which uses a uniform regularization term to prevent the distribution from being too unbalanced and causing the model to collapse, and uses a distance regularization term to improve the distinguishability of the prototype.

[0125] The spatiotemporal cue generation module may include: a temporal cue generation part, which captures temporal heterogeneity by combining prior embedding and memory network, and generates temporal cues through embedding query; a spatial cue generation part, which captures spatial heterogeneity through adaptive node embedding, and constructs a spatial adjacency matrix based on this for dependency modeling and representation learning, and fuses the representations to generate semantic spatial cues; a spatiotemporal cue fusion part, which uses a learnable spatiotemporal interaction tensor to model the complex interaction between the two, and regards the fusion process of spatiotemporal cues as the inverse process of tensor decomposition, and realizes adaptive update through backpropagation to obtain comprehensive spatiotemporal cues.

[0126] Example 1 The following describes Example 1 of a spatiotemporal prediction method based on meta-pattern mining and prompt guidance provided by an embodiment of the present invention, so as to better understand the technical solution of the present invention.

[0127] Step S1, collect historical spatiotemporal data in the spatial area to be predicted, standardize the historical spatiotemporal data, obtain a standard data set including historical spatiotemporal sequences, and collect historical spatiotemporal data including traffic road speed.

[0128] Step S2, construct a prediction model based on meta-pattern mining and prompt guidance, including an encoder, a decoder, a self-supervised meta-pattern mining module, a spatiotemporal prompt generation module and a spatiotemporal prompt guidance module. The historical spatiotemporal sequences are encoded through graph convolutional networks and temporal convolutional networks to capture spatial and temporal dependencies, and spatiotemporal heterogeneity is captured by generating spatiotemporal prompts. The model is then used together with the offline mined meta-patterns to guide the spatiotemporal modeling process to overcome the interference of spatiotemporal heterogeneity.

[0129] Step S3: Use a standard data set to train the constructed prediction model based on meta-pattern mining and prompt guidance to obtain a trained prediction model.

[0130] Step S4: Apply the trained prediction model to the prediction of future spatiotemporal data to obtain spatiotemporal prediction results of future traffic road speeds, and use the spatiotemporal prediction results to plan dynamic traffic management.

[0131] In Example 1, a prediction model was trained using a traffic speed dataset from Tongzhou District, Beijing. Statistical data was collected from January 5, 2024, to March 31, 2024, covering 645 spatial locations with a 5-minute time interval. The dataset was divided into a training set (70%), a validation set (10%), and a test set (20%) based on the temporal dimension. This example uses historical one-hour traffic speed data to predict the next hour's traffic speed. Figure 2 A portion of the historical spatiotemporal data collected in the spatial area to be predicted in Example 1 is shown. In order to avoid being too lengthy, only the traffic road speed data collected from the first spatial position to the sixth spatial position, from 0:00 to 1:00 on January 5, 2024, at intervals of 5 minutes are shown.

[0132] The constructed deep learning model was trained using the partitioned training set. The data was Z-score normalized, and all parameters in the prediction model based on meta-pattern mining and hint guidance were randomly initialized.

[0133] Training was performed on Intel(R) Xeon(R) Processors CPU and NVIDIA TeslaV100S GPU on Linux using the PyTorch framework, with the batch size set to 64 and the initial learning rate set to 0.001.

[0134] Using AdamW as the optimizer, this deep learning model was trained on the full dataset for 200 epochs. The model was validated using a loss function at each epoch, and the optimal model was saved based on the loss function value. An early stopping strategy was used during training, terminating training early if the loss function value did not decrease for 20 consecutive epochs. Figure 3 This is a comparison curve diagram of the road traffic prediction value and the true value obtained in Example 1. It can be seen from the figure that the prediction value of this embodiment has a better fitting effect on the true value and the prediction effect is accurate.

[0135] The prediction results of the above embodiment were compared with those of the prior art. Traffic speed prediction was performed on the same dataset. The comparative results are shown in Table 1. The prediction results were evaluated using mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE). Lower errors indicate better prediction performance. Example 1 was compared with nine prior art prediction methods.

[0136] The first is STGCN, which integrates graph convolution and gated temporal convolution via spatiotemporal convolution blocks to capture spatiotemporal dependencies.

[0137] The second is GraphWaveNet, which proposes an adaptive adjacency matrix to capture the hidden spatial dependencies in the data and captures the temporal dependencies through stacked dilated one-dimensional convolutions.

[0138] The third is AGCRN, which captures node-specific patterns through node-adaptive parameter learning, captures potential spatial dependencies with unified node embeddings, and automatically captures spatiotemporal correlations in combination with recurrent networks.

[0139] The fourth is DMSTGCN, which extends the existing graph convolution to dynamic graph convolution by constructing an adaptive spatial adjacency matrix with a day-cycle to model the changing spatial correlation.

[0140] The fifth is STSSL, which adaptively enhances traffic flow graph data at the data level and topological structure level, and captures spatiotemporal heterogeneity through auxiliary self-supervised learning tasks.

[0141] The sixth is MegaCRN, which captures spatiotemporal heterogeneity through spatiotemporal meta-graph learning and combines graph convolution and recurrent networks on the meta-graph to capture spatiotemporal correlation.

[0142] The seventh is TESTAM, which selects a specific spatial modeling method for each node through a hybrid expert model and combines it with a time-enhanced attention model to capture spatiotemporal dependencies.

[0143] The eighth is TGCRN, which learns a time-varying graph structure that can perceive periodicity and trends, and combines it with a gated recurrent unit to jointly capture dynamic spatiotemporal dependencies.

[0144] The ninth is HimNet, which implicitly captures spatiotemporal heterogeneity through spatiotemporal embedding and learns spatiotemporal specific parameters from a meta-parameter pool.

[0145] It can be clearly seen from the comparison results in Table 1 that the prediction effect of the spatiotemporal prediction method based on meta-pattern mining and prompt guidance in Example 1 is better than that of the existing technology.

[0146] Table 1 Comparison of traffic road speed prediction results of Tongzhou dataset

[0147] It can be seen from the experimental results that the prediction method of Example 1 of the present invention is better than the existing technology.

[0148] Furthermore, several ablation experiments were conducted to demonstrate the effectiveness of the prediction method of the present invention. The experimental results are shown in Table 2.

[0149] Example 1 was compared with six post-ablation models.

[0150] (1) Base model: The spatiotemporal cue guidance module is deleted, representing the base model that only captures spatiotemporal dependencies but cannot capture spatiotemporal heterogeneity.

[0151] (2) w / o Ot: The time prompt generation module was deleted.

[0152] (3) w / o Es: The spatial cue generation module was deleted.

[0153] (4) w / o Wc: The spatiotemporal cue fusion module was deleted.

[0154] (5) w / o Ep: The self-supervised meta-pattern mining module was removed.

[0155] (6) w / o Adapter: The layer-by-layer adapter is removed, and the same spatiotemporal cues are used to guide the spatiotemporal representation of each layer.

[0156] Table 2 Comparison of ablation experiment results on Tongzhou dataset

[0157] All of the above optional technical solutions can be combined in any way to form optional embodiments of the present application, and will not be described in detail here.

[0158] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0159] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.

Claims

1. A spatiotemporal prediction method based on meta-pattern mining and prompt guidance for traffic road speed prediction, characterized by: The following steps are involved: Step S1, collecting historical spatiotemporal data in the spatial area to be predicted, standardizing the historical spatiotemporal data to obtain a standard data set including historical spatiotemporal sequences, and collecting historical spatiotemporal data including traffic road speed; Step S2: Construct a prediction model based on meta-pattern mining and prompt guidance, including an encoder, a decoder, a self-supervised meta-pattern mining module, a spatiotemporal prompt generation module, and a spatiotemporal prompt guidance module. The model encodes historical spatiotemporal sequences through graph convolutional networks and temporal convolutional networks to capture spatial and temporal dependencies, captures spatiotemporal heterogeneity by generating spatiotemporal prompts, and guides the spatiotemporal modeling process together with the offline mined meta-patterns to overcome the interference of spatiotemporal heterogeneity. Step S3, using a standard data set to train the constructed prediction model based on meta-pattern mining and prompt guidance to obtain a trained prediction model; Step S4: Apply the trained prediction model to the prediction of future spatiotemporal data to obtain spatiotemporal prediction results of future traffic road speeds, and use the spatiotemporal prediction results to plan dynamic traffic management.

2. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 1, characterized in that: In step S1: The collected historical spatiotemporal data in the spatial area to be predicted are standardized. The processing process is as follows: the spatial area to be predicted is divided into N sub-areas, and the historical spatiotemporal data of each time period in each sub-area are counted; the historical spatiotemporal data of each time period in each sub-area are input into a three-dimensional array in the format of B*T*N to obtain a standard data set including historical spatiotemporal sequences, where B represents the data batch, T represents the length of the time series, and N represents the number of spatial nodes. The standard data set contains the traffic road speed corresponding to each data batch, spatial node, and time step.

3. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 1, characterized in that: Step S2 specifically includes the following steps: Step S2.1, building the backbone network of the prediction model; Step S2.2: construct a self-supervised meta-pattern mining module, which mines discriminative meta-patterns in the feature space through self-supervised learning and stores them as a meta-pattern library. This is used to retrieve local trend information by inputting historical spatiotemporal sequences into the meta-pattern library. Step S2.3: Construct a spatiotemporal cue generation module to capture temporal heterogeneity through multi-scale temporal cue generation, capture spatial heterogeneity through semantic spatial cue generation, and fuse temporal and spatial cues through spatiotemporal interaction modeling to obtain comprehensive spatiotemporal cues. In step S2.4, a spatiotemporal cue guidance module is constructed to perform feature splicing on the meta-pattern and the fused spatiotemporal cue to obtain enhanced spatiotemporal cue. After inputting the cue into the encoder of the prediction model, the encoded spatiotemporal representation is cue-guided to overcome the interference of heterogeneity on spatiotemporal modeling.

4. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 3, characterized in that: Step S2.2 specifically includes the following steps: Step S2.2.1: Divide the historical spatiotemporal sequence in the standard dataset into several prediction segments and randomly shuffle them to form the original data, and map the original data from the data space to the feature space to obtain the mapped feature vectors; Step S2.2.2, mining meta-patterns in historical prediction segments based on a soft clustering process in the feature space, using a preset number of randomly initialized trainable parameters as prototypes to establish a meta-pattern library, which serves as cluster centers; Step S2.2.3, selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity, including selecting positive and negative sample pairs from the samples of the mapped feature vector based on dynamic spatial similarity Select positive and negative sample pairs; Step S2.2.4, constructing a meta-pattern library, including calculating the multi-class cross entropy based on the sample-to-prototype assignment probabilities of the obtained feature vectors and the positive sample pair-to-prototype assignment probabilities of the selected samples, and using the multi-class cross entropy as the optimization target to construct the self-supervisory signal required for the self-supervised learning task; Step S2.2.5, construct the feature enhancement part and obtain the contrastive learning loss; Step S2.2.6, construct the prototype regularization part to obtain the uniform regularization loss and the distance regularization loss; Step S2.2.7, constructing a total loss-based optimization objective of the self-supervised meta-pattern mining module for performing self-supervised meta-pattern mining, the total loss includes contrastive learning loss, uniform regularization loss and distance regularization loss.

5. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 4, characterized in that: Step S2.2.5 specifically includes: Add random masks and Gaussian noise to the positive and negative sample pairs selected from the mapped feature vector to obtain the enhanced feature vector; Based on the obtained enhanced feature vector, a contrastive learning strategy is adopted for the positive and negative sample pairs selected from the mapped feature vector, which brings the positive sample pairs closer and pushes the negative sample pairs farther in the feature space, and obtains the contrastive learning loss.

6. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 3, characterized in that: Step S2.3 specifically includes: Step S2.3.1, construct the temporal cue generation part, which captures temporal heterogeneity by combining prior embeddings with memory networks and generates temporal cues through embedding queries; Step S2.3.2: Construct the spatial cue generation part, which captures spatial heterogeneity through adaptive spatial node embedding, and constructs a spatial adjacency matrix based on this to perform dependency modeling and representation learning, and fuses the representations to generate semantic spatial cues; In step S2.3.3, the spatiotemporal cue fusion part is constructed, and the complex interaction between the two is modeled using a learnable spatiotemporal interaction tensor. The spatiotemporal cue fusion process is regarded as the reverse process of tensor decomposition, and adaptive updates are achieved through backpropagation to obtain comprehensive spatiotemporal cues.

7. The spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to claim 3, characterized in that: Step S2.4 specifically includes: Step S2.4.1: Input the historical spatiotemporal sequence into the meta-pattern library, perform meta-pattern query and fusion, and obtain the fused meta-pattern; Step S2.4.2, combining the fused spatiotemporal cue and the fused meta-pattern to enhance the spatiotemporal cue and obtain enhanced spatiotemporal cue; In step S2.4.3, the spatiotemporal cue tensor is flexibly mapped to the feature space of each layer of the perception adapter through the multi-layer perception adapter, and the spatiotemporal representation of each layer of the perception adapter after the spatiotemporal cue guidance is obtained through the Hadamard product operation.

8. A system for executing the spatiotemporal prediction method based on meta-pattern mining and prompt guidance according to any one of claims 1 to 7, characterized in that: include: The data collection and processing module collects historical spatiotemporal data in the spatial area to be predicted, performs standardization processing on the spatial area to be predicted, and obtains a standard data set including historical spatiotemporal sequences; A prediction model based on meta-pattern mining and cue guidance captures temporal and spatial heterogeneity by generating multi-scale temporal cues and semantic spatial cues, and integrates temporal and spatial cues through spatiotemporal interaction modeling to obtain comprehensive spatiotemporal cues, thereby guiding the spatiotemporal modeling process to overcome the interference of spatiotemporal heterogeneity. The training module uses a standard dataset to train the prediction model.

9. The system according to claim 8, characterized in that Meta-pattern mining and hint-guided predictive models include: The encoder and decoder capture spatiotemporal dependencies and generate spatiotemporal representations layer by layer through stacked graph convolutional networks and temporal convolutional networks; The self-supervised meta-pattern mining module mines discriminative meta-patterns in the feature space through self-supervised learning and stores them in a meta-pattern library. It then retrieves historical spatiotemporal sequences from the meta-pattern library to obtain local trend information to supplement spatiotemporal cues. The spatiotemporal cue generation module captures temporal heterogeneity through multi-scale temporal cue generation, captures spatial heterogeneity through semantic spatial cue generation, and fuses temporal and spatial cues to obtain comprehensive spatiotemporal cues through complex spatiotemporal interaction modeling; The spatiotemporal cue guidance module performs feature splicing on the meta-pattern and the generated spatiotemporal cue to obtain enhanced spatiotemporal cue. After inputting it into the encoder, it performs cue guidance on the encoded spatiotemporal representation to overcome the interference of heterogeneity on spatiotemporal modeling.

Citation Information

Patent Citations

  • Traffic speed prediction method and system and storage medium

    CN111612243A

  • Traffic flow prediction method and system for urban road network

    CN112183862A

Cited By

  • Spatial-temporal flow data prediction model training method

    CN120763625A

  • Spatiotemporal flow data prediction model training method

    CN120763625B

  • Distributed drift adaptive time series prediction model generation method

    CN121030346A

  • A distributed drift adaptive time series prediction model generation method

    CN121030346B

  • Pumped storage power station infrastructure period equipment parameter multi-source data acquisition and monitoring system based on open source gap

    CN121682739A