Multi-dimensional spatial-temporal feature OD path traffic prediction method and device of GCN
By integrating multi-source data and an improved GCN model, combined with Transformer feature fusion technology, the long-tail effect and spatial sparsity problems in OD path traffic prediction are solved, achieving high-precision and robust prediction results and supporting refined decision-making in urban traffic management.
Patent Information
- Application Number
- CN202511950618.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-17
AI Technical Summary
Existing OD path traffic prediction methods fail to effectively integrate multi-dimensional spatiotemporal features, resulting in low prediction accuracy and insufficient robustness. They are ill-suited to the complexity of urban traffic and multi-dimensional disturbance factors, and traditional GCN models struggle to handle OD path node inputs of variable length.
We propose a multi-dimensional spatiotemporal feature-based OD path flow prediction method using GCN. By integrating multi-source data and employing a dual-branch processing architecture combining temporal and spatial data, along with Transformer feature fusion technology, we improve the GCN model to adapt to variable-length inputs and address the issues of long-tailed data and spatial sparsity.
It significantly improves the accuracy and robustness of OD route traffic prediction, adapts to the road network structure of different cities, and supports refined decision-making in traffic management.
Smart Images

Figure CN121684201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of intelligent transportation and artificial intelligence, specifically to a method and apparatus for predicting OD path traffic flow using multidimensional spatiotemporal characteristics of GCN. Background Technology
[0002] Origin-destination (OD) path flow prediction is one of the core functions of intelligent transportation systems, and its accuracy directly affects the level of precision in traffic management. With the widespread deployment of urban traffic detection equipment, massive amounts of multi-source traffic data have accumulated, but traditional prediction methods still face many bottlenecks:
[0003] Traditional LSTM time series models focus only on the temporal characteristics of traffic flow, ignoring the inherent spatial correlation of traffic data and failing to consider spatial factors such as road network topology and POI distribution, resulting in limited prediction accuracy. While Conv-LSTM incorporates convolutional features, it still does not fully explore the dynamic patterns of spatial changes and cannot adapt to the nonlinearity and complexity of traffic flow. Furthermore, urban traffic operations are affected by various disturbances such as weather and holidays; existing methods have low data utilization and fail to fully integrate these multidimensional features, making it difficult to accurately capture the changing trends of traffic flow.
[0004] In practical applications, two key issues remain: First, OD path traffic data exhibits a significant long-tail effect, with some paths having extremely low traffic volume, leading to model predictions biased towards high-traffic paths and insufficient accuracy in critical path predictions. Second, uneven coverage of detection equipment results in sparse spatial data, making it difficult for traditional GCN models to handle variable-length OD path node inputs and effectively mine spatial features. These shortcomings lead to poor generalization and insufficient robustness of existing methods, failing to meet the practical needs of refined urban traffic management.
[0005] While GCN-based methods can handle spatial features, traditional GCN methods struggle to adapt to the variable number of OD path nodes and do not incorporate temporal features and multidimensional perturbation factors. Therefore, developing an improved GCN prediction method and device that integrates multidimensional spatiotemporal features and addresses the long-tail and sparsity issues has significant engineering application value for promoting the optimization of intelligent transportation systems. Summary of the Invention
[0006] To address the problems in existing technologies, this invention provides a multi-dimensional spatiotemporal feature-based OD path traffic prediction method and apparatus using GCN. By integrating six types of multi-source data and adopting a dual-branch processing architecture combining temporal and spatial data, the GCN model is improved to adapt to variable-length inputs. Combined with Transformer feature fusion technology, the invention solves the challenges of long-tailed data, spatial sparsity, and multi-dimensional feature fusion, thereby improving the accuracy, robustness, and generalization of OD path traffic prediction.
[0007] The technical solution adopted by this invention to solve its technical problem is: a multidimensional spatiotemporal feature OD path traffic prediction method for GCN, comprising the following steps:
[0008] (1) Data access: Acquire six types of data sources, including traffic camera / checkpoint vehicle data, meteorological data, holiday data, road network topology data, urban POI data, and equipment configuration information;
[0009] (2) Time-series data processing:
[0010] ① Data cleaning: Delete missing values where the license plate is empty or where both the device and geographic information are empty; fill missing values where only the device is empty by matching geographic coordinates; delete abnormal license plate number data; and replace meteorological anomalies that do not match the season.
[0011] ② Long-tail processing: Dynamically adjust the threshold for the proportion of trip volume and filter high-demand OD routes that exceed the threshold;
[0012] ③ Individual vehicle OD identification: Based on the vehicle passing time difference threshold, O points and D points are filtered by sorting and difference calculation, following the formula: , , ,
[0013] , ;
[0014] ④ Traffic statistics: according to the formula Aggregate the number of vehicles with the same OD point. ;
[0015] ⑤ Data Fusion: Link traffic data, meteorological data, and holiday data by date and location;
[0016] (3) Spatial data processing:
[0017] ① Graph structure construction: Intersections and POIs are used as nodes (including attributes such as coordinates and POI type), and road segments between intersections and road segments between POIs and adjacent intersections are used as directed edges (including attributes such as distance and road type) to form a comprehensive directed graph;
[0018] ② Matrix transformation: Convert the composite graph into an adjacency matrix and a node feature matrix (including O / D point attributes, POI type, and distance from nodes to O / D points);
[0019] (4) Feature extraction:
[0020] ① Parallel feature extraction: Conv-LSTM extracts temporal features (periodicity, trend), and improved GCN extracts spatial features (Transformer Encoder encoding plus DGL dynamic layer processing of variable-length input and GCN layer aggregation).
[0021] ②Transformer Feature Fusion: Adaptively adjusts the weights of temporal and spatial features, and performs weighted summation and fusion;
[0022] (5) Predicted output: Input the fused features into the fully connected layer and infer the OD path flow for the next day.
[0023] Specifically, in step (2) For time; This represents the data for each vehicle, sorted by time. Indicates the first Data items; This indicates calculating the time difference between two consecutive data points for the same vehicle. This indicates the set time threshold; Indicate the filtering criteria; Statistical similarity Number of vehicles at the point; Represents a set The filter counts the number of elements with the same O and D points in the current query. and They represent the first Points O and D of the vehicle, Indicates the first The car time.
[0024] Specifically, the threshold for the proportion of travel volume in step (2) can be dynamically adjusted within the range of 3% to 8% to adapt to the traffic characteristics of different cities.
[0025] Specifically, in step (3), the adjacency matrix represents the connection relationship between nodes, and each row of the node feature matrix corresponds to the attribute features of a single node on the OD path. The dimensions include O point attribute, D point attribute, POI type, node to O point distance, and node to D point distance.
[0026] Specifically, the processing flow of the improved GCN in step (4) is as follows: initialize weight parameters → TransformerEncoder encodes node features → DGL dynamic layer packs variable length sequences → RNN layer calculation → unpacking and filling → GCN layer aggregates neighbor and self features → splices encoded features and aggregated features.
[0027] Specifically, in step (4), the parameters of Conv-LSTM are set as follows: batch size =32~64, sequence length =7~14 days, input dim =5~8, activation function is ReLU, loss function is RMSE or MAE; Transformer fusion layer contains 2~4 attention heads.
[0028] A multi-dimensional spatiotemporal OD path flow prediction device for GCN, comprising: a data access module, a data processing module, a feature extraction module, a model application module, and a processor, a memory, and a bus for implementing the functions of each module; the bus connects the processor and the memory, the memory stores the computer program, and the processor executes the program to achieve the following functions:
[0029] (1) Data access module: It acquires six types of data, including vehicle traffic, weather, holidays, road network topology, POI, and equipment configuration, through the API interface and updates data resources in real time;
[0030] (2) Data processing module: includes time-series processing branch and spatial processing branch. The time-series branch performs data cleaning, long-tail processing, OD identification, traffic statistics and data fusion. The spatial branch performs graph structure construction and matrix transformation.
[0031] (3) Feature extraction module: including Conv-LSTM unit, improved GCN unit and Transformer fusion unit. Conv-LSTM unit extracts temporal features, improved GCN unit integrates Transformer Encoder and DGL dynamic layer, and Transformer unit fuses two-dimensional features.
[0032] (4) Model application module: Based on the fusion feature reasoning, output the OD path flow for the next day to support traffic planning, resource allocation or congestion mitigation analysis.
[0033] Specifically, the data processing module has a time-series branch processing cycle of 24 hours / time and a spatial branch processing cycle of 7 days / time, which can be dynamically adjusted according to the road network update frequency.
[0034] Specifically, the improved GCN unit of the feature extraction module packages the variable-length node sequence into a fixed-length representation (packaging length = 32~64) through the RNN layer, adapting to the difference in the number of nodes in different OD paths.
[0035] Specifically, the memory stores more than two years of training data, model weight files, and intermediate data such as adjacency matrices and node feature matrices. The processor is an Intel Core i7 or higher model, supporting parallel computing.
[0036] The beneficial effects of this invention are:
[0037] Multi-dimensional feature integration: It integrates six types of multi-source data, covering temporal disturbance factors (weather, holidays) and spatial features (road network topology, POI), and comprehensively considers the influencing factors of traffic flow, significantly improving prediction accuracy.
[0038] Breakthrough in core technologies: The long-tail effect is solved by dynamic thresholding, and the improved GCN with Transformer Encoder and DGL handles variable-length inputs and spatial data sparsity, improving model stability and robustness.
[0039] Strong generalization ability: It supports dynamic adjustment of parameters such as travel volume ratio threshold and time threshold, adapts to the road network structure and traffic characteristics of different cities, and can be widely used in intelligent transportation systems of cities of all sizes.
[0040] It has good engineering feasibility: the device has a clear modular architecture, standardized hardware configuration, and automated data processing and model inference processes. It can be directly deployed on the existing platforms of traffic management departments and quickly transformed into practical application value.
[0041] Strong decision support capability: The accurate prediction results focus on high-demand OD paths, which can provide a scientific basis for traffic signal optimization, road network expansion planning, public transportation scheduling, etc., and improve the efficiency of urban traffic operation. Attached Figure Description
[0042] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0043] Figure 1 A block diagram for designing an OD path flow prediction device based on an improved model;
[0044] Figure 2 This is a schematic diagram of a directed graph integrating road network topology and Points of Interest (POIs).
[0045] Figure 3 It is a multidimensional spatiotemporal OD path flow prediction device. Detailed Implementation
[0046] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0047] like Figure 2 As shown, the multidimensional spatiotemporal feature OD path traffic prediction method of GCN described in this invention includes the following steps:
[0048] 1. Data Access Steps: Access 6 core data sources to ensure data comprehensiveness and integrity:
[0049] Vehicle data from electronic police / checkpoints: including license plate number, detection time, equipment number, equipment location coordinates, etc., sourced from electronic police, checkpoint, or radar-based surveillance equipment deployed on urban roads;
[0050] Meteorological data: including daily weather type (sunny, rainy, heavy rain, heavy snow, etc.) and temperature information, sourced from urban meteorological stations;
[0051] Holiday data: Includes public holidays and statutory holidays, organized by annual calendar information;
[0052] Road network topology data: containing the geospatial structure of all intersections and road segments in the city, sourced from electronic maps;
[0053] City POI data: including the type, name, and coordinates of points of interest such as shopping malls, schools, and hospitals, sourced from electronic maps;
[0054] Equipment configuration information: A self-created upstream and downstream relationship table for testing equipment, used to establish logical connections between various testing equipment in vehicle data.
[0055] 2. Time-series data processing steps: This step optimizes the processing of time-series data to address its quality defects and distribution characteristics, laying the foundation for time-series feature extraction.
[0056] ① Data cleaning:
[0057] Missing value handling: A deletion and padding strategy is adopted to delete data where the license plate information is empty or where both the detection device and geographical information are empty, so as to avoid interference from invalid data; for data where only the detection device is empty, it is filled by associating its geographical coordinates with the location of surrounding detection devices to ensure data integrity.
[0058] Outlier handling: Delete license plate numbers that are abnormal (e.g., fewer than 5 or more than 7 digits), as these are often caused by errors in the license plate recognition algorithm; for outliers in meteorological data that do not match the season (e.g., snowstorms in July), replace them with meteorological data from nearby meteorological stations for the same period to ensure data rationality.
[0059] ② Long-tail data processing:
[0060] Due to the randomness of vehicle travel and the spatial differences in the deployment of detection equipment, OD path traffic data exhibits a significant long-tail effect (some paths have very low traffic, while others have extremely high traffic). Based on business needs, a travel volume percentage threshold (3%~8%) is set, dynamically adjusted for the traffic characteristics of different cities, and high-demand OD paths exceeding the threshold are selected for prediction. This focuses on key commuter corridors and core paths, improving the relevance and stability of the model's predictions.
[0061] ③ Individual vehicle OD recognition:
[0062] By linking vehicle data with equipment configuration information, filter the vehicle's O point (start point) and D point (end point) using the following formula:
[0063] The vehicle passage data for each vehicle is sorted according to time T to obtain the sorted time series DT;
[0064] : Calculate the time difference between two consecutive vehicle passage data points for the same vehicle. ;
[0065] Set time threshold (30~60min), filter out those with a time difference ≥ The index set I, where the threshold corresponds to the dwell time of a vehicle at a certain location, and exceeding the threshold is considered the end of a trip;
[0066] The time point corresponding to index set I That is, point D (the destination of the journey) for the vehicle;
[0067] The next time point of index set I This is the vehicle's O point (the starting point for the next trip).
[0068] The above formula can accurately identify the daily travel trajectory and origin-destination information of individual vehicles.
[0069] ④OD path traffic statistics:
[0070] Based on the OD identification results of individual vehicles, the macro OD path traffic is calculated using the following formula:
[0071] ,in ;
[0072] in the formula Statistical similarity Number of vehicles at the point; Represents a set The filter counts the number of elements with the same O and D points in the current query. and They represent the first Points O and D of the vehicle, Indicates the first The car time.
[0073] ⑤ Data fusion:
[0074] Based on date and geographic location information, the statistical OD path traffic data is correlated with meteorological data (weather type, temperature) and holiday data (whether it is a holiday) to form a time-series feature dataset containing multi-dimensional perturbation factors, providing comprehensive input for subsequent time-series feature extraction.
[0075] 3. Spatial data processing steps:
[0076] This step converts spatial data into an input format adapted to GCN and mines the spatial correlation between road network topology and POI distribution: ① Graph structure construction:
[0077] Intersection node construction: Each intersection in the urban road network is treated as a graph node, and the node attributes include the geographic coordinates of the intersection;
[0078] Road segment edge construction: The road segments between adjacent intersections are used as directed edges, and the edge attributes include road segment distance and road type (main road, secondary road, local road).
[0079] POI node integration: City POIs are added as new graph nodes, and node attributes include POI type (shopping mall, school, etc.), name, and geographic coordinates;
[0080] POI edge construction: Based on the spatial distance between the POI and the adjacent intersection and the connecting road type, a directed edge is added between the POI and the adjacent intersection. The edge attributes include road segment distance and road type, forming a comprehensive directed graph of intersections and POIs.
[0081] ② Matrix transformation:
[0082] Adjacency Matrix Construction: Converting a synthetic directed graph into an adjacency matrix R AD The matrix elements represent the connection relationships between nodes (1 indicates a connection, 0 indicates no connection). For example, the adjacency matrix containing intersections A, B, C, and D and POI nodes P1 and P2 is as follows:
[0083] R AD =[[0,0,0,0,1,0],
[0084] [1,0,1,0,0,1],
[0085] [0,1,0,1,0,0],
[0086] [0,0,1,0,0,0],
[0087] [1,0,0,0,0,0],
[0088] [0,1,0,0,0,0]].
[0089] Node feature matrix construction: Constructing the node feature matrix X AD Each row corresponds to the attribute features of a single node on the OD path. The dimensions include the attributes of point O, the attributes of point D, the POI type, the distance from the node to point O, and the distance from the node to point D. For example, the node feature matrix of the above 6 nodes is as follows:
[0090] X AD =[[1,0,0,0,800],
[0091] [0,0,0,200,600],
[0092] [0,0,0,500,300],
[0093] [0,1,0,800,0],
[0094] [0,0,3,100,500],
[0095] [0,0,5,150,400]].
[0096] Figure 2 In the diagram, A, B, C, and D represent intersection nodes, and AB, BC, and CD represent road segments formed between intersections. P1 and P2 represent two Point of Interest (POI) nodes, located near intersections B and C, respectively. The road segment AB from intersection A to intersection B is represented as A--AB→B. Similarly, the road segment BC from intersection B to intersection C is represented as B--BC→C. A directed edge P1→A connects POI node P1 to its adjacent intersection A. Likewise, a directed edge P2→B connects POI node P2 to its adjacent intersection B. This method is used to construct the integrated directed graph of the urban road network topology and POI points. The actual data input into the GCN network is represented using an adjacency matrix and a node feature matrix. The adjacency matrix RAD, based on the intersections and POI points A, B, C, D, P1, and P2, is shown in the adjacency matrix diagram. The construction of the node feature matrix mainly focuses on the relationship between the nodes of each OD path and the selected attribute features. For example, the node feature matrix XAD is shown in the node feature matrix. Each row is the attribute feature of a single node on the OD path. The first column is the attribute of point O, the second column is the attribute of point D, the third column is the node POI type, the fourth column is the distance from the node to point O, and the last column is the distance from the node to point D.
[0097] 4. Feature extraction steps:
[0098] A parallel architecture combining Conv-LSTM and an improved GCN is used to extract features, and Transformer fusion is employed to fully explore spatiotemporal correlations.
[0099] ① Parallel feature extraction:
[0100] Conv-LSTM Temporal Feature Extraction: The temporal feature dataset (historical OD flow plus weather and holiday data) is normalized and input into the Conv-LSTM model. Model parameters are set to: batch size =32~64, sequence length =7~14 days (the length of the historical time series used for prediction), input dim=5~8 (input feature dimensions). The convolutional layer extracts the latent spatial features in the time series data, the LSTM layer captures the periodicity (morning and evening peak hours, weekday / weekend differences) and trend (long-term travel changes) of traffic, and the ReLU activation function is used to enhance the model's nonlinear fitting ability.
[0101] Improved GCN spatial feature extraction: To address the issue of varying node counts for each OD path in the node feature matrix, a combined architecture of Transformer Encoder, DGL dynamic layers, and GCN is employed.
[0102] Transformer Encoder: Initializes the weight parameters of the node feature matrix and adjacency matrix, and encodes the node features through the Transformer Encoder layer to capture long-distance dependencies between nodes;
[0103] DGL Dynamic Layer Processing: The Dynamic Layer (DGL) method based on RNN layers is adopted to pack the variable-length node sequence into a fixed-length representation. The sequence elements are processed one by one through the RNN layer and the parameters are shared. Then, the sequence is unpacked and filled to restore the original shape, which can adapt to variable-dimensional input.
[0104] GCN layer aggregation: Add a GCN layer after the Transformer Encoder layer. By aggregating the neighbor features and its own features, the node representation is updated, capturing the spatial correlation between the road network topology and the POI distribution.
[0105] Feature concatenation: The Transformer Encoder encoded features are concatenated with the GCN aggregated features to enhance the spatial feature representation.
[0106] ②Transformer Feature Fusion:
[0107] The temporal features extracted by Conv-LSTM and the spatial features extracted by the improved GCN are input into the Transformer fusion layer. The weights of the two types of features are adaptively adjusted by multiple attention heads. The weights are assigned according to the importance of features at different locations in the input sequence. The weighted sum is used to obtain the fused feature vector, which fully captures the collaborative dependency relationship between spatiotemporal features (such as the impact of POI pedestrian flow on OD path flow during holidays).
[0108] 5. Predicting output steps:
[0109] The fused feature vectors are input into the fully connected layer (FC layer), and inference calculations are performed based on the weight file obtained during model training to output the traffic prediction results for each target OD path for the next day. During model training, the root mean square error (RMSE) or mean absolute error (MAE) is used as the loss function, and the model performance is optimized by adjusting model parameters (number of attention heads, number of network layers, etc.) to ensure prediction accuracy.
[0110] like Figure 1 and Figure 3 As shown, the multi-dimensional spatiotemporal characteristic OD path flow prediction device for GCN described in this invention is a hardware and software integrated system for implementing the above prediction method. It has a clear architecture and is deployable in an engineerable manner. Specifically, it includes:
[0111] 1. Data access module:
[0112] It is configured to acquire real-time vehicle passage data, weather data, holiday data, road network topology data, POI data, and equipment configuration information from electronic police / checkpoints via API interfaces and database synchronization. It supports unified access and standardized format processing of multi-source data, providing a complete and standardized data source for subsequent modules.
[0113] 2. Data Processing Module:
[0114] It includes time-series processing branches and spatial processing branches, which work in parallel to improve data processing efficiency.
[0115] Time series processing branch: Configured to perform data cleaning, long tail processing, OD identification, traffic statistics and data fusion functions, and output a standardized time series feature dataset;
[0116] Spatial processing branch: Configured to perform graph structure construction and matrix transformation functions, outputting adjacency matrix and node feature matrix to solve the problem of spatial data sparsity.
[0117] 3. Feature Extraction Module:
[0118] Configured as a Conv-LSTM unit, an improved GCN unit, and a Transformer fusion unit, the three work together:
[0119] Conv-LSTM unit: configured to extract time-series features and capture the periodicity and trend of traffic;
[0120] Improved GCN unit: configured to integrate Transformer Encoder layer and DGL dynamic layer, process variable-length spatial data, and extract spatial correlation features;
[0121] Transformer fusion unit: configured to adaptively adjust the spatiotemporal feature weights and output a fused feature vector.
[0122] 4. Model Application Module:
[0123] Configured to receive fused feature vectors, perform inference calculations through a fully connected layer, and output OD path traffic prediction results. This module supports visualization of prediction results and data interface output, and can be connected to traffic management platforms to provide decision support for downstream tasks such as traffic planning, resource allocation, and congestion mitigation analysis.
[0124] 5. Hardware Support Unit:
[0125] It includes a processor, memory, and bus. The processor uses an Intel Core i7 or higher model, supports parallel computing, and ensures efficient operation of multi-source data processing and model inference. The memory is used to store more than 2 years of training data, model weight files, adjacency matrices, node feature matrices, and other intermediate data, with a storage capacity of no less than 16GB. The bus adopts PCIe 4.0 or higher specifications to realize high-speed data transmission between modules.
[0126] Example 1: Specific implementation of the prediction method (taking a second-tier city as an example)
[0127] Training set collection and preprocessing:
[0128] Six types of data sources were collected for the city from 2021 to 2023: vehicle data (including 280 million records of 1.5 million license plates), meteorological data (daily weather and temperature from 3 meteorological stations), holiday data (public holidays + statutory holidays), road network topology data (280 intersections and 650 road segments), POI data (180 points of interest, including 35 shopping malls, 42 schools, 28 hospitals, etc.), and equipment configuration information (upstream and downstream relationship table of 180 detection devices).
[0129] Time series data processing:
[0130] ① Data cleaning: 420,000 records of empty license plate information and 180,000 records of empty equipment and geographic information information were deleted; 250,000 records of empty equipment information were filled; 120,000 records of abnormal license plate number were deleted; and 35,000 records of abnormal weather information were replaced.
[0131] ② Long-tail processing: Set the travel volume percentage threshold to 5% and filter out 156 high-demand OD routes;
[0132] ③OD recognition: Set time threshold T th =45 minutes, identified the daily OD points of 1.2 million vehicles;
[0133] ④ Traffic statistics: Calculate the daily average traffic time series data for 156 OD paths according to the formula;
[0134] ⑤ Data fusion: Associate meteorological (sunny / rainy / snowy, etc.) and holiday features to form a time-series feature dataset (dimension=7).
[0135] Spatial data processing:
[0136] ① Graph structure construction: Construct a comprehensive directed graph containing 280 intersection nodes and 180 POI nodes, with a total of 460 nodes and 820 directed edges (including road segment distance and road type attributes).
[0137] ② Matrix transformation: Generate a 460×460 adjacency matrix and a 460×5 node feature matrix.
[0138] Model training and optimization:
[0139] Dataset partitioning: The time series feature dataset is divided into training set, validation set, and test set in a 7:2:1 ratio and then normalized.
[0140] Model parameter configuration: Conv-LSTM batch size =64, sequence length =10 days, input dim =7; Improved GCN contains 3 attention heads, DGL dynamic layer packing length = 32; Transformer blending layer contains 4 attention heads;
[0141] Training process: RMSE was used as the loss function, Adam optimizer was used, learning rate = 0.001, 150 iterations were performed, training set RMSE = 8.6, validation set RMSE = 11.2, MAE = 9.3.
[0142] Predictive Applications and Evaluation:
[0143] Input data: meteorological data (light rain) on October 1, 2023, holiday data (statutory holidays), and historical flow data from September 21 to 30, 2023, spatial matrix data;
[0144] Model inference: After Conv-LSTM temporal feature extraction, improved GCN spatial feature extraction, and Transformer fusion, the traffic prediction results for 156 OD paths on October 1 are output.
[0145] Evaluation results: Test set RMSE=12.5, MAE=10.1, a 53.4% improvement in prediction accuracy compared to the traditional LSTM model (RMSE=26.8), and a 33.2% improvement compared to the ordinary GCN model (RMSE=18.7).
[0146] Example 2: Specific Implementation and Deployment of the Prediction Device
[0147] Device hardware configuration:
[0148] Processor: Intel Core i9-13900K (24 cores, 32 threads);
[0149] Storage: 32GB DDR5 5600MHz plus 2TB SSD;
[0150] Bus: PCIe 4.0;
[0151] Operating system: Ubuntu 20.04 LTS;
[0152] Software environment: Python 3.8, PyTorch 1.12, TensorFlow 2.10.
[0153] Device module deployment and operation:
[0154] Data access module: Connects to the city traffic monitoring platform and meteorological department database via API interface, automatically synchronizes the previous day's data at 00:30 every day, and the data synchronization time is ≤30min;
[0155] Data processing module: The time-series processing branch runs daily from 01:00 to 02:30, taking 90 minutes; the spatial processing branch runs every Sunday from 03:00 to 04:00, taking 60 minutes.
[0156] Feature extraction module: Model training phase (offline) takes about 24 hours, model inference phase (online) runs from 05:00 to 05:30 daily, taking 30 minutes;
[0157] Model application module: Outputs prediction results daily at 06:00, displays traffic prediction values for 156 OD paths through a visual interface, and provides a JSON data interface for connection to the city traffic management platform.
[0158] Practical Application Results: After deployment, the device successfully supported traffic management during the city's National Day holiday in 2023. Predictions showed that the peak traffic flow along the core commuter corridor's origin-destination (OD) path on October 1st reached 850 vehicles per hour, with an error of only 2.2% compared to the actual monitored value (832 vehicles per hour). Based on the predictions, traffic management optimized the signal timings at 12 key intersections, reducing the average travel time along the core OD path by 18%, resulting in significant congestion relief.
[0159] V. Comparative Examples
[0160] Comparison with Example 1: Traditional LSTM prediction method
[0161] Process: Only traffic flow time series data were used, without processing long-tail effects and spatial data, and a single LSTM model was used for prediction;
[0162] Performance: Test set RMSE=26.8, MAE=21.5, high-demand OD path prediction error exceeds 40%;
[0163] Limitations: It ignores spatial characteristics and multidimensional perturbation factors, fails to address the long-tail effect, has extremely low prediction accuracy, and cannot support practical decision-making.
[0164] Compare with Example 2: Ordinary GCN prediction method
[0165] Process: It integrates temporal and spatial data, adopts the traditional GCN model, and does not use Transformer and DGL dynamic layers;
[0166] Performance: RMSE=18.7, MAE=15.3 on the test set, poor performance in handling spatially sparse data, and failure to adapt to variable-length inputs;
[0167] Defects: It cannot handle the problem of inconsistent number of OD path nodes, the spatial feature extraction is insufficient, and the generalization is poor.
[0168] Compare with Example 3: Conv-LSTM plus ordinary GCN prediction method (without Transformer fusion)
[0169] Process: Features are extracted in parallel using Conv-LSTM and ordinary GCN, and then fused through simple concatenation without using the Transformer attention mechanism;
[0170] Performance: RMSE=15.6, MAE=12.8 on the test set, indicating insufficient capture of spatiotemporal feature co-dependencies;
[0171] Limitations: The feature fusion method is simple and cannot adaptively adjust the spatiotemporal feature weights, thus failing to fully explore spatiotemporal correlations.
[0172] This invention improves prediction accuracy by more than 30% compared to traditional methods through multi-dimensional feature fusion, improved GCN design and data preprocessing optimization. It effectively solves industry pain points such as long-tail effect and spatial sparsity, and has strong engineering application value and promotion prospects.
[0173] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of protection claimed by the present invention. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting OD path flow of multi-dimensional space-time features of GCN, characterized in that, Comprising the following steps: (1) Data access: Obtain 6 types of data sources including traffic data of electric police / camera, weather data, holiday data, road network topology data, city POI data and device configuration information; (2) Time series data processing: ① Data cleaning: delete missing values with empty license plate or empty device and geographic information, fill in missing values with empty device by matching geographic coordinates, delete abnormal data with abnormal license plate number, and replace abnormal weather values inconsistent with the season; ② Long tail processing: dynamically adjust the threshold of travel volume ratio, and select high demand OD paths exceeding the threshold; 3. Individual vehicle OD identification: Based on the vehicle passing time difference threshold, the O point and D point are screened through sorting and difference calculation, following the formula: , , , 、 ; (iv) Flow statistics: by formula Aggregate the number of vehicles for the same OD point, ; ⑤ Data fusion: associate flow data, weather data and holiday data by date and location; (3) Spatial data processing: ① Graph structure construction: take intersections and POIs as nodes, and road segments between intersections and road segments between POIs and adjacent intersections as directed edges to form a comprehensive directed graph; ② Matrix conversion: convert the comprehensive graph into an adjacency matrix and a node feature matrix; (4) Feature extraction: ① Parallel feature extraction: Conv-LSTM extracts time series features, and improved GCN extracts spatial features; ② Transformer feature fusion: adaptively adjust the weights of time series and spatial features, and fuse them by weighted summation; (5) Prediction output: input the fused features into a fully connected layer to infer the next day's OD path flow. 2.The GCN-based multi-dimensional spatio-temporal feature OD path flow prediction method of claim 1, wherein: In step (2) is time; represents data sorted by time for each vehicle; represents the first piece of data; represents the time difference between the two pieces of data for the same vehicle; represents the set time threshold; represents the screening condition; counts the number of vehicles at the same point; represents the number of elements filtered in the set for the current query O, D point; and respectively represent the O point and the D point of the vehicle, and represents the time of the vehicle. 3.The GCN-based multi-dimensional spatio-temporal feature OD path flow prediction method of claim 1, wherein: In step (2), the travel volume ratio threshold can be dynamically adjusted within the range of 3% to 8% to adapt to different city traffic characteristics.
4. The method of claim 1, wherein: In step (3), the adjacency matrix represents the connection relationship between nodes, and the node feature matrix corresponds to the attribute characteristics of a single node on the OD path. The dimensions include O-point attributes, D-point attributes, POI types, node-to-O-point distances, and node-to-D-point distances.
5. The method of claim 1, wherein: In step (4), the processing flow of the improved GCN is as follows: initialize weight parameters → Transformer Encoder encode node features → DGL dynamic graph layer pack variable length sequences → RNN layer calculation → unpack and fill → GCN layer aggregate neighbor and self features → concatenate and encode features and aggregated features.
6. The method of claim 1, wherein: The parameter setting of Conv-LSTM in step (4) is: batch size = 32~64, sequence length = 7~14 days, input dim = 5~8, the activation function is ReLU, the loss function adopts RMSE or MAE; the transform fusion layer contains 2~4 attention heads.
7. A GCN multi-dimensional spatio-temporal feature OD path flow prediction device for implementing the GCN multi-dimensional spatio-temporal feature OD path flow prediction method of any one of claims 1-6, characterized in that, It includes: a data access module, a data processing module, a feature extraction module, a model application module, and a processor, a memory and a bus for realizing the functions of each module; the bus connects the processor and the memory, the memory stores a computer program, and the processor executes the program to realize the following functions: (1) Data access module: obtain 6 types of data including traffic, weather, holiday, road network topology, POI and device configuration through API interface, and update data resources in real time; (2) Data processing module: contains time series processing branch and spatial processing branch, time series branch performs data cleaning, long tail processing, OD identification, flow statistics and data fusion, and spatial branch performs graph structure construction and matrix conversion; (3) Feature extraction module: including Conv-LSTM unit, improved GCN unit and Transformer fusion unit, Conv-LSTM unit extracts time series features, improved GCN unit integrates Transformer Encoder and DGL dynamic graph layer, and Transformer unit fuses two-dimensional features; (4) Model application module: infer the next-day OD path flow based on the fused features, support traffic planning, resource allocation or congestion alleviation analysis.
8. The multi-dimensional spatio-temporal feature OD path flow prediction apparatus of the GCN of claim 7, wherein: The time branch processing period of the data processing module is 24 hours per time, and the space branch processing period is 7 days per time, which can be dynamically adjusted according to the road network update frequency.
9. The multi-dimensional spatio-temporal feature OD path flow prediction apparatus of the GCN of claim 7, wherein: The improved GCN unit of the feature extraction module packs the variable-length node sequence into a fixed-length representation through an RNN layer, adapting to the node number difference of different OD paths.
10. The multi-dimensional spatio-temporal feature OD path flow prediction apparatus of the GCN of claim 7, wherein: The memory stores training data, model weight files, adjacency matrices, node feature matrices, and other intermediate data for more than 2 years, and the processor is Intel Core i7 and above, supporting parallel computing.
Citation Information
Patent Citations
Multi-source data-based multi-layer fusion urban rail transit passenger flow prediction method
CN116776277A
Space-time convolution traffic flow prediction method and system based on R-C-R structure
CN116959252A
Dynamic graph convolution traffic flow prediction method based on spatial-temporal characteristics
CN117037491A
Community traffic flow prediction and optimization system based on artificial intelligence
CN118982927A
Big data urban traffic flow prediction method and device based on geographic information and readable storage medium
CN119229651A