Bus route passenger flow prediction method, system and terminal considering spatial-temporal characteristics
By preprocessing and feature extraction of bus card swiping data, combined with the GCN-XGBoost model, more accurate prediction of bus line passenger flow is achieved, solving the problem of inaccurate prediction data in the existing technology, and improving transportation efficiency and resource utilization rate.
Patent Information
- Application Number
- CN202411839164.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The prior art cannot provide more accurate and effective passenger flow forecast data on bus routes, resulting in waste of resources and inefficient transportation.
By obtaining bus card swiping data, preprocessing and analysis, passenger flow characteristics are extracted from the time and space dimensions, the passenger flow similarity relationship between lines and passenger flow circulation relationship between stations are quantified, and GCN-XGBoost's bus line passenger flow prediction combination model is constructed to train and predict.
It provides more accurate passenger flow forecast data on bus routes, helps to formulate more realistic operational scheduling plans, reduce resource waste, and improve transportation efficiency.
Smart Images

Figure CN119988828A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of public transportation big data processing, and in particular to a method, system, terminal and computer-readable storage medium for predicting passenger flow of public transportation routes taking into account temporal and spatial characteristics. Background Art
[0002] With the rapid advancement of urbanization, urban traffic problems are becoming increasingly prominent. Public transportation systems play an important role in urban transportation, providing urban residents with convenient and efficient travel options, reducing traffic congestion, improving environmental quality, and promoting sustainable urban development.
[0003] As an important part of the public transportation system, traditional public transportation plays an irreplaceable role in urban transportation due to its universality and accessibility. With the influence of various factors, the public's travel habits have changed, resulting in a sharp decline in the passenger flow of urban buses and trams. For example, some bus routes have low full load rates during certain periods and sections, and the passenger flow distribution is uneven. This imbalance leads to a waste of resources during off-peak hours and passenger congestion during peak hours, affecting the efficiency and service quality of the public transportation system.
[0004] With the continuous development of intelligent transportation systems, their construction has become an effective means to solve urban traffic problems and an important indicator for measuring the construction of "smart cities". As an important part of the intelligent transportation system, the bus intelligent dispatching system adheres to the policy orientation of promoting urban sustainable development, improving the level of public transportation services, reducing traffic congestion, and reducing carbon emissions. This system helps to optimize the passenger travel experience and promote the development of urban transportation in the direction of intelligence, efficiency, and environmental protection, becoming an important trend in the future development of public transportation. As one of the major components of the intelligent transportation system, the bus intelligent dispatching system can formulate efficient vehicle dispatching plans based on passenger flow demand in different time periods, thereby helping public transportation companies reduce operating costs. Accurate passenger flow prediction can effectively obtain the dynamic changes of passenger flow, provide key support for intelligent optimization algorithms, and ensure the effectiveness and practicality of dispatching plans; however, existing technologies cannot provide more accurate and effective route passenger flow prediction data.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] The main purpose of the present invention is to provide a bus route passenger flow prediction method, system, terminal and computer-readable storage medium that take into account temporal and spatial characteristics, aiming to solve the problem that the prior art cannot provide more accurate and effective route passenger flow prediction data, resulting in waste of resources and low transportation efficiency.
[0007] To achieve the above object, the present invention provides a bus route passenger flow prediction method considering spatiotemporal characteristics, the bus route passenger flow prediction method considering spatiotemporal characteristics comprising the following steps:
[0008] Obtaining bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data based on the preprocessed bus card swiping data and determining a time granularity;
[0009] Qualitatively analyzing the passenger flow data of the bus route from the time dimension and the space dimension respectively, and obtaining the passenger flow characteristics of the bus route in the time dimension and the passenger flow characteristics of the bus route in the space dimension respectively;
[0010] According to the bus line passenger flow characteristics in the time dimension and the bus line passenger flow characteristics in the space dimension, quantify the passenger flow similarity relationship between lines and the passenger flow circulation relationship between line stations, and screen out highly correlated spatiotemporal features;
[0011] Constructing a bus route passenger flow prediction combination model, and using the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model;
[0012] Obtain the bus route data to be predicted, input the bus route data to the trained bus route passenger flow prediction combined model, and output the bus route passenger flow prediction result.
[0013] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the bus card swiping data is obtained, the bus card swiping data is preprocessed, and the route passenger flow data is counted according to the preprocessed bus card swiping data and the time granularity is determined, specifically including:
[0014] Acquire all bus card swiping data of the historical period of the predicted target route, and pre-process all bus card swiping data of the historical period selected by the predicted target route, wherein the pre-processing includes deduplication and deletion of erroneous data;
[0015] The passenger flow data of the route is counted according to the time granularity used for short-term prediction objectives, and the optimal prediction time granularity is determined through autocorrelation measurement and stationarity measurement.
[0016] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the qualitative analysis of the route passenger flow data from the time dimension and the space dimension is performed to obtain the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, respectively, specifically includes:
[0017] Qualitatively analyze the passenger flow data of the route from the time dimension, determine the passenger flow time characteristics and the relationship between the bus route passenger flow, and obtain the bus route passenger flow characteristics in the time dimension;
[0018] The passenger flow data of the bus lines are qualitatively analyzed from the spatial dimension to determine the spatial characteristics of passenger flow and the relationship between passenger flow of bus lines, thereby obtaining the passenger flow characteristics of bus lines in the spatial dimension.
[0019] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations are quantified according to the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, and highly correlated spatiotemporal characteristics are screened out, specifically including:
[0020] Analyze the similarity of overall and local passenger flows of the route, construct overall and local passenger flow similarity graphs, and use graph convolutional neural networks for self-learning to obtain the similarity features of overall and local passenger flows respectively;
[0021] Calculate the round-trip ratio of passengers between stations, obtain the station with the largest circulation intensity, and construct the circulation characteristics between stations according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station;
[0022] Construct time features, which include: features of the previous 6 adjacent moments, features of the moment in the previous 4 weeks, and features of whether it is a working day.
[0023] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the calculation of the round-trip ratio of passengers between stations, obtaining the station with the largest circulation intensity corresponding to the station, and constructing the circulation characteristics between the station lines according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station, specifically includes:
[0024] Passengers swipe their ID cards at the starting station O to the alighting station D in the passenger flow OD data. i The number of times the passenger swipes the card from station O to station D is calculated, and the round-trip ratio of the passenger from station O to station D is calculated. i Add the round trip ratios of the two stations to get O and D i The fixed interaction strength between sites is calculated as:
[0025]
[0026] in, Indicates O and D i fixed interaction strength between sites; Indicates that the same passenger travels from O to D i Number of sites; Indicates that the same passenger from D i The number of times you go to station O; N means boarding the bus from station O i The number of passengers getting off at the station;
[0027] The station with the largest fixed interaction intensity corresponding to all stations on the line is taken as the maximum interaction station D of the station. m , the maximum interactive station passenger flow of the station multiplied by the average outflow ratio from the maximum interactive station to the station is taken as the station passenger flow interactive feature, and the line station circulation feature is the sum of the station passenger flow circulation features of all stations in the line. The line station circulation feature is calculated as:
[0028]
[0029] Among them, L i represents the line station flow characteristics of line i; represents the passenger flow of the maximum interactive station of the jth station in the i-th line at time t; It represents the average travel ratio from the maximum interactive station to the jth station in the i-th line.
[0030] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the bus route passenger flow prediction combined model is a GCN-XGBoost bus route passenger flow prediction combined model.
[0031] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the GCN-XGBoost bus route passenger flow prediction combined model includes: a GCN feature extraction layer, a feature fusion layer and an XGBoost layer;
[0032] The GCN feature extraction layer is used to capture the similarity relationship between passenger flows between routes using GCN and extract similar features of passenger flows between routes;
[0033] The feature fusion layer is used to fuse all selected features to form a seven-dimensional feature after GCN extracts similar features of route passenger flow;
[0034] The XGBoost layer is used to input the seven-dimensional features obtained by the feature fusion layer into XGBoost for passenger flow prediction.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also provides a bus route passenger flow prediction system considering spatiotemporal characteristics, wherein the bus route passenger flow prediction system considering spatiotemporal characteristics comprises:
[0036] A data processing module, used for acquiring bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data and determining time granularity according to the preprocessed bus card swiping data;
[0037] A data analysis module is used to perform qualitative analysis on the bus route passenger flow data from the time dimension and the space dimension, respectively, to obtain bus route passenger flow characteristics in the time dimension and bus route passenger flow characteristics in the space dimension;
[0038] A feature screening module, for quantifying the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations according to the passenger flow characteristics of the bus routes in the time dimension and the passenger flow characteristics of the bus routes in the space dimension, and screening out highly correlated spatiotemporal features;
[0039] A model training module is used to construct a bus route passenger flow prediction combination model, and use the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model;
[0040] The passenger flow prediction module is used to obtain the bus line data to be predicted, input the bus line data to be predicted into the trained bus line passenger flow prediction combined model, and output the bus line passenger flow prediction result.
[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a bus line passenger flow prediction program considering spatiotemporal characteristics stored in the memory and executable on the processor, wherein the bus line passenger flow prediction program considering spatiotemporal characteristics implements the steps of the bus line passenger flow prediction method considering spatiotemporal characteristics as described above when the bus line passenger flow prediction program considering spatiotemporal characteristics is executed by the processor.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a bus line passenger flow prediction program considering spatiotemporal characteristics, and when the bus line passenger flow prediction program considering spatiotemporal characteristics is executed by a processor, the steps of the bus line passenger flow prediction method considering spatiotemporal characteristics as described above are implemented.
[0043] In the present invention, bus card swiping data is obtained, the bus card swiping data is preprocessed, and the route passenger flow data is counted according to the preprocessed bus card swiping data and the time granularity is determined; the route passenger flow data is qualitatively analyzed from the time dimension and the space dimension, respectively, and the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension are obtained respectively; according to the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations are quantified, and high-correlation spatiotemporal features are screened out; a bus route passenger flow prediction combination model is constructed, and the bus route passenger flow prediction combination model is trained, tested and tuned using the high-correlation spatiotemporal features to obtain a trained bus route passenger flow prediction combination model; the bus route data to be predicted is obtained, and the bus route data to be predicted is input into the trained bus route passenger flow prediction combination model, and the bus route passenger flow prediction result is output. The present invention provides more accurate and effective route passenger flow prediction data for the bus intelligent dispatching system, helps the system to formulate more practical daily operation dispatching plans, reduces resource waste, and improves transportation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flow chart of a preferred embodiment of a method for predicting passenger flow of a bus route taking into account spatiotemporal characteristics of the present invention;
[0045] Figure 2 It is a framework diagram of a bus route passenger flow prediction combined model of GCN-XGBoost in a preferred embodiment of the bus route passenger flow prediction method considering spatiotemporal characteristics of the present invention;
[0046] Figure 3 This is a comparison chart of the accuracy results of the GCN-XGBoost bus route passenger flow prediction combined model and other models in the preferred embodiment of the bus route passenger flow prediction method considering spatiotemporal characteristics of the present invention;
[0047] Figure 4 It is a schematic diagram of the principle of a preferred embodiment of the bus route passenger flow prediction system considering the temporal and spatial characteristics of the present invention;
[0048] Figure 5 Schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0050] In the current daily operation of public transportation, there are often problems such as waste of resources and uneven service. In the dispatching and operation of bus routes, relying on the bus intelligent dispatching system can better dispatch bus resources according to the real-time passenger situation and reduce resource waste. However, in the day-ahead bus passenger flow forecast, the time characteristics of bus passenger flow itself are usually considered, and the implicit spatial characteristics between routes are ignored. Fully considering the time and space characteristics can better cope with passenger flow fluctuations and improve the prediction accuracy.
[0051] In view of the above technical problems, the present invention provides a bus line passenger flow prediction method considering spatiotemporal characteristics. The embodiment of the present invention mainly counts the bus card swiping data at a half-hour time granularity, and then mines its passenger flow characteristics from the time latitude and space latitude, clarifies the relationship between the above-mentioned dimensional characteristic factors and the bus line passenger flow, and then, based on the relationship between the characteristic factors and the bus line passenger flow, proposes a construction method for similar passenger flow characteristics between lines and circulation intensity characteristics between line stations, and screens out highly correlated spatiotemporal characteristics; then, by constructing a GCN-XGBoost bus line passenger flow prediction combined model, 28 days of historical passenger flow data are used for model training, testing and optimization to verify the superiority of the model.
[0052] The bus route passenger flow prediction method considering spatiotemporal characteristics described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the bus route passenger flow prediction method considering spatiotemporal characteristics includes the following steps:
[0053] Step S10: Obtain bus card swiping data, pre-process the bus card swiping data, and count route passenger flow data based on the pre-processed bus card swiping data and determine the time granularity.
[0054] Specifically, all bus card swiping data of the historical period of the predicted target line are obtained, and all bus card swiping data of the historical period selected by the predicted target line are preprocessed through Python, wherein the preprocessing includes deduplication and deletion of erroneous data; the route passenger flow data is counted according to the time granularity used for the short-term prediction target, and the optimal prediction time granularity is determined through autocorrelation measurement and stationarity measurement, so as to better mine the passenger flow characteristics and achieve better prediction effect.
[0055] In this embodiment, the card swiping data can be deduplicated, erroneous data can be deleted, and then the passenger flow data of 15min, 30min, and 60min (the time granularity usually used for short-term prediction) can be statistically analyzed for autocorrelation measurement and stationarity measurement to determine the optimal time granularity for prediction. Among them, autocorrelation can reflect the periodicity, trend and other characteristic strengths of the time series; the stationarity of the time series helps to simplify model construction and improve prediction accuracy. The statistical characteristics of the stationary series (such as mean and variance) do not change over time, making the prediction more stable and reliable.
[0056] Step S20: qualitatively analyzing the bus route passenger flow data from the time dimension and the space dimension, respectively, to obtain bus route passenger flow characteristics in the time dimension and bus route passenger flow characteristics in the space dimension.
[0057] Specifically, the passenger flow characteristics of the line are explored from the time dimension and the space dimension, the relationship between the characteristic factors of the above dimensions and the passenger flow of the bus line is clarified, the passenger flow data of the line is qualitatively analyzed from the time dimension, the time characteristics of the passenger flow and the relationship between the passenger flow of the bus line are determined, and the passenger flow characteristics of the bus line in the time dimension are obtained. First, the total passenger flow on weekdays and non-working days, and the passenger flow in each time period are visualized and analyzed to discover the passenger flow patterns under different time attributes, for example, the commuting peak on weekdays, the periodicity of passenger flow, etc.; the passenger flow data of the line is qualitatively analyzed from the space dimension, the spatial characteristics of the passenger flow and the relationship between the passenger flow of the bus line are determined, and the passenger flow characteristics of the bus line in the space dimension are obtained.
[0058] The average percentage difference between the overall passenger flow and local passenger flow (morning peak / morning flat peak / evening peak / evening flat peak) between each line is calculated to verify the similarity between the passenger flows between lines; the round-trip ratio of the same passenger between stations is calculated, and the correlation coefficient between the round-trip ratio between stations and the correlation between passenger flows between stations is calculated to verify whether there is a connection between the round-trip ratio and the correlation between passenger flows between stations. The results show that there is indeed a similarity between the passenger flows between lines, and there is a high degree of coupling between the round-trip ratio and the correlation between passenger flows between stations. Therefore, it can be preliminarily determined that these two spatial factors have an impact on passenger flows, and the factors can be further quantified into features as influencing factors to be considered.
[0059] Step S30: quantify the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations according to the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, and select highly correlated spatiotemporal features.
[0060] Specifically, the constructed spatial features include: similarity of passenger flow of the whole route, similarity of passenger flow of local routes, and circulation of routes and stations; the time features included in the screening include: the features of the previous 6 adjacent moments, the features of the moment in the previous 4 weeks, and whether it is a working day. The correlation analysis is conducted between these features and the real passenger flow, and the influencing factor features with a correlation greater than 0.3 are screened out (usually, the correlation coefficient greater than 0.3 is considered to be correlated between the two).
[0061] Step S30 includes:
[0062] Step S301, constructing similar features of passenger flow of the whole route and similar features of passenger flow of the local route: analyzing the similarity of the whole route and the local passenger flow, constructing similar graphs of the whole route and the local passenger flow, and using graph convolutional neural network (GCN) for self-learning to obtain similar features of passenger flow of the whole route and similar features of passenger flow of the local route respectively.
[0063] Step S302, constructing the circulation characteristics of the line stations: calculating the round trip ratio of passengers between stations, obtaining the station with the largest circulation intensity corresponding to the station, and constructing the circulation characteristics between the line stations according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station.
[0064] Further, step S302 includes the following steps:
[0065] Step S302a, calculating the fixed interaction strength between sites.
[0066] Calculation method: Passengers swipe their ID cards at the stations in the passenger flow OD data, from the starting station O to the alighting station D i The number of times the passenger swipes the card from station O to station D is calculated, and the round-trip ratio of the passenger from station O to station D is calculated. i Add the round trip ratios of the two stations to get O and D i The fixed interaction strength between sites is calculated as:
[0067]
[0068] in, Indicates O and D i fixed interaction strength between sites; Indicates that the same passenger travels from O to D i Number of sites; Indicates that the same passenger from D i The number of times you go to station O; N means boarding the bus from station O i The number of passengers who got off at the stop.
[0069] Step S302b, calculating the line station circulation characteristics.
[0070] Calculation method: The station with the largest fixed interaction intensity corresponding to all stations on the line is taken as the maximum interaction station D of the station. m , the maximum interactive station passenger flow of the station multiplied by the average outflow ratio from the maximum interactive station to the station is taken as the station passenger flow interactive feature, and the line station circulation feature is the sum of the station passenger flow circulation features of all stations in the line. The line station circulation feature is calculated as:
[0071]
[0072] Among them, Li represents the line station flow characteristics of line i; represents the passenger flow of the maximum interactive station of the jth station in the i-th line at time t; It represents the average travel ratio from the maximum interactive station to the jth station in the i-th line.
[0073] Step S303: construct time features.
[0074] The time features included in the screening include: the features of the previous 6 adjacent moments, the features of the moment in the previous 4 weeks, and whether it is a working day. The specific construction method is as follows:
[0075] Features of the previous t moments: predict the passenger flow t moments before the target moment;
[0076] Features of the time in the previous t weeks: predict the passenger flow at this time t weeks before the target time;
[0077] Whether it is a working day: 0 (non-working day) / 1 (working day).
[0078] Step S40: construct a bus line passenger flow prediction combination model, and use the highly correlated spatiotemporal features to train, test and optimize the bus line passenger flow prediction combination model to obtain a trained bus line passenger flow prediction combination model.
[0079] Specifically, the bus route passenger flow prediction combined model is a GCN-XGBoost bus route passenger flow prediction combined model.
[0080] Step S40 includes the following steps:
[0081] Step S401, model architecture design, such as Figure 2 As shown:
[0082] The GCN-XGBoost bus route passenger flow prediction combined model includes: a GCN feature extraction layer, a feature fusion layer and an XGBoost layer; the GCN feature extraction layer is used to use GCN (graph convolutional neural network) to capture the passenger flow similarity relationship between routes and extract the passenger flow similarity features of the routes; the feature fusion layer is used to fuse all selected features after GCN extracts the passenger flow similarity features of the routes to form a seven-dimensional feature (each dimension is: passenger flow at the previous moment, passenger flow at the previous two moments, passenger flow in the previous week, whether it is a working day, similarity features of the overall passenger flow of the route, similarity features of the local passenger flow of the route, and circulation features of the route stations); the XGBoost layer is used to input the seven-dimensional features obtained by the feature fusion layer into XGBoost for passenger flow prediction.
[0083] Step S402: model training and testing.
[0084] The existing bus card swiping data is used as the training and testing data set, which is divided into training set, validation set and test set in the ratio of 7:1.5:1.5.
[0085] Step S403: tuning model parameters.
[0086] Hyperparameter tuning: In the GCN feature extraction layer, grid search is used to tune the hidden layer dimension and batch size; in the XGBoost layer, Bayesian optimization is used to tune six key parameters such as learning rate and maximum tree depth.
[0087] Step S404: model performance, feature contribution and applicability analysis.
[0088] Model performance analysis: Use evaluation indicators such as MAPE (mean absolute percentage error) and RMSE (root mean square error) to quantify the prediction accuracy of the model on the validation set and test set, and use accuracy to compare with common models, such as Figure 3 As shown in the figure, the commonly used prediction models are compared with the commonly used prediction models, including single models XGBoost, SVM, random forest, LSTM, GCN and the commonly used combination model GCN-LSTM.
[0089] Feature contribution analysis: By outputting the contribution of each feature in the XGBoost model, the coupling degree between feature contribution and feature correlation is calculated.
[0090] Applicability analysis: Analyze the applicability of the model from the dimensions of time, passenger flow, and route attributes.
[0091] Step S50: Obtain the bus route data to be predicted, input the bus route data to be predicted into the trained bus route passenger flow prediction combined model, and output the bus route passenger flow prediction result.
[0092] Specifically, after obtaining the trained bus line passenger flow prediction combination model, the trained bus line passenger flow prediction combination model can be used to quickly predict the bus line passenger flow for the route for which passenger flow prediction is desired. Then, after obtaining the bus line data to be predicted, the bus line data to be predicted can be directly input into the trained bus line passenger flow prediction combination model to quickly output the bus line passenger flow prediction result.
[0093] The present invention extracts the temporal and spatial characteristics of line passenger flow, combines the bus line card swiping data, analyzes the relationship between passenger flow characteristics and rail transit passenger flow, and then screens out highly correlated factors for passenger flow prediction model input based on the correlation between the two. The present invention targets the bus line passenger flow demand, uses highly correlated spatiotemporal characteristics, and deeply explores the relationship between highly correlated spatiotemporal characteristics and line passenger flow, which is more in line with passenger travel patterns and provides data support for bus operations.
[0094] Aiming at the problems of resource waste and service imbalance caused by the current unbalanced distribution of bus passenger flow, the present invention processes historical passenger flow data through Python, fully considers the high-impact time factors and combines the space factors between line stations to realize short-term prediction of bus line passenger flow, provides more accurate passenger flow basis for intelligent bus system, and helps to realize efficient scheduling of daily bus operations and balance supply and demand.
[0095] The present invention aims at the problem of waste of public transportation resources, realizes bus route passenger flow prediction considering more comprehensive spatiotemporal characteristics, provides more accurate passenger flow data support for intelligent public transportation dispatching system, and helps to realize more reasonable dispatching arrangement of public transportation resources.
[0096] Furthermore, if Figure 4 As shown, based on the above-mentioned bus route passenger flow prediction method considering spatiotemporal characteristics, the present invention also provides a bus route passenger flow prediction system considering spatiotemporal characteristics, wherein the bus route passenger flow prediction system considering spatiotemporal characteristics includes:
[0097] A data processing module, used for acquiring bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data and determining time granularity according to the preprocessed bus card swiping data;
[0098] A data analysis module is used to perform qualitative analysis on the bus route passenger flow data from the time dimension and the space dimension, respectively, to obtain bus route passenger flow characteristics in the time dimension and bus route passenger flow characteristics in the space dimension;
[0099] A feature screening module, for quantifying the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations according to the passenger flow characteristics of the bus routes in the time dimension and the passenger flow characteristics of the bus routes in the space dimension, and screening out highly correlated spatiotemporal features;
[0100] A model training module is used to construct a bus route passenger flow prediction combination model, and use the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model;
[0101] The passenger flow prediction module is used to obtain the bus line data to be predicted, input the bus line data to be predicted into the trained bus line passenger flow prediction combined model, and output the bus line passenger flow prediction result.
[0102] Furthermore, if Figure 5 As shown, based on the above-mentioned bus route passenger flow prediction method and system considering spatiotemporal characteristics, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 5 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0103] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a bus route passenger flow prediction program 40 considering spatiotemporal characteristics is stored on the memory 20, and the bus route passenger flow prediction program 40 considering spatiotemporal characteristics can be executed by the processor 10, thereby realizing the bus route passenger flow prediction method considering spatiotemporal characteristics in the present application.
[0104] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the bus line passenger flow prediction method considering spatiotemporal characteristics.
[0105] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0106] In one embodiment, when the processor 10 executes the bus route passenger flow prediction program 40 considering spatiotemporal characteristics in the memory 20, the following steps are implemented:
[0107] Obtaining bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data based on the preprocessed bus card swiping data and determining a time granularity;
[0108] Qualitatively analyzing the passenger flow data of the bus route from the time dimension and the space dimension respectively, and obtaining the passenger flow characteristics of the bus route in the time dimension and the passenger flow characteristics of the bus route in the space dimension respectively;
[0109] According to the bus line passenger flow characteristics in the time dimension and the bus line passenger flow characteristics in the space dimension, quantify the passenger flow similarity relationship between lines and the passenger flow circulation relationship between line stations, and screen out highly correlated spatiotemporal features;
[0110] Constructing a bus route passenger flow prediction combination model, and using the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model;
[0111] Obtain the bus route data to be predicted, input the bus route data to the trained bus route passenger flow prediction combined model, and output the bus route passenger flow prediction result.
[0112] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the bus card swiping data is obtained, the bus card swiping data is preprocessed, and the route passenger flow data is counted according to the preprocessed bus card swiping data and the time granularity is determined, specifically including:
[0113] Acquire all bus card swiping data of the historical period of the predicted target route, and pre-process all bus card swiping data of the historical period selected by the predicted target route, wherein the pre-processing includes deduplication and deletion of erroneous data;
[0114] The passenger flow data of the route is counted according to the time granularity used for short-term prediction objectives, and the optimal prediction time granularity is determined through autocorrelation measurement and stationarity measurement.
[0115] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the qualitative analysis of the route passenger flow data from the time dimension and the space dimension is performed to obtain the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, respectively, specifically includes:
[0116] Qualitatively analyze the passenger flow data of the route from the time dimension, determine the passenger flow time characteristics and the relationship between the bus route passenger flow, and obtain the bus route passenger flow characteristics in the time dimension;
[0117] The passenger flow data of the bus lines are qualitatively analyzed from the spatial dimension to determine the spatial characteristics of passenger flow and the relationship between passenger flow of bus lines, thereby obtaining the passenger flow characteristics of bus lines in the spatial dimension.
[0118] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations are quantified according to the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, and highly correlated spatiotemporal characteristics are screened out, specifically including:
[0119] Analyze the similarity of overall and local passenger flows of the route, construct overall and local passenger flow similarity graphs, and use graph convolutional neural networks for self-learning to obtain the similarity features of overall and local passenger flows respectively;
[0120] Calculate the round-trip ratio of passengers between stations, obtain the station with the largest circulation intensity, and construct the circulation characteristics between stations according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station;
[0121] Construct time features, which include: features of the previous 6 adjacent moments, features of the moment in the previous 4 weeks, and features of whether it is a working day.
[0122] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the calculation of the round-trip ratio of passengers between stations, obtaining the station with the largest circulation intensity corresponding to the station, and constructing the circulation characteristics between the station lines according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station, specifically includes:
[0123] Passengers swipe their ID cards at the starting station O to the alighting station D in the passenger flow OD data. i The number of times the passenger swipes the card from station O to station D is calculated, and the round-trip ratio of the passenger from station O to station D is calculated. i Add the round trip ratios of the two stations to get O and D i The fixed interaction strength between sites is calculated as:
[0124]
[0125] in, Indicates O and D i fixed interaction strength between sites; Indicates that the same passenger travels from O to D i Number of sites; Indicates that the same passenger from D i The number of times you go to station O; N means you get on the bus from station O. i The number of passengers getting off at the station;
[0126] The station with the largest fixed interaction intensity corresponding to all stations on the line is taken as the maximum interaction station D of the station. m , the maximum interactive station passenger flow of the station multiplied by the average outflow ratio from the maximum interactive station to the station is taken as the station passenger flow interactive feature, and the line station circulation feature is the sum of the station passenger flow circulation features of all stations in the line. The line station circulation feature is calculated as:
[0127]
[0128] Among them, L i represents the line station flow characteristics of line i; represents the passenger flow of the maximum interactive station of the jth station in the i-th line at time t; It represents the average travel ratio from the maximum interactive station to the jth station in the i-th line.
[0129] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the bus route passenger flow prediction combined model is a GCN-XGBoost bus route passenger flow prediction combined model.
[0130] The bus route passenger flow prediction method considering spatiotemporal characteristics, wherein the GCN-XGBoost bus route passenger flow prediction combined model includes: a GCN feature extraction layer, a feature fusion layer and an XGBoost layer;
[0131] The GCN feature extraction layer is used to capture the similarity relationship between passenger flows between routes using GCN and extract similar features of passenger flows between routes;
[0132] The feature fusion layer is used to fuse all selected features to form a seven-dimensional feature after GCN extracts similar features of route passenger flow;
[0133] The XGBoost layer is used to input the seven-dimensional features obtained by the feature fusion layer into XGBoost for passenger flow prediction.
[0134] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a bus line passenger flow prediction program that considers spatiotemporal characteristics, and when the bus line passenger flow prediction program that considers spatiotemporal characteristics is executed by a processor, the steps of the bus line passenger flow prediction method that considers spatiotemporal characteristics as described above are implemented.
[0135] In summary, the present invention provides a bus route passenger flow prediction method, system, terminal and computer-readable storage medium considering spatiotemporal characteristics, the method comprising: obtaining bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data according to the preprocessed bus card swiping data and determining the time granularity; qualitatively analyzing the route passenger flow data from the time dimension and the space dimension, respectively, to obtain bus route passenger flow characteristics in the time dimension and bus route passenger flow characteristics in the space dimension; quantifying the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations according to the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, and screening out highly correlated spatiotemporal characteristics; constructing a bus route passenger flow prediction combination model, using the highly correlated spatiotemporal characteristics to train, test and tune the bus route passenger flow prediction combination model, and obtaining a trained bus route passenger flow prediction combination model; obtaining bus route data to be predicted, inputting the bus route data to be predicted into the trained bus route passenger flow prediction combination model, and outputting a bus route passenger flow prediction result. The present invention provides more accurate and effective route passenger flow prediction data for the public transportation intelligent dispatching system, helps the system to formulate more practical daily operation dispatching plans, reduces resource waste and improves transportation efficiency.
[0136] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0137] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0138] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A bus route passenger flow prediction method considering spatiotemporal characteristics, characterized in that: The bus route passenger flow prediction method considering spatiotemporal characteristics includes: Obtaining bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data based on the preprocessed bus card swiping data and determining a time granularity; Qualitatively analyzing the passenger flow data of the bus route from the time dimension and the space dimension respectively, and obtaining the passenger flow characteristics of the bus route in the time dimension and the passenger flow characteristics of the bus route in the space dimension respectively; According to the bus line passenger flow characteristics in the time dimension and the bus line passenger flow characteristics in the space dimension, quantify the passenger flow similarity relationship between lines and the passenger flow circulation relationship between line stations, and screen out highly correlated spatiotemporal features; Constructing a bus route passenger flow prediction combination model, and using the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model; Obtain the bus route data to be predicted, input the bus route data to the trained bus route passenger flow prediction combined model, and output the bus route passenger flow prediction result.
2. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 1 is characterized in that: The obtaining of bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data according to the preprocessed bus card swiping data and determining the time granularity specifically include: Acquire all bus card swiping data of the historical period of the predicted target route, and pre-process all bus card swiping data of the historical period selected by the predicted target route, wherein the pre-processing includes deduplication and deletion of erroneous data; The passenger flow data of the route is counted according to the time granularity used for short-term prediction objectives, and the optimal prediction time granularity is determined through autocorrelation measurement and stationarity measurement.
3. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 1 is characterized in that: The qualitative analysis of the route passenger flow data from the time dimension and the space dimension is respectively performed to obtain the bus route passenger flow characteristics in the time dimension and the bus route passenger flow characteristics in the space dimension, which specifically include: Qualitatively analyze the passenger flow data of the route from the time dimension, determine the passenger flow time characteristics and the relationship between the bus route passenger flow, and obtain the bus route passenger flow characteristics in the time dimension; The passenger flow data of the bus lines are qualitatively analyzed from the spatial dimension to determine the spatial characteristics of passenger flow and the relationship between passenger flow of bus lines, thereby obtaining the passenger flow characteristics of bus lines in the spatial dimension.
4. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 1 is characterized in that: According to the bus line passenger flow characteristics in the time dimension and the bus line passenger flow characteristics in the space dimension, the similarity relationship of passenger flow between lines and the relationship of passenger flow between line stations are quantified, and highly correlated spatiotemporal features are screened out, specifically including: Analyze the similarity of overall and local passenger flows of the route, construct overall and local passenger flow similarity graphs, and use graph convolutional neural networks for self-learning to obtain the similarity features of overall and local passenger flows respectively; Calculate the round-trip ratio of passengers between stations, obtain the station with the largest circulation intensity, and construct the circulation characteristics between stations according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station; Construct time features, which include: features of the previous 6 adjacent moments, features of the moment in the previous 4 weeks, and features of whether it is a working day.
5. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 4 is characterized in that: The calculation of the round trip ratio of passengers between stations, obtaining the station with the largest circulation intensity corresponding to the station, and constructing the circulation characteristics between the stations of the line according to the maximum circulation station corresponding to all stations in the line and the average circulation ratio of each station specifically include: Passengers swipe their ID cards at the starting station O to the alighting station D in the passenger flow OD data. i The number of times the passenger swipes the card from station O to station D is calculated, and the round-trip ratio of the passenger from station O to station D is calculated. i Add the round trip ratios of the two stations to get O and D i The fixed interaction strength between sites is calculated as: in, Indicates O and D i fixed interaction strength between sites; Indicates that the same passenger travels from O to D i Number of sites; Indicates that the same passenger from D i The number of times you go to station O; N means boarding the bus from station O i The number of passengers getting off at the station; The station with the largest fixed interaction intensity corresponding to all stations on the line is taken as the maximum interaction station D of the station. m , the maximum interactive station passenger flow of the station multiplied by the average outflow ratio from the maximum interactive station to the station is taken as the station passenger flow interactive feature, and the line station circulation feature is the sum of the station passenger flow circulation features of all stations in the line. The line station circulation feature is calculated as: Among them, L i represents the line station flow characteristics of line i; represents the passenger flow of the maximum interactive station of the jth station in the i-th line at time t; It represents the average travel ratio from the maximum interactive station to the jth station in the i-th line.
6. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 1, characterized in that: The bus route passenger flow prediction combined model is a GCN-XGBoost bus route passenger flow prediction combined model.
7. The bus route passenger flow prediction method considering spatiotemporal characteristics according to claim 6 is characterized in that: The GCN-XGBoost bus route passenger flow prediction combined model includes: a GCN feature extraction layer, a feature fusion layer and an XGBoost layer; The GCN feature extraction layer is used to capture the similarity relationship between passenger flows between routes using GCN and extract similar features of passenger flows between routes; The feature fusion layer is used to fuse all selected features to form a seven-dimensional feature after GCN extracts similar features of route passenger flow; The XGBoost layer is used to input the seven-dimensional features obtained by the feature fusion layer into XGBoost for passenger flow prediction.
8. A bus route passenger flow prediction system considering spatiotemporal characteristics, characterized in that: The bus route passenger flow prediction system considering spatiotemporal characteristics includes: A data processing module, used for acquiring bus card swiping data, preprocessing the bus card swiping data, and counting route passenger flow data and determining time granularity according to the preprocessed bus card swiping data; A data analysis module is used to perform qualitative analysis on the bus route passenger flow data from the time dimension and the space dimension, respectively, to obtain bus route passenger flow characteristics in the time dimension and bus route passenger flow characteristics in the space dimension; A feature screening module, for quantifying the passenger flow similarity relationship between routes and the passenger flow circulation relationship between route stations according to the passenger flow characteristics of the bus routes in the time dimension and the passenger flow characteristics of the bus routes in the space dimension, and screening out highly correlated spatiotemporal features; A model training module is used to construct a bus route passenger flow prediction combination model, and use the highly correlated spatiotemporal features to train, test and optimize the bus route passenger flow prediction combination model to obtain a trained bus route passenger flow prediction combination model; The passenger flow prediction module is used to obtain the bus line data to be predicted, input the bus line data to be predicted into the trained bus line passenger flow prediction combined model, and output the bus line passenger flow prediction result.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a bus route passenger flow prediction program considering spatiotemporal characteristics stored in the memory and executable on the processor. When the bus route passenger flow prediction program considering spatiotemporal characteristics is executed by the processor, the steps of the bus route passenger flow prediction method considering spatiotemporal characteristics as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a bus route passenger flow prediction program that considers spatiotemporal characteristics. When the bus route passenger flow prediction program that considers spatiotemporal characteristics is executed by a processor, the steps of the bus route passenger flow prediction method that considers spatiotemporal characteristics as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Rail transit passenger flow prediction method considering dynamic space-time correlation
CN113298314A
Short-time public transport passenger flow prediction system and method based on cloud platform
CN113393012A
Method for predicting travel time between bus stations based on spatio-temporal characteristics
CN114358428A
Cited By
Passenger flow monitoring and analyzing system
CN120893610A