A carpooling demand prediction and matching method based on neural network

By building a ConvLSTM-based carpooling demand prediction model, combining RTV graph theory and G-Tree algorithm, and taking into account user departure and arrival points as well as weather factors, the problem of insufficient prediction accuracy in existing carpooling prediction systems is solved, more efficient carpooling matching and route planning are achieved, and passenger waiting time is reduced.

CN115994787BActive Publication Date: 2025-09-26TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310151458.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2025-09-26
Estimated Expiration
2043-02-22

AI Technical Summary

Technical Problem

Existing ride-sharing prediction systems fail to fully consider the local and global correlations of user travel needs and weather factors, resulting in limited prediction accuracy and long waiting times for passengers.

Method used

A ConvLSTM-based carpooling demand prediction model is constructed. Combining RTV graph theory and G-Tree algorithm, it considers the user's departure and arrival points, as well as weather factors, to perform carpooling matching and route planning, thereby improving prediction accuracy.

Benefits of technology

It improves the accuracy of carpooling demand forecasting, significantly reduces passengers’ waiting time, and optimizes the matching efficiency of the carpooling system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994787B_ABST
    Figure CN115994787B_ABST
Patent Text Reader

Abstract

The present invention relates to a neural network-based method for predicting and matching carpooling demand, comprising the following steps: collecting real data from an actual road network and performing matrix segmentation and data mapping on the road network; collecting historical user travel data, normalizing the data, and reconstructing it; collecting weather influencing factors and normalizing both continuous and categorical data; inputting historical user travel data and weather influencing data into a convolutional long-short-term memory neural network model, and obtaining user travel prediction data through model training; using the predicted user travel data as input to a carpooling matching system, and using a matching algorithm based on G-Tree path planning and RTV graphs to obtain a carpooling matching solution and an evaluation index for user carpooling waiting time. Compared with existing technologies, the present invention improves the accuracy of user travel predictions. Simultaneously, by combining path planning and matching algorithms, it verifies that the carpooling matching method can effectively reduce user waiting time during carpooling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for predicting and matching carpooling demands based on a neural network. Background Art

[0002] Ride-sharing is a new travel model that lies between large-scale public transportation (such as subways and buses) and on-demand private transportation (such as private cars, taxis, ride-hailing services, and shared bicycles). Ride-sharing combines the shared, centralized nature of large-scale public transportation with the flexible nature of on-demand private transportation. Predictive ride-sharing systems predict current travel demand based on historical data and match vehicles with passengers and plan vehicle routes based on the predicted results and existing orders. Due to the flexible nature of passenger travel, ride-sharing platforms cannot predict passengers' exact travel needs in advance, and demand is always generated dynamically. On the other hand, passengers also want to minimize wait times, even during peak hours and areas. If a demand prediction module can be incorporated into the ride-sharing system and the ride-sharing matching and routing algorithms can be improved, the system can prioritize high-demand areas, thereby reducing passenger wait times and improving the passenger travel experience.

[0003] Existing research on predictive ridesharing largely obscures the details of the passenger boarding and alighting process and the vehicle's regional travel. The time required to pick up and drop off passengers within a specific area is highly generalized as a fixed value. However, in reality, the time required to pick up and drop off passengers within a small area is highly influenced by the distribution of passenger departure and arrival points, and this influence is difficult to quantify or represent with a simple function. Furthermore, existing research uses relatively simplistic demand forecasting methods. For example, methods based on probability distribution and sampling completely ignore other important factors influencing travel demand, including weather (including temperature, humidity, precipitation, snow depth, weather type, and other dimensions), holidays, and emergencies. Furthermore, basic long-short-term memory (LSTM) neural network models fail to consider local demand correlation (high demand areas may also have high demand areas nearby) and global demand correlation (for example, if most passengers in area A travel to area B, an increase in demand in area A will also lead to an increase in orders arriving in area B). This results in limited prediction accuracy.

[0004] In summary, existing predictive carpooling matching algorithms fail to consider factors such as user arrival requirements and weather impacts, and lack consideration of the global correlation of user travel needs; the existing LSTM model has limited prediction accuracy. Summary of the Invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned existing technologies and provide a carpooling demand prediction and matching method based on a neural network. A user travel demand neural network prediction model is constructed based on the user's departure and arrival points and taking into account weather factors, thereby improving the accuracy of user travel prediction.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] The present invention provides a method for predicting and matching carpooling demand based on a neural network, comprising the following steps:

[0008] Obtain and pre-process real-time travel demand data and implementation environmental impact data, input the pre-trained ConvLSTM-based carpooling demand prediction model, and obtain user travel prediction data;

[0009] Based on the user travel prediction data, carpooling matching is performed based on RTV graph theory, and path planning is performed using the G-Tree algorithm to obtain carpooling plans and user waiting time information.

[0010] As a preferred technical solution, the process of obtaining the carpooling plan and user waiting time information includes the following steps:

[0011] Based on the user travel prediction data, an RTV graph is constructed, and the maximum length of a single trip, the cycle for updating demand matching, and the maximum waiting time and maximum delay of passengers are set. NetworkX is used to implement G-Tree path planning, and carpooling solutions and user waiting time information are obtained.

[0012] As a preferred technical solution, the process of obtaining the pre-trained ConvLSTM-based carpooling demand prediction model includes the following steps:

[0013] Obtaining original map data, performing preprocessing including partitioning and coordinate conversion on the original map data, and obtaining a mapping between road network partitions and coordinates;

[0014] Obtaining historical travel demand data, and converting it into a preset format through normalization and reconstruction based on the mapping between the road network partitions and coordinates;

[0015] Obtain environmental impact factor data and perform normalization processing;

[0016] A training set is prepared according to the processed demand data and the processed environmental influencing factor data, and the ConvLSTM-based carpooling demand prediction model is trained using the training set to obtain the pre-trained carpooling demand prediction model.

[0017] As a preferred technical solution, the original map data includes the latitude and longitude coordinate information of each node in the traffic network.

[0018] As a preferred technical solution, the process of obtaining the mapping between the road network partitions and coordinates includes the following steps:

[0019] Obtain a coordinate transformation matrix based on the latitude and longitude coordinate system and the coordinates of multiple corresponding points in the regional coordinate system;

[0020] Coordinate transformation is implemented based on the original map data and the coordinate transformation matrix, and the mapping between the road network partitions and coordinates is obtained after normalization.

[0021] As a preferred technical solution, the environmental influencing factors include one or more of temperature, precipitation, weather type, and day of the week. Acquiring environmental influencing factor data and performing normalization processing includes the following steps:

[0022] For continuous data, the data is normalized to the preset range. For categorical data, one-hot encoding is used for normalization.

[0023] As a preferred technical solution, based on the mapping between the road network partitions and coordinates, converting to a preset format through normalization and reconstruction processing includes the following steps:

[0024] According to the historical travel data, the data range is scaled to a preset interval, and departure point data and arrival point data matching a preset format are constructed.

[0025] As a preferred technical solution, the carpooling demand forecasting model includes:

[0026] A fusion network is used to fuse the travel data and environmental impact data input into the model and obtain fusion features that match a preset format;

[0027] A ConvLSTM network is used to obtain output features based on the fused features;

[0028] The output network is used to obtain global correlation features based on the output features, and to obtain user travel prediction data based on the output features and the global correlation features.

[0029] As a preferred technical solution, the fusion network includes:

[0030] A plurality of first convolutional layers connected sequentially are used to extract features from the input travel data;

[0031] A plurality of first fully connected layers connected in sequence, for extracting features from the input environmental impact data;

[0032] The second fully connected layer is used to obtain the fusion feature according to the output of the 2D convolution layer and the first fully connected layer.

[0033] As a preferred technical solution, the output network includes:

[0034] A second convolutional layer is used to obtain global correlation features based on the output of the ConvLSTM network;

[0035] The third convolutional layer is used to obtain user travel prediction data based on the output of the ConvLSTM network and the global correlation feature, and the activation function of the third convolutional layer is tanh.

[0036] Compared with the prior art, the present invention has the following advantages:

[0037] (1) High accuracy in user travel prediction: Compared with the traditional LSTM model that fails to consider factors such as user arrival needs and weather influence, the present invention pre-processes historical travel data and environmental influence factor data, inputs the pre-trained ConvLSTM-based model to obtain the prediction results, and adopts a matching algorithm based on G-Tree path planning and RTV graph to obtain a carpooling matching solution and obtain an evaluation index of the user's carpooling waiting time. It fully considers the weather influence factor to construct the user's travel needs, thereby improving the prediction accuracy.

[0038] (2) The global correlation of user travel demand is taken into consideration. After obtaining the output features of the ConvLSTM network, the global correlation features are calculated, and the final prediction results are obtained based on the output features and correlation features, which further improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a flow chart of the neural network-based carpooling demand prediction and matching method in Example 1;

[0040] Figure 2 This is a schematic diagram of rectangular segmentation of the real Manhattan road network;

[0041] Figure 3 Comparison between user travel prediction data based on ConvLSTM and real data. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0043] In this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise specifically specified.

[0044] Example 1

[0045] like Figure 1 As described above, this embodiment provides a method for predicting and matching carpooling demand based on a neural network. Compared with most existing models that can only predict travel demand starting from a certain area, the model provided by the present invention processes the data into departure angles and arrival angles respectively, and can predict the number of demands for traveling from one area to another. At the same time, the model also takes into account the global correlation of demand. For example, if most people living in place A work in place B, there is an obvious correlation between the fluctuations in the demand for departure from place A and the demand for arrival at place B. The model can capture this feature in the data set and learn the corresponding change rules. Based on the ConvLSTM neural network demand prediction model, the present invention combines the G-Tree path planning algorithm and the RTV graph carpooling matching algorithm to realize carpooling matching based on user travel demand prediction on the actual road network.

[0046] The method comprises the following steps:

[0047] Step S1, obtain the map. Obtain the original data of the urban traffic network G, mainly including the longitude and latitude coordinates of the nodes (lat i ,lon i ).

[0048] Step S2, map partitioning. Divide the original road network into M×N rectangular areas, and use the longitude and latitude coordinates (lat i ,lon i ) is converted to the coordinates within the region (x i ,y i ) algorithm. Since both coordinate systems reside in a two-dimensional plane, the conversion between them can be considered a projective transformation. Based on the properties of projective transformations, the projective transformation matrix M can be calculated given the coordinates of four corresponding points in the two coordinate systems. This provides a method for converting geographic coordinates into grid coordinates.

[0049] First, expand the geographic longitude and latitude [a, o] (a: latitude, o: longitude) into the form of homogeneous coordinates:

[0050] c g =[a,o,1] T

[0051] Then, the homogeneous coordinates are multiplied by the transformation matrix M to obtain the homogeneous coordinates of the geographic point in the grid coordinate system:

[0052] c m =[x h ,y h ,w h ] T =Mc g

[0053] Finally, normalize the homogeneous coordinates and round them to get the coordinates (x, y) of the grid area to which the geographic location belongs:

[0054] x=x h / / w h

[0055] y=y h / / w h

[0056] Among them, / / represents integer division.

[0057] Step S3: Normalization and reconstruction of historical travel demand data. For travel demand data, its data range needs to be changed from the interval [0,d max ] is scaled to the interval [-1,1].

[0058] Reconstruct historical travel demand data and construct travel data from the starting point Travel data with arrival points The specific operation is: in order to construct For an M×N×M×N tensor X t , split it in the fourth dimension to produce N M×N×M tensors; connect these tensors in the third dimension to produce a three-dimensional tensor of M×N×MN In order to construct Swap X first t The same operation can be performed on the 1st and 2nd dimensions and the 3rd and 4th dimensions.

[0059] Step S4: Normalize the environmental influencing factor data. There are two normalization methods: for "continuous" data, such as temperature and precipitation, the data range is scaled to the interval [0, 1]; for "categorical" data, such as weather type and day of the week, one-hot encoding is used.

[0060] Step S501: Input ConvLSTM model training data. Travel data is input into ConvLSTM. and After passing through three 2D convolutional layers, the third dimension of the tensor data is considered as the channel dimension. It is worth mentioning that in order to keep the shape of the input and final output data unchanged, all convolutional layers in the network have enabled edge padding. The influencing factor data is input into the ConvLSTM. Influencing factor data W t First, three fully connected layers are passed to generate the influencing factor feature F with a length of L W Then, in order to combine the two data with different dimensions, it is necessary to W Replicate M×N times to generate a three-dimensional tensor and combine it with F X Connected in the third dimension, and continue through a fully connected layer to complete the fusion of travel demand information and influencing factor information. This fusion feature F XW It will be used as the input of ConvLSTM.

[0061] In step S502, the following parameters need to be considered when training the model: the length of a single time series, L, the length of the training period, T, and the batch size, b. The following formula represents the data structure of each input to the neural network, where the last column is the validation data.

[0062]

[0063] Step S503: ConvLSTM model output. The output feature of ConvLSTM is named F f , the number of channels is set to C f , that is, the shape is M×N×C f In order to generate the features of global correlation, it is first necessary to pass it through a channel number C s The convolution layer produces a shape of M×N×C s Features F s . Subsequently, F s The shape is reshaped to MN×C s . Two-dimensional F s It can be understood as a list of each region and its demand characteristics. Define the matrix:

[0064]

[0065] The generated matrix S is of shape MN×MN, which can be understood as the correlation matrix between regions. f Reshape into MN×C f Shape and multiply by S:

[0066] F g =F f S

[0067] Then convert the shape back to M×N×Cf , we can get the global correlation feature F g Finally, F f With F g After feature concatenation, the convolutional layer completes the fusion of globally relevant information. Since the output of this layer directly serves as the output of the entire model, it must be formatted identically to the travel demand data. Furthermore, travel demand data is not categorical. Based on these two factors, the activation function of this layer must be tanh, and the number of channels must be MN. This allows the network to generate demand forecast data for time t+1.

[0068] In steps S7 and S8, the generated travel demand forecast is matched to ridesharing routes based on RTV graph theory. The G-Tree algorithm is used for route planning. The performance of the invented method is verified by comparing and analyzing the results of predictive and non-predictive ridesharing, using average passenger wait time as the evaluation criterion.

[0069] This method was implemented based on the actual road network in Manhattan and verified using the following method:

[0070] Step 1, the road network dataset comes from the Manhattan road network of OpenStreetMap (OSM), an open source map platform. The present invention uses OpenStreetMap's Overpass API and its corresponding Python toolkit, OSMPythonTools, to complete data download and filtering. Enter the ID of the corresponding area and all required road types into the Overpass API to download the required data. The downloaded data is divided into two parts: nodes and roads. The node data contains the latitude and longitude of the point, while the road data contains the type of road and the list of nodes it passes through. This project stores the two types of data in two .csv files respectively.

[0071] Step 2, divide the Manhattan road network into 5×15 rectangular areas ( Figure 2 The road network in each area is further partitioned. The fanout is set to 4, and the vertex capacity of each leaf node is 32.

[0072] Step 3 uses taxi data from Manhattan, New York, as the dataset for demand forecasting and driving simulation. This dataset is derived from taxi order data published by the New York Taxi & Limousine Commission (NYC TLC). The data discloses the origin, destination, and start time of each order and can be downloaded directly from the official website in .csv format. During the implementation of this invention, travel data from June and July 2015 was obtained. Because the original dataset was not sorted by time, a preprocessing program traversed each trip data entry in New York City in June and July 2015, adding the number of travelers to the corresponding departure and arrival areas of the corresponding data frame.

[0073] Step 4: Weather data comes from the Local Climatological Data (LCD) dataset from the National Centers for Environmental Information (NCEI), a subsidiary of the National Oceanic and Atmospheric Administration (NOAA). This dataset contains data from over 1,000 monitoring sites across the United States since 2005. Data for the corresponding region can be obtained by applying to the agency. The normalized data format is shown in Table 1.

[0074] Table 1 Content and format of influencing factor data

[0075]

[0076] Step 5: TensorFlow is the most commonly used machine learning platform. As the name suggests, TensorFlow excels at processing tensors and flowing them between neural network layers. Keras, on the other hand, is a high-level machine learning API that can be built on TensorFlow. It hides the underlying technical details and provides a user-friendly way to build and interact with neural networks. This project uses both of these to build and train a ConvLSTM neural network model.

[0077] TensorFlow's neural network training process divides data into batches, completing backpropagation and updating weights after each batch is trained. Due to computer memory limitations, extremely long time series cannot be loaded into memory. Furthermore, due to the nature of batch training, the sequence length is fixed, necessitating repeated loading of some data into memory to train various RNNs in Keras without losing useful information. Therefore, the model in this project trains on a relatively short period of time, saves the model, and continues training in the next period.

[0078] In Step 6, consider the following parameters for model training: the length of a single time series, L, the length of a training period, T, and the batch size, b. The configurations are as follows: L = 24, T = 576, b = 32, and 200 epochs are trained per period.

[0079] Step 7, the present invention first uses the Manhattan travel data from 0:00 on July 15, 2015 to 23:30 on July 29, 2015 to train the demand forecasting model. Then, the present invention uses the real travel data from July 29, 2015 to July 31, 2015 to simulate the forecast demand. The real travel demand and the forecast travel demand are as follows: Figure 2 As shown. Figure 2 It can be seen that the demand forecasting model constructed by the present invention has a good forecasting effect, which reflects the similarity between the predicted results and the actual results in spatial distribution. The obtained forecast results can serve as a support for predictive carpooling matching.

[0080] Step 8, when constructing the RTV graph, the maximum length of a single journey is set to 4; the cycle for updating demand matching is 1 minute; the maximum waiting time and the maximum delay of passengers are both 5 minutes. At the same time, NetworkX is used to implement G-Tree path planning. When matching carpooling, it is assumed that there are a total of 2,000 vehicles providing carpooling services. The maximum allowed waiting time for passengers is set to 5 minutes. Through simulation, it is found that the average waiting time for passengers under predictive carpooling is 155.1 seconds, and the waiting time for passengers under non-predictive carpooling is 161.0 seconds. It is confirmed that the predictive carpooling matching algorithm proposed in the present invention can significantly reduce the waiting time of passengers.

[0081] like Figure 3 (a) and (b) are the predicted demand and actual demand from the starting point perspective, respectively. Figure 3 (c) and (d) are the predicted demand and actual demand at the arrival point, respectively.

[0082] The present invention constructs a neural network prediction model for user travel demand based on the user's departure and arrival points and takes weather factors into consideration, thereby improving the accuracy of user travel prediction. At the same time, combined with the path planning algorithm and matching algorithm, it is verified that the carpooling matching method based on user travel prediction proposed in the present invention can effectively reduce the waiting time of users during the carpooling process.

[0083] Example 2

[0084] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the neural network-based carpooling demand prediction and matching method as described in Example 1.

[0085] Example 3

[0086] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the neural network-based carpooling demand prediction and matching method as described in Example 1.

[0087] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A carpooling demand prediction and matching method based on neural network, characterized in that: The steps include: Obtain and pre-process real-time travel demand data and implementation environmental impact data, input the pre-trained ConvLSTM-based carpooling demand prediction model, and obtain user travel prediction data; Based on the user travel prediction data, carpooling matching is performed based on RTV graph theory, and path planning is performed using the G-Tree algorithm to obtain carpooling plans and user waiting time information. The process of obtaining the carpooling plan and user waiting time information includes the following steps: Based on the user travel prediction data, an RTV graph is constructed, setting the maximum length of a single trip, the update demand matching cycle, and the maximum waiting time and maximum delay of passengers. NetworkX is used to implement G-Tree path planning, obtain carpooling solutions and user waiting time information, The carpooling demand forecasting model includes: A fusion network is used to fuse the travel data and environmental impact data input into the model and obtain fusion features that match a preset format; A ConvLSTM network is used to obtain output features based on the fused features; An output network is used to obtain global correlation features based on the output features, and to obtain user travel prediction data based on the output features and the global correlation features. The fusion network includes: A plurality of first convolutional layers connected sequentially are used to extract features from the input travel data; A plurality of first fully connected layers connected in sequence, for extracting features from the input environmental impact data; The second fully connected layer is used to obtain the fusion features according to the output of the 2D convolutional layer and the first fully connected layer. The output network includes: A second convolutional layer is used to obtain global correlation features based on the output of the ConvLSTM network; The third convolutional layer is used to obtain user travel prediction data based on the output of the ConvLSTM network and the global correlation feature, and the activation function of the third convolutional layer is tanh.

2. The method for predicting and matching carpooling demand based on a neural network according to claim 1, characterized in that: The process of obtaining the pre-trained ConvLSTM-based carpooling demand prediction model includes the following steps: Obtaining original map data, performing preprocessing including partitioning and coordinate conversion on the original map data, and obtaining a mapping between road network partitions and coordinates; Obtaining historical travel demand data, and converting it into a preset format through normalization and reconstruction based on the mapping between the road network partitions and coordinates; Obtain environmental impact factor data and perform normalization processing; A training set is prepared according to the processed demand data and the processed environmental influencing factor data, and the ConvLSTM-based carpooling demand prediction model is trained using the training set to obtain the pre-trained carpooling demand prediction model.

3. The method for predicting and matching carpooling demand based on a neural network according to claim 2, characterized in that: The original map data includes the latitude and longitude coordinate information of each node in the traffic network.

4. The method for predicting and matching carpooling demand based on a neural network according to claim 2, characterized in that: The process of obtaining the mapping between the road network partitions and the coordinates includes the following steps: Obtain a coordinate transformation matrix based on the latitude and longitude coordinate system and the coordinates of multiple corresponding points in the regional coordinate system; Coordinate transformation is implemented based on the original map data and the coordinate transformation matrix, and the mapping between the road network partitions and coordinates is obtained after normalization.

5. The method for predicting and matching carpooling demand based on neural network according to claim 2, characterized in that: The environmental influencing factors include one or more of temperature, precipitation, weather type, and day of the week. Acquiring environmental influencing factor data and performing normalization processing includes the following steps: For continuous data, the data is normalized to the preset range. For categorical data, one-hot encoding is used for normalization.

6. The method for predicting and matching carpooling demand based on neural network according to claim 2, characterized in that: Based on the mapping between the road network partitions and the coordinates, converting to a preset format through normalization and reconstruction processing includes the following steps: According to the historical travel data, the data range is scaled to a preset interval, and departure point data and arrival point data matching a preset format are constructed.

Citation Information

Patent Citations

  • Rideshare vehicle demand forecasting device, method for forecasting rideshare vehicle demand, and storage medium

    US20210174270A1

  • Method and system for predicting carpool matching probability in ridesharing

    US20220108227A1