Short-time passenger flow prediction method and system based on space-time big data, and medium
Through the short-term passenger flow prediction method based on spatiotemporal big data, combined with LSTM model and local correlation coefficient weighting, the problem that the existing technology cannot reflect passenger flow in real time is solved, and higher prediction accuracy and adaptability are achieved, and passenger flow management is optimized. and operation.
Patent Information
- Application Number
- CN202411263495.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
AI Technical Summary
The existing technology cannot reflect passenger flow in real time, cannot effectively respond to emergencies, and medium- and long-term predictions cannot meet passengers' real-time demand for subway service quality. Traditional methods only consider the time correlation of traffic flow, affecting the prediction accuracy.
The short-term passenger flow prediction method based on spatiotemporal big data is adopted, and the spatial correlation of traffic passenger flow is considered by combining grid division, data normalization, clustering algorithm and LSTM model, and the spatial correlation is trained by using local correlation coefficient weighting. LSTM prediction model realizes short-term passenger flow prediction with a granularity of 15 minutes.
Improve the real-time and accuracy of short-term passenger flow forecasts, can better reflect the passenger flow characteristics of specific areas and time periods, enhance the space-time sensitivity and robustness of the model, adapt to changes and abnormal situations in local areas, and provide More accurate prediction results, optimize routes and passenger flow organization, and reduce rail transit pressure.
Smart Images

Figure CN119204312A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a short-term passenger flow prediction method, system and medium based on spatiotemporal big data. Background Art
[0002] In the existing technology, the prediction of passenger flow at stations, subways, etc. mostly adopts medium- and long-term prediction strategies, which cannot reflect the passenger flow situation in real time. In traditional prediction methods, passenger flow is usually predicted for the next 1 year, 3 to 10 years to achieve medium- and long-term planning and guidance needs, but it cannot provide effective data for handling emergency incidents, and cannot meet passengers' real-time demand for subway service quality. The prediction model constructed by the traditional method only considers the time correlation of traffic flow, and uses the historical data of the target station itself to predict the traffic passenger flow at the next moment, which affects the prediction accuracy of the model.
[0003] With the development of big data and artificial intelligence technology, it is possible to use big data to make more accurate short-term passenger flow predictions. Short-term passenger flow predictions at transportation stations are of great significance for further improving the scientific management level of cities. Short-term passenger flow predictions can be used to optimize routes and passenger flow organization, provide early warnings and multi-party decision-making for operators, and are conducive to scheduling train operations, improving passenger travel efficiency, and reducing the pressure on rail transit. How to combine big data, artificial intelligence technology with short-term passenger flow prediction tasks to improve the real-time and accuracy of short-term passenger flow predictions is an urgent problem to be solved by technicians in this field. Summary of the invention
[0004] The purpose of the present invention is to provide a short-term passenger flow prediction method and system based on spatiotemporal big data, taking into account the spatial correlation characteristics of traffic passenger flow, realizing short-term passenger flow prediction in spatiotemporal dimensions, and combining comprehensive evaluation indicators to evaluate the prediction accuracy, thereby improving the effectiveness and accuracy of model prediction.
[0005] According to a first aspect of the present invention, a short-term passenger flow prediction method based on spatiotemporal big data is proposed, comprising the following steps:
[0006] Step 1: Divide the grids within the region according to the administrative divisions and determine the grids within the entire region;
[0007] Step 2: According to the grids in the entire area and the subway exit information, determine the grid corresponding to the exit, and determine the total passenger flow data of the grid area based on the POI passenger flow and the number of base station users in the grid area;
[0008] Step 3: Obtain the passenger flow data of the subway station according to the settlement data of the subway automatic fare collection system in the grid area;
[0009] Step 4: normalize the total passenger flow data of the grid area and the passenger flow data of the subway station;
[0010] Step 5: Cluster and reduce the dimension of the normalized passenger flow data according to the clustering algorithm to classify the passenger flow data;
[0011] Step 6: According to the classified passenger flow data, weighted based on the local correlation coefficient, obtain the weighted passenger flow data of the classified data on working days and non-working days, and divide the weighted passenger flow data into a training set and a test set;
[0012] Step 7: Input the training sets of the two types of weighted passenger flow data into LSTM training respectively, and train to obtain the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal association, which are used to predict short-term traffic passenger flow on weekdays and non-working days respectively. Use the test sets of the two types of weighted passenger flow data to test and optimize the model to obtain the final LSTM short-term traffic flow prediction model, whose input is the weighted passenger flow data and output is the predicted passenger flow of the preset time step, so as to realize the output of subway short-term passenger flow prediction.
[0013] As an optional implementation, in step 2, the grid corresponding to the exit is determined according to the grids in the entire area and the subway exit information, and the total passenger flow data of the grid area is determined based on the POI passenger flow and the number of base station users in the grid area, including:
[0014] According to the latitude and longitude information of each subway exit, the corresponding grid is divided;
[0015] For each grid, summarize the base stations and POIs it contains;
[0016] The total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI gathering point information in the grid.
[0017] As an optional implementation, in step 2, the total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI passenger gathering point information in the grid, including:
[0018] Using the mobile phone signaling data of the base stations in the grid area, the number of users connected to the base station within a preset time step is counted, and the number of users of all base stations is summarized as the number of base station users;
[0019] According to the types of different POIs and historical passenger flow data, a weight value is assigned to each POI, and the passenger flow data of the POI within a preset time step is calculated according to the POI weight value in the grid area as the POI passenger flow;
[0020] The number of base station users and POI passenger flow are aggregated to obtain the total passenger flow data in the grid area.
[0021] As an optional implementation, in step 3, obtaining subway station passenger flow data based on the settlement data of the subway automatic fare collection system in the grid area includes:
[0022] Based on the settlement data of the subway automatic fare collection system, the station passenger flow data is collected according to the preset time step, including passenger arrival time, entry station name, exit time, and exit station name information.
[0023] As an optional implementation, in step 4, the total passenger flow data of the grid area and the passenger flow data of the subway station are normalized, including:
[0024] The max-min linear normalization method is used to constrain the total passenger flow data of the grid area and the subway station passenger flow data to the range of [0,1], so that each attribute of the data has the same order of magnitude.
[0025] As an optional implementation, in step 5, clustering and dimensionality reduction are performed on the normalized passenger flow data according to a clustering algorithm to classify the passenger flow data, including:
[0026] Based on the K-means clustering algorithm, the normalized passenger flow data is clustered and reduced in dimension, and classified into two types of passenger flow data: working day and non-working day.
[0027] As an optional implementation, in step 6, according to the classified passenger flow data, weighted based on the local correlation coefficient, the weighted passenger flow data of the classified data on working days and non-working days is obtained, including:
[0028] First, the local correlation coefficients between the adjacent sites and the target site at all times of the day are calculated;
[0029] Then, the calculated local correlation coefficient is normalized to obtain the local correlation coefficient weight;
[0030] Finally, the passenger flow data of each target station is weighted using the local correlation coefficient weight to obtain the weighted passenger flow data of the spatial correlation between the stations, which quantitatively represents the spatial correlation between the stations.
[0031] As an optional implementation, in step 7, the training sets of the two types of weighted passenger flow data are respectively input into LSTM training, and the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal correlation are respectively trained to predict the short-term traffic passenger flow on weekdays and non-working days, respectively. The model is tested and optimized using the test sets of the two types of weighted passenger flow data to obtain the final LSTM short-term traffic flow prediction model, which also includes a comprehensive evaluation of the final LSTM short-term traffic flow prediction model, with the three evaluation indicators of mean absolute error, root mean square error, and mean absolute percentage error as the evaluation basis.
[0032] According to a second aspect of the present invention, a computer system is further provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the aforementioned method when executing the computer program.
[0033] According to a third aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the aforementioned method are implemented.
[0034] Compared with the prior art, combined with the implementation of the above short-term passenger flow prediction method based on spatiotemporal big data, firstly, the target grid area is obtained according to the latitude and longitude of the target station, the passenger flow data is obtained through the base station information and POI information in the grid area, and the subway automatic fare collection system (AFC) is used to collect passenger data. Through multi-source data fusion, more comprehensive passenger flow information can be provided to cope with the complex change pattern of passenger flow; then the attributes of the above passenger flow data and passenger data are normalized and clustered for dimension reduction to reduce the complexity of the data, and useful features are extracted to improve the performance and performance of the subsequent prediction model; local correlation weighted calculation is performed on the classified data to determine two types of weighted passenger flow data on working days and non-working days, and the spatial correlation between each station is quantitatively represented to better reflect the passenger flow characteristics and spatial distribution of specific areas and time periods. On this basis, the spatiotemporal correlation LSTM short-term traffic prediction model is trained respectively, and the prediction results of short-term subway traffic (such as 15 minutes) are output through the model. The prediction accuracy is comprehensively evaluated using three evaluation indicators, indicating the effectiveness and accuracy of the prediction results of the method proposed in the present invention.
[0035] In the short-term passenger flow prediction method based on spatiotemporal big data of the present invention, the correlation and change law between sites in time and space are studied, and the spatial correlation between each site is determined to be quantified in detail based on the weight of the local correlation coefficient. The local correlation coefficient between each site and other sites in the neighborhood is calculated by the sliding window technology, and a weight is assigned to each site accordingly, and the weighted passenger flow of the target site is calculated, so as to fully explore and reflect the influence of passenger flow between subway stations, reduce data noise, and make the data of sites with higher correlation that contribute more to the final prediction result be reflected, capture the characteristics and patterns in the local area, improve the reliability of the data, and enhance the spatiotemporal sensitivity of the model. Therefore, the weighted passenger flow data can better reflect the actual passenger flow distribution, and the model can learn a more accurate passenger flow pattern during training, thereby improving the accuracy and precision of the prediction; at the same time, the weighted local correlation coefficient can help the model better adapt to changes and abnormal situations in the local area, such as passenger flow fluctuations in emergencies or special time periods, so that the model is more robust when facing data in different regions and time periods, and thus performs more stably on different test sets.
[0036] Since the existing traffic passenger flow prediction adopts the time series prediction method, the prediction of subway passenger flow is a medium- and long-term prediction, which cannot provide effective data for handling emergency incidents. Starting from the data, combined with the operation of LSTM network deep learning, the present invention quantifies the time and space correlation of short-term passenger flow changes in subway stations in a more detailed manner, adopts a smaller time granularity for prediction, divides the data into 15-minute time intervals for statistical analysis, and obtains short-term passenger flow prediction results, so that the prediction results can be more accurate, and can provide evidence for passenger flow control and induction methods, optimize lines and passenger flow organization, provide early warning and multi-party decision-making for operators, make train operation scheduling in advance, improve passengers' travel efficiency, reduce the pressure on rail transit, and prevent congestion, trampling and other safety accidents.
[0037] It should be understood that all combinations of the aforementioned concepts and the additional concepts described in more detail below can be considered as part of the inventive subject matter of the present disclosure as long as such concepts are not mutually inconsistent. In addition, all combinations of the claimed subject matter are considered as part of the inventive subject matter of the present disclosure.
[0038] The foregoing and other aspects, embodiments and features of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or beneficial effects of the exemplary embodiments, will be apparent from the following description or learned from the practice of the specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flowchart of a short-term passenger flow prediction method based on spatiotemporal big data according to an embodiment of the present invention.
[0040] Figure 2 It is a schematic diagram of the training process of the spatiotemporal correlation LSTM short-term traffic prediction model according to an embodiment of the present invention.
[0041] Figure 3 It is a flowchart of a short-term passenger flow prediction method according to a specific embodiment of the present invention.
[0042] Figure 4 It is a flowchart of obtaining and preprocessing raw passenger flow data according to a specific embodiment of the present invention.
[0043] Figure 5 It is a flowchart of building an LSTM prediction model based on deep learning according to a specific embodiment of the present invention.
[0044] Figure 6 is a schematic diagram of a POI according to a specific embodiment of the present invention.
[0045] Figure 7 It is a schematic diagram of clustering results corresponding to different clustering K values according to a specific embodiment of the present invention.
[0046] Figure 8 It is a comparison diagram of passenger flow classification results corresponding to two categories of non-working days and working days and different traffic passenger flow box lines according to a specific embodiment of the present invention.
[0047] Fig. 9 4 is a schematic diagram of relationship coefficients between adjacent sites according to a specific embodiment of the present invention.
[0048] Fig.10 It is a schematic diagram of the change of the weight of the correlation coefficient of adjacent sites according to a specific embodiment of the present invention.
[0049] Fig.11 It is a schematic diagram of the change of loss functions of a working day prediction model and a non-working day prediction model according to a specific embodiment of the present invention.
[0050] Fig.12 It is a schematic diagram of prediction results of a working day model according to a specific embodiment of the present invention.
[0051] Fig.13 It is a schematic diagram of prediction results of a non-working day model according to a specific embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0053] Various aspects of the present invention are described in this disclosure with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present disclosure are not necessarily intended to include all aspects of the present invention. It should be understood that the various concepts and embodiments introduced above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed by the present invention are not limited to any implementation. In addition, some aspects disclosed by the present invention can be used alone or in any appropriate combination with other aspects disclosed by the present invention.
[0054] {Example 1}
[0055] This embodiment provides a short-term passenger flow prediction method based on spatiotemporal big data, which can be executed by a computer system. The computer system can be implemented by a server, a terminal, or an interactive system between a terminal and a server. Figure 1 The short-term passenger flow prediction method based on spatiotemporal big data of the example shown includes the following steps:
[0056] Step S101, dividing the area into grids according to administrative divisions, and determining the grids within the entire area;
[0057] Step S102: Determine the grid corresponding to the exit according to the grids in the entire region and the subway exit information, and determine the total passenger flow data of the grid area based on the POI passenger flow and the number of base station users in the grid area;
[0058] Step S103, obtaining subway station passenger flow data according to the settlement data of the subway automatic fare collection system in the grid area;
[0059] Step S104, normalizing the total passenger flow data of the grid area and the passenger flow data of the subway station;
[0060] Step S105: clustering and dimensionality reduction processing are performed on the normalized passenger flow data according to a clustering algorithm to classify the passenger flow data;
[0061] Step S106: According to the classified passenger flow data, weighted based on the local correlation coefficient, obtain weighted passenger flow data of the classified data of working days and non-working days, and divide the weighted passenger flow data into a training set and a test set;
[0062] Step S107, input the training sets of the two types of weighted passenger flow data into LSTM training respectively, and train to obtain the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal association respectively, which are used to predict the short-term traffic passenger flow on working days and non-working days respectively, and use the test sets of the two types of weighted passenger flow data to test and optimize the model to obtain the final LSTM short-term traffic flow prediction model, whose input is the weighted passenger flow data, and output is the predicted passenger flow of the preset time step, so as to realize the output of subway short-term passenger flow prediction.
[0063] As an optional implementation, in step S102, the grid corresponding to the exit is determined according to the grids in the entire area and the subway exit information, and the total passenger flow data of the grid area is determined based on the POI passenger flow and the number of base station users in the grid area, including:
[0064] According to the latitude and longitude information of each subway exit, the corresponding grid is divided;
[0065] For each grid, summarize the base stations and POIs it contains;
[0066] The total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI gathering point information in the grid.
[0067] As an optional implementation, in step S102, the total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI passenger gathering point information in the grid, including:
[0068] Using the mobile phone signaling data of the base stations in the grid area, the number of users connected to the base station within a preset time step is counted, and the number of users of all base stations is summarized as the number of base station users;
[0069] According to the types of different POIs and historical passenger flow data, a weight value is assigned to each POI, and the passenger flow data of the POI within a preset time step is calculated according to the POI weight value in the grid area as the POI passenger flow;
[0070] The number of base station users and POI passenger flow are aggregated to obtain the total passenger flow data in the grid area.
[0071] As an optional implementation, in step S103, obtaining subway station passenger flow data according to the settlement data of the subway automatic fare collection system in the grid area includes:
[0072] Based on the settlement data of the subway automatic fare collection system, the station passenger flow data is collected according to the preset time step, including passenger arrival time, entry station name, exit time, and exit station name information.
[0073] As an optional implementation, in step S104, the total passenger flow data of the grid area and the passenger flow data of the subway station are normalized, including:
[0074] The max-min linear normalization method is used to constrain the total passenger flow data of the grid area and the subway station passenger flow data to the range of [0,1], so that each attribute of the data has the same order of magnitude.
[0075] As an optional implementation, in step S105, clustering and dimensionality reduction are performed on the normalized passenger flow data according to a clustering algorithm to classify the passenger flow data, including:
[0076] Based on the K-means clustering algorithm, the normalized passenger flow data is clustered and reduced in dimension, and classified into two types of passenger flow data: working day and non-working day.
[0077] As an optional implementation, in step S106, according to the classified passenger flow data, weighted based on the local correlation coefficient, the weighted passenger flow data of the classified data on working days and non-working days is obtained, including:
[0078] First, the local correlation coefficients between the adjacent sites and the target site at all times of the day are calculated;
[0079] Then, the calculated local correlation coefficient is normalized to obtain the local correlation coefficient weight;
[0080] Finally, the passenger flow data of each target station is weighted using the local correlation coefficient weight to obtain the weighted passenger flow data of the spatial correlation between the stations, which quantitatively represents the spatial correlation between the stations.
[0081] As an optional implementation, Figure 2 The training process of the LSTM short-term traffic flow prediction model is exemplarily shown. In step S107, the training sets of the two types of weighted passenger flow data are respectively input into the LSTM training, and the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal association are respectively trained to predict the short-term traffic passenger flow on working days and non-working days, respectively. The test sets of the two types of weighted passenger flow data are used to test and optimize the model to obtain the final LSTM short-term traffic flow prediction model, and the following steps are also included:
[0082] Step S108: Comprehensively evaluate the final LSTM short-term traffic flow prediction model, using the mean absolute error, root mean square error, and mean absolute percentage error as the evaluation basis.
[0083] {Example 2}
[0084] In this example, a short-term passenger flow prediction method based on spatiotemporal big data executed by a computer system is provided. The time and spatial correlation of short-term passenger flow changes at subway stations is quantified in more detail, and a smaller granularity is used for prediction to achieve a 15-minute granularity subway short-term passenger flow prediction, which is used to optimize lines and passenger flow organization, provide early warning and multi-party decision-making for operators, and is conducive to scheduling train operations, improving passenger travel efficiency, and reducing the pressure on rail transit.
[0085] Combined with Figure 1 , 2 As shown in , 3, 4, and 5, in this embodiment 2, we explain the implementation process of the aforementioned short-term passenger flow prediction method in more detail.
[0086] Combination Figure 3 The short-term passenger flow prediction method shown includes:
[0087] Step S201, acquisition and preprocessing of original passenger flow data, including acquisition and preprocessing of grid area passenger flow data and subway station passenger flow data;
[0088] Step S202: cluster analysis based on K-means; and
[0089] Step S203: construct an LSTM prediction model based on deep learning to predict the short-term passenger flow of subway stations.
[0090] As an optional embodiment, combining Figure 3 , 4 As shown, in step S201, the original passenger flow data is acquired and preprocessed, including the acquisition and preprocessing of the grid area passenger flow data and the subway station passenger flow data, specifically including:
[0091] Step S2011, grid area passenger flow data acquisition and data processing;
[0092] Step S2012, subway station passenger flow data acquisition and data processing; and
[0093] Step S2013: normalize passenger flow data.
[0094] As an optional embodiment, in step S2011, the grid area human flow data acquisition and data processing include:
[0095] First, the entire city is divided into grids, and the total area within the administrative division is about 6587km 2 , using 250m grids (i.e. square grids with a side length of 250m) to divide the entire domain, we can get about 164675 grids;
[0096] Then, we combined spatiotemporal big data technology to analyze the longitude and latitude of each subway exit, and divided the corresponding grid according to the longitude and latitude information of each exit; then for each grid, we summarized the base stations and POIs it contained; and based on the number of base station users contained in the grid and the POI gathering point information in the grid, we summarized the total passenger flow data of the grid area.
[0097] As an optional embodiment, since the value density of mobile phone signaling data is low, in order to reduce errors, reduce redundancy and improve the accuracy of results, the mobile phone signaling data can be further pre-processed by abnormal incomplete data processing, duplicate data processing, ping-pong data processing and drift data processing, which can be achieved based on the pre-processing methods of the prior art.
[0098] As an optional implementation mode, the total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI gathering point information in the grid, including:
[0099] Using the mobile phone signaling data of the base stations in the grid area, the number of users connected to the base station within a preset time step is counted, and the number of users of all base stations is summarized as the number of base station users;
[0100] According to the types of different POIs and historical passenger flow data, a weight value is assigned to each POI, and the passenger flow data of the POI within a preset time step is calculated according to the POI weight value in the grid area as the POI passenger flow;
[0101] The number of base station users and POI passenger flow are aggregated to obtain the total passenger flow data in the grid area.
[0102] It should be understood that in the embodiment of the present invention, the preset time step is set to 15 minutes.
[0103] In the embodiments of the present invention, POI refers to a point of interest, that is, a geographical coordinate point. A POI can be a community, a shopping mall or a store, etc. Figure 6 In the example shown, a specific type of POI combination can support a specific urban functional area, such as a large shopping area where various types of clothing, bags, shoes and catering POIs are clustered and co-occurring. By associating base station information with POI information, the flow of people in the grid area can be counted, thereby making more accurate passenger flow predictions.
[0104] Base station refers to a mobile communication base station, which is the interface and medium for mobile terminals to access the Internet. Base stations provide wireless network coverage and transmission for users when using mobile terminals, realize wireless signal transmission between communication networks and mobile terminals, and generate mobile signaling data when mobile terminals interact with their base stations. Mobile signaling is the communication data between mobile phone users and transmitting base stations or micro stations. After the mobile phone establishes a connection with the base station, all communication behaviors such as making and receiving calls, sending and receiving text messages, and browsing the Internet will have a communication relationship with the base station near the mobile phone. Since the location of the communication base station is fixed and known, the location information of the base station reflects the location of the user. Therefore, the mobile signaling data field always contains information such as time and location. Regardless of the type of mobile signaling data, the basic format of the original data of the mobile signaling data usually includes fixed fields such as the International Mobile Subscriber Identity (IMSI) number, timestamp, location area number, time type, etc. Therefore, through the analysis of mobile signaling data, it can be used to realize statistical analysis of population and work in a specific area, job-residence OD analysis, spatiotemporal analysis of urban population, urban transportation OD analysis, travel mode analysis, user portrait analysis and other applications.
[0105] Spatiotemporal big data refers to big data that is directly or indirectly related to time, space and location based on unified spatiotemporal benchmark activities. Through multi-dimensional data fusion, correlation analysis and data mining, it reveals the essential laws of things and makes faster, more comprehensive, more accurate and more effective judgments and predictions on things. It has the comprehensive characteristics of multi-source, massive and fast updating.
[0106] As an optional embodiment, in step S2012, the subway station passenger flow data acquisition and data processing include:
[0107] First, the station passenger flow data is collected by the subway automatic fare collection system (AFC) according to a preset time step, for example, according to a 15-min time period. The obtained station passenger flow data includes passenger arrival time, station entry name, station exit time, station exit name and other information;
[0108] Then, the raw data collected by AFC is screened and preprocessed to remove null values, missing values, and abnormal data that do not meet the standard dates to improve data quality.
[0109] As an optional embodiment, in step S2013, the passenger flow data is normalized, including:
[0110] Since the various attributes of the acquired passenger flow data and site passenger flow data have different dimensional standards, which will affect the training and accuracy of the subsequent prediction model, in this step, the values of each attribute are constrained to a same value range.
[0111] In this embodiment, max-min linear normalization is used to constrain the data within the range of [0, 1]. After the normalization, each attribute of the data has the same order of magnitude, avoiding the phenomenon that data with a large order of magnitude has a large weight, which can improve accuracy.
[0112] Among them, the formula of the max-min linear normalization method is as follows:
[0113]
[0114] Among them, x is the original attribute value, y is the normalized attribute value, and x max is the maximum value of the original attribute, x min The minimum value of the original attribute.
[0115] As an optional embodiment, in step S202, a cluster analysis based on K-means is performed.
[0116] The traffic passenger flow data of a target station from June 1 to August 31 is used, with a sample time interval of 15 minutes, totaling 8832 time points. Therefore, the data has the characteristics of high dimension and single attribute, and the high-dimensional data needs to be reduced in dimension.
[0117] First, the traffic passenger flow data is segmented into samples according to the length of a day. The start and end time of each sample is 00:00-23:55, and the sample time interval is 15 minutes, totaling 96 time points;
[0118] Then, each time point is taken as a feature, and multi-feature sample clustering is realized through K-means clustering, and 2, 3, 4, and 5 clusters are taken for clustering respectively.
[0119] The clustering results are as follows Figure 7 As shown in the figure, the horizontal axis represents time and the vertical axis represents the traffic flow value. It can be seen from the figure that the passenger flow in different clustering results has a similar change law, and there is only a difference in the value. Compared with Figure (a), the newly added traffic passenger flow in other clustering results is like the overall upward or downward movement of the two traffic passenger flow values in Figure (a). Therefore, in the embodiment of the present invention, it is most reasonable to take K as 2, and for this reason, the passenger flow is divided into two categories, namely working days and non-working days.
[0120] like Figure 8As shown, there are two types of traffic passenger flow categories with different change trends and obvious characteristics in the figure. Category 2 has morning and evening peaks, where the morning peak occurs between 7 and 9 o'clock, and the evening peak is between 16 and 18 o'clock. This also reflects that the passenger flow is affected by the travel rules of residents, while category 1 is the opposite. The median of the traffic passenger flow of category 1 in the right middle of the figure is significantly smaller than that of category 2, that is, the overall passenger flow is smaller than that of category 2. It can be seen that the passenger flow on non-working days is smaller than that on working days, and the binary classification results of the present invention are consistent with actual traffic travel. Therefore, the passenger flow is divided into two categories by the K-means algorithm, and it is verified that the two categories correspond to the passenger flow on non-working days and working days, respectively. At the same time, it is found that there is a big difference between the two, so the present invention trains the prediction model separately under two different situations to predict the short-term passenger flow data under two different categories to improve the prediction accuracy.
[0121] As an optional embodiment, in step S203, a LSTM prediction model based on deep learning is constructed.
[0122] The prediction model that only considers the time correlation of traffic flow only uses the historical data of the target station itself to predict the traffic passenger flow at the next moment, and the model prediction accuracy is low.
[0123] In the embodiment of the present invention, considering that the traffic passenger flow also has spatial correlation, the spatial correlation relationship between the target site and the upstream and downstream sites is used, so that the prediction model can not only learn the traffic passenger flow change characteristics of the target site itself, but also learn the traffic passenger flow change characteristics of the upstream and downstream sites through weighting of the local correlation coefficient. Combined with the LSTM model (Long Short-Term Memory, referred to as LSTM), it belongs to the category of deep learning methods and is a special recurrent neural network (RNN) that can effectively capture long-term dependencies in the sequence. By effectively training the model to learn the spatial correlation between the site and the site and the upstream and downstream sites, high-precision prediction results are obtained to achieve time series prediction.
[0124] In an embodiment of the present invention, we studied the impact of global correlation coefficients and local correlation coefficients on the passenger flow characteristics and spatial distribution of subway stations in the region, the correlation and change patterns between stations in time and space, so that the data of stations with higher correlation that contribute more to the final prediction results can be reflected, thereby improving the reliability of the data and enhancing the temporal and spatial sensitivity of the model; the weighted passenger flow data can better reflect the passenger flow distribution between actual stations, and the model can learn more accurate passenger flow patterns during training, thereby improving the accuracy and precision of the prediction; at the same time, the weighted local correlation coefficient can help the model better adapt to changes and abnormal situations in the local area, such as passenger flow fluctuations in emergencies or special time periods, making the model more robust when facing data from different regions and time periods, and thus performing more stably on different test sets.
[0125] In the embodiment of the present invention, the global correlation coefficient refers to the correlation coefficient of two time series at each moment. For example, when calculating the global correlation coefficient between two adjacent site time series X1 and X2, the values of the entire time period of the two time series are used to participate in the calculation, where the adjacent site time series X1 and X2 are respectively expressed as:
[0126] X1=[x1(1),x1(2),x1(t)], X2=[x2(1),x2(2),x2(t)].
[0127] The local correlation coefficient refers to the correlation coefficient between two time series at all times. For example, the local correlation coefficient of two adjacent sites is calculated, that is, the local correlation coefficient between the time series X1 and X2 corresponding to the two sites is calculated. The adjacent site time series X1 and X2 are expressed as:
[0128] X1=[x1(1),x1(2),x1(t)], X2=[x2(1),x2(2),x2(t)].
[0129] The local correlation coefficient between the time series X1 and X2 corresponding to the two stations is the correlation coefficient between the sequences [x1(1)x1(2)…x1(m)], [x2(1)x2(2)…x2(m)], where m is the length of the sliding window. To calculate the correlation of the two time series at each moment, the step size in this embodiment is 1. Therefore, with a sliding window of m and a step size of 1, the process is repeated in the entire time series until the sliding window covers all moments.
[0130] In this example, we take a target site p3 and its four adjacent sites p1, p2, p4, and p5, and calculate the global correlation coefficients between p1, p2, p4, p5 and p3, respectively, as follows: Fig. 9 shown.
[0131] Since local correlation cannot finely divide the relationship between upstream and downstream sites and target sites at all times of the day, Fig.10 The correlation coefficient weight changes between p1, p2, p4, p5 and the target site p3 at each time of the day are shown in the figure. The correlation coefficient weights of each site show different change patterns at different times of the day. And the correlation coefficient weights of each site may also be different at the same time. Therefore, in the embodiment of the present invention, the use of local correlation coefficient weights can more finely quantify the spatial correlation between each site compared to the correlation coefficient.
[0132] Combination Figure 5 As shown, in step S203, a LSTM prediction model based on deep learning is constructed, including the following steps:
[0133] Step S2031: weighting the passenger flow data of the subway station using the local correlation coefficient to obtain weighted passenger flow data;
[0134] Among them, according to the classified passenger flow data (i.e., the station flow data on working days and non-working days), weighted based on the local correlation coefficient, the weighted passenger flow data of the classified data on working days and non-working days is obtained, and the weighted passenger flow data is divided into a training set and a test set. In this example, the training set and the test set are divided according to the principle of 80% and 20%.
[0135] Step S2032: Use the training sets of two types of weighted passenger flow data to input LSTM training respectively, train the prediction model respectively under two different situations, predict the short-term passenger flow data under two different categories, and improve the prediction accuracy.
[0136] In this example, the training sets of two types of weighted passenger flow data are respectively input into LSTM training, and the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal correlation are respectively trained to predict the short-term traffic passenger flow on weekdays and non-working days, respectively. The test sets of the two types of weighted passenger flow data are used to test and optimize the model to obtain the final LSTM short-term traffic flow prediction model, whose input is the weighted passenger flow data and output is the predicted passenger flow of the preset time step, thereby realizing the output of subway short-term passenger flow prediction.
[0137] Using the trained LSTM prediction model, the input is the weighted passenger flow data X i,weight (t), the output is the predicted passenger flow with a time step of Δt
[0138] As an optional embodiment, the LSTM prediction model obtained through training is evaluated based on three evaluation indicators: mean absolute error, root mean square error, and mean absolute percentage error to evaluate the accuracy of the prediction results.
[0139] Among them, X i (t+Δt) represents the actual passenger flow value of the i-th station at a certain moment, It represents the passenger flow prediction value output by the model at the same time of the i-th station, and the length of the passenger flow time series to be evaluated. The lower the three evaluation indicators are, the better the prediction results are.
[0140] Mean absolute error: It is the sum of the absolute values of the difference between the actual passenger flow and the predicted passenger flow, divided by the length of the passenger flow time series to be evaluated. The absolute value of the error between the actual and the predicted is taken, thus avoiding the cancellation of positive and negative values when calculating the sum of errors, which can better reflect the accuracy of the prediction results;
[0141]
[0142] Root mean square error: It is the square root of the sum of the squares of the difference between the actual passenger flow and the predicted passenger flow divided by the length of the sequence to be evaluated;
[0143]
[0144] The mean absolute percentage error is the absolute value of the ratio of the difference between the actual value and the predicted value to the actual value divided by the length of the sequence to be evaluated;
[0145]
[0146] like Fig.11 As shown in the figure, the change process of the model loss function on working days and non-working days is shown, the horizontal axis is the number of iterations, and the vertical axis is the model loss function, that is, the mean square error. Among them, the training loss and the validation loss both show a rapid downward trend and eventually stabilize, which indicates that the model is well fitted and there is no overfitting or underfitting.
[0147] like Fig.12 , 13 As shown in the figure, the comparison diagram of the predicted value and the true value of the spatiotemporal correlation LSTM model on working days and non-working days is respectively shown. The horizontal axis is the time interval (every 15 minutes), and the vertical axis is the traffic passenger flow value. The red solid line is the true value of the traffic passenger flow, and the blue is the predicted value of the spatiotemporal correlation LSTM model. Combined with the accompanying drawings, no matter which category (working day model or non-working day model), the spatiotemporal correlation LSTM model proposed in the present invention can capture the overall change trend of traffic passenger flow.
[0148] The following Tables 1 and 2 are the feedback results of the spatiotemporal correlation LSTM model for working days and non-working days through the three evaluation indicators of mean absolute error, root mean square error, and mean absolute percentage error. It can be seen that the working day prediction model and the non-working day prediction model proposed in the present invention show very good prediction accuracy.
[0149] Table 1 - Model prediction accuracy on weekdays
[0150]
[0151] Table 2 - Model prediction accuracy on non-working days
[0152]
[0153] {Example 3}
[0154] According to a second aspect of the present invention, a computer system is further provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the aforementioned method when executing the computer program.
[0155] {Example 4}
[0156] According to a third aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the aforementioned method are implemented.
[0157] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.
Claims
1. A short-term passenger flow prediction method based on spatiotemporal big data, characterized in that: The following steps are involved: Step 1: Divide the grids within the region according to the administrative divisions and determine the grids within the entire region; Step 2: According to the grids in the entire area and the subway exit information, determine the grid corresponding to the exit, and determine the total passenger flow data of the grid area based on the POI passenger flow and the number of base station users in the grid area; Step 3: Obtain the passenger flow data of the subway station according to the settlement data of the subway automatic fare collection system in the grid area; Step 4: normalize the total passenger flow data of the grid area and the passenger flow data of the subway station; Step 5: Cluster and reduce the dimension of the normalized passenger flow data according to the clustering algorithm to classify the passenger flow data; Step 6: According to the classified passenger flow data, weighted based on the local correlation coefficient, obtain the weighted passenger flow data of the classified data on working days and non-working days, and divide the weighted passenger flow data into a training set and a test set; Step 7: Input the training sets of the two types of weighted passenger flow data into LSTM training respectively, and train to obtain the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal association, which are used to predict short-term traffic passenger flow on weekdays and non-working days respectively. Use the test sets of the two types of weighted passenger flow data to test and optimize the model to obtain the final LSTM short-term traffic flow prediction model, whose input is the weighted passenger flow data and output is the predicted passenger flow of the preset time step, so as to realize the output of subway short-term passenger flow prediction.
2. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 2, the grid corresponding to the exit is determined according to the grids in the entire area and the subway exit information, and the total passenger flow data of the grid area is determined based on the POI passenger flow and the number of base station users in the grid area, including: According to the latitude and longitude information of each subway exit, the corresponding grid is divided; For each grid, summarize the base stations and POIs it contains; The total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI gathering point information in the grid.
3. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 2 is characterized in that: In step 2, the total passenger flow data of the grid area is obtained by summarizing the number of base station users contained in the grid and the POI gathering point information in the grid, including: Using the mobile phone signaling data of the base stations in the grid area, the number of users connected to the base station within a preset time step is counted, and the number of users of all base stations is summarized as the number of base station users; According to the types of different POIs and historical passenger flow data, a weight value is assigned to each POI, and the passenger flow data of the POI within a preset time step is calculated according to the POI weight value in the grid area as the POI passenger flow; The number of base station users and POI passenger flow are aggregated to obtain the total passenger flow data in the grid area.
4. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 3, obtaining the subway station passenger flow data according to the settlement data of the subway automatic fare collection system in the grid area includes: Based on the settlement data of the subway automatic fare collection system, the station passenger flow data is collected according to the preset time step, including passenger arrival time, entry station name, exit time, and exit station name information.
5. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 4, the total passenger flow data of the grid area and the passenger flow data of the subway station are normalized, including: The max-min linear normalization method is used to constrain the total passenger flow data of the grid area and the subway station passenger flow data to the range of [0,1], so that each attribute of the data has the same order of magnitude.
6. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 5, clustering and dimensionality reduction are performed on the normalized passenger flow data according to a clustering algorithm to classify the passenger flow data, including: Based on the K-means clustering algorithm, the normalized passenger flow data is clustered and reduced in dimension, and classified into two types of passenger flow data: working day and non-working day.
7. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 6, according to the classified passenger flow data, weighted passenger flow data of the classified data on working days and non-working days is obtained based on the local correlation coefficient weighting, including: First, the local correlation coefficients between the adjacent sites and the target site at all times of the day are calculated; Then, the calculated local correlation coefficient is normalized to obtain the local correlation coefficient weight; Finally, the passenger flow data of each target station is weighted using the local correlation coefficient weight to obtain the weighted passenger flow data of the spatial correlation between the stations, which quantitatively represents the spatial correlation between the stations.
8. The short-term passenger flow prediction method based on spatiotemporal big data according to claim 1 is characterized in that: In step 7, the training sets of the two types of weighted passenger flow data are respectively input into LSTM training, and the first LSTM prediction model and the second LSTM prediction model based on spatiotemporal association are respectively trained to predict the short-term traffic passenger flow on working days and non-working days, respectively. The model is tested and optimized using the test sets of the two types of weighted passenger flow data to obtain the final LSTM short-term traffic flow prediction model, which also includes a comprehensive evaluation of the final LSTM short-term traffic flow prediction model, using the three evaluation indicators of mean absolute error, root mean square error, and mean absolute percentage error as the evaluation basis.
9. A computer system, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
