A feature segmentation method for predicting online ride-hailing demand
Through the combination of feature segmentation and deep neural network model, the accuracy of short-term demand prediction of online ride-hailing is solved, the prediction accuracy is improved, the operation strategy is optimized, and travel efficiency is improved.
Patent Information
- Application Number
- CN202210229531.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-09
AI Technical Summary
The existing technology is difficult to accurately predict the short-term travel demand for online ride-hailing, resulting in a mismatch between supply and demand of vehicle resources and affecting travel efficiency.
The feature segmentation method is used to divide the online ride-hailing demand features into time-cycle features and periphery features, and are processed using LSTM and DNN models, and predicted by fusion of two types of coding features through deep neural networks.
It improves the accuracy of online car-hailing order volume forecasts for one-hour, guides operational strategies, and improves public travel efficiency.
Smart Images

Figure CN114708011B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of online car-hailing, and specifically to a feature segmentation method for predicting online car-hailing demand. 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 demand and the supply and demand of service vehicle resources has gradually become prominent. If the short-term travel demand can be accurately predicted, the online ride-hailing platform can timely allocate vehicle supply, issue passenger subsidies, and set different driver reward rules. Based on this, a feature segmentation online ride-hailing demand prediction method is proposed. Summary of the invention
[0003] The purpose of the present invention is to provide a feature segmentation method for predicting online car-hailing demand to solve the problems raised in the above-mentioned background technology.
[0004] To achieve the above object, the present invention provides the following technical solution: a method for predicting online car-hailing demand based on feature segmentation, comprising the following steps:
[0005] Step S1, segment the features of the online car-hailing demand, and divide the feature segmentation into two categories: time series periodic features and near-point features, where the time series periodic features X1, X2...Xn (n is the time series number, 5≤n≤10), and X1...Xn is a 14-dimensional vector;
[0006] Step S2: the near point feature in step S1 is set to T, where T is the real-time feature of the day, and T is an 18-dimensional vector;
[0007] Step S3: Based on the data in the last 6 months, establish features X1…Xn with a 7-day period;
[0008] Step S4, using the LSTM network to construct a model for the time series periodic features in step S1, wherein X1...Xn are all feature vectors, each X is a 14-dimensional vector, and the output of the LSTM is a periodic feature encoding vector with a dimension of 256;
[0009] Step S5, using DNN to construct a model for the near point features in step S2, the input T is an 18-dimensional vector, the output is a 256-dimensional near point feature encoding vector, and this DNN can be constructed using an ordinary 6-layer or deeper deep neural network model;
[0010] Step S6: The 256-dimensional periodic coding features and the 256-dimensional near-point coding features in step S4 and step S5 are used as inputs to enter the DNN, and the output is a feature z, where z is the predicted order volume. During the training process, y is the label value. This DNN is constructed using an ordinary 6-layer or deeper deep neural network model;
[0011] Step S7: The loss function of the deep neural network model constructed in steps S4 to S6 is the mean square error. Where m is the number of samples, yi is the tag value of the order quantity, zi is the predicted value of the order quantity calculated by the forward network model, and the optimization goal is to minimize the MSE, that is, to minimize the mean square of the prediction error; the Adam optimization algorithm is then used to train the deep neural network model constructed in steps S4 to S6. The Adam optimization algorithm is an extension of the stochastic gradient descent method and is widely used in deep learning in computer vision and natural language processing. It is used to solve the matrix parameters of the machine learning model when the MSE is minimized;
[0012] Step S8: Use the data parameters obtained in step S7 to predict the order volume, wherein the online production environment of the online car-hailing service can construct near-point features and periodic features within a certain time period, and provide operational strategy guidance after predicting the order volume results for 1 hour.
[0013] Preferably, in step S1, X is a feature with a period of 7 days, and X contains 5 types of features:
[0014] Feature 1, Weather features: temperature of the day x1, weather of the day x2;
[0015] Feature 2: Passenger features: number of registrations in the last 7 days x3, number of logins in the last 7 days x4, number of calls made by passengers yesterday x5, number of cancellations made by passengers yesterday x6, etc.;
[0016] Feature 3, order features: number of valid coupons on the day x7, yesterday's preferential subsidy rate x8, yesterday's driver reward rate x9, yesterday's reward ratio to yesterday's GMV x10, etc.;
[0017] Feature 4: Driver features: Number of drivers dispatched yesterday x 11, Average number of drivers dispatched yesterday x 12, etc.
[0018] Feature 5, activity feature: number of driver activities on the day x13, number of passenger activities on the day x14.
[0019] Preferably, the real-time features T in step S2 include the following four categories:
[0020] The first category, time features: the current time serial number t1, the time is 5 minutes interval, the serial number range is from 0 to 287; whether the day is a holiday t2; whether the current time is the peak time t3; the difference between the current time and the peak time t4, in minutes;
[0021] Category 2: Passenger near-point characteristics: price estimate 5 minutes ago t5; number of calls 5 minutes ago t6; price estimate 10 minutes ago t7; number of calls 10 minutes ago t8;
[0022] The third category, order proximity features: number of discounted orders 5 minutes ago t9; average order acceptance distance 5 minutes ago t10; average order acceptance time 5 minutes ago t11; number of discounted orders 10 minutes ago t12; average order acceptance distance 10 minutes ago t13; average order acceptance time 10 minutes ago t14;
[0023] The fourth category is the recent characteristics of drivers: the number of drivers who dispatched 5 minutes ago t15; the average number of drivers’ odd trips 5 minutes ago t16; the number of drivers who dispatched 10 minutes ago t17; the average number of drivers’ odd trips 10 minutes ago t18.
[0024] Preferably, the LSTM network parameters specifically constructed in step S4 are as follows: the input feature dimension is set to 14, the time step time_steps is set to n, the output layer feature dimension output_dim is set to 256, the number of hidden layers is set to 1, the epoch is set to 120, and whether to return the time series return_sequence is set to false to ensure that the last time series returned by the LSTM is a feature vector rather than a group of feature vectors; the time_steps*embedding_dim feature of the sample is the input of time_steps LSTM units, each unit inputs 14 features, that is, each unit input is X1 or X2, etc., and the 256 output features are the encoding of the periodic features.
[0025] Preferably, the Adam related parameters in step S8 are set as:
[0026] Learning rate alpha = 0.001;
[0027] The first estimated exponential decay rate is beta1 = 0.9;
[0028] The second estimated exponential decay rate beta2 = 0.999;
[0029] The minimum parameter is a very small number epsilon = 10E-8, which is to prevent division by zero in the implementation.
[0030] Compared with the prior art, the present invention has the following beneficial effects: the present invention provides a feature segmentation method for predicting online car-hailing demand to solve the problem of predicting the demand for online car-hailing in the next hour. The method segments the features into periodic features and near-point features, and uses a combination of LSTM and DNN to process different features respectively, and finally uses DNN to fuse the corresponding two types of coding features. Compared with the approach of using only time series features or only a single model, this method can improve the prediction accuracy.
[0031] In summary, the one-hour short-term prediction problem of online ride-hailing services in the present invention can guide online ride-hailing platforms to make good capacity planning and various activities of drivers and passengers, thereby improving public travel efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the workflow of the present invention;
[0033] Figure 2 Schematic diagram of the deep neural network model structure of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] See also Figure 1-2 The present invention provides a technical solution: a feature segmentation method for predicting online car-hailing demand, comprising the following steps:
[0036] Step S1, segment the features of the online car-hailing demand, and divide the feature segmentation into two categories: time series periodic features and near-point features, where the time series periodic features X1, X2...Xn (n is the time series number, 5≤n≤10), and X1...Xn is a 14-dimensional vector;
[0037] Step S2: the near point feature in step S1 is set to T, where T is the real-time feature of the day, and T is an 18-dimensional vector;
[0038] Step S3: Based on the data in the last 6 months, if the time span is from January 1 to June 30, establish features X1…Xn with a period of 7 days;
[0039] The specific method is as follows, taking June 30 as an example:
[0040] 1. Construct the periodic features of June 30. Xn is the data collected on June 30, then Xn-1 is the data collected on June 23, X3 is the data collected on June 16, and so on. Construct the periodic feature vector X1…Xn, where X1 comes from the data of June 30-(n-1)*7;
[0041] 2. Construct the perigee features on June 30th, with a 5-minute interval and a sequence number ranging from 0 to 287. Construct a feature vector T every 5 minutes; a total of T0…T287 are constructed;
[0042] 3. Construct the predicted value. The method to determine the predicted value is to count the single quantity y one hour after the near-point feature. Each near-point feature vector T corresponds to a label value y. If y is a scalar, y0…y287 is constructed.
[0043] On June 30, we get 288 data samples, which are (X1…Xn,T0,y0), (X1…Xn,T1,y1)…(X1…Xn,T287,y287); we continue to construct data samples on June 29 until the periodic feature construction condition of (n-1)*7 is no longer met.
[0044] Step S4, using the LSTM network to construct a model for the time series periodic features in step S1, wherein X1...Xn are all feature vectors, each X is a 14-dimensional vector, and the output of the LSTM is a periodic feature encoding vector with a dimension of 256;
[0045] Step S5: Use DNN to construct a model for the near point features in step S2, the input T is an 18-dimensional vector, and the output is a 256-dimensional near point feature encoding vector. This DNN can be constructed using an ordinary 6-layer or deeper deep neural network model; taking 6 layers as an example, specifically:
[0046] 1. The first linear Dense layer uses relu as the activation function. The input is 18 features and the output is 2048 features.
[0047] 2. The second linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 2048 features.
[0048] 3. The third linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 1024 features.
[0049] 4. The fourth linear Dense layer uses relu as the activation function. The input is 1024 features and the output is 1024 features.
[0050] 5. The fifth linear Dense layer uses relu as the activation function. The input is 1024 features and the output is 512 features.
[0051] 6. The sixth linear Dense layer has no activation function. The input is 512 features and the output is 256 features.
[0052] Among them, 256 output features are the encoding of near-point features.
[0053] Step S6: The 256-dimensional periodic coding features and the 256-dimensional near-point coding features in step S4 and step S5 are used as inputs to enter the DNN, and the output is a feature z, where z is the predicted order volume. During the training process, y is the label value. This DNN is constructed using an ordinary 6-layer or deeper deep neural network model; taking 6 layers as an example, the specific details are:
[0054] 1. The first linear Dense layer uses relu as the activation function. The input is 512 features and the output is 2048 features.
[0055] 2. The second linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 2048 features.
[0056] 3. The third linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 2048 features.
[0057] 4. The fourth linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 2048 features.
[0058] 5. The fifth linear Dense layer uses relu as the activation function. The input is 2048 features and the output is 2048 features.
[0059] 6. The sixth linear Dense layer has no activation function. The input is 2048 features and the output is 1 feature.
[0060] Step S7: The loss function of the deep neural network model constructed in steps S4 to S6 is the mean square error. Where m is the number of samples, yi is the tag value of the order quantity, zi is the predicted value of the order quantity calculated by the forward network model, and the optimization goal is to minimize the MSE, that is, to minimize the mean square of the prediction error; the Adam optimization algorithm is then used to train the deep neural network model constructed in steps S4 to S6. The Adam optimization algorithm is an extension of the stochastic gradient descent method and is widely used in deep learning in computer vision and natural language processing. It is used to solve the matrix parameters of the machine learning model when the MSE is minimized;
[0061] Step S8: Use the data parameters obtained in step S7 to predict the order volume, wherein the online production environment of the online car-hailing service can construct near-point features and periodic features within a certain time period, and provide operational strategy guidance after predicting the order volume results for 1 hour.
[0062] Furthermore, in step S1, X is a feature with a period of 7 days, and X contains 5 types of features:
[0063] Feature 1, Weather features: temperature of the day x1, weather of the day x2;
[0064] Feature 2: Passenger features: number of registrations in the last 7 days x3, number of logins in the last 7 days x4, number of calls made by passengers yesterday x5, number of cancellations made by passengers yesterday x6, etc.;
[0065] Feature 3, order features: number of valid coupons on the day x7, yesterday's preferential subsidy rate x8, yesterday's driver reward rate x9, yesterday's reward ratio to yesterday's GMV x10, etc.;
[0066] Feature 4: Driver features: Number of drivers dispatched yesterday x 11, Average number of drivers dispatched yesterday x 12, etc.
[0067] Feature 5, activity feature: number of driver activities on the day x13, number of passenger activities on the day x14.
[0068] Furthermore, the real-time features T in step S2 include the following four categories:
[0069] The first category, time features: the current time serial number t1, the time is 5 minutes interval, the serial number range is from 0 to 287; whether the day is a holiday t2; whether the current time is the peak time t3; the difference between the current time and the peak time t4, in minutes;
[0070] Category 2: Passenger near-point characteristics: price estimate 5 minutes ago t5; number of calls 5 minutes ago t6; price estimate 10 minutes ago t7; number of calls 10 minutes ago t8;
[0071] The third category, order proximity features: number of discounted orders 5 minutes ago t9; average order acceptance distance 5 minutes ago t10; average order acceptance time 5 minutes ago t11; number of discounted orders 10 minutes ago t12; average order acceptance distance 10 minutes ago t13; average order acceptance time 10 minutes ago t14;
[0072] The fourth category is the recent characteristics of drivers: the number of drivers who dispatched 5 minutes ago t15; the average number of drivers’ odd trips 5 minutes ago t16; the number of drivers who dispatched 10 minutes ago t17; the average number of drivers’ odd trips 10 minutes ago t18.
[0073] Furthermore, the LSTM network parameters specifically constructed in step S4 are as follows: the input feature dimension is set to 14, the time step time_steps is set to n, the output layer feature dimension output_dim is set to 256, the number of hidden layers is set to 1, the epoch is set to 120, and whether to return the time series return_sequence is set to false to ensure that the last time series returned by the LSTM is a feature vector rather than a group of feature vectors; the time_steps*embedding_dim feature of the sample is the input of time_steps LSTM units, each unit inputs 14 features, that is, each unit input is X1 or X2, etc., and the 256 output features are the encoding of the periodic features.
[0074] Furthermore, in step S8, the Adam related parameters are set as:
[0075] Learning rate alpha = 0.001;
[0076] The first estimated exponential decay rate is beta1 = 0.9;
[0077] The second estimated exponential decay rate beta2 = 0.999;
[0078] The minimum parameter is a very small number epsilon = 10E-8, which is to prevent division by zero in the implementation.
[0079] The present invention provides a feature segmentation method for predicting demand for online ride-hailing vehicles to solve the problem of predicting demand for online ride-hailing vehicles in the next hour. The method segments the features into periodic features and near-point features, and uses a combination of LSTM and DNN to process different features respectively, and finally uses DNN to fuse the corresponding two types of coding features. Compared with the approach of using only time series features or only a single model, this method can improve the prediction accuracy.
[0080] In summary, the one-hour short-term prediction problem of online ride-hailing services in the present invention can guide online ride-hailing platforms to make good capacity planning and various activities of drivers and passengers, thereby improving public travel efficiency.
[0081] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A feature segmentation method for predicting online car-hailing demand, characterized in that: The following steps are involved: Step S1, segment the features of the online car-hailing demand, and divide the feature segmentation into two categories: time series periodic features and near-point features, where the time series periodic features X1, X2...Xn (n is the time series number, 5≤n≤10), and X1...Xn is a 14-dimensional vector; Step S2: the near point feature in step S1 is set to T, where T is the real-time feature of the day, and T is an 18-dimensional vector; Step S3: Based on the data in the last 6 months, establish features X1…Xn with a 7-day period; Step S4, using the LSTM network to construct a model for the time series periodic features in step S1, wherein X1...Xn are all feature vectors, each X is a 14-dimensional vector, and the output of the LSTM is a periodic feature encoding vector with a dimension of 256; Step S5, using DNN to construct a model for the near point features in step S2, the input T is an 18-dimensional vector, the output is a 256-dimensional near point feature encoding vector, and this DNN can be constructed using an ordinary 6-layer or deeper deep neural network model; Step S6: The 256-dimensional periodic coding features and the 256-dimensional near-point coding features in step S4 and step S5 are used as inputs to enter the DNN, and the output is a feature z, where z is the predicted order volume. During the training process, y is the label value. This DNN is constructed using an ordinary 6-layer or deeper deep neural network model; Step S7: The loss function of the deep neural network model constructed in steps S4 to S6 is the mean square error. Where m is the number of samples, yi is the tag value of the order quantity, zi is the predicted value of the order quantity calculated by the forward network model, and the optimization goal is to minimize the MSE, that is, to minimize the mean square of the prediction error; the Adam optimization algorithm is then used to train the deep neural network model constructed in steps S4 to S6. The Adam optimization algorithm is an extension of the stochastic gradient descent method and is widely used in deep learning in computer vision and natural language processing. It is used to solve the matrix parameters of the machine learning model when the MSE is minimized; Step S8: Use the data parameters obtained in step S7 to predict the order volume, wherein the online production environment of the online car-hailing service can construct near-point features and periodic features within a certain time period, and provide operational strategy guidance after predicting the order volume results for 1 hour.
2. The feature segmentation method for predicting online car-hailing demand according to claim 1, characterized in that: In step S1, X is a feature with a 7-day period, and X contains 5 types of features: Feature 1, Weather features: temperature of the day x1, weather of the day x2; Feature 2: Passenger features: number of registrations in the last 7 days x3, number of logins in the last 7 days x4, number of calls made by passengers yesterday x5, number of cancellations made by passengers yesterday x6, etc.; Feature 3, order features: number of valid coupons on the day x7, yesterday's preferential subsidy rate x8, yesterday's driver reward rate x9, yesterday's reward ratio to yesterday's GMV x10, etc.; Feature 4: Driver features: Number of drivers dispatched yesterday x 11, Average number of drivers dispatched yesterday x 12, etc. Feature 5, activity feature: number of driver activities on the day x13, number of passenger activities on the day x14.
3. The feature segmentation method for predicting online car-hailing demand according to claim 1, characterized in that: The real-time features T in step S2 include the following four categories: The first category, time features: the current time serial number t1, the time is 5 minutes interval, the serial number range is from 0 to 287; whether the day is a holiday t2; whether the current time is the peak time t3; the difference between the current time and the peak time t4, in minutes; Category 2: Passenger near-point characteristics: price estimate 5 minutes ago t5; number of calls 5 minutes ago t6; price estimate 10 minutes ago t7; number of calls 10 minutes ago t8; The third category, order proximity features: number of discounted orders 5 minutes ago t9; average order acceptance distance 5 minutes ago t10; average order acceptance time 5 minutes ago t11; number of discounted orders 10 minutes ago t12; average order acceptance distance 10 minutes ago t13; average order acceptance time 10 minutes ago t14; The fourth category is the recent characteristics of drivers: the number of drivers who dispatched 5 minutes ago t15; the average number of drivers’ odd trips 5 minutes ago t16; the number of drivers who dispatched 10 minutes ago t17; the average number of drivers’ odd trips 10 minutes ago t18.
4. The feature segmentation method for predicting online car-hailing demand according to claim 1, characterized in that: The LSTM network parameters specifically constructed in step S4 are as follows: the input feature dimension is set to 14, the time step time_steps is set to n, the output layer feature dimension output_dim is set to 256, the number of hidden layers is set to 1, the epoch is set to 120, and whether to return the time series return_sequence is set to false to ensure that the last time series returned by the LSTM is a feature vector rather than a group of feature vectors; the time_steps*embedding_dim feature of the sample is the input of time_steps LSTM units, each unit inputs 14 features, that is, each unit input is X1 or X2, etc., and the 256 output features are the encoding of the periodic features.
5. The feature segmentation method for predicting online car-hailing demand according to claim 1, characterized in that: In step S8, the Adam related parameters are set to: Learning rate alpha = 0.001; The first estimated exponential decay rate is beta1 = 0.9; The second estimated exponential decay rate beta2 = 0.999; The minimum parameter is a very small number epsilon = 10E-8, which is to prevent division by zero in the implementation.
