Ride-hailing demand multi-step prediction method and system based on spatiotemporal depth convolutional network
By constructing a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network, the problem of inaccurate ride-hailing demand prediction is solved, and higher-precision multi-step prediction is achieved, enhancing the ability to capture the correlation characteristics of time series and spatial regions.
Patent Information
- Application Number
- CN202510539056.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-04-27
AI Technical Summary
Existing ride-hailing demand forecasting methods have low multi-step forecasting performance and are unable to effectively cope with the instability of cross-regional demand, resulting in inaccurate forecasts.
A spatiotemporal deep convolutional network-based approach is adopted. A spatiotemporally related ride-hailing traffic matrix is formed by grid partitioning. By utilizing a contextual time correlation module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module, the temporal and spatiotemporal correlation characteristics of ride-hailing demand are learned to construct a multi-step prediction model.
It improves the accuracy and robustness of ride-hailing demand forecasting, enhances multi-step forecasting performance, and can more accurately capture complex dependencies in time series and spatial regions.
Smart Images

Figure CN120450128B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of transportation information engineering, and particularly relates to a multi-step demand prediction method and system for online car-hailing based on a spatiotemporal deep convolutional network. BACKGROUND
[0002] Intelligent transportation is an important direction of modern city development, and its core goal is to optimize the transportation system through big data, artificial intelligence and Internet of Things technologies, and to improve travel efficiency.
[0003] Online car-hailing, as an important part of intelligent transportation, plays a key role in improving vehicle scheduling efficiency, reducing passenger waiting time, balancing supply and demand, etc. The core of online car-hailing demand prediction is to accurately grasp the user travel regularity, so as to provide more accurate services for passengers, more reasonable order suggestions for drivers, and also assist traffic management departments in fine-tuning control. High-precision demand prediction can not only optimize vehicle scheduling and path planning, but also reduce system operation costs and improve overall traffic efficiency.
[0004] Due to the high spatiotemporal correlation of online car-hailing demand, existing methods mainly use time and space correlation models to model the correlation between different regions, and make predictions through historical travel data modeling. However, these methods usually assume that demand has strong continuity in time or space, and cannot effectively deal with the instability of cross-regional demand. Although the above research has made significant progress in methods and technologies, it is still difficult to solve the problem of inaccurate online car-hailing travel demand prediction, and the performance of multi-step prediction needs to be improved. SUMMARY
[0005] The present application provides a multi-step demand prediction method and system for online car-hailing based on a spatiotemporal deep convolutional network, which solves the problem of inaccurate online car-hailing travel demand prediction and low performance of multi-step prediction in related technologies. The present application uses historical data to analyze the complex dependence of online car-hailing, and improves the accuracy of online car-hailing demand prediction.
[0006] The present application provides a multi-step demand prediction method for online car-hailing based on a spatiotemporal deep convolutional network, comprising:
[0007] Determine the study area and obtain the online car-hailing dataset, divide the online car-hailing dataset with a time step of 5 minutes; divide the study area using a grid division method; count the demand of online car-hailing in each grid area with a time step of 5 minutes, and form a spatiotemporal related online car-hailing flow matrix;
[0008] The method comprises the following steps: constructing a multi-step prediction model of online car-hailing demand based on a spatio-temporal deep convolutional network, taking the demand amount of the starting point of an order as a prediction target, and completing training and testing of the model; the multi-step prediction model of online car-hailing demand comprises a context time correlation module, a spatio-temporal cross attention mechanism module and a spatio-temporal fusion module, wherein the context time correlation module is used for learning the time sequence correlation characteristics of online car-hailing demand, the spatio-temporal cross attention mechanism module is used for learning the spatio-temporal correlation characteristics, and the spatio-temporal fusion module is used for comprehensively learning the correlation mode of online car-hailing demand in the spatio-temporal and continuous time dimensions.
[0009] The online car-hailing dataset and the online car-hailing flow matrix are input into the multi-step prediction model of online car-hailing demand based on the spatio-temporal deep convolutional network, and instance verification of multi-step spatio-temporal demand prediction of online car-hailing is performed.
[0010] According to the method, the demand amount of online car-hailing in each grid area is counted at a time step of 5 minutes, and a spatio-temporal related online car-hailing flow matrix is formed.
[0011] After the grid division processing of the research area is performed, the demand amount of online car-hailing at the nth division grid and t time intervals is defined as X is defined as a demand spatio-temporal feature matrix, X R N×T is defined as a real number set, N is defined as the total number of regions, T is defined as the length of a historical time sequence, and is defined as the demand amount of all regions in the t time step; the spatio-temporal related online car-hailing flow matrix X is obtained f =[X t+1 ,X t+2 ,...,X t+m ];
[0012] X f is the demand multi-step prediction of online car-hailing, and X f R N×m , wherein m is a positive integer.
[0013] According to the method, the multi-step prediction model of online car-hailing demand based on the spatio-temporal deep convolutional network comprises the following steps:
[0014] The context time correlation module is used for learning the context time sequence correlation characteristics of online car-hailing demand;
[0015] The spatio-temporal cross attention mechanism module is used for learning the spatio-temporal correlation characteristics;
[0016] By utilizing 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 a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network was carried out, resulting in a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network.
[0018] According to the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the present invention, the step of learning the contextual temporal correlation characteristics of ride-hailing demand using a contextual temporal correlation module includes:
[0019] The association rules between the multi-step predictions are defined in accordance with 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 level is high, which conforms to the following formula (2):
[0022] Confidence t→t+1 =|Cor t,t+1 | (2)
[0023] Demand forecasting using the aforementioned confidence level conforms to the following formula (3):
[0024]
[0025] Among them, Cor t,t+1 The correlation between time step t and time step t+1; D t Cov(D) represents the demand for ride-hailing services at time step t. t D t+1 ) is D t and D t+1 covariance; σD t and σD t+1 They are D t and D t+1 Standard deviation; Confidence t→t+1 D represents the confidence level. Trend This represents the initial estimated demand; k is the k-th step forecast; α and β are dynamically adjusted weights.
[0026] According to the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the present invention, the context temporal association module is further used to simultaneously consider the spatial encoding information of each location in the ride-hailing demand sequence, conforming to the following formula:
[0027]
[0028] in, This represents the positive input demand matrix; This represents the output of a forward Transformer; This represents the reverse input demand matrix; This represents the output of the inverse Transformer; Output represents spatial encoding information.
[0029] The context time association module is also used to fuse the context temporal association information and spatial coding information by splicing, thereby forming a spatiotemporal fusion feature.
[0030] According to the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks 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 for the spatial cross-attention module is the fused spatiotemporal demand features, the target data is spatial features, and the input spatiotemporal fusion feature is E. st Spatial features are E f Perform a cubic linear transformation 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 spatial areas that are highly correlated with future demand forecasts, conforming to the following formula (7):
[0033]
[0034] Where, d k It is the dimension of the query or key vector. This represents the scaling factor.
[0035] The multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the present invention, wherein the spatiotemporal fusion module comprehensively learns the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions, including:
[0036] The spatiotemporal fusion module uses the temporal features H output by the time decoder and spatial decoder respectively. t and spatial features H s This enables deep interaction between temporal and spatial features;
[0037] Based on the temporal and spatial features, a linear transformation is used to fuse the temporal and spatial features, conforming to the following formula (8):
[0038] H f =W t H t +Ws H s (8)
[0039] Among them, W t and W s It is a learnable weight matrix.
[0040] According to the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the present invention, the example verification of multi-step spatiotemporal demand prediction for ride-hailing includes:
[0041] The ride-hailing traffic matrix is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network to perform ride-hailing multi-step spatiotemporal demand prediction.
[0042] The ride-hailing dataset is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network. Through multiple sets of comparison and ablation experiments, the performance of the ride-hailing demand multi-step prediction method and the ride-hailing demand multi-step prediction model is verified.
[0043] This invention also provides a multi-step prediction system for ride-hailing demand based on spatiotemporal deep convolutional networks, comprising:
[0044] The data acquisition module is used to determine the research area and acquire the ride-hailing dataset. The ride-hailing dataset is divided into segments with a time step of 5 minutes. The research area is divided using a grid partitioning method. The demand for ride-hailing vehicles in each grid area is counted with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0045] The model building module is used to construct a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for ride-hailing demand uses the initial demand volume of an order as the prediction target and completes the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0046] The instance verification module is used to input the ride-hailing dataset into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform instance verification of multi-step spatiotemporal demand prediction for ride-hailing.
[0047] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements any of the above-described methods for multi-step prediction of ride-hailing demand based on spatiotemporal deep convolutional networks.
[0048] The present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements any of the above-described methods for multi-step prediction of ride-hailing demand based on spatiotemporal deep convolutional networks.
[0049] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for multi-step prediction of ride-hailing demand based on spatiotemporal deep convolutional networks.
[0050] The multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by this invention can construct a multi-step prediction model based on spatiotemporal deep convolutional networks. This model can learn the contextual temporal correlation information of ride-hailing demand. Furthermore, it can enhance the modeling ability of cross-regional changes in ride-hailing demand through a 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 a ride-hailing dataset and a ride-hailing traffic matrix. The ride-hailing dataset can be divided with a time step of 5 minutes, realizing the temporal division of ride-hailing demand. The ride-hailing traffic matrix is obtained by statistically analyzing the ride-hailing demand of each grid in the study area, thus realizing the spatial division of ride-hailing demand. In other words, the solution of this application realizes the spatiotemporal division from the input data. Combined with the multi-step prediction model for ride-hailing demand constructed based on spatiotemporal deep convolutional networks, the spatiotemporal correlation of ride-hailing demand prediction is further strengthened, effectively improving the prediction accuracy. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0052] Figure 1 This is a flowchart illustrating the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided in 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 ride-hailing demand based on spatiotemporal deep convolutional networks provided in this embodiment of the invention.
[0054] Figure 3 This is a schematic diagram of the contextual time correlation module of the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided in this embodiment of the invention;
[0055] Figure 4This is a schematic diagram of the structure of the multi-step prediction system for ride-hailing demand based on spatiotemporal deep convolutional networks provided in an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0058] Figure 1 This is a flowchart illustrating the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided in an embodiment of the present invention.
[0059] like Figure 1 As shown, this embodiment provides a multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks, including:
[0060] Step 101: Determine the study area and obtain the ride-hailing dataset. Divide the ride-hailing dataset into segments with a time step of 5 minutes. Divide the study area into segments using a grid method. Calculate the demand for ride-hailing vehicles in each grid area with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0061] In practical applications, ride-hailing datasets can be derived from ride-hailing trajectory data. For a trajectory segment, the transition from a passenger-carrying state to an empty state, and vice versa, can be defined as two ride-hailing demands. This method is used to calculate the ride-hailing demand every 5 minutes. When the number of passengers in a vehicle changes from 1 to more than 1, it indicates that the point is a passenger's pick-up point and is counted as one ride-hailing demand. The passenger pick-up point is the source of ride-hailing demand; that is, a passenger needs to pick up at a certain location to travel, representing the point where demand arises. Therefore, using the passenger pick-up point as the demand point is the most direct way to represent ride-hailing demand. After data processing, the acquired ride-hailing dataset is divided into 5-minute time steps, and the corresponding demand is statistically analyzed. 288 time segments are created within a day, and the data in different time segments are grouped from 1 to 288. Next, a grid partitioning method can be used to divide the study area, with grids measuring 1km x 1km. Each grid represents a study area, facilitating the statistical analysis of the ride-hailing demand in a specific city within each study area every 5 minutes.
[0062] Step 102: Construct a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for ride-hailing demand uses the demand at the starting point of the order as the prediction target, and completes the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 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 ride-hailing demand based on spatiotemporal deep convolutional networks provided in this embodiment of the invention.
[0064] Figure 3 This is a schematic diagram of the contextual time correlation module of the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided in an embodiment of the present invention.
[0065] like Figure 2 As shown, the multi-step ride-hailing demand prediction model provided in this embodiment can perform temporal and spatial auto-encoding on the input data to enhance the model's understanding of spatiotemporal features. After temporal encoding, the data is processed through a contextual temporal association mechanism, and the temporal and spatial features are input into the fusion module to obtain spatiotemporal fusion features. The spatiotemporal cross-attention mechanism includes a temporal cross-attention module and a spatial cross-attention module. In the temporal and spatial cross-attention modules, the weights of the spatiotemporal fusion features with the temporal and spatial features are calculated respectively, enabling the model to automatically focus on time and spatial regions with a high correlation to future demand prediction. Feature extraction is performed in the temporal and spatial dimensions through temporal decoding and spatial decoding respectively.
[0066] Furthermore, such as Figure 3 As shown, in the contextual temporal association mechanism of the ride-hailing demand multi-step prediction model, the input data can be temporally encoded, embedded with relative positions, and embedded with association rules. The information is then input into the forward transformer, and then into the reverse transformer for contextual semantic association before output.
[0067] Step 103: Input the ride-hailing dataset and the ride-hailing traffic matrix into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network to perform instance verification of ride-hailing multi-step spatiotemporal demand prediction.
[0068] The multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided in this embodiment can construct a multi-step prediction model based on spatiotemporal deep convolutional networks. This model can learn the contextual temporal correlation information of ride-hailing demand. Furthermore, it can enhance the modeling ability of cross-regional changes in ride-hailing demand through a 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 a ride-hailing dataset and a ride-hailing traffic matrix. The ride-hailing dataset can be divided with a time step of 5 minutes, realizing the temporal division of ride-hailing demand. The ride-hailing traffic matrix is obtained by statistically analyzing the ride-hailing demand of each grid in the study area, thus realizing the spatial division of ride-hailing demand. In other words, the solution of this application realizes the spatiotemporal division from the input data. Combined with the multi-step prediction model for ride-hailing demand constructed based on spatiotemporal deep convolutional networks, the spatiotemporal correlation of ride-hailing demand prediction is further strengthened, effectively improving the prediction accuracy.
[0069] In an exemplary embodiment, the step of statistically analyzing the demand for ride-hailing vehicles in each grid area with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix includes:
[0070] After dividing the study area into grids, the ride-hailing demand at the nth grid and the tth time interval is defined as follows: Define X as the spatiotemporal characteristic matrix of demand, X∈R N×T Let R be the set of real numbers, N be the total number of regions, and T be the length of the historical time series. Let X be the demand for all regions within the t-th time step; then the spatiotemporal related ride-hailing traffic matrix is obtained as X. f =[X t+1 ,X t+2 ,...,X t+m ];
[0071] Among them, X f Multi-step forecasting of ride-hailing demand involves predicting the demand in all regions over m time steps in the future. f ∈R N×m , where m is a positive integer.
[0072] In an exemplary embodiment, the construction of a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network includes:
[0073] By utilizing the contextual time correlation module, we can learn the contextual temporal correlation characteristics of ride-hailing demand;
[0074] By utilizing the spatiotemporal cross-attention mechanism module, we can learn its spatiotemporal correlation characteristics;
[0075] By utilizing 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 a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network was carried out, resulting in a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network.
[0077] In an exemplary embodiment, the step of using the contextual temporal correlation module to learn the contextual temporal correlation characteristics of ride-hailing demand includes:
[0078] The association rules between the multi-step predictions are defined in accordance with 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 level is high, which conforms to the following formula (2):
[0081] Confidence t→t+1 =|Cor t,t+1 | (2)
[0082] Demand forecasting using the aforementioned confidence level conforms to the following formula (3):
[0083]
[0084] Among them, Cor t,t+1 The correlation between time step t and time step t+1; D t Cov(D) represents the demand for ride-hailing services at time step t. t D t+1 ) is D t and D t+1 covariance; σD t and σD t+1 They are D t and D t+1 Standard deviation; Confidence t→t+1 D represents the confidence level. Trend This represents the initial estimated demand; k is the k-th step forecast; α and β are dynamically adjusted weights.
[0085] In an exemplary embodiment, the context time association module is further configured to simultaneously consider the spatial encoding information of each location in the ride-hailing demand sequence, conforming to the following formula:
[0086]
[0087] in, This represents the positive input demand matrix; This represents the output of a forward Transformer; This represents the reverse input demand matrix; This represents the output of the inverse Transformer; Output represents spatial encoding information.
[0088] The context time association module is also used to fuse the context temporal association information and spatial coding information by splicing, 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 for the spatial cross-attention module is the fused spatiotemporal demand features, the target data is spatial features, and the input spatiotemporal fusion feature is E. st Spatial features are E f Perform a cubic linear transformation 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 spatial areas that are highly correlated with future demand forecasts, conforming to the following formula (7):
[0092]
[0093] Where, d k It is the dimension of the query or key vector. This represents the scaling factor.
[0094] In an exemplary embodiment, the step of utilizing the spatiotemporal fusion module to comprehensively learn the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions includes:
[0095] The spatiotemporal fusion module uses the temporal features H output by the time decoder and spatial decoder respectively. t and spatial features H s This enables deep interaction between temporal and spatial features;
[0096] Based on the temporal and spatial features, a linear transformation is used to fuse the temporal and spatial features, conforming to the following formula (8):
[0097] H f =W t H t +W s H s (8)
[0098] Among them, W t and W sIt is a learnable weight matrix.
[0099] In an exemplary embodiment, the instance verification of multi-step spatiotemporal demand prediction for ride-hailing services includes:
[0100] The ride-hailing traffic matrix is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network to perform ride-hailing multi-step spatiotemporal demand prediction.
[0101] The ride-hailing dataset is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network. Through multiple sets of comparison and ablation experiments, the performance of the ride-hailing demand multi-step prediction method and the ride-hailing demand multi-step prediction model is verified.
[0102] The following specific embodiment illustrates the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by this application.
[0103] (1) Work environment
[0104] The model code was written using the PyTorch framework. All experimental code was compiled and executed on a Windows software environment and run on a workstation equipped with an Intel(R) Core(TM) i7 13700k CPU, an NVIDIA GeForce RTX4090 GPU, and 128GB of memory.
[0105] (2) Introduction to the experimental dataset
[0106] The experimental dataset for this invention consists of ride-hailing data from a city within a single month of a given year. After preprocessing, a total of 170 million data entries are available. The ride-hailing data includes the ride-hailing company ID, driver's license ID, ride-hailing license plate number, location and corresponding time, latitude and longitude, number of passengers in the ride-hailing vehicle (including the driver), and upload time.
[0107] (3) Selection of benchmark model
[0108] In the comparison and ablation experiments, 10 benchmark models were selected and their performance was compared with the proposed model on a given dataset.
[0109] Graph Convolutional Networks (GCNs) use adjacency matrices and node feature matrices to propagate information and update the feature representation of each node, effectively capturing the spatial relationships between nodes in a graph. They are used to process graph data and can also handle time-series data.
[0110] Long Short-Term Memory (LSTM) networks control the storage and forgetting of information through "forget gates", "input gates", and "output gates".
[0111] Gated Recurrent Unit (GRU): Uses a gating mechanism to control the flow of information, and has only two gates (update gate and reset gate). Compared to LSTM, GRU is structurally simpler and can also handle time series data.
[0112] Bidirectional Long Short-Term Memory (BiLSTM): Based on LSTM, a bidirectional structure is added, which can process sequence data from both forward and backward directions simultaneously.
[0113] Spatio-Temporal Graph Convolutional Network (STGCN): This model combines graph convolutional networks and temporal models, enabling it to model both spatial and temporal dependencies. It is suitable for processing spatio-temporal graph data.
[0114] Transformer: Based on the self-attention mechanism, it can simultaneously capture the dependencies between various positions in a sequence and can perform parallel computation. It can efficiently process large-scale time-series data.
[0115] GMAN (Graph Multi-Attention Network): Combines graph attention mechanism (GAT) and temporal attention mechanism to make data predictions by capturing complex spatiotemporal changes.
[0116] STFGNN (Spatial-Temporal Fusion Graph Neural Network): It utilizes graph neural networks (GNN) and temporal modeling mechanisms, and integrates spatial and temporal information through a multi-scale fusion mechanism to ultimately output predicted data.
[0117] STTN (Spatio-Temporal Transformer Network): It extracts spatio-temporal features by modeling spatio-temporal dependencies through a time and space self-attention mechanism, thereby enabling spatio-temporal data prediction.
[0118] PDFormer (Prediction and Decision Transformer): It combines the Transformer architecture to handle dependencies in time and space dimensions, and also incorporates a decision module to optimize predictions and support practical decision-making tasks.
[0119] (4) Experimental parameter settings
[0120] All models use Adam as the optimizer, with a learning rate of 0.001, and are trained for 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 2-layer LSTM with 128 hidden units in each layer and tanh activation.
[0123] The GRU model uses a 2-layer GRU with 128 hidden units per layer, 64 output units per layer, and Dropout 0.2.
[0124] The BiLSTM model uses a two-layer bidirectional LSTM with 128 hidden units per layer and 64 output units, activated by tanh.
[0125] The STGCN model uses a 2-layer GCN with 64 hidden layers and a 32-layer output layer, with ReLU activation. It also includes a 1-layer 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 employs a 3-layer spatiotemporal attention layer, with 8 attention heads in each layer. The hidden layer has a dimension of 64, and the output layer has a dimension of 32.
[0128] The STFGNN model uses a 3-layer GCN with 128 hidden layers and 64 output layers, with ReLU activation. Alternatively, it uses a 2-layer LSTM with 128 hidden layers and 64 output layers.
[0129] The STTN model employs a 4-layer Transformer architecture, with 4 temporal attention heads and 4 spatial attention heads per layer. It has 128 hidden layers, 512 feedforward layers, and 64 output layers.
[0130] The PDFormer model uses a 4-layer Transformer architecture with 8 heads per layer. There are 256 hidden layers, 1024 feedforward layers, and 128 output layers.
[0131] The method proposed in this application employs a 4-layer Transformer variant, with 8 headers per layer. The hidden layer has 256 layers, the feedforward layer has 1024 layers, and the output layer has 128 layers.
[0132] (5) Selection of evaluation indicators
[0133] The predictive performance of each model is evaluated using two common metrics: Mean Absolute Error (MAE) and Root Mean Square Error (RMSE). Smaller metrics generally indicate better performance.
[0134] (6) Experimental Results and Analysis
[0135] Table 1 presents the comparative experimental results of demand prediction performance of various models on a local ride-hailing dataset. Overall, the proposed method achieves the best prediction performance (see bold data in Table 1). Compared with the baseline model PDFormer, which has the second-best group segmentation performance, the proposed method achieves lower errors across all metrics, namely, a 2.14% reduction in MAE and a 2.46% reduction in RMSE, confirming the good demand prediction performance of this invention. This is attributed to the presence of a contextual temporal correlation module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module in the proposed method. The former, with its bidirectional structure, can fully learn the contextual temporal correlation characteristics of ride-hailing demand; the intermediate module can learn the spatiotemporal correlation characteristics of ride-hailing demand; and the latter can effectively combine the characteristics of the spatiotemporal distribution of ride-hailing demand to comprehensively learn the correlation patterns of ride-hailing demand in both spatiotemporal and continuous time dimensions.
[0136] Table 1 Comparison Results of Multi-Step Prediction Experiments for the Model Table 1 Comparison of Multi-Step Pre
[0137]
[0138] Table 2 reflects the performance improvement of demand forecasting by the context-time correlation module and the spatiotemporal cross-attention mechanism module of the proposed method. The first row of data in the table shows the distribution of demand forecasting performance when only the context-time correlation module is removed; the second row shows the distribution of demand forecasting performance when only the spatiotemporal cross-attention mechanism module is removed; and the third row shows the distribution of population partitioning performance when the proposed method includes both modules. As shown in the table, including the context-time correlation module reduces the MAE of the proposed model by 21.57% and the RMSE by 9.52%, confirming that the context-time correlation module enables the proposed model to more accurately capture complex dependencies in time series. Including the spatiotemporal cross-attention mechanism module reduces the MAE of the proposed model by 13.98% and the RMSE by 5.62%, indicating that the introduction of this module further improves the spatiotemporal demand forecasting performance of the proposed model. This fully demonstrates that the design of the context-time correlation module and the spatiotemporal cross-attention mechanism module in this invention contributes to improving the accurate partitioning performance of the population.
[0139] Table 2 shows the ablation experiment results of the built-in module of the proposed method on a local ride-hailing dataset.
[0140]
[0141] Based on the above examples, it can be determined that the spatiotemporal demand forecasting method provided in this application has at least the following beneficial effects:
[0142] 1) By modeling a multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks, the ability to capture complex dependencies in time series and learn the spatiotemporal correlation characteristics of ride-hailing demand is enhanced, thereby improving the accuracy and robustness of demand prediction.
[0143] 2) It effectively serves the field of transportation information engineering, providing important theoretical references for rationally adjusting the contradiction between transportation supply and demand, optimizing resource allocation, improving service efficiency and passenger satisfaction, and enhancing overall travel efficiency. It is expected to provide more refined demand forecasting solutions for urban transportation planning, transportation resource optimization, and intelligent travel scheduling, thereby promoting the development and progress of related fields.
[0144] The following describes the multi-step prediction system for ride-hailing demand based on spatiotemporal deep convolutional networks provided by this invention. The multi-step prediction system for ride-hailing demand based on spatiotemporal deep convolutional networks described below can be referred to in correspondence with the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks described above.
[0145] Figure 4 This is a schematic diagram of the structure of a multi-step prediction system for ride-hailing demand based on a spatiotemporal deep convolutional network provided in an embodiment of the present invention.
[0146] like Figure 4 As shown, the ride-hailing demand multi-step prediction system provided in this embodiment includes:
[0147] The data acquisition module 401 is used to determine the research area and acquire the ride-hailing dataset. The ride-hailing dataset is divided into segments with a time step of 5 minutes. The research area is divided using a grid division method. The demand for ride-hailing vehicles in each grid area is counted with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0148] The model building module 402 is used to build a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for ride-hailing demand uses the initial demand volume of the order as the prediction target to complete the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0149] The instance verification module 403 is used to input the ride-hailing dataset into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network to perform instance verification of ride-hailing multi-step spatiotemporal demand prediction.
[0150] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... 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 through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a multi-step prediction method for ride-hailing demand based on a spatiotemporal deep convolutional network. This method includes:
[0151] The study area was determined and a ride-hailing dataset was obtained. The ride-hailing dataset was divided into segments with a time step of 5 minutes. The study area was divided using a grid partitioning method. The demand for ride-hailing vehicles in each grid area was counted with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0152] A multi-step prediction model for ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the starting point of an order as the prediction target to complete the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0153] The ride-hailing dataset and the ride-hailing traffic matrix are input into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform an instance verification of multi-step spatiotemporal demand prediction for ride-hailing.
[0154] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0155] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the above methods. The method includes:
[0156] The study area was determined and a ride-hailing dataset was obtained. The ride-hailing dataset was divided into segments with a time step of 5 minutes. The study area was divided using a grid partitioning method. The demand for ride-hailing vehicles in each grid area was counted with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0157] A multi-step prediction model for ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the starting point of an order as the prediction target to complete the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0158] The ride-hailing dataset and the ride-hailing traffic matrix are input into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform an instance verification of multi-step spatiotemporal demand prediction for ride-hailing.
[0159] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks provided by the methods described above, the method comprising:
[0160] The study area was determined and a ride-hailing dataset was obtained. The ride-hailing dataset was divided into segments with a time step of 5 minutes. The study area was divided using a grid partitioning method. The demand for ride-hailing vehicles in each grid area was counted with a time step of 5 minutes to form a spatiotemporally related ride-hailing traffic matrix.
[0161] A multi-step prediction model for ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the starting point of an order as the prediction target to complete the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions.
[0162] The ride-hailing dataset and the ride-hailing traffic matrix are input into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform an instance verification of multi-step spatiotemporal demand prediction for ride-hailing.
[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 can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0164] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks, characterized in that, include: The study area was determined and a ride-hailing dataset was obtained. The ride-hailing dataset was then divided into segments with a time step of 5 minutes. The study area is divided using a grid-based method; The demand for ride-hailing vehicles in each grid area is statistically analyzed with a 5-minute time step to form a spatiotemporally related ride-hailing traffic matrix. A multi-step prediction model for ride-hailing demand is constructed based on a spatiotemporal deep convolutional network. The model uses the demand at the starting point of an order as the prediction target to complete the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions. The ride-hailing dataset and the ride-hailing traffic matrix are input into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform an instance verification of multi-step spatiotemporal demand prediction for ride-hailing. The multi-step prediction model for ride-hailing demand built based on a spatiotemporal deep convolutional network includes: By utilizing the contextual time correlation module, we can learn the contextual temporal correlation characteristics of ride-hailing demand; By utilizing the spatiotemporal cross-attention mechanism module, we can learn its spatiotemporal correlation characteristics; By utilizing 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 a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network was carried out to obtain the multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network. The method of using the contextual time correlation module to learn the contextual temporal correlation characteristics of ride-hailing demand includes: The association rules between the multi-step predictions are defined in accordance with the following formula (1): ; During the prediction process, correlation is used to adjust the prediction results. When the correlation is high, the confidence level is high, which conforms to the following formula (2): ; Demand forecasting using the aforementioned confidence level conforms to the following formula (3): ; in, The correlation between time step t and time step t+1; yes and covariance; and They are and Standard deviation; Confidence level; This is a preliminary estimate of demand. For the first Step prediction; , The weights are dynamically adjusted. The context time association module is also used to simultaneously consider the spatial encoding information of each location in the ride-hailing demand sequence, conforming to the following formula: (4); (5); (6); in, This represents the positive input demand matrix; This represents the output of a forward Transformer; This represents the reverse input demand matrix; This represents the output of the reverse Transformer. Represents spatial encoding information; The context time association module is also used to fuse context temporal association information and spatial coding information by splicing, thereby forming a spatiotemporal fusion feature; The spatiotemporal cross-attention mechanism module includes a temporal cross-attention module and a spatial cross-attention module; The source data for the spatial cross-attention module is the fused spatiotemporal demand features, the target data is spatial features, and the input spatiotemporal fusion features are... Spatial features are Perform a three-linear transformation on the input features to generate query results. , Key and Vector representation of values; The model can automatically focus on spatial areas that are highly correlated with future demand forecasts, conforming to the following formula (7): (7); in, It is the dimension of the query or key vector. Indicates the scaling factor; The aforementioned spatiotemporal fusion module comprehensively learns the correlation patterns of ride-hailing demand in the spatiotemporal and continuous time dimensions, including: The spatiotemporal fusion module outputs the temporal features from the time decoder and spatial decoder respectively. and spatial features This enables deep interaction between temporal and spatial features; Based on the temporal and spatial features, a linear transformation is used to fuse the temporal and spatial features, conforming to the following formula (8): (8); in, and It is a learnable weight matrix.
2. The multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks according to claim 1, characterized in that, The method of statistically analyzing the demand for ride-hailing vehicles in each grid area with a 5-minute time step to form a spatiotemporally related ride-hailing traffic matrix includes: After dividing the study area into grids, the ride-hailing demand at the nth grid and the tth time interval is defined as follows: Let X be the spatiotemporal characteristic matrix of demand. Let R be the set of real numbers, N be the total number of regions, and T be the length of the historical time series. Let be the demand for all regions within the t-th time step; the spatiotemporal related ride-hailing traffic matrix is obtained as follows. ; in, Multi-step forecasting of ride-hailing demand involves predicting the demand for all regions over the next m time steps. , where m is a positive integer.
3. The multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks according to claim 1, characterized in that, The instance verification of multi-step spatiotemporal demand prediction for ride-hailing services includes: The ride-hailing traffic matrix is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network to perform ride-hailing multi-step spatiotemporal demand prediction. The ride-hailing dataset is input into the ride-hailing demand multi-step prediction model based on spatiotemporal deep convolutional network. Through multiple sets of comparison and ablation experiments, the performance of the ride-hailing demand multi-step prediction method and the ride-hailing demand multi-step prediction model is verified.
4. A multi-step ride-hailing demand prediction system based on spatiotemporal deep convolutional networks, applied to the multi-step ride-hailing demand prediction method based on spatiotemporal deep convolutional networks as described in any one of claims 1-3, characterized in that, include: The data acquisition module is used to determine the research area and acquire the ride-hailing dataset, and to divide the ride-hailing dataset into segments with a time step of 5 minutes. The study area is divided using a grid-based method; The demand for ride-hailing vehicles in each grid area is statistically analyzed with a 5-minute time step to form a spatiotemporally related ride-hailing traffic matrix. The model building module is used to construct a multi-step prediction model for ride-hailing demand based on a spatiotemporal deep convolutional network. The multi-step prediction model for ride-hailing demand uses the initial demand volume of an order as the prediction target and completes the training and testing of the model. The multi-step prediction model for ride-hailing demand includes a contextual temporal association module, a spatiotemporal cross-attention mechanism module, and a spatiotemporal fusion module. The contextual temporal association module is used to learn the temporal correlation characteristics of 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 ride-hailing demand in the spatiotemporal and continuous time dimensions. The instance verification module is used to input the ride-hailing dataset into a multi-step ride-hailing demand prediction model based on a spatiotemporal deep convolutional network to perform instance verification of multi-step spatiotemporal demand prediction for ride-hailing.
5. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the multi-step prediction method for ride-hailing demand based on spatiotemporal deep convolutional networks as described in any one of claims 1-3.
Citation Information
Patent Citations
Online car-hailing order demand prediction method based on space-time context attention network
CN112150207A