Subway station passenger flow prediction method and device based on multi-relation self-attention spatio-temporal graph neural network and electronic equipment

The passenger flow prediction method constructed by multi-relation self-attention spatiotemporal graph neural network solves the problem of predicting the similarity and correlation of long-distance passenger flow between subway stations, achieves accurate passenger flow prediction and reduces errors, and supports the optimization of intelligent transportation systems.

CN121903093BActive Publication Date: 2026-07-31FUJIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN UNIV OF TECH
Filing Date
2026-03-25
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies cannot accurately predict the similarity and correlation of long-distance passenger flow between subway stations, resulting in an inability to reflect cross-regional passenger flow patterns and affecting passenger travel experience and safety.

Method used

A multi-relation self-attention spatiotemporal graph neural network is adopted. By acquiring metro network data and historical passenger flow data, a normalized metro network map, a passenger flow similarity map, and a passenger boarding and alighting correlation map are constructed. Combined with a collaborative gating cyclic unit and a multi-head self-attention module, a time series model is constructed to predict passenger flow.

Benefits of technology

It improves the accuracy of passenger flow forecasting, reduces the fluctuation of forecasting errors, and enables accurate forecasting of passenger flow at subway stations, supporting real-time scheduling and capacity resource optimization of intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121903093B_ABST
    Figure CN121903093B_ABST
Patent Text Reader

Abstract

This invention provides a method, device, and electronic device for predicting subway passenger flow using a multi-relational self-attention spatiotemporal graph neural network. The method includes: acquiring subway network data and historical passenger flow data, wherein the historical passenger flow data includes passenger entry and exit data of all stations in the subway network across multiple time slices, including the current time slice; acquiring a normalized subway network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the subway network data and the historical passenger flow data; applying a time series model constructed based on a collaborative gated cyclic unit, combined with the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to process the historical passenger flow data to obtain passenger flow prediction data; thereby improving the accuracy of passenger flow prediction while reducing the fluctuation of prediction error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of passenger flow prediction technology, specifically to a subway station passenger flow prediction method, device, and electronic equipment using a multi-relation self-attention spatiotemporal graph neural network. Background Technology

[0002] Subway passenger flow fluctuates dramatically with changes in time, space, and weather conditions. If passenger flow changes at each station cannot be accurately predicted, it can easily lead to problems such as congestion in station halls, overcrowded carriages, and a mismatch between capacity and demand, affecting not only passenger travel experience but also posing safety hazards. Therefore, how to accurately predict passenger flow at each subway station has become a key research issue in Intelligent Transportation Systems (ITS).

[0003] Existing methods use graph convolutional networks and related variants for passenger flow prediction, which often only capture the local correlation of passenger flow between nearby stations, ignoring the potential similarity and correlation of passenger flow between distant stations. They cannot reflect the cross-regional passenger flow patterns, and the information calculation for key stations is insufficient, thus failing to meet the needs of passenger flow prediction. Summary of the Invention

[0004] In view of this, the present invention aims to provide a subway station passenger flow prediction method, device and electronic device based on a multi-relation self-attention spatiotemporal graph neural network, which solves the problem that passenger flow prediction in related technologies ignores the potential similarity and correlation between distant stations and fails to reflect the cross-regional passenger flow pattern. It improves the accuracy of passenger flow prediction while reducing the fluctuation of prediction error.

[0005] According to one aspect of the present invention, an embodiment of the present invention provides a subway station passenger flow prediction method based on a multi-relation self-attention spatiotemporal graph neural network, comprising: acquiring subway network data and historical passenger flow data, wherein the historical passenger flow data includes passenger entry and exit data of all stations in the subway network in multiple time slices, including the current time slice; acquiring a normalized subway network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the subway network data and the historical passenger flow data; applying a time series model constructed based on a collaborative gated recurrent unit in combination with the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map to process the historical passenger flow data to obtain passenger flow prediction data, wherein the collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit, wherein the relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining graph structure, and the gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

[0006] In one embodiment, obtaining a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the metro network data and the historical passenger flow data includes: obtaining an adjacency matrix of the metro network based on the metro network data, and generating a normalized metro network map based on the adjacency matrix; calculating the passenger flow similarity weights for any two stations in the metro network based on the metro network data and the historical passenger flow data to obtain a passenger flow similarity map; and calculating the passenger boarding / alighting correlation weights for any two matching stations in the metro network based on the metro network data and the historical passenger flow data to obtain a passenger boarding / alighting correlation map.

[0007] In one embodiment, the step of calculating the similarity weight of passenger flow between any two stations in the metro network based on the metro network data and the historical passenger flow data to obtain a passenger flow similarity map includes: applying a dynamic time warping algorithm to calculate the similarity of passenger flow curves between any two stations in the metro network based on the metro network data and the historical passenger flow data; calculating the passenger flow similarity between any two stations based on the passenger flow curve similarity; normalizing the passenger flow similarity based on the metro network to obtain the passenger flow similarity weight of any two stations; and filtering the passenger flow similarity weight of any two stations in the metro network based on a similarity threshold to obtain a passenger flow similarity map.

[0008] In one embodiment, the step of calculating the passenger boarding / alighting correlation weights of any two matching stations in the metro network based on the metro network data and the historical passenger flow data to obtain a passenger boarding / alighting correlation map includes: calculating the ratio of the total number of passengers entering from any first station and exiting from any second station in the metro network to the total number of passengers entering from the first station, based on the metro network data and the historical passenger flow data, to obtain the passenger boarding / alighting correlation of the first station and the second station; normalizing the passenger boarding / alighting correlation of any two matching stations in the metro network based on the metro network data to obtain the passenger boarding / alighting correlation weights of any two matching stations; and combining the passenger boarding / alighting correlation weights of any two matching stations in the metro network based on a correlation threshold to obtain a passenger boarding / alighting correlation map.

[0009] In one embodiment, the application, based on a time series model constructed using collaborative gating loop units, processes the historical passenger flow data in conjunction with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map to obtain passenger flow prediction data. This includes: applying an encoder comprising multiple collaborative gating loop units to process the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in conjunction with the historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data; and applying a decoder comprising multiple collaborative gating loop units to process the high-dimensional features to obtain passenger flow prediction data for multiple future time slices.

[0010] In one embodiment, the application includes encoders of multiple collaborative gated loop units processing the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in conjunction with historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data. This includes: for any collaborative gated loop unit in the encoder, updating the data based on the passenger flow data of the current time slice, in conjunction with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and outputting the hidden state of the collaborative gated loop unit for the next time slice; the application also includes decoders of multiple collaborative gated loop units processing the high-dimensional features to obtain passenger flow prediction data for multiple future time slices. This includes: for any collaborative gated loop unit in the decoder, updating the data based on the hidden state of the collaborative gated loop unit of the previous time slice, in conjunction with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and outputting the passenger flow data for the next time slice.

[0011] In one embodiment, the step of updating the passenger flow data for the next time slice based on the hidden state of the collaborative gating loop unit of the previous time slice, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and outputting the passenger flow data for the next time slice includes: applying a relational graph convolutional neural network to extract historical spatiotemporal map features of each station based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the hidden state of the collaborative gating loop unit of the previous time slice; obtaining the spatiotemporal map features of the current time slice based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the passenger flow data of the current time slice or the hidden state of the previous layer collaborative gating loop unit of the current time slice; and applying a first gating loop unit to combine the historical spatiotemporal map features and the spatiotemporal map features of the current time slice. The spatiotemporal graph fusion features are obtained by fusing the features. A multi-head self-attention module is applied to perform self-attention analysis on the hidden state of the collaborative gated loop unit of the previous time slice to obtain historical passenger flow features. Self-attention analysis is then performed on the passenger flow data of the current time slice or the hidden state of the previous layer collaborative gated loop unit of the current time slice to obtain passenger flow features of the current time slice. A second gated loop unit is applied to fuse the historical passenger flow features and the passenger flow features of the current time slice to obtain passenger flow fusion features. A branch feature convergence module is applied to perform fine fusion of the spatiotemporal graph fusion features and the passenger flow fusion features, and outputs the hidden state of the collaborative gated loop unit of the current time slice and the passenger flow data of the next time slice. When the collaborative gated loop unit of the current time slice belongs to the decoder part, the predicted passenger flow data of the current time slice can be output.

[0012] According to another aspect of the present invention, an embodiment of the present invention provides a subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network. The subway station passenger flow prediction device based on the multi-relation self-attention spatiotemporal graph neural network includes: a data acquisition unit, used to acquire subway network data and historical passenger flow data, wherein the historical passenger flow data includes passenger entry and exit data of all stations in the subway network in multiple time slices, including the current time slice; a data analysis unit, used to acquire a normalized subway network map, a passenger flow similarity map, and a passenger boarding and alighting correlation map based on the subway network data and the historical passenger flow data; and a passenger flow prediction unit, used to apply a time series model constructed based on a collaborative gated recurrent unit to process the historical passenger flow data in combination with the normalized subway network map, the passenger flow similarity map, and the passenger boarding and alighting correlation map to obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining graph structures, and the gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

[0013] According to another aspect of the present invention, an embodiment of the present invention provides a subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network, comprising: a memory for storing executable program code; and a processor for calling and running the executable program code from the memory, such that the processor executes the aforementioned subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network.

[0014] This invention provides a method, device, and electronic device for predicting subway passenger flow using a multi-relational self-attention spatiotemporal graph neural network. It acquires subway network data and historical passenger flow data, including passenger entry and exit data for all stations in the subway network across multiple time slices, including the current time slice. Based on the subway network data and the historical passenger flow data, it obtains a normalized subway network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map. It then applies a time-series model constructed based on a collaborative gated cyclic unit, combined with the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to process the historical passenger flow data, thereby obtaining passenger flow prediction data. This improves the accuracy of passenger flow prediction while reducing fluctuations in prediction errors. Attached Figure Description

[0015] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0016] Figure 1 The diagram shown is a flowchart illustrating a subway station passenger flow prediction method based on a multi-relation self-attention spatiotemporal graph neural network provided in an embodiment of this application.

[0017] Figure 2 The diagram shown illustrates the acquisition of the normalized subway network map, passenger flow similarity map, and passenger boarding / alighting correlation map provided in this embodiment of the application.

[0018] Figure 3 The diagram shown is an example of a normalized subway network map provided in an embodiment of this application.

[0019] Figure 4 The diagram shown is a structural schematic of the time series model provided in an embodiment of this application.

[0020] Figure 5 The diagram shown is a schematic diagram of data processing in a collaboratively gated cyclic unit in a time series model provided in an embodiment of this application.

[0021] Figure 6The diagram shown is a structural schematic of a subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network provided in an embodiment of this application.

[0022] Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] 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. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] Furthermore, in exemplary embodiments, since the same reference numerals denote the same components having the same structure or the same steps of the same method, if one embodiment has been described by way of example, then in other exemplary embodiments only structures or methods different from those described in the embodiment will be described.

[0025] Throughout the specification and claims, when a component is described as being “connected” to another component, that component may be “directly connected” to the other component or “electrically connected” to the other component via a third component. Furthermore, unless explicitly stated otherwise, the term “comprising” and its corresponding terms should be understood only to include the stated component and not to exclude any other component.

[0026] Subway passenger flow fluctuates dramatically with changes in time, space, and weather conditions. If passenger flow changes at each station cannot be accurately predicted, it can easily lead to problems such as congestion in station halls, overcrowded carriages, and a mismatch between capacity and demand, affecting not only passenger travel experience but also posing safety hazards. Therefore, how to accurately predict passenger flow at each subway station has become a key research issue in Intelligent Transportation Systems (ITS).

[0027] Deep learning technology offers a new approach to solving this complex prediction problem. Compared with traditional methods, deep learning models possess powerful feature learning capabilities, automatically extracting multi-level, highly abstract feature representations from massive historical data without relying on excessive manual feature engineering. For example, graph convolutional networks can abstract the entire subway network into a graph structure, where each station is a node in the graph, and the subway lines define the edges between nodes. This abstraction naturally expresses the topological connections between stations. Through its unique spectral graph convolution or spatial convolution operations, it allows information from each station to be transmitted and aggregated along these edges between nodes, capturing spatial dependencies. Subway passenger flow is a typical time series, and its changes contain multiple temporal patterns: there are daily peak-hour fluctuations, weekly fluctuations between weekdays and weekends, and even short-term fluctuations measured in hours and minutes. Recurrent neural networks and their variants, such as Long Short-Term Memory (LSTM) networks and Gated Recurrent Units (GRUs), can model the dynamic changes of time series. Deep learning, an end-to-end learning framework, can automatically adapt to multi-dimensional influencing factors such as weather, events, and holidays, and achieve refined predictions at multiple time granularities, providing data support for real-time scheduling of subway trains and optimization of transportation capacity resource allocation.

[0028] Graph convolutional networks and their variants are commonly used in related technologies. However, constructing a graph structure based solely on the physical topology of the subway only captures the local spatial correlations of nearby stations, ignoring the potential similarities and connections between distant stations and failing to reflect cross-regional passenger flow patterns. Many related technologies employ simple graph convolutions and recurrent units, setting parameters for fully connected layers for automatic machine learning. This treats all stations in the subway network equally, failing to adaptively allocate weights to highlight the influence of key stations or main lines, resulting in insufficient computation of information about key stations. Furthermore, graph attention networks and large-dimensional convolutional fully connected layers are frequently used, leading to high computational costs and failing to meet the real-time requirements of passenger flow prediction.

[0029] To address the technical problem that passenger flow prediction in related technologies ignores the potential similarities and connections between distant stations and fails to reflect cross-regional passenger flow patterns, this application provides a subway station passenger flow prediction method based on a multi-relational self-attention spatiotemporal graph neural network. Figure 1 The diagram shown is a flowchart illustrating a subway station passenger flow prediction method based on a multi-relation self-attention spatiotemporal graph neural network, as provided in an embodiment of this application. Figure 1 As shown, the subway station passenger flow prediction method based on the multi-relation self-attention spatiotemporal graph neural network includes:

[0030] Step S11: Obtain subway network data and historical passenger flow data. The historical passenger flow data includes passenger entry and exit data of all stations in the subway network for multiple time slots, including the current time slot.

[0031] By collecting gate access data from all stations in the subway network, we can obtain the entry and exit times of each passenger, as well as the stations they enter and exit, i.e., long-term historical passenger flow data. The data can be statistically analyzed by time slice, and the length of each time slice can be set as needed. Statistical analysis can yield the number of people entering and exiting each station within each time slice, which can be directly used as the training and testing sets for subsequent time series models. Typical time slice lengths are 15 minutes, 30 minutes, 45 minutes, and 1 hour. The station time slice data and individual passenger data are also used to generate passenger flow similarity maps and passenger boarding / alighting correlation maps, providing richer features for time series model training.

[0032] Step S12: Obtain a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the metro network data and the historical passenger flow data.

[0033] After obtaining the metro network data and historical passenger flow data, data preprocessing is required. The preprocessing targets the long-term historical passenger flow data and metro network data used for training. Three methods are employed to preprocess them, resulting in three spatiotemporal relationship graphs. The normalized metro network graph has the same structure as the standard metro network graph, except that the edge values ​​are normalized. The passenger flow similarity graph analyzes the similarity of the total passenger flow curves for each station across all training data, using the similarity as the edge values ​​to construct a graph. The passenger boarding / alighting correlation graph analyzes the boarding / alighting stations of all passengers in the training data, calculating the ratio of passengers entering from station a and exiting from station b to the total number of passengers exiting from station b. This ratio is used as the value of the edge from a to b, thus constructing a directed graph. Finally, these graphs are fed into each Collaborative Gated Recurrent Unit (CGRU) in the time series model for training.

[0034] In the embodiments of this application, such as Figure 2 As shown, the adjacency matrix of the metro network is obtained based on the metro network data, and a normalized metro network map is generated based on the adjacency matrix; the similarity weight of passenger flow between any two stations in the metro network is calculated based on the metro network data and the historical passenger flow data to obtain a passenger flow similarity map; the correlation weight of passenger boarding and alighting between any two matching stations in the metro network is calculated based on the metro network data and the historical passenger flow data to obtain a passenger boarding and alighting correlation map.

[0035] A normalized metro network map is a network diagram composed of all stations on all metro lines, with each station being a node in the normalized metro network map. The adjacency matrix can be directly obtained from metro network data. , Figure 3 For a simple example, the station numbers are not actually stored. If the i-th station and the j-th station have an edge in the normalized metro network graph, then... If there is no edge between the i-th station and the j-th station, then .

[0036] In graph convolutional networks, the features of connected nodes are added to the features of each node in each convolution, i.e.:

[0037]

[0038] in, Let j be the feature vector of station j before convolution. Let i be the feature vector of station i after convolution. Let W be the weight matrix. If we directly use the adjacency matrix A of the subway network as the weight matrix W for convolution operations, the addition of features from multiple nodes can easily lead to numerical explosion since the weights of connected nodes are all 1. Therefore, we need to normalize the edge values, multiply the node features by their corresponding weights, and then sum them. This is equivalent to transforming the summation operation into a weighted average operation, thereby stabilizing the feature values. The normalization formula is as follows:

[0039]

[0040] in, Let N be the normalized weight of the edge between node i and node j in the normalized metro network graph, and N be the total number of metro stations.

[0041] To extract the similarity relationships between different subway stations on the overall passenger flow change curve, this application's embodiments introduce a passenger flow similarity map. The dynamic time warping algorithm is applied to calculate the passenger flow curve similarity between any two stations in the metro network based on the metro network data and the historical passenger flow data; the passenger flow similarity between any two stations is calculated based on the passenger flow curve similarity; the passenger flow similarity is normalized according to the metro network to obtain the passenger flow similarity weights between any two stations; and the passenger flow similarity weights between any two stations in the metro network are filtered based on a similarity threshold to obtain a passenger flow similarity map.

[0042] For subway station collection The passenger flow time series of each station i in the training set is denoted as follows: It includes passenger flow in and out of the station at all times. For any two stations... Define the passenger flow similarity between site i and site j. for:

[0043]

[0044] Considering that passenger flow curves at different stations may have temporal peaks or stretching distortions, such as slight shifts in the timing of the morning peak, rigid measures such as Euclidean distance are insufficient to accurately reflect their similarity. Therefore, this application uses the Dynamic Time Warping (DTW) algorithm to measure the similarity of passenger flow curves, as shown in the following formula:

[0045]

[0046] and Representing sequences respectively and Passenger flow values ​​for entering and exiting the station at time slots p and q; It is the L2 norm, used to measure the straight-line distance between p and q; To match the path, Where L is the length of the passenger flow time series, for and A pair of matching points are formed. The entire DTW operation is equivalent to allowing the passenger flow curve to be shifted over time and stretched and compressed locally. The dynamic programming method is used to find the matching path with the minimum Euclidean distance, which can effectively extract the similarity of passenger flow curves between different stations and provide richer features for subsequent model training.

[0047] An edge with similarity can be calculated between any two stations. Many of these edges have very low similarity values, indicating a lack of significant passenger flow similarity between the stations. Feeding these edges into the model would only increase computational load. Therefore, this patent sets a threshold of 0.1, only considering passenger flow similarity. An edge is drawn connecting two stations with passenger flow similarity exceeding a threshold, and the edge value is included in the adjacency matrix based on passenger flow similarity. The passenger flow similarity map was also normalized.

[0048]

[0049] in, This is the normalized weight for the passenger flow similarity between node i and node j in the normalized subway network graph. Let the edge signal function be the adjacency matrix. If there is an edge between station i and station k, then the value is 1; otherwise, the value is 0.

[0050] Considering the large number of regular, fixed-point traffic demands in subway transportation, such as rush hour and weekend / holiday peak travel periods, passenger boarding / alighting station data obtained from subway turnstiles can be used to generate a passenger boarding / alighting correlation map for each station. Based on the subway network data and historical passenger flow data, the ratio of the total number of passengers entering at any first station and exiting at any second station in the subway network to the total number of passengers entering at the first station is calculated to obtain the passenger boarding / alighting correlation between the first station and the second station. The passenger boarding / alighting correlation of any two matching stations in the subway network is normalized according to the subway network to obtain the passenger boarding / alighting correlation weights for any two matching stations. Based on a correlation threshold, the passenger boarding / alighting correlation weights of any two matching stations in the subway network are combined to obtain the passenger boarding / alighting correlation map.

[0051] The formula for calculating the correlation between passenger pick-up and drop-off at any two stations is as follows:

[0052]

[0053] in, Let J represent the total number of passengers entering station J and exiting station i. Since entry and exit are directional, the passenger boarding / alighting correlation graph is a directed graph. Similar to the passenger flow similarity graph, a threshold of 0.02 is set, edges below the threshold are removed to avoid unnecessary computation, and normalization is performed.

[0054]

[0055] This is the normalized weight for the passenger boarding / alighting correlation between node i and node j in the normalized metro network diagram.

[0056] Step S13: Apply the time series model constructed based on the collaborative gated recurrent unit, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to process the historical passenger flow data and obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining the graph structure. The gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

[0057] The time series model in this embodiment of the invention is a two-level time series model composed of multiple cooperatively gated cyclic units. The overall time series model structure is as follows: Figure 4As shown, the time series model adopts an encoder-decoder architecture, unfolded from left to right with time steps as columns. Every two collaboratively gated loop units form a column, representing a forward propagation and output at a certain time slice, with the time slices further to the right being newer. Let the passenger flow data at the current time t be X(t), and the future passenger flow data sequence for n time slices is obtained by using the historical passenger flow data sequence composed of n time slices.

[0058] In this embodiment, an encoder comprising multiple collaborative gating loop units can be used to process the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in conjunction with the historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data. Specifically, for any collaborative gating loop unit in the encoder, the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map are updated based on the passenger flow data of the current time slice, and the hidden state of the collaborative gating loop unit for the next time slice is output.

[0059] The leftmost n columns form the encoder, used to sequentially receive and encode the historical passenger flow sequence from time slice t-n+1 to t. Specifically, the input of the k-th column encoding unit is the passenger flow X(t-n+k) of the k-th historical time slice and the hidden state passed from the previous column unit. Its output hidden state is then passed to the (k+1)-th column, thus forming a high-dimensional representation that integrates features from all historical time slices at the last encoding unit. Since the leftmost encoding column has no features available from earlier time slices, it uses... <zero>The all-zero vector serves as the hidden state of its preceding column, meaning that historical passenger flow is memorized starting from an "empty state" without prior information.

[0060] The application includes a decoder with multiple collaboratively gated recurrent units to process the high-dimensional features and obtain passenger flow prediction data for multiple future time slots. Specifically, for any collaboratively gated recurrent unit in the decoder, the data is updated based on the hidden state of the collaboratively gated recurrent unit in the previous time slot, combined with the metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and the passenger flow data for the next time slot is output.

[0061] The n columns on the right constitute the decoder, used to predict passenger flow data for the next n time slices starting from time t+1. Each column cell also takes the hidden state processed by the previous column cell as input. The first column is... <zero>The all-zero vector serves as a placeholder vector for the input passenger flow, indicating the starting point of decoding. It explicitly prompts the model to rely solely on the encoded historical information and its own cyclic state for prediction starting from this column, outputting passenger flow data X(t+1). Subsequent columns (columns k-th and n-th) then predict the passenger flow X(t+k) for the next time slice by inputting the hidden state of the previous time slice and its predicted passenger flow result X(t+k-1), and pass the hidden state to the next column. This process continues until the n-th column outputs X(t+n), completing the prediction of all future passenger flow data.

[0062] Each column of the time series model contains two layers of collaboratively gated recurrent units stacked internally to capture deeper feature information. During training, the model uses long-term historical passenger flow data as the training set, inputting it sequentially, and combines it with a normalized subway network map, passenger flow similarity map, and passenger boarding / alighting correlation map to perform end-to-end learning of all collaboratively gated recurrent unit parameters. In the application phase, only recent historical passenger flow data needs to be input to obtain future passenger flow data.

[0063] The collaborative gated recurrent unit organically combines a Relational Graph Convolutional Network (RGCN), a Multi-Head Attention module, and a gated recurrent unit. The RGCN and Multi-Head Attention module are mainly responsible for extracting features from passenger flow data by combining the graph structure, while the gated recurrent unit is mainly responsible for fusing the features extracted from the current time slice and the previous time slice.

[0064] like Figure 5 As shown, each rounded rectangle represents a piece of input data or a processing module. B is the batch size, which is the size of a batch. Given sufficient computer performance, multiple similar prediction tasks can be processed simultaneously in batches. N is the number of subway stations. The entire module's data flow largely maintains a station dimension, facilitating station-level prediction by the model. C is the number of feature dimensions, i.e., how many passenger flow data points are input and predicted for each station in each time slice. Regular data includes two dimensions: the number of people entering and exiting the station, so C = 2. H is the adjustable number of intermediate dimensions, representing how many dimensions are used in all intermediate processing to learn the features of each station. This can be used to control the balance between model computation and accuracy.

[0065] In this embodiment, a relational graph convolutional neural network can be applied to extract historical spatiotemporal graph features of each station based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the hidden state of the collaborative gating recurrent unit of the previous time slice. The spatiotemporal graph features of the current time slice are obtained based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the passenger flow data of the current time slice or the hidden state of the previous layer collaborative gating recurrent unit of the current time slice. A first gating recurrent unit is applied to fuse the historical spatiotemporal graph features and the spatiotemporal graph features of the current time slice to obtain the spatiotemporal graph fusion features. A multi-head self-attention module is applied to the collaborative gating recurrent unit of the previous time slice. The hidden state of the gated loop unit is subjected to self-attention analysis to obtain historical passenger flow characteristics. Self-attention analysis is then performed on the passenger flow data of the current time slice or the hidden state of the collaborative gated loop unit of the previous time slice to obtain passenger flow characteristics of the current time slice. The historical passenger flow characteristics and the passenger flow characteristics of the current time slice are fused using the second gated loop unit to obtain passenger flow fusion characteristics. The spatiotemporal graph fusion characteristics and the passenger flow fusion characteristics are then finely fused using the branch feature convergence module, and the hidden state of the collaborative gated loop unit of the current time slice and the passenger flow data of the next time slice are output. When the collaborative gated loop unit of the current time slice belongs to the decoder part, the predicted passenger flow data of the current time slice is output.

[0066] Regarding the input and output of the collaborative gated loop unit, it simultaneously receives the hidden state from the previous time slice and the passenger flow information or hidden state from the current time slice. It then updates this information by combining the weighted normalized metro network map, passenger flow similarity map, and passenger boarding / alighting correlation map. After a series of processing steps, the output module Zoneout outputs the data to the unit in the next time slice. Specifically, if the collaborative gated loop unit is the first unit in a column, it receives passenger flow data from one time slice, and the output hidden state is activated by a ReLU function and sent to the next unit in the same column. If the collaborative gated loop unit is the second unit in a column, it receives the hidden state activated by the previous collaborative gated loop unit. If this unit is also in the decoder part of the entire model, the output is mapped to a B×N×C dimension via a linear layer to obtain the predicted passenger flow data for the next time slice.

[0067] Within the collaborative gated recurrent unit, data first enters two branches: a relational graph convolutional neural network branch and a multi-head self-attention branch. The relational graph convolutional neural network branch receives three graphs and passenger flow data to perform multi-relational graph convolution, encoding the local spatiotemporal relationships of each station and its neighborhood under various topological priors into node-level hidden states. The multi-head self-attention branch, on the other hand, performs self-attention modeling and convergence of all station features across the entire network, capturing long-range correlations and global operational dynamics beyond the explicit graph structure. Each branch has left and right sub-branches. The left sub-branch takes the hidden state from the previous time slice as input for further feature extraction from historical information; the right sub-branch takes the passenger flow state from the current time slice as input for extracting features from current passenger flow information. The gated recurrent unit fuses the two sub-branches, adaptively balancing the relationship between historical memory and new features. Finally, the features from both branches are fused together through a series of steps and output.

[0068] In this embodiment, the relational graph convolutional neural network maps the three preprocessed graphs into three types of relationships, and uses the relational graph convolutional neural network to extract passenger flow information features based on multiple relationships simultaneously. Assume the input passenger flow data at time slice t is... Therefore, in this patent, for each site's data... The formula for processing relational graphs using convolutional neural networks is:

[0069]

[0070] in, Represents the Hadamard product of matrices. There are four sets of learnable parameter matrices. Let i be the set of neighboring stations connected to station i in the three graphs. Let be the weight of the edge between station i and station j in the three graphs. This is a self-loop term used to preserve the unique features of station i. For each station in the metro network, the entire graph convolutional neural network first preserves its own features, then obtains the features of neighboring nodes based on a weighted normalized metro network map, passenger flow similarity map, and passenger boarding / alighting correlation map. These four features are then linearly transformed using a learnable parameter matrix and summed to obtain the new features for that station.

[0071] The multi-head self-attention module in this application uses a multi-head self-attention mechanism to extract passenger flow features, and limits the computational complexity of the attention mechanism by restricting the size of the dimension H. Then, average pooling is used to aggregate global features, a linear layer deepens the model and adjusts its dimensions, and finally, layer normalization is performed to obtain the output. This approach can utilize the self-attention mechanism to extract globally complex relationship features missed in the graph structure without causing excessive computation. Average pooling takes B×N×H data as input, and for each sample in the batch, it extracts the features of its N nodes. A single feature vector is obtained by averaging each element. Output the data in B×H format. The formula for layer normalization is as follows:

[0072]

[0073] in It is a feature vector of a station in a batch. and These are the mean and variance of each value in X. and These are learnable parameters. Layer normalization can stabilize the feature distribution and prevent numerical explosion.

[0074] Within the multi-head self-attention module, the input data It will be divided into i parts The data of dimension i is fed into i heads for self-attention mechanism computation. The data in each head is processed through three linear layers with invariant dimensions to obtain the Q (query), K (key), and V (value) matrices used to calculate self-attention. After computation, the matrices are concatenated back to the original data. The dimension is then processed and output using a linear layer. The specific formula is as follows:

[0075]

[0076]

[0077]

[0078] in, Let be the learnable parameter matrix in the linear layer. Used to adjust the weights of each head. In Attention, Q and K are first multiplied by a dot product, then divided by... We obtain a correlation matrix that represents the correlation of passenger flow characteristics for each station. Then, we perform a dot product between this matrix and V, which is equivalent to weighting the passenger flow characteristics of all stations according to their correlation weights. Finally, we activate the system using the softmax function to complete the calculation.

[0079] Since the number of time slices is usually not very large in practical applications, this embodiment uses gated recurrent units instead of long short-term memory networks for feature updates in the time dimension, which can reduce the computational load of the model and reduce deployment costs. Let the feature vector of a station in the feature data of the current time slice t (i.e., the output of the right branch) be... The historical feature vector of the corresponding station in the feature data obtained from the previous time slice (i.e., the output of the left branch) is: In the collaborative gating loop unit, the data input to the gating loop unit has already been processed into B×N×3H or B×3H channels, and is directly divided into three B×N×H or B×H channels, which are used as reset gates respectively. (Reset gate), Update gate (Update gate), hidden state (Hidden state) and The calculation is performed using the following formula:

[0080]

[0081]

[0082]

[0083]

[0084] in, , To reset the weight of the door, , To update the weights of the gates, , The weights of the candidate hidden states, , , These represent the biases for the reset gate, update gate, and candidate hidden state, respectively, and are all trainable parameter matrices and bias values. The reset gate, update gate, and hidden state are responsible for filtering historical information, controlling the memory update ratio, and comprehensively representing the new information at the current moment, respectively. Through the synergistic effect of these three gating mechanisms, the embodiments of this application can adaptively model the passenger flow evolution process at multiple time scales, achieving a unified characterization of long-term trends and short-term fluctuations.

[0085] After completing feature extraction and updating of the gated recurrent units within the graph convolutional neural network branches and the multi-head self-attention branches, this embodiment of the application uses a branch feature aggregation module to finely fuse the two types of features at each site. Specifically, the outputs of the two branches are concatenated, reduced back to B×N×H dimensions using a linear layer, activated by the Tanh function, and finally multiplied element-wise with the output of the gated recurrent unit of the graph convolutional neural network branch. After layer normalization, the output is then processed.

[0086] Before convergence, in order to integrate the spatiotemporal relationship features of the graph with the global operational status features equally, the output of the multi-head self-attention branch is repeatedly expanded (Repeat) N times from the B×H dimension and mapped to the same B×N×H dimension as the branch of the relation graph convolutional neural network before convergence and splicing.

[0087] The product operation, with relatively low computational cost, allows the entire branch feature convergence operation to achieve an effect similar to channel attention. By using concatenation, linear layers, and activated information as weights to modulate the information strength of the branch outputs of the relation graph convolutional neural network, the model's ability to express local-global relationships in complex operational scenarios is enhanced.

[0088] To further suppress overfitting and enhance the robustness of hidden state evolution in the time dimension, this application introduces a Zoneout mechanism in the collaboratively gated recurrent unit, which is a layer discarding mechanism in the time dimension. Specifically, for the hidden state to be output to the next time-slice collaboratively gated recurrent unit, 5% of the features are randomly selected and retained as values ​​from the previous time-slice collaboratively gated recurrent unit. This random retention mechanism can preserve diverse memory paths for different time slices, allowing some channels to focus more on long-term trends and others to focus more on short-term changes, thereby enriching the model's ability to express passenger flow evolution patterns across multiple time scales.

[0089] The following uses subway card swiping data from 80 stations across three subway lines in a city from the 1st to the 25th of a month for training, validation, and testing. The 1st-18th is the training set, the 19th-20th the validation set, and the 21st-25th the test set. The subway station passenger flow prediction method using the multi-relational self-attention spatiotemporal graph neural network of this application is compared with other existing technologies. Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) are used as evaluation indicators; lower values ​​are better. The formulas for calculating the indicators are as follows:

[0090]

[0091]

[0092] in For time slot i, the actual passenger flow includes the number of people entering and exiting the station. Let i be the predicted passenger flow for time slice i. The MAE indicator can well reflect the deviation between the predicted passenger flow and the actual passenger flow, while the RMSE indicator can further reflect the degree of fluctuation in the prediction error.

[0093] Table 1 Comparison of Passenger Flow Forecasting Results

[0094]

[0095] As can be seen from Table 1, the root mean square error (RMSE) and mean absolute error (MAE) of the subway passenger flow prediction method using the multi-relation self-attention spatiotemporal graph neural network (MFRNN) of this application embodiment are significantly better than other methods. Under the RMSE evaluation metric, the subway passenger flow prediction method using the MFRNN of this application embodiment has smaller errors across all time slice lengths than existing methods. Under the MAE metric, it still outperforms the best existing technology, PVCGN, for most time slice lengths. This indicates that the time series model maintains high prediction accuracy while having a smaller error fluctuation range, and is less prone to large prediction errors within a single time slice.

[0096] This invention provides a subway station passenger flow prediction method based on a multi-relation self-attention spatiotemporal graph neural network. The method acquires subway network data and historical passenger flow data, including passenger entry and exit data for all stations in the subway network across multiple time slices, including the current time slice. Based on the subway network data and the historical passenger flow data, a normalized subway network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map are obtained. A time series model based on a collaborative gated cyclic unit is applied to process the historical passenger flow data in conjunction with the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map to obtain passenger flow prediction data. This method improves the accuracy of passenger flow prediction while reducing fluctuations in prediction errors.

[0097] Figure 6 The diagram shown is a structural schematic of a subway station passenger flow prediction device based on a multi-relationship self-attention spatiotemporal graph neural network, according to an embodiment of this application. Figure 6 As shown, the subway station passenger flow prediction device 600 based on the multi-relational self-attention spatiotemporal graph neural network includes:

[0098] The data acquisition unit 601 is used to acquire subway network data and historical passenger flow data. The historical passenger flow data includes passenger entry and exit data of all stations in the subway network in multiple time slices, including the current time slice.

[0099] Data analysis unit 602 is used to obtain a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the metro network data and the historical passenger flow data.

[0100] The passenger flow prediction unit 603 is used to process the historical passenger flow data by applying a time series model constructed based on the collaborative gated recurrent unit, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining the graph structure. The gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

[0101] In one embodiment, the data analysis unit 602 is configured to: obtain the adjacency matrix of the metro network based on the metro network data, and generate a normalized metro network map based on the adjacency matrix; calculate the passenger flow similarity weights for any two stations in the metro network based on the metro network data and the historical passenger flow data, and obtain a passenger flow similarity map; and calculate the passenger boarding / alighting correlation weights for any two matching stations in the metro network based on the metro network data and the historical passenger flow data, and obtain a passenger boarding / alighting correlation map.

[0102] In one embodiment, the data analysis unit 602 is further configured to: apply a dynamic time warping algorithm to calculate the passenger flow curve similarity between any two stations in the metro network based on the metro network data and the historical passenger flow data; calculate the passenger flow similarity between any two stations based on the passenger flow curve similarity; normalize the passenger flow similarity according to the metro network to obtain the passenger flow similarity weights between any two stations; and filter the passenger flow similarity weights between any two stations in the metro network based on a similarity threshold to obtain a passenger flow similarity map.

[0103] In one embodiment, the data analysis unit 602 is further configured to: calculate the ratio of the total number of passengers entering from any first station and exiting from any second station in the metro network to the total number of passengers entering from the first station, based on the metro network data and the historical passenger flow data, to obtain the passenger boarding and alighting correlation between the first station and the second station; normalize the passenger boarding and alighting correlation between any two stations matching the entry and exit points in the metro network based on the metro network, to obtain the passenger boarding and alighting correlation weights of any two stations matching the entry and exit points; and combine the passenger boarding and alighting correlation weights of any two stations matching the entry and exit points in the metro network based on a correlation threshold to obtain a passenger boarding and alighting correlation map.

[0104] In one embodiment, the passenger flow prediction unit 603 is used to: apply an encoder including multiple collaborative gating loop units to process the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in combination with the historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data; and apply a decoder including multiple collaborative gating loop units to process the high-dimensional features to obtain passenger flow prediction data for multiple future time slices.

[0105] In one embodiment, the passenger flow prediction unit 603 is further configured to: for any collaborative gating loop unit in the encoder, update the passenger flow data of the current time slice in conjunction with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and output the hidden state of the collaborative gating loop unit in the next time slice; for any collaborative gating loop unit in the decoder, update the passenger flow data of the next time slice in conjunction with the hidden state of the collaborative gating loop unit of the previous time slice in conjunction with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map.

[0106] In one embodiment, the passenger flow prediction unit 603 is further configured to: apply a relational graph convolutional neural network to extract historical spatiotemporal graph features of each station based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the hidden state of the collaborative gating recurrent unit of the previous time slice; obtain spatiotemporal graph features of the current time slice based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the passenger flow data of the current time slice or the hidden state of the previous layer collaborative gating recurrent unit of the current time slice; apply a first gating recurrent unit to fuse the historical spatiotemporal graph features and the spatiotemporal graph features of the current time slice to obtain spatiotemporal graph fusion features; and apply a multi-head self-attention module to the previous time slice... The hidden state of the collaborative gated loop unit is analyzed by self-attention to obtain historical passenger flow characteristics. Self-attention analysis is then performed on the passenger flow data of the current time slice or the hidden state of the previous layer of collaborative gated loop unit to obtain passenger flow characteristics of the current time slice. The historical passenger flow characteristics and the passenger flow characteristics of the current time slice are fused by the second gated loop unit to obtain passenger flow fusion characteristics. The spatiotemporal graph fusion characteristics and the passenger flow fusion characteristics are finely fused by the branch feature convergence module, and the hidden state of the collaborative gated loop unit of the current time slice and the passenger flow data of the next time slice are output. When the collaborative gated loop unit of the current time slice belongs to the decoder part, the predicted passenger flow data of the current time slice is output.

[0107] This invention provides a subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network, comprising: a data acquisition unit for acquiring subway network data and historical passenger flow data, wherein the historical passenger flow data includes passenger entry and exit data of all stations in the subway network across multiple time slices, including the current time slice; a data analysis unit for acquiring a normalized subway network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the subway network data and the historical passenger flow data; and a passenger flow prediction unit for processing the historical passenger flow data using a time series model constructed based on a collaborative gated recurrent unit, combined with the normalized subway network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features from the passenger flow data using a graph structure, and the gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

[0108] According to another aspect of the present invention, one embodiment of the present invention provides an electronic device, Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0109] For example, such as Figure 7 As shown, the electronic device includes a memory 701 and a processor 702. The memory 701 stores executable program code 7011, and the processor 702 is used to call and execute the executable program code 7011 from the memory, so that the processor 702 executes a subway station passenger flow prediction method based on a multi-relational self-attention spatiotemporal graph neural network.

[0110] This embodiment can divide the electronic device into functional modules according to the above method embodiment. For example, each module can correspond to a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and is only a logical functional division. In actual implementation, there may be other division methods.

[0111] When each functional module is divided according to its corresponding function, the electronic device may include: a data acquisition unit, a data analysis unit, and a passenger flow prediction unit, etc.

[0112] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0113] The electronic device provided in this embodiment is used to execute the above-mentioned method for predicting subway passenger flow using a multi-relational self-attention spatiotemporal graph neural network, and thus can achieve the same effect as the above-mentioned implementation method.

[0114] When using integrated units, the electronic device may include a processing module and a storage module. The processing module is used to control and manage the operation of the electronic device. The storage module is used to support the execution of program code and data by the electronic device.

[0115] The processing module may be a processor or a controller, which can implement or execute various exemplary logic blocks, modules, and circuits as disclosed in this application. The processor may also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc., and the storage module may be a memory.

[0116] This embodiment also provides a computer-readable storage medium (including but not limited to disk storage, CD-ROM, optical storage, etc.) storing computer program code. When the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement the subway station passenger flow prediction method based on a multi-relation self-attention spatiotemporal graph neural network provided in the above embodiment. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, Digital Video Discs (DVDs), Compact Disc Read-Only Memory (CD-ROM), microdrives, and magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), dynamic random access memory (DRAM), video random access memory (VRAM), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and / or data.

[0117] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to realize the subway station passenger flow prediction method based on a multi-relational self-attention spatiotemporal graph neural network provided in the above embodiment.

[0118] The beneficial effects of the above embodiments can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0119] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.

[0120] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.

[0121] It should also be noted that in the apparatus or equipment of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.

[0122] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0123] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.< / zero> < / zero>

Claims

1. A metro passenger flow prediction method of a multi-relation self-attention spatio-temporal graph neural network, characterized in that, The method includes: Acquire subway network data and historical passenger flow data, wherein the historical passenger flow data includes passenger entry and exit data of all stations in the subway network for multiple time slices, including the current time slice; Based on the metro network data and the historical passenger flow data, a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map are obtained. The application uses a time series model built on a collaborative gated recurrent unit, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to process the historical passenger flow data and obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining the graph structure, and the gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice. The process of obtaining a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the metro network data and the historical passenger flow data includes: The adjacency matrix of the metro network is obtained based on the metro network data, and a normalized metro network map is generated based on the adjacency matrix. Based on the metro network data and historical passenger flow data, the similarity weights of passenger flow entering and exiting any two stations in the metro network are calculated to obtain a passenger flow similarity map. Specifically, a dynamic time warping algorithm is applied to calculate the similarity of passenger flow curves between any two stations in the metro network based on the metro network data and historical passenger flow data. This algorithm allows for time shifting and local stretching / compression of the passenger flow curves, and uses dynamic programming to find the matching path with the minimum Euclidean distance, extracting the similarity of passenger flow curves between different stations. The passenger flow similarity between any two stations is calculated based on the passenger flow curve similarity. The passenger flow similarity is then normalized according to the metro network data to obtain the passenger flow similarity weights between any two stations. Finally, the passenger flow similarity weights between any two stations in the metro network are filtered based on a similarity threshold to obtain the passenger flow similarity map. Based on the metro network data and the historical passenger flow data, the passenger boarding and alighting correlation weights of any two stations matching entry and exit points in the metro network are calculated to obtain a passenger boarding and alighting correlation map. Specifically, the ratio of the total number of passengers entering from any first station and exiting from any second station to the total number of passengers entering from the first station is calculated based on the metro network data and the historical passenger flow data to obtain the passenger boarding and alighting correlation of the first station and the second station. The passenger boarding and alighting correlation of any two stations matching entry and exit points in the metro network is normalized according to the metro network data to obtain the passenger boarding and alighting correlation weights of any two stations matching entry and exit points. The passenger boarding and alighting correlation weights of any two stations matching entry and exit points in the metro network are combined based on a correlation threshold to obtain the passenger boarding and alighting correlation map.

2. The method of claim 1, wherein, The application, based on a time-series model constructed using a collaborative gated loop unit, combines the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map to process the historical passenger flow data and obtain passenger flow prediction data, including: The application includes an encoder with multiple collaborative gating loop units that processes the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in conjunction with the historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data. The application includes a decoder with multiple collaborative gated loop units to process the high-dimensional features and obtain passenger flow prediction data for multiple future time slices.

3. The method of claim 1, wherein, The application includes encoders in multiple collaborative gated loop units processing the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map in conjunction with the historical passenger flow data to obtain a high-dimensional feature representation of the historical passenger flow data, including: For any collaborative gating loop unit in the encoder, the passenger flow data of the current time slice is updated in combination with the normalized metro network map, the passenger flow similarity map and the passenger boarding and alighting correlation map, and the hidden state of the collaborative gating loop unit in the next time slice is output. The application includes a decoder with multiple collaboratively gated recurrent units processing the high-dimensional features to obtain passenger flow prediction data for multiple future time slices, including: For any collaborative gated loop unit in the decoder, the passenger flow data for the next time slice is updated based on the hidden state of the collaborative gated loop unit in the previous time slice, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and then output.

4. The method of claim 3, wherein, The process involves updating the passenger flow data for the next time slice based on the hidden state of the collaborative gating loop unit from the previous time slice, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, and outputting the passenger flow data for the next time slice, including: The relational graph convolutional neural network extracts historical spatiotemporal graph features of each station based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, and the hidden state of the collaborative gating recurrent unit of the previous time slice. It also obtains the spatiotemporal graph features of the current time slice based on the normalized metro network map, the passenger flow similarity map, the passenger boarding / alighting correlation map, the passenger flow data of the current time slice, or the hidden state of the collaborative gating recurrent unit of the previous layer of the current time slice. The first gating recurrent unit is used to fuse the historical spatiotemporal graph features and the spatiotemporal graph features of the current time slice to obtain the spatiotemporal graph fusion features. A multi-head self-attention module is applied to perform self-attention analysis on the hidden state of the collaborative gating loop unit of the previous time slice to obtain historical passenger flow characteristics. Self-attention analysis is then performed on the passenger flow data of the current time slice or the hidden state of the previous layer collaborative gating loop unit of the current time slice to obtain passenger flow characteristics of the current time slice. The second gating loop unit is then applied to fuse the historical passenger flow characteristics and the passenger flow characteristics of the current time slice to obtain passenger flow fusion characteristics. The application branch feature convergence module performs fine fusion of the spatiotemporal graph fusion features and the passenger flow fusion features, and outputs the hidden state of the current time slice collaborative gating loop unit and the passenger flow data of the next time slice. When the current time slice collaborative gating loop unit belongs to the decoder part, it outputs the predicted passenger flow data of the current time slice.

5. A subway station passenger flow prediction device based on a multi-relation self-attention spatiotemporal graph neural network, characterized in that, The device includes: The data acquisition unit is used to acquire subway network data and historical passenger flow data. The historical passenger flow data includes passenger entry and exit data of all stations in the subway network for multiple time slices, including the current time slice. The data analysis unit is used to obtain a normalized metro network map, a passenger flow similarity map, and a passenger boarding / alighting correlation map based on the metro network data and the historical passenger flow data; to obtain the adjacency matrix of the metro network based on the metro network data, and to generate a normalized metro network map based on the adjacency matrix; to calculate the passenger flow similarity weights between any two stations in the metro network based on the metro network data and the historical passenger flow data, and to obtain a passenger flow similarity map. Specifically, a dynamic time warping algorithm is applied to calculate the passenger flow curve similarity between any two stations in the metro network based on the metro network data and the historical passenger flow data. The dynamic time warping algorithm allows for time translation and local stretching / compression of the passenger flow curves, and uses dynamic programming to find the matching path with the minimum Euclidean distance, extracting the similarity of passenger flow curves between different stations; to calculate the passenger flow similarity between any two stations based on the passenger flow curve similarity; and to normalize the passenger flow similarity based on the metro network. Obtain the passenger flow similarity weights for any two stations; filter the passenger flow similarity weights for any two stations in the metro network based on a similarity threshold to obtain a passenger flow similarity map; calculate the passenger boarding / alighting correlation weights for any two stations in the metro network that match entry / exit points based on the metro network data and the historical passenger flow data to obtain a passenger boarding / alighting correlation map; wherein, calculate the ratio of the total number of passengers entering from any first station and exiting from any second station in the metro network to the total number of passengers entering from the first station based on the metro network data and the historical passenger flow data to obtain the passenger boarding / alighting correlation for entering from the first station and exiting from the second station; normalize the passenger boarding / alighting correlation for any two stations in the metro network that match entry / exit points based on the metro network to obtain the passenger boarding / alighting correlation weights for any two stations that match entry / exit points; combine the passenger boarding / alighting correlation weights for any two stations in the metro network that match entry / exit points based on a correlation threshold to obtain a passenger boarding / alighting correlation map; The passenger flow prediction unit is used to process the historical passenger flow data by applying a time series model constructed based on the collaborative gated recurrent unit, combined with the normalized metro network map, the passenger flow similarity map, and the passenger boarding / alighting correlation map, to obtain passenger flow prediction data. The collaborative gated recurrent unit combines a relational graph convolutional neural network, a multi-head self-attention module, and a gated recurrent unit. The relational graph convolutional neural network and the multi-head self-attention module are used to extract features of passenger flow data by combining the graph structure. The gated recurrent unit is used to fuse the features extracted from the current time slice and the previous time slice.

6. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, such that the processor performs the method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 4.