A method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network
Through the multi-graph neural network of time and space, multiple correlations between roads and public transportation are captured, and combined with time correlation, the problem of insufficient accuracy of online ride-hailing demand prediction in the existing technology is solved, the prediction effect is improved, and the online ride-hailing operation is optimized. and traffic management.
Patent Information
- Application Number
- CN202210038032.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-01-13
AI Technical Summary
In the forecast of online ride-hailing demand in the prior art, the grid divided by the city does not match the actual road network, and the multiple spatial correlations between road sections are not fully considered, resulting in inaccurate predictions and increasing operating costs and passenger waiting time.
Using a method based on spatiotemporal multi-graph neural network, the adjacency relationship, functional correlation and public transportation correlation between roads are captured through graph convolutional networks, and combined with the gated recurrent neural network to capture the time correlation, the spatiotemporal graph convolutional neural network is constructed. , predict the demand for online car-hailing.
It improves the accuracy of online car-hailing demand forecasts, effectively alleviates the supply and demand contradictions between drivers and passengers, and optimizes the operation and traffic management of online car-hailing.
Smart Images

Figure CN114372830B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic forecasting, and more specifically to a method for predicting online car-hailing demand based on a spatiotemporal multi-graph neural network. Background Art
[0002] In this era of diversified transportation development, taking online ride-hailing has become one of the important modes of travel due to its flexible and convenient features. However, many cities have the problem of "difficulty in calling a car", mainly because there is a contradiction between the online ride-hailing services provided by drivers and the taxi demand generated by passengers. This not only increases the operating cost of online ride-hailing, reduces the utilization rate of online ride-hailing and the income of drivers, but also increases the waiting time of passengers. Accurately predicting the demand for online ride-hailing can help online ride-hailing platforms distribute orders and dispatch vehicles more reasonably, and also has a very positive effect on traffic management, design, travel induction, etc.
[0003] When predicting the demand for online ride-hailing vehicles, the existing technology divides the city into grids of fixed size or grid areas with certain rules. There are problems such as the grids not being consistent with the actual road network, the same road section may be divided into multiple grids, and the actual accessible paths of different road sections in the same grid are far away. In addition, when using spatiotemporal graph network modeling in non-Euclidean space to predict the demand for online ride-hailing vehicles, the multiple spatial correlations between road sections are not fully considered. Summary of the invention
[0004] In order to avoid the shortcomings of the prior art, the present invention proposes a method for predicting online car-hailing demand based on spatiotemporal multi-graph neural networks. Based on the actual urban road network data, a graph convolutional network is used to capture the multiple correlations in non-Euclidean space between the adjacency relationships, road function correlations and public transportation correlations between roads, and then a gated recurrent neural network is used to capture the temporal correlation of the graph network to solve the problem of modeling multiple correlations in non-Euclidean space of road sections.
[0005] The embodiment of the present invention provides a method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network, comprising:
[0006] Extract urban road network data and perform map matching;
[0007] According to whether the road sections are spatially adjacent, a road section adjacency relationship graph is constructed;
[0008] According to the road section functions, a road section function correlation diagram is constructed;
[0009] According to the correlation between subway and bus stops on the road section, a public transportation correlation map is obtained;
[0010] The graph convolutional neural network is used to perform graph convolution operations on the road section adjacency graph, the road section function correlation graph, and the public transportation correlation graph, respectively, to capture multiple correlations including the adjacency relationship between roads, functional correlation, and public transportation correlation;
[0011] The fused road section adjacency graph, road section function correlation graph, and public transportation correlation graph are input into the recurrent neural network to capture the temporal correlation at different times.
[0012] Based on the multiple spatial correlations of graph convolutional neural networks and the temporal correlations of recurrent neural networks, a spatiotemporal graph convolutional neural network is constructed;
[0013] The order time and the matched road section are input into the spatiotemporal graph convolutional neural network to obtain the predicted value of the online car-hailing demand on the road section in the future.
[0014] Furthermore, the urban road network data is extracted and map matched, including:
[0015] Clean the data and delete the order data with missing location and time;
[0016] Extract urban road network data and obtain road section information through the open source map service OpenStreetMap;
[0017] According to the longitude and latitude information in the order data, the order is matched to the nearest road section using the map matching algorithm;
[0018] Design the time slice length, and count the number of online car-hailing demands in all time slices and all road sections according to the order time and the matched road sections, which will be used as the input of the network.
[0019] Furthermore, a road segment adjacency graph is constructed, including:
[0020] An adjacency relationship graph is constructed based on the adjacency relationship of road segments in the extracted road network. Vertices are represented by road segments, and the relationship between road segments represents edges. The edge weight between two vertices indicates whether the two road segments are adjacent.
[0021] Furthermore, a road segment function correlation diagram is constructed, including:
[0022] The functional correlation of road sections is obtained by calculating the similarity of POI distribution on the road sections. The graph structure is represented by vertices, edges and edge weight matrix. The edge weight represents the functional correlation between two road sections.
[0023] Furthermore, a road section public transportation related graph is constructed, including:
[0024] The public transportation correlation is obtained by calculating the similarity of the distribution of subway and bus stations on the road section. The graph structure is represented by vertices, edges and edge weight matrix. The edge weight represents the public transportation correlation between two road sections.
[0025] Furthermore, it also includes: training the spatiotemporal graph convolutional network, which is specifically:
[0026] Input the statistical online car-hailing demand matrix into the network, set the time slice step size, and divide the demand matrix according to the step size;
[0027] Graph convolution is performed on the established road section adjacency graph, road section function correlation graph, and road section public transportation correlation graph to capture multiple correlations between road sections. Graph convolution operations are performed on these three graphs at each moment, and then multiple graphs are fused;
[0028] The gated recurrent neural network is used to capture the temporal correlation between the fused graphs. At each moment, the fused graph is input into the recurrent neural network to capture the correlation at different moments.
[0029] Output the number of online car-hailing demands for all road sections in several future time slices, reversely adjust the parameters according to the loss between the predicted results and the true values, complete the network training through iterative training, and save the training network parameters.
[0030] Furthermore, it also includes:
[0031] Input the test data into the trained network, calculate the number of online car-hailing demands on the road section within a specific time in the future based on the trained network and its parameters, and output the predicted value;
[0032] The direct error between the true value and the predicted value is calculated according to the evaluation index to evaluate the network performance.
[0033] The embodiment of the present invention provides a method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network. Compared with the prior art, the method has the following beneficial effects:
[0034] 1. The present invention proposes a method for predicting the demand for online ride-hailing vehicles on road sections, which solves the problems that the road sections in the demand prediction using the regional division method in the current method do not match the actual road network conditions, the same road section may be divided into multiple grids, and the actual accessible paths of different road sections in the same grid are far or even unreachable. It is conducive to better dispatching and route planning for online ride-hailing vehicles, and the contradiction between supply and demand between online ride-hailing vehicles and passengers is effectively alleviated. It also plays a positive role in helping traffic management departments to better manage and plan traffic.
[0035] 2. The present invention proposes a method for predicting the demand of online car-hailing based on a spatio-temporal multi-graph convolutional neural network, which fully considers various factors affecting the demand of online car-hailing, captures multiple temporal and spatial correlations affecting the demand of online car-hailing, and effectively improves the accuracy of network prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of the method for predicting the demand of online car-hailing based on a spatio-temporal multi-graph neural network provided by an embodiment of the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0038] See Figure 1 , an embodiment of the present invention provides a method for predicting the demand of online car-hailing based on a spatio-temporal multi-graph neural network, and the method includes:
[0039] Step 1, data preprocessing, deleting data with missing location and time information.
[0040] Step 2, urban road network extraction and map matching, including the following steps:
[0041] Step 21, based on the interface provided by the OpenStreetMap map service, obtain the city ID according to the city name, and use a Python program to extract the urban road network data according to the interface, obtain the road segment information and save it.
[0042] Step 22, according to the longitude and latitude information in each order data, use the map matching algorithm to match the order to the nearest road segment in the urban road network.
[0043] Step 23, divide the time into slices of the same time length, and count the number of online car-hailing demands on all road segments in all time slices according to the order time and the number of road segments where the order is matched in step 22, to obtain the online car-hailing demand matrix.
[0044] Step 3, use the statistically obtained online car-hailing demand matrix as the input, the matrix size is N×W, N represents the total number of all road segments, and W represents the total number of historical online car-hailing demand time slices. m ij ∈M, 0 < i ≤ W, 0 < j ≤ N represents the number of online car-hailing demands on the j-th road segment at the i-th moment. Set the step size d to divide N, and divide the input demand matrix into sub-matrices, and regard the time slice of d steps as a moment, a moment.
[0045] Step 4: Construct a multi-graph of spatial correlation of road sections, including a road section adjacency graph, a road section function correlation graph, and a road section public transportation correlation graph. This includes the following steps:
[0046] Step 41: Construct an adjacency relationship graph G based on whether the road sections are adjacent in the road network geographic space. r , denoted by G r =(V,E,W r ), V represents the set of vertices in the graph, a vertex represents a road segment, E represents the set of edges, and W r (i,j) indicates whether the road segment i is adjacent to the road segment j, 1 indicates adjacent, and 0 indicates not adjacent.
[0047] Step 42: road section function correlation graph G f :Road segment function correlation graph uses G f =(V,E,W f ) indicates that W f (i, j) is the functional correlation between two road sections. The POI distribution on the road section is represented as a vector, and the functional correlation of the road section is obtained by calculating the similarity of the POI vectors of the two road sections.
[0048] Step 43: Road section public transportation correlation graph G p :Road section public transport correlation diagram using G p = (V,E,W p ) indicates. p (i, j) represents the public transportation correlation between two sections. The distribution of subway and bus stations on the section is represented as a vector. The public transportation correlation of the sections is obtained by calculating the similarity of the station vectors of the two sections.
[0049] Step 5: Use graph convolutional neural network to capture multiple correlations between road sections and further fuse the graph after graph convolution. This includes the following steps:
[0050] Step 51: Use a two-layer graph convolutional neural network to capture the link adjacency correlation, link function correlation, and link public transportation correlation. The graph convolution process is expressed as in A is the adjacency matrix, I is the identity matrix, is The degree matrix, W (l) is a trainable weight matrix. σ(·) is the activation function. H (l) With H (l+1) are the input and output of the lth layer of the neural network respectively.
[0051] Step 52: After performing graph convolution on the road segment adjacency correlation graph, road segment function correlation graph, and road segment public transportation correlation graph, fuse the graphs.
[0052] Step 6: Use a gated recurrent unit (GRU) to capture the temporal correlation between the fused graphs. At each moment, input the fused graph into the gated recurrent unit to capture the correlation existing at different moments.
[0053] Step 7: Repeat Step 5 and Step 6, iterate and train K times to complete the training of the spatio-temporal graph convolutional neural network, and save the parameters.
[0054] Step 8: According to the trained network and the saved parameters, input the test sample data, calculate the predicted values through the parameters, and evaluate the performance of the spatio-temporal graph convolutional neural network based on the error between the true values and the predicted values.
[0055] Example 1:
[0056] Step 1: Input the online car-hailing order data and delete the data with missing location and time information in the orders.
[0057] Step 2: Extract the urban road network and perform map matching, specifically execute the following steps:
[0058] Step 21: Based on the OpenStreetMap map service, obtain the city ID according to the city name, and use a Python program to extract the urban road network data according to the city ID according to the interface, obtain the road segment information and save it.
[0059] Step 22: According to the starting longitude lon and latitude lat in each order data, use the map matching algorithm based on hidden Markov to match the order starting point to the nearest road segment in the urban road network.
[0060] Step 23: Set the unit time slice as e minutes, and T represents the total number of minutes covered by all orders. Then there are time slices. According to the road network data, there are N road segments in total. Then the online car-hailing demand matrix is expressed as M ∈ R W×N .
[0061] Step 3: Input the online car-hailing demand matrix M into the spatio-temporal graph convolutional network. The matrix size is W × N, m ij ∈ M, 0 < i ≤ W, 0 < j ≤ N represents the number of online car-hailing demands on the j-th road segment at the i-th moment. Set the step size d to divide N, and divide the input demand matrix into sub-matrices. Regard the time slices of d step sizes as one moment, and there are moments in total.
[0062] Step 4: Construct a multi-graph of spatial correlation of road sections, including a road section adjacency graph, a road section function correlation graph, and a road section public transportation correlation graph. This includes the following steps:
[0063] Step 41: Construct the road segment adjacency graph G r . Construct an adjacency graph G based on whether the road sections are adjacent in space in the road network. r , denoted by G r =(V,E,W r ), V represents the set of vertices in the graph, a vertex represents a road segment, E represents the set of edges, and W r (i,j) indicates whether the road segment i is adjacent to the road segment j, 1 indicates adjacent, 0 indicates not adjacent, W r Expressed as
[0064]
[0065] Step 42: Constructing the road segment function correlation graph G f , denoted by G f =(V,E,W f ), where W f (i, j) is the functional correlation between the two road sections. The distribution of points of interest (POI) on the road section is crawled, including catering, work (such as companies, banks, etc.), business (such as shopping malls, stores, etc.), residence, science and education, medical care, etc., to form a feature vector. By calculating the POI vector pv of the two road sections i and pv j The cosine similarity obtains the functional relevance of the road section, which is expressed as:
[0066]
[0067] W f It is expressed as the following formula, where W f The value of (i,j) is the normalized Sim(pv i ,pv j )value.
[0068]
[0069] Step 43: Construct the road section public transportation related graph G p :Road section public transport correlation diagram using G p = (V,E,W p ) indicates. p (i, j) represents the public transportation correlation between the two sections. The distribution of subway and bus stations on the section is represented as a vector. By calculating the station vector tv of the two sections i and tv jCosine similarity Sim(tv i ,tv j ) to obtain the public transportation relevance of the road section. p It is expressed as the following formula, where W p The value of (i,j) is the normalized Sim(tv i ,tv j )value.
[0070]
[0071] Step 5: Use the graph convolution network to capture the link adjacency correlation, link function correlation, and link public transportation correlation, and further fuse the convolution graph. This includes the following steps:
[0072] Step 51: Use two layers of graph convolution, expressed as in A is the adjacency matrix, I is the identity matrix, is The degree matrix, W (l) is a trainable weight matrix. σ(·) is the activation function. H (l) With H (l+1) are the input and output of the lth layer of the neural network respectively.
[0073] Step 52: Fuse the convolutional graph. is the fused output matrix, expressed as:
[0074]
[0075] Step 6: Use the GRU network to capture the temporal correlation between the fused graphs. At each time t, generate a fused matrix Will Input into the GRU network for training.
[0076] Step 7. Repeat steps 5 and 6, iterate the training K times, complete the spatiotemporal graph convolutional neural network training, and save the parameters.
[0077] Step 8: According to the trained network and saved parameters, input the test sample data, calculate the predicted value through the parameters, and evaluate the performance of the spatiotemporal graph convolutional neural network.
[0078] Disclosed above are only a few specific embodiments of the present invention. Those skilled in the art may make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the present invention. However, the embodiments of the present invention are not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present invention.
Claims
1. A method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network, characterized in that: include: Extract urban road network data and perform map matching; According to whether the road sections are spatially adjacent, a road section adjacency relationship graph is constructed; According to the road section functions, a road section function correlation diagram is constructed; According to the correlation between subway and bus stops on the road section, a public transportation correlation map is obtained; The graph convolutional neural network is used to perform graph convolution operations on the road section adjacency graph, the road section function correlation graph, and the public transportation correlation graph, respectively, to capture multiple correlations including the adjacency relationship between roads, functional correlation, and public transportation correlation; The fused road section adjacency graph, road section function correlation graph, and public transportation correlation graph are input into the recurrent neural network to capture the temporal correlation at different times. Based on the multiple spatial correlations of graph convolutional neural networks and the temporal correlations of recurrent neural networks, a spatiotemporal graph convolutional neural network is constructed; The order time and the matched road section are input into the spatiotemporal graph convolutional neural network to obtain the predicted value of the online car-hailing demand on the road section in the future. The step of constructing a road segment adjacency relationship graph includes: An adjacency relationship graph is constructed based on the adjacency relationship of the road segments in the extracted road network, with road segments representing vertices, the relationship between road segments representing edges, and the edge weight between two vertices representing whether the two road segments are adjacent; The constructing of the road section function correlation graph includes: The functional relevance of road sections is obtained based on the similarity of POI distribution on the road sections. The graph structure is represented by vertices, edges and edge weight matrix. The edge weight represents the functional relevance of two road sections. The obtaining of the public transportation correlation graph comprises: The public transportation correlation is obtained by calculating the similarity of the distribution of subway and bus stations on the road segment, and the graph structure is represented by vertices, edges and edge weight matrices, where the edge weight represents the public transportation correlation of two road segments; Training of spatiotemporal graph convolutional networks, including: Input the statistical online car-hailing demand matrix into the network, set the time slice step size, and divide the demand matrix according to the step size; Perform multi-graph convolution on the established road section adjacency graph, road section function correlation graph, and road section public transportation correlation graph to capture the multiple correlations between road sections. Perform graph convolution operations on these three graphs at each moment, and then perform multi-graph fusion. The gated recurrent neural network is used to capture the temporal correlation between the fused graphs. At each moment, the fused graph is input into the recurrent neural network to capture the correlation at different moments. Output the number of online car-hailing demands for all road sections in several future time slices, reversely adjust the parameters according to the loss between the predicted results and the true values, complete the network training through iterative training, and save the training network parameters.
2. The method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network according to claim 1, characterized in that: The extracting of urban road network data and performing map matching include: Clean the data and delete the order data with missing location and time; Extract urban road network data and obtain road section information through the open source map service OpenStreetMap; According to the longitude and latitude information in the order data, the order is matched to the nearest road section using the map matching algorithm; Design the time slice length, and count the number of online car-hailing demands in each time slice and each road section according to the order time and the matched road section, which serves as the input of the network.
3. The method for predicting online car-hailing demand based on spatiotemporal multi-graph neural network according to claim 1, characterized in that: Also includes: Input the test data into the trained network, calculate the number of online car-hailing demands on the road section within a specific time in the future based on the trained network and its parameters, and output the predicted value; The direct error between the true value and the predicted value is calculated according to the evaluation index to evaluate the network performance.
