A dynamic spatio-temporal graph traffic prediction method and system based on curriculum learning

By constructing a dynamic adjacency matrix and a feature interaction mechanism, the problem of capturing spatiotemporal coupling relationships in agricultural logistics scenarios using existing spatiotemporal graph networks is solved, achieving efficient traffic prediction and decision support, and improving the training efficiency and prediction accuracy of the model.

CN121860159BActive Publication Date: 2026-05-22WENS FOODSTUFF GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WENS FOODSTUFF GROUP CO LTD
Filing Date
2026-03-16
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing spatiotemporal graph neural networks struggle to effectively capture complex spatiotemporal coupling relationships in agricultural and logistics scenarios. During training, gradients become unstable and inefficient, failing to adapt to real-time changes in spatial dependencies. Furthermore, variations in sample difficulty lead to model overfitting.

Method used

A dynamic spatiotemporal graph traffic prediction method based on curriculum learning is adopted. By constructing a dynamic adjacency matrix, combining graph convolutional networks and gated recurrent units to extract features, using a bidirectional cross-attention mechanism for feature interaction, and adjusting the training strategy through a multi-dimensional difficulty estimator, the model achieves adaptive training.

Benefits of technology

It improves the accuracy of predictions for complex scenarios, supports precise congestion warnings and route optimization decisions, enhances logistics efficiency, and reduces costs and delays.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860159B_ABST
    Figure CN121860159B_ABST
Patent Text Reader

Abstract

The application discloses a dynamic space-time graph traffic prediction method and system based on course learning, relates to the technical field of supply chain logistics data analysis, and comprises the following steps: constructing a space-time matrix based on historical multi-source data, generating a dynamic adjacency matrix through learning, and combining a static graph to perform smooth fusion to form a dynamic graph structure. Then, a graph convolution network and a gate recurrent unit are used to extract spatial and temporal features respectively, deep interaction and fusion are realized through a bidirectional cross attention mechanism. A multidimensional difficulty estimator is innovatively introduced to quantize the prediction difficulty of each training sample from three dimensions of space, time and space-time coupling, and the selection order of the training sample is dynamically adjusted based on an adaptive course scheduler to realize progressive learning. Finally, feature representation is obtained through global pooling, and multi-step traffic prediction is realized by using a parallel independent decoder to avoid error accumulation. The application effectively improves the prediction accuracy and model training efficiency in a complex supply chain logistics scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of supply chain logistics data analysis technology, and more specifically, to a dynamic spatiotemporal graph flow prediction method and system based on course learning. Background Technology

[0002] In the fields of smart agriculture and supply chain management, logistics flow forecasting is a core technological support for realizing intelligent management of farms and improving supply chain operational efficiency. Logistics flow forecasting provides crucial decision-making basis for applications such as on-farm vehicle scheduling, feed delivery route optimization, and material turnover early warning. In recent years, spatiotemporal forecasting methods based on graph neural networks have made significant progress in various flow forecasting tasks. These methods can simultaneously model spatial dependence (the correlation between logistics nodes) and temporal dependence (the evolution trend of node flow), providing a new technical path for flow forecasting in complex scenarios.

[0003] On the other hand, while spatiotemporal graph neural network (SPNN) solutions for various traffic flow predictions exist in the market and academia, applicable to most prediction tasks such as traffic flow, logistics, and personnel flow, these solutions are mostly based on general spatiotemporal graph modeling frameworks and have three major structural limitations. First, current mainstream methods typically employ a separate modeling paradigm, using GCNs to extract spatial features and RNNs to extract temporal features, lacking deep interaction between the two. This unidirectional information flow design makes it difficult for the model to effectively capture the complex spatiotemporal coupling relationships in actual agricultural and logistics scenarios. Second, most methods use predefined static adjacency matrices, which cannot adapt to real-time changing spatial dependencies. Third, the training process of existing methods typically employs random or sequential sampling strategies, treating all training samples equally. However, different training samples have significant differences in prediction difficulty. Mixing simple and complex samples for training may lead to unstable gradients in the early stages of training, overfitting of the model to simple samples, and low training efficiency. Due to the complex spatiotemporal dependencies, dynamically changing topologies, and significant differences in sample difficulty in agricultural and logistics traffic prediction scenarios, spatiotemporal modeling faces key technical bottlenecks. Based on this, the present invention proposes a dynamic spatiotemporal graph flow prediction method and system based on course learning. Summary of the Invention

[0004] To address the aforementioned technical challenges, this invention proposes a dynamic spatiotemporal graph-based traffic prediction method and system based on curriculum learning. By employing a curriculum learning mechanism, the method improves the model's prediction accuracy for complex scenarios such as concentrated work periods, sudden epidemic lockdowns, and holiday logistics peaks, providing more reliable decision support for applications such as intelligent vehicle scheduling within the site, emergency material distribution, and supply chain collaborative optimization.

[0005] The first aspect of this invention provides a dynamic spatiotemporal graph-based flow prediction method based on course learning, comprising the following steps:

[0006] Based on multi-source heterogeneous data of multiple traffic nodes in the traffic network within a historical time window, a spatiotemporal data matrix is ​​constructed. Based on the spatiotemporal data matrix, a dynamic adjacency matrix is ​​generated for each time step within the window using a graph structure learner.

[0007] Through a course-driven dynamic-static interpolation strategy, the smoothed dynamic adjacency matrix is ​​weighted and fused with a predefined static adjacency matrix to generate a fused dynamic graph structure.

[0008] Based on the dynamic graph structure, spatial features are extracted using a graph convolutional network, temporal features are extracted using a gated recurrent unit, and spatial and temporal features are interactively fused through a bidirectional cross-attention mechanism to generate spatiotemporal fusion features.

[0009] For each training sample in the training set, a multi-dimensional difficulty estimator is used to evaluate the difficulty of the training sample in multiple dimensions, generating a difficulty score for each sample. The sample selection strategy is dynamically adjusted according to the training progress, and the model is trained in order of difficulty from easy to difficult using a course learning approach.

[0010] The spatiotemporal fusion features are globally pooled to generate a global feature representation. Independent decoders are then constructed for multiple future prediction time steps, and traffic flow prediction values ​​for each future time step are generated in parallel based on the global feature representation.

[0011] In this scheme, the time-smoothing dynamic graph encoder constructs a spatiotemporal data matrix based on multi-source heterogeneous data of multiple traffic nodes in the traffic network within a historical time window. Based on this spatiotemporal data matrix, a dynamic adjacency matrix is ​​generated for each time step within the window using a graph structure learner, including:

[0012] For each time step within a historical time window, the spatiotemporal data matrix corresponding to the multi-source heterogeneous data of each traffic node is feature-encoded through a learnable linear transformation matrix to obtain the hidden layer representation of each traffic node at the current time step. The multi-source heterogeneous data includes vehicle speed, traffic flow, occupancy rate, time, and weather.

[0013] For all traffic nodes at the same time step, the feature similarity between any two traffic nodes is calculated based on the hidden layer representation to generate an initial dynamic adjacency matrix representing the time-varying spatial dependency.

[0014] The initial dynamic adjacency matrix is ​​sparsified, retaining the connections of the K strongest neighboring nodes associated with the current node, and the sparsified matrix is ​​normalized to generate the dynamic adjacency matrix for the current time step.

[0015] In this scheme, a course-driven dynamic-static interpolation strategy is used to weightedly fuse the smoothed dynamic adjacency matrix with a predefined static adjacency matrix, generating a fused dynamic graph structure, including:

[0016] An exponentially weighted moving average mechanism is introduced to perform a weighted average of the dynamic adjacency matrix at the current time step and the smoothed dynamic adjacency matrix at the previous time step to obtain the smoothed dynamic adjacency matrix at the current time step.

[0017] Using a course learning coefficient that increases with each training round, the smooth dynamic adjacency matrix is ​​weighted and interpolated with a predefined static adjacency matrix to generate a fused dynamic graph structure for model training. The interpolation weights are dynamically adjusted with each training round, gradually transitioning from a static graph to a dynamic graph.

[0018] The predefined static adjacency matrix is ​​constructed based on the geographic distance of the sensors, road topology, or spatiotemporal data correlation.

[0019] In this scheme, within the bidirectional cross-attention spatiotemporal interaction module, based on the dynamic graph structure, a graph convolutional network is used to extract spatial features, and a gated recurrent unit is used to extract temporal features. The spatial and temporal features are then interactively fused through a bidirectional cross-attention mechanism to generate spatiotemporal fused features, including:

[0020] For each time step within a historical time window, a graph convolutional network is used, with the fused dynamic graph structure as a spatial relation constraint, to convolve and aggregate the features of traffic nodes, and extract the spatial feature sequence of nodes containing spatial dependencies.

[0021] For traffic nodes, the feature sequence of the historical time window is encoded using a gated loop unit. Through the gating mechanism of updating and resetting gates, the historical evolution trend and periodic pattern of the node are modeled, and the time feature sequence representing the node's own historical behavior pattern is extracted.

[0022] The spatial feature sequence and the temporal feature sequence are enhanced through a bidirectional cross-attention mechanism to generate temporal features enhanced with spatial context and spatial features enhanced with temporal trend. In the attention calculation process, a course learning coefficient related to the training round is introduced to dynamically adjust the weight ratio of self-attention and cross-attention.

[0023] By employing a learnable gating fusion mechanism, the temporal features enhanced by spatial context and the spatial features enhanced by temporal trend are adaptively weighted and fused to generate spatiotemporal fusion features.

[0024] In this scheme, for each training sample in the training set, a multi-dimensional difficulty estimator is used to perform multi-dimensional difficulty assessment on the training sample, generating a difficulty score for each sample, including:

[0025] From historical continuous multi-source heterogeneous data, spatiotemporal data segments are extracted using a sliding window according to the preset historical time window length and prediction time step length. Each spatiotemporal data segment and the corresponding future traffic ground value constitute training samples.

[0026] Based on the dynamic graph structure corresponding to the training samples, the degree centrality and clustering coefficient of the nodes are calculated, and the space complexity is evaluated.

[0027] Based on the historical flow sequences of each node in the training samples, the sample entropy, periodicity intensity, and volatility are calculated, and the time complexity is evaluated.

[0028] Calculate the rate of change of the dynamic adjacency matrix between adjacent time steps of the training sample within the historical time window, and evaluate the spatiotemporal coupling complexity.

[0029] The calculated space complexity, time complexity, and spatiotemporal coupling complexity are weighted and fused to obtain the overall difficulty score for each training sample, and then normalized.

[0030] In this scheme, the sample selection strategy is dynamically adjusted according to the training progress, and the model is trained in order of increasing difficulty using a course-based learning approach. This is achieved through an adaptive course scheduler, and the steps include:

[0031] At the beginning of each training round, a basic difficulty threshold is calculated based on the preset Pace function and the current training progress.

[0032] By combining the performance change feedback of the model on the most recent K rounds of validation sets, the basic difficulty threshold is adaptively adjusted to obtain the dynamic difficulty threshold for the current round;

[0033] For training samples in the training set, the weights sampled in this round are calculated using the exponential decay function based on the relationship between the difficulty score and the current dynamic difficulty threshold. The sampling weights of all training samples are normalized to generate the sampling probability of each training sample.

[0034] Based on the sampling probability, samples are drawn from the training set to form a weighted training batch for the current training round, which is used for updating the parameters of the model in this round.

[0035] In this scheme, the spatiotemporal fusion features are globally pooled to generate a global feature representation. Independent decoders are then constructed for multiple future prediction time steps. Based on the global feature representation, traffic flow prediction values ​​for each future time step are generated in parallel, including:

[0036] The spatiotemporal fusion features are subjected to global pooling in the time dimension to generate a global feature representation that characterizes the historical spatiotemporal patterns of all traffic nodes;

[0037] For each time step that needs to be predicted in the future, an independent multilayer perceptron is constructed as a decoder. All decoders work in parallel, and all take the global feature representation as input.

[0038] Each independent decoder outputs traffic flow prediction values ​​for the corresponding future time steps based on the global feature representation. The outputs of all decoders are stacked in the time dimension to generate a complete multi-step traffic flow prediction sequence.

[0039] During model training, the parameters of the multi-step parallel prediction head and all modules are optimized by calculating the mean square error between the predicted and actual values ​​at all future time steps.

[0040] The second aspect of the present invention provides a dynamic spatiotemporal graph traffic prediction system based on course learning, the system comprising: an offline training subsystem, an online inference subsystem, and an application service subsystem;

[0041] In the offline training subsystem, an adaptive course scheduler is used to dynamically adjust the difficulty threshold, and the prediction model is trained in order of difficulty from easy to difficult using a course learning method.

[0042] In the online inference subsystem, after receiving real-time historical spatiotemporal data, a dynamic adjacency matrix is ​​first generated for each time step through a graph structure learning module, and time smoothing is performed using exponential moving average. Spatiotemporal features are extracted using a GCN spatial encoder and a GRU temporal encoder, and the spatiotemporal features are interacted through a cross-attention mechanism. The gating fusion module adaptively integrates the bidirectional enhanced feature representations, and an independent MLP decoder is configured for each future time step. After global pooling, the multi-step prediction results are directly output.

[0043] The application service subsystem displays the road network traffic distribution in real time through a heatmap visualization module, triggers tiered early warning signals based on the predicted traffic threshold, and recommends the optimal route to travelers based on the traffic prediction results.

[0044] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0045] This invention enhances agricultural enterprises' real-time monitoring capabilities of internal logistics and supply chain networks within farms, supporting precise congestion warnings and route optimization decisions. This reduces on-farm vehicle congestion rates and supply chain turnaround delays, improving logistics efficiency and ultimately reducing farming and transportation costs. A learning mechanism further enhances the model's prediction accuracy for complex scenarios (concentrated feeding periods, disease control measures, and holiday logistics peaks), providing more reliable decision support for on-farm scheduling, emergency response, and other applications.

[0046] Traditional agricultural logistics flow forecasting relies on manual experience or conventional statistical models, resulting in low accuracy and poor timeliness. The dynamic spatiotemporal graph flow forecasting system captures the time-varying topology of the logistics network in real time using a time-smoothed dynamic graph encoder, significantly reducing training time compared to traditional dynamic graph methods. Based on an adaptive course scheduling mechanism, the system can automatically identify high-difficulty samples and adjust the training strategy, improving training convergence speed and model generalization ability. The system can automatically trigger alarms for predicted congested road sections or nodes and push flow forecast results for multiple future time steps. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments or examples of the present invention, the drawings used in the embodiments or examples will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained according to these drawings without creative effort.

[0048] Figure 1 A flowchart of a dynamic spatiotemporal graph-based flow prediction method based on curriculum learning is shown.

[0049] Figure 2 The flowchart of the prediction model algorithm architecture is shown;

[0050] Figure 3 The diagram shows the architecture of the bidirectional cross-attention spatiotemporal interaction module.

[0051] Figure 4 A schematic diagram of a multi-dimensional difficulty estimator is shown below;

[0052] Figure 5 A block diagram of a dynamic spatiotemporal graph-based flow prediction system based on curriculum learning is shown.

[0053] Figure 6 The data processing flowchart of a dynamic spatiotemporal graph-based traffic prediction system based on curriculum learning is shown. Detailed Implementation

[0054] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0055] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0056] like Figure 1 As shown, this embodiment provides a dynamic spatiotemporal graph-based traffic prediction method based on course learning, including:

[0057] Based on multi-source heterogeneous data of multiple traffic nodes in the traffic network within a historical time window, a spatiotemporal data matrix is ​​constructed. Based on the spatiotemporal data matrix, a dynamic adjacency matrix is ​​generated for each time step within the window using a graph structure learner.

[0058] Through a course-driven dynamic-static interpolation strategy, the smoothed dynamic adjacency matrix is ​​weighted and fused with a predefined static adjacency matrix to generate a fused dynamic graph structure.

[0059] Based on the dynamic graph structure, spatial features are extracted using a graph convolutional network, temporal features are extracted using a gated recurrent unit, and spatial and temporal features are interactively fused through a bidirectional cross-attention mechanism to generate spatiotemporal fusion features.

[0060] For each training sample in the training set, a multi-dimensional difficulty estimator is used to evaluate the difficulty of the training sample in multiple dimensions, generating a difficulty score for each sample. The sample selection strategy is dynamically adjusted according to the training progress, and the model is trained in order of difficulty from easy to difficult using a course learning approach.

[0061] The spatiotemporal fusion features are globally pooled to generate a global feature representation. Independent decoders are then constructed for multiple future prediction time steps, and traffic flow prediction values ​​for each future time step are generated in parallel based on the global feature representation.

[0062] It should be noted that, based on the spatiotemporal dependency propagation mechanism of logistics networks, a spatiotemporal dynamic graph prediction model is constructed for agricultural and supply chain scenarios, such as... Figure 2 As shown, it mainly includes a time-smoothed dynamic graph encoder, a bidirectional cross-attention spatiotemporal interaction module, a multi-dimensional difficulty estimator, an adaptive course scheduler, and a multi-step parallel prediction head.

[0063] In the time-smoothing dynamic graph encoder, the dynamic adjacency matrix of the traffic network at different time steps is learned. Through the EMA time smoothing mechanism and the course-learning driven dynamic-static interpolation strategy, a smooth transition from static graph to dynamic graph is achieved, solving the problems of unstable training and high computational cost of dynamic graph.

[0064] Input multi-source heterogeneous data from multiple traffic nodes within a historical time window. This multi-source heterogeneous data includes, but is not limited to, vehicle speed, traffic flow, occupancy rate, time, and weather. Construct a spatiotemporal data matrix with dimensions of time steps × number of nodes × number of features. For each time step within the historical time window, generate the spatiotemporal data matrix corresponding to the multi-source heterogeneous data of each traffic node. Through learnable linear transformation matrices Perform feature encoding to obtain the hidden layer representation of each traffic node at the current time step. , is represented as:

[0065] ,

[0066] For all traffic nodes at the same time step, calculate the feature similarity between any two traffic nodes based on the hidden layer representation. Generate an initial dynamic adjacency matrix representing time-varying spatial dependencies;

[0067] The initial dynamic adjacency matrix is ​​sparsified, retaining the connections of the K strongest neighboring nodes associated with the current node, and then normalized to generate the dynamic adjacency matrix for the current time step. , is represented as:

[0068] ,

[0069] in, To retain the connections of the K strongest neighbor nodes associated with the current node, the connections of the rest are set to zero.

[0070] To avoid drastic changes in graph structure between adjacent time steps, an exponentially weighted moving average mechanism is introduced. This mechanism calculates a weighted average of the dynamic adjacency matrix at the current time step and the smoothed dynamic adjacency matrix at the previous time step, yielding the smoothed dynamic adjacency matrix at the current time step. , is represented as:

[0071] ,

[0072] in For smoothing coefficients, Represents the smoothed dynamic adjacency matrix at time t-1;

[0073] During training, a course learning coefficient that increases with each training epoch is used to perform weighted interpolation fusion between the smoothed dynamic adjacency matrix and a predefined static adjacency matrix, generating a fused dynamic graph structure for model training. The predefined static adjacency matrix is ​​constructed based on sensor geographic distance, road topology, or spatiotemporal data correlation. The interpolation weights are dynamically adjusted with each training epoch, gradually transitioning from a static to a dynamic graph; the course learning coefficient... The mixing ratio of static and dynamic graphs is controlled as follows:

[0074] ,

[0075] in, For the current training round, For a predefined static adjacency matrix, For the preheating round, Let be the adjacency matrix after the course learning at time t.

[0076] It should be noted that spatial features are extracted through GCN and temporal features are extracted through GRU. Then, the features are mutually enhanced through a bidirectional cross-attention mechanism. Finally, the spatiotemporal fusion features are obtained through gating fusion, thereby capturing the complex spatiotemporal evolution patterns in traffic flow more accurately.

[0077] like Figure 3 As shown, for each time step within a historical time window, a graph convolutional network is used, with the fused dynamic graph structure as a spatial relation constraint, to convolve and aggregate the features of traffic nodes, extracting a sequence of spatial features containing spatial dependencies. For example, during concentrated feeding periods, the delivery demand of the feed tower is affected by the delivery rhythm of its upstream feed mill. For traffic nodes, a gated recurrent unit is used to encode the feature sequence of the historical time window. Through the gating mechanism of update gate and reset gate, the historical evolution trend and periodic pattern of the nodes are modeled, and the time feature sequence representing the node's own historical behavior pattern is extracted. For example, the daily periodic trend of feed consumption increasing during the morning and evening feeding periods and decreasing at noon can be identified, or the weekly and monthly periodic patterns of a significant increase in meat product outflow before holidays can be observed.

[0078] The spatial feature sequence With the time feature sequence Interaction enhancement is achieved through a bidirectional cross-attention mechanism, and in spatial enhancement of temporal features, the temporal feature sequence is used as the query. Using the spatial feature sequence as the key Sum By using cross-attention computation, global spatial structure information is dynamically injected into temporal features to obtain spatial context-aware temporal features. , is represented as:

[0079] ,

[0080] in, , , This is a trainable weight matrix;

[0081] In temporally enhanced spatial features, the spatial feature sequence is used as the query. Using the time feature sequence as the key Sum By using cross-attention computation, temporal evolution pattern information is dynamically injected into spatial features to obtain spatial features with temporal evolution perception. , is represented as:

[0082] ,

[0083] in, , , This is a trainable weight matrix;

[0084] During the attention calculation process, a course learning coefficient related to the training rounds is introduced. This is used to dynamically adjust the weight ratio of self-attention and cross-attention. In the early stages of training, emphasis is placed on self-attention learning within features, while the weight of cross-attention is gradually increased as training progresses. This effectively avoids optimization difficulties caused by complex interactions in the early stages of training, improving training efficiency and final performance. Course-driven self-attention and cross-attention are represented as follows:

[0085] ,

[0086] in Self-attention with temporal characteristics, Self-attention for spatial features , These are the enhanced temporal features and enhanced spatial features obtained from cross-attention calculations after course learning-driven learning.

[0087] By employing a learnable gating fusion mechanism, temporal features enhanced with spatial context and spatial features enhanced with temporal trend are adaptively weighted and fused to generate spatiotemporal fusion features. , is represented as:

[0088] ,

[0089] in For adaptive fusion weights;

[0090] Gating mechanisms enable models to adaptively decide whether to retain more information from the time dimension or the spatial dimension in spatiotemporal fusion features, providing flexibility for feature fusion.

[0091] It should be noted that the multi-dimensional difficulty estimator jointly evaluates space complexity, time complexity, and spatiotemporal coupling complexity, providing a scientific quantitative index of sample difficulty for course learning. For each sample in the training set, the complexity of the three dimensions is calculated separately, and then weighted and fused to obtain the overall difficulty score.

[0092] like Figure 4As shown, spatiotemporal data segments are extracted from historical continuous multi-source heterogeneous data according to the preset historical time window length and prediction time step length using a sliding window. Each spatiotemporal data segment and the corresponding future traffic ground value constitute training samples. Each sample encapsulates the local spatiotemporal pattern of a specific historical period and the corresponding future evolution ground value. The training set is formed based on a large number of spatiotemporal sample sets. The goal of the model is to extract the complex mapping relationship from historical spatiotemporal patterns to future traffic from the samples.

[0093] Based on the dynamic graph structure corresponding to the training samples, the degree centrality and clustering coefficient of the nodes are calculated to evaluate the space complexity and quantify the spatial modeling difficulty caused by network topology connections; the degree centrality Calculate the average number of connections for each node in the dynamic graph within the time window corresponding to the training samples. Nodes with higher degrees (such as large feed mills or regional distribution centers) are more influenced by their neighbors, resulting in more complex spatial modeling, as represented by:

[0094] ,

[0095] in, Let represent the element in the i-th row and j-th column of the dynamic adjacency matrix, representing the association strength between node i and node j. This represents the total number of nodes in the transportation network. For index variables, This indicates that for all nodes The degree takes the maximum value;

[0096] The clustering coefficient The degree to which a node's neighbors are also interconnected is represented as:

[0097] ,

[0098] in Let be the degree of the node. When clustering neighbors, a low clustering coefficient indicates fewer connections between neighbors and a more complex pattern. Let be any two distinct neighboring nodes in the neighbor set of node i. For connecting nodes The edge, This is the set of all edges in the dynamic graph;

[0099] The space complexity is expressed as:

[0100] in , These are the weighting coefficients.

[0101] Based on the historical flow sequences of each node in the training samples, the sample entropy, periodicity, and volatility are calculated to assess time complexity and quantify the prediction difficulty caused by the inherent uncertainty and volatility of the time series. The sample entropy... Calculate the degree of disorder in the distribution of sequence values. A higher entropy value indicates greater randomness and uncertainty in the sequence, making prediction more difficult. This is expressed as:

[0102] ,

[0103] in The empirical probability that the historical flow sequence value of node i falls into the j-th discrete interval; This refers to the number of discrete intervals into which the range of sequence values ​​is divided when calculating entropy;

[0104] The periodic intensity The energy intensity of the sequence at key frequencies such as daily and weekly periods is analyzed using Fourier transform. The weaker the periodicity, the less the sequence follows a regular pattern (e.g., sudden congestion), and the more difficult it is to predict. This is expressed as:

[0105] ,

[0106] in Let be the flow value of node i at the t-th time step within the historical time window. The length of the historical time window, Angular frequency, For the time series of node i in frequency The squared magnitude of the discrete Fourier transform coefficients at point . The imaginary unit;

[0107] The volatility Calculate the standard deviation of the series with the mean The ratio of [the two values]. A higher value indicates more volatile relative fluctuations in the sequence, lower stability, and greater difficulty in prediction, expressed as:

[0108] ,

[0109] in For smoothing terms;

[0110] The time complexity is expressed as: ,in , , These are the weighting coefficients;

[0111] Calculate the rate of change of the dynamic adjacency matrix between adjacent time steps of the training samples within the historical time window, and perform spatiotemporal coupling complexity. The assessment quantifies the dramatic evolution of spatial dependencies over time, directly capturing the dynamics and non-stationarity of spatiotemporal interactions, and is expressed as:

[0112] ,

[0113] in This represents the change in the spatial relationship matrix between adjacent time steps. , Let t be the t-th time step and t-1 be the time step within the historical time window. The length of the historical time window;

[0114] The calculated space complexity, time complexity, and spatiotemporal coupling complexity are weighted and fused to obtain the overall difficulty score for each training sample. This score is then normalized, and the three dimensions are combined to obtain the difficulty score for each node. , is represented as:

[0115] ,

[0116] in , , These are the weighting coefficients.

[0117] It should be noted that the adaptive course scheduler dynamically adjusts the difficulty threshold by combining training progress and validation set feedback, and uses an exponential weight sampling strategy to select the training order of samples, so as to achieve course learning from easy to difficult.

[0118] At the beginning of each training round, a basic difficulty threshold is calculated based on the preset Pace function and the current training progress. It grows smoothly with the increase of training rounds, as shown below:

[0119] ,

[0120] in For the current round, For the total number of training rounds, Pace index;

[0121] Based on the performance changes of the model on the most recent K rounds of validation sets, the basic difficulty threshold is adaptively adjusted to obtain the dynamic difficulty threshold for the current round. , is represented as:

[0122] ,

[0123] in Feedback on the changes in loss in the most recent k rounds of validation. To adjust the coefficients, if the validation loss continues to decrease significantly, it indicates that the model is learning smoothly and has a strong ability to digest samples of current difficulty. In this case, the difficulty threshold is automatically increased, allowing the model to encounter more difficult samples earlier, accelerating the learning process and improving learning efficiency. If the validation loss stagnates or increases, it indicates that the model may be encountering a bottleneck or overfitting at the current difficulty level. The difficulty threshold is automatically decreased or maintained to slow down the learning process, consolidate learning at the current difficulty level, and avoid training instability or collapse due to premature exposure to overly difficult samples.

[0124] For the training samples in the training set, the weights sampled in this round are calculated using an exponential decay function, based on the relationship between the difficulty score and the current dynamic difficulty threshold. ,in The attenuation coefficient is... To determine the difficulty of training sample n, a decay exponent ensures that the weights of samples with different difficulties change continuously, preventing drastic changes in the training data distribution and maintaining exploratory nature while avoiding getting trapped in local optima. The sampling weights of all training samples are normalized to generate a sampling probability for each training sample. Based on these sampling probabilities, samples are drawn from the training set to form a weighted training batch for the current training round, used for updating the model's parameters in this round.

[0125] It should be noted that the multi-step parallel prediction head designs an independent MLP decoder for each future time step to achieve parallel prediction and avoid error accumulation in traditional autoregressive methods. The spatiotemporal fusion features are then subjected to global pooling in the time dimension to generate a global feature representation characterizing the historical spatiotemporal patterns of all traffic nodes.

[0126] For each time step requiring future prediction, an independent multilayer perceptron is constructed as a decoder. All decoders operate in parallel, each taking the global feature representation as input. Each independent decoder outputs a traffic flow prediction value for the corresponding future time step based on the global feature representation. The outputs of all decoders are stacked along the time dimension to generate a complete sequence of future multi-step traffic flow predictions. The decoder is represented as follows:

[0127] ,

[0128] in For the future A matrix of traffic flow predictions at each time step. For global feature representation, , The first The weight matrices of the first and second layers of the decoder , The first The bias vectors of the first and second layers of the decoder.

[0129] During model training, the mean squared error (MSE) between the predicted and true values ​​at all future time steps is calculated and used as the training loss. The model optimizes the parameters of all decoders and all front-end modules simultaneously through backpropagation to minimize the global multi-step prediction error.

[0130] like Figure 5 As shown, the second embodiment of the present invention provides a dynamic spatiotemporal graph traffic prediction system based on course learning. The system includes: an offline training subsystem, an online inference subsystem, and an application service subsystem.

[0131] In the offline training subsystem, a fixed-length historical spatiotemporal sequence is extracted from historical traffic time-series data using a sliding window as input, and the corresponding future multi-step traffic sequence is used as the prediction target to form multiple spatiotemporal training samples, which constitute the training set. An adaptive course scheduler is used to dynamically adjust the difficulty threshold, and the prediction model is trained in order of difficulty from easy to difficult using a course learning method.

[0132] In the online inference subsystem, after receiving real-time historical spatiotemporal data, a dynamic adjacency matrix is ​​first generated for each time step through a graph structure learning module, and time smoothing is performed using exponential moving average. Spatiotemporal features are extracted using a GCN spatial encoder and a GRU temporal encoder, and the spatiotemporal features are interacted through a cross-attention mechanism. The gating fusion module adaptively integrates the bidirectional enhanced feature representations, and an independent MLP decoder is configured for each future time step. After global pooling, the multi-step prediction results are directly output.

[0133] In the application service subsystem, the prediction matrix output by the online inference subsystem... Perform inverse normalization to restore the flow rate to a value with actual physical units. , The training set contains the standard deviation and mean. The prediction results are visualized in real-time using a heatmap visualization module to show the traffic distribution within the farm or supply chain network, generating logistics traffic heatmaps, key node prediction curves, and congestion propagation animations. Based on the prediction results, business rules are triggered, and tiered early warning signals are activated according to predicted traffic thresholds. When the predicted traffic exceeds the threshold, tiered early warnings (such as yellow, orange, and red) are automatically generated and pushed to relevant platforms. Combined with the traffic prediction results, optimal delivery route solutions are recommended to on-site dispatchers. Predicted traffic data for key nodes is provided to the dispatch control system as a basis for dynamically adjusting delivery plans.

[0134] In the data processing flow of the dynamic spatiotemporal graph flow prediction system based on course learning, such as Figure 6As shown, multi-source heterogeneous data is read from multiple data sources such as traffic sensors, weather stations, and map data. This multi-source heterogeneous data includes vehicle speed, traffic flow, occupancy rate, time, and weather. The cleaned data is reorganized into a spatiotemporal matrix, and data normalization is performed to generate historical spatiotemporal data. A static adjacency matrix is ​​constructed based on the geographic location of the sensors, road topology, or correlation of historical data. This matrix is ​​imported into a prediction model to obtain prediction results for multiple future time steps. Inverse normalization is performed to restore the original dimensions, and the prediction results are saved as a time series data table and pushed to the application service subsystem for visualization.

[0135] It should be noted that the technical solution of this invention is universal and can be applied to various traffic prediction scenarios with spatiotemporal dependencies. The accompanying drawings and some embodiments use urban traffic scenarios as examples for illustration only, and are not intended to limit the application scenarios of this invention. This invention is also applicable to scenarios such as logistics within livestock farms, agricultural product supply chain networks, and industrial material flow.

[0136] A third embodiment of the present invention provides a computer-readable storage medium, which includes a program for a dynamic spatiotemporal graph traffic prediction method based on course learning. When the program for a dynamic spatiotemporal graph traffic prediction method based on course learning is executed by a processor, it implements the steps of a dynamic spatiotemporal graph traffic prediction method based on course learning.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical, or other forms. Furthermore, in the various embodiments of the present invention, all functional units can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0138] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0139] The above description is merely a 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 conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A dynamic spatiotemporal graph-based flow prediction method based on curriculum learning, characterized in that, Includes the following steps: Based on multi-source heterogeneous data of multiple traffic nodes in the traffic network within a historical time window, a spatiotemporal data matrix is ​​constructed. Based on the spatiotemporal data matrix, a dynamic adjacency matrix is ​​generated for each time step within the window using a graph structure learner. Through a course-driven dynamic-static interpolation strategy, the smoothed dynamic adjacency matrix is ​​weighted and fused with a predefined static adjacency matrix to generate a fused dynamic graph structure. Based on the dynamic graph structure, spatial features are extracted using a graph convolutional network, temporal features are extracted using a gated recurrent unit, and spatial and temporal features are interactively fused through a bidirectional cross-attention mechanism to generate spatiotemporal fusion features. For each training sample in the training set, a multi-dimensional difficulty estimator is used to evaluate the difficulty of the training sample in multiple dimensions, generating a difficulty score for each sample. The sample selection strategy is dynamically adjusted according to the training progress, and the model is trained in order of difficulty from easy to difficult using a course learning approach. The spatiotemporal fusion features are globally pooled to generate a global feature representation. Independent decoders are then constructed for multiple future prediction time steps. Traffic flow prediction values ​​for each future time step are generated in parallel based on the global feature representation. Through a course-driven dynamic-static interpolation strategy, the smoothed dynamic adjacency matrix is ​​weighted and fused with a predefined static adjacency matrix to generate a fused dynamic graph structure, including: An exponentially weighted moving average mechanism is introduced to perform a weighted average of the dynamic adjacency matrix at the current time step and the smoothed dynamic adjacency matrix at the previous time step to obtain the smoothed dynamic adjacency matrix at the current time step. Using a course learning coefficient that increases with each training round, the smooth dynamic adjacency matrix is ​​weighted and interpolated with a predefined static adjacency matrix to generate a fused dynamic graph structure for model training. The interpolation weights are dynamically adjusted with each training round, gradually transitioning from a static graph to a dynamic graph. The predefined static adjacency matrix is ​​constructed based on the geographic distance of the sensors, road topology, or spatiotemporal data correlation. The sample selection strategy is dynamically adjusted according to the training progress. The model is trained in order of increasing difficulty using a course-based learning approach, which is achieved through an adaptive course scheduler. The steps include: At the beginning of each training round, a basic difficulty threshold is calculated based on the preset Pace function and the current training progress. By combining the performance change feedback of the model on the most recent K rounds of validation sets, the basic difficulty threshold is adaptively adjusted to obtain the dynamic difficulty threshold for the current round; For training samples in the training set, the weights sampled in this round are calculated using the exponential decay function based on the relationship between the difficulty score and the current dynamic difficulty threshold. The sampling weights of all training samples are normalized to generate the sampling probability of each training sample. Based on the sampling probability, samples are drawn from the training set to form a weighted training batch for the current training round, which is used for updating the parameters of the model in this round.

2. The dynamic spatiotemporal graph flow prediction method based on course learning according to claim 1, characterized in that, In the time-smoothing dynamic graph encoder, a spatiotemporal data matrix is ​​constructed based on multi-source heterogeneous data of multiple traffic nodes in the traffic network within a historical time window. Based on this spatiotemporal data matrix, a dynamic adjacency matrix is ​​generated for each time step within the window using a graph structure learner, including: For each time step within a historical time window, the spatiotemporal data matrix corresponding to the multi-source heterogeneous data of each traffic node is feature-encoded through a learnable linear transformation matrix to obtain the hidden layer representation of each traffic node at the current time step. The multi-source heterogeneous data includes vehicle speed, traffic flow, occupancy rate, time, and weather. For all traffic nodes at the same time step, the feature similarity between any two traffic nodes is calculated based on the hidden layer representation to generate an initial dynamic adjacency matrix representing the time-varying spatial dependency. The initial dynamic adjacency matrix is ​​sparsified, retaining the connections of the K strongest neighboring nodes associated with the current node, and the sparsified matrix is ​​normalized to generate the dynamic adjacency matrix for the current time step.

3. The dynamic spatiotemporal graph flow prediction method based on course learning according to claim 1, characterized in that, In the bidirectional cross-attention spatiotemporal interaction module, based on the dynamic graph structure, a graph convolutional network is used to extract spatial features, and a gated recurrent unit is used to extract temporal features. The spatial and temporal features are then interactively fused through a bidirectional cross-attention mechanism to generate spatiotemporal fused features, including: For each time step within a historical time window, a graph convolutional network is used, with the fused dynamic graph structure as a spatial relation constraint, to convolve and aggregate the features of traffic nodes, and extract the spatial feature sequence of nodes containing spatial dependencies. For traffic nodes, the feature sequence of the historical time window is encoded using a gated loop unit. Through the gating mechanism of updating and resetting gates, the historical evolution trend and periodic pattern of the node are modeled, and the time feature sequence representing the node's own historical behavior pattern is extracted. The spatial feature sequence and the temporal feature sequence are enhanced through a bidirectional cross-attention mechanism to generate temporal features enhanced with spatial context and spatial features enhanced with temporal trend. In the attention calculation process, a course learning coefficient related to the training round is introduced to dynamically adjust the weight ratio of self-attention and cross-attention. By employing a learnable gating fusion mechanism, the temporal features enhanced by spatial context and the spatial features enhanced by temporal trend are adaptively weighted and fused to generate spatiotemporal fusion features.

4. The dynamic spatiotemporal graph flow prediction method based on course learning according to claim 1, characterized in that, For each training sample in the training set, a multi-dimensional difficulty estimator is used to evaluate the difficulty of the training sample in multiple dimensions, generating a difficulty score for each sample, including: From historical continuous multi-source heterogeneous data, spatiotemporal data segments are extracted using a sliding window according to the preset historical time window length and prediction time step length. Each spatiotemporal data segment and the corresponding future traffic ground value constitute training samples. Based on the dynamic graph structure corresponding to the training samples, the degree centrality and clustering coefficient of the nodes are calculated, and the space complexity is evaluated. Based on the historical flow sequences of each node in the training samples, the sample entropy, periodicity intensity, and volatility are calculated, and the time complexity is evaluated. Calculate the rate of change of the dynamic adjacency matrix between adjacent time steps of the training sample within the historical time window, and evaluate the spatiotemporal coupling complexity. The calculated space complexity, time complexity, and spatiotemporal coupling complexity are weighted and fused to obtain the overall difficulty score for each training sample, and then normalized.

5. The dynamic spatiotemporal graph flow prediction method based on course learning according to claim 1, characterized in that, The spatiotemporal fusion features are globally pooled to generate a global feature representation. Independent decoders are then constructed for multiple future prediction time steps. Based on the global feature representation, traffic flow prediction values ​​for each future time step are generated in parallel, including: The spatiotemporal fusion features are subjected to global pooling in the time dimension to generate a global feature representation that characterizes the historical spatiotemporal patterns of all traffic nodes; For each time step that needs to be predicted in the future, an independent multilayer perceptron is constructed as a decoder. All decoders work in parallel, and all take the global feature representation as input. Each independent decoder outputs traffic flow prediction values ​​for the corresponding future time steps based on the global feature representation. The outputs of all decoders are stacked in the time dimension to generate a complete multi-step traffic flow prediction sequence. During model training, the parameters of the multi-step parallel prediction head and all modules are optimized by calculating the mean square error between the predicted and actual values ​​at all future time steps.

6. A dynamic spatiotemporal graph-based flow prediction system based on curriculum learning, characterized in that, To implement the dynamic spatiotemporal graph traffic prediction method based on course learning as described in any one of claims 1-5, the system includes: an offline training subsystem, an online inference subsystem, and an application service subsystem; In the offline training subsystem, an adaptive course scheduler is used to dynamically adjust the difficulty threshold, and the prediction model is trained in order of difficulty from easy to difficult using a course learning method. In the online inference subsystem, after receiving real-time historical spatiotemporal data, a dynamic adjacency matrix is ​​first generated for each time step through a graph structure learning module, and time smoothing is performed using exponential moving average. Spatiotemporal features are extracted using a GCN spatial encoder and a GRU temporal encoder, and the spatiotemporal features are interacted through a cross-attention mechanism. The gating fusion module adaptively integrates the bidirectional enhanced feature representations, and an independent MLP decoder is configured for each future time step. After global pooling, the multi-step prediction results are directly output. The application service subsystem displays the road network traffic distribution in real time through a heatmap visualization module, triggers tiered early warning signals based on the predicted traffic threshold, and recommends the optimal route to travelers based on the traffic prediction results.