Subway short-time OD passenger flow prediction method based on multi-knowledge graph neural network model

By building a multi-knowledge graph neural network model, combining multi-source data and graph neural network, the problem of sparsity in time and space of subway passenger flow prediction is solved, and high-precision and highly interpretable OD passenger flow prediction is achieved.

CN120386983AActive Publication Date: 2025-07-29CHINA RAILWAY FIRST SURVEY & DESIGN INST GRP

Patent Information

Application Number
CN202510512053.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-07-29
Estimated Expiration
2045-04-23

AI Technical Summary

Technical Problem

The existing subway passenger flow prediction model is seriously sparse in the time and space dimensions, and lacks effective space-time correlation capture capabilities, resulting in low prediction accuracy and insufficient interpretability.

Method used

A multi-knowledge graph neural network model is built, and key OD pairs are extracted using subway site location data, AFC data, POI data and mobile phone signaling data. The multi-knowledge graph captures spatial connectivity, travel mode similarity and functional similarity, and combines graph neural network and time series modeling to predict future OD passenger flow.

Benefits of technology

It significantly improves the accuracy and interpretability of short-term OD passenger flow prediction of subway, effectively captures the complex temporal and spatial correlation of passenger flow, and improves prediction capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386983A_ABST
    Figure CN120386983A_ABST
Patent Text Reader

Abstract

The invention discloses a subway short-time OD passenger flow prediction method based on a multi-knowledge graph neural network model. Firstly, based on multi-source data such as subway station position data, AFC data, POI data and mobile phone signaling data, a subway network structure, passenger flow characteristics and subway station surrounding land and population characteristics are quantified, key OD pairs are extracted, and the influence of low-value and random data on a model is prevented; secondly, constructing spatial connectivity, travel mode similarity and function similarity among a plurality of knowledge graph capture nodes; meanwhile, constructing a spatial feature modeling module, and capturing a potential spatial relationship between nodes by using a graph neural network; and finally, constructing a time feature modeling module, and capturing a passenger flow dynamic change process by using a time sequence modeling method. According to the prediction method, complex spatial-temporal correlation existing in subway passenger flow is effectively and quantitatively captured, and the prediction capability and the interpretability of the model are remarkably enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of subway passenger flow prediction, and particularly to a short-term subway OD passenger flow prediction method based on a multi-knowledge graph neural network model. Background Art

[0002] The subway is an important means to meet the urban rapid and large-capacity transportation demands. Accurately grasping the spatio-temporal dynamic characteristics and evolution trends of rail transit passenger flow provides a reference for taking proactive operation organization and passenger flow control strategies. Currently, most subway passenger flow predictions are for the passenger flow at subway entrances and exits, and this method cannot reflect the specific distribution of passenger demands in the subway network. Subway OD (Origin Destination) refers to the exchange volume between subway stations and can better reflect the travel behavior of passengers, which is more significant for operation organization and passenger flow control strategies.

[0003] However, the OD matrix between rail transit stations is severely sparse in both the time and space dimensions: in the time dimension, the travel patterns of passengers change over time, resulting in the sparse pattern of OD flows changing over time; in the space dimension, the travel volume between some subway stations is very small or almost zero, and the low-value and random OD passenger flows are not very important for the operation and management of the subway, and their introduction may weaken the prediction ability of the model. In addition, the change of subway OD passenger flow has complex spatio-temporal correlations: in the time dimension, the OD passenger flow has certain periodicity and trend. The OD passenger flow at a specific moment is correlated not only with the passenger flow at adjacent historical moments but also with the passenger flow at the same historical moment; in the space dimension, the passenger flow demands between stations or lines at different spatial positions will affect each other, and the OD passenger flow has significant departure-dependence and destination-dependence in the space dimension. At the same time, the accuracy and ability of existing prediction models are not enough, and the interpretability also needs to be improved. Summary of the Invention

[0004] The present application provides a short-term subway OD passenger flow prediction method based on a multi-knowledge graph neural network model to solve the problems of high difficulty in subway passenger flow prediction, insufficient accuracy and ability of existing prediction models, and the need to improve interpretability.

[0005] According to a first aspect, in one embodiment, a short-term subway OD passenger flow prediction method based on a multi-knowledge graph neural network model is provided. The method includes: Collect multi-source basic data related to the subway network, subway passenger flow, and passenger flow influencing factors, and perform data preprocessing to extract key OD pairs of subway passenger flow; Construct a multi-knowledge graph neural network model, which is used to first extract various spatial correlation features by using a multi-knowledge graph, and then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use a spatial feature modeling module to extract spatial features, and then input the time series with spatial features into a time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction result for future time through a fully connected layer; Construct a training set and a test set, train, test and evaluate the multi-knowledge graph neural network model to obtain the final multi-knowledge graph neural network model.

[0006] Furthermore, collect multi-source basic data related to the subway network, subway passenger flow and passenger flow influencing factors, specifically including: The multi-source basic data includes subway station spatial location data, AFC card swiping data, POI data, and anonymized mobile phone signaling data.

[0007] Furthermore, perform data preprocessing, specifically including: Preprocess the AFC card swiping data, including: Statistical analysis of inbound and outbound passenger flows at subway stations by time period: Clean the AFC card swiping data; According to the cleaned AFC card swiping data, count the inbound and outbound volumes respectively according to the station and time interval; Statistical analysis of OD passenger flows between subway stations by time period: According to the cleaned AFC card swiping data, perform time period aggregation according to the outbound time, and count the OD passenger flows between the starting station and the terminal station according to the time window to obtain the OD passenger flow matrix between subway stations with multiple time series; Preprocess the subway station spatial location data, including: Mark the longitude and latitude of all subway stations in the WGS-84 coordinate system and map them to the map; Preprocess the POI data, including: Unify the coordinate systems of various types of POI data with the coordinate system of the subway station and match them to the map; Preprocess the mobile phone signaling data, including: First, clean the anonymized mobile phone signaling data, unify the timestamps into the standard format, map the base station IDs to geographical coordinates, and reconstruct the user's movement trajectory according to the timestamps and base station locations; Secondly, analyze the user's activity patterns in different time periods and infer their place of residence and place of work; Next, divide the research area into grids, map the user's residence or work records to the corresponding grids, and generate work and residence data for each grid; Finally, count the resident population and working population within each grid and perform oversampling calibration.

[0008] Furthermore, extract the key OD pairs of subway passenger flow, specifically including: The extraction of key OD pairs needs to meet the following conditions: the proportion of zero values in any OD pair is lower than the preset threshold, and the sum of the OD pair time series is greater than the preset percentile or the standard deviation of the OD pair is greater than the preset percentile. If the 90th percentile is taken, the key OD pairs are expressed as: ; Among them, the proportion of zero values in the OD pair being lower than the preset threshold is expressed as: ; Among them, represents the proportion of zero values in the time series of the i th OD pair; is the tensor of the time series of the i th OD pair; z is the preset threshold of the proportion of zero values, set according to the distribution of the proportion of zero values in all OD pairs; represents the time series composed of the OD passenger flow of the i th OD pair in historical time, where t is the length of the time series, is the i th OD pair t at time ; refers to the number of 0s in the OD pair time series tensor; refers to the length of the OD pair time series tensor; ; Among them, [[ID=A9]]is the sum of the time series of the i th OD pair, ; is the 90th percentile of the set composed of the sums of all time series: ; refers to finding the percentile of the data set; The standard deviation of the OD pair being greater than the 90th percentile is expressed as: ; is the standard deviation of the time series of the i th OD pair, , is the mean of the time series; is the 90th percentile of the set composed of the standard deviations of all time series: 。

[0009] Furthermore, multiple spatial correlation features are extracted using multiple knowledge graphs, specifically including: The multiple knowledge graphs include: Spatial connectivity knowledge graph: It includes calculating and constructing a spatial distance matrix between the starting points of key OD pairs and a spatial distance matrix between the ending points of key OD pairs; the spatial distance i between stations j is calculated using the Haversine formula; each element in the spatial connectivity correlation matrix is the reciprocal of the spatial distance between stations; Inflow or outflow volume pattern similarity knowledge graph: It includes calculating and constructing a time pattern similarity matrix of the inflow volume at the starting points of key OD pairs, a time pattern similarity matrix of the inflow volume at the ending points of key OD pairs, a time pattern similarity matrix of the outflow volume at the starting points of key OD pairs, and a time pattern similarity matrix of the outflow volume at the ending points of key OD pairs; the time pattern similarity of the inflow or outflow volume is calculated and quantified based on the DTW function; OD volume time pattern similarity knowledge graph: It includes calculating and constructing a pattern correlation matrix between key OD pairs, and each element in the matrix is the Pearson correlation coefficient of the OD passenger flow time series between OD pairs; Function similarity knowledge graph: It includes calculating and constructing a function similarity matrix between the starting points of key OD pairs and a function similarity matrix between the ending points of key OD pairs; the function similarity i between stations j is calculated according to the cosine similarity of the vectors P(i) composed of the POI quantity, working population, and resident population of the two stations P(j) and

[0010] Furthermore, a spatial feature modeling module is used to extract spatial features, specifically including: Construct an OD pair feature matrix : The OD pair feature matrix between stations , where N is the number of OD pairs, P is the length of the OD pair time series, i the eigenvalue at time is R , where represents the set of real numbers, and is a matrix or vector; Graph Convolutional Network (GCN) processing: Input the knowledge graph H concat 。

[0011] Further, input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction results for future time through a fully connected layer, specifically including: After splicing the state matrices obtained by processing multiple knowledge graphs through GCN H concat , input it into the gated recurrent unit GRU for time series modeling and output the high-dimensional hidden state results, and then map the hidden state to the prediction results of one or more future time steps through a fully connected layer.

[0012] Further, train, test and evaluate the multi-knowledge graph neural network model, specifically including: During the training process, the goal is to minimize the error between the actual value and the predicted value, using and to represent the actual OD and the predicted OD respectively, and the loss function of the multi-knowledge graph neural network model is expressed as: ; The first term refers to minimizing the error between the actual value and the predicted value, and the second term is the L2 regularization term, is a hyperparameter.

[0013] Further, train, test and evaluate the multi-knowledge graph neural network model, specifically including: Adopt evaluation indicators including root mean square error RMSE, mean absolute error MAE, accuracy rate, coefficient of determination R 2 , and explained variance score Var to evaluate and optimize the multi-knowledge graph neural network model to obtain the final prediction model.

[0014] According to the second aspect, an embodiment provides a subway short-term OD passenger flow prediction system based on a multi-knowledge graph neural network model, and the system includes: A data acquisition module, configured to collect multi-source basic data related to the subway network, subway passenger flow and passenger flow influencing factors, and perform data preprocessing to extract key OD pairs of subway passenger flow; A prediction model construction module, configured to construct a multi-knowledge graph neural network model, and the neural network model is used to first extract various spatial correlation features by using a multi-knowledge graph, then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use a spatial feature modeling module to extract spatial features, and then input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction results for future time through a fully connected layer; A model training and testing module for constructing a training set and a testing set, training, testing and evaluating the multi-knowledge graph neural network model to obtain a final multi-knowledge graph neural network model.

[0015] According to a third aspect, in one embodiment, an electronic device is provided, and the device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model as described in any one of the above.

[0016] According to a fourth aspect, in one embodiment, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model as described in any one of the above are implemented.

[0017] The present application provides a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model. First, based on multi-source data such as subway station location data, AFC data, POI data, and mobile phone signaling data, the subway network structure, passenger flow characteristics, and land use and population characteristics around subway stations are quantified, and key OD pairs are extracted to prevent low-value and random data from affecting the model. Secondly, multiple knowledge graphs are constructed to capture the spatial connectivity, travel pattern similarity, and functional similarity between nodes. At the same time, a spatial feature modeling module is constructed to use graph neural networks to capture the potential spatial relationships between nodes. Finally, a time feature modeling module is constructed to use time series modeling methods to capture the dynamic change process of passenger flow. This prediction method effectively quantifies and captures the complex spatio-temporal correlations existing in subway passenger flow, and significantly enhances the prediction ability and interpretability. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided by an embodiment of the present invention; Figure 2 It is a specific implementation flowchart of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided by an embodiment of the present invention; Figure 3 It is a schematic diagram of the basic framework of a multi-knowledge graph neural network model in a subway short-term OD passenger flow prediction method provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of the relationship between data preprocessing and knowledge graph construction in a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided by an embodiment of the present invention; Figure 5 The GRU time feature modeling structure diagram in a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided by an embodiment of the present invention; Figure 6 The comparison between the true value and the predicted value of OD pair (number 391) at 30-minute intervals in a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided by an embodiment of the present invention; Figure 7 The overall architecture diagram of a subway short-term OD passenger flow prediction system based on a multi-knowledge graph neural network model provided by an embodiment of the present invention. Detailed implementation manners

[0019] The present invention will be further described in detail below in conjunction with the accompanying drawings through specific implementation manners. Similar elements in different implementation manners are labeled with related similar element numbers. In the following implementation manners, many details are described to enable a better understanding of the present application. However, those skilled in the art can easily recognize that some of the features can be omitted in different situations, or can be replaced by other elements, materials, or methods. In some cases, some operations related to the present application are not shown or described in the specification to avoid the core part of the present application being overwhelmed by excessive description. For those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0020] In addition, the features, operations, or characteristics described in the specification can be combined in any appropriate manner to form various implementation manners. At the same time, the steps or actions in the method description can also be reordered or adjusted in an obvious manner by those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for clearly describing a certain embodiment and do not mean that they are necessary sequences unless it is stated that a certain sequence must be followed.

[0021] A subway short-term OD passenger flow prediction method provided by an embodiment of the present invention will be described in detail below in conjunction with Figure 1 and Figure 2 as follows.

[0022] As Figure 1 shown, in step S100, multi-source basic data related to the subway network, subway passenger flow, and passenger flow influencing factors is collected, and data preprocessing is performed to extract key OD pairs of subway passenger flow.

[0023] In this embodiment, the basic data includes subway station spatial location data, AFC card swiping data, POI data, and anonymized mobile signaling data.

[0024] Data preprocessing specifically includes: 1) Preprocessing of AFC card swiping data Passenger flow statistics of entering and leaving subway stations by time period: Perform data cleaning on AFC card swiping data, including duplicate removal, outlier removal (missing entry or exit records, overly long intervals between entry and exit), time format conversion, and station code matching; according to the cleaned AFC card swiping data, separately count the entry volume and exit volume by station and time interval (such as a 15-minute interval). OD passenger flow statistics between subway stations by time period: According to the cleaned AFC card swiping data, perform time-period aggregation by exit time, and statistically count the OD passenger flow between the starting station and the ending station within a time window (such as aggregating at 15-minute intervals) to obtain an OD passenger flow matrix between subway stations with multiple time series.

[0025] Table 1 AFC card swiping data

[0026] 2) Preprocessing of subway station spatial location data Mark the longitude and latitude of all subway stations in the WGS-84 coordinate system and map them to the map.

[0027] 3) Preprocessing of POI data Unify the coordinate systems of various types of POI data with the coordinate system of the subway station and match them to the map.

[0028] 4) Preprocessing of mobile signaling data First, filter outliers, handle missing values, unify the timestamp to a standard format, map the base station ID to geographical coordinates for the anonymized mobile signaling data, and reconstruct the user's movement trajectory based on the timestamp and base station location; Secondly, analyze the user's activity patterns at different time periods to infer their place of residence and workplace; determine their workplace and place of residence based on the user's stay duration at night and during the day; Next, divide the research area into grids of 150m * 150m, map the user's residence or work records to the corresponding grids, and generate work and residence data for each grid; Finally, count the resident population and working population within each grid and perform sampling calibration.

[0029] 5) Extract key OD pairs of subway passenger flow The OD matrix describes the number of trips for each OD pair within the system during a specific time interval. The number of stations in the subway system is N, and the number of generated OD pairs is N*N pairs. That is, the OD matrix is an N*N square matrix with a large amount of data. However, most elements in the OD matrix are 0, which means that there is no passenger travel demand between most stations. Therefore, not all OD pairs need to be concerned. The passenger flow of some non-critical OD pairs is very scarce, and the travel demand is also very random. The contribution of the passenger flow of such OD pairs is very small, indicating that relatively few critical OD pairs account for the vast majority of the overall OD passenger flow.

[0030] Table 2 OD Passenger Flow Matrix Data between Subway Stations during a Certain Time Segment

[0031] Table 3 OD Pair Data during a Certain Time Segment

[0032] Table 4 Example of OD Pair Feature Matrix

[0033] Use to represent the time series composed of the historical OD passenger flow of the i th OD pair, where t is the length of the time series, is the OD passenger flow of the i th OD pair at the t th moment. In order to extract critical OD pairs, this embodiment believes that OD pairs with a relatively low proportion of 0 values in historical data, a relatively large total historical OD passenger flow, or distinctive changes are critical OD pairs, which are selected by setting thresholds as follows: The extraction of critical OD pairs needs to meet the following conditions: the proportion of zero values of any OD pair is lower than the preset threshold, and the sum of the OD pair time series is greater than the preset percentile or the standard deviation of the OD pair is greater than the preset percentile; in this embodiment, the 90th percentile is taken, then the critical OD pair is expressed as: ; The proportion of zero values of the OD pair is lower than the preset threshold, which is expressed as: ; Among them, represents the proportion of zero values in the time series of the i th OD pair; is the tensor of the time series of the i th OD pair; z is the preset threshold of the zero value proportion, which is set according to the distribution of the zero value proportion of all OD pairs and can be 50%-90%; The sum of OD pairs for the time series is greater than the 90th percentile, expressed as: ; where is the sum of the i th OD pair time series, ; is the 90th percentile of the set composed of the sums of all time series: ; The standard deviation of OD pairs is greater than the 90th percentile, expressed as: ; is the standard deviation of the i th OD pair time series, , is the mean of the time series; is the 90th percentile of the set composed of the standard deviations of all time series: .

[0034] As Figure 1 shown, in step S200, a multi-knowledge graph neural network model is constructed. The neural network model is used to first extract various spatial correlation features using the multi-knowledge graph, then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use the spatial feature modeling module to extract spatial features, then input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction result for future time through the fully connected layer.

[0035] The above steps specifically include: 1. Problem description Define the OD pair feature matrix between stations , where N is the number of OD pairs, P is the length of the OD pair time series, i The eigenvalue at time is

[0036] The spatio-temporal traffic prediction problem is: Given the preset graph structure and feature matrix , learn the mapping function to predict the traffic information at the next time: ; Among them, n is the length of the historical time series, is the length of the time to be predicted.

[0037] 2. Construction of multi-knowledge graphs Based on the preprocessed data, construct multi-knowledge graphs, such as Figure 4 shown. Each graph represents different spatial correlations. Among them, the OD pairs between stations are the vertices of the graph, and the edges encode the pairwise relationships between OD pairs, between the starting points of OD, and between the ending points of OD, denoted by indicating, V where represents the vertices of the graph, E represents the edges of the graph.

[0038] 1) Spatial connectivity knowledge graph: It includes calculating and constructing the spatial distance matrix between the starting points of key OD pairs and the spatial distance matrix between the ending points of key OD pairs.

[0039] Specifically, the spatial connectivity graph is calculated based on the spatial distance between the starting stations or the ending stations of key OD pairs. The spatial distance i between station j and station is calculated using the Haversine formula, and its formula is as follows: ; where: R is the radius of the earth, taking 6371 km; are respectively the latitudes of station i and station j , in radians; are respectively the longitudes of station i and station j , in radians.

[0040] Each element in the spatial connectivity correlation matrix is the reciprocal of the spatial distance: ; It can be seen that the spatial connectivity correlation decreases as the spatial distance increases.

[0041] 2) Inflow or outflow volume pattern similarity knowledge graph: It includes calculating and constructing the time pattern similarity matrix of the inflow volume at the starting points of key OD pairs, the time pattern similarity matrix of the inflow volume at the ending points of key OD pairs, the time pattern similarity matrix of the outflow volume at the starting points of key OD pairs, and the time pattern similarity matrix of the outflow volume at the ending points of key OD pairs.

[0042] Specifically, the time pattern similarity knowledge graph of the inflow or outflow volume or , DTW quantization is adopted. The core idea of DTW is to align two time series to minimize their distance. The calculation process is as follows: Suppose two time series of inbound volumes are given: The historical time series of inbound volumes at Subway Station 1: ; The historical time series of inbound volumes at Subway Station 2: ; Among them, is the inbound volume at Subway Station 1 at m time, is the inbound volume at Subway Station 2 at n time.

[0043] DTW calculates the shortest alignment path between two time series by constructing a cumulative distance matrix D The formula is as follows: ; Among them, is the Euclidean distance between the X and Y at the i th and j th points; represents the minimum cumulative matching distance from to .

[0044] The final DTW distance of the time series is expressed as: ; The smaller it is, the greater the similarity.

[0045] The time pattern similarity matrix of the inbound volume is calculated by the following formula: ; After conversion , equals 1, the more similar the time series are.

[0046] 3) OD volume time pattern similarity knowledge graph: It includes calculating and constructing a pattern correlation matrix between key OD pairs. Each element in the matrix is the Pearson correlation coefficient of the OD passenger flow time series between OD pairs.

[0047] Specifically, for the OD passenger flow pattern time similarity knowledge graph , the Pearson coefficient is used to quantify the correlation between time series and the co - variability over time. For the pattern correlation matrix between key OD pairs, each element is the Pearson correlation coefficient of the historical flow data series between OD: ; and represent the time series of two OD pairs respectively, and represent the mean values of each time series.

[0048] indicates a perfect positive correlation, and the trends of the two are exactly the same; indicates a complete lack of correlation; indicates a perfect negative correlation, and the trends of the two are exactly opposite.

[0049] 4) Functional similarity knowledge graph: including calculating and constructing the functional similarity matrix between the starting points of key OD pairs and the functional similarity matrix between the ending points of key OD pairs.

[0050] Specifically, the functional similarity graph simulates the similarity between stations in terms of regional functions (such as commerce, residence, etc.). Two stations located in areas with similar urban functions may show similarity in the time patterns of passenger flow. The regional functions of stations are represented by the number of POIs (points of interest) of each category, the working population, and the residential population vector within a range of 2 kilometers centered on the station.

[0051] Station i and j The functional similarity between them is denoted as , and is calculated through the cosine similarity of the vectors P(i) and P(j) composed of the POI quantities, working population, and residential population of the two stations. The calculation formula is as follows: ; Calculate the functional similarity for each pair of stations and use it as the weight of each edge in the graph .

[0052] , indicating complete similarity, , indicating complete irrelevance.

[0053] 3. Modeling of Spatial and Temporal Features Based on the construction of multiple knowledge graphs such as the spatial connectivity knowledge graph between starting points, the spatial connectivity knowledge graph between ending points, the inbound volume pattern similarity graph between starting points, the outbound volume pattern similarity graph between starting points, the inbound volume pattern similarity graph between ending points, the outbound volume pattern similarity graph between ending points, the OD volume time pattern similarity graph, the functional similarity graph between starting points, and the functional similarity graph between ending points (four types of knowledge graphs, a total of 9 knowledge graphs, i.e., 9 adjacency matrices), use the spatial feature modeling module and the temporal feature modeling module to carry out spatial and temporal feature modeling.

[0054] In this embodiment, the spatial feature modeling module can use, but is not limited to, graph convolutional network (GCN), graph attention network (GAT), graph autoencoder, etc., and the temporal feature modeling module can use, but is not limited to, gated recurrent unit (GRU), long short-term memory network (LSTM), temporal convolutional network (TCN), or Transformer and other architectures. Figure 3 A specific example of the multi-knowledge graph neural network model architecture is given. In this example, the spatial feature modeling module uses the graph convolutional network GCN, and the temporal feature modeling module uses the gated recurrent unit GRU.

[0055] 1) Spatial feature modeling As a specific example, the spatial feature modeling module uses the graph convolutional network GCN. GCN is a neural network model based on graph-structured data. Its core idea is to utilize the topological structure of the graph and node features to perform information propagation and feature extraction through convolutional operations.

[0056] Given the adjacency matrix A and the feature matrix X , the GCN model constructs a filter in the Fourier domain. This filter acts on the nodes of the graph to capture spatial features through its first-order neighbors.

[0057] a. Construct the OD pair feature matrix X : The OD pair feature matrix between stations , N is the number of OD pairs, P is the length of the OD pair time series, t The eigenvalue at time is R ,

[0058] b. GCN processing: Input the knowledge graph and the OD pair feature matrix X into the GCN to obtain the corresponding state matrix. Multiple knowledge graphs are all processed by the GCN to obtain multiple state matrices.

[0059] Specifically, for each knowledge graph , apply it and the OD pair feature matrix to two layers of GCN. The GCN model is constructed by stacking multiple convolutional layers, and its mathematical expression is as follows: ; where: is the adjacency matrix with self-connections added, is the identity matrix; is the degree matrix, defined as , is lOutput of the layer; are the trainable parameters of this layer; is a non - linear activation function (such as sigmoid); obtain the graph - level output state result .

[0060] c. Concatenation: Concatenate the state matrix results of multiple knowledge graphs to obtain H concat, Denoted as: .

[0061] In summary, the input of GCN during operation is the OD - pair feature matrix and a knowledge graph. Input a knowledge graph and the OD - pair feature matrix into GCN, and generate a new state matrix. Since 9 knowledge graphs are obtained previously, input 9 times, GCN runs 9 times, and finally concatenate the state matrix results corresponding to the 9 knowledge graphs.

[0062] 2) Temporal feature modeling As a specific example, the temporal feature modeling module uses the gated recurrent unit GRU. GRU is a variant of the recurrent neural network (RNN), specifically designed for processing sequence data. Compared with the long short - term memory network (LSTM), it has higher computational efficiency. The principle of the GRU model is as Figure 5 shown. By receiving the hidden state at the previous moment and the current traffic information as inputs to obtain t the traffic information at time

[0063] denotes the hidden state at time t-1 , denotes the traffic information at time t . In this embodiment, is the concatenated state matrix output by GCN H concat .

[0064] The reset gate is used to control the degree of ignoring the state information at the previous moment at the current moment: ; The update gate is used to control the degree of retaining the state information at the previous moment in the current state: ; The candidate state of the memory content represents the memory information stored at time t : ; The output status represents the moment t of the final state: ; where * represents element-wise multiplication, W and b represent the weights and biases during the model training process respectively.

[0065] In this embodiment, the input of the GRU is the concatenated feature H concat corresponding t state value at the moment, and the hidden state at the previous moment h t-1 , and through GRU processing, the hidden state t at the moment is obtained , and then the hidden state is mapped to the prediction results of one or more future time steps through a fully connected layer. The future time steps can be 15 min, 30 min, 45 min, 60 min.

[0066] As Figure 1 shown, in step S300, a training set and a test set are constructed, the multi-knowledge graph neural network model is trained, tested and evaluated to obtain the final multi-knowledge graph neural network model.

[0067] Specifically, taking the Xi'an Metro data as an example, 80% of the data is used as the training set, and the remaining 20% is used as the test set. Predict the OD passenger flow for the next 15 minutes, 30 minutes, 45 minutes and 60 minutes.

[0068] Loss function: During the training process, the goal is to minimize the error between the actual value and the predicted value. Use and to represent the actual OD and the predicted OD respectively. The loss function of the multi-knowledge graph neural network model is as shown in the formula: ; where the first term refers to minimizing the error between the actual value and the predicted value; the second term is the L2 regularization term, which helps to avoid overfitting problems, is a hyperparameter.

[0069] The evaluation metrics use the root mean square error RMSE, mean absolute error MAE, accuracy, coefficient of determination R 2 , explained variance score Var to evaluate and optimize the multi-knowledge graph neural network model to obtain a prediction model; the multi-knowledge graph neural network model uses the PyTorch deep learning framework.

[0070] The evaluation indicators are as follows: (1) Root Mean Square Error (RMSE) ; (2) Mean Absolute Error (MAE) ; (3) Accuracy ; (4) Coefficient of Determination (R²) ; (5) Explained Variance Score (var) ; Use and to represent the actual value and the predicted OD of the i th OD in the j th time period respectively. M is the number of time samples, N is the number of OD, and are the sets of and , is the mean value of , represents the Frobenius norm, which is used to measure the overall error of the matrix.

[0071] Figure 6 Figure

[0072] corresponds to the subway short-term OD passenger flow prediction method based on the multi-knowledge graph neural network model disclosed above. The embodiment of the present invention also discloses a subway short-term OD passenger flow prediction system based on the multi-knowledge graph neural network model, as shown in Figure 7 shown, which specifically includes: A data acquisition module, configured to collect multi-source basic data related to the subway network, subway passenger flow, and passenger flow influencing factors, and perform data preprocessing to extract key OD pairs of subway passenger flow; A prediction model construction module for constructing a multi-knowledge graph neural network model, which is used to first extract various spatial correlation features using a multi-knowledge graph, then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use a spatial feature modeling module to extract spatial features, and then input the time series with spatial features into a time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction result for future time through a fully connected layer; A model training and testing module for constructing a training set and a testing set, training, testing and evaluating the multi-knowledge graph neural network model to obtain a final multi-knowledge graph neural network model.

[0073] It should be noted that for the detailed description of a subway short-term OD passenger flow prediction system based on a multi-knowledge graph neural network model provided in an embodiment of the present invention, reference can be made to the relevant description of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided in an embodiment of the present application, which will not be elaborated here.

[0074] In addition, an embodiment of the present invention further provides an electronic device, which includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model as described in any one of the above.

[0075] It should be noted that for the detailed description of an electronic device provided in an embodiment of the present invention, reference can be made to the relevant description of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided in an embodiment of the present application, which will not be elaborated here.

[0076] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model as described in any one of the above are implemented.

[0077] It should be noted that for the detailed description of a computer-readable storage medium provided in an embodiment of the present invention, reference can be made to the relevant description of a subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model provided in an embodiment of the present application, which will not be elaborated here.

[0078] Those skilled in the art can understand that all or part of the functions of the various methods in the above embodiments can be implemented in a hardware manner or in a computer program manner. When all or part of the functions in the above embodiments are implemented in a computer program manner, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, magnetic disk, optical disk, hard disk, etc. The above functions can be realized by a computer executing the program. For example, the program is stored in the memory of the device, and when the processor executes the program in the memory, the above all or part of the functions can be realized. In addition, when all or part of the functions in the above embodiments are implemented in a computer program manner, the program can also be stored in a storage medium such as a server, another computer, magnetic disk, optical disk, flash drive or mobile hard disk, and saved to the memory of the local device by downloading or copying, or the system of the local device is updated in version. When the processor executes the program in the memory, all or part of the functions in the above embodiments can be realized.

[0079] The above uses specific examples to elaborate on the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art of the present invention, according to the idea of the present invention, several simple deductions, deformations or substitutions can also be made.

Claims

1. A short-term OD passenger flow prediction method for subway based on a multi-knowledge graph neural network model, characterized in that The method includes: Collecting multi-source basic data related to the subway network, subway passenger flow, and passenger flow influencing factors, and performing data preprocessing to extract key OD pairs of subway passenger flow; Constructing a multi-knowledge graph neural network model, which is used to first extract various spatial correlation features using the multi-knowledge graph, then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use the spatial feature modeling module to extract spatial features, and then input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction results for future time through the fully connected layer; Constructing a training set and a test set, training, testing, and evaluating the multi-knowledge graph neural network model to obtain the final multi-knowledge graph neural network model.

2. The subway short-term OD passenger flow prediction method based on the multi-knowledge graph neural network model according to claim 1, wherein, Collecting multi-source basic data related to the subway network, subway passenger flow, and passenger flow influencing factors, specifically including: The multi-source basic data includes subway station spatial location data, AFC card swiping data, POI data, and anonymized mobile phone signaling data.

3. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 2, characterized in that Data preprocessing specifically includes: Preprocessing the AFC card swiping data, including: Statistical analysis of the inbound and outbound passenger flow of subway stations by time period: cleaning the AFC card swiping data; according to the cleaned AFC card swiping data, respectively counting the inbound volume and outbound volume by station and time interval; Statistical analysis of the OD passenger flow between subway stations by time period: according to the cleaned AFC card swiping data, performing time period aggregation according to the outbound time, and statistically analyzing the OD passenger flow between the starting station and the terminal station according to the time window to obtain the OD passenger flow matrix between subway stations with multiple time series; Preprocessing the subway station spatial location data, including: Marking the longitude and latitude of all subway stations in the WGS-84 coordinate system and mapping them to the map; Preprocessing the POI data, including: Unifying the coordinate systems of various types of POI data with the coordinate system of the subway station and matching them to the map; Preprocessing the mobile phone signaling data, including: First, cleaning the anonymized mobile phone signaling data, unifying the timestamp to the standard format, mapping the base station ID to the geographical coordinates, and reconstructing the user's movement trajectory according to the timestamp and the base station location; Secondly, analyzing the user's activity patterns in different time periods to infer the user's place of residence and place of work; Then, dividing the research area into grids, mapping the user's residence or work records to the corresponding grids to generate work and residence data for each grid; Finally, counting the resident population and working population within each grid and performing resampling and calibration.

4. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, characterized in that, Extracting key OD pairs of subway passenger flow, specifically including: The extraction of key OD pairs needs to meet the following conditions: the proportion of zero values in any OD pair is lower than the preset threshold, and the sum of the OD pair time series is greater than the preset percentile or the standard deviation of the OD pair is greater than the preset percentile.

5. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, characterized in that, Extracting various spatial correlation features using the multi-knowledge graph, specifically including: The multi-knowledge graph includes: Spatial connectivity knowledge graph: including calculating and constructing the spatial distance matrix between the starting points of key OD pairs and the spatial distance matrix between the ending points of key OD pairs; stations i and stations j The spatial distance between them is calculated using the Haversine formula; each element in the spatial connectivity correlation matrix is the reciprocal of the spatial distance between stations; Inbound or outbound volume pattern similarity knowledge graph: It includes calculating and constructing the time pattern similarity matrix of the starting point inbound volume of key OD pairs, the time pattern similarity matrix of the ending point inbound volume of key OD pairs, the time pattern similarity matrix of the starting point outbound volume of key OD pairs, and the time pattern similarity matrix of the ending point outbound volume of key OD pairs; The time pattern similarity of inbound or outbound volume is calculated and quantified based on the DTW function. OD volume time pattern similarity knowledge graph: It includes calculating and constructing the pattern correlation matrix between key OD pairs, and each element in the matrix is the Pearson correlation coefficient of the OD passenger flow time series between OD pairs. Functional similarity knowledge graph: including calculating and constructing the functional similarity matrix between the starting points of key OD pairs and the functional similarity matrix between the ending points of key OD pairs; stations i and j The functional similarity between is calculated according to the cosine similarity of the vectors composed of the POI quantities, working populations, and resident populations of the two stations P(i) and P(j) and 6. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, characterized in that Use the spatial feature modeling module to extract spatial features, specifically including: Construct the OD pair feature matrix : The OD pair feature matrix between stations , where N is the number of OD pairs, P is the length of the OD pair time series, i The eigenvalue at time is R denotes the set of real numbers and is a matrix or vector; Graph Convolutional Network (GCN) processing: input the knowledge graph and the OD pair feature matrix into the GCN to obtain the corresponding state matrix. Multiple knowledge graphs are all processed by the GCN to obtain multiple state matrices; Concatenation: Concatenate the state matrix results of multiple knowledge graphs to obtain H concat .

7. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, wherein Input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction results for future time through the fully connected layer, specifically including: After splicing the state matrices obtained by processing multiple knowledge graphs through GCN H concat , it is input into the gated recurrent unit GRU for temporal modeling and outputs a high-dimensional hidden state result, and then the hidden state is mapped to the prediction results of one or more future time steps through a fully connected layer.

8. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, wherein, Train, test and evaluate the multi-knowledge graph neural network model, specifically including: During the training process, the goal is to minimize the error between the actual value and the predicted value, using and to represent the actual OD and the predicted OD respectively. The loss function of the multi-knowledge graph neural network model is expressed as: ; The first term refers to minimizing the error between the actual value and the predicted value, and the second term is the L2 regularization term, which is a hyperparameter.

9. The subway short-term OD passenger flow prediction method based on a multi-knowledge graph neural network model according to claim 1, characterized in that, Train, test and evaluate the multi-knowledge graph neural network model, specifically including: Using evaluation metrics including Root Mean Square Error (RMSE), Mean Absolute Error (MAE), accuracy, and coefficient of determination R 2 , and explained variance score (Var) to evaluate and optimize the multi-knowledge graph neural network model, and obtaining a final prediction model.

10. A subway short-term OD passenger flow prediction system based on a multi-knowledge graph neural network model, characterized in that, The system includes: Data acquisition module, which is used to collect multi-source basic data related to the subway network, subway passenger flow and passenger flow influencing factors, and perform data preprocessing to extract key OD pairs of subway passenger flow. Prediction model construction module, which is used to construct a multi-knowledge graph neural network model. The neural network model is used to first extract various spatial correlation features using the multi-knowledge graph, and then based on the multi-knowledge graph results and the constructed OD pair feature matrix, use the spatial feature modeling module to extract spatial features, and then input the time series with spatial features into the time feature modeling module to extract time features, and finally obtain the OD passenger flow prediction results for future time through the fully connected layer. Model training and testing module, which is used to construct a training set and a testing set, train, test and evaluate the multi-knowledge graph neural network model, and obtain the final multi-knowledge graph neural network model.

Citation Information

Patent Citations

  • Subway passenger flow prediction method and device and computer storage medium

    CN113239198A

  • Space-time double-attention subway passenger flow short-time prediction method based on GAT-Seq2seq model

    CN113962472A

  • Intercity travel OD demand prediction model training method, prediction method and system

    CN117076922A

  • Urban rail passenger flow prediction method based on dynamic multi-graph and multi-dimensional attention space-time neural network

    CN117454119A

  • Subway passenger flow volume prediction method and device based on DCG and double-branch parallel

    CN118469079A

Cited By

  • Commercial district passenger flow volume prediction method based on graph neural network

    CN121660739A