Regional network car-hailing demand prediction method and system based on improved LSTM

By dividing the online car-hailing demand area into sub-areas, constructing feature data and using the improved LSTM model for prediction, it solves the problems of difficult data collection and low prediction efficiency in the existing technology, and achieves accurate prediction of online car-hailing demand. and capacity planning.

CN118551978AInactive Publication Date: 2024-08-27BEIJING BAILONG MAYUN TECH CO LTD

Patent Information

Application Number
CN202410673033.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, online ride-hailing demand prediction methods require a large amount of real-time feature data, which results in difficulty in data collection, high consumption of computing resources, low prediction efficiency, and difficulty in ensuring accuracy, especially when forecasting one-hour demand within a short time interval.

Method used

By dividing the area to be predicted into equal-area sub-areas, we construct characteristic data including working days, rest days, weather and platform coupon issuance, use the improved LSTM model for training and prediction, and revise the accuracy based on the historical daily average order number. , improve prediction accuracy.

Benefits of technology

It achieves accurate prediction of online car-hailing demand in different regions within one day with less characteristic data, guides online car-hailing platform capacity planning, and improves public travel efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551978A
    Figure CN118551978A
Patent Text Reader

Abstract

The invention discloses an improved LSTM-based regional online car-hailing demand prediction method and system, and relates to the technical field of online car-hailing. Comprising the following steps: performing equal-area region division on a to-be-predicted region, obtaining historical online car-hailing demand data in each sub-region, and constructing feature data of an online car-hailing demand number; performing normalization processing on the weather characteristic data of the online car-hailing demand quantity to generate a first data set; establishing an LSTM model, selecting an activation function and an optimization algorithm, and setting parameters of the LSTM model; training the LSTM model with the set parameters according to the obtained data to obtain prediction reference values of the current skynet car-hailing demand quantity of different sub-regions; comparing the demand prediction reference value with the historical daily average order quantity of the corresponding sub-region, and judging the accuracy of the demand prediction reference value; and revising the current-skynet car-hailing demand quantity prediction reference values which do not meet the precision requirement to obtain current-skynet car-hailing demand quantity prediction values of different sub-regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field related to online car-hailing, and specifically to a method and system for predicting regional online car-hailing demand based on improved LSTM. Background Art

[0002] Online ride-hailing has become an important part of the urban public transportation system, meeting diverse travel needs. However, the contradiction between the rapid growth of urban residents' online ride-hailing travel needs and the supply and demand of service vehicle resources has gradually become prominent. If the travel needs of residents can be accurately predicted, the online ride-hailing platform can allocate vehicle supply in a timely manner.

[0003] Long Short Term Memory Neural Network (LSTM), in LSTM, the network unit is designed to retain long-term memory of previously input information, so as to better process sequence data. Each unit in the model includes three gates: input gate, forget gate and output gate. Each gate controls the flow of information and can selectively retain or discard information. Long-term memory can be updated and retained through the gating mechanism. This mechanism enables LSTM to better handle long-term dependencies, making it a powerful tool widely used in time series prediction tasks.

[0004] In the prior art, publication number CN114708011A discloses a feature segmentation method for predicting demand for online ride-hailing vehicles. This method divides features into periodic features and near-point features, and uses a combination of LSTM and DNN to process different features respectively. Finally, DNN fuses the corresponding two types of coding features, which can solve the one-hour short-term prediction problem of online ride-hailing vehicles. This method can improve the prediction accuracy; however, this method requires a large amount of real-time feature data, which is not easy to collect. At the same time, the accuracy of the data needs to be guaranteed, which is difficult to achieve in real life. Each time the demand problem of online ride-hailing vehicles is predicted for one hour, it is necessary to collect data again for prediction within a very short time interval, which requires a large amount of computing resources, which reduces the prediction efficiency and also causes errors in the feature data, increasing the possibility of reduced prediction accuracy.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a method and system for predicting regional online car-hailing demand based on improved LSTM to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A regional online car-hailing demand prediction method based on improved LSTM, the specific steps include:

[0009] Divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders;

[0010] Construct characteristic data of the number of online car-hailing demands, wherein the characteristic data includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, wherein the weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day;

[0011] Normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, weekends, and the day's valid coupon issuance status of the platform one by one into the first data set;

[0012] Establish an LSTM model, select an activation function and an optimization algorithm, and set the LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0013] According to the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, the LSTM model with the set parameters is trained, and the trained LSTM model is saved;

[0014] According to the saved trained LSTM model, the feature data of the day and the normalized weather feature data are input into the trained LSTM model to obtain the forecast reference values ​​of the online car-hailing demand in different sub-regions on the day;

[0015] Compare the obtained reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-regions, and determine the accuracy of the reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day based on different comparison results;

[0016] The number of online-hailing vehicles in different sub-regions is obtained, and the online-hailing vehicle demand forecast values ​​for the day are obtained by combining the historical average daily order quantity of the corresponding sub-region and revising the reference value of the online-hailing vehicle demand forecast for the day that does not meet the accuracy requirements.

[0017] Furthermore, the historical online car-hailing demand data of different sub-regions within a month are obtained, including historical date data and the corresponding historical daily order quantity, and the daily online car-hailing demand quantity in different regions is sorted and counted, and the historical daily online car-hailing order quantity of each sub-region within a month is calibrated as G j , where j = 1, 2,…, m.

[0018] Furthermore, the logic for constructing the characteristic data of the number of online car-hailing demands is as follows:

[0019] Record whether each day in a month is a working day or a rest day. The method for determining whether each day is a working day or a rest day is as follows: Monday to Friday are considered working days, Saturday and Sunday are considered working days, when holidays occur on Monday to Friday, the day is considered a rest day, and when Saturday and Sunday need to be adjusted to a day off, the day is considered a working day; label encoding is used for working days and rest days, and working days and rest days are mapped to integer form, where working days are mapped to 0 and rest days are mapped to 1;

[0020] Weather conditions are also encoded using labels, mapping sunny, cloudy, and rainy days to integers, where sunny is mapped to 0, cloudy is mapped to 1, and rainy is mapped to 2.

[0021] In the platform's effective coupon issuance situation for the day, no coupons issued will be mapped to 0, and issued coupons will be mapped to 1.

[0022] Furthermore, the weather characteristic data of the number of online car-hailing demands are normalized, and the formula for the normalization is:

[0023]

[0024] In the formula, Z normi is the sample value of the normalized weather characteristic data on different dates, z i is the weather characteristic sample data on different dates and i = 1, 2, ..., n, n is the number of days for collecting sample data, z min is the minimum value in the weather sample data, z max is the maximum value in the weather sample data; the normalized data are mapped one by one to generate the first data set.

[0025] Furthermore, the data in the generated first data set is divided into two parts, a training set and a test set, and an LSTM model is established, wherein the logic of dividing the training set and the test set is: the sample data processed in the last five days of a month is used as the test set, and all the sample data except the last five days of a month is used as the training set.

[0026] Furthermore, the activation function and optimization algorithm are selected, where the ReLU function is selected as the activation function and Adam is selected as the optimization algorithm of the LSTM model; the formula of the ReLU function is:

[0027] f(x)=max(0,x)

[0028] In the formula, f(x) represents the ReLU function, and the independent variable x represents the weighted sum of the neuron's input, that is, the result of the weighted summation of the input received by the neuron from the previous layer;

[0029] At the same time, the LSTM model parameters are set, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0030] The number of network layers is set to a four-layer network structure, the number of iterations is set to 300, the learning rate is set to 0.01, the batch size is set to 32, the number of training times is set to 300, the batch size is set to 256, and the number of hidden layer neurons is 32.

[0031] Furthermore, the obtained reference values ​​of the forecast demand for online ride-hailing vehicles in different sub-regions on the same day are compared with the historical average daily order quantity of the corresponding sub-regions, and the accuracy of the reference values ​​of the forecast demand for online ride-hailing vehicles in different sub-regions on the same day is determined based on different comparison results;

[0032] The formula for the historical average daily order quantity in different sub-regions is:

[0033]

[0034] Where MEAN j is the historical daily average order quantity of the jth sub-region, n is the number of days for collecting sample data, G i,j represents the number of orders received by the jth sub-region on the i-th day;

[0035] Based on different comparison results, the logic for judging the accuracy of the reference value of the forecast of online car-hailing demand in different sub-regions on the same day is as follows:

[0036] The reference value for the forecast of online car-hailing demand in different sub-regions is fore j , and the historical daily average order quantity MEAN of different sub-regions j Compared to;

[0037] When 0.5*MEAN j ≤fore j ≤2*MEAN j When the generated forecast values ​​of online car-hailing demand for different sub-regions are determined to meet the actual requirements, there is no need to revise them;

[0038] When 0.5*MEAN j >fore j When determining that the forecast values ​​of online car-hailing demand for the same day in different sub-regions do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for the same day in different sub-regions need to be revised;

[0039] When fore j >2*MEAN j When determining that the forecast values ​​of online car-hailing demand for different sub-regions on the same day do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for different sub-regions on the same day need to be revised.

[0040] Furthermore, the number of online-hailing vehicles in different sub-regions is obtained, and the online-hailing vehicle demand forecast values ​​for the same day that do not meet the accuracy requirements are revised based on the historical daily average order quantity of the corresponding sub-region, to obtain the online-hailing vehicle demand forecast values ​​for the same day in different sub-regions;

[0041] Among them, the number of online-hailing vehicles in different sub-areas is calibrated as X j , combined with the historical daily average order quantity of the corresponding sub-region and the reference value of the online car-hailing demand forecast that does not meet the accuracy requirements, the formula for the online car-hailing demand forecast value of the day in different sub-regions is obtained as follows:

[0042] actual j =a*X j +b*MEAN j +c*fore j

[0043] In the formula, actual j is the revised forecast value of the demand for online ride-hailing vehicles in the jth sub-region on that day, a, b, and c are the weight coefficients of the number of online ride-hailing vehicles in different sub-regions, the historical average number of orders in the corresponding sub-region, and the reference value of the forecast demand for online ride-hailing vehicles on that day, respectively, where a, b, and c are all greater than 0 and a <c<b。

[0044] The present invention also provides a regional online car-hailing demand forecasting system based on improved LSTM, and the regional online car-hailing demand forecasting system based on improved LSTM is used to execute the above-mentioned regional online car-hailing demand forecasting method based on improved LSTM, comprising:

[0045] A regional data collection module is used to divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders;

[0046] A feature data construction module is used to construct feature data of the number of online car-hailing demands, wherein the feature data includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, wherein the weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day;

[0047] A normalization processing module, used to normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, rest days and the distribution of valid coupons on the platform on the same day into the first data set;

[0048] A model building module is used to build an LSTM model, select an activation function and an optimization algorithm, and set LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0049] A model training module is used to train the LSTM model with set parameters according to the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, and save the trained LSTM model;

[0050] The prediction reference value solving module is used to input the characteristic data of the day and the normalized weather characteristic data into the trained LSTM model according to the saved trained LSTM model, so as to obtain the prediction reference value of the online car-hailing demand of different sub-regions on the day;

[0051] The accuracy judgment module is used to compare the obtained reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-region, and judge the accuracy of the reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day based on different comparison results;

[0052] The forecast reference value revision module is used to obtain the number of online-hailing vehicles in different sub-regions, and revise the forecast reference value of the online-hailing vehicle demand on the day that does not meet the accuracy requirements based on the historical daily average order quantity of the corresponding sub-region, to obtain the online-hailing vehicle demand on the day in different sub-regions.

[0053] Compared with the prior art, the beneficial effects of the present invention are as follows: by dividing the area to be predicted into regions of equal area to obtain a total of m sub-regions, obtaining the historical online car-hailing demand data in each sub-region, and constructing the characteristic data of the number of online car-hailing demands; normalizing the weather characteristic data of the number of online car-hailing demands, sorting the processed data, and generating a first data set; establishing an LSTM model, selecting an activation function and an optimization algorithm, and setting the LSTM model parameters; training the LSTM model with the set parameters based on the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, and saving the trained LSTM model; based on the saved trained LSTM model, inputting the characteristic data of the day and the normalized weather characteristic data into the LSTM model. After the trained LSTM model is completed, the reference values ​​of the forecast demand for online ride-hailing vehicles on the same day in different sub-regions are obtained; the reference values ​​of the forecast demand for online ride-hailing vehicles on the same day in different sub-regions are compared with the historical average daily order number of the corresponding sub-regions, and the accuracy of the reference values ​​of the forecast demand for online ride-hailing vehicles on the same day in different sub-regions is judged according to different comparison results; the number of online ride-hailing vehicles in different sub-regions is obtained, and the forecast demand value for online ride-hailing vehicles on the same day is revised based on the historical average daily order number of the corresponding sub-region and the reference values ​​of the forecast demand for online ride-hailing vehicles on the same day that do not meet the accuracy requirements, so as to obtain the forecast demand value for online ride-hailing vehicles on the same day in different sub-regions; thus, the demand for online ride-hailing vehicles in different regions within one day can be predicted while ensuring accuracy by using less feature data, which can guide the online ride-hailing platform to make capacity planning and various activities of drivers and passengers, thereby improving the efficiency of public travel. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 It is a schematic diagram of the overall method flow of the present invention;

[0055] Figure 2 It is a schematic diagram of the overall system flow of the present invention. DETAILED DESCRIPTION

[0056] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0057] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0058] Example:

[0059] See also Figure 1 , the present invention provides a technical solution:

[0060] A regional online car-hailing demand prediction method based on improved LSTM, the specific steps include:

[0061] Step 1: Divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders;

[0062] Obtain the historical online car-hailing demand data for different sub-regions within a month, including historical date data and the corresponding historical daily order quantity, sort out and count the daily online car-hailing demand quantity in different regions, and calibrate the daily historical online car-hailing order quantity in each sub-region within a month as G. j , where j = 1, 2, ..., m; in this embodiment, a month with 30 days is selected for data collection.

[0063] Step 2: Construct characteristic data of the number of online car-hailing demands, which includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, where weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day;

[0064] Whether it is a weekday has a significant impact on the demand for online ride-hailing. For residents near work areas, the daily demand for online ride-hailing will decrease during weekends compared with weekdays. For residents near residential areas, the daily demand for online ride-hailing will increase during weekends compared with weekdays. For scenic spots, the daily demand for online ride-hailing will increase significantly during weekends compared with weekdays.

[0065] Weather factors have a significant impact on the daily demand for online ride-hailing vehicles in work areas, residential areas, and scenic areas. When the weather conditions are good, fewer citizens choose to go out for online ride-hailing. When the weather conditions are bad, citizens rarely choose to go out, which also directly affects the number of residents' demand for online ride-hailing vehicles.

[0066] The issuance of valid coupons on the platform also has a significant impact on the number of online car-hailing demand. When the platform issues valid coupons on the same day, the number of online car-hailing demand will increase. On the contrary, when the platform does not issue valid coupons on the same day, the number of online car-hailing demand will decrease.

[0067] Record whether each day in a month is a working day or a rest day. The method for determining whether each day is a working day or a rest day is as follows: Monday to Friday are considered working days, Saturday and Sunday are considered working days, when holidays occur on Monday to Friday, the day is considered a rest day, and when Saturday and Sunday need to be adjusted to a day off, the day is considered a working day; label encoding is used for working days and rest days, and working days and rest days are mapped to integer form, where working days are mapped to 0 and rest days are mapped to 1;

[0068] Weather conditions are also encoded using labels, mapping sunny, cloudy, and rainy days to integers, where sunny is mapped to 0, cloudy is mapped to 1, and rainy is mapped to 2.

[0069] In the platform's effective coupon issuance situation for the day, no coupons issued will be mapped to 0, and issued coupons will be mapped to 1.

[0070] Step 3: Normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, weekends, and the day's valid coupon issuance status of the platform one by one into the first data set;

[0071] The weather characteristic data of the number of online car-hailing demands are normalized, and the formula for the normalization is:

[0072]

[0073] In the formula, Z normi is the sample value of the normalized weather characteristic data on different dates, z i is the weather characteristic sample data on different dates and i = 1, 2, ..., n, n is the number of days for collecting sample data, z min is the minimum value in the weather sample data, z max is the maximum value in the weather sample data;

[0074] Normalization is one of the important steps in data preprocessing. Its purpose is to convert the original data into a specific range or distribution to eliminate the impact of dimensions, accelerate model convergence, and improve model accuracy and stability. Normalization scales the data to a specified range (usually [0,1]). The feature data of working days, weekends, and the issuance of valid coupons on the platform on the same day have been mapped to the range of [0,1] through label encoding, so normalization is no longer needed.

[0075] Step 4: Establish an LSTM model, select an activation function and an optimization algorithm, and set the LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0076] The ReLU function is selected as the activation function, and Adam is selected as the optimization algorithm of the LSTM model; the formula of the ReLU function is:

[0077] f(x)=max(0,x)

[0078] In the formula, f(x) represents the ReLU function, and the independent variable x represents the weighted sum of the neuron's input, that is, the result of the weighted summation of the input received by the neuron from the previous layer;

[0079] The ReLU function can effectively solve the gradient vanishing problem and improve the training speed. Therefore, the ReLU function is selected as the activation function. In addition, Adam is selected as the optimization algorithm for the LSTM model. The Adam algorithm is an adaptive learning rate optimization algorithm used to train neural networks and other machine learning models. It combines the momentum method and the adaptive learning rate method. It has the advantages of efficient calculation, small memory usage, suitable for solving large-scale data and parameter optimization problems, and suitable for solving high noise and sparse gradient problems. It has good application prospects in large data set training.

[0080] At the same time, the LSTM model parameters are set, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0081] The number of network layers is set to a four-layer network structure. The model structure has achieved good results with a four-layer structure and can better reflect the fluctuations in passenger flow. Continuing to increase the number of model layers has little effect on model accuracy, but the running speed is greatly reduced. Therefore, a four-layer network structure is selected. At the same time, in the four-layer model structure, the DDLL model is selected, that is, the first and second layers are Desse layers, the third and fourth layers are LSTM layers, and the goal of the Dense layer is to make nonlinear changes to the previously extracted features; the number of iterations is set to 300, the learning rate is set to 0.01, the batch size is set to 32, the number of training times is set to 300, the number of batches is set to 256, and the number of hidden layer neurons is 32.

[0082] Step 5: According to the data in the generated first data set, combined with the historical date data in different sub-regions and the corresponding historical daily order data, the LSTM model with the set parameters is trained, and the trained LSTM model is saved;

[0083] The LSTM model will be trained using feature data, historical date data, and corresponding historical daily order data. The trained LSTM model will be saved for subsequent solution of the reference value for the forecast of online car-hailing demand in different sub-regions on the same day.

[0084] Step 6: According to the saved trained LSTM model, the feature data of the day and the normalized weather feature data are input into the trained LSTM model to obtain the reference value of the online car-hailing demand forecast for different sub-regions on the day;

[0085] The characteristic data of the day and the normalized weather characteristic data are input into the trained LSTM model, and the forecast reference values ​​of the online car-hailing demand of different sub-regions on the day are solved, and the obtained forecast reference values ​​are recorded. This embodiment only takes the specific forecast results of one sub-region among m sub-regions as an example. For details, please refer to Table 1, a forecast model data table of a certain sub-region;

[0086] Table 1 Workspace prediction model data table

[0087]

[0088]

[0089] The predicted reference values ​​for the remaining sub-regions can be obtained in the same way and will not be further explained.

[0090] Step 7: Compare the obtained reference values ​​of the online car-hailing demand forecast for the same day in different sub-regions with the historical daily average order quantity of the corresponding sub-regions, and determine the accuracy of the reference values ​​of the online car-hailing demand forecast for the same day in different sub-regions based on different comparison results;

[0091] Compare the obtained reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-regions, and determine the accuracy of the reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day based on different comparison results;

[0092] The formula for the historical average daily order quantity in different sub-regions is:

[0093]

[0094] Where MEAN j is the historical daily average order quantity of the jth sub-region, n is the number of days for collecting sample data, G i,j represents the number of orders received by the jth sub-region on the i-th day;

[0095] Based on different comparison results, the logic for judging the accuracy of the reference value of the forecast of online car-hailing demand in different sub-regions on the same day is as follows:

[0096] The reference value for the forecast of online car-hailing demand in different sub-regions is fore j , and the historical daily average order quantity MEAN of different sub-regions j Compared to;

[0097] When 0.5*MEAN j ≤fore j ≤2*MEAN j When the generated forecast values ​​of online car-hailing demand for different sub-regions are determined to meet the actual requirements, there is no need to revise them;

[0098] When 0.5*MEAN j >fore j When determining that the forecast values ​​of online car-hailing demand for the same day in different sub-regions do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for the same day in different sub-regions need to be revised;

[0099] When fore j >2*MEAN j When determining that the forecast values ​​of online car-hailing demand for different sub-regions on the same day do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for different sub-regions on the same day need to be revised.

[0100] Step 8: Obtain the number of online-hailing vehicles in different sub-regions, and revise the online-hailing vehicle demand forecast reference value that does not meet the accuracy requirements based on the historical daily average order quantity of the corresponding sub-region to obtain the online-hailing vehicle demand forecast value for the same day in different sub-regions;

[0101] The number of online-hailing vehicles in different sub-regions is obtained, and the online-hailing vehicle demand forecast values ​​for the day are obtained by combining the historical daily average order quantity of the corresponding sub-region and revising the reference value of the online-hailing vehicle demand forecast that does not meet the accuracy requirements;

[0102] Among them, the number of online-hailing vehicles in different sub-areas is calibrated as X j , combined with the historical daily average order quantity of the corresponding sub-region and the reference value of the online car-hailing demand forecast that does not meet the accuracy requirements, the formula for the online car-hailing demand forecast value of the day in different sub-regions is obtained as follows:

[0103] actual j =a*X j +b*MEAN j +c*fore j

[0104] In the formula, actual j is the revised forecast value of the demand for online ride-hailing vehicles in the jth sub-region on that day, a, b, and c are the weight coefficients of the number of online ride-hailing vehicles in different sub-regions, the historical average number of orders in the corresponding sub-region, and the reference value of the forecast demand for online ride-hailing vehicles on that day, respectively, where a, b, and c are all greater than 0 and a <c<b。

[0105] See also Figure 2 The present invention also provides a regional online car-hailing demand forecasting system based on improved LSTM, and the regional online car-hailing demand forecasting system based on improved LSTM is used to execute the above-mentioned regional online car-hailing demand forecasting method based on improved LSTM, including:

[0106] A regional data collection module is used to divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders;

[0107] A feature data construction module is used to construct feature data of the number of online car-hailing demands, wherein the feature data includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, wherein the weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day;

[0108] A normalization processing module, used to normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, rest days and the distribution of valid coupons on the platform on the same day into the first data set;

[0109] A model building module is used to build an LSTM model, select an activation function and an optimization algorithm, and set LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons;

[0110] A model training module is used to train the LSTM model with set parameters according to the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, and save the trained LSTM model;

[0111] The prediction reference value solving module is used to input the characteristic data of the day and the normalized weather characteristic data into the trained LSTM model according to the saved trained LSTM model, so as to obtain the prediction reference value of the online car-hailing demand of different sub-regions on the day;

[0112] The accuracy judgment module is used to compare the obtained reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-region, and judge the accuracy of the reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day based on different comparison results;

[0113] The forecast reference value revision module is used to obtain the number of online-hailing vehicles in different sub-regions, and revise the forecast reference value of the online-hailing vehicle demand on the day that does not meet the accuracy requirements based on the historical daily average order quantity of the corresponding sub-region, to obtain the online-hailing vehicle demand on the day in different sub-regions.

[0114] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0115] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A regional online car-hailing demand prediction method based on improved LSTM, It is characterized in that The specific steps include: Divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders; Construct characteristic data of the number of online car-hailing demands, wherein the characteristic data includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, wherein the weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day; Normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, weekends, and the day's valid coupon issuance status of the platform one by one into the first data set; Establish an LSTM model, select an activation function and an optimization algorithm, and set the LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons; According to the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, the LSTM model with the set parameters is trained, and the trained LSTM model is saved; According to the saved trained LSTM model, the feature data of the day and the normalized weather feature data are input into the trained LSTM model to obtain the forecast reference values ​​of the online car-hailing demand in different sub-regions on the day; Compare the obtained reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-regions, and determine the accuracy of the reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day based on different comparison results; The number of online-hailing vehicles in different sub-regions is obtained, and the online-hailing vehicle demand forecast values ​​for the day are obtained by combining the historical average daily order quantity of the corresponding sub-region and revising the reference value of the online-hailing vehicle demand forecast for the day that does not meet the accuracy requirements.

2. According to claim 1, a method for predicting regional online car-hailing demand based on improved LSTM, Features: Obtain the historical online car-hailing demand data for different sub-regions within a month, including historical date data and the corresponding historical daily order quantity, sort out and count the daily online car-hailing demand quantity in different regions, and calibrate the daily historical online car-hailing order quantity in each sub-region within a month as G. j , where j = 1, 2,…, m.

3. According to claim 2, a method for predicting regional online car-hailing demand based on improved LSTM, Features: The logic for constructing the feature data of the number of online car-hailing demands is: Record whether each day in a month is a working day or a rest day. The method for determining whether each day is a working day or a rest day is as follows: Monday to Friday are considered working days, Saturday and Sunday are considered working days, when holidays occur on Monday to Friday, the day is considered a rest day, and when Saturday and Sunday need to be adjusted to a day off, the day is considered a working day; label encoding is used for working days and rest days, and working days and rest days are mapped to integer form, where working days are mapped to 0 and rest days are mapped to 1; Weather conditions are also encoded using labels, mapping sunny, cloudy, and rainy days to integers, where sunny is mapped to 0, cloudy is mapped to 1, and rainy is mapped to 2. In the platform's effective coupon issuance situation for the day, no coupons issued will be mapped to 0, and issued coupons will be mapped to 1.

4. According to claim 1, a method for predicting regional online car-hailing demand based on improved LSTM, Features: The weather characteristic data of the number of online car-hailing demands are normalized, and the formula for the normalization is: In the formula, Z normi is the sample value of the normalized weather characteristic data on different dates, z i is the weather characteristic sample data on different dates and i = 1, 2, ..., n, n is the number of days for collecting sample data, z min is the minimum value in the weather sample data, z max is the maximum value in the weather sample data; the normalized weather characteristic data are mapped one by one to generate the first data set.

5. According to claim 1, a method for predicting regional online car-hailing demand based on improved LSTM, Features: Select the activation function and optimization algorithm. Select the ReLU function as the activation function and Adam as the optimization algorithm for the LSTM model. The formula of the ReLU function is: f(x) = max(0, x) In the formula, f(x) represents the ReLU function, and the independent variable x represents the weighted sum of the neuron's input, that is, the result of the weighted summation of the input received by the neuron from the previous layer; At the same time, the LSTM model parameters are set, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons; The number of network layers is set to a four-layer network structure, the number of iterations is set to 300, the learning rate is set to 0.01, the batch size is set to 32, the number of training times is set to 300, the batch size is set to 256, and the number of hidden layer neurons is 32.

6. According to claim 2, a method for predicting regional online car-hailing demand based on improved LSTM, Features: Compare the obtained reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-regions, and determine the accuracy of the reference values ​​of the online ride-hailing demand forecast for different sub-regions on the same day based on different comparison results; The formula for the historical average daily order quantity in different sub-regions is: Where MEAN j is the historical daily average order quantity of the jth sub-region, n is the number of days for collecting sample data, G i,j represents the number of orders received by the jth sub-region on the i-th day; Based on different comparison results, the logic for judging the accuracy of the reference value of the forecast of online car-hailing demand in different sub-regions on the same day is as follows: The reference value for the forecast of online car-hailing demand in different sub-regions is fore j , and the historical daily average order quantity MEAN of different sub-regions j in comparison; When 0.5*MEAN j ≤fore j ≤2*MEAN j When the generated forecast values ​​of online car-hailing demand for different sub-regions are determined to meet the actual requirements, there is no need to revise them; When 0.5*MEAN j >fore j When determining that the forecast values ​​of online car-hailing demand for the same day in different sub-regions do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for the same day in different sub-regions need to be revised; When fore j >2*MEAN j When determining that the forecast values ​​of online car-hailing demand for different sub-regions on the same day do not meet the accuracy requirements, the generated forecast values ​​of online car-hailing demand for different sub-regions on the same day need to be revised.

7. According to claim 6, a method for predicting regional online car-hailing demand based on improved LSTM, Features: The number of online-hailing vehicles in different sub-regions is obtained, and the online-hailing vehicle demand forecast values ​​for the day are obtained by combining the historical daily average order quantity of the corresponding sub-region and revising the reference value of the online-hailing vehicle demand forecast that does not meet the accuracy requirements; Among them, the number of online-hailing vehicles in different sub-areas is calibrated as X j , combined with the historical daily average order quantity of the corresponding sub-region and the reference value of the online car-hailing demand forecast that does not meet the accuracy requirements, the formula for the online car-hailing demand forecast value of the day in different sub-regions is obtained as follows: actual j =a*X j +b*MEAN j +c*fore j In the formula, actual j is the revised forecast value of the demand for online ride-hailing vehicles in the jth sub-region on that day, a, b, and c are the weight coefficients of the number of online ride-hailing vehicles in different sub-regions, the historical average number of orders in the corresponding sub-region, and the reference value of the forecast demand for online ride-hailing vehicles on that day, respectively, where a, b, and c are all greater than 0 and a <c<b。 8. A regional online car-hailing demand prediction system based on improved LSTM, Features: The improved LSTM-based regional online car-hailing demand forecasting system is used to execute the improved LSTM-based regional online car-hailing demand forecasting method according to any one of claims 1 to 7, comprising: A regional data collection module is used to divide the area to be predicted into regions of equal area to obtain a total of m sub-regions, and obtain historical online car-hailing demand data in each sub-region, wherein the historical online car-hailing demand data includes historical date data and the corresponding number of historical daily orders; A feature data construction module is used to construct feature data of the number of online car-hailing demands, wherein the feature data includes working days and weekends, weather conditions, and the issuance of valid coupons on the platform on the same day, wherein the weather conditions include sunny days, cloudy days, and rainy days, and the issuance of valid discounts on the same day by the platform includes the issuance of valid coupons on the same day and the non-issuance of valid coupons on the same day; A normalization processing module, used to normalize the weather characteristic data of the number of online car-hailing demands, organize the processed data to generate a first data set, and map the characteristic data of working days, rest days and the distribution of valid coupons on the platform on the same day into the first data set; A model building module is used to build an LSTM model, select an activation function and an optimization algorithm, and set LSTM model parameters, including: the number of network layers, the number of iterations, the learning rate, the batch size, the number of training times, the batch processing number, and the number of hidden layer neurons; A model training module is used to train the LSTM model with set parameters according to the data in the generated first data set combined with the historical date data in different sub-regions and the corresponding historical daily order data, and save the trained LSTM model; The prediction reference value solving module is used to input the characteristic data of the day and the normalized weather characteristic data into the trained LSTM model according to the saved trained LSTM model, so as to obtain the prediction reference value of the online car-hailing demand of different sub-regions on the day; The accuracy judgment module is used to compare the obtained reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day with the historical average daily order quantity of the corresponding sub-region, and judge the accuracy of the reference values ​​of the online car-hailing demand forecast for different sub-regions on the same day based on different comparison results; The forecast reference value revision module is used to obtain the number of online-hailing vehicles in different sub-regions, and revise the forecast reference value of the online-hailing vehicle demand on the day that does not meet the accuracy requirements based on the historical daily average order quantity of the corresponding sub-region, to obtain the online-hailing vehicle demand on the day in different sub-regions.

Citation Information

Patent Citations

  • Online car-hailing service demand prediction method based on deep neural network

    CN108985475A

  • Water consumption prediction method and device, electronic equipment and computer readable medium

    CN112036668A

  • Online booked vehicle flow prediction method based on deep learning

    CN112669595A

  • Feature segmentation-based online car-hailing demand prediction method

    CN114708011A

  • Rail transit passenger flow prediction method based on improved LSTM network

    CN117252311A

Cited By

  • Infrastructure planning method and device, equipment and storage medium

    CN119338288A