Rail transit key OD pair flow prediction method and system
By constructing virtual connection relationships and combining GCN and GRU models, the problems of data sparsity and high dimensionality in OD traffic prediction in urban rail transit were solved, achieving accurate short-term OD traffic prediction and improving data support for operation management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF MINING & TECH (BEIJING)
- Filing Date
- 2022-08-15
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies are unable to effectively resolve the implicit spatial relationships between OD pairs in urban rail transit, making it difficult to directly predict the OD matrix and lacking data support under networked operation conditions.
By acquiring raw passenger flow data, filtering travel records, constructing an OD matrix, setting thresholds to extract key OD pairs, establishing virtual connectivity using the Pearson correlation matrix, and combining graph convolutional neural network (GCN) and gated recurrent neural network (GRU) models, spatiotemporal dependencies are captured for prediction.
It improves the accuracy and flexibility of OD for traffic forecasting, solves the problems of data sparsity and high dimensionality, and can accurately predict the traffic of key OD pairs in the short term, assisting subway operation and emergency response to emergencies.
Smart Images

Figure CN115375020B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method and system for predicting traffic flow for key origin-destination pairs in rail transit. Background Technology
[0002] In recent years, urban rail transit has entered the era of networked operation, gradually taking on the responsibility of alleviating traffic congestion in large cities. Taking Shenzhen Metro as an example, in 2018, the daily metro ridership exceeded 5 million, handling more than one-third of the city's total traffic flow and occupying an important position in the urban public transportation system. The increasing travel demand has brought severe operational pressure to urban rail transit, especially during morning and evening rush hours when commuting demand is high. The operational efficiency of the metro directly affects the overall commuting efficiency of the city. Against this backdrop, passenger flow forecasting research has become a key issue of concern for researchers.
[0003] Existing research mostly focuses on predicting passenger flow in and out of stations, daily passenger flow, hourly passenger flow, and cross-sectional passenger flow, with relatively little research on OD prediction. OD passenger flow reflects the direction and distribution of passenger flow in and out of stations, providing a direct representation of passenger travel demand and containing valuable information. It serves as fundamental support data for subway train operation organization, passenger transport organization, and passenger services under networked operation conditions. However, due to the high dimensionality and sparsity of OD data, directly predicting the OD matrix is very difficult. Furthermore, existing research has not identified the implicit spatial relationships between OD pairs. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method and system for predicting traffic flow for key OD pairs in urban rail transit, which can solve the problem of predicting traffic flow for key OD pairs in the short term in urban rail transit, provide data reference for subway operation and management, and assist in emergency response to sudden events, thereby reducing the lasting impact of sudden events.
[0005] In a first aspect, embodiments of the present invention provide a method for traffic flow prediction of key origin-destination pairs in rail transit, comprising:
[0006] Obtain raw passenger flow data and filter it to obtain ride record data.
[0007] The obtained ride record data is summarized to obtain several N*N OD matrices.
[0008] Set a threshold to extract the set of key OD pairs.
[0009] Using the Pearson correlation matrix, a virtual graph is constructed to model the virtual connection relationships between OD pairs.
[0010] A model combining graph convolutional neural network (GCN) and gated recurrent neural network (GRU) is used to model the spatiotemporal dependency of key OD pairs and obtain prediction results.
[0011] In conjunction with the first aspect, the present invention provides a first possible implementation of the first aspect, wherein the step of acquiring raw passenger flow data and filtering to obtain travel record data includes:
[0012] Obtain raw card swipe data from the rail transit AFC system.
[0013] Set data filtering conditions to extract travel record data, including card number, entry time, entry station, exit station, and exit time, from the original card swipe data.
[0014] Since subway stations require card swiping for both entry and exit, a complete travel record requires a single travel card entry and exit record. Data filtering conditions are set to extract complete and reasonable travel records from the raw data.
[0015] In conjunction with the first aspect, embodiments of the present invention provide a second possible implementation of the first aspect, wherein the data filtering conditions include:
[0016] Each travel record includes both entry and exit records.
[0017] Each travel record has a different entry and exit station.
[0018] Each passenger record data entry time is after 6:00.
[0019] In conjunction with the first aspect, this invention provides a third possible implementation of the first aspect, wherein summarizing the obtained ride record data to obtain several N*N OD matrices includes:
[0020] The filtered passenger record data is then used to summarize the traffic demand from station O to station D within a fixed time interval T, based on the arrival time.
[0021] Obtain the OD matrix of the total network passenger flow at time t (N*N).
[0022] in, This represents the total passenger flow demand generated from station i to station j within the t-th time period, where i is the entry station number and j is the exit station number.
[0023] In conjunction with the first aspect, embodiments of the present invention provide a fourth possible implementation of the first aspect, wherein setting a threshold and extracting a set of key OD pairs includes:
[0024] Set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data p that is greater than the randomness judgment value.
[0025] Using the historical passenger flow data set H for each OD pair s As a screening criterion, H s ={h 1 h 2 , ..., h s}, where s is the length of the selected historical data, h i This represents the OD (Original Departure) passenger flow during that time period.
[0026] Generate two subsets H s′ and H s″ The key OD meets the conditions
[0027] Among them, H s′ ={h i |h i ∈H S and h i H represents a subset of OD pairs where all elements are 0, where i = 0, i = 1, 2, ..., s. s″ ={h i |h i ∈H S and h i >r,i=1,2,...,s} represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r.
[0028] Extract the key OD pair set K OD ={k1, k2, ..., k n}
[0029] In conjunction with the first aspect, this invention provides a fifth possible implementation of the first aspect, wherein the step of constructing a virtual graph modeling virtual connection relationships between OD pairs using the Pearson correlation matrix includes:
[0030] Calculate the Pearson correlation coefficient
[0031] Where X and Y represent two variables. It is the average value.
[0032] Calculate the correlation matrix R between key OD pairs n×n ,
[0033] Where, k ij Let represent the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence.
[0034] By setting a correlation threshold c, we obtain a correlation matrix A representing the virtual connectivity between OD pairs.
[0035]
[0036] A is used to represent a virtual connection between OD pairs, containing only 0 and 1 elements. If there is no connection between nodes, then A... ij It is 0 if it is not 0, otherwise it is 1.
[0037] This invention predicts based on key OD pairs, which eliminates the dependence on physical maps of real sites. However, the OD pairs themselves incorporate the spatial properties of the starting and ending sites. For example, if site O is a residential area and site D is an office area, OD pairs with similar properties will show correlation. That is, OD pairs may have similar traffic distribution characteristics due to similar functions. Therefore, virtual connecting edges can be established to generate an adjacency matrix.
[0038] In conjunction with the first aspect, this embodiment of the invention provides a sixth possible implementation of the first aspect, wherein the model employing a combination of a graph convolutional neural network (GCN) and a gated recurrent neural network (GRU) to model the spatiotemporal dependency of key OD pairs and obtain prediction results includes: receiving historical passenger flow information represented by OD pairs from the input layer, extracting key OD pairs, and forming a feature matrix using historical flow information of key OD pairs over multiple time steps. Where X represents the historical data set of key OD pairs across the entire network at all times, x t x represents the set of historical data collected at time t for each key OD pair. t = [x(k1), x(k2), ..., x(k)] n )] T Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer.
[0039] The feature extraction layer employs a spectral-based graph convolutional neural network (GCN) to perform graph convolution operations on the data from the input layer. This allows for end-to-end learning of node feature and structural information, ultimately acquiring aggregated spatial features of node information.
[0040] in, This represents the sum of the adjacency matrix A and the identity matrix IN. express The degree matrix, Indicates to After normalization, W represents the weight matrix, and σ is the activation function, resulting in sequence data X containing spatial information. t′ =[x 1′ , ..., xt′ ].
[0041] By inputting sequence data containing spatial information into a gated recurrent neural network (GRU) with graph convolution operations, temporal features are captured. The hidden state at time t-1 and the current key OD pair flow information are used as input to obtain the flow state at time t.
[0042] z t =σ(W z [f(X t ,A),h t-1 ]+b z ),
[0043] r t =σ(W r [f(X t ,A),h t-1 ]+b r ),
[0044]
[0045] Among them, h t-1 Let X be the hidden state at time t-1. t For the traffic information of all key OD pairs at time t, r t The reset gate in the GRU model determines how new input information is combined with previous information. t For the update gate in the GRU model, the amount of information from previous timestamps saved to the current time step is defined. h represents the memory content stored at time t. t Let t be the output state at time t.
[0046] The prediction results are output from the output layer.
[0047] In conjunction with the first aspect, this invention provides a seventh possible implementation of the first aspect, wherein the model employing a combination of a graph convolutional neural network (GCN) and a gated recurrent neural network (GRU) to model the spatiotemporal dependency of key OD pairs and obtain prediction results further includes:
[0048] The predicted output is optimized using a loss function.
[0049] Among them, y t and These are the actual OD value and the predicted value, where n represents the length of the observation window.
[0050] Secondly, embodiments of the present invention also provide a traffic flow prediction system for rail transit OD pairs, comprising:
[0051] The raw data extraction module is used to obtain raw passenger flow data and filter it to obtain ride record data.
[0052] The OD matrix aggregation module is used to aggregate the obtained ride record data to obtain several N*N OD matrices.
[0053] The key OD pair extraction module is used to set a threshold and extract a set of key OD pairs.
[0054] The virtual graph construction module is used to construct a virtual graph to model the virtual connection relationships between OD pairs using the Pearson correlation matrix.
[0055] The modeling and prediction module is used to model the spatiotemporal dependencies of key OD pairs using a model that combines graph convolutional neural networks (GCN) and gated recurrent neural networks (GRU) to obtain prediction results.
[0056] In conjunction with the second aspect, embodiments of the present invention provide a first possible implementation of the second aspect, wherein the key OD pair extraction module includes:
[0057] The threshold setting unit is used to set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data p that is greater than the randomness judgment value.
[0058] OD pair filtering unit, used to utilize the historical passenger flow data set H for each OD pair s As a screening criterion, H s ={h 1 h 2 , ..., h s}, where s is the length of the selected historical data, h i Representing the OD passenger flow during this time period, two subsets H are generated. s′ and H s″ The key is to meet the conditions.
[0059] Among them, H s′ ={h i |h i ∈H S and h i H represents a subset of OD pairs where all elements are 0, where i = 0, i = 1, 2, ..., s. s″ ={h i |h i ∈H S and h i >r,i=1,2,...,s} represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r.
[0060] Key OD pair extraction unit, used to extract the key OD pair set K OD ={k1, k2, ..., k n}
[0061] In conjunction with the second aspect, embodiments of the present invention provide a second possible implementation of the second aspect, wherein the virtual graph construction module includes:
[0062] The Pearson coefficient calculation unit is used to calculate the Pearson correlation coefficient. Where X and Y represent two variables. It is the average value.
[0063] OD-to-correlation calculation unit, used to calculate the correlation matrix R between key OD pairs. n×n , Where, k ij Let represent the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence.
[0064] The correlation matrix building unit is used to set the correlation threshold c and obtain the correlation matrix A, which represents the virtual connection relationship between OD pairs.
[0065] In conjunction with the second aspect, this embodiment of the invention provides a third possible implementation of the second aspect, wherein the modeling and prediction module includes:
[0066] The input layer unit receives historical passenger flow information represented by OD pairs, extracts key OD pairs, and forms an adjacency feature matrix X = [x] using historical flow information from multiple time steps for each key OD pair. 1 , ..., x t ], where X represents the historical data set of key OD pairs across the entire network at all times, x t x represents the set of historical data collected at time t for each key OD pair. t = [x(k1), x(k2), ..., x(k)] n )] T Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer.
[0067] The feature extraction layer unit includes a graph convolutional neural network (GCN) module and a gated recurrent neural network (GRU) module.
[0068] The Graph Convolutional Neural Network (GCN) module employs a spectral-based GCN approach. It performs graph convolution operations on the data from the input layer, learns node feature information and structural information end-to-end, and acquires spatial features aggregated from node information to obtain sequence data X containing spatial information.t′ =[x 1′ , ..., x t′ ].
[0069] The gated recurrent neural network (GRU) module inputs sequence data containing spatial information into the improved gated recurrent neural network (GRU) with graph convolution operations to capture temporal features.
[0070] Output layer unit, used to output the prediction results from the output layer.
[0071] Loss reduction optimization unit, used to optimize the loss function The predicted output is optimized, where y t and These are the actual OD value and the predicted value, where n represents the length of the observation window.
[0072] The beneficial effects of the embodiments of the present invention are:
[0073] This invention provides a method and system for traffic flow prediction of key origin-destination (OD) pairs in urban rail transit. By setting three thresholds to extract key OD pairs, it addresses the issues of data sparsity and high dimensionality in OD passenger flow. The Pearson correlation coefficient is used to calculate the correlation between key OD pairs, establishing a virtual graph of these pairs. A Global Correlation Network (GCN) is used to capture this relationship, and a Global Randomization Root (GRU) is employed to capture temporal information. By combining temporal and spatial information, the model's flexibility and expressive power are enhanced. The aim is to solve the problem of short-term traffic flow prediction for key OD pairs in urban rail transit. Attached Figure Description
[0074] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a flowchart of the traffic flow prediction method for OD pairs in rail transit according to the present invention;
[0076] Figure 2 This is a schematic diagram of the traffic flow prediction method and system model prediction framework for key OD pairs in rail transit according to the present invention.
[0077] Figure 3 This is a schematic diagram illustrating the calculation process of combining GCN and GRU in the traffic flow prediction method for rail transit OD pairs of the present invention.
[0078] Figure 4This is a visual illustration of the prediction of key OD pair traffic data at a 10-minute granularity for the traffic flow prediction method of rail transit OD pairs in this invention. Detailed Implementation
[0079] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0080] Please refer to Figures 1 to 4 The first embodiment of this invention provides a method for predicting passenger flow for rail transit origin-destination (OD) pairs. This involves acquiring raw passenger flow data and filtering it to obtain travel record data; summarizing the obtained travel record data to obtain several N*N OD matrices; setting a threshold to extract a set of key OD pairs; using the Pearson correlation matrix to construct a virtual graph to model the virtual connections between OD pairs; and employing a model combining a graph convolutional neural network (GCN) and a gated recurrent neural network (GRU) to model the spatiotemporal dependencies of the key OD pairs and obtain the prediction results. The objective of this invention is to predict passenger flow over the next m time intervals given historical passenger flow data for key OD pairs over the previous n time intervals. This can be expressed as the following learning function:
[0081]
[0082] Where X T f represents the historical flow values of all OD pairs within time interval T, and f is a mapping function. The specific steps are as follows:
[0083] Step S1: Obtain raw passenger flow data and filter to obtain ride record data.
[0084] Obtain raw card swipe data from the rail transit AFC system.
[0085] Set data filtering conditions to extract travel record data, including card number, entry time, entry station, exit station, and exit time, from the original card swipe data.
[0086] Since subway stations require card swiping for both entry and exit, a complete travel record requires a single travel card entry and exit record. Data filtering conditions are set to extract complete and reasonable travel records from the raw data.
[0087] The data filtering conditions include:
[0088] Each travel record includes both entry and exit records.
[0089] Each travel record has a different entry and exit station.
[0090] Each passenger record data entry time is after 6:00.
[0091] Step S2: Summarize the obtained ride record data to obtain several N*N OD matrices.
[0092] The filtered passenger record data is then used to summarize the traffic demand from station O to station D within a fixed time interval T, based on the arrival time.
[0093] Obtain the OD matrix of the total network passenger flow at time t (N*N).
[0094] in, This represents the total passenger flow demand generated from station i to station j within the t-th time period, where i is the entry station number and j is the exit station number.
[0095] Step S3: Set the threshold and extract the key OD pair set.
[0096] Set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data greater than the randomness judgment value p.
[0097] Using the historical passenger flow data set H for each OD pair s As a screening criterion, H s ={h 1 h 2 , ..., h s}, where s is the length of the selected historical data, h i This represents the OD (Original Departure) passenger flow during that time period.
[0098] Generate two subsets H s′ and H s″ The key OD meets the conditions
[0099] Among them, H s′ ={h i |h i ∈H S and h i H represents a subset of OD pairs where all elements are 0, where i = 0, i = 1, 2, ..., s. s″ ={h i |h i ∈H S and h i >r,i=1,2,...,s} represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r.
[0100] Extract the key OD pair set K OD ={k1, k2, ..., k n}
[0101] Step S4: Using the Pearson correlation matrix, construct a virtual graph to model the virtual connection relationships between OD pairs.
[0102] This invention predicts based on key OD pairs, which eliminates the dependence on physical maps of real sites. However, the OD pairs themselves incorporate the spatial properties of the starting and ending sites. For example, if site O is a residential area and site D is an office area, OD pairs with similar properties will show correlation. That is, OD pairs may have similar traffic distribution characteristics due to similar functions. Therefore, virtual connecting edges can be established to generate an adjacency matrix.
[0103] Calculate the Pearson correlation coefficient
[0104] Where X and Y represent two variables. It is the average value.
[0105] Calculate the correlation matrix R between key OD pairs n×n ,
[0106] Where, k ij Let represent the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence.
[0107] By setting a correlation threshold c, we obtain a correlation matrix A representing the virtual connectivity between OD pairs.
[0108]
[0109] A is used to represent a virtual connection between OD pairs, containing only 0 and 1 elements. If there is no connection between nodes, then A... ij It is 0 if it is not 0, otherwise it is 1.
[0110] Step S5: A model combining a graph convolutional neural network (GCN) and a gated recurrent neural network (GRU) is used to model the spatiotemporal dependency of key OD pairs and obtain the prediction results. The model prediction framework used in this invention is as follows: Figure 2 As shown.
[0111] The input layer receives historical passenger flow information represented by OD pairs, extracts key OD pairs, and forms a feature matrix using historical traffic information from multiple time steps for each key OD pair. Where X represents the historical data set of key OD pairs across the entire network at all times, x tx represents the set of historical data collected at time t for each key OD pair. t = [x(k1), x(k2), ..., x(k)] n )] T Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer.
[0112] like Figure 3 As shown, the feature extraction layer employs a spectral-based graph convolutional neural network (GCN) to perform graph convolution operations on the data from the input layer. This allows for end-to-end learning of node feature information and structural information, ultimately acquiring aggregated spatial features of node information.
[0113] in, This represents the sum of the adjacency matrix A and the identity matrix IN. express The degree matrix, Indicates to After normalization, W represents the weight matrix, and σ is the activation function, resulting in sequence data X containing spatial information. t′ =[x 1′ , ..., x t′ ].
[0114] By inputting sequence data containing spatial information into a gated recurrent neural network (GRU) with graph convolution operations, temporal features are captured. The hidden state at time t-1 and the current key OD pair flow information are used as input to obtain the flow state at time t.
[0115] z t =σ(W z [f(X t ,A),h t-1 ]+b z ),
[0116] r t =σ(W r [f(X t ,A),h t-1 ]+b r ),
[0117]
[0118] Among them, h t-1 Let X be the hidden state at time t-1. t For the traffic information of all key OD pairs at time t, r t The reset gate in the GRU model determines how new input information is combined with previous information.t For the update gate in the GRU model, the amount of information from previous timestamps saved to the current time step is defined. h represents the memory content stored at time t. t Let t be the output state at time t.
[0119] The prediction results are output from the output layer.
[0120] The predicted output is optimized using a loss function.
[0121] Among them, y t and These are the actual OD value and the predicted value, where n represents the length of the observation window.
[0122] Step S6: Select the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²) for linear regression as evaluation metrics. Specifically, RMSE and MAE measure prediction error: the smaller the value, the better the prediction. R² is used to calculate the correlation coefficient, measuring the ability of the prediction result to represent the actual data: the larger the value, the better the prediction. The specific calculation formula is as follows:
[0123]
[0124]
[0125]
[0126] Among them, Y t Represents true OD information. This represents the predicted OD information. This represents the average value of the predicted OD information, where n is the number of nodes.
[0127] Step S7: Results Analysis. The model presented in this paper is compared with the following five baseline methods: three traditional time series models and two general deep learning models: (1) Historical Average (HA), (2) Autoregressive Integrated Moving Average (ARIMA), (3) Support Vector Regression (SVR), (4) Graph Convolutional Network (GCN), and (5) Gated Recurrent Unit (GRU). The results are compared with the baseline methods to verify the effectiveness of the model presented in the critical OD (Original Distance) flow prediction task.
[0128] Step S8: Visualize the prediction of key OD traffic data at a 10-minute granularity. The model can effectively model different passenger flow demands, and the relatively accurate predictions can provide effective reference information for passenger travel. At the same time, the modeling and analysis of key OD passenger flow can assist in emergency response when unexpected events occur, reducing the lasting impact of such events.
[0129] A second embodiment of the present invention provides a traffic flow prediction system for critical origin-destination pairs in rail transit, comprising:
[0130] The raw data extraction module is used to obtain raw passenger flow data and filter it to obtain ride record data.
[0131] The OD matrix aggregation module is used to aggregate the obtained ride record data to obtain several N*N OD matrices.
[0132] The key OD pair extraction module is used to set a threshold and extract a set of key OD pairs.
[0133] The virtual graph construction module is used to construct a virtual graph to model the virtual connection relationships between OD pairs using the Pearson correlation matrix.
[0134] The modeling and prediction module is used to model the spatiotemporal dependencies of key OD pairs using a model that combines graph convolutional neural networks (GCN) and gated recurrent neural networks (GRU) to obtain prediction results.
[0135] The key OD extraction module includes:
[0136] The threshold setting unit is used to set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data p that is greater than the randomness judgment value.
[0137] OD pair filtering unit, used to utilize the historical passenger flow data set H for each OD pair s As a screening criterion, H s ={h 1 h 2 , ..., h s}, where s is the length of the selected historical data, h i Representing the OD passenger flow during this time period, two subsets H are generated. s′ and H s″ The key is to meet the conditions.
[0138] Among them, H s′ ={h i |h i ∈H S and h i H represents a subset of OD pairs where all elements are 0, where i = 0, i = 1, 2, ..., s. s″ ={h i |h i ∈H S and h i >r,i=1,2,...,s} represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r.
[0139] Key OD pair extraction unit, used to extract the key OD pair set K OD ={k1, k2, ..., k n}
[0140] The virtual graph construction module includes:
[0141] The Pearson coefficient calculation unit is used to calculate the Pearson correlation coefficient. Where X and Y represent two variables. It is the average value.
[0142] OD-to-correlation calculation unit, used to calculate the correlation matrix R between key OD pairs. n×n , Where, k ij Let represent the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence.
[0143] The correlation matrix building unit is used to set the correlation threshold c and obtain the correlation matrix A, which represents the virtual connection relationship between OD pairs.
[0144] The modeling and prediction module includes:
[0145] The input layer unit receives historical passenger flow information represented by OD pairs, extracts key OD pairs, and forms an adjacency feature matrix X = [x] using historical flow information from multiple time steps for each key OD pair. 1 , ..., x t ], where X represents the historical data set of key OD pairs across the entire network at all times, x t x represents the set of historical data collected at time t for each key OD pair. t = [x(k1), x(k2), ..., x(k)] n )] T Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer.
[0146] The feature extraction layer unit includes a graph convolutional neural network (GCN) module and a gated recurrent neural network (GRU) module.
[0147] The Graph Convolutional Neural Network (GCN) module employs a spectral-based GCN approach. It performs graph convolution operations on the data from the input layer, learns node feature information and structural information end-to-end, and acquires spatial features aggregated from node information to obtain sequence data X containing spatial information. t′ =[x 1′ , ..., xt′ ].
[0148] The gated recurrent neural network (GRU) module inputs sequence data containing spatial information into the improved gated recurrent neural network (GRU) with graph convolution operations to capture temporal features.
[0149] Output layer unit, used to output the prediction results from the output layer.
[0150] Loss reduction optimization unit, used to optimize the loss function The predicted output is optimized, where y t and These are the actual OD value and the predicted value, where n represents the length of the observation window.
[0151] The third embodiment of the present invention provides a practical application example of a traffic flow prediction method for key OD pairs in rail transit.
[0152] Using real data provided by Shenzhen Metro, we constructed the dataset MetroSZ2020, as shown in Table 1. The dataset contains 205 usable stations. We used rail transit card swiping data from August 23, 2020 to September 30, 2020 (39 consecutive days) as the base data. Each record includes card number, entry number, entry time, exit number, and exit time. The operating period is selected as 6:00-24:00. The OD matrix is summarized at 10-minute intervals, resulting in a total of 42,025 OD pairs.
[0153] type MetroSZ2020 date August 23, 2020 to September 30, 2020 Operating hours 6:00-24:00 Number of stations 205 Matrix dimension 205*205 Number of key OD pairs 490 Time interval 10min
[0154] Key OD pair extraction and OD passenger flow prediction were performed using steps S1-S8 on the MetroSZ2020 dataset. The effectiveness of this invention was verified as follows:
[0155] The performance of the ST-VGCN model for key OD pair flow prediction at a 10-minute time granularity was tested, and the results are shown in Table 2.
[0156] Table 2
[0157] RMSE MAE R2 HA 15.134 5.787 0.360 ARIMA 11.321 6.065 0.105 SVR 8.416 3.748 0.802 GCN 13.619 5.191 0.482 GRU 12.071 5.015 0.593 ST-VGCN 8.360 3.492 0.805
[0158] Compared to the ARIMA and SVR models, the ST-VGCN model reduced the RMSE by approximately 26.15% and 0.6%, respectively. Compared to GCN and GRU, which only focus on spatial or temporal relationships, the ST-VGCN model reduced the RMSE by approximately 38.62% and 30.74%, respectively. The ST-VGCN model also showed significant advantages over other models in other evaluation metrics. The comparative results validate the effectiveness of the proposed ST-VGCN model.
[0159] In this embodiment, the prediction results of key OD (Original Distance) data at a 10-minute granularity are visualized. The results are as follows: Figure 4 As shown, three different passenger travel patterns can be observed. (a) and (c) have distinct peak times, with the peak time in (c) being later than that in (a). Analysis reveals that the origin and destination stations of the OD pair represented in Figure (a) are: station O is a residential area and station D is an office area. The origin and destination stations of the OD pair represented in Figure (c) are: station O is an office area and station D is a residential area, which aligns with residents' commuting patterns. (b) maintains a relatively flat trend, with station D being an airport station, thus maintaining a certain level of passenger travel demand throughout the day.
[0160] This invention first obtains raw passenger flow data from the rail transit AFC system. It then aggregates this data at fixed time intervals to obtain an OD matrix. A threshold is set to extract key OD pairs, addressing the issues of high dimensionality and sparsity in OD data. A Pearson correlation matrix is used to construct a virtual graph to model the virtual connections between OD pairs. A spatiotemporal virtual graph network (ST-VGCN), combining graph convolutional neural networks and gated recurrent neural networks, is used to simultaneously identify spatial relationships and passenger flow temporal patterns between OD pairs, yielding prediction results. Comparison with five other benchmark methods shows that this invention outperforms the benchmark methods in all evaluation metrics, effectively improving prediction accuracy. Furthermore, this invention has good scalability; by collecting real-time AFC data as sample data, it can predict passenger flow at key ODs in the next time period, providing important insights for subway operation and management.
[0161] The computer program product of the traffic flow prediction method and apparatus for OD pairs of rail transit provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0162] Specifically, the storage medium can be a general-purpose storage medium, such as a portable disk or hard disk. When the computer program on the storage medium is run, it can execute the above-mentioned traffic flow prediction method for rail transit OD pairs, thereby solving the problem of short-term key OD pair traffic flow prediction in urban rail transit.
[0163] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0164] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for predicting traffic flow for key origin-destination pairs in rail transit, characterized in that, include: Obtain raw passenger flow data and filter it to obtain ride record data; The obtained ride record data is summarized to obtain several N*N OD matrices; Set a threshold to extract the set of key OD pairs; Using the Pearson correlation matrix, a virtual graph is constructed to model the virtual connection relationships between OD pairs; A model combining graph convolutional neural network (GCN) and gated recurrent neural network (GRU) is used to model the spatiotemporal dependency of key OD pairs and obtain prediction results. The process of acquiring raw passenger flow data and filtering it to obtain travel record data includes: Obtain raw card swipe data from the rail transit AFC system; Set data filtering conditions to extract travel record data including card number, entry time, entry station, exit station, and exit time from the original card swipe data; The data filtering conditions include: Each travel record includes both entry and exit records; Each passenger record has a different entry and exit station; The arrival time for each passenger record is after the preset time; The setting of thresholds and extraction of key OD pair sets includes: Set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data p that is greater than the randomness judgment value; Using the historical passenger flow data set of each OD pair As a screening criterion Where s is the length of the selected historical data, This represents the OD (Original Departure) passenger flow during that time period; Generate two subsets and The key OD meets the conditions ,in, This represents a subset of OD pairs where all elements have a value of 0. This represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r. Extract the key OD pair set ; The method of constructing a virtual graph modeling virtual connection relationships between OD pairs using the Pearson correlation matrix includes: Calculate the Pearson correlation coefficient Where X and Y represent two variables, , It is the average value; Calculate the correlation matrix between key OD pairs , ,in, This represents the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence; By setting a correlation threshold c, we obtain a correlation matrix A representing the virtual connectivity between OD pairs. ; The model employing a combination of Graph Convolutional Neural Network (GCN) and Gated Recurrent Neural Network (GRU) models the spatiotemporal dependencies of key OD pairs, yielding prediction results, including: The input layer receives historical passenger flow information represented by OD pairs, extracts key OD pairs, and forms a feature matrix X using historical traffic information from multiple time steps for each key OD pair. Where X represents the historical data set of key OD pairs across the entire network at all times. This represents the set of historical data collected at time t for each key OD pair. Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer; The feature extraction layer employs a spectral-based graph convolutional neural network (GCN) to perform graph convolution operations on the data from the input layer. This allows for end-to-end learning of node feature and structural information, ultimately acquiring aggregated spatial features of node information. ,in, Represents the adjacency matrix A and the identity matrix 𝐼 𝑁 The sum of, express The degree matrix, Indicates to After normalization, where W represents the weight matrix and σ is the activation function, sequence data containing spatial information is obtained. ; By inputting sequence data containing spatial information into a gated recurrent neural network (GRU) with graph convolution operations, temporal features are captured. The hidden state at time t-1 and the current key OD pair flow information are used as input to obtain the flow state at time t. , , , ,in, For the first The hidden state at any given moment. For the traffic information of all key OD pairs at time t, For the reset gate in the GRU model, For the update gate in the GRU model, The memory content stored at time t. This represents the output state at time t. The predicted output is optimized using a loss function. ,in, and These are the actual OD value and the predicted value, where n represents the length of the observation window; The prediction results are output from the output layer.
2. The traffic flow prediction method for key OD pairs in rail transit according to claim 1, characterized in that, The obtained ride record data is then aggregated to obtain several N*N OD matrices, including: The filtered passenger record data is then used to calculate and summarize the traffic demand from station O to station D within a fixed time interval T, based on the arrival time. Obtain the OD matrix of the total network passenger flow at time t (N*N). ,in, This represents the total passenger flow demand generated from station i to station j within the t-th time period, where i is the entry station number and j is the exit station number.
3. A traffic flow prediction system for key origin-destination pairs in rail transit, characterized in that, include: The raw data extraction module is used to acquire raw passenger flow data and filter it to obtain ride record data; The OD matrix aggregation module is used to aggregate the obtained ride record data to obtain several N*N OD matrices; The key OD pair extraction module is used to set a threshold and extract a set of key OD pairs; The virtual graph construction module is used to construct a virtual graph to model the virtual connection relationships between OD pairs using the Pearson correlation matrix; The modeling and prediction module is used to model the spatiotemporal dependencies of key OD pairs using a model that combines graph convolutional neural networks (GCN) and gated recurrent neural networks (GRU) to obtain prediction results. The key OD extraction module includes: The threshold setting unit is used to set three thresholds: the proportion of zero elements z, the randomness judgment value r, and the proportion of data p that is greater than the randomness judgment value. OD pair filtering unit, used to utilize the historical passenger flow data set of each OD pair. As a screening criterion Where s is the length of the selected historical data, Representing the OD (Original Demand) passenger flow during this time period, two subsets are generated. and The key is to meet the conditions. ,in, This represents a subset of OD pairs where all elements have a value of 0. This represents a subset of OD pairs in a set whose element values are all greater than the randomness judgment value r. Key OD pair extraction unit, used to extract key OD pair set. ; The virtual graph construction module includes: The Pearson coefficient calculation unit is used to calculate the Pearson correlation coefficient. Where X and Y represent two variables, , It is the average value; The OD pair correlation calculation unit is used to calculate the correlation matrix between key OD pairs. , ,in, This represents the Pearson correlation coefficient between the i-th and j-th OD pairs and the historical passenger flow data observation sequence; The correlation matrix building unit is used to set the correlation threshold c and obtain the correlation matrix A, which represents the virtual connection relationship between OD pairs. ; The modeling and prediction module includes: The input layer unit receives historical passenger flow information represented by OD pairs, extracts key OD pairs, and forms an adjacency feature matrix using historical flow information from multiple time steps for each key OD pair. Where X represents the historical data set of key OD pairs across the entire network at all times. This represents the set of historical data collected at time t for each key OD pair. Then, using the Pearson correlation coefficient, a virtual graph is constructed to generate the adjacency matrix A, and the feature matrix X and the adjacency matrix A are used as inputs to the feature extraction layer; The feature extraction layer unit includes a graph convolutional neural network (GCN) module and a gated recurrent neural network (GRU) module; The Graph Convolutional Neural Network (GCN) module employs a spectral-based GCN approach. It performs graph convolution operations on the data from the input layer, learns node feature information and structural information end-to-end, and acquires spatial features aggregated from node information to obtain sequence data containing spatial information. ; The gated recurrent neural network (GRU) module inputs sequence data containing spatial information into the gated recurrent neural network (GRU) improved by adding graph convolution operations to capture temporal features. Output layer unit, used to output the prediction result from the output layer; Loss reduction optimization unit, used to optimize the loss function The output predictions are optimized, whereby... and These are the actual OD value and the predicted value, where n represents the length of the observation window.