Online car-hailing order quantity prediction method based on multilevel neighborhood matrix and sequence model
Through the multi-level neighborhood matrix and sequence model, combined with the Sequence-to-Sequence model, the problem of difficulty in utilizing spatial information and neighborhood relationships in the existing technology is solved, the accuracy and efficiency of online car-hailing order volume prediction is improved, and the The need for refined management in complex urban environments.
Patent Information
- Application Number
- CN202411370287.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-09-29
AI Technical Summary
When the existing online ride-hailing order quantity prediction system uses the time series prediction model, it is difficult to make full use of spatial information and neighborhood relationships, resulting in low prediction accuracy and cannot meet the needs of refined management in complex urban environments.
Using a method based on multi-level neighborhood matrix and sequence model, the geographic hash grid division, representative grid selection, multi-level neighborhood matrix construction and neighborhood feature calculation are trained in combination with the Sequence-to-Sequence model. Forecast the number of online car-hailing orders in the future.
The prediction accuracy and training efficiency are significantly improved, and the prediction results are closer to the actual situation, which can better meet the needs of online ride-hailing operation and management.
Smart Images

Figure CN118886572A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic data prediction technology, and in particular to a method for predicting ride-hailing order volume based on a multi-level neighborhood matrix and sequence model. Background Technology
[0002] With the rapid development of information technology, shared mobility has drastically changed residents' travel habits. The ride-hailing market, relying on platforms to connect drivers and passengers, achieves a rapid balance between supply and demand. However, in popular travel areas and during peak hours, passengers still face the challenge of "difficulty in hailing a ride"; simultaneously, during off-peak hours, there is often an oversupply of ride-hailing drivers. These supply-demand mismatches lead to varying degrees of problems with ride-hailing service capacity and passenger experience.
[0003] Therefore, in modern ride-hailing operation management, order demand forecasting is a crucial task. Its goal is to predict future order demand over a specific period based on historical and current order data from urban traffic. A high-precision order demand forecasting model not only helps ride-hailing platforms rationally allocate and dispatch vehicles, improving vehicle utilization, but also reduces passenger waiting times and enhances the user travel experience. Furthermore, it plays a vital role in planning public transportation routes and managing the number of vehicles deployed.
[0004] Existing ride-hailing order volume prediction systems typically rely on time series forecasting models, such as ARIMA and LSTM. While these methods can capture patterns in time series data to some extent, their utilization of spatial information and neighborhood relationships is very limited. Especially in complex urban environments, the mutual influence between different areas is significant, and existing methods struggle to fully utilize this spatial information, resulting in low prediction accuracy and failing to meet the needs of refined management. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method for predicting ride-hailing order volume based on a multi-level neighborhood matrix and sequence model.
[0006] To achieve the aforementioned objectives, the technical solution adopted by this invention includes: In a first aspect, the present invention provides a method for predicting ride-hailing order volume based on a multi-level neighborhood matrix and sequence model, comprising: The region to be predicted is divided into geohash grids, and the ride-hailing order data in each geogrid is aggregated in a time series based on historical records to obtain order volume data; Based on the clustering and analysis of the order volume data, several representative grids are selected; A multi-level neighborhood matrix is constructed using multiple representative grids, and the multi-level neighborhood matrix represents the adjacency relationship between any representative grid and other representative grids at multiple levels; The neighborhood features are calculated using the multi-level neighborhood matrix and order volume data. The neighborhood features represent the weighted sum of the order volume data of each representative grid calculated based on the multi-level neighborhood matrix and other representative grids with the adjacent relationship. The order volume data and neighborhood features in the first time period are used as input to the sequence-sequence model, and the order volume data in the second time period are used as labels to train the sequence-sequence model, wherein the first time period and the second time period are consecutive in time series and the second time period is later in time. By inputting the real-time sequence data of the current period into the trained sequence-sequence model, the prediction results of the time series distribution of ride-hailing order volume in future periods can be obtained.
[0007] Secondly, the present invention also provides a ride-hailing order volume prediction system based on a multi-level neighborhood matrix and sequence model, which includes: The data acquisition module is used to divide the area to be predicted into geohash grids and to perform time-series aggregation of ride-hailing order data in each geogrid based on historical records to obtain order volume data. A representative grid module is used to select multiple representative grids based on the clustering and analysis of the order volume data; The neighborhood relationship module is used to construct a multi-level neighborhood matrix using multiple representative grids, wherein the multi-level neighborhood matrix represents the adjacency relationship between any representative grid and other representative grids at multiple levels; The neighborhood feature module is used to calculate neighborhood features using the multi-level neighborhood matrix and order volume data; The model training module is used to take the order volume data and the neighborhood features in the first time period as input to the sequence-sequence model, and take the order volume data in the second time period as labels to train the sequence-sequence model, wherein the first time period and the second time period are consecutive in time series and the second time period is later in time. The data prediction module is used to input real-time sequence data of the current period into the trained sequence-sequence model to obtain the prediction results of the time series distribution of ride-hailing order volume in future periods.
[0008] Thirdly, the present invention also provides a readable storage medium storing a computer program, wherein the computer program is executed to perform the steps of the above-described ride-hailing order volume prediction method.
[0009] Based on the above technical solution, compared with the prior art, the beneficial effects of the present invention include at least the following: The ride-hailing order volume prediction method provided by this invention utilizes geohashing grids to divide and select representative grids for training a sequence-to-sequence model, avoiding interference from invalid data and significantly improving training efficiency and model accuracy. Furthermore, this invention identifies multi-level neighborhood features for the selected representative grids and uses these features as input variables in the model training process, participating alongside historical order volume data. This ensures that the model training fully considers the influence of neighborhood relationships, aligning with the actual impact of ride-hailing demand distribution. Consequently, the predicted results more closely approximate reality, guaranteeing accuracy and providing stronger reference value for ride-hailing operation management.
[0010] The above description is merely an overview of the technical solution of the present invention. In order to enable those skilled in the art to better understand the technical means of this application and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described below in conjunction with detailed drawings. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the network structure of a sequence-sequence model provided in a typical embodiment of the present invention; Figure 2 This is a schematic diagram of the overall process of the ride-hailing order volume prediction method provided in a typical implementation case of the present invention; Figure 3a This is an example diagram of the direct neighborhood matrix provided in a typical embodiment of the present invention; Figure 3b This is an example diagram of a quadratic neighborhood matrix provided in a typical embodiment of the present invention; Figure 3c This is an example diagram of a functional neighborhood matrix provided in a typical embodiment of the present invention; Figure 4 This is a schematic diagram of the LSTM unit structure in a sequence-sequence model provided in a typical embodiment of the present invention; Figure 5 This is a prediction performance test chart of the prediction model provided by a typical implementation case and multiple control cases of the present invention. Detailed Implementation
[0012] In view of the shortcomings of the prior art, the inventors of this invention, through long-term research and extensive practice, have proposed the technical solution of this invention. The following will further explain and illustrate the technical solution, its implementation process, and its principles.
[0013] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0014] Moreover, relational terms such as “first” and “second” are used merely to distinguish one component or method step from another that has the same name, without necessarily requiring or implying any such actual relationship or order between these components or method steps.
[0015] This invention provides a method for predicting ride-hailing order volume based on a multi-level neighborhood matrix and sequence model, which includes the following steps: The region to be predicted is divided into geohash grids, and the ride-hailing order data in each geogrid is aggregated in a time series based on historical records to obtain order volume data; Based on the clustering and analysis of the order volume data, several representative grids are selected; A multi-level neighborhood matrix is constructed using multiple representative grids, and the multi-level neighborhood matrix represents the adjacency relationship between any representative grid and other representative grids at multiple levels; The neighborhood features are calculated using the multi-level neighborhood matrix and order volume data. The neighborhood features represent the weighted sum of the order volume data of each representative grid calculated based on the multi-level neighborhood matrix and other representative grids with the adjacent relationship. The order volume data and neighborhood features in the first time period are used as input to the sequence-sequence model, and the order volume data in the second time period are used as labels to train the sequence-sequence model, wherein the first time period and the second time period are consecutive in time series and the second time period is later in time. By inputting the real-time sequence data of the current period into the trained sequence-sequence model, the prediction results of the time series distribution of ride-hailing order volume in future periods can be obtained.
[0016] In existing technologies, the main methods for predicting ride-hailing order demand fall into two categories: knowledge-driven and data-driven. Current research focuses on data mining methods based on large amounts of historical data. Data-driven prediction can also be divided into two main categories: traditional (based on statistical analysis, nonlinear theory, and traditional machine learning) and deep learning-based methods. Traditional prediction methods mainly rely on statistical and regression analysis based on historical data, but they cannot fully consider the spatiotemporal characteristics and nonlinear relationships of ride-hailing demand.
[0017] Therefore, it is necessary to study a new method for forecasting ride-hailing demand in order to improve forecasting accuracy and efficiency.
[0018] While some existing technologies involve using sequence-to-sequence models for traffic index prediction, such as the Chinese invention patent CN110619427A, "Traffic Index Prediction Method and Device Based on Sequence-to-Sequence Learning Model," although these technologies have certain universality in traffic data prediction, directly applying them to the field of ride-hailing order volume prediction does not yield good results. The inventors of this invention have discovered that even a simple sequence-to-sequence model used for ride-hailing order volume prediction still faces accuracy issues. This is because ride-hailing order demand differs from traffic data such as public transportation, subway station entry and exit, and parking lot saturation. Ride-hailing demand exhibits distinct temporal and spatial characteristics, and the correlation and influence between adjacent spaces are more significant. The results obtained by using only a sequence-to-sequence model combined with traditional uniform grid segmentation methods cannot fully fit the changes in actual ride-hailing demand.
[0019] The multi-level neighborhood matrix used in this invention can fully consider the spatiotemporal correlation and characteristics of ride-hailing order demand. The sequence-to-sequence model (its structure can be found in...) Figure 1 (As shown) It can handle variable-length sequences and has high adaptability to indeterminate-length sequences. It performs well in fields such as machine translation and dialogue systems. This invention is an innovative attempt to apply it to the time series prediction of ride-hailing order volume. Compared with conventional demand forecasting methods, it also shows strong adaptability. It can fully consider the nonlinear relationship of ride-hailing demand and automatically learn complex features from the data to improve prediction accuracy.
[0020] For the geographic grid processing part, existing studies often fail to properly classify ride-hailing trip prediction areas. Conventional methods employ uniform grid division or multi-scale spatial partitioning, which offers advantages such as simplicity, convenience, and strong portability. However, in ride-hailing order demand prediction, due to spatial hotspots and cold spots, ride-hailing demand is unevenly distributed across regions. Using such grid divisions can easily lead to significant differences in demand across regions, causing a decrease in prediction accuracy. This invention improves the grid features, enabling the mining of spatiotemporal correlations among grid regions of the same category, thereby enhancing the accuracy of demand prediction. Furthermore, the proposed scheme fully considers the adjacency relationships of selected grids, incorporating these relationships as an input feature for model training. The calculation of neighborhood features can be achieved by combining the neighborhood matrix and order volume data to better capture the spatial relationships between different grid regions and their impact on order volume. Specifically, introducing order volume data into the calculation of neighborhood features helps the model understand the dependencies between regions and how the order volume of a particular grid region is affected by changes in the order volume of its neighbors. The resulting model can then make sufficient adjustments based on the corresponding grid neighborhood relationships during prediction, thus maximizing its approximation of actual patterns.
[0021] For some typical application examples of the above technical solutions, see Figure 2 As shown, the process of the ride-hailing order volume prediction method provided by the present invention may include, for example: 1. Data Input and Preprocessing: a) Collect historical ride-hailing order data and count the number of orders by grid according to the latitude and longitude of the order initiation location.
[0022] b) Generate multi-level neighborhood matrices in various ways, including direct adjacency matrices, second-order neighborhood matrices, and functional neighborhood matrices.
[0023] c) Calculate the neighborhood features of each grid based on the neighborhood matrix and order volume data.
[0024] 2. Construct a multi-level neighborhood matrix: a) Generate a direct adjacency matrix based on the direct proximity relationships between grids.
[0025] b) represents the second-order neighborhood matrix representing the second-order proximity relationship between grids.
[0026] c) Generate a functional neighborhood matrix based on regional characteristics, such as residential areas and concentrated commercial areas.
[0027] 3. Preprocess the collected data, including data cleaning, data normalization, and time series segmentation.
[0028] 4. Construct a sequence-to-sequence model, input the data into the model for training, and the model structure includes: a) Input layer: Receives order volume data and neighborhood feature data.
[0029] b) Encoder: The input data is encoded through an LSTM layer to extract time series features.
[0030] c) Decoder: Decodes the encoder output through an LSTM layer to predict future order volume.
[0031] d) Output layer: The prediction results are output through a fully connected layer.
[0032] 5. Input real-time data into the trained prediction model and output the prediction results of the demand for ride-hailing services in the next 24 hours.
[0033] The above scheme proposes a ride-hailing order volume prediction system based on a multi-level neighborhood matrix and a Seq2Seq model (i.e., sequence-sequence model), which can make full use of the multi-level neighborhood features between different grid areas and improve the accuracy of order volume prediction.
[0034] Furthermore, in the above exemplary scheme, the time granularity is divided into 1-hour units, but it is not limited to this. Usually, half-hour or 2-hour units are used for prediction, which can also reflect the changing patterns of the day. At the same time, the input data generally uses the sequence data of the past 48 hours, but it is not limited to this. Similarly, the output data usually outputs the sequence prediction of the next 24 hours, but it does not mean that it can only output the prediction results of 24 hours.
[0035] The loss function used in the model training process can be of various types. For example, the mean squared error (MSE) function can be used to express the difference between the predicted value and the label value. Its calculation formula is as follows: ; Where MSE represents the value of the mean squared error loss function, n represents the sample size, and Y represents the mean squared error loss function. i Indicates the tag value. This represents the predicted value.
[0036] Of course, apart from the mean squared error loss function, other loss functions that can reflect the difference between predicted and labeled values can theoretically guide the model training process.
[0037] In some implementations, the selection process for the representative grid specifically includes the following sub-steps: The geographic grid is clustered using K-means to form multiple groups, with each group having consistent order characteristics.
[0038] Geographic grids that satisfy preset order patterns are selected from multiple groups to form a set of representative grids.
[0039] In some implementations, the order characteristics include peak order volume, mean order volume, variance, and trend of change. In some implementations, the preset order pattern includes a stable order volume pattern calculated based on the order characteristics, indicating that the corresponding representative grid exhibits a stable order volume pattern across different dates. A stable order volume generally refers to consistent performance of order characteristics such as peak order volume, peak time, and average order volume across multiple dates. This can be filtered using multi-day variance or multi-day fluctuation range. The specific stability calculation method is not limited, as long as it demonstrates a relatively stable pattern within the representative grid.
[0040] As a typical application example of the above technical solution, step (1) mentioned above specifically involves: collecting relevant data such as historical ride-hailing orders, weather, and traffic, and aggregating the order volume by hour according to the geo-hash grid encoding. Since some natural scenic areas and river areas do not generate order volume, the specific example of this invention uses the K-means clustering algorithm to filter out redundant grids to improve the prediction accuracy and computational efficiency of the model.
[0041] In K-means clustering, the geographic grids within each group exhibit similar order characteristics, such as peak order volume, mean, variance, and trends in order volume. Feature analysis directly reduces data redundancy. Finally, geographic grids with pre-defined order patterns are selected as the training dataset, and cross-validation and performance evaluation ensure the accuracy of the algorithm's classification. This geographic grid selection method significantly improves the efficiency and accuracy of the prediction model. Compared to traditional methods that directly use all grids for training, this geographic grid selection method offers the following advantages: a. Improved computational efficiency: Reduced training data size, accelerating model training speed.
[0042] b. Improved prediction accuracy: Through clustering and importance analysis, the representativeness of the selected geographic grids is ensured, thereby improving the accuracy of the prediction model.
[0043] c. Enhanced model versatility: Applicable to datasets in different regions and time periods, ensuring stable model performance in various application scenarios.
[0044] It is evident that this invention not only achieves a technological breakthrough in order volume prediction models, but also further enhances the overall system performance and application value through an optimized geographic grid selection method.
[0045] Regarding how to consider the impact of adjacency relationships, in some implementations, the adjacency relationships include direct adjacency, second-order adjacency, and functional adjacency; direct adjacency means that two representative grids have a common boundary; second-order adjacency means that a representative grid has a direct adjacency relationship with at least two other representative grids; functional adjacency means that two representative grids with an adjacency relationship have the same functional attributes.
[0046] In some implementations, the functional attributes include, but are not limited to, multiple categories such as commercial areas, school areas, tourist areas, hospital areas, and air-rail hub areas. In some specific examples, the functional attributes can be divided based on building attributes within the geographic grid, such as the presence of hospitals, schools, residential areas, or tourist attractions. If multiple attributes exist, they can be classified based on proportion. The specific classification method is not limited and can be found in many existing technologies.
[0047] In some implementations, the multi-level neighborhood matrix is represented as a combined neighborhood matrix, and the calculation method of the combined neighborhood matrix is as follows:
[0048]
[0049]
[0050]
[0051] in, Represents the combined neighborhood matrix; Represents the direct neighborhood matrix; Represents a second-order neighborhood matrix; This represents the multiplication operation of the direct neighborhood matrix. The second-order neighborhood matrix is obtained by multiplying the first-order neighborhood matrix, which can capture a wider range of spatial relationships and capture spatial information of order volume at a slightly longer distance. Represents the functional neighborhood matrix; is the weighting coefficient; i and j represent the index numbers of the representative grid.
[0052] When analyzing spatial data, considering adjacency relationships is crucial because the attributes of spatial data are often influenced by the surrounding area. Specifically, city order data falls under spatial data, which generally has the following characteristics: 1. Spatial Autocorrelation: Spatial data often exhibits autocorrelation, meaning that the attributes of one region are correlated to some extent with the attributes of neighboring regions. This autocorrelation may not be limited to the immediate neighborhood but may extend to more distant areas.
[0053] 2. Scale effect: Data characteristics may differ at different scales. Direct neighborhood may capture local features, while second-order neighbor relationships may reveal broader patterns or trends.
[0054] 3. Increased complexity: Real-world problems are often complex, and this complexity may need to be captured by considering a wider range of adjacency relationships.
[0055] Analysis of the roles of second-order neighborhood and functional neighborhood matrices: 1. More comprehensive pattern recognition: By considering second-order adjacency relationships, more complex spatial patterns can be identified, which may be ignored when only direct neighborhoods are considered.
[0056] 2. Improve prediction accuracy: Second-order adjacency can provide additional information when making spatial predictions, which helps to improve the accuracy of predictions.
[0057] 3. Enhanced robustness: Considering second-order adjacency relationships can increase the robustness of the model in the presence of noise or missing data, as it can utilize broader spatial information to compensate for local uncertainties.
[0058] 4. Multi-scale analysis: Second-order adjacency allows the model to be analyzed at multiple scales, which helps to capture spatial features at different scales.
[0059] 5. Improve interpretability: Considering second-order adjacency can provide a deeper understanding of spatial data and help to interpret and understand complex phenomena in the data.
[0060] In Geographic Information Systems (GIS), second-order adjacency relationships can help better understand spatial distribution and relationships when analyzing land use and urban planning issues. Similarly, this can be applied to predicting ride-hailing order volumes. In machine learning, considering second-order adjacency relationships when training models on spatial data can improve the model's ability to learn spatial features, thereby enhancing model performance.
[0061] In summary, second-order adjacency provides a more comprehensive perspective for analyzing and understanding spatial data. Its importance lies in its ability to capture more complex spatial patterns and improve the predictive power of models. Furthermore, grid regions with similar attributes often exhibit similar order volume characteristics; therefore, incorporating functional features can enhance the model's ability to capture features from similar regions.
[0062] Therefore, compared to simply considering one type of adjacency relationship, comprehensively considering multiple adjacency relationships of different categories and orders is more crucial for obtaining accurate prediction results.
[0063] As a typical example, the process of step (2) described above can be specifically as follows: First, construct a multi-level neighborhood matrix, including the direct neighborhood matrix. This represents the direct adjacency relationship between each grid cell, and the specific generation method is as follows:
[0064] The second-order neighborhood matrix represents the relationship between each grid cell and its second-order neighborhood. The specific generation method is as follows: For direct adjacency matrices Second-order neighborhood matrix The calculation method is as follows:
[0065] Then, a functional neighborhood matrix is constructed based on grid attributes (such as commercial areas and residential areas), and grid attributes are defined according to the proportion of POI categories stored in each grid. The construction method is as follows:
[0066] Exemplary images of the three types of neighborhood matrices mentioned above can be referenced. Figures 3a-3c As shown, in order to fully consider the above three neighborhood relationships, a weighted fusion strategy is introduced in the specific example of this invention to fuse the three matrices. Specifically, the neighborhood matrix is combined. The calculation formula is as follows:
[0067] Here, α, β, and γ satisfy the following conditions: α + β + γ = 1.
[0068] This weighted fusion method has the following advantages: Comprehensiveness: The fused neighborhood matrix can simultaneously consider local and global spatial relationships, as well as the relationships between functionally similar regions, providing more comprehensive neighborhood information.
[0069] Flexibility: By adjusting the values of α, β, and γ, the influence of each neighborhood matrix can be flexibly changed to optimize model performance based on different application scenarios and data characteristics (e.g., training corresponding models for prediction in different types of cities, such as tourist cities, industrial cities, and comprehensive cities, with different weights).
[0070] Adaptability: This method can adapt to the characteristics of different urban structures and different types of regions, improving the model's generalization ability and prediction accuracy.
[0071] As a preferred example of weight setting, in general settings, direct neighbors may have a direct impact on order volume, while second-order neighbors and functional neighbors may provide indirect or more complex effects. Therefore, as a starting point, α can be set to a slightly higher weight (e.g., 0.4), and β and γ can be set to equal weight (0.3). The values and selections of the weights in the combined neighborhood matrix can be adjusted according to different scenarios and needs. 1. Principles and range of values for weight selection Essentially equal: In some cases, the relationships between direct neighbors, second-order neighbors, and functional neighbors may be equally important. For example, in a well-developed city, the impact of these three types of relationships on order volume may not differ significantly. In this case, equal or close weights can be chosen, such as α = 0.33, β = 0.33, γ = 0.34.
[0072] Emphasizing direct neighborhood relationships: In some cities, spatial distance plays a dominant role in predicting grid order volume, such as densely populated metropolitan areas with convenient inter-regional transportation. In this case, the weight of direct neighborhood may need to be larger, with a typical setting of α = 0.6, β = 0.2, γ = 0.2.
[0073] Emphasizing functional neighborhood relationships: If there are distinct functional areas in a city (such as CBDs, commercial districts, tourist attractions, etc.), the interaction between these functional areas has a significantly greater impact on order volume than spatial distance. In this case, the weight of functional neighborhoods may be higher, for example, α = 0.2, β = 0.2, γ = 0.6.
[0074] 2. Adjust weights based on the city's basic type. For first-tier cities (large metropolitan areas): Features: Densely distributed areas, well-developed transportation, and frequent interactions between different functional zones.
[0075] Suggested weights: The weights of direct neighbors can be appropriately reduced, while the weights of functional neighbors can be increased, for example, α = 0.3, β = 0.2, γ = 0.5.
[0076] Second-tier cities (medium-sized cities): Features: It has some functional zoning, but the distance between areas is still an important factor.
[0077] Suggested weights: A more balanced weighting setting may be adopted, such as α = 0.4, β = 0.3, γ = 0.3.
[0078] Third-tier and below cities (small cities or towns): Characteristics: The city is relatively evenly developed, with indistinct functional zoning, and spatial distance has a significant impact on interaction.
[0079] Suggested weights: Increase the weights of the direct and second-order neighbors, for example, α = 0.5, β = 0.3, γ = 0.2.
[0080] It should be noted that in the above weight settings, appropriate fluctuations will not affect the basic size relationship. Even if it is slightly different from the recommended value (e.g., within ±0.03), it still reflects the same rule and can achieve a nearly equivalent effect.
[0081] Therefore, in terms of weight strategy adjustment, initial weights can be set by analyzing factors such as the city's geographical spatial layout, population density, transportation network, and functional zoning, and then fine-tuned through model training. Through these strategies and discussions, the weighted fusion method of the neighborhood matrix can be flexibly applied to adapt to different application scenarios and further improve the model's predictive ability.
[0082] The above technical solution can preprocess the collected data and combine multi-level neighborhood matrix features to remove outliers and missing values. It can also normalize data of different dimensions to unify the scale and ensure data quality. Finally, the time series is segmented: the time series data is divided into time periods of a certain length as model input. Specifically, it can construct 48 steps (one step is 1 hour) input and 24 steps output. The processed data is input into the sequence-sequence model adopted in this invention for training to obtain the prediction model.
[0083] Regarding the structure and characteristics of the above model, in some implementations, the sequence-sequence model includes an encoder and a decoder, each of which includes multiple LSTM units connected in series. The serialized input data is input into the multiple LSTM units in the encoder. Each LSTM unit combines the corresponding input data and the output of the previous LSTM unit to generate the corresponding hidden state and cell state. The final hidden state and the final cell state are used as the encoding information of the entire input sequence and input into the decoder to generate predicted sequence data.
[0084] In some implementations, the encoder's calculation process is represented as follows: ;
[0085] The operation process of the decoder is represented as follows: ; in, This represents the encoded information; This refers to the encoder; This refers to the input data; Represents the neighborhood features; Represents the predicted sequence data, wherein It is an integer greater than 1, representing the number of time series in the second time period or a future time period; This refers to the decoder; This refers to the order volume data.
[0086] generally, The value is 24, which means that the time series is divided into one-hour increments throughout the day, but it is not limited to this. For example, it can be divided into half-hour increments. The value is usually 48. If the granularity is divided into 2 hours, the value is usually 12.
[0087] As a typical example, step (3) mentioned above can specifically be: building a deep learning network Sequence-to-Sequence model to realize the mapping of sequences to sequences, that is, mapping an input sequence to an output sequence. In the prediction of ride-hailing order volume demand, the order volume input sequence of the first 48 hours is used to predict the output of the next 24 hours. In this example, the granularity of the time series is divided into 1 hour. This process consists of two stages: encoding input and decoding output. The former is responsible for encoding the sequence into a fixed-length vector, which is passed as input to the latter and outputs a variable-length vector. The embodiment of this invention selects a Long Short-Term Memory (LSTM) network, the structure of which is as follows: Figure 4 As shown, a deep learning encoder-decoder (Encoder-Decoder) is constructed. In the LSTM Encoder, the input data at each time step is processed by an LSTM unit to generate the corresponding hidden state and cell state. The final hidden state and cell state of the encoder are passed to the decoder as the encoded information of the entire input sequence. The structure and principle of the LSTM Decoder are similar to those of the LSTM Encoder, but its task is to generate the sequence based on the encoder's output and the prediction from the previous time step.
[0088] The encoder's input includes the order volume time series Xi for the current grid and neighborhood relationship features: ; The decoder generates a prediction of order volume for the next 24 hours based on the encoder's hidden state and the initial input. ; Corresponding to the training process in step (3), step (4) specifically involves: using the sequence model proposed in step (3), selecting the sequence data 48 hours before the prediction date as input at the time when the latest historical data is obtained each day. Since the Sequence-to-Sequence model can accept variable-length sequences as model input, the input length can be adjusted in real time according to the actual application scenario to further improve the prediction effect and obtain the order volume 24 hours before the prediction date.
[0089] This invention also provides a ride-hailing order volume prediction system based on a multi-level neighborhood matrix and sequence model, which includes: The data acquisition module is used to divide the area to be predicted into geohash grids and to perform time-series aggregation of ride-hailing order data in each geogrid based on historical records to obtain order volume data. A representative grid module is used to select multiple representative grids based on the clustering and analysis of the order volume data; The neighborhood relationship module is used to construct a multi-level neighborhood matrix using multiple representative grids, wherein the multi-level neighborhood matrix represents the adjacency relationship between any representative grid and other representative grids at multiple levels; The neighborhood feature module is used to calculate neighborhood features using the multi-level neighborhood matrix and order volume data; The model training module is used to take the order volume data and the neighborhood features in the first time period as input to the sequence-sequence model, and take the order volume data in the second time period as labels to train the sequence-sequence model, wherein the first time period and the second time period are consecutive in time series and the second time period is later in time. The data prediction module is used to input real-time sequence data of the current period into the trained sequence-sequence model to obtain the prediction results of the time series distribution of ride-hailing order volume in future periods.
[0090] Furthermore, embodiments of the present invention also provide a readable storage medium storing a computer program, which, when run, executes the steps of the above-described ride-hailing order volume prediction method.
[0091] The technical solution of the present invention will be further described in detail below through several embodiments and in conjunction with the accompanying drawings. However, the selected embodiments are only for illustrating the present invention and do not limit the scope of the present invention.
[0092] Example 1 The selected training data consists of historical ride-hailing order data from Shanghai from March 2023 to March 2024. The grid division method is based on 7-bit geographic grid coding. Specifically, the latitude and longitude information of each ride-hailing order location is mapped to the corresponding 7-bit grid code. In this way, order data from different regions can be clearly integrated, laying the foundation for subsequent feature extraction and model training.
[0093] This approach ensures that order data can be accurately allocated to specific urban areas, helping to capture the demand differences between different functional areas of the city (such as commercial areas and residential areas). At the same time, the precision of the 7-digit code can reflect the urban structure in detail while avoiding the data sparsity problem caused by excessive segmentation.
[0094] Based on 7-bit grid-encoded data, a direct adjacency matrix, a second-order neighborhood matrix, and a functional neighborhood matrix were constructed, and a seq2seq model was used for multi-step prediction of ride-hailing order volume. This method significantly improves the accuracy and stability of prediction by incorporating spatial neighborhood features into the time series model. The root mean square error (RMSE) is used to represent the accuracy of the trained model, and the results are compared with various technical solutions. See [link to results]. Figure 5 As shown, compared with the traditional LSTM model, the accuracy obtained by using the pure Seq2Seq model is improved. However, if a grid filtering mechanism that does not consider neighborhood features is introduced, a decrease in model accuracy can be observed. When the Seq2Seq model incorporates consideration of multi-level neighborhood features during training, the model's prediction performance reaches its optimal level.
[0095] This fully demonstrates that simply introducing a filtering mechanism for grid order features to obtain representative grids cannot help train the Seq2Seq model in this scenario; on the contrary, it will have a negative impact. Therefore, the grid filtering mechanism needs to be combined with multi-level neighborhood features to synchronously guide the model training process in order to achieve a positive effect.
[0096] It should be understood that the above embodiments are merely illustrative of the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for predicting online car-hailing order volume based on multi-level neighborhood matrix and sequence model, characterized in that: include: Divide the forecast area into geographic hash grids, and aggregate the online car-hailing order data in each geographic grid in time series based on historical records to obtain order volume data; Based on clustering and analysis of the order volume data, selecting a plurality of representative grids; Using the plurality of representative grids, a multi-level neighborhood matrix is constructed, wherein the multi-level neighborhood matrix represents the neighbor relationship between any representative grid and other representative grids at multiple levels; Calculating neighborhood features using the multi-level neighborhood matrix and the order volume data, wherein the neighborhood features represent a weighted sum of the order volume data of other representative grids having the neighboring relationship with any of the representative grids calculated based on the multi-level neighborhood matrix; Using the order volume data and the neighborhood features in the first period as inputs of a sequence-sequence model, and using the order volume data in the second period as labels, to train the sequence-sequence model, wherein the first period and the second period are continuous in time series and the second period is later in time; The real-time sequence data of the current period is input into the trained sequence-sequence model to obtain the prediction results of the online car-hailing order volume in the future period according to the time series distribution.
2. The method for predicting online car-hailing order volume according to claim 1, characterized in that: The representative grid selection process specifically includes: Performing Kmeans clustering on the geographic grid to form a plurality of groups, wherein each group has consistent order characteristics; Geographical grids satisfying a preset order rule are selected from the plurality of groups to form a set of representative grids.
3. The method for predicting online car-hailing order volume according to claim 2, characterized in that: The order characteristics include peak order volume, order volume mean, variance and change trend; The preset order rule includes a corresponding representative grid having a stable order volume performance rule on different dates, which is calculated based on the order characteristics.
4. The method for predicting online car-hailing order volume according to claim 1, characterized in that: The neighbor relationship includes direct neighbor, second-order neighbor and functional neighbor; The direct adjacency means that the two representative grids have a common boundary; the second-order adjacency means that the representative grid has a direct adjacency relationship with at least two other representative grids; and the functional adjacency means that the two representative grids having an adjacency relationship have the same functional attributes.
5. The method for predicting online car-hailing order volume according to claim 4, characterized in that: The functional attributes include commercial areas, school areas, tourist areas, hospital areas, and air-rail hub areas.
6. The method for predicting online car-hailing order volume according to claim 4, characterized in that: The multi-level neighborhood matrix is expressed as a combined neighborhood matrix, and the calculation method of the combined neighborhood matrix is expressed as: ; ; ; ; in, represents the combined neighborhood matrix; represents the direct neighborhood matrix; represents the second-order neighborhood matrix; represents the multiplication operation of the direct neighbor matrix; represents the functional neighborhood matrix; is the weight coefficient; i and j represent the index numbers of the representative grids.
7. The method for predicting online car-hailing order volume according to claim 6, characterized in that: The sequence-sequence model includes an encoder and a decoder, and the encoder and the decoder each include a plurality of LSTM units connected in series; The serialized input data are respectively input into the multiple LSTM units in the encoder, and any of the LSTM units combines the corresponding input data and the output of the previous LSTM unit to generate the corresponding hidden state and cell state, and the final hidden state and the final cell state are input into the decoder as the encoding information of the entire input sequence to generate predicted sequence data.
8. The method for predicting online car-hailing order volume according to claim 7, characterized in that: The calculation process of the encoder is expressed as: ; The operation process of the decoder is expressed as: ; in, represents the coded information; represents the encoder; represents the input data; represents the neighborhood feature; represents the predicted sequence data, wherein is an integer greater than 1, representing the number of time series in the second period or the future period; represents the decoder; Indicates the order quantity data.
9. A system for predicting online car-hailing order volume based on multi-level neighborhood matrix and sequence model, characterized in that: include: The data acquisition module is used to divide the predicted area into geographic hash grids, and to aggregate the online car-hailing order data in each geographic grid in time series based on historical records to obtain order volume data; A representative grid module, used for selecting a plurality of representative grids based on clustering and analysis of the order volume data; A neighborhood relationship module, used to construct a multi-level neighborhood matrix using a plurality of the representative grids, wherein the multi-level neighborhood matrix represents the neighbor relationship between any of the representative grids and other representative grids at multiple levels; A neighborhood feature module, used to calculate neighborhood features using the multi-level neighborhood matrix and order volume data; a model training module, configured to use the order volume data and the neighborhood features in a first period as inputs of a sequence-sequence model, and use the order volume data in a second period as labels to train the sequence-sequence model, wherein the first period and the second period are continuous in time series and the second period is later in time; The data prediction module is used to input the real-time sequence data of the current period into the trained sequence-sequence model to obtain the prediction results of the online car-hailing order volume in the future period based on the time series distribution.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed, the steps of the online car-hailing order volume prediction method described in any one of claims 1 to 8 are executed.
Citation Information
Patent Citations
Traffic index prediction method and device based on sequence-to-sequence learning model
CN110619427A
Online car-hailing demand prediction method based on space-time multi-graph neural network
CN114372830A
Online car-hailing order demand prediction method based on space-time convolutional network
CN114418606A
Travel demand prediction method and system for interaction between urban functional areas
CN115204445A
Taxi and online taxi-hailing-based demand joint prediction method
CN116051171A
Cited By
Intelligent lottery sorting method and system
CN119939436A
Online car-hailing vehicle scheduling and order matching framework and system, and storage medium
CN120013028A
