Urban rail transit passenger flow prediction method, system, device and medium based on space-time evolution characteristics
By constructing an adaptive dynamic adjacency matrix and dynamic spatiotemporal graph fusion network model, and combining multi-source data fusion and dual-path attention mechanism, the problem of passenger flow prediction lag and bias in existing technologies is solved, realizing high-precision and stable prediction of urban rail transit passenger flow, and supporting real-time scheduling and resource optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI SOFTWARE INST
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-31
AI Technical Summary
Existing urban rail transit passenger flow forecasting methods cannot effectively characterize the spatial propagation characteristics of passenger flow dynamic changes with time and events in actual operation, resulting in forecast lag and bias, making it difficult to meet the requirements of high real-time and high-precision operation scheduling.
By constructing an adaptive dynamic adjacency matrix and dynamic spatiotemporal graph fusion network model, and combining multi-source data fusion and dual-path attention mechanism, the instantaneous passenger flow interaction patterns and potential correlation strengths between stations are extracted. Joint spatiotemporal modeling is performed to capture the temporal evolution and spatial propagation patterns of passenger flow. The model parameters are optimized through multi-step prediction and residual correction.
It enables dynamic modeling of the spatial dependence of passenger flow, improves the stability and accuracy of prediction results, and supports real-time and precise scheduling and capacity resource optimization of rail transit.
Smart Images

Figure CN122491587A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, specifically to a method, system, device, and medium for predicting urban rail transit passenger flow based on spatiotemporal evolution characteristics. Background Technology
[0002] As the backbone of modern urban public transportation, accurate passenger flow forecasting is a core prerequisite for efficient, safe, and intelligent operation of urban rail transit. Accurate passenger flow forecasting provides crucial data support for train scheduling, capacity allocation, emergency management, and passenger information services. With the development of big data and artificial intelligence technologies, passenger flow forecasting based on historical gate data and employing time-series models and graph neural networks has become a mainstream technological direction. Existing methods typically treat the rail transit network as a static graph structure, with stations as nodes and physical line connections as edges. Based on this, they combine historical passenger flow time-series characteristics to model the network, aiming to capture the patterns of passenger flow changes over time and its spatial dependence within a fixed network structure.
[0003] However, these existing technologies have a significant drawback: their spatial dependencies are modeled based on a pre-set, fixed network topology adjacency matrix, which fails to reflect the dynamic spatial propagation characteristics of passenger flow over time and events in actual operation. Specifically, the mutual influence of passenger flow between stations is not static. For example, commuter flows during morning and evening rush hours, large-scale events causing concentrated passenger flows, or congestion propagation due to sudden events all cause the strength and direction of the association between stations to evolve in real time. Static adjacency matrices cannot characterize this dynamic and nonlinear spatial interaction process, resulting in lag and bias in the model's prediction of the spatiotemporal diffusion of passenger flow (such as the spread of congestion from transfer stations to surrounding stations), making it difficult to meet the requirements of high real-time performance and high accuracy in operation scheduling and risk prevention. Summary of the Invention
[0004] Based on this, the purpose of this invention is to provide a method, system, device and medium for predicting urban rail transit passenger flow based on spatiotemporal evolution characteristics that can effectively model the spatiotemporal dynamic evolution characteristics of passenger flow, especially the real-time adaptive change of spatial dependence with passenger flow status.
[0005] The objective of this invention is achieved through the following solution:
[0006] In a first aspect, the present invention provides a method for predicting urban rail transit passenger flow based on spatiotemporal evolution characteristics, comprising the following steps:
[0007] S1: Perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic ticketing system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor;
[0008] S2: Perform dynamic spatial correlation learning on the unified spatiotemporal feature tensor, extract the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and perform adaptive weighted fusion in combination with the predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix.
[0009] S3: Joint spatiotemporal modeling is performed based on unified spatiotemporal feature tensor and adaptive dynamic adjacency matrix. The temporal evolution law of passenger flow is captured by temporal convolution and the spatial propagation law is captured by graph convolution. A dynamic spatiotemporal graph fusion network model is constructed and the station-level hidden state representation of fused spatiotemporal evolution features is output.
[0010] S4: Perform multi-step forward prediction processing on the site-level hidden state representation, call the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and perform residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data and short-term historical passenger flow data to generate the final site passenger flow prediction results for future time periods.
[0011] S5: Calculate the prediction error loss between the final station passenger flow prediction results and the actual observed passenger flow data. Based on the prediction error loss, iteratively optimize the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. Use a multi-objective adaptive optimization algorithm to balance the prediction error loss and the model complexity loss, and update the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix.
[0012] Secondly, the present invention provides an urban rail transit passenger flow prediction system based on spatiotemporal evolution characteristics, which is configured with the following modules:
[0013] The multi-source data fusion module is used to perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic ticketing system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor.
[0014] The dynamic adjacency matrix generation module is used to learn the dynamic spatial correlation of a unified spatiotemporal feature tensor. It extracts the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and performs adaptive weighted fusion with a predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix.
[0015] The spatiotemporal graph network modeling module is used for joint spatiotemporal modeling based on a unified spatiotemporal feature tensor and an adaptive dynamic adjacency matrix. It captures the temporal evolution of passenger flow through temporal convolution and captures spatial propagation through graph convolution. It constructs a dynamic spatiotemporal graph fusion network model and outputs a station-level hidden state representation that integrates spatiotemporal evolution features.
[0016] The multi-step passenger flow prediction module is used to perform multi-step forward prediction processing on the hidden state representation at the station level. It calls the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and performs residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data of the same period and short-term historical passenger flow data to generate the final station passenger flow prediction results for future time periods.
[0017] The model parameter optimization module is used to calculate the prediction error loss between the final station passenger flow prediction results and the actual observed passenger flow data. Based on the prediction error loss, it iteratively optimizes the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. A multi-objective adaptive optimization algorithm is used to balance the prediction error loss and the model complexity loss, and to update the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix.
[0018] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement any of the above-mentioned urban rail transit passenger flow prediction methods based on spatiotemporal evolution characteristics.
[0019] Fourthly, this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements any of the above-mentioned urban rail transit passenger flow prediction methods based on spatiotemporal evolution characteristics.
[0020] In summary, the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided in this application constructs an adaptive dynamic adjacency matrix and a dynamic spatiotemporal graph fusion network model, which enables dynamic modeling of passenger flow spatial dependencies. This effectively overcomes the prediction lag and bias caused by the inability of traditional static graph models to depict real-time passenger flow propagation. Through multi-source data fusion and a dual-path attention mechanism, this method can accurately extract the instantaneous interaction intensity between stations as passenger flow evolves, thereby capturing dynamic spatial relationships such as peak commuter flows or those triggered by sudden events. In both temporal and spatial dimensions, joint modeling using temporal convolution and graph convolution can simultaneously analyze the temporal patterns of passenger flow evolution and its dynamic diffusion process within the network. The multi-step prediction architecture, combined with residual correction from historical contemporaneous and short-term historical data, can significantly suppress error accumulation in long-term predictions, improving the stability and accuracy of prediction results. Finally, a multi-objective optimization strategy balances prediction error and model complexity, enabling automated and efficient learning of model parameters and ensuring the model possesses good generalization ability and robustness. This method provides reliable technical support for real-time and precise scheduling of rail transit, congestion risk early warning, and optimization of transport capacity resources.
[0021] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0022] Figure 1 A flowchart illustrating a method for predicting urban rail transit passenger flow based on spatiotemporal evolution characteristics, provided in an embodiment of this application;
[0023] Figure 2 This is a schematic diagram of the structure of an urban rail transit passenger flow prediction system based on spatiotemporal evolution characteristics, provided as another embodiment of this application. Detailed Implementation
[0024] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0026] In one embodiment, such as Figure 1 As shown, a method for predicting urban rail transit passenger flow based on spatiotemporal evolution characteristics is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and furthermore, to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0027] S1: Perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic ticketing system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor.
[0028] Specifically, the raw passenger flow data includes inbound passenger flow data, outbound passenger flow data, and transfer passenger flow data at each rail transit station. All types of passenger flow data carry a collection timestamp and unique station identifier information. Static connectivity data includes the spatial location information of each station in the rail transit network, the physical connections between stations, line affiliation information, and multi-line association information for transfer nodes. Environmental impact data includes external impact data related to passenger flow changes, such as meteorological data, holiday attribute data, urban traffic control data, and data on large-scale events. All types of environmental impact data carry time dimension information and spatial coverage information. The system performs spatiotemporal alignment processing. First, a unified time granularity is set as the time alignment benchmark, and the time dimensions of the raw passenger flow data, static connectivity data, and environmental impact data are uniformly mapped to the time axis of this time granularity, ensuring consistency in the time dimension among the three types of data. Then, using rail transit stations as the spatial alignment benchmark, the system accurately matches the spatial coverage information of the environmental impact data to the corresponding rail transit stations or station clusters, achieving spatial correspondence between the environmental impact data and the passenger flow data and static connectivity data of the corresponding stations.
[0029] After spatiotemporal alignment, the system performs feature preprocessing on the three types of data. The system encodes categorical features in each data type, converting them into numerical features. The system then normalizes and standardizes the numerical features in each data type, eliminating dimensional differences between features. Following feature preprocessing, the system performs feature fusion, concatenating the encoded and preprocessed features along time and station dimensions to achieve deep feature fusion. Through these processes, the system generates a unified spatiotemporal feature tensor. This tensor includes temporal features, spatial features, core passenger flow features, and environmental impact features. Its dimensions include time, station, and feature dimensions, comprehensively representing the multi-source feature information of rail transit passenger flow in the spatiotemporal dimensions.
[0030] S2: Perform dynamic spatial correlation learning on the unified spatiotemporal feature tensor, extract the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and perform adaptive weighted fusion with the predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix.
[0031] Specifically, the system performs dynamic spatial correlation learning on the generated unified spatiotemporal feature tensor. The system inputs the unified spatiotemporal feature tensor into a dual-path linear transformation structure, which contains two independent linear transformation paths. The first linear transformation path performs linear projection on the unified spatiotemporal feature tensor, generating a query feature matrix representing the passenger flow characteristics of each rail transit station. The second linear transformation path performs another linear projection on the unified spatiotemporal feature tensor, simultaneously generating a key feature matrix and a value feature matrix representing the passenger flow characteristics of each rail transit station. The system performs matrix operations on the query feature matrix and the key feature matrix, generating a passenger flow interaction attention weight matrix between rail transit stations based on the operation results. This attention weight matrix can characterize the instantaneous passenger flow interaction pattern and potential correlation strength between any two stations in the rail transit network, quantifying the degree of mutual influence between different stations in the current spatiotemporal state. The system retrieves a predefined static topological adjacency matrix, which is constructed based on the physical connection relationships of the rail transit network and can characterize the inherent physical connection attributes between stations.
[0032] Preferably, the system introduces learnable adaptive weighting coefficients to perform adaptive weighted fusion processing on the passenger flow interaction attention weight matrix and the static topological adjacency matrix. During the fusion process, the adaptive weighting coefficients dynamically adjust the weight ratio of the two types of matrices according to the current spatiotemporal state of passenger flow. For station pairs with close physical connections and high passenger flow interaction intensity, the weight ratio of the static topological adjacency matrix is increased; for station pairs without direct physical connections but with significant passenger flow interaction, the weight ratio of the passenger flow interaction attention weight matrix is increased. Through the adaptive weighted fusion operation, the system generates an adaptive dynamic adjacency matrix. This adaptive dynamic adjacency matrix is a real-valued matrix, and its element values can characterize the actual passenger flow association strength of the corresponding station pair in the current spatiotemporal state, reflecting the dynamic changes in the spatial association state of passenger flow between stations in real time.
[0033] S3: Joint spatiotemporal modeling is performed based on a unified spatiotemporal feature tensor and an adaptive dynamic adjacency matrix. The temporal evolution of passenger flow is captured by temporal convolution and the spatial propagation is captured by graph convolution. A dynamic spatiotemporal graph fusion network model is constructed and a station-level hidden state representation with fused spatiotemporal evolution features is output.
[0034] Specifically, the system uses a unified spatiotemporal feature tensor as the model input feature and an adaptive dynamic adjacency matrix as the graph structure constraint to perform joint spatiotemporal modeling. The system constructs a dynamic spatiotemporal graph fusion network, which includes a temporal convolutional structure and a graph convolutional structure, cascaded and fused together. The system first inputs the unified spatiotemporal feature tensor into the temporal convolutional structure, which is composed of stacked one-dimensional causal convolutional layers. The causal convolutional layers ensure the forward propagation characteristics of the temporal dimension, preventing premature leakage of future information. The system performs convolution operations on the temporal dimension features of the unified spatiotemporal feature tensor using causal convolutional kernels with different dilation rates, capturing the temporal evolution patterns of passenger flow data at different time scales, including passenger flow fluctuations at the short-term time scale, passenger flow trends at the medium-term time scale, and passenger flow cycles at the long-term time scale.
[0035] Furthermore, the system outputs a spatiotemporal feature tensor after encoding the temporal dimension features. The system then inputs this temporal-dimensional feature tensor and an adaptive dynamic adjacency matrix into a graph convolutional structure, which is based on the message passing mechanism of a graph neural network. Using the adaptive dynamic adjacency matrix as the adjacency constraint for message passing, the system uses graph convolution operations to transfer and aggregate the feature information of each station to its neighboring stations with actual passenger flow associations, capturing the spatial propagation patterns of passenger flow in the rail transit network. This includes the diffusion patterns of passenger flow from core stations to surrounding stations, the transmission patterns from transfer stations to stations on different lines, and the passenger flow interaction patterns between stations on different lines. The temporal convolutional structure and the graph convolutional structure are deeply fused through feature residual connections and layer normalization operations, alleviating the gradient vanishing problem during deep network training and improving the network's feature learning and representation capabilities. Through this joint spatiotemporal modeling process, the system completes the deep extraction and encoding of passenger flow spatiotemporal evolution features, ultimately outputting a station-level hidden state representation that integrates spatiotemporal evolution features. Each rail transit station corresponds to an independent station-level hidden state representation, which can fully characterize the passenger flow evolution characteristics of the corresponding station in the spatiotemporal dimension.
[0036] S4: Perform multi-step forward prediction processing on the station-level hidden state representation, call the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and perform residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data of the same period and short-term historical passenger flow data to generate the final station passenger flow prediction results for future time periods.
[0037] Specifically, the system constructs a cascaded encoder-decoder structure, where the encoder portion is connected to the output of a dynamic spatiotemporal graph fusion network. The system uses station-level hidden state representations as input data to the encoder. The encoder performs feature dimensionality reduction and feature mapping on the high-dimensional station-level hidden state representations through fully connected layers, generating low-dimensional encoded feature vectors. This improves the network's inference efficiency while preserving core features of passenger flow spatiotemporal evolution. The decoder portion of this structure employs a recursive prediction approach, using the low-dimensional encoded feature vectors output by the encoder as initial input. Based on the passenger flow prediction results of the previous time step, it recursively generates passenger flow prediction features for multiple future time steps. The system maps these passenger flow prediction features to the actual passenger flow numerical space through fully connected layers and activation functions, generating preliminary passenger flow prediction values for multiple future time steps. Each future time step corresponds to a set of preliminary passenger flow prediction values, which include the passenger flow prediction values for each station in the rail transit network at the corresponding time step.
[0038] To improve the accuracy of passenger flow forecasting, the system introduces a residual correction mechanism. The system simultaneously retrieves historical passenger flow data from the same period in the past and short-term historical passenger flow data. Historical passenger flow data from the same period in the past is observed within the same time frame as the forecast period, characterizing the cyclical changes in passenger flow. Short-term historical passenger flow data is observed from the most recent few time steps before the forecast period, characterizing the short-term fluctuations in passenger flow. The system calculates the periodic deviation of the historical passenger flow data relative to the initial passenger flow forecast, and simultaneously calculates the trend deviation of the short-term historical passenger flow data relative to the initial passenger flow forecast. The system performs a weighted fusion of the periodic and trend deviation values to generate a comprehensive deviation correction value. The system superimposes the comprehensive deviation correction value onto the corresponding initial passenger flow forecast value, performing progressive residual correction on the initial passenger flow forecast value for each future time step to eliminate prediction errors caused by network fitting bias or data noise during the initial forecast process. Through the above processing, the system generates the final station passenger flow forecast result for the future period. This result includes passenger flow forecast values for each station in the rail transit network for multiple future time steps, enabling multi-step station-level passenger flow forecasting.
[0039] S5: Calculate the prediction error loss between the final station passenger flow prediction results and the actual observed passenger flow data. Based on the prediction error loss, iteratively optimize the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. Use a multi-objective adaptive optimization algorithm to balance the prediction error loss and the model complexity loss, and update the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix.
[0040] Specifically, the system retrieves real-time passenger flow data for the corresponding future prediction period. This data consists of actual passenger flow monitoring data for each station in the urban rail transit network during the prediction period. The system performs station-by-station and time-step numerical matching between the final station passenger flow prediction results and the real-time passenger flow data. Based on a preset loss function, it calculates the prediction error loss between the two. This prediction error loss quantifies the overall deviation between the final station passenger flow prediction results and the real-time passenger flow data, intuitively reflecting the passenger flow prediction accuracy of the dynamic spatiotemporal graph fusion network model. The system uses the prediction error loss as the core optimization objective and initiates an iterative optimization process for the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. Through gradient calculation methods, the system solves for the gradient values of the prediction error loss with respect to all learnable parameters in the dynamic spatiotemporal graph fusion network model and the learnable parameters in the static topological adjacency matrix. Based on the gradient values, it determines the update direction and magnitude of each parameter, providing a basis for the iterative update of the parameters.
[0041] Preferably, the system introduces a multi-objective adaptive optimization algorithm, incorporating model complexity loss into the optimization system. This model complexity loss, along with the prediction error loss, constitutes a multi-objective optimization function. The model complexity loss is quantified based on the number of parameters and network structure levels of the dynamic spatiotemporal graph fusion network model, effectively preventing overfitting during training. The system uses the multi-objective adaptive optimization algorithm to weight and balance the prediction error loss and model complexity loss, setting adaptively adjustable weight coefficients for each type of loss. These weight coefficients dynamically change as the optimization process progresses. When the model exhibits an overfitting trend, the algorithm automatically increases the weight of the model complexity loss; conversely, when the model's prediction accuracy falls short of expectations, the algorithm automatically increases the weight of the prediction error loss, achieving a dynamic balance between the two types of losses.
[0042] Furthermore, based on the calculation results of the multi-objective adaptive optimization algorithm, the system comprehensively updates the learnable parameters in the dynamic spatiotemporal graph fusion network model, including the convolution kernel parameters and bias parameters of the temporal and graph convolutional layers, the weighting coefficients in the feature fusion process, and the encoding and decoding parameters in the cascaded encoder-decoder structure. Simultaneously, the system updates the learnable coefficients in the static topological adjacency matrix that participate in adaptive weighted fusion. The system continuously executes the above parameter update and loss calculation process until the prediction error loss converges to a preset range, or the number of iterations reaches a preset threshold. At this point, the iterative optimization operation stops, completing the overall optimization of the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix. This ensures that the model achieves high-precision prediction of urban rail transit passenger flow while maintaining reasonable model complexity.
[0043] In summary, the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided in this application constructs an adaptive dynamic adjacency matrix and a dynamic spatiotemporal graph fusion network model, which enables dynamic modeling of passenger flow spatial dependencies. This effectively overcomes the prediction lag and bias caused by the inability of traditional static graph models to depict real-time passenger flow propagation. Through multi-source data fusion and a dual-path attention mechanism, this method can accurately extract the instantaneous interaction intensity between stations as passenger flow evolves, thereby capturing dynamic spatial relationships such as peak commuter flows or those triggered by sudden events. In both temporal and spatial dimensions, joint modeling using temporal convolution and graph convolution can simultaneously analyze the temporal patterns of passenger flow evolution and its dynamic diffusion process within the network. The multi-step prediction architecture, combined with residual correction from historical contemporaneous and short-term historical data, can significantly suppress error accumulation in long-term predictions, improving the stability and accuracy of prediction results. Finally, a multi-objective optimization strategy balances prediction error and model complexity, enabling automated and efficient learning of model parameters and ensuring the model possesses good generalization ability and robustness. This method provides reliable technical support for real-time and precise scheduling of rail transit, congestion risk early warning, and optimization of transport capacity resources.
[0044] In one embodiment, S1 of the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided by the present invention specifically includes the following steps:
[0045] S11: Clean and aggregate the raw passenger flow data obtained from the automatic fare collection system, remove abnormal transaction records, and count the number of passengers entering and leaving the station at each station in the network at preset time intervals to generate a station-level passenger flow matrix.
[0046] Specifically, the system acquires raw passenger flow data transmitted from the automatic fare collection system. This raw passenger flow data covers transaction records from all turnstiles at each rail transit station, including passenger entry and exit transactions, as well as related transactions generated during transfers. Each transaction record carries a unique transaction identifier, station identifier, turnstile identifier, transaction time, and transaction type information. The system cleans the acquired raw passenger flow data by comprehensively reviewing it to identify abnormal transaction records. Abnormal transaction records include duplicate transactions (multiple records with the same transaction identifier, station identifier, turnstile identifier, and transaction time); invalid timestamp transactions (transaction times exceeding the rail transit operating hours or with incorrect timestamp formats); transactions without station identifiers (transaction records lacking valid station identifiers, making it impossible to determine the station to which the transaction belongs); and transactions exceeding the reasonable passenger flow range (records where the passenger flow statistics logic corresponding to a single transaction does not conform to the normal operating scenario). The system removes all identified abnormal transaction records to ensure the validity and accuracy of the remaining passenger flow data and prevent abnormal data from interfering with subsequent processing results. After the cleaning process is completed, the system performs aggregation processing on the cleaned passenger flow data. The system sets a preset time interval, which is used to unify the statistical dimensions of the passenger flow data and realize the temporal regularization of the passenger flow data.
[0047] Furthermore, the system categorizes and statistically analyzes passenger flow transaction records for all stations across the network at preset time intervals. Taking a station as the unit, it counts all entry transactions for the same station within the same preset time interval to obtain the entry volume for that station within that time interval; similarly, it counts all exit transactions for the same station within the same preset time interval to obtain the exit volume for that station within that time interval. The system systematically organizes the entry and exit volumes for all stations within each preset time interval, arranging them according to station and time interval order to construct a station-level passenger flow matrix. The rows of this matrix correspond to the individual stations in the rail transit network, the columns correspond to the preset time intervals, and the elements in the matrix correspond to the entry or exit volume of the corresponding station within the corresponding time interval, clearly presenting the passenger flow distribution for all stations across the network across different time intervals.
[0048] S12: Perform topology modeling on the static connection relationship data obtained from the network topology data, construct a graph structure representing the connectivity between stations based on the actual physical connection between the lines and stations, and generate a static topology adjacency matrix.
[0049] Specifically, the system acquires static connectivity data from the network topology data. This data encompasses the route information of all lines in the rail transit network, the spatial distribution information of all stations, the affiliation information between stations and lines, the physical connectivity information between stations, and the multi-line association information of transfer stations. It also includes supplementary information such as the line layout, the number of platforms at stations, and the physical distance between adjacent stations. The system performs topology modeling on the acquired static connectivity data. First, it organizes and integrates the data, clarifying the station sequence included in each line, determining the line to which each station belongs, clarifying the actual physical connections between each line and each station, identifying the adjacent stations for each station, determining the connection methods between adjacent stations, distinguishing between direct adjacent connections and indirect connections, clarifying the connection relationships between transfer stations and adjacent stations on different lines, and clarifying the impact of the internal passageway connection logic of transfer stations on the connectivity between stations. Based on the clarified actual physical connections between lines and stations, the system constructs a graph structure representing the connectivity between stations.
[0050] In this graph structure, each rail transit station is an independent node, and the actual physical connections between stations are represented by edges. The presence or absence of an edge corresponds to the existence of a direct physical connection between stations, and the association of edges corresponds to the connectivity logic between stations. Based on the constructed graph structure, the system generates a static topological adjacency matrix. The static topological adjacency matrix is used to characterize the inherent connectivity attributes between stations. The rows and columns of the matrix correspond to each station in the rail transit network, and the elements in the matrix are used to identify whether there is a direct physical connection between two corresponding stations. Through this matrix, the physical connectivity relationship between any two stations can be directly obtained, and the distribution of adjacent nodes of each station can be clearly defined.
[0051] S13: Perform spatiotemporal correlation and normalization processing on environmental impact data obtained from external data sources, match weather, temperature and special event information to corresponding stations and time slices, and generate an external feature matrix.
[0052] Specifically, the system acquires environmental impact data from external data sources, including meteorological monitoring data sources, urban event information sources, traffic control data sources, and public service information sources. The environmental impact data covers external information related to passenger flow changes, such as weather information, temperature information, and special event information. Weather information includes weather condition types and precipitation-related information; temperature information includes real-time temperature and temperature change data; and special event information includes information on large-scale events, holiday arrangements, urban traffic control, and public health prevention and control. Each piece of environmental impact data carries both temporal and spatial coverage information.
[0053] The system performs spatiotemporal correlation processing on the acquired environmental impact data. First, it extracts the time range and spatial coverage information from each piece of environmental impact data, clarifying the effective time interval and applicable spatial area corresponding to each piece of data. The system then matches the time range of the environmental impact data with preset time slices, mapping each piece of data to a specific time slice to ensure alignment between the environmental impact data and the time dimension. This ensures that each time slice contains valid environmental impact data for that specific time period. Simultaneously, the system matches the spatial coverage information of the environmental impact data with the spatial location information of the rail transit stations. Based on the station's spatial location, it accurately matches the corresponding environmental impact data to the environmental impact data corresponding to the spatial area covering that station. This achieves spatial correlation between environmental impact data and each rail transit station, ensuring that each station corresponds to the relevant environmental impact data within each time slice, guaranteeing a precise correspondence between environmental impact data, stations, and time.
[0054] After spatiotemporal correlation processing, the system performs normalization on the correlated environmental impact data. This standardization process eliminates dimensional differences between different types of environmental impact data, ensuring that all types of environmental impact data fall within the same numerical range. This avoids feature weight imbalances during subsequent feature fusion due to differing data dimensions. The system then organizes the spatiotemporally correlated and normalized environmental impact data, arranging it by station and time slice order to generate an external feature matrix. The rows of the external feature matrix correspond to each station in the rail transit network, and the columns correspond to each time slice. The elements in the matrix correspond to the environmental impact feature information of the respective station within its corresponding time slice.
[0055] S14: The station-level passenger flow matrix, external feature matrix, and station attribute features extracted from the static topological adjacency matrix are fused and spliced together, and combined along the feature dimension to integrate passenger flow, environmental and spatial topological information, generating a unified spatiotemporal feature tensor.
[0056] Specifically, the system extracts station attribute features from the static topological adjacency matrix. During the extraction process, the system mines the inherent attribute features of each station based on the connectivity relationships between stations represented by the static topological adjacency matrix. The system determines the number of neighboring stations for each station by analyzing the number of edges corresponding to each node in the static topological adjacency matrix; it determines the number of lines each station belongs to by associating with the line affiliation information in the static connectivity data; it determines whether each station is a transfer station by judging whether it has connectivity relationships with multiple lines; and it extracts other inherent attributes of each station by combining supplementary information in the static connectivity data.
[0057] Furthermore, the system converts the extracted station attribute information into numerical features to ensure the computability of the features. Each station corresponds to an independent set of station attribute feature vectors, and the elements in the feature vectors correspond to the numerical expression of various station attributes. The system performs fusion and splicing processing on the station-level passenger flow matrix, external feature matrix, and extracted station attribute features. First, the three data structures are dimensionally calibrated to ensure that the number of stations and time slices corresponding to the station-level passenger flow matrix, external feature matrix, and station attribute feature vectors are consistent, so that the three are accurately aligned in the station dimension and time dimension, ensuring that the passenger flow features, environmental features, and station attribute features of each station in each time slice can correspond one-to-one.
[0058] The system combines three data structures along the feature dimension, deeply integrating passenger flow features from the station-level passenger flow matrix, environmental impact features from the external feature matrix, and extracted station attribute features. This achieves the organic fusion of passenger flow information, environmental impact information, and spatial topology information, eliminating redundancy and conflicts between multi-source data while retaining core feature information from each type of data. Through the above fusion and splicing process, the system generates a unified spatiotemporal feature tensor. This unified spatiotemporal feature tensor integrates multi-source feature information, covering core passenger flow features, environmental impact features, and spatial topology features. Its dimensions include station dimension, time dimension, and feature dimension, enabling it to fully represent the multi-source feature information of rail transit passenger flow in the spatiotemporal dimension.
[0059] In one embodiment, S2 of the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided by the present invention specifically includes the following steps:
[0060] S21: Perform dual-path feature mapping processing on the unified spatiotemporal feature tensor. Extract the differential feature representations of each station as the starting point and ending point of passenger flow through two parallel and parameter-independent linear transformation layers, and generate the source node feature matrix and the destination node feature matrix.
[0061] Specifically, the system sets up two parallel linear transformation layers with independent parameters, eliminating parameter sharing. These layers are used to extract the differentiated feature representations of each station as the starting and ending points of passenger flow. The system simultaneously inputs a unified spatiotemporal feature tensor into the two parallel linear transformation layers. The first layer performs a linear projection on the tensor, mapping it from the original feature dimension to a preset target feature dimension, focusing on extracting feature information when each station is the starting point of passenger flow, and generating a source node feature matrix. The second layer uses parameters independent of the first layer to perform another linear projection on the tensor, similarly mapping it to the same target feature dimension, focusing on extracting feature information when each station is the ending point of passenger flow, and generating a destination node feature matrix. Preferably, the linear transformation process follows the formula:
[0062]
[0063]
[0064] in, Represents the unified spatiotemporal feature tensor. This represents the weight matrix of the first linear transformation layer. This represents the bias term of the first linear transformation layer. This represents the generated source node feature matrix. This represents the weight matrix of the second linear transformation layer. This represents the bias term of the second linear transformation layer. The source node feature matrix and the destination node feature matrix have the same dimensions, both including the station dimension, time dimension, and target feature dimension, and capture the passenger flow characteristics of the station from different perspectives.
[0065] S22: Perform pairwise site correlation calculation on the source node feature matrix and the destination node feature matrix, use the scaled dot product attention mechanism to evaluate the potential passenger flow interaction intensity between any two sites at the current time, and convert the correlation into a probability distribution through the normalized exponential function to generate a dynamic attention weight matrix.
[0066] Specifically, the system employs a scaled dot product attention mechanism to perform pairwise site correlation calculations on the source node feature matrix and the destination node feature matrix, evaluating the potential passenger flow interaction strength between any two sites at the current moment. During the calculation, the system uses the source node feature matrix as the query feature matrix and the destination node feature matrix as both the key and value feature matrices. First, matrix multiplication is performed between the query and key feature matrices to obtain an initial correlation score matrix between any two sites. The system then scales this initial correlation score matrix to mitigate the problem of excessively large correlation scores and gradient vanishing caused by high feature dimensions, resulting in a scaled correlation score matrix. Subsequently, the system uses a normalized exponential function to normalize the scaled correlation score matrix, transforming the correlation score of each site with all other sites into a probability distribution, ensuring that the sum of the correlation probabilities of any site with all other sites is 1, generating a dynamic attention weight matrix. The correlation calculation follows the formula:
[0067]
[0068] in, This represents the dynamic attention weight matrix. Represents the feature matrix of the source nodes. This represents the transpose of the feature matrix of the target node. Representing feature dimension, This represents the normalized exponential function. The rows and columns of the dynamic attention weight matrix correspond to each station in the rail transit network. The elements in the matrix represent the potential passenger flow interaction intensity between two corresponding stations at the current moment, which can reflect the dynamic changes in passenger flow relationships between stations in real time.
[0069] S23: Perform global average pooling on the current unified spatiotemporal feature tensor and map it to scalar fusion coefficients. Based on the scalar fusion coefficients, perform linear weighted summation on the predefined static topological adjacency matrix and dynamic attention weight matrix, dynamically aggregate the two relationships of static physical connection and instantaneous passenger flow association, and generate an adaptive dynamic adjacency matrix.
[0070] Specifically, the system performs global average pooling on the current unified spatiotemporal feature tensor. This global average pooling operation compresses the feature dimensions of the unified spatiotemporal feature tensor, eliminating redundant information and mapping the high-dimensional unified spatiotemporal feature tensor to a scalar fusion coefficient. The scalar fusion coefficient characterizes the relative importance of static physical connectivity and instantaneous passenger flow relationships under the current spatiotemporal state. Its numerical change is related to current passenger flow characteristics, environmental characteristics, and spatial topology characteristics, dynamically adjusting with changes in the spatiotemporal state. Preferably, based on the generated scalar fusion coefficient, the system performs linear weighted summation on a predefined static topological adjacency matrix and a dynamic attention weight matrix, dynamically aggregating the two relationships: static physical connectivity and instantaneous passenger flow relationships. During the weighted summation process, the scalar fusion coefficient is used to allocate the weight ratios of the static topological adjacency matrix and the dynamic attention weight matrix, achieving adaptive fusion of the two relationships and generating an adaptive dynamic adjacency matrix. The linear weighted summation follows the formula:
[0071]
[0072] in, This represents the generated adaptive dynamic adjacency matrix. Represents the scalar fusion coefficient. This represents a predefined static topological adjacency matrix. This represents the dynamic attention weight matrix. The adaptive dynamic adjacency matrix retains the inherent physical connection attributes between stations represented by the static topological adjacency matrix, while incorporating the instantaneous passenger flow interaction intensity represented by the dynamic attention weight matrix, thus reflecting the dynamic evolution of spatial relationships between stations in real time.
[0073] In one embodiment, S3 of the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided by the present invention specifically includes the following steps:
[0074] S31: Perform temporal convolution processing on the unified spatiotemporal feature tensor, and use dilated causal convolutional networks to perform convolution operations on the historical feature sequences of each station to extract the evolution trend and periodicity of passenger flow features at different time scales, and generate a high-level temporal feature representation containing the temporal evolution pattern.
[0075] Specifically, the system employs a dilated causal convolutional network to perform convolution operations on the historical feature sequences of each station. This network consists of stacked dilated causal convolutional layers, each with a different dilation rate to capture the evolution patterns of passenger flow characteristics at different time scales. During the convolution operation, the dilated causal convolutional layers expand the receptive field through a set dilation rate, covering longer historical time series without increasing the number of parameters. This extracts the evolution trends and periodic patterns of passenger flow characteristics at short-term, medium-term, and long-term time scales, eliminating redundant information in the time series and retaining core temporal features. Preferably, the temporal convolution processing follows the formula:
[0076]
[0077] in, This represents the generated high-level temporal feature representation. The weight matrix represents the dilated causal convolution. This represents the dilated causal convolution operator. Represents the unified spatiotemporal feature tensor. This represents the bias term of dilated causal convolution. Represents the time series feature enhancement coefficient. This represents the activation function. This represents the average pooling operation. This formula enables deep extraction and enhancement of temporal features, generating a high-level temporal feature representation that includes station dimensions, time dimensions, and temporal feature dimensions, fully preserving the evolution trend and periodic patterns of passenger flow at different time scales.
[0078] S32: Perform spatial graph convolution processing on the advanced temporal feature representation and the adaptive dynamic adjacency matrix. Based on the dynamic site connection relationship defined by the adaptive dynamic adjacency matrix, perform multi-round neighborhood feature aggregation and propagation to simulate the real-time spatial diffusion process of passenger flow in the network and generate spatial context feature representation containing spatial propagation rules.
[0079] Specifically, the system performs spatial graph convolution processing on the high-level temporal feature representation and the adaptive dynamic adjacency matrix. Based on the dynamic station connection relationships defined by the adaptive dynamic adjacency matrix, it conducts multiple rounds of neighborhood feature aggregation and propagation operations. In each round of aggregation, the system, constrained by the adaptive dynamic adjacency matrix, transmits the high-level temporal features of each station to its neighboring stations with actual passenger flow associations, while simultaneously aggregating the feature information fed back by neighboring stations and updating the feature representation of that station. After multiple rounds of aggregation, the system simulates the real-time spatial diffusion process of passenger flow in the rail transit network, captures the spatial propagation patterns of passenger flow interaction between stations, eliminates redundant information in spatial features, and retains core spatial propagation features. The spatial graph convolution processing follows the following formula:
[0080]
[0081] in, This represents the generated spatial context feature representation. Represents an adaptive dynamic adjacency matrix. Represents high-level temporal features. The weight matrix represents the spatial graph convolution. This represents the bias term in spatial graph convolution. This represents the spatial propagation enhancement coefficient. The generated spatial context feature representation includes station dimension, time dimension, and spatial feature dimension, fully preserving the real-time spatial propagation pattern of passenger flow in the network.
[0082] S33: Perform graph fusion processing on the high-level temporal feature representation and spatial context feature representation. Automatically calculate the fusion weight of temporal and spatial features through learnable gating units, and perform weighted summation on the high-level temporal feature representation and spatial context feature representation based on the fusion weight to generate a site-level hidden state representation that fuses spatiotemporal evolution features.
[0083] Specifically, the system performs graph fusion processing on the high-level temporal feature representation and the spatial context feature representation. A learnable gating unit is set up. This gating unit calculates the feature correlation between the high-level temporal feature representation and the spatial context feature representation, automatically generating temporal feature fusion weights and spatial feature fusion weights. These two weights are mutually constrained, and their sum is 1, representing the relative importance of temporal and spatial features under different spatiotemporal states. After the gating unit calculation is completed, the system performs a weighted summation process on the high-level temporal feature representation and the spatial context feature representation based on the generated fusion weights. This achieves deep fusion of temporal and spatial features, eliminates redundancy and conflicts between the two types of features, retains the core feature information of passenger flow spatiotemporal evolution, and generates a station-level hidden state representation of the fused spatiotemporal evolution features. Preferably, the graph fusion processing follows the formula:
[0084]
[0085]
[0086] in, This represents the generated site-level hidden state representation. This represents the fusion weights generated by the gating unit. Represents high-level temporal features. Representation of spatial context features, This represents the weight matrix of the gated unit. This represents the concatenation operation between high-level temporal feature representations and spatial context feature representations. This indicates the bias term of the gating unit. The activation function is represented by the generated station-level hidden state, which is a high-dimensional feature vector of each station in each time slice. This fully integrates the spatiotemporal evolution features of passenger flow, providing core feature inputs for subsequent multi-step forward prediction.
[0087] In one embodiment, S4 of the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided by the present invention specifically includes the following steps:
[0088] S41: Perform initial decoding mapping on the site-level hidden state representation, call the first-level decoder in the cascade encoder-decoder structure to map the site-level hidden state representation to the passenger flow prediction values of all sites in the first future time step, and generate the first preliminary passenger flow prediction values.
[0089] Specifically, the system calls the first-level decoder in the cascaded encoder-decoder structure. This decoder consists of a fully connected layer and an activation function, used to map the high-dimensional station-level hidden state representation to concrete passenger flow prediction values. During the initial decoding mapping process, the first-level decoder first performs feature dimensionality reduction on the station-level hidden state representation, mapping the high-dimensional feature vectors to the dimensions corresponding to the passenger flow values. Then, the activation function converts the mapping result into non-negative passenger flow prediction values, ultimately obtaining the passenger flow prediction values for all stations in the first future time step, generating the first preliminary passenger flow prediction value. The formula for calculating the first preliminary passenger flow prediction value is:
[0090]
[0091] in, This represents the initial passenger flow forecast value generated in the first step. This represents the weight matrix of the first-level decoder. This indicates the site-level hidden state. This represents the bias term of the first-level decoder. Indicates the initial decoding enhancement coefficients. This represents the activation function. This indicates a feature normalization operation. The initial passenger flow forecast generated corresponds to all stations across the entire network.
[0092] S42: Perform recursive multi-step decoding on the initial passenger flow prediction value of the first step. Concatenate the passenger flow prediction value output by the previous decoder with the encoded temporal features as the input features of the next level decoder and repeat this decoding and feature concatenation process to recursively generate a sequence of initial passenger flow prediction values for multiple consecutive time steps in the future.
[0093] Specifically, the system retrieves the initial passenger flow forecast value from the first step, and simultaneously retrieves the encoded temporal features. These encoded temporal features are obtained by feature compression processing of the high-level temporal feature representation and are used to supplement the temporal correlation information in the recursive decoding process. The system performs dimensional calibration on the initial passenger flow forecast value and the encoded temporal features to ensure that their station and time dimensions are consistent, achieving accurate feature concatenation. Then, it executes recursive multi-step decoding. The system concatenates the initial passenger flow forecast value and the encoded temporal features, integrating the prediction result from the previous step with the temporal correlation information to form the input features for the next-level decoder. The next-level decoder adopts a structure consistent with the first-level decoder but with independent parameters, decoding and mapping the input features to generate the initial passenger flow forecast value for the second future time step. The system repeats the above process. At each step, the passenger flow prediction value output by the previous level decoder is concatenated with the encoded time-series features and used as the input features for the current level decoder. The decoder completes the decoding mapping and recursively generates preliminary passenger flow prediction values for multiple consecutive future time steps, forming a preliminary passenger flow prediction value sequence. The calculation formula for the preliminary passenger flow prediction value sequence is as follows:
[0094]
[0095] in, This represents the preliminary passenger flow forecast at time step t. This represents the weight matrix of the t-th level decoder. Indicates the first Preliminary passenger flow forecasts for each time step. This represents the encoded temporal characteristics. This indicates a feature concatenation operation. This represents the bias term of the t-th level decoder. Let represent the recursive enhancement coefficient at step t.
[0096] S43: Perform residual correction processing based on historical data on each predicted value in the preliminary passenger flow forecast sequence, and superimpose an adjustment term obtained by linear regression of the nearby short-term historical real passenger flow data and an adjustment term calculated by the historical same period real passenger flow data to correct the prediction bias and generate the final station passenger flow forecast result for the future period.
[0097] Specifically, the system retrieves the generated preliminary passenger flow forecast sequence, and simultaneously retrieves recent short-term historical real passenger flow data and historical real passenger flow data from the same period. It performs dimensional calibration on these three types of data to ensure complete consistency in station dimensions and the number of time steps, achieving precise data alignment. Further, the system performs linear regression processing on the recent short-term historical real passenger flow data. Through linear regression, it uncovers the deviation patterns between the short-term historical passenger flow data and the preliminary passenger flow forecast, generating the first adjustment term. This adjustment term corrects prediction deviations caused by short-term passenger flow fluctuations. The system performs feature analysis and calculation on the historical real passenger flow data from the same period, uncovering the cyclical patterns and deviation characteristics of the historical passenger flow, generating the second adjustment term. This adjustment term corrects prediction deviations caused by cyclical factors. The system superimposes the two adjustment terms onto each forecast value in the preliminary passenger flow forecast sequence, performing deviation correction on the preliminary passenger flow forecast value at each time step. This eliminates prediction deviations caused by short-term fluctuations and cyclical factors, ultimately generating the final station passenger flow forecast result for future periods. Preferably, the residual correction processing follows the following formula:
[0098]
[0099] in, This represents the final passenger flow forecast value at time step t. This represents the preliminary passenger flow forecast at time step t. This represents the short-term adjustment coefficient. This represents the adjustment term obtained by linear regression of near-short-term historical real passenger flow data. This represents the adjustment factor for the same period. This indicates adjustments calculated from historical passenger flow data for the same period. The generated final station passenger flow forecast covers passenger flow values for all stations across the network over multiple consecutive time steps, providing accurate data support for urban rail transit operation and scheduling.
[0100] In one embodiment, S5 of the urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics provided by the present invention specifically includes the following steps:
[0101] S51: Perform point-by-point error calculation processing on the final station passenger flow prediction results and the actual observed passenger flow data, and calculate the sum of squared differences between the predicted values and observed values for all future prediction times and all stations to generate prediction error loss.
[0102] Specifically, the system retrieves the generated final station passenger flow forecast results and simultaneously retrieves the actual observed passenger flow data for the corresponding time periods. The actual observed passenger flow data comes from the cleaned and aggregated valid data of the automatic fare collection system, maintaining correspondence with the time and station dimensions of the final station passenger flow forecast results to quantify the deviation between the forecast results and actual passenger flow. The system performs dimensional verification on the final station passenger flow forecast results and the actual observed passenger flow data, confirming that the number of stations and the number of future forecast times are completely consistent, with no missing data or invalid values. Then, it performs point-by-point error calculation processing. This point-by-point error calculation processing is performed separately for all future forecast times and all stations. The system extracts the final passenger flow forecast value and the corresponding actual observed passenger flow value for each forecast time and each station, calculates the difference between the two values, and squares the calculated difference to amplify the impact of larger deviations while preventing positive and negative deviations from canceling each other out. The system accumulates and statistically analyzes the squared differences for all forecast times and all stations, integrating all point-by-point error information to generate a forecast error loss. Prediction error loss is used to quantify the overall deviation between the final station passenger flow prediction results and the actual observed passenger flow data, providing a core basis for subsequent model optimization. Point-by-point error calculation follows the formula:
[0103]
[0104] in, This represents the loss due to the generated prediction error. This represents the total number of predicted future moments. This represents the total number of stations in the rail transit network. Let represent the final passenger flow forecast value for the i-th station at the t-th prediction time. This represents the actual observed passenger flow value at station i at prediction time t. This represents the error penalty coefficient.
[0105] S52: Jointly evaluate the prediction error loss and the parameter complexity of the dynamic spatiotemporal graph fusion network model. Use the L2 norm of all weight parameters of the dynamic spatiotemporal graph fusion network model as the model complexity loss, and combine it with the prediction error loss in a weighted manner to form a multi-objective total loss function.
[0106] Specifically, the system retrieves the generated prediction error loss and all weight parameters of the dynamic spatiotemporal graph fusion network model, validating both types of data. After confirming the prediction error loss calculation is correct and the model weight parameters are complete, a joint evaluation is performed, integrating the prediction error loss and model parameter complexity to prevent the model from overfitting to improve prediction accuracy and thus reducing generalization ability. The system calculates the L2 norm of all weight parameters of the dynamic spatiotemporal graph fusion network model. The L2 norm calculation result serves as the model complexity loss, used to quantify the overall complexity of the model parameters; the more model parameters and the larger their values, the higher the model complexity loss. The system introduces a learnable weight allocation coefficient, which dynamically balances the relative importance of the prediction error loss and the model complexity loss, adaptively adjusting according to error changes during model training to avoid performance defects caused by single-objective optimization. The system weights and combines the prediction error loss and model complexity loss according to the weight allocation coefficient to construct a multi-objective total loss function. This function simultaneously considers prediction accuracy and model generalization ability, providing a unified optimization objective for subsequent model parameter optimization.
[0107] Preferably, the joint assessment and total loss construction follow the formula below:
[0108]
[0109] in, Represents the total loss function for multiple objectives. Indicates the weighting coefficient. This represents the loss due to prediction error. This represents the set of all weight parameters of the dynamic spatiotemporal graph fusion network model. The square operation represents the L2 norm. This represents the complexity regularization coefficient. This represents the trace operation of a matrix. The formula further constrains model complexity through a regularization term, ensuring the rationality and effectiveness of multi-objective optimization.
[0110] S53: Based on the multi-objective total loss function, the model parameters of the dynamic spatiotemporal graph fusion network model are optimized by backpropagation. The adaptive moment estimation algorithm is used to calculate the gradients of the learnable parameters and the learnable fusion coefficients in the static topological adjacency matrix of the dynamic spatiotemporal graph fusion network model, and the gradients of the learnable parameters and the learnable fusion coefficients are iteratively updated along the gradient descent direction.
[0111] Specifically, the system retrieves the constructed multi-objective total loss function, along with all learnable parameters in the dynamic spatiotemporal graph fusion network model and the learnable fusion coefficients in the static topological adjacency matrix. All parameters are initialized and verified; after confirming the correct parameter dimensions and reasonable initial values, backpropagation optimization is performed. The backpropagation optimization process focuses on minimizing the multi-objective total loss function. The system employs an adaptive moment estimation algorithm, which combines the advantages of momentum gradient descent and adaptive learning rate adjustment, enabling rapid convergence and effectively avoiding local optima. The system uses the adaptive moment estimation algorithm to differentiate the multi-objective total loss function, calculating the gradients of all learnable parameters in the dynamic spatiotemporal graph fusion network model and the gradients of the learnable fusion coefficients in the static topological adjacency matrix. The gradient values characterize the degree and direction of influence of parameter changes on the total loss function.
[0112] Furthermore, based on the calculated gradient values, the system iteratively updates and adjusts all learnable parameters and learnable fusion coefficients along the gradient descent direction. During each iteration, the adaptive moment estimation algorithm adaptively adjusts the learning rate of each parameter based on its gradient history, ensuring that parameters with larger gradients receive larger update step sizes and parameters with smaller gradients receive smaller update step sizes, thus improving optimization efficiency and accuracy. The system repeats the above backpropagation and parameter update process until the multi-objective total loss function converges to a preset threshold or reaches a preset number of iterations, completing the optimization of the model parameters and learnable fusion coefficients. Gradient calculation and parameter updates follow the formulas below:
[0113]
[0114] in, This represents the learnable parameters or learnable fusion coefficients after the (k+1)th iteration. This represents the learnable parameters or learnable fusion coefficients after the k-th iteration. Indicates the basic learning rate. This represents the estimate of the first moment of the gradient. This represents the estimate of the second moment of the gradient. This represents a small constant used to prevent the denominator from being zero. This represents the total multi-objective loss function with respect to parameters at the k-th iteration. gradient, Indicates the momentum coefficient. Indicates the first The learnable parameters or learnable fusion coefficients after each iteration are achieved through this innovative formula. This ensures that the optimized model can stably output high-precision passenger flow prediction results, while also guaranteeing the model's generalization ability and inference efficiency, thus meeting the actual needs of urban rail transit operation and scheduling.
[0115] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0116] Based on the same inventive concept, this application also provides a spatiotemporal evolution-based urban rail transit passenger flow prediction system for implementing the spatiotemporal evolution-based urban rail transit passenger flow prediction method described above. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more embodiments of the spatiotemporal evolution-based urban rail transit passenger flow prediction system provided below can be found in the limitations of the spatiotemporal evolution-based urban rail transit passenger flow prediction method described above, and will not be repeated here.
[0117] Preferably, such as Figure 2 As shown, this invention provides an urban rail transit passenger flow prediction system 600 based on spatiotemporal evolution characteristics. This system is configured with the following modules:
[0118] The multi-source data fusion module 610 is used to perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic fare collection system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor.
[0119] The dynamic adjacency matrix generation module 620 is used to learn the dynamic spatial correlation of the unified spatiotemporal feature tensor. It extracts the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and performs adaptive weighted fusion with the predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix.
[0120] The spatiotemporal graph network modeling module 630 is used for joint spatiotemporal modeling based on a unified spatiotemporal feature tensor and an adaptive dynamic adjacency matrix. It captures the temporal evolution of passenger flow through temporal convolution and captures the spatial propagation pattern through graph convolution. It constructs a dynamic spatiotemporal graph fusion network model and outputs a station-level hidden state representation that integrates spatiotemporal evolution features.
[0121] The passenger flow multi-step prediction module 640 is used to perform multi-step forward prediction processing on the station-level hidden state representation. It calls the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and performs residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data and short-term historical passenger flow data to generate the final station passenger flow prediction results for future time periods.
[0122] The model parameter optimization module 650 is used to calculate the prediction error loss between the final station passenger flow prediction results and the actual observed passenger flow data. Based on the prediction error loss, it iteratively optimizes the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. A multi-objective adaptive optimization algorithm is used to balance the prediction error loss and the model complexity loss, and to update the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix.
[0123] Preferably, the multi-source data fusion module 610 provided in this application is configured with the following units:
[0124] The passenger flow data cleaning and aggregation unit is used to clean and aggregate the raw passenger flow data obtained from the automatic ticketing system, remove abnormal transaction records, and count the number of passengers entering and leaving the entire network at preset time intervals to generate a station-level passenger flow matrix.
[0125] The static topology modeling unit is used to perform topology modeling on the static connection relationship data obtained from the network topology data. It constructs a graph structure representing the connectivity between stations based on the actual physical connection between the lines and stations, and generates a static topology adjacency matrix.
[0126] The environmental data normalization unit is used to perform spatiotemporal correlation and normalization processing on environmental impact data obtained from external data sources, matching weather, temperature and special event information to corresponding stations and time slices to generate an external feature matrix.
[0127] The multi-feature fusion and splicing unit is used to fuse and splice the station-level passenger flow matrix, external feature matrix, and station attribute features extracted from the static topological adjacency matrix. It combines along the feature dimension to integrate passenger flow, environmental and spatial topological information and generate a unified spatiotemporal feature tensor.
[0128] Preferably, the dynamic adjacency matrix generation module 620 provided in this application is configured with the following units:
[0129] The dual-path feature mapping unit is used to perform dual-path feature mapping processing on the unified spatiotemporal feature tensor. It extracts the differential feature representations of each station as the starting point and ending point of passenger flow through two parallel and parameter-independent linear transformation layers, and generates the source node feature matrix and the destination node feature matrix.
[0130] The site correlation calculation unit is used to perform pairwise site correlation calculation on the source node feature matrix and the destination node feature matrix. It uses a scaled dot product attention mechanism to evaluate the potential passenger flow interaction intensity between any two sites at the current time, and transforms the correlation into a probability distribution through a normalized exponential function to generate a dynamic attention weight matrix.
[0131] The dynamic adjacency matrix generation unit is used to perform global average pooling on the current unified spatiotemporal feature tensor and map it to scalar fusion coefficients. Based on the scalar fusion coefficients, it performs linear weighted summation on the predefined static topological adjacency matrix and dynamic attention weight matrix, dynamically aggregating the two relationships of static physical connection and instantaneous passenger flow association to generate an adaptive dynamic adjacency matrix.
[0132] Preferably, the spatiotemporal graph network modeling module 630 provided in this application is configured with the following units:
[0133] The temporal convolution feature extraction unit is used to perform temporal convolution processing on the unified spatiotemporal feature tensor. It uses a dilated causal convolutional network to perform convolution operations on the historical feature sequence of each station to extract the evolution trend and periodicity of passenger flow features at different time scales, and generate a high-level temporal feature representation containing the temporal evolution pattern.
[0134] The spatial graph convolution feature aggregation unit is used to perform spatial graph convolution processing on high-level temporal feature representations and adaptive dynamic adjacency matrices. Based on the dynamic site connection relationship defined by the adaptive dynamic adjacency matrix, it performs multiple rounds of neighborhood feature aggregation and propagation, simulates the real-time spatial diffusion process of passenger flow in the network, and generates spatial context feature representations containing spatial propagation rules.
[0135] The spatiotemporal feature gating fusion unit is used to perform graph fusion processing on high-level temporal feature representation and spatial context feature representation. Through learnable gating units, the fusion weights of temporal and spatial features are automatically calculated, and the high-level temporal feature representation and spatial context feature representation are weighted and summed according to the fusion weights to generate a site-level hidden state representation that fuses spatiotemporal evolution features.
[0136] Preferably, the multi-step passenger flow prediction module 640 provided in this application is configured with the following units:
[0137] The initial decoding prediction unit is used to perform initial decoding mapping processing on the site-level hidden state representation. It calls the first-level decoder in the cascade encoder-decoder structure to map the site-level hidden state representation to the passenger flow prediction values of all sites in the first future time step, generating the first preliminary passenger flow prediction value.
[0138] The recursive multi-step decoding unit is used to perform recursive multi-step decoding on the first step of the preliminary passenger flow prediction value. It concatenates the passenger flow prediction value output by the previous decoder with the encoded temporal features, uses it as the input features of the next level decoder, and repeats this decoding and feature concatenation process to recursively generate a sequence of preliminary passenger flow prediction values for multiple consecutive time steps in the future.
[0139] The residual correction prediction unit is used to perform residual correction processing on each prediction value in the preliminary passenger flow prediction value sequence based on historical data. It superimposes an adjustment term obtained by linear regression of the near short-term historical real passenger flow data and an adjustment term calculated by the historical real passenger flow data of the same period to generate the final station passenger flow prediction result for the future period.
[0140] Preferably, the model parameter optimization module 650 provided in this application is configured with the following units:
[0141] The prediction error loss calculation unit is used to perform point-by-point error calculation processing on the final station passenger flow prediction results and the actual observed passenger flow data, and to calculate the sum of squares of the differences between the predicted values and observed values for all future prediction times and all stations, thereby generating the prediction error loss.
[0142] The multi-objective total loss construction unit is used to jointly evaluate the prediction error loss and the parameter complexity of the dynamic spatiotemporal graph fusion network model. The L2 norm of all weight parameters of the dynamic spatiotemporal graph fusion network model is used as the model complexity loss, and it is weighted and combined with the prediction error loss to form the multi-objective total loss function.
[0143] The model parameter backpropagation optimization unit is used to perform backpropagation optimization on the model parameters of the dynamic spatiotemporal graph fusion network model based on the multi-objective total loss function. It uses the adaptive moment estimation algorithm to calculate the gradients of the learnable parameters and learnable fusion coefficients in the static topological adjacency matrix of the dynamic spatiotemporal graph fusion network model, and iteratively updates the learnable parameters and learnable fusion coefficients along the gradient descent direction.
[0144] In one embodiment, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics.
[0145] In one embodiment, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described urban rail transit passenger flow prediction method based on spatiotemporal evolution characteristics.
[0146] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0147] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0148] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for urban rail transit passenger flow prediction based on spatio-temporal evolution characteristics, characterized in that, Includes the following steps: S1: Perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic ticketing system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor; S2: Perform dynamic spatial correlation learning on the unified spatiotemporal feature tensor, extract the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and perform adaptive weighted fusion in combination with the predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix. S3: Based on the unified spatiotemporal feature tensor and the adaptive dynamic adjacency matrix, joint spatiotemporal modeling is performed. The temporal evolution law of passenger flow is captured by temporal convolution and the spatial propagation law is captured by graph convolution. A dynamic spatiotemporal graph fusion network model is constructed and the station-level hidden state representation of the fused spatiotemporal evolution features is output. S4: Perform multi-step forward prediction processing on the site-level hidden state representation, call the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and perform residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data and short-term historical passenger flow data to generate the final site passenger flow prediction results for future time periods. S5: Calculate the prediction error loss between the final station passenger flow prediction result and the actual observed passenger flow data. Based on the prediction error loss, iteratively optimize the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model. Use a multi-objective adaptive optimization algorithm to balance the prediction error loss and the model complexity loss, and update the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix.
2. The method of claim 1, wherein, S1 includes: S11: Clean and aggregate the raw passenger flow data obtained from the automatic fare collection system, remove abnormal transaction records, and count the number of passengers entering and leaving the station at each station in the network at preset time intervals to generate a station-level passenger flow matrix. S12: Perform topology modeling on the static connection relationship data obtained from the network topology data, construct a graph structure representing the connectivity between stations based on the actual physical connection between the lines and stations, and generate a static topology adjacency matrix; S13: Perform spatiotemporal correlation and normalization processing on environmental impact data obtained from external data sources, match weather, temperature and special event information to corresponding stations and time slices, and generate an external feature matrix. S14: The station-level passenger flow matrix, the external feature matrix, and the station attribute features extracted from the static topological adjacency matrix are fused and spliced together, and combined along the feature dimension to integrate passenger flow, environmental and spatial topological information, and generate a unified spatiotemporal feature tensor.
3. The method according to claim 1, characterized in that, S2 includes: S21: Perform dual-path feature mapping processing on the unified spatiotemporal feature tensor, and extract the differential feature expressions of each station as the starting point and ending point of passenger flow through two parallel and parameter-independent linear transformation layers to generate source node feature matrix and destination node feature matrix. S22: Perform pairwise site correlation calculation on the source node feature matrix and the destination node feature matrix, use the scaling dot product attention mechanism to evaluate the potential passenger flow interaction intensity between any two sites at the current time, and convert the correlation into a probability distribution through the normalized exponential function to generate a dynamic attention weight matrix. S23: Perform global average pooling on the current unified spatiotemporal feature tensor and map it to scalar fusion coefficients. Based on the scalar fusion coefficients, perform linear weighted summation on the predefined static topological adjacency matrix and the dynamic attention weight matrix to dynamically aggregate the two relationships of static physical connection and instantaneous passenger flow association, and generate an adaptive dynamic adjacency matrix.
4. The method according to claim 1, characterized in that, S3 includes: S31: Perform temporal convolution processing on the unified spatiotemporal feature tensor, and use a dilated causal convolutional network to perform convolution operation on the historical feature sequence of each station to extract the evolution trend and periodicity of passenger flow features at different time scales, and generate a high-level temporal feature representation containing the temporal evolution pattern. S32: Perform spatial graph convolution processing on the high-level temporal feature representation and the adaptive dynamic adjacency matrix, and perform multi-round neighborhood feature aggregation and propagation based on the dynamic site connection relationship defined by the adaptive dynamic adjacency matrix to simulate the real-time spatial diffusion process of passenger flow in the network and generate a spatial context feature representation containing spatial propagation rules. S33: Perform graph fusion processing on the high-level temporal feature representation and the spatial context feature representation, automatically calculate the fusion weight of temporal and spatial features through a learnable gating unit, and perform weighted summation on the high-level temporal feature representation and the spatial context feature representation according to the fusion weight to generate a site-level hidden state representation that fuses spatiotemporal evolution features.
5. The method according to claim 1, characterized in that, S4 includes: S41: Perform initial decoding mapping processing on the site-level hidden state representation, call the first-level decoder in the cascade encoder-decoder structure to map the site-level hidden state representation to the passenger flow prediction values of all sites in the first future time step, and generate the first preliminary passenger flow prediction value. S42: Perform recursive multi-step decoding processing on the preliminary passenger flow prediction value of the first step, and concatenate the passenger flow prediction value output by the previous decoder with the encoded time sequence feature as the input feature of the next level decoder. Repeat this decoding and feature concatenation process to recursively generate a sequence of preliminary passenger flow prediction values for multiple consecutive time steps in the future. S43: Perform residual correction processing based on historical data on each predicted value in the preliminary passenger flow prediction value sequence, and superimpose an adjustment term obtained by linear regression of the nearby short-term historical real passenger flow data and an adjustment term calculated by the historical real passenger flow data of the same period to generate the final station passenger flow prediction result for the future period.
6. The method according to any one of claims 1-5, characterized in that, S5 includes: S51: Perform point-by-point error calculation processing on the final station passenger flow prediction results and the actual observed passenger flow data, and calculate the sum of squares of the differences between the predicted values and observed values for all future prediction times and all stations to generate prediction error loss. S52: The prediction error loss and the parameter complexity of the dynamic spatiotemporal graph fusion network model are jointly evaluated. The L2 norm of all weight parameters of the dynamic spatiotemporal graph fusion network model is used as the model complexity loss, and it is weighted and combined with the prediction error loss to form a multi-objective total loss function. S53: Based on the multi-objective total loss function, backpropagation optimization is performed on the model parameters of the dynamic spatiotemporal graph fusion network model. The adaptive moment estimation algorithm is used to calculate the gradients of the learnable parameters in the dynamic spatiotemporal graph fusion network model and the learnable fusion coefficients in the static topological adjacency matrix. The gradients of the learnable parameters and the learnable fusion coefficients are iteratively updated along the gradient descent direction.
7. A city rail transit passenger flow prediction system based on spatiotemporal evolution characteristics, characterized in that, The system includes: The multi-source data fusion module is used to perform spatiotemporal alignment and feature fusion processing on the raw passenger flow data obtained from the automatic ticketing system, the static connection relationship data obtained from the network topology data, and the environmental impact data obtained, to generate a unified spatiotemporal feature tensor. The dynamic adjacency matrix generation module is used to perform dynamic spatial correlation learning on the unified spatiotemporal feature tensor. It extracts the instantaneous passenger flow interaction patterns and potential correlation strength between stations through dual-path linear transformation and attention mechanism, and performs adaptive weighted fusion with the predefined static topological adjacency matrix to generate an adaptive dynamic adjacency matrix. The spatiotemporal graph network modeling module is used to perform joint spatiotemporal modeling based on the unified spatiotemporal feature tensor and the adaptive dynamic adjacency matrix. It captures the temporal evolution of passenger flow through temporal convolution and captures the spatial propagation pattern through graph convolution. It constructs a dynamic spatiotemporal graph fusion network model and outputs a station-level hidden state representation that integrates spatiotemporal evolution features. The passenger flow multi-step prediction module is used to perform multi-step forward prediction processing on the station-level hidden state representation. It calls the cascade encoder-decoder structure to recursively generate preliminary passenger flow prediction values for multiple future time steps, and performs residual correction on the preliminary passenger flow prediction values for each step based on historical passenger flow data and short-term historical passenger flow data to generate the final station passenger flow prediction results for future time periods. The model parameter optimization module is used to calculate the prediction error loss between the final station passenger flow prediction results and the actual observed passenger flow data. Based on the prediction error loss, the static topological adjacency matrix and the dynamic spatiotemporal graph fusion network model are iteratively optimized. A multi-objective adaptive optimization algorithm is used to balance the prediction error loss and the model complexity loss, and the learnable parameters in the dynamic spatiotemporal graph fusion network model and the static topological adjacency matrix are updated.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.