Shared bicycle dynamic scheduling method based on station demand prediction and user reward mechanism
By clustering and predicting the demand for shared bicycle stations and combining it with a user reward mechanism, a dynamic scheduling model was designed to solve the supply and demand imbalance problem in the shared bicycle system, optimize resource allocation and user participation, reduce operating costs, and improve user satisfaction.
Patent Information
- Application Number
- CN202411879893.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-19
AI Technical Summary
There is an imbalance between supply and demand in the shared bicycle system, resulting in an oversupply of shared bicycles at some stations and a lack of bicycles available at other stations, affecting the timely satisfaction of users' travel needs. The existing scheduling strategy pays little attention to user participation, increasing the scheduling pressure and costs of operators.
By clustering shared bicycle stations, using DBSCAN and K-Means algorithms to divide the stations, combining the CNN-LSTM neural network to predict demand, and using the user reward mechanism to build a dynamic scheduling model, a greedy algorithm is used to solve the optimal scheduling path to encourage users to participate in scheduling.
It optimizes bicycle resource allocation, reduces operating costs, improves user satisfaction, and realizes scientific and efficient scheduling of the shared bicycle system.
Smart Images

Figure CN119831230B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of traffic system prediction and intelligent scheduling, and particularly relates to a shared bicycle dynamic scheduling method based on station demand prediction and user reward mechanism. BACKGROUND
[0002] With the continuous development of the concept of sharing economy, shared bicycles, as a new type of urban travel mode, have played an important role in solving the "first kilometer" and "last kilometer" travel problems, and have been widely favored by users in recent years. However, the asymmetry of user demand in time and space leads to the imbalance between supply and demand of shared bicycle system in a certain period of time. Specifically, there are excess shared bicycles at some stations, while there are no available bicycles at other stations, thereby affecting the timely satisfaction of user travel demand.
[0003] In order to cope with the imbalance between supply and demand of shared bicycles, scheduling is usually used to alleviate the problem. Existing scheduling strategies include dynamic scheduling and static scheduling. Static scheduling usually constructs a scheduling model based on historical data for one-time scheduling planning. In static scheduling, the real-time changes of station demand and the number of bicycles are not considered and remain unchanged during the entire scheduling process. Dynamic scheduling is based on real-time data and continuously optimizes the scheduling scheme according to the current real-time state. Dynamic scheduling strategy can adjust according to the current situation and respond to changes in user demand in real time, providing a more flexible solution.
[0004] Most of the existing scheduling strategies focus on the use of scheduling vehicles by operators to redistribute shared bicycles, and less consideration is given to the potential participation of users in the scheduling process. In fact, by encouraging users to actively participate in the scheduling task of shared bicycles, not only can the scheduling pressure of operators be reduced, but also the scheduling cost can be reduced and environmental pollution can be reduced. Therefore, how to realize scientific and efficient scheduling of shared bicycles, optimize the allocation of bicycle resources, reduce operating costs, encourage users to participate in scheduling while improving user satisfaction, has become a key problem to be solved. SUMMARY
[0005] The main purpose of the present application is to cluster the shared bicycle stations, predict the user borrowing / returning bicycle demand of different stations at different times, consider the way of issuing red packet rewards to users to encourage user participation in scheduling, and finally design a scheduling scheme to reasonably and efficiently plan the scheduling route of the scheduling truck, thereby solving the technical problems raised in the background art.
[0006] To achieve the above purpose, the present application provides a shared bicycle dynamic scheduling method based on station demand prediction and user reward mechanism, comprising the following steps:
[0007] S1: extracting shared bicycle user travel OD data;
[0008] S2: Combine the DBSCAN clustering algorithm and the K-Means clustering algorithm to perform clustering evaluation on the shared bicycle travel OD data, and determine the optimal number of clusters based on the evaluation results, and then perform clustering to divide the shared bicycle dispatch stations;
[0009] S3: Use the constructed CNN-LSTM neural network model to predict the future demand for bikes at different shared bike dispatch stations;
[0010] S4: A dynamic scheduling model for shared bicycles is constructed based on demand forecasting and user reward mechanisms. A greedy algorithm is used to solve the objective function to obtain the optimal scheduling path. The optimal scheduling path is used to guide scheduling vehicles to dynamically schedule shared bicycles in different areas.
[0011] More specifically, the clustering of shared bicycle travel OD data by combining the DBSCAN clustering algorithm and the K-Means clustering algorithm in S2 includes:
[0012] S2.1: Preprocess the shared bicycle travel OD data to remove abnormal data and null value data;
[0013] S2.2: Use the DBSCAN clustering algorithm to cluster the shared bicycle travel OD data. Adjust the parameters of the DBSCAN clustering algorithm based on the evaluation indicator of the silhouette coefficient S(i). After determining the parameter radius parameter ε and the minimum sample parameter minPts, estimate the approximate cluster number range of shared bicycle OD points.
[0014] S2.3: Calculate the silhouette coefficient S(i) and the average distortion Evaluate the clustering effect of the K-Means clustering algorithm;
[0015] The calculation formula of silhouette coefficient S(i) is as follows:
[0016]
[0017] Where a(i) represents the closeness between sample i and other samples in its cluster, which is calculated as the average distance between sample i and other samples; b(i) represents the separation between sample i and its nearest cluster, which is calculated as the average distance between sample i and all samples in its nearest cluster.
[0018] Average distortion The calculation formula is as follows:
[0019]
[0020] where k is the number of clusters, C kis the set of all data points in the i-th cluster, u i represents the cluster center of the i-th cluster, x i represents the data point of the i-th cluster.
[0021] More specifically, after determining the optimal number of clusters based on the evaluation results, clustering is performed to divide the shared bicycle dispatching stations into:
[0022] S2.4: The cluster number interval of the shared bicycle OD points determined in S2.2 is used as the reference cluster number range of S2.3, and the number of clusters corresponding to the maximum value of the silhouette coefficient S(i) and the average distortion degree are used. The optimal number of clusters k is determined by rapidly decreasing and approaching the "elbow point";
[0023] S2.5: Use the K-Means clustering algorithm to cluster the shared bicycle travel OD data, and the obtained cluster center coordinates are used as the shared bicycle dispatch station coordinates.
[0024] Furthermore, the K-Means clustering algorithm is used to cluster the shared bicycle travel OD data, including:
[0025] S2.5.1: Randomly select K data points as the initial cluster centers μ1,μ2,…,μ K ;
[0026] S2.5.2: For each shared bicycle trip OD data coordinate x j , calculate its difference from all cluster centers μ i The Euclidean distance of:
[0027]
[0028] Where: x j is the OD data coordinate of shared bicycle travel, μ i is the cluster center coordinate, D is the data dimension, in this problem D = 2;
[0029] Point x j Assign to the nearest cluster center
[0030] S2.5.3: For each cluster C i , recalculate the cluster centers Where: |C i | is cluster C i The number of midpoints; x j It is cluster C i The point in
[0031] S2.5.4: Repeat SS2.5.2 and S2.5.3 until the cluster center μ is satisfied. iNo longer change or cluster assignment of data points no longer change, output cluster center μ1, μ2,..., μ K .
[0032] Further, using the constructed CNN-LSTM neural network model, different shared bicycle scheduling sites are predicted, including:
[0033] S3.1: Standardize the shared bicycle OD data to [0, 1], divide the site into a two-dimensional matrix, and construct a time series data set, including a training set, a validation set, and a test set;
[0034] S3.2: Input time series data, i.e. shared bicycle OD volume, shape [N, T, H, W], where N is the sample number, T is the time series length, H and W are spatial distribution, and the predicted value of future OD data is [N, T', H, W], where T' is the predicted time step;
[0035] For each time step OD data X t Perform convolution operation Where: is the output feature of the kth convolution kernel, W (k) is the convolution kernel parameter, * is the two-dimensional convolution operation; σ is the activation function;
[0036] Downsample the convolution output to reduce the dimension of the feature map P t = pooling(Z t ), and pool the pooling layer P i,j = max{Z m,n |(m, n) ∈ window(i, j)}, where window(i, j) is the pooling window;
[0037] Stack the pooling output P t of each time step by time dimension to form time series input P = [P1, P2,..., P n ];
[0038] S3.3: Input sequence P to LSTM, update hidden state: input gate i t = σ(W i · [h t-1 , P t ] + b i ); forget gate f t = σ(W f · [h t-1 , P t ] + b f ); candidate memory cell Update memory cell Output gate: ot =σ(W o ·[h t-1 , P t ]+b o ); hidden state h t =o t ⊙tanh(C t );
[0039] The final output of LSTM is the time series feature H = [h1, h2, ..., h T ], used to predict future OD data;
[0040] S3.4: Input the LSTM output H into the fully connected layer and map it to the target OD data in is the predicted value, W h , b h are the weights and biases of the fully connected layer respectively;
[0041] S3.5: Train the CNN-LSTM neural network model, using mean square error as the loss function Update parameters using the Adam optimizer Where θ is the model parameter; η is the learning rate;
[0042] Hyperparameters adjust the parameters of the CNN layer and LSTM, as well as the time series length T and the prediction step length T′;
[0043] S3.6: Input test data set and predict future OD data And through the mean square error (MSE), mean absolute error (MAE) and determination coefficient (R 2 ) to evaluate the model performance.
[0044] Furthermore, the shared bicycle scheduling model is constructed based on demand forecasting and user reward mechanism, including:
[0045] S4.1: In a shared bike dispatching scenario involving users, it is necessary to reward users who park their bikes at a desired station and then walk to their destination. The variable considered is the user's walking distance. A user reward model is constructed: y = 0.184 + 0.004x, where y is the reward amount and x is the walking distance from the desired station to the user's destination.
[0046] S4.2: Taking the operator's cost minimization as the optimization goal and considering the penalty cost of deviation from the expected inventory, the shared bicycle dynamic scheduling model based on demand forecasting and user reward mechanism consists of the objective function expressed by the following formula (4) to formula (7) and the constraints expressed by formula (8) to formula (21):
[0047]
[0048] wherein the meaning of each parameter is as follows:
[0049] V: set of stations V = {1,...,n};
[0050] V0: set of stations and dispatch center V0 = {0,1,...,n};
[0051] K: set of dispatch vehicles K = {1,2,...,m};
[0052] O: set of user origins O = {1,2,...,q};
[0053] D: set of user destinations D = {1,2,...,q};
[0054] i: dispatch station, i ∈ V;
[0055] p: user OD station, p ∈ O,D;
[0056] V i : the i-th dispatch station;
[0057] d ij : distance from station i to station j;
[0058] x ijk : whether vehicle k is dispatched from node i to node j, if yes then x ijk = 1, otherwise 0;
[0059] α1: transportation cost generated by dispatch vehicles during transportation;
[0060] α2: fixed cost generated by enabling dispatch vehicles;
[0061] c: constant;
[0062] k': red packet reward coefficient;
[0063] r ip : whether the user will park the shared bicycle at station i and then walk to destination p, if yes then r ip = 1, otherwise 0;
[0064] d ip : walking distance of the user from station i to destination p;
[0065] P i : penalty coefficient of station i deviating from expectation;
[0066] E i : expected demand of station i;
[0067] Ii : the inventory of station i before dispatching;
[0068] m i : the number of vehicles dispatching in or out of station i, m i > 0 if dispatching in, m i < 0 if dispatching out;
[0069] t ik : the time when vehicle k starts dispatching at station i;
[0070] a i : the left time window of station i;
[0071] b i : the right time window of station i;
[0072] S ik : the service time of vehicle k at station i, S ik = 0 if vehicle k does not serve station i;
[0073] t ij : the travel time of vehicle k from station i to station j;
[0074] y i : the number of shared bikes loaded by vehicle k when it arrives at station i;
[0075] y′ i : the number of shared bikes unloaded by vehicle k when it leaves station i;
[0076] U i : the number of red packet vehicles dispatched to station i;
[0077] Q: the maximum number of shared bikes that each vehicle can load;
[0078] S i : the time spent on loading or unloading one shared bike.
[0079] S4.3: input the relevant parameters of S4.2 into the greedy algorithm, define the shared bike dispatching problem and initialize the vehicles and time windows;
[0080] The calculation of the optimal dispatching path is as follows:
[0081] At each step, the station closest to the current distribution point is selected under the conditions of time window and capacity constraints; when a vehicle arrives at a distribution point, the available time window (a i , b i ) of the distribution point i is updated, which is adjusted according to the actual traffic conditions or delays, and the real-time inventory and future demand of each shared bike station are updated, and the distribution order is adjusted according to the urgency or demand priority of different stations;
[0082] If the vehicle arrives at a certain delivery point earlier than the scheduled time window, it can choose to wait;
[0083] If the vehicle arrives at a certain delivery point not earlier than the scheduled time window, possible penalties or costs need to be considered;
[0084] After selecting the optimal next delivery point each time, the path is added to the route of the current vehicle, and the iteration is continued until all deliveries are completed to obtain the optimal scheduling path. BRIEF DESCRIPTION OF DRAWINGS
[0085] Figure 1 A flowchart of the shared bicycle dynamic scheduling method based on station demand prediction and user reward mechanism of the present application;
[0086] Figure 2 K-Means clustering contour coefficient and average distortion degree of the present application;
[0087] Figure 3 K-Means clustering station visualization result of the present application;
[0088] Figure 4 CNN-LSTM neural network station demand prediction result of the present application;
[0089] Figure 5 Scheduling vehicle delivery path and user travel path of the present application. DETAILED DESCRIPTION
[0090] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described examples are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0091] As shown in Figure 1 The embodiments of the present application provide a shared bicycle dynamic scheduling method based on station demand prediction and user reward mechanism, comprising the following steps:
[0092] S1: Extract shared bicycle user travel OD data;
[0093] S2: Combine DBSCAN clustering algorithm and K-Means clustering algorithm to evaluate shared bicycle travel OD data clustering, and determine the best clustering number according to the evaluation result index, then perform clustering, and divide shared bicycle scheduling stations;
[0094] S3: Using the constructed CNN-LSTM neural network model, predict the future bike demand of different bike sharing stations;
[0095] S4: According to the user reward mechanism, construct a shared bike scheduling model, and use the greedy algorithm to solve the objective function to obtain the best scheduling path.
[0096] The best scheduling path is used to guide the scheduling vehicle, that is, to dynamically schedule shared bikes in different areas.
[0097] For the above S1: Extract shared bike user trip OD data, which includes: bike number, start time, start position horizontal coordinate, start position vertical coordinate, end time, end position horizontal coordinate and end position vertical coordinate;
[0098] For example, the following Table 1 lists the shared bike user trip OD data in a certain area;
[0099] Table 1: Shared bike user trip OD data in a certain area
[0100]
[0101]
[0102] Wherein, bike_id represents the ID number of the shared bike ridden by the user, start_time represents the time when the user starts riding, start_location_x represents the horizontal coordinate of the user's starting riding position, start_location_y represents the vertical coordinate of the user's starting riding position, end_time represents the time when the user finishes riding, end_location_x represents the horizontal coordinate of the user's ending riding position, and end_location_y represents the vertical coordinate of the user's ending riding position.
[0103] For the above S2: Cluster evaluation of shared bike trip OD data by combining DBSCAN clustering algorithm and K-Means clustering algorithm, including the following steps:
[0104] S2.1: Data cleaning of shared bike user trip OD data, excluding abnormal value data such as long riding time, null data and beyond the scope of the study, and then slicing the processed shared bike user trip OD data by hour to provide data basis for the following S's shared bike station demand prediction;
[0105] S2.2: For the problem of selecting shared bicycle station locations, the K-Means clustering algorithm is a classic unsupervised learning algorithm for dividing data points into different clusters, which divides data points into K clusters so that each data point belongs to the center of the cluster closest to it, and the sum of the distances (such as Euclidean distance) of all data points from the center of the cluster to which they belong is minimized, but the K-Means clustering algorithm requires the number of clusters K to be specified in advance, while the DBSCAN algorithm automatically determines the number of clusters according to the density of the data, as it identifies clusters based on the principle of density connection;
[0106] Therefore, when clustering shared bicycle stations, the present application combines the K-Means clustering algorithm with the DBSCAN algorithm, first uses the DBSCAN algorithm to determine the core points and the number of clusters in the shared bicycle travel location data, and then uses the results as the initial points or cluster centers of K-Means, avoiding the need to specify K in advance for K-Means; In addition, K-Means can provide good initial cluster centers, while DBSCAN can adjust the boundaries of the clusters through density information, thereby improving the accuracy and robustness of clustering as a whole;
[0107] The DBSCAN clustering algorithm is used to cluster shared bicycle travel OD data, the DBSCAN clustering algorithm is adjusted according to the evaluation index of the silhouette coefficient S(i), and after the radius parameter ε and the minimum sample parameter minPts are determined, the approximate number of shared bicycle OD point clusters is estimated; The calculation formula of the silhouette coefficient S(i) is as follows:
[0108]
[0109] Where a(i) represents the tightness of sample i and other samples in its cluster, and the calculation method is the average distance from sample i to other samples; b(i) represents the separation degree of sample i from its nearest other cluster, and the calculation method is the average distance from sample i to all samples in its nearest other cluster;
[0110] S2.3: Calculate the silhouette coefficient S(i) and the average distortion degree The clustering effect of the K-Means clustering algorithm is evaluated; the average distortion degree The calculation formula is as follows:
[0111]
[0112] Where k is the number of clusters, C k is the set of all data points in the ith cluster, u i represents the clustering center of the ith cluster, and x i represents the data points of the ith cluster.
[0113] For the above S2: determine the optimal clustering number according to the evaluation result index, then cluster, and divide the shared bicycle dispatching station, including the following steps:
[0114] S2.4: taking the clustering number interval of the shared bicycle OD point determined in S2.2 as the reference clustering number range of S2.3, and taking the clustering number corresponding to the maximum contour coefficient S(i) and the average distortion degree The elbow point of rapid reduction and approaching flatness determines the optimal clustering number k.
[0115] The average distortion degree curve usually presents a shape similar to an elbow, and the point of rapid reduction and approaching flatness is called an elbow point. When selecting the optimal clustering number, the elbow point is usually sought as the optimal clustering number, because it indicates that increasing the number of clusters after the point will not bring obvious reduction of the average distortion degree, and thus can be regarded as the optimal clustering number.
[0116] In the embodiment, the processed shared bicycle trip OD data is clustered using the DBSCAN clustering algorithm on the horizontal and vertical coordinates of the shared bicycle trip points. In the parameter setting, the radius parameter ε is set to 0.1, and the minimum sample parameter minPts is set to 0.5. The noise points are ignored, and the clustering number is 43. Then, the trip data is clustered in the K-Means clustering. The parameter adjustment process of the K-Means clustering is as shown in the figure. Figure 2 It can be found from the figure that the contour coefficient is maximum when k is 39, and the average distortion degree tends to be flat after k is 39. Therefore, the clustering number of the K-Means clustering is determined to be 39.
[0117] S2.5: using the K-Means clustering algorithm to cluster the shared bicycle trip OD data, and taking the obtained clustering center coordinates as the shared bicycle dispatching station coordinates.
[0118] For the above S2.5: using the K-Means clustering algorithm to cluster the shared bicycle trip OD data, including the following steps:
[0119] S2.5.1: randomly selecting K data points as initial cluster centers μ1, μ2,..., μ K In the embodiment, K is 39;
[0120] S2.5.2: for each shared bicycle trip OD data coordinate x j , calculating the Euclidean distance between it and all cluster centers μ i :
[0121]
[0122] wherein: x jCoordinates of shared bicycle trip OD data; μ i Coordinates of cluster center; D is the dimension of data, D = 2 in this problem;
[0123] Assign point x j to the nearest cluster center
[0124] S2.5.3: Recalculate the cluster center for each cluster C i Where: |C i | is the number of points in cluster C i ; x j is a point in cluster C i ;
[0125] S2.5.4: Repeat SS2.5.2 and S2.5.3 until the cluster center μi no longer changes or the cluster assignment of data points no longer changes, output the center of the cluster μ1, μ2,..., μ K .
[0126] In this embodiment, after completing the above S2.5.1 ~ 2.5.4, the shared bicycle trip OD data K-Means clustering result as shown in Figure 2 is obtained, and the cluster center coordinates μ1, μ2,..., μ K are derived to match the trip data in the data set, and a cluster station label is added to each trip data for subsequent demand prediction part processing;
[0127] For the above S3: in using the constructed CNN-LSTM neural network model to predict the future bicycle demand of different shared bicycle stations, the following steps are included:
[0128] S3.1: Standardize the shared bicycle OD data to [0, 1], divide the station into a two-dimensional matrix, and construct a time series data set, where the time series data set includes a training set, a validation set and a test set, and the proportion of the training set, the validation set and the test set is 7:2:1;
[0129] S3.2: Input the time series data, i.e. the shared bicycle OD volume, with a shape of [N, T, H, W], where N is the number of samples, and when predicting the demand of each station, the number of samples is the number of shared bicycle OD points belonging to the station; T is the time series length, which is one hour in this embodiment; H and W are spatial distribution, H is the station ID, and W is a plurality of features of each station at each time step, including station coordinates, station demand in this time period, and time; the predicted value of future OD data has a shape of [N, T', H, W], where T' is the predicted time step length;
[0130] For each time step of OD data X t Perform convolution operation in: is the output feature of the kth convolution kernel; W (k) is the convolution kernel parameter; * is the two-dimensional convolution operation; σ is the activation function;
[0131] Downsample the convolution output to reduce the dimension P of the feature map t =pooling(Z t ), and perform pooling operation P on the pooling layer i,j =max{Z m,n |(m,n)∈window(i,j)}, where window(i,j) is the pooling window;
[0132] The pooled output P of each time step t Stacked by time dimension to form time series input P = [P1, P2, ..., P n ];
[0133] S3.3: Input LSTM to sequence P and update hidden state: input gate i t =σ(W i ·[h t-1 , P t ]+b i ); forget gate f t =σ(W f ·[h t-1 , P t ]+b f ); candidate memory unit Update memory unit Output gate: o t =σ(W o ·[h t-1 , P t ]+b o ); hidden state h t =o t ⊙tanh(C t );
[0134] The final output of LSTM is the time series feature H = [h1, h2, ..., h T ], used to predict future OD data;
[0135] S3.4: Input the LSTM output H into the fully connected layer and map it to the target OD data in is the predicted value; W h , b hRespectively, the full connection layer weight and bias;
[0136] S3.5: Train the model, and use mean square error as loss function Update parameters using Adam optimizer Wherein, theta is model parameter; eta is learning rate;
[0137] Hyperparameter adjustment CNN layer and related parameters of LSTM, and time series length T and prediction step T';
[0138] S3.6: Input test data set, and predict future OD data And evaluate the model effect through mean square error (MSE), mean absolute error (MAE) and determination coefficient (R 2 ).
[0139] The K-Means clustering site visualization result can be obtained through the above technical scheme as shown in Figure 3 .
[0140] In the embodiment, the model evaluation effect of the CNN-LSTM neural network model is shown in Table 2, and the CNN-LSTM neural network site demand prediction result is shown in Figure 4 .
[0141] Table 2: Model evaluation effect of CNN-LSTM neural network model
[0142]
[0143] From the data in Table 2 and Figure 4 prediction result figure, it can be seen that the deviation between the predicted value and the true value of the model is small and the error distribution is relatively concentrated, and the MSE and RMSE of the test set are improved accordingly, which shows that the prediction error of the model on the unseen data is increased, which is a direct manifestation of the generalization ability of the model, the MAPE value is relatively low, the prediction accuracy of the model is high, and the R 2 coefficient is 0.933, which means that the model can still effectively capture most of the variability in the test data, and the generalization performance is good.
[0144] In the embodiment, for the demand prediction of the dispatching site, the shared bicycle travel data from 7 o'clock to 8 o'clock on August 1st is extracted as the basic data for dispatching path planning, and through the site demand prediction in the above part, it is concluded that site 1, site 15, site 17, site 23, site 32 and site 36 will have a large travel demand from 8 o'clock to 9 o'clock, and the predicted demand of each dispatching site in this time period is shown in Table 3;
[0145] Table 3: Predicted demand of each dispatching site
[0146]
[0147]
[0148] For the above S4: based on demand prediction and user reward mechanism to build shared bicycle scheduling model, including the following steps:
[0149] In the shared bicycle scheduling problem, the demand of each station is not fixed, but will change with time, and is also related to the time of shared bicycle arriving at the station, so the shared bicycle scheduling problem studied in the application is a dynamic scheduling problem; in addition, the application considers the mechanism of user reward, by giving a certain amount of reward to the user to let the user park the shared bicycle at the demand station close to the destination, encourage users to participate in the scheduling task, and relieve the scheduling pressure of the region;
[0150] S4.1: In the shared bicycle scheduling participated by users, the user who walks to the destination after parking the shared bicycle at the demand station needs to be rewarded, and the variable considered is the user walking distance, a user reward model y=0.184+0.004x is constructed, wherein y is the reward amount, and x is the walking distance from the demand station to the user's destination;
[0151] According to the above description of the user reward mechanism shared bicycle scheduling problem, the following necessary assumptions are made for the model:
[0152] (1) There is only one dispatching center for a dispatching area;
[0153] (2) Each dispatching vehicle is homogeneous, that is, the dispatching vehicle has the same departure cost, capacity limit and unit distance transportation cost;
[0154] (3) The number of dispatching vehicles in the dispatching center can meet the dispatching task in the dispatching area;
[0155] (4) The dispatching vehicle departs from the dispatching center, and must return to the dispatching center after completing the dispatching task;
[0156] (5) The location of the dispatching center and the station is known, and the distance between the dispatching center and each station and between each station is fixed, and the Euclidean distance is used as the distance between two points;
[0157] (6) The demand of each station and the time window are known;
[0158] (7) A station can only be served by one dispatching vehicle at a time, and the service time depends on the number of shared bicycles that need to be loaded or unloaded at the station;
[0159] (8) Each station can only have the demand of loading or unloading bicycles in a time window, and cannot have both at the same time.
[0160] S4.2: The dynamic scheduling model of shared bicycles based on demand prediction and user reward mechanism with the optimization goal of minimizing the cost of the operator while considering the penalty cost of deviating from the expected inventory is represented by the objective function as formula (4)~formula (7) and its constraint conditions as formula (8)~formula (21):
[0161]
[0162]
[0163] wherein the meanings of various parameters are as follows:
[0164] V: station set V = {1,...,n};
[0165] V0: station and scheduling center set V0 = {0,1,...,n};
[0166] K: scheduling vehicle set K = {1,2,...,m};
[0167] O: user departure set O = {1,2,...,q};
[0168] D: user destination set D = {1,2,...,q};
[0169] i: scheduling station, i∈V;
[0170] p: user OD station, p∈O,D;
[0171] V i : the i-th scheduling station;
[0172] d ij : the distance from station i to station j;
[0173] x ijk : whether the vehicle k is sent from node i to node j, if yes, x ijk =1, otherwise 0;
[0174] α1: the transportation cost generated by the scheduling vehicle during transportation;
[0175] α2: the fixed cost generated by enabling the scheduling vehicle;
[0176] c: constant;
[0177] k′: red envelope reward coefficient;
[0178] r ip : whether the user will park the shared bicycle at station i and then walk to the destination p, if yes, r ip =1, otherwise 0;
[0179] d ip : the walking distance of the user from station i to destination p;
[0180] P i : Penalty coefficient for site i deviating from the expectation;
[0181] E i : expected demand number of site i;
[0182] I i : Inventory quantity before transfer at site i;
[0183] m i : The number of shared bicycles dispatched to or from station i. If it is transferred in, then m i >0, if m is called out i <0;
[0184] t ik : The time when vehicle k starts scheduling to station i;
[0185] a i : left time window of station i;
[0186] b i : right time window of station i;
[0187] S ik : The service time of the dispatched vehicle at station i. If vehicle k does not serve station i, then S ik =0;
[0188] t ij : The travel time of the dispatched vehicle from station i to station j;
[0189] y i : The number of shared bicycles loaded when the dispatch vehicle arrives at station i;
[0190] y′ i : The number of shared bicycles loaded by the dispatch vehicle when it leaves station i;
[0191] U i : the number of red envelope vehicles transferred into station i;
[0192] Q: The maximum number of bicycles that each dispatch vehicle can carry;
[0193] S i : The time it takes to load and unload a shared bicycle.
[0194] Constraint (8) means that each vehicle will eventually return to the dispatch center after completing all dispatch tasks.
[0195] Constraints (9) (10) represent that the number of dispatch vehicles departing from and returning to the dispatch center is greater than 0;
[0196] Constraints (11) (12) represent that each station is only served by one dispatch vehicle;
[0197] Constraint (13) represents the continuity of the path, ensuring that the dispatch vehicle will leave the station after completing the dispatch task at the station;
[0198] Constraint (14) represents that the dispatch vehicle arrives within the time window at the station;
[0199] Constraint (15) represents that the time at which the dispatch vehicle arrives at the next station is greater than or equal to the sum of the time at which the last station is arrived, the service time, and the travel time between the two stations;
[0200] Constraint (16) represents that the number of shared bicycles loaded by the dispatch vehicle when leaving the station is equal to the sum of the number of shared bicycles loaded by the dispatch vehicle when arriving at the station and the number of shared bicycles served at the station;
[0201] Constraint (17) represents that the number of bicycles that need to be dispatched by the dispatch vehicle at the station is equal to the expected demand of the station minus the inventory of bicycles before dispatching at the station minus the number of vehicles dispatched into the station by users through the red envelope car;
[0202] Constraint (18) represents that the number of vehicles dispatched at the station cannot be greater than the maximum loading capacity of the dispatch vehicle;
[0203] Constraint (19) represents that the number of shared bicycles loaded by the dispatch vehicle when leaving the station after completing the dispatch task at the station cannot be greater than the maximum loading capacity of the dispatch vehicle;
[0204] Constraint (20) represents that the service time at the station is determined by the number of shared bicycles served;
[0205] Constraint (21) represents the constraint on the decision variable;
[0206] S4.3: input the relevant parameters of S4.2 into the greedy algorithm, define the shared bicycle dispatching problem and initialize the vehicle and time window;
[0207] At each step, select the station i closest to the current distribution point under the condition of considering the time window and capacity constraints; when a vehicle arrives at a distribution point, update the available time window (a i ,b i), which can be adjusted according to actual traffic conditions or delays, while updating the real-time inventory and future demand of each shared bicycle station, and adjusting the delivery sequence according to the urgency or demand priority of different stations; if the vehicle arrives at a certain delivery point earlier than the scheduled time window, it can choose to wait; if it is late, it needs to consider possible penalties or costs;
[0208] After selecting the optimal next delivery point each time, the path is added to the route of the current vehicle, and the iteration is continued until all deliveries are completed to obtain the optimal scheduling path.
[0209] In summary, the shared bicycle dynamic scheduling model based on demand prediction and user reward mechanism has been built, and after obtaining the scheduling demand of the shared bicycle scheduling station from S3, the station-related parameters and scheduling vehicle parameters are substituted into the mathematical model to obtain the corresponding scheduling route planning scheme and cost.
[0210] As shown in Figure 5 The scheduling strategy of the scheduling vehicle based on the above example based on demand prediction and user reward mechanism is shown, and in the parameter setting, the carrying capacity of each scheduling vehicle is 50, the red envelope reward coefficient is 0.004, the reward constant is 0.184, the fixed cost of the scheduling vehicle is 50 yuan per vehicle, and the driving cost generated by the scheduling is 1 yuan per kilometer.
[0211] The optimal scheduling path of the shared bicycle scheduling vehicle is obtained by using the greedy algorithm to solve the objective function as shown in Figure 5 The results show that 9 scheduling vehicles are dispatched from the scheduling center, and due to the large scheduling range and only one scheduling center, the total driving distance of the scheduling vehicles is 506.76km, and the scheduling vehicles meet the demand of the stations within the given time window, and there is no unserved vehicle and station. Among them, scheduling vehicle 1 serves the most stations, a total of 10 stations; scheduling vehicle 9 serves the least number of stations, only one station. By enlarging a specific scheduling area, it can also be seen that the demand station users also participate in the scheduling process, improving the overall scheduling efficiency. Under the condition of station demand prediction and user reward mechanism, the dynamic scheduling model of shared bicycles is constructed, which can effectively solve the route planning problem of scheduling vehicles.
[0212] Obviously, it should be noted that the above is only the preferred embodiment of the present application, and does not limit the patent protection scope of the present application, and any equivalent structure or equivalent flow transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A dynamic scheduling method for shared bicycles based on site demand forecasting and user reward mechanism, characterized in that: The following steps are involved: S1: Extract shared bicycle user travel OD data; The shared bicycle travel OD data includes: bicycle number, start time, start position horizontal coordinate, start position vertical coordinate, end time, end position horizontal coordinate and end position vertical coordinate; S2: Combine the DBSCAN clustering algorithm and the K-Means clustering algorithm to perform clustering evaluation on the shared bicycle travel OD data. After determining the optimal number of clusters based on the evaluation results, clustering is performed to divide the shared bicycle dispatch stations. In S2, the DBSCAN clustering algorithm and the K-Means clustering algorithm are combined to cluster the shared bicycle travel OD data, specifically including: S2.1: Preprocess the shared bicycle travel OD data to remove abnormal data and null value data; S2.2: Use the DBSCAN clustering algorithm to cluster the shared bicycle travel OD data. Adjust the parameters of the DBSCAN clustering algorithm based on the evaluation indicator of the silhouette coefficient S(i). After determining the parameter radius parameter ε and the minimum sample parameter minPts, estimate the approximate cluster number range of shared bicycle OD points. S2.3: Calculate the silhouette coefficient S(i) and the average distortion Evaluate the clustering effect of the K-Means clustering algorithm; The calculation formula of silhouette coefficient S(i) is as follows: Where a(i) represents the closeness between sample i and other samples in its cluster, which is calculated as the average distance between sample i and other samples; b(i) represents the separation between sample i and its nearest cluster, which is calculated as the average distance between sample i and all samples in its nearest cluster. Average distortion The calculation formula is as follows: where k is the number of clusters, C k is the set of all data points in the i-th cluster, u i represents the cluster center of the i-th cluster, x i represents the data point of the i-th cluster; In S2, the optimal number of clusters is determined based on the evaluation results, and clustering is performed to divide the shared bicycle dispatching stations, including: S2.4: The cluster number interval of the shared bicycle OD points determined in S2.2 is used as the reference cluster number range of S2.3, and the number of clusters corresponding to the maximum value of the silhouette coefficient S(i) and the average distortion degree are used. The optimal number of clusters k is determined by rapidly decreasing and approaching the "elbow point"; S2.5: Use the K-Means clustering algorithm to cluster the shared bicycle travel OD data, and use the obtained cluster center coordinates as the shared bicycle dispatch station coordinates; S3: Use the constructed CNN-LSTM neural network model to predict the future demand for bikes at different shared bike dispatch stations; S4: A dynamic scheduling model for shared bicycles is constructed based on demand forecasting and user reward mechanisms. A greedy algorithm is used to solve the objective function and the optimal scheduling path is updated in real time. The optimal scheduling path is used to guide scheduling vehicles to dynamically schedule shared bicycles in different areas.
2. The shared bicycle dynamic scheduling method based on site demand forecasting and user reward mechanism according to claim 1 is characterized by: In S2.5, the K-Means clustering algorithm is used to cluster the shared bicycle travel OD data, including: S2.5.1: Randomly select K data points as the initial cluster centers μ1,μ2,…,μ K ; S2.5.2: For each shared bicycle trip OD data coordinate x j , calculate its difference from all cluster centers μ i The Euclidean distance of: Where: x j is the OD data coordinate of shared bicycle travel, μ i is the cluster center coordinate, D is the data dimension, D = 2; Point x j Assign to the nearest cluster center S2.5.3: For each cluster C i , recalculate the cluster centers Where: |C i | is cluster C i The number of midpoints; x j It is cluster C i The point in S2.5.4: Repeat S2.5.2 and S2.5.3 until the cluster center μ is satisfied. i No longer changes or the cluster assignment of data points no longer changes, output the cluster centers μ1,μ2,…,μ K .
3. The shared bicycle dynamic scheduling method based on site demand forecasting and user reward mechanism according to claim 1 is characterized by: The CNN-LSTM neural network model built in S3 is used to predict the future demand for bikes at different shared bike dispatch stations, including: S3.1: Normalize the shared bicycle OD data to [0, 1], divide the shared bicycle dispatch stations into a two-dimensional matrix, and construct a time series dataset, where the time series dataset includes a training set, a validation set, and a test set; S3.2: Input time series data, the shape is [N, T, H, W], where N is the number of samples, T is the length of the time series, H and W are the spatial distribution; the predicted value of future OD data has the shape [N, T′, H, W], where T′ is the predicted time step; For each time step of OD data X t Perform convolution operation in: is the output feature of the kth convolution kernel, W (k) is the convolution kernel parameter, * is the two-dimensional convolution operation, and σ is the activation function; Downsample the convolution output to reduce the dimension P of the feature map t =pooling(Z t ), and perform pooling operation P on the pooling layer i,j =max{Z m,n |(m,n)∈window(i,j)}, where wimdow(i,j) is the pooling window; The pooled output P of each time step t Stacked by time dimension to form time series input P=[P1,P2,…,P n ]; S3.3: Input LSTM to sequence P and update hidden state: input gate i t =σ(W i ·[h t-1 ,P t ]+b i ); forget gate f t =σ(W f ·[h t-1 ,P t ]+b f ); candidate memory unit Update memory unit Output gate: o t =σ(W o ·[h t-1 ,P t ]+b o ); hidden state h t =o t ⊙tanh(C t ); The final output of LSTM is the time series feature H = [h1,h2,…,h T ], used to predict future OD data; S3.4: Input the LSTM output H into the fully connected layer and map it to the target OD data in is the predicted value, W h ,b h are the weights and biases of the fully connected layer respectively; S3.5: Train the CNN-LSTM neural network model, using mean square error as the loss function Update parameters using Adam optimizer Where θ is the model parameter; η is the learning rate; Hyperparameters adjust the parameters of the CNN layer and LSTM, as well as the time series length T and the prediction step length T′; S3.6: Input the test data set and predict future OD data And through the mean square error MSE, mean absolute error MAE and determination coefficient R 2 Evaluate the model performance.
4. The method for dynamic scheduling of shared bicycles based on site demand forecasting and user reward mechanism according to claim 1, characterized in that: In S4, a shared bicycle scheduling model is constructed based on demand forecasting and user reward mechanism, specifically including: S4.1: In a shared bike dispatching scenario involving users, it is necessary to reward users who park their bikes at a desired station and then walk to their destination. The variable considered is the user's walking distance. A user reward model is constructed: y = 0.184 + 0.004x, where y is the reward amount and x is the walking distance from the desired station to the user's destination. S4.2: Taking the operator's cost minimization as the optimization goal and considering the penalty cost of deviation from the expected inventory, the shared bicycle dynamic scheduling model based on demand forecasting and user reward mechanism consists of the objective function expressed by the following formula (4) to formula (7) and the constraints expressed by formula (8) to formula (21): a i ≤t ik ≤b i ,i∈{1,2,…,n},k∈{1,2,…,m} (14) t jk ≥t ik +S ik +t ij x ijk ,i∈{1,2,…,n},j∈{1,2,…,n},k∈{1,2,…,m} (15) y′ i =y i -m i x ijk ,i∈{1,2,…,n},j∈{1,2,…,n},k∈{1,2,…,m} (16 m i =E i -I i -U i ,i∈{1,2,…,n} (17) m i ≤Q,i∈{1,2,…,n} (18) and' i ≤Q,i∈{1,2,…,n} (19 S ik =m i S i ,i∈{1,2,…,n},k∈{1,2,…,m} (20) x ijk ∈{0,1},i∈{1,2,…,n},j∈{1,2,…,n},k∈{1,2,…,m} (21) The meaning of each parameter is as follows: V: site set V = {1,…,n}; V0: the set of sites and dispatch centers V0 = {0, 1, ..., n}; K: dispatch vehicle set K = {1, 2…, m}; O: user departure set O = {1, 2, ..., q}; D: User purpose set D = {1, 2, ..., q}; i: dispatching site, i∈V; p: user OD site, p∈O,D; V i : the i-th scheduling site; d ij : the distance from site i to site j; x ijk : Whether vehicle k goes from node i to node j, if yes then x ijk =1, otherwise 0; α1: transportation cost incurred by dispatching vehicles during transportation; α2: Fixed cost of using dispatch vehicles; c: constant; k': red envelope reward coefficient; r ip : Whether the user parks the shared bicycle at station i and walks to the destination p, if yes, then r ip =1, otherwise 0; d ip : the walking distance of the user from station i to destination p; P i : Penalty coefficient for site i deviating from the expectation; E i : expected demand number of site i; I i : Inventory quantity before transfer at site i; m i : The number of shared bicycles dispatched to or from station i. If it is transferred in, then m i >0, call out then m i <0; t ik : The time when vehicle k starts scheduling to station i; a i : left time window of station i; b i : right time window of station i; S ik : The service time of the dispatched vehicle at station i. If vehicle k does not serve station i, then S ik =0; t ij : The travel time of the dispatched vehicle from station i to station j; y i : The number of shared bicycles loaded when the dispatch vehicle arrives at station i; y′ i : The number of shared bicycles loaded by the dispatch vehicle when it leaves station i; U i : the number of red envelope vehicles transferred into station i; Q: The maximum number of bicycles that each dispatch vehicle can carry; S i : The time it takes to load and unload a shared bike; S4.3: Input the relevant parameters of S4.2 into the greedy algorithm, define the shared bicycle scheduling problem and initialize the vehicles and time windows; The calculation to obtain the optimal scheduling path is as follows: At each step, the station closest to the current delivery point is selected under the conditions of time window and capacity constraints; when a vehicle arrives at a delivery point, the available time window (a i ,b i ), whose available time window is adjusted according to actual traffic conditions or delays, while updating the real-time inventory and future demand of each shared bicycle station, and adjusting the delivery order according to the urgency or demand priority of different stations; If the vehicle arrives at a delivery point earlier than the scheduled time window, it can choose to wait; If a vehicle does not arrive at a delivery point earlier than the scheduled time window, potential fines or costs need to be considered; Each time the optimal next delivery point is selected, the path is added to the current vehicle's route, and the process continues iterating until all deliveries are completed to obtain the optimal scheduling path.
Citation Information
Patent Citations
Task scheduling method and device
CN111738488A
End-edge-cloud vehicle road collaborative fusion sensing architecture and construction method thereof
CN113743479A