A method for automatically compiling bus timetable

The method addresses incomplete bus timetables by integrating passenger flow prediction, departure interval optimization, and turnaround time modeling to create accurate and efficient bus schedules.

CN114066032BActive Publication Date: 2024-12-10ZHENGZHOU TIAMAES TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111315345.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2024-12-10
Estimated Expiration
2041-11-08

AI Technical Summary

Technical Problem

Existing bus timetable compilation methods fail to account for turnaround time at departure points, leading to incomplete schedules despite considering passenger flow variations.

Method used

A method involving passenger flow prediction, departure interval optimization, and turnaround time modeling using lightGBM algorithms to automatically generate a comprehensive bus timetable, incorporating weather, road conditions, and time periodicity.

Benefits of technology

The method significantly improves timetable accuracy and speed by considering multiple factors, reducing operation complexity and ensuring schedules align with passenger flow dynamics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066032B_ABST
    Figure CN114066032B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of public transportation planning, and specifically relates to a method for compiling an automatic public transportation schedule. The method first trains a passenger flow change law model through the lightGBM algorithm based on the passenger flow change law of the public transportation, and then calculates the departure interval that conforms to the passenger flow change law through the slope ratio model, and then trains a turnaround time change law model through the lightGBM algorithm, and finally obtains a complete public transportation schedule that conforms to the passenger flow change law. The method can obtain the departure schedule more quickly and accurately, greatly simplifies the operation process, and the method of the present invention fully considers the influence of objective factors affecting the operation of public transportation, and the consideration is more comprehensive. The calculated schedule is more reasonable and more in line with the characteristics of passenger flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of timetable compilation, and in particular relates to a method for automatically compiling a bus timetable. Background Art

[0002] With the advancement of my country's urbanization process, residents' travel is also facing more severe challenges. The vigorous development of subways and buses is in line with my country's "public transportation priority" strategy. Although public transportation still has a large share, the proportion of public transportation is gradually declining with the popularity of subways and diversified taxis and the irrationality of bus scheduling. How to effectively improve the utilization rate of public transportation vehicles is a key factor in improving passenger comfort and an important part of solving the current situation of urban congestion.

[0003] At present, some scholars have also conducted some research on the departure timetable of buses. Zhang Minghui et al. proposed a method for designing bus timetables in the article "A composite genetic algorithm for calculating urban bus timetables", considering the crowded characteristics of passenger flow at the station, combining the time constraints of bus operation and passenger arrival, and establishing an optimization model for bus timetables; Xu Mengfei proposed a new departure frequency optimization model based on the minimum expected total cost of a single vehicle in the article "Research on the optimization of departure frequency and timetable compilation of single-line buses". This model divides the operating time of a day into multiple equal-length time periods according to the passenger flow law, considering the impact of the choice of departure frequency in different time periods on passenger costs and bus costs; Yang Liu proposed a method to define peak and non-peak time periods in actual operation in the article "Research on the method of computer compilation of bus timetables", providing a reference for the vehicle configuration of each time period of the line. On this basis, the general process of compiling driving plans for up and down lines and the verification algorithm when the number of vehicles is not equal are proposed. At the same time, the number of vehicles in each time period is also arranged in detail according to the changes in passenger flow.

[0004] However, when compiling bus timetables, existing scholars generally only consider the impact of existing passenger flow on the departure timetable, and calculate the departure intervals during the operating period based on the changing rules of existing passenger flow. Although the above approach can calculate the departure intervals that conform to the changing rules of passenger flow, it is still impossible to obtain a complete bus timetable without the turnaround time of the given departure time point. Summary of the invention

[0005] In view of the defects and problems existing in the current bus schedule compilation method, the present invention provides a method for automatically compiling a bus schedule, which can automatically calculate the departure time point based on the travel passenger flow and then calculate the arrival time of the given departure time point through a turnaround time prediction model, thereby realizing the preparation of the departure schedule.

[0006] The solution adopted by the present invention to solve the technical problem is: a method for automatically compiling a bus timetable, comprising the following steps:

[0007] Step 1: Build a passenger flow prediction model based on the historical passenger flow data of the route to be optimized, and calculate the passenger flow of the route in different operating periods according to the passenger flow prediction model;

[0008] Step 2: Build a departure interval optimization model based on the operating time period and daily workload of the route to be optimized, and calculate the departure interval based on the passenger flow change pattern;

[0009] Step 3: Build a turnaround time prediction model based on the historical turnaround time data of the route to be optimized, calculate the arrival time of a given departure point based on the turnaround time prediction model, and generate a timetable based on the departure time point and its corresponding arrival time point.

[0010] The above-mentioned method for automatically compiling a bus schedule, step 1 of calculating passenger flow, comprises the following steps:

[0011] S1. Preprocess the historical passenger flow data of the route to be optimized, and use one-hot encoding to obtain preprocessed data for weather data and road conditions;

[0012] S2. Set the number of iterations or the maximum permissible training time, and use the lightGBM algorithm to train the preprocessed data to obtain a passenger flow prediction model. The steps are as follows:

[0013] (1) First, write the DataSet class to format the data so that it forms a dictionary;

[0014] (2) Define the parameters of lightGBM;

[0015] (3) Insert the parameter dictionary, training samples, test samples and evaluation indicators into the parameters of the lgb.train() method to obtain the optimal parameters and the optimal model, and save the model;

[0016] (4) Use the passenger flow prediction model to predict the test set;

[0017] S3, determine whether the number of iterations or the time limit is exceeded, if exceeded, output the passenger flow prediction model and end the training process; if not exceeded, return to step 2;

[0018] S4. Use the passenger flow prediction model to calculate the passenger flow in different time periods.

[0019] The above-mentioned method for automatically compiling bus schedules preprocesses historical passenger flow data, including cleaning and fusing multi-source historical passenger flow data from different systems, including redundant data processing, outlier deletion and missing value completion; the fusion method is:

[0020] f(x1,x2,...,x n )=a1x1+a2x2+....+a n x n

[0021] Where: x1, x2, ..., x n are the dimensional features of the multi-source dataset; a1, a2, ..., a n is the dimension weight of the multi-source dataset.

[0022] The above-mentioned method for automatically compiling a bus schedule, step 2 of calculating the departure interval includes the following steps:

[0023] S1, taking the passenger flow of the first period of the route to be optimized as the origin, and calculating the slope corresponding to each period according to the calculated passenger flow of other periods;

[0024] S2. Calculate the number of shifts per time period pi based on the slope and departure frequency of each time period.

[0025]

[0026] Where: y min is the minimum passenger flow in the time period, y i is the passenger flow in each period, k is the total number of departures throughout the day;

[0027] S3. Calculate the departure interval t for each time period based on the number of shifts and time period i ;

[0028]

[0029] S4. Determine whether the departure interval is reasonable according to the given operating time period. If it is unreasonable, remove the unreasonable departure interval and return to Step 3. If it is reasonable, calculate the departure time of each trip according to the departure interval, and then output the departure time points for the whole day.

[0030] In the above-mentioned method for automatically compiling a bus schedule, the calculation of the departure interval requires calculating the departure interval of each time period under the premise of a given full-day task volume, that is, the departure interval of each time period when F(n) = task;

[0031]

[0032]

[0033] Where: t i is the departure interval during the time period, total Time For full-day operation, T max is the maximum departure interval, task is the whole day's task, St The operation start time.

[0034] In the above-mentioned method for automatically compiling a bus schedule, the arrival time of a given departure time point in step 3 includes the following steps:

[0035] S1. Merge the turnaround time data generated during the actual operation of the historical bus routes to be optimized with the objective factor data and the route and vehicle data;

[0036] S2. Preprocess the merged data separately, including missing value filling and outlier deletion;

[0037] S3, input the preprocessed data into lightGBM, set the number of iterations for iteration;

[0038] S4, judging whether the number of iterations is completed or the loss is converged, if completed or converged, outputting the turnaround time prediction model; otherwise, looping step S3;

[0039] S5. Input the departure times of the whole day into the turnaround time prediction model and consider the objective factors of the day and the influence of the line and vehicle conditions on the turnaround time to calculate and output the arrival time of the given departure time.

[0040] In the above-mentioned method for automatically compiling a bus schedule, the multi-source data fusion method in step S1 is:

[0041] f(y1, y2, ..., y n )=b1y1+b2y2+…+b n y n

[0042] Where: y1, y2, ..., y n are the dimensional characteristics of different objective factors, b1, b2, ..., b n is the dimension weight of the multi-source dataset.

[0043] Beneficial effects of the present invention: The present invention mainly scientifically compiles bus operation plans, analyzes the passenger flow variation law of the route to be optimized, fully considers the influence of objective factors such as weather, road conditions, and time periodicity, and then obtains a passenger flow prediction model through the lightGBM algorithm, processes various factors and incorporates them into the bus passenger flow analysis system, which is more in line with the actual situation of the bus; then the slope ratio algorithm is used to calculate the departure interval that conforms to the passenger flow variation law during the operating period, and seconds are used as the departure interval division point, which is conducive to optimizing the design of the shifts while increasing the accuracy of the model, so that in a given operating time period, the first time of the operating time period must be the departure time point of the first shift, and the last time is the departure time point of the last shift. The departure time points that do not meet the matching points are smoothed, which can better match the required characteristics; finally, various factors affecting the line turnaround time are fully considered and processed, and the turnaround time model is trained through the lightGBM algorithm, and finally a complete timetable that conforms to the passenger flow variation law is obtained, thereby realizing the automatic generation of the bus departure timetable. The method can obtain the departure timetable more quickly and accurately, greatly simplifying the operation process. In addition, the method of the present invention fully considers the impact of objective factors affecting public transportation operation, and the consideration is more comprehensive. The calculated timetable is more reasonable and more in line with passenger flow characteristics.

[0044] The present invention greatly improves the accuracy of the final result by considering objective factors and time periodic factors (such as holidays, working days, and rest days) for prediction. At the same time, there are qualitative improvements in calculation speed and deployment difficulty. For example, in terms of calculation speed, the original mode needs to consider the series connection of multiple templates, so its calculation speed is slow, while the new mode can realize one-click calculation, so the calculation speed is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0046] Figure 2 It is the passenger flow prediction flow chart of the present invention.

[0047] Figure 3 This is the relationship diagram between passenger flow and departure interval.

[0048] Figure 4 This is a prediction flow chart of the present invention.

[0049] Figure 5 This is the passenger flow and turnaround time prediction result of the method of the present invention.

[0050] Figure 6 The following is a departure timetable generated according to the method of the present invention.

[0051] Figure 7This is the result of the passenger flow template produced by the original method.

[0052] Figure 8 This is the passenger flow prediction result of the original method.

[0053] Fig. 9 Produce results for the original method turnaround time template.

[0054] Fig.10 The turnaround time prediction results for the original method.

[0055] Fig.11 Select the passenger flow template for the original method.

[0056] Fig.12 Select for the Original Method Turnaround Time template.

[0057] Fig.13 The departure timetable generated by the original method. DETAILED DESCRIPTION

[0058] In view of the problems that the calculation operation of the current departure timetable is complicated, time-consuming and low-precision, the present invention provides a method for compiling an automatic bus timetable, which fully considers the objective factors affecting bus operation, greatly reduces the operation steps, reduces the time and improves the precision, and at the same time obtains a more reasonable departure timetable that is more in line with the characteristics of passenger flow. The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0059] Embodiment 1: This embodiment provides a method for compiling an automatic public transportation timetable, the method comprising the following steps:

[0060] Step 1: Build a passenger flow prediction model based on the historical passenger flow data of the route to be optimized, and calculate the passenger flow in different operating periods based on the passenger flow prediction model.

[0061] By analyzing the historical card swiping data of the routes to be optimized, we can know that the travel of passengers shows a certain periodicity. High-precision prediction of the future passenger flow of the routes to be optimized is the basis for optimizing the departure interval. When processing the historical passenger flow of buses, the impact of factors such as weather factors and road conditions on passenger travel is taken into account. For example, the passenger flow of buses in extreme weather such as rainy and snowy days shows a downward trend. Buses also show a downward trend under road construction and congestion. However, bus passenger flow shows an upward trend when the road is smooth and the weather is relatively comfortable. Therefore, it is necessary to take into account the impact of objective factors in the passenger flow prediction process.

[0062] The following steps are involved:

[0063] S1. Preprocessing the historical passenger flow data of the route to be optimized, wherein the preprocessing includes cleaning and fusing the historical passenger flow data of different systems, specifically including redundant data processing, outlier deletion and missing value completion;

[0064] The fusion method is:

[0065] f(x1,x2,...,x n )=a1x1+a2x2+....+a n x n

[0066] Where: x1, x2, ..., x n are the dimensional features of the multi-source dataset; a1, a2, ..., a n is the dimension weight of the multi-source dataset.

[0067] Then the weather data and road conditions are encoded using one-hot encoding to obtain preprocessed data, as shown in Table 1 below.

[0068] Table 1 One-hot encoding results for different weather conditions and roads

[0069]

[0070] S2. Set the number of iterations or the maximum permissible training time, and use the lightGBM algorithm to train the preprocessed data to obtain a passenger flow prediction model. The steps are as follows:

[0071] (1) First, write the DataSet class to format the data so that it forms a dictionary;

[0072] (2) Define the parameters of lightGBM;

[0073] (3) Insert the parameter dictionary, training samples, test samples and evaluation indicators into the parameters of the lgb.train() method to obtain the optimal parameters and the optimal model, and save the model;

[0074] (4) Use the passenger flow prediction model to predict the test set;

[0075] S3, judging whether the number of iterations or the time limit is exceeded, if exceeded, outputting the passenger flow prediction model and ending the training process;

[0076] If it does not exceed, return to step 2;

[0077] S4, using the passenger flow prediction model to calculate the passenger flow in different time periods;

[0078] Step 2: Calculate the departure interval based on the operating time period and the daily workload of the route to be optimized and the passenger flow change rule;

[0079] The feasibility of the algorithm needs to be considered during implementation. The following assumptions are made during design to meet the needs of bus companies:

[0080] (1) The generated intervals match the overall trend of passenger flow;

[0081] (2) The matching degree can be appropriately sacrificed to achieve interval oversmoothing;

[0082] (3) The peak points of passenger flow match the low peak points of the interval.

[0083] See Figure 3 ; Curve 1 is the passenger flow, and curve 2 is the departure interval.

[0084] from Figure 3 It can be seen that passenger flow is inversely proportional to the departure interval. If the passenger flow is large, the departure interval needs to be shortened to ensure the full load rate of the vehicle; when the passenger flow is relatively low, the departure interval needs to be increased to avoid wasting resources.

[0085] A slope ratio model is established for this algorithm to better match the required characteristics, that is, to calculate the departure interval of each time period under the premise of a given full-day task volume, that is, the departure interval of each time period when F(n) = task t i The value of .

[0086]

[0087]

[0088] Where: t i is the departure interval during the time period, total Time For full-day operation, T max is the maximum departure interval, task is the whole day's task, S t The operation start time;

[0089] The following steps are involved:

[0090] S1, taking the passenger flow of the first period as the origin, calculate the corresponding slope according to the passenger flow of other periods;

[0091] The slope is mainly used to judge the relationship between the passenger flow in each time period and the time period with the lowest passenger flow. When determining the correlation between the departure intervals in each time period, it is necessary to fully consider the inverse proportional characteristics of the passenger flow and the departure interval. Here, the passenger flow in other time periods is normalized based on the time period with the minimum passenger flow. For example, if the passenger flow in time periods T1, T2, T3, T4, and T5 are 100, 50, 30, 20, and 10 respectively, then the corresponding normalized slopes are 10, 5, 3, 2, and 1, which can reduce the amount of calculation when calculating the departure interval.

[0092] S2, calculate the number of shifts pi for each period according to the slope and departure frequency of each period;

[0093]

[0094] where y min is the minimum passenger flow in the time period, y i is the passenger flow in each period, k is the total number of departures throughout the day;

[0095] S3. Calculate the departure interval t for each time period based on the number of shifts and time period i ,

[0096]

[0097] Wherein: T is the time period, and in this embodiment, T is set to 1h.

[0098] S4. Determine whether the departure interval is reasonable based on the given operating time period.

[0099] If t i >T max , remove the unreasonable departure interval and return to S3;

[0100] If t i ≤T max , output the departure time points throughout the day;

[0101] The pseudo code for running is shown below.

[0102]

[0103] Step 3: construct a turnaround time prediction model based on the historical turnaround time data of the route to be optimized, and calculate the train collection time of a given departure point based on the turnaround time prediction model, including the following steps:

[0104] S1. Merge the turnaround time data generated during the actual operation of the historical bus routes to be optimized with the objective factor data and the route and vehicle data;

[0105] f(y1, y2, ..., y n )=b1y1+b2y2+…+b n y n

[0106] Where: y1, y2, ..., y n are the dimensional characteristics of different objective factors, b1, b2, ..., b n is the dimension weight of the multi-source dataset;

[0107] S2. Preprocess the merged data separately, including missing value filling and outlier deletion;

[0108] S3, input the preprocessed data into lightGBM, set the number of iterations for iteration;

[0109] S4, judging whether the number of iterations is completed or the loss is converged, if completed or converged, outputting the turnaround time prediction model; otherwise, looping step (3);

[0110] S5. Input the departure times of the whole day into the turnaround time prediction model and consider the objective factors of the day and the influence of the line and vehicle conditions on the turnaround time to calculate and output the arrival time of the given departure time.

[0111] Specifically, this embodiment is based on the historical data of a certain line, and uses the passenger flow prediction model, departure interval optimization model and turnaround time prediction model trained by the present invention to directly predict the passenger flow and turnaround time of a certain day. The results are as follows: Figure 5 As shown;

[0112] The predicted passenger flow and turnaround time are used to generate a departure schedule. The results are as follows: Figure 6 shown.

[0113] It can be seen from the above-mentioned schedule generation process that the prediction model is prepared by the method of the present invention. When in use, the schedule can be directly and automatically generated according to the model, which only requires two steps and is simple and fast.

[0114] At the same time, in order to reflect the advantages of the method of the present invention, a common timetable production method is provided for comparison. The timetable needs to obtain historical operation data from the database for prediction and calculation. The operation data granularity is specific to a certain vehicle and a certain station. The data volume is huge and the operation speed is slow. The specific production process is as follows:

[0115] S1. Create a passenger flow template to filter out abnormal data. See the results. Figure 7 .

[0116] S2, passenger flow prediction, predict the current and future passenger flow based on the passenger flow template selected in the first step; the results are shown in Figure 8 .

[0117] S3. Turnaround time template creation to filter out abnormal data; see the results Fig. 9 .

[0118] S4, Turnaround time forecast, predict the current and future turnaround time based on the turnaround time template selected in step 3; the results are shown in Fig.10 .

[0119] S5. Select the passenger flow template and apply the predicted passenger flow to that day. The result is shown in Fig.11 .

[0120] S6. Select the turnaround time template and apply the predicted turnaround time to the day; see the result. Fig.12 .

[0121] S7, generate a timetable, generate a departure timetable based on the predicted passenger flow and turnaround time, the result is shown in Fig.13 .

[0122] From the above, the passenger flow prediction model of the present invention not only takes into account its own true value, but also fully considers the influence of objective factors such as time periodicity and weather, so that its accuracy is greatly improved.

[0123] From the comparison results of the above cases, it can be seen that the comparison method requires seven steps to make a departure schedule, and the passenger flow template and turnaround time template of the original schedule only consider the average value of the same time point in the past few days during the production process. The operation process is complicated and the accuracy is low. In addition to considering its own true value, the passenger flow prediction model of the present invention also fully considers the influence of objective factors such as time periodicity and weather. When using the prediction model, only two steps are required to directly and automatically generate the schedule according to the model. Compared with the comparison method, it not only greatly reduces the operation process, but also significantly improves the calculation speed and accuracy.

Claims

1. A method for automatically compiling a bus schedule, characterized in that: The following steps are involved: Step 1: Build a passenger flow prediction model based on the historical passenger flow data of the route to be optimized, and calculate the passenger flow of the route in different operating periods according to the passenger flow prediction model; The calculation of passenger flow includes the following steps: S1. Preprocess the historical passenger flow data of the route to be optimized, and use one-hot encoding to obtain preprocessed data for weather data and road conditions; Preprocessing of historical passenger flow data includes cleaning and fusion of multi-source historical passenger flow data from different systems, including redundant data processing, outlier deletion and missing value completion; the fusion method is: f(x1,x2,…,x n )=a1x1+a2x2+....+a n x n Where: x1, x2, ..., x n are the dimensional features of the multi-source dataset; a1, a2, ..., a n is the dimension weight of the multi-source dataset; S2. Set the number of iterations or the maximum permissible training time, and use the lightGBM algorithm to train the preprocessed data to obtain a passenger flow prediction model. The steps are as follows: (1) First, write the DataSet class to format the data so that it forms a dictionary; (2) Define the parameters of lightGBM; (3) Insert the parameter dictionary, training samples, test samples and evaluation indicators into the parameters of the lgb.train() method to obtain the optimal parameters and the optimal model, and save the model; (4) Use the passenger flow prediction model to predict the test set; S3, determine whether the number of iterations or time limit is exceeded, if exceeded, output the passenger flow prediction model and end the training process; if not exceeded, return to step 2; S4, using the passenger flow prediction model to calculate the passenger flow in different time periods; Step 2: Build a departure interval optimization model based on the operating time period and daily workload of the route to be optimized, and calculate the departure interval based on the passenger flow change pattern; The calculation of the departure interval includes the following steps: S1, taking the passenger flow of the first period of the route to be optimized as the origin, and calculating the slope corresponding to each period according to the calculated passenger flow of other periods; S2. Calculate the number of trains per time period based on the slope and departure frequency of each time period. i , Where: y min is the minimum passenger flow in the time period, y i is the passenger flow in each period, k is the total number of departures throughout the day; S3. Calculate the departure interval t for each time period based on the number of shifts and time period i ; Where: T is the time period; The calculation of the departure interval requires calculating the departure interval of each time period under the premise of a given full-day task volume, that is, the departure interval of each time period when F(n) = task; Where: t i is the departure interval for each period, total Time For full-day operation, T max is the maximum departure interval, task is the whole day's task, S t The operation start time; S4. Determine whether the departure interval is reasonable based on the given operating time period. If i >T max , remove the unreasonable departure interval and return to S3; If i ≤T max , calculate the departure time of each bus according to the departure interval, and then output the departure time points for the whole day; Step 3: construct a turnaround time prediction model based on the historical turnaround time data of the route to be optimized, calculate the arrival time of a given departure point based on the turnaround time prediction model, and generate a timetable based on the departure time point and its corresponding arrival time point; The pick-up time for a given departure time point includes the following steps: S1. Merge the turnaround time data generated during the actual operation of the historical bus routes to be optimized with the objective factor data and the route and vehicle data; The multi-source data fusion method in step S1 is: f(y1,y2,...,y n )=b1y1+b2y2+...+b n y n Where: y1, y2, ..., y n are the dimensional characteristics of different objective factors, b1, b2, ..., b n is the dimension weight of the multi-source dataset; S2. Preprocess the merged data separately, including missing value filling and outlier deletion; S3, input the preprocessed data into lightGBM, set the number of iterations for iteration; S4, judging whether the number of iterations is completed or the loss is converged, if completed or converged, outputting the turnaround time prediction model; otherwise, looping step S3; S5. Input the departure times of the whole day into the turnaround time prediction model and consider the objective factors of the day and the influence of the line and vehicle conditions on the turnaround time to calculate and output the arrival time of the given departure time.