Online car-hailing demand multi-step prediction method and system based on space-time deep convolutional network
Through the method based on the space-time deep convolutional network, a multi-step prediction model for online car-hailing demand is built, which solves the problem of inaccurate prediction of online car-hailing demand, achieves higher-precision multi-step prediction, and enhances the modeling ability of cross-regional changes.
Patent Information
- Application Number
- CN202510539056.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The existing technology has insufficient assumptions of travel demand continuity in online ride-hailing demand forecasting, which is difficult to effectively deal with the instability of cross-regional demand, resulting in low multi-step prediction performance.
Using a method based on a space-time deep convolution network, a space-time-related online car-hailing traffic matrix is formed through grid division, and combined with the context time correlation module, the space-time cross attention mechanism module and the space-time fusion module, the time-time and space-time fusion module, the time-time and space-time correlation characteristics of the online car-hailing needs are learned to build a multi-step prediction model.
It improves the accuracy and multi-step prediction performance of online ride-hailing demand prediction, enhances the modeling ability of cross-regional changes, and improves the accuracy and robustness of prediction.
Smart Images

Figure CN120450128A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of transportation information engineering technology, and in particular to a multi-step prediction method and system for online car-hailing demand based on a spatiotemporal deep convolutional network. Background Art
[0002] Intelligent transportation is an important direction of modern urban development. Its core goal is to optimize the transportation system and improve travel efficiency through technologies such as big data, artificial intelligence and the Internet of Things.
[0003] As a crucial component of intelligent transportation, demand forecasting for online ride-hailing services plays a key role in improving vehicle dispatch efficiency, reducing passenger wait times, and balancing supply and demand. The core of online ride-hailing demand forecasting lies in accurately understanding user travel patterns, thereby providing more precise service for passengers and more reasonable order recommendations for drivers. It also assists traffic management departments in fine-tuning traffic regulations. Highly accurate demand forecasting not only optimizes vehicle dispatching and route planning, but also reduces system operating costs and improves overall traffic efficiency.
[0004] Because ride-hailing demand is highly spatiotemporally correlated, existing methods primarily employ temporal and spatial correlation models to model the connections between different regions, using historical travel data for forecasting. However, these methods often assume strong temporal or spatial continuity in demand and fail to effectively address the volatility of cross-regional demand. Despite significant advances in methods and technologies, these studies still struggle to address the issue of inaccurate continuous forecasts of ride-hailing demand, and multi-step forecasting performance needs to be improved. Summary of the Invention
[0005] The present invention provides a multi-step prediction method and system for online ride-hailing demand based on a spatiotemporal deep convolutional network, which is used to solve the defects of inaccurate online ride-hailing travel demand prediction and low multi-step prediction performance in related technologies. The solution of this application improves the accuracy of online ride-hailing demand prediction by using historical data to analyze the complex dependency relationships of online ride-hailing.
[0006] The present invention provides a multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network, comprising:
[0007] Determine a study area and obtain an online ride-hailing dataset, partitioning the dataset into 5-minute time steps; divide the study area into grids; and calculate the demand for online ride-hailing vehicles in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0008] A multi-step prediction model for online ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the start of an order as the prediction target to complete model training and testing. The model includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0009] The online car-hailing dataset and the online car-hailing traffic matrix are input into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0010] According to the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the present invention, the demand for online ride-hailing in each grid area is counted with a time step of 5 minutes to form a spatiotemporal related online ride-hailing flow matrix, including:
[0011] After the study area is grid-divided, the demand for online ride-hailing services at time intervals t in the nth grid is defined as Define X as the demand spatiotemporal feature matrix, X∈R N×T , define R as a set of real numbers, define N as the total number of regions, define T as the length of the historical time series, and define is the demand of all regions in the t-th time step; the time-space related online car-hailing flow matrix is X f =[X t+1 ,X t+2 ,...,X t+m ];
[0012] Among them, X f The multi-step forecast for online car-hailing demand is to predict the demand of all regions in the next m time steps, X f ∈R N×m , where m is a positive integer.
[0013] According to the multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network provided by the present invention, the multi-step prediction model for online car-hailing demand based on the spatiotemporal deep convolutional network is constructed, comprising:
[0014] Use the contextual temporal association module to learn the contextual temporal association characteristics of online ride-hailing demands;
[0015] Use the spatiotemporal cross attention mechanism module to learn its spatiotemporal correlation characteristics;
[0016] Using the spatiotemporal fusion module, we can comprehensively learn the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0017] The training and testing process of the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network is carried out to obtain the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network.
[0018] According to the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the present invention, the contextual time association module is used to learn the contextual temporal association characteristics of online ride-hailing demand, including:
[0019] The association rules between the multi-step predictions are specified to conform to the following formula (1):
[0020]
[0021] During the prediction process, correlation is used to adjust the prediction results. When the correlation is high, the confidence is high, which conforms to the following formula (2):
[0022] Confidence t→t+1 =|Cor t,t+1 | (2)
[0023] The demand forecast using the confidence level is in accordance with the following formula (3):
[0024]
[0025] Among them, Cor t,t+1 is the correlation between time step t and time step t+1; D t represents the demand for online ride-hailing at time step t; Cov(D t ,D t+1 ) is D t and D t+1 Covariance of σD t and σD t+1 D t and D t+1 Standard deviation of t→t+1 is the confidence level; D Trend is the preliminary estimated demand; k is the k-th step forecast; α and β are the dynamically adjusted weights.
[0026] According to the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the present invention, the contextual time association module is also used to simultaneously consider the spatial encoding information of each position in the online ride-hailing demand sequence, which conforms to the following formula:
[0027]
[0028] in, represents the forward input demand matrix; Represents the output of the forward Transformer; represents the inverse input demand matrix; Represents the output of the inverse Transformer, Output represents the spatial encoding information;
[0029] The context time association module is further configured to fuse the context temporal association information and the spatial coding information in a splicing manner, thereby forming a spatiotemporal fusion feature.
[0030] According to the multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network provided by the present invention, the spatiotemporal cross attention mechanism module includes a temporal cross attention module and a spatial cross attention module;
[0031] The source data of the spatial cross attention module is the fused spatiotemporal demand feature, the target data is the spatial feature, and the input spatiotemporal fusion feature is E st , the spatial feature is E f , perform three linear transformations on the input features to generate query Q st , K f Key and V f Vector representation of values;
[0032] The model can automatically focus on the spatial areas with a high correlation with future demand forecasts in accordance with the following formula (7):
[0033]
[0034] Among them, d k is the dimension of the query or key vector, Represents the scaling factor.
[0035] According to the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the present invention, the spatiotemporal fusion module is used to comprehensively learn the correlation pattern of online ride-hailing demand in the spatiotemporal and continuous time dimensions, including:
[0036] The spatiotemporal fusion module outputs the temporal features H through the temporal decoder and spatial decoder respectively. t and spatial characteristics H s , achieving deep interaction between temporal and spatial features;
[0037] On the basis of temporal features and spatial features, temporal features and spatial features are fused through linear transformation, which conforms to the following formula (8):
[0038] H f =W t H t +Ws H s (8)
[0039] Among them, W t and W s is a learnable weight matrix.
[0040] According to the multi-step prediction method for online ride-hailing demand based on spatiotemporal deep convolutional network provided by the present invention, the example verification of the multi-step spatiotemporal demand prediction for online ride-hailing includes:
[0041] Inputting the online car-hailing traffic matrix into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform multi-step spatiotemporal demand prediction for online car-hailing;
[0042] The online car-hailing data set is input into the multi-step online car-hailing demand prediction model based on the spatiotemporal deep convolutional network, and the performance of the multi-step online car-hailing demand prediction method and the multi-step online car-hailing demand prediction model are verified through multiple groups of comparison and ablation experiments.
[0043] The present invention also provides a multi-step prediction system for online car-hailing demand based on a spatiotemporal deep convolutional network, comprising:
[0044] A data acquisition module is used to determine the study area and obtain an online ride-hailing dataset, partitioning the dataset into 5-minute time steps; dividing the study area using a grid partitioning method; and calculating the demand for online ride-hailing in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0045] A model construction module is used to construct a multi-step prediction model for online ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for online ride-hailing demand uses the starting demand of an order as the prediction target to complete model training and testing. The multi-step prediction model for online ride-hailing demand includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0046] An instance verification module is used to input the online car-hailing data set into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform instance verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0047] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, it implements any of the above-mentioned multi-step prediction methods for online car-hailing demand based on a spatiotemporal deep convolutional network.
[0048] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements any of the above-mentioned multi-step prediction methods for online car-hailing demand based on a spatiotemporal deep convolutional network.
[0049] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned multi-step prediction methods for online car-hailing demand based on a spatiotemporal deep convolutional network.
[0050] In the multi-step prediction method for online car-hailing demand based on the spatiotemporal deep convolutional network provided by the present invention, a multi-step prediction model can be constructed based on the spatiotemporal deep convolutional network. The model can learn the contextual time correlation information of online car-hailing demand, and further enhance the modeling ability of cross-regional changes in online car-hailing demand through the spatiotemporal cross-attention mechanism, thereby improving the performance of the constructed multi-step prediction model. The data processed by the multi-step prediction model are the online car-hailing data set and the online car-hailing traffic matrix, wherein the online car-hailing data set can be divided into a time step of 5 minutes, thereby realizing the time division of the online car-hailing demand. The online car-hailing traffic matrix is obtained by counting the online car-hailing demand for each grid in the study area, thereby realizing the spatial division of the online car-hailing demand. That is to say, the scheme of the present application realizes the spatiotemporal division from the input data, and then combines the multi-step prediction model for online car-hailing demand constructed based on the spatiotemporal deep convolutional network to further enhance the spatiotemporal correlation of the online car-hailing demand prediction and effectively improve the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 Schematic diagram of a multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by an embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of the overall model of the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by an embodiment of the present invention;
[0054] Figure 3 Schematic diagram of a context-dependent time association module of a multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by an embodiment of the present invention;
[0055] Figure 4Schematic diagram of the structure of a multi-step prediction system for online car-hailing demand based on a spatiotemporal deep convolutional network provided by an embodiment of the present invention;
[0056] Figure 5 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0058] Figure 1 This is a flow chart of a multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network provided in an embodiment of the present invention.
[0059] like Figure 1 As shown, this embodiment provides a multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network, including:
[0060] Step 101: Determine a study area and obtain an online ride-hailing dataset, partition the dataset into 5-minute time steps, and use a grid partitioning method to partition the study area. Count the demand for online ride-hailing vehicles in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0061] In practical applications, a ride-hailing dataset can be trajectory data for ride-hailing vehicles. For a segment of trajectory data, the transition from loaded to empty and then back to loaded can be defined as two ride-hailing requests. This approach can be used to calculate the demand for ride-hailing vehicles every 5 minutes. When the number of passengers in a vehicle changes from 1 to greater than 1, it indicates a passenger boarding point and is counted as a demand for ride-hailing vehicles. The passenger boarding point is the source of demand for ride-hailing vehicles; that is, passengers need to board a vehicle at a certain location to travel, representing the point where demand arises. Therefore, using the passenger boarding point as the demand point is the most direct way to represent demand for ride-hailing vehicles. After data processing, the acquired ride-hailing dataset is partitioned into 5-minute time steps and the corresponding demand is counted. 288 time steps are created within a day, and the data from different time periods are grouped from 1 to 288. Next, a grid partitioning method can be used to divide the study area, using a grid size of 1 km x 1 km. Each grid cell represents a study area, allowing for the 5-minute statistics of the demand for ride-hailing vehicles in a specific city within each study area.
[0062] Step 102: Construct a multi-step prediction model for online ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for online ride-hailing demand uses the demand at the start of an order as the prediction target, and completes model training and testing. The multi-step prediction model for online ride-hailing demand includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0063] Figure 2 This is a schematic diagram of the overall model of the multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network provided by an embodiment of the present invention.
[0064] Figure 3 It is a schematic diagram of the contextual time association module of the multi-step prediction method for online car-hailing demand based on the spatiotemporal deep convolutional network provided by an embodiment of the present invention.
[0065] like Figure 2 As shown, the multi-step prediction model for online car-hailing demand provided by this embodiment can perform time self-encoding and space self-encoding on the input data to enhance the model's ability to understand time and space features. After the time-encoded data is processed by the context time association mechanism, the time features and space features are input into the fusion module to obtain time and space fusion features. The time-space cross-attention mechanism includes a time cross-attention module and a space cross-attention module. In the time cross-attention module and the space cross-attention module, the weights of the time-space fusion features and their time features and space features are calculated respectively, so that the model can automatically focus on time and space areas with a high correlation with future demand forecasts. Feature extraction is performed in the time and space dimensions respectively through time decoding and space decoding.
[0066] Further, such as Figure 3 As shown in the figure, in the contextual time association mechanism of the multi-step prediction model for online car-hailing demand, the input data can be temporally encoded, relatively positioned, and embedded in association rules, and then the information is input into the forward transformer, and then enters the reverse transformer for contextual semantic association, and then output.
[0067] Step 103: Input the online car-hailing data set and the online car-hailing traffic matrix into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0068] In the multi-step prediction method for online car-hailing demand based on the spatiotemporal deep convolutional network provided in this embodiment, a multi-step prediction model can be constructed based on the spatiotemporal deep convolutional network. The model can learn the contextual time correlation information of online car-hailing demand, and further enhance the modeling ability of cross-regional changes in online car-hailing demand through the spatiotemporal cross-attention mechanism, thereby improving the performance of the constructed multi-step prediction model. The data processed by the multi-step prediction model are the online car-hailing dataset and the online car-hailing traffic matrix, wherein the online car-hailing dataset can be divided into a time step of 5 minutes, thereby realizing the time division of the online car-hailing demand. The online car-hailing traffic matrix is obtained by counting the online car-hailing demand for each grid in the study area, thereby realizing the spatial division of the online car-hailing demand. That is to say, the scheme of this application realizes the spatiotemporal division from the input data, and then combines the multi-step prediction model for online car-hailing demand constructed based on the spatiotemporal deep convolutional network to further enhance the spatiotemporal correlation of the online car-hailing demand prediction and effectively improve the prediction accuracy.
[0069] In an exemplary embodiment, the demand for online ride-hailing vehicles in each grid area is counted with a time step of 5 minutes to form a spatiotemporal related online ride-hailing vehicle flow matrix, including:
[0070] After the study area is grid-divided, the demand for online ride-hailing services at time intervals t in the nth grid is defined as Define X as the demand spatiotemporal feature matrix, X∈R N×T , define R as a set of real numbers, define N as the total number of regions, define T as the length of the historical time series, and define is the demand of all regions in the t-th time step; the time-space related online car-hailing flow matrix is X f =[X t+1 ,X t+2 ,...,X t+m ];
[0071] Among them, X f The multi-step forecast for online car-hailing demand is to predict the demand of all regions in the next m time steps, X f ∈R N×m , where m is a positive integer.
[0072] In an exemplary embodiment, the multi-step prediction model for online ride-hailing demand based on a spatiotemporal deep convolutional network is constructed, including:
[0073] Use the contextual temporal association module to learn the contextual temporal association characteristics of online ride-hailing demands;
[0074] Use the spatiotemporal cross attention mechanism module to learn its spatiotemporal correlation characteristics;
[0075] Using the spatiotemporal fusion module, we can comprehensively learn the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0076] The training and testing process of the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network is carried out to obtain the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network.
[0077] In an exemplary embodiment, the use of a contextual time association module to learn the contextual temporal association characteristics of online ride-hailing demands includes:
[0078] The association rules between the multi-step predictions are specified to conform to the following formula (1):
[0079]
[0080] During the prediction process, correlation is used to adjust the prediction results. When the correlation is high, the confidence is high, which conforms to the following formula (2):
[0081] Confidence t→t+1 =|Cor t,t+1 | (2)
[0082] The demand forecast using the confidence level is in accordance with the following formula (3):
[0083]
[0084] Among them, Cor t,t+1 is the correlation between time step t and time step t+1; D t represents the demand for online ride-hailing at time step t; Cov(D t ,D t+1 ) is D t and D t+1 Covariance of σD t and σD t+1 D t and D t+1 Standard deviation of t→t+1 is the confidence level; D Trend is the preliminary estimated demand; k is the k-th step forecast; α and β are the dynamically adjusted weights.
[0085] In an exemplary embodiment, the contextual time association module is further configured to simultaneously consider the spatial encoding information of each position in the online car-hailing demand sequence, in accordance with the following formula:
[0086]
[0087] in, represents the forward input demand matrix; Represents the output of the forward Transformer; represents the inverse input demand matrix; Represents the output of the inverse Transformer, Output represents the spatial encoding information;
[0088] The context time association module is further configured to fuse the context temporal association information and the spatial coding information in a splicing manner, thereby forming a spatiotemporal fusion feature.
[0089] In an exemplary embodiment, the spatiotemporal cross attention mechanism module includes a temporal cross attention module and a spatial cross attention module;
[0090] The source data of the spatial cross attention module is the fused spatiotemporal demand feature, the target data is the spatial feature, and the input spatiotemporal fusion feature is E st , the spatial feature is E f , perform three linear transformations on the input features to generate query Q st , K f Key and V f Vector representation of values;
[0091] The model can automatically focus on the spatial areas with a high correlation with future demand forecasts in accordance with the following formula (7):
[0092]
[0093] Among them, d k is the dimension of the query or key vector, Represents the scaling factor.
[0094] In an exemplary embodiment, the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions, including:
[0095] The spatiotemporal fusion module outputs the temporal features H through the temporal decoder and spatial decoder respectively. t and spatial characteristics H s , achieving deep interaction between temporal and spatial features;
[0096] On the basis of temporal features and spatial features, temporal features and spatial features are fused through linear transformation, which conforms to the following formula (8):
[0097] H f =W t H t +W s H s (8)
[0098] Among them, W t and W sis a learnable weight matrix.
[0099] In an exemplary embodiment, the example verification of performing multi-step spatiotemporal demand forecasting for online ride-hailing services includes:
[0100] Inputting the online car-hailing traffic matrix into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform multi-step spatiotemporal demand prediction for online car-hailing;
[0101] The online car-hailing data set is input into the multi-step online car-hailing demand prediction model based on the spatiotemporal deep convolutional network, and the performance of the multi-step online car-hailing demand prediction method and the multi-step online car-hailing demand prediction model are verified through multiple groups of comparison and ablation experiments.
[0102] The following is an example of a specific embodiment to illustrate the multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network provided by the solution of this application.
[0103] (1) Working environment
[0104] The model code was written using the PyTorch framework. All experimental codes were compiled and executed in a Windows software environment and run on a hardware workstation equipped with an Intel(R) Core(TM) i7-13700k CPU, an NVIDIA GeForce RTX4090 GPU, and 128GB of memory.
[0105] (2) Introduction to experimental dataset
[0106] The experimental dataset for this paper consists of 170 million ride-hailing data records from a specific city within a specific month of a specific year. After preprocessing, the available data includes the ride-hailing company ID, driver's license ID, license plate number, location time, longitude and latitude, number of people in the ride (including the driver), and upload time.
[0107] (3) Benchmark model selection
[0108] In the comparison and ablation experiments, 10 baseline models were selected to compare their performance with the proposed model on a given dataset.
[0109] Graph Convolutional Network (GCN): This network propagates information through an adjacency matrix and a node feature matrix, updating the feature representation of each node. This effectively captures the spatial relationships between nodes in the graph. It is used to process graph data and can handle time series data.
[0110] Long Short-Term Memory (LSTM): controls the storage and forgetting of information through "forget gate", "input gate" and "output gate".
[0111] Gated Recurrent Unit (GRU): uses a gating mechanism to control the flow of information and has only two gates (an update gate and a reset gate). Compared to LSTM, GRU is more concise in structure and can also process time series data.
[0112] Bidirectional Long Short-Term Memory (BiLSTM): This adds a bidirectional structure to the LSTM, enabling it to process sequence data in both forward and backward directions.
[0113] Spatio-Temporal Graph Convolutional Network (STGCN): This model combines graph convolutional networks with temporal models to model both spatial and temporal dependencies. This model is suitable for processing spatio-temporal graph data.
[0114] Transformer: Based on the self-attention mechanism, it can simultaneously capture the dependencies between positions in a sequence and perform parallel computations. It can efficiently process large-scale time series data.
[0115] GMAN (Graph Multi-Attention Network): combines the graph attention mechanism (GAT) and the temporal attention mechanism to predict data by capturing complex spatiotemporal changes.
[0116] STFGNN (Spatial-Temporal Fusion Graph Neural Network): Utilizes graph neural networks (GNNs) and temporal modeling mechanisms, while adopting a multi-scale fusion mechanism to integrate spatial and temporal information and ultimately output predicted data.
[0117] STTN (Spatio-Temporal Transformer Network): It extracts spatiotemporal features by modeling spatiotemporal dependencies through temporal and spatial self-attention mechanisms, thereby achieving spatiotemporal data prediction.
[0118] PDFormer (Prediction and Decision Transformer): combines the Transformer architecture to handle dependencies in temporal and spatial dimensions, and also combines a decision module to optimize predictions and support actual decision-making tasks.
[0119] (4) Experimental parameter setting
[0120] All models were trained with Adam as the optimizer, a learning rate of 0.001, and 100 epochs.
[0121] The GCN model uses a 2-layer GCN with a hidden layer dimension of 64 and an output layer dimension of 32, and uses the ReLU activation function.
[0122] The LSTM model uses a two-layer LSTM with 128 hidden units in each layer and uses tanh activation.
[0123] The GRU model uses a 2-layer GRU with 128 hidden units in each layer, 64 hidden units in the output layer, and Dropout 0.2.
[0124] The BiLSTM model uses a two-layer bidirectional LSTM with 128 hidden units in each layer, 64 hidden units in the output layer, and tanh activation.
[0125] The STGCN model uses 2 layers of GCN, 64 hidden layers, 32 output layers, and ReLU activation. It also uses 1 layer of temporal convolutional network (TCN) with 64 hidden layers.
[0126] The Transformer model uses a 4-layer Transformer with 8 attention heads per layer, 256 hidden layers, 1024 feedforward layers, and 128 output layers.
[0127] The GMAN model uses three layers of spatiotemporal attention, with eight attention heads per layer. The hidden layer dimension is 64, and the output layer dimension is 32.
[0128] The STFGNN model uses a 3-layer GCN with 128 hidden layers, 64 output layers, and ReLU activation. It also uses a 2-layer LSTM with 128 hidden layers and 64 output layers.
[0129] The STTN model uses a 4-layer Transformer layer, with 4 temporal attention heads and 4 spatial attention heads in each layer. It has 128 hidden layers, 512 feedforward layers, and 64 output layers.
[0130] The PDFormer model uses 4 layers of Transformer layers with 8 heads per layer, 256 hidden layers, 1024 feedforward layers, and 128 output layers.
[0131] The proposed method uses a 4-layer Transformer variant with 8 heads per layer, 256 hidden layers, 1024 feedforward layers, and 128 output layers.
[0132] (5) Selection of evaluation indicators
[0133] The prediction performance of each model is evaluated using two common metrics: Mean Absolute Error (MAE) and Root Mean Square Error (RMSE). The smaller the evaluation metric, the better the effect.
[0134] (6) Experimental results and analysis
[0135] Table 1 shows the experimental results of the demand forecasting performance comparison of various models on a certain online car-hailing dataset. Overall, the method proposed in this application achieved the best forecasting performance (see the bold data in Table 1). Compared with the baseline model PDFormer with the second best group segmentation performance, the proposed method achieved lower errors in all indicators, namely: MAE was reduced by 2.14%, and RMSE was reduced by 2.46%, which confirmed that the present invention has good demand forecasting performance. This is attributed to the fact that the method proposed in the present invention has a contextual time association module, a spatiotemporal cross attention mechanism module, and a spatiotemporal fusion module. The former can fully learn the contextual temporal correlation characteristics of online car-hailing demand with its bidirectional structure; the intermediate module can learn the spatiotemporal correlation characteristics of online car-hailing; the latter can effectively combine the spatiotemporal distribution characteristics of online car-hailing demand and comprehensively learn the correlation pattern of online car-hailing demand in the spatiotemporal and continuous time dimensions.
[0136] Table 1 Comparison results of model multi-step prediction experiments
[0137]
[0138] Table 2 shows the improvement in demand forecasting performance achieved by the proposed method's contextual temporal association module and spatiotemporal cross-attention mechanism. The first row of data in the table shows the demand forecasting performance distribution when the proposed method removes only the contextual temporal association module; the second row shows the demand forecasting performance distribution when the proposed method removes only the spatiotemporal cross-attention mechanism; and the third row shows the group segmentation performance distribution when the proposed method incorporates both modules. As shown in the table, incorporating the contextual temporal association module reduces the MAE of the proposed model by 21.57% and the RMSE by 9.52%, demonstrating that the contextual temporal association module enables the proposed model to more accurately capture complex dependencies in time series. Incorporating the spatiotemporal cross-attention mechanism module also reduces the MAE of the proposed model by 13.98% and the RMSE by 5.62%, indicating that the inclusion of this module further improves the spatiotemporal demand forecasting performance of the proposed model. This demonstrates that both the contextual temporal association module and the spatiotemporal cross-attention mechanism contribute to improved group segmentation performance.
[0139] Table 2 Ablation test results of the built-in module of the proposed method on a certain online car-hailing dataset
[0140]
[0141] Combined with the above examples, it can be determined that the spatiotemporal demand forecasting method provided by this application has at least the following beneficial effects:
[0142] 1) By modeling a multi-step forecasting method for online ride-hailing demand based on a spatiotemporal deep convolutional network, we can enhance the ability to capture complex dependencies in time series and learn the spatiotemporal correlation characteristics of online ride-hailing demand, thereby improving the accuracy and robustness of demand forecasting;
[0143] 2) Effectively serve the field of transportation information engineering, provide important theoretical reference for rationally adjusting the contradiction between transportation supply and demand, optimizing resource allocation, improving service efficiency and passenger satisfaction, and improving overall travel efficiency, and is expected to provide more refined demand forecasting solutions for urban transportation planning, transportation resource optimization, smart travel scheduling and other fields, and promote the development and progress of related fields.
[0144] The following describes the multi-step prediction system for online car-hailing demand based on the spatiotemporal deep convolutional network provided by the present invention. The multi-step prediction system for online car-hailing demand based on the spatiotemporal deep convolutional network described below and the multi-step prediction method for online car-hailing demand based on the spatiotemporal deep convolutional network described above can be referenced to each other.
[0145] Figure 4 It is a structural diagram of the multi-step prediction system for online car-hailing demand based on spatiotemporal deep convolutional network provided by an embodiment of the present invention.
[0146] like Figure 4 As shown, the multi-step prediction system for online car-hailing demand provided in this embodiment includes:
[0147] Data acquisition module 401 is used to determine a study area and obtain an online ride-hailing data set, divide the online ride-hailing data set into 5-minute time steps, divide the study area into grids, and calculate the demand for online ride-hailing in each grid area in 5-minute time steps to form a spatiotemporal online ride-hailing traffic matrix.
[0148] Model construction module 402 is used to construct a multi-step prediction model for online ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for online ride-hailing demand uses the starting demand of an order as the prediction target to complete model training and testing. The multi-step prediction model for online ride-hailing demand includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0149] The example verification module 403 is used to input the online car-hailing data set into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0150] Figure 5 An example of a physical structure diagram of an electronic device is shown below. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network, the method comprising:
[0151] Determine a study area and obtain an online ride-hailing dataset, partitioning the dataset into 5-minute time steps; divide the study area into grids; and calculate the demand for online ride-hailing vehicles in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0152] A multi-step prediction model for online ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the start of an order as the prediction target to complete model training and testing. The model includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0153] The online car-hailing dataset and the online car-hailing traffic matrix are input into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0154] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0155] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the above methods, which includes:
[0156] Determine a study area and obtain an online ride-hailing dataset, partitioning the dataset into 5-minute time steps; divide the study area into grids; and calculate the demand for online ride-hailing vehicles in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0157] A multi-step prediction model for online ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the start of an order as the prediction target to complete model training and testing. The model includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0158] The online car-hailing dataset and the online car-hailing traffic matrix are input into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0159] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the multi-step prediction method for online ride-hailing demand based on a spatiotemporal deep convolutional network provided by the above methods, the method comprising:
[0160] Determine a study area and obtain an online ride-hailing dataset, partitioning the dataset into 5-minute time steps; divide the study area into grids; and calculate the demand for online ride-hailing vehicles in each grid area using a 5-minute time step to form a spatiotemporal online ride-hailing traffic matrix.
[0161] A multi-step prediction model for online ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the start of an order as the prediction target to complete model training and testing. The model includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0162] The online car-hailing dataset and the online car-hailing traffic matrix are input into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
[0163] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. That is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0164] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or certain parts of the embodiment.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A multi-step prediction method for online ride-hailing demand based on spatiotemporal deep convolutional networks, characterized by: include: Determine the research area and obtain a ride-hailing dataset, dividing the dataset into 5-minute time steps; The research area is divided by using a grid division method; The demand for ride-hailing services in each grid area is counted with a time step of 5 minutes to form a spatiotemporal-related ride-hailing traffic matrix. A multi-step prediction model for online ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the start of an order as the prediction target to complete model training and testing. The model includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions. The online car-hailing dataset and the online car-hailing traffic matrix are input into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform an example verification of the online car-hailing multi-step spatiotemporal demand prediction.
2. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 1 is characterized in that: The demand for online ride-hailing vehicles in each grid area is counted with a time step of 5 minutes to form a time-space related online ride-hailing vehicle flow matrix, including: After the study area is grid-divided, the demand for online ride-hailing services at time intervals t in the nth grid is defined as Define X as the demand spatiotemporal feature matrix, X∈R N×T , define R as a set of real numbers, define N as the total number of regions, define T as the length of the historical time series, and define is the demand of all regions in the t-th time step; the time-space related online car-hailing flow matrix is X f =[X t+1 ,X t+2 ,...,X t+m ]; Among them, X f The multi-step forecast for online car-hailing demand is to predict the demand of all regions in the next m time steps, X f ∈R N ×m , where m is a positive integer.
3. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 1 is characterized in that: The multi-step prediction model for online ride-hailing demand based on the spatiotemporal deep convolutional network includes: Use the contextual temporal association module to learn the contextual temporal association characteristics of online ride-hailing demands; Use the spatiotemporal cross attention mechanism module to learn its spatiotemporal correlation characteristics; Using the spatiotemporal fusion module, we can comprehensively learn the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions. The training and testing process of the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network is carried out to obtain the multi-step prediction model of online car-hailing demand based on the spatiotemporal deep convolutional network.
4. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 3 is characterized in that: The context-time association module is used to learn the context-time association characteristics of online ride-hailing demand, including: The association rules between the multi-step predictions are specified to conform to the following formula (1): During the prediction process, correlation is used to adjust the prediction results. When the correlation is high, the confidence is high, which conforms to the following formula (2): Confidence t→t+1 =|Cor t,t+1 | (2) The demand forecast using the confidence level is in accordance with the following formula (3): Among them, Cor t,t+1 is the correlation between time step t and time step t+1; D t represents the demand for online ride-hailing at time step t; Cov(D t ,D t+1 ) is D t and D t+1 Covariance of σD t and σD t+1 D t and D t+1 Standard deviation of t→t+1 is the confidence level; D Trend is the preliminary estimated demand; k is the k-th step forecast; α and β are the dynamically adjusted weights.
5. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 4 is characterized in that: The contextual time association module is also used to simultaneously consider the spatial encoding information of each position in the online car-hailing demand sequence, which conforms to the following formula: in, represents the forward input demand matrix; Represents the output of the forward Transformer; represents the inverse input demand matrix; Represents the output of the inverse Transformer, Output represents the spatial encoding information; The context time association module is further configured to fuse the context temporal association information and the spatial coding information in a splicing manner, thereby forming a spatiotemporal fusion feature.
6. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 3 is characterized in that: The spatiotemporal cross attention mechanism module includes a temporal cross attention module and a spatial cross attention module; The source data of the spatial cross attention module is the fused spatiotemporal demand feature, the target data is the spatial feature, and the input spatiotemporal fusion feature is E st , the spatial feature is E f , perform three linear transformations on the input features to generate query Q st , K f Key and V f Vector representation of values; The model can automatically focus on the spatial areas with a high correlation with future demand forecasts in accordance with the following formula (7): Among them, d k is the dimension of the query or key vector, Represents the scaling factor.
7. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 3 is characterized in that: The spatiotemporal fusion module is used to comprehensively learn the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions, including: The spatiotemporal fusion module outputs the temporal features H through the temporal decoder and spatial decoder respectively. t and spatial characteristics H s , achieving deep interaction between temporal and spatial features; On the basis of temporal features and spatial features, temporal features and spatial features are fused through linear transformation, which conforms to the following formula (8): H f =W t H t +W s H s (8) Among them, W t and W s is a learnable weight matrix.
8. The multi-step prediction method for online car-hailing demand based on spatiotemporal deep convolutional network according to claim 1 is characterized in that: The example verification of the multi-step spatiotemporal demand forecast for online ride-hailing services includes: Inputting the online car-hailing traffic matrix into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform multi-step spatiotemporal demand prediction for online car-hailing; The online car-hailing data set is input into the multi-step online car-hailing demand prediction model based on the spatiotemporal deep convolutional network, and the performance of the multi-step online car-hailing demand prediction method and the multi-step online car-hailing demand prediction model are verified through multiple groups of comparison and ablation experiments.
9. A multi-step prediction system for online car-hailing demand based on spatiotemporal deep convolutional networks, characterized by: include: A data acquisition module, used to determine the research area and obtain the online ride-hailing dataset, dividing the dataset into 5-minute time steps; The research area is divided by using a grid division method; The demand for ride-hailing services in each grid area is counted with a time step of 5 minutes to form a spatiotemporal-related ride-hailing traffic matrix. A model construction module is used to construct a multi-step prediction model for online ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for online ride-hailing demand uses the starting demand of an order as the prediction target to complete model training and testing. The multi-step prediction model for online ride-hailing demand includes a contextual time association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual time association module is used to learn the temporal correlation characteristics of online ride-hailing demand, the spatiotemporal cross-attention mechanism module is used to learn the spatiotemporal correlation characteristics, and the spatiotemporal fusion module is used to comprehensively learn the correlation patterns of online ride-hailing demand in the spatiotemporal and continuous time dimensions. An instance verification module is used to input the online car-hailing data set into the online car-hailing demand multi-step prediction model based on the spatiotemporal deep convolutional network to perform instance verification of the online car-hailing multi-step spatiotemporal demand prediction.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the multi-step prediction method for online car-hailing demand based on a spatiotemporal deep convolutional network as described in any one of claims 1-8.
Citation Information
Patent Citations
Peak value sensitive travel demand prediction method based on deep learning
CN111915081A
Online car-hailing order demand prediction method based on space-time context attention network
CN112150207A
Prediction method and device of taxi-taking demand quantity and traffic flow combined prediction model
CN112819222A
Regional flow prediction-oriented spatio-temporal global semantic representation learning method
CN114493034A
A computer-implemented method for forecasting traffic indicators in a road network
WO2024068527A1