A method for dividing bus operation periods based on time series clustering

By using a method based on time series clustering, bus operation periods are dynamically adjusted, which solves the problem of inaccurate operation time division in the existing technology and achieves more efficient bus operation punctuality and improved service levels.

CN116757390BInactive Publication Date: 2024-08-27北京蔚行科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310496618.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing bus line operation time division method is not very accurate and ignores the differences in characteristics of different time periods, which affects the travel time of bus vehicles and passenger demand, resulting in insufficient punctuality of operations.

Method used

The bus operation period division method based on time series clustering is adopted. By inputting the travel time data and departure time, the period division parameters are set, such as the forward and backward standard deviation and minimum length of the travel time, and the multi-center clustering algorithm is used to dynamically adjust Period division, combined with time sequence merging of periods, achieves accurate division of period characteristics.

Benefits of technology

It effectively improves the punctuality and service level of bus operations, can take into account scenarios with and without given time periods, and improves the accuracy of timetables and operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004212278540000091
    Figure BDA0004212278540000091
  • Figure BDA0004212278540000101
    Figure BDA0004212278540000101
  • Figure BDA0004212278540000102
    Figure BDA0004212278540000102
Patent Text Reader

Abstract

The present invention discloses a method for dividing bus operation periods based on time series clustering, which extracts travel time data of bus lines from historical operation records, and counts travel time data sets corresponding to different time points according to departure times; based on the characteristics of each data set, a multi-center clustering method is used to classify time points with similar characteristics into one category; after obtaining the clustering results, sample points of the same type are merged in chronological order according to the time labels corresponding to the data sets, thereby obtaining the division results of the operation periods. The method of the present invention uses travel time to characterize the characteristics of the bus operation period, and data acquisition is simple and easy, which realizes the division of time periods based on operation characteristics, can effectively help improve the punctuality of bus operation and improve the service level, and has practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of bus line operation time characteristic analysis and division, and in particular to a bus operation time period division method based on time series clustering. Background Art

[0002] The operating hours of bus routes throughout the day usually span a large span. Passenger demand and road traffic conditions will fluctuate greatly at different time periods of the day, which in turn affects the travel time of buses and has a significant impact on the punctuality of bus arrival and departure times. Reasonable division of the operating hours throughout the day according to the characteristics of different time periods is the key to improving service levels. At present, in the actual operation of buses, the high, flat and low peak start and end times of the routes are usually given based on the local commuting time rules and combined with historical experience. This method is not very accurate and tends to ignore the differences in characteristics of different time periods. Summary of the invention

[0003] In view of the shortcomings of the prior art, the present invention aims to provide a method for dividing bus operating time periods based on time series clustering, which uses the travel time data that is easier to obtain to reflect the characteristics of passenger demand and road traffic conditions in each time period, while taking into account the impact of travel time on the punctuality of bus arrival and departure.

[0004] In order to achieve the above object, the present invention adopts the following technical solution:

[0005] The bus operation period division method based on time series clustering includes the following steps:

[0006] Step 1: Input the travel time data of the bus line and the corresponding departure time. According to the line service level requirements, set the allowable standard deviation of the travel time in the same period and the minimum length of the bus operation period as the period division parameters; the period division parameters include the forward standard deviation δ- and the backward standard deviation δ + , the minimum length of bus operation period T min ;

[0007] Step 2: Count the travel time data set by departure time: The travel time data with the same departure time are classified into the same data set, and the departure time is recorded as the timestamp corresponding to the data set; the median of each data set is counted, and each data set is converted into a sample feature point represented by the median and the timestamp; each sample feature point corresponds to a different departure timestamp, and the departure timestamp is calculated in the format of "hour: minute" (i.e. HH:MM), and all departure timestamps represent the full-day operation time period of the target line;

[0008] Step 3: Use all the processed sample feature points to perform multi-center clustering. The number of cluster centers is not preset. Instead, the most appropriate number of cluster centers is found through analysis, iteration and update of the sample feature points, thereby obtaining the clustering results of the sample feature points.

[0009] Step 4: Based on the clustering results, sample feature points are merged based on time order: each sample feature point corresponds to a category label and a timestamp label. All sample feature points are first sorted in timestamp order. Then, in the obtained sequence, if two adjacent sample feature points have the same category label, they are merged into the same time period. After the merger is completed, check whether there is a time period whose length is less than the minimum length value T of the bus operation period set in step 1. min , and merge it with the previous or next period.

[0010] Furthermore, in step 1, the time period division parameter also includes a maximum number of time period divisions N.

[0011] Furthermore, in step 1, if a data set is X = {x1, x2, x3, ..., x n- ,x n}, the median is m, and the data set smaller than the median is X - ={x i |x i <m,x i ∈X}, the data set greater than the median is X + ={x i |x i >m,x i ∈X}, then the forward deviation σ - for: Backward bias σ + for Here |*| represents the number of elements in the set, and the forward standard deviation δ - , backward standard deviation δ + are the standard values ​​of forward deviation and backward deviation, forward standard deviation δ - , backward standard deviation δ + Indicates the fluctuation range of travel time data.

[0012] Furthermore, in step 3, the specific process of the multi-center clustering is as follows:

[0013] 3.1) Input the sample feature point set S, the initial cluster center number m=1, and randomly select one from all the sample feature points as the initial cluster center c1;

[0014] 3.2) Calculate all sample feature points s∈S and each cluster center c in turn i , i = 1, 2…, the distance difference between m: Ds ={d si =|sc i ||i=1,2…,m}, then classify the sample feature point s∈S into the category corresponding to the nearest center i, i=argmin D s (i);

[0015] 3.3) After all sample feature points are classified, the median of the sample feature points contained in each class is set as the new cluster center of the class, and compared with the cluster center before the update; if the position of a cluster center has changed, return to step 3.2), otherwise go to step 3.4);

[0016] 3.4) After the cluster centers no longer change, calculate the forward deviation and backward deviation of all original travel time data sets corresponding to the sample feature points in each class: If the travel time data sets corresponding to all classes satisfy σ - ≤δ - And σ + ≤δ + , clustering is completed and the clustering result is output, that is, each sample feature point will have a new category label; otherwise, let the number of cluster centers m = m + 1 and randomly select a sample feature point as the cluster center of the newly added class, and then return to 3.2).

[0017] Furthermore, in step 4, if there is a time period whose length is less than T min When further merging is required, the forward deviation and backward deviation of the travel time data set corresponding to the new period obtained by merging the period with the previous period or the next period need to be calculated respectively: if the forward deviation and backward deviation obtained by merging with the previous period are both smaller than the forward deviation and backward deviation obtained by merging with the next period, then merge with the previous period; if the forward deviation and backward deviation obtained by merging with the next period are both smaller than the forward deviation and backward deviation obtained by merging with the previous period, then merge with the next period; otherwise, calculate the sum of the forward deviation and backward deviation obtained in the two cases, and merge with the period with the smaller sum of the forward deviation and backward deviation; if there are multiple periods with lengths less than T min , then the time periods are merged in order from small to large; if it does not exist, the time period division is completed and the result is output.

[0018] Furthermore, if the maximum number of time period divisions N is preset and the number of time periods obtained after steps 1 to 4 is still greater than N, the adjacent time periods are merged in the order of the remaining time period lengths from small to large until the number of time periods is reduced to N, and the time period division result is output.

[0019] The beneficial effects of the present invention are as follows: the method of the present invention uses travel time to characterize the characteristics of bus operation periods, data acquisition is simple and easy, and time period division based on operation characteristics is realized, which can effectively help improve the punctuality of bus operations and improve service levels, and has practical application value.

[0020] Specifically, the multi-center clustering algorithm based on time series proposed in the present invention can take into account both scenarios of no given target time period number and given target time period number, and can be selected by bus operators according to actual conditions, with a wider scope of application; at the same time, time period division is the basis of bus timetable design. The present invention divides the bus operation time periods based on historical data analysis, taking into account the operation characteristics of different time periods, which can help improve the accuracy of the timetable and enhance the service level of bus operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a flow chart of a method for dividing bus operation periods based on time series clustering in Embodiment 1 of the present invention;

[0022] Figure 2 This is a schematic diagram of the distribution of historical travel time data of a bus route in Lianyungang in the experiment of Example 2 of the present invention;

[0023] Figure 3 A schematic diagram of a method for converting historical travel time data into sample feature points in an experiment of Example 2 of the present invention;

[0024] Figure 4 Schematic diagram of a method for merging sample feature points based on time sequence in the experiment of Example 2 of the present invention. DETAILED DESCRIPTION

[0025] The present invention will be further described below in conjunction with the accompanying drawings. It should be noted that this embodiment is based on the technical solution and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to this embodiment.

[0026] This embodiment provides a method for dividing bus operation periods by time series clustering. Considering that buses in most cities are currently equipped with positioning devices (GPS), it is very convenient to extract the travel time information of the route, and the passenger flow of the route and the road traffic conditions during the operation process can be reflected by the length of the travel time. More importantly, the travel time is a direct factor affecting the punctuality of bus arrivals and departures. Therefore, analyzing the operation characteristics of the time period based on the travel time is a simple and effective method.

[0027] The bus operation period division method based on time series clustering is as follows: Figure 1 As shown, the following steps are included:

[0028] Step 1: Input the travel time data of the bus line and the corresponding departure time, and set the allowable standard deviation of the travel time in the same period and the minimum length of the bus operation period according to the line service level requirements as the period division parameters. The period division parameters include the forward standard deviation of the travel time in the same period δ - , backward standard deviation δ + , the minimum length of bus operation period T min , according to the needs of the operating company, the maximum number of time period divisions N can also be set.

[0029] The specific calculation method of forward deviation and backward deviation is: if a data set is X = {x1, x2, x3, ..., x n- ,x n}, the median is m, and the data set smaller than the median is X - ={x i |x i <m,x i ∈X}, the data set greater than the median is X + ={x i |x i >m,x i ∈X}, then the forward deviation σ - for: Backward bias σ + for Here |*| represents the number of elements in the set, and the forward standard deviation δ - , backward standard deviation δ + are the standard values ​​of forward deviation and backward deviation, forward standard deviation δ - , backward standard deviation δ + It indicates the fluctuation range of travel time data. Since the division of bus operation periods is the basis for the formulation of bus operation timetables, the parameter selection will further affect the punctuality of the timetable. Therefore, the standard deviation value can be selected according to the tolerance of the operating company for the punctuality of the timetable; the minimum length of the bus operation period T min It should be selected according to the line characteristics and the distribution interval of the departure interval. min A T value that is too large may easily result in extremely short time segments appearing in the time segmentation results and make it impossible to schedule the departure time. min The value tends to ignore the differences between time periods, so it is usually recommended to use T min The value is 60min.

[0030] Step 2: Count the travel time data sets by departure time: The travel time data with the same departure time are classified into the same data set, and the departure time is recorded as the timestamp corresponding to the data set; the median of each data set is counted, and each data set is converted into a sample feature point represented by the median and the timestamp; each sample feature point corresponds to a different departure timestamp, and the departure timestamp is calculated in the "hour: minute" (i.e. HH:MM) format, and all departure timestamps represent the target line's full-day operating time period.

[0031] Step 3: Use all the processed sample feature points to perform multi-center clustering. The number of cluster centers is not preset, but the most appropriate number of cluster centers is found through analysis, iteration and update of the sample feature points, thereby obtaining the clustering result of the sample feature points. The specific process of the multi-center clustering is as follows:

[0032] 3.1) Input the sample feature point set S, the initial cluster center number m = 1, and randomly select one from all sample feature points as the initial cluster center c1;

[0033] 3.2) Calculate all sample feature points s∈S and each cluster center c in turn i , i = 1, 2…, the distance difference between m: D s ={d si =|sc i ||i=1,2…,m}, then classify the sample feature point s∈S into the category corresponding to the nearest center i, i=argmin D s (i);

[0034] 3.3) After all sample feature points are classified, the median of the sample feature points contained in each class is set as the new cluster center of the class, and compared with the cluster center before the update; if the position of a cluster center has changed, return to step 3.2), otherwise go to step 3.4);

[0035] 3.4) After the cluster centers no longer change, calculate the forward deviation and backward deviation of all original travel time data sets corresponding to the sample feature points in each class: If the travel time data sets corresponding to all classes satisfy σ - ≤δ - And σ + ≤δ + , clustering is completed and the clustering result is output, that is, each sample feature point will have a new category label; otherwise, let the number of cluster centers m = m + 1 and randomly select a sample feature point as the cluster center of the newly added class, and then return to 3.2).

[0036] Step 4: Based on the clustering results, sample feature points are merged based on time order: each sample feature point corresponds to a category label and a timestamp label. All sample feature points are first sorted in timestamp order. Then, in the obtained sequence, if two adjacent sample feature points have the same category label, they are merged into the same time period. After the merger is completed, check whether there is a time period whose length is less than the minimum length value T of the bus operation period set in step 1. min :If there is a period of time less than T min When further merging is required, the forward deviation and backward deviation of the travel time data set corresponding to the new period obtained by merging the period with the previous period or the next period need to be calculated respectively: if the forward deviation and backward deviation obtained by merging with the previous period are both smaller than the forward deviation and backward deviation obtained by merging with the next period, then merge with the previous period; if the forward deviation and backward deviation obtained by merging with the next period are both smaller than the forward deviation and backward deviation obtained by merging with the previous period, then merge with the next period; otherwise, calculate the sum of the forward deviation and backward deviation obtained in the two cases, and merge with the period with the smaller sum of the forward deviation and backward deviation; if there are multiple periods with lengths less than T min , then the time periods are merged in order from small to large; if it does not exist, the time period division is completed and the result is output.

[0037] In addition, if the maximum number of time period divisions N is preset and the number of time periods obtained after the above steps are completed is still greater than N, the adjacent time periods are merged in the order of the remaining time period lengths from small to large until the number of time periods is reduced to N, and the time period division result is output.

[0038] Example 2

[0039] This example uses a bus route in Lianyungang City, Jiangsu Province as an example to verify the effectiveness of the method proposed in Example 1. In this example, according to the relevant regulations that "the actual arrival time of the last stop is 2 minutes earlier or 5 minutes later than the scheduled schedule as the last stop arrival time", the forward standard deviation δ - Take 2min, backward standard deviation δ + Take 5 minutes, the minimum length of the bus operation period is T min Take 60 minutes and set the maximum number of time divisions N to 6 according to the needs of the operating company.

[0040] Figure 2 It shows all the historical travel time data records and distribution of the route used to analyze time characteristics and divide time periods. Figure 2 It can be seen that each departure time corresponds to multiple travel time records, so it is necessary to extract sample feature points according to step 2 of the method in Example 1. Take the travel time record with a departure time of 6:00 as an example, Figure 3The method of extracting sample feature points at this time is shown. The sample feature points of other departure times are extracted in the same way. Table 1 shows the clustering results and the minimum length of the time period T. min , the time period division result is obtained after merging the sample feature points.

[0041] Table 1 Results of time period division based on multi-center clustering

[0042]

[0043]

[0044] If there is no preset maximum number of time period divisions, Table 1 is the result of time period division; since the maximum number of time period divisions N is set to 6 in this example, time periods are further merged based on the results in Table 1: the shortest time period is time period 6 (81 minutes), and after calculating the forward and backward deviations after merging it with time periods 5 and 7, the forward and backward deviations obtained by merging time periods 5 and 6 are both smaller, so time periods 5 and 6 are merged, and the length of the new time period is 167 minutes; at this time, the number of time periods is 7, and the shortest time period is still to be found, which is time period 4 (83 minutes). Similarly, it is calculated that it should be merged with time period 3, and the final result is shown in Table 2:

[0045] Table 2 Final results of time period division calculated by the preset time period number

[0046]

[0047]

[0048] The results show that the bus operation period division method based on time series clustering proposed in Example 1 can use travel time data to simply and effectively characterize the operation period characteristics, can take into account both the given maximum number of time periods and the ungiven number of time periods, and achieve accurate division based on time period characteristics, which has practical application value.

[0049] For those skilled in the art, various corresponding changes and modifications can be made according to the above technical solutions and concepts, and all of these changes and modifications should be included in the protection scope of the claims of the present invention.

Claims

1. A method for dividing bus operation periods based on time series clustering, characterized in that: The following steps are involved: Step 1: Input the travel time data of the bus line and the corresponding departure time, and set the allowable standard deviation of the travel time in the same period and the minimum length of the bus operation period according to the line service level requirements as the period division parameters; the period division parameters include the forward standard deviation of the travel time in the same period δ - , backward standard deviation δ + , the minimum length of bus operation period T min ; If a data set is X={x1,x2,x3,…,x n- ,x n }, the median is m, and the data set smaller than the median is X - ={x i |x i <m,x i ∈X}, the data set greater than the median is X + ={x i |x i >m,x i ∈X}, then the forward deviation σ - for: Backward bias σ + for Here |*| represents the number of elements in the set, and the forward standard deviation δ - , backward standard deviation δ + are the standard values ​​of forward deviation and backward deviation, forward standard deviation δ - , backward standard deviation δ + It shows the fluctuation range of travel time data; Step 2: Count the travel time data set by departure time: The travel time data with the same departure time are classified into the same data set, and the departure time is recorded as the timestamp corresponding to the data set; the median of each data set is counted, and each data set is converted into a sample feature point represented by the median and the timestamp; each sample feature point corresponds to a different departure timestamp, and the departure timestamp is calculated in the format of "hour: minute" (i.e. HH:MM), and all departure timestamps represent the full-day operation period of the target line; Step 3: Use all the processed sample feature points to perform multi-center clustering. The number of cluster centers is not preset. Instead, the most appropriate number of cluster centers is found through analysis, iteration and update of the sample feature points, thereby obtaining the clustering results of the sample feature points. The specific process of multi-center clustering is as follows: 3.1) Input the sample feature point set S, the initial cluster center number m=1, and randomly select one from all the sample feature points as the initial cluster center c1; 3.2) Calculate all sample feature points s∈S and each cluster center c in turn i , i = 1, 2…, the distance difference between m: D s ={d si =|sc i ||i=1,2…,m}, then classify the sample feature point s∈S into the category corresponding to the nearest center i, i=argmin D s (i); 3.3) After all sample feature points are classified, the median of the sample feature points contained in each class is set as the new cluster center of the class, and compared with the cluster center before the update; if the position of a cluster center has changed, return to step 3.2), otherwise go to step 3.4); 3.4) After the cluster centers no longer change, calculate the forward deviation and backward deviation of all original travel time data sets corresponding to the sample feature points in each class: If the travel time data sets corresponding to all classes satisfy σ - ≤δ - And σ + ≤δ + , clustering is completed and the clustering result is output, that is, each sample feature point will have a new category label; otherwise, let the number of cluster centers m = m + 1 and randomly select a sample feature point as the cluster center of the newly added class, and then return to 3.2); Step 4: Based on the clustering results, sample feature points are merged based on time order: each sample feature point corresponds to a category label and a timestamp label. All sample feature points are first sorted in timestamp order. Then, in the obtained sequence, if two adjacent sample feature points have the same category label, they are merged into the same time period. After the merging is completed, check whether there is a period whose length is less than the minimum length T of the bus operation period set in step 1. min , merge it with the previous or next period; If there is a period of time less than T min When further merging is required, the forward deviation and backward deviation of the travel time data set corresponding to the new period obtained by merging the period with the previous period or the next period need to be calculated separately: if the forward deviation and backward deviation obtained by merging with the previous period are both smaller than the forward deviation and backward deviation obtained by merging with the next period, then merge with the previous period; if the forward deviation and backward deviation obtained by merging with the next period are both smaller than the forward deviation and backward deviation obtained by merging with the previous period, then merge with the next period; otherwise, calculate the sum of the forward deviation and backward deviation obtained in the two cases, and merge with the period with the smaller sum of the forward deviation and backward deviation; if there are multiple periods with lengths less than T min , then the time periods are merged in order from small to large; if it does not exist, the time period division is completed and the result is output.

2. The method according to claim 1, characterized in that In step 1, the time period division parameters also include a maximum number of time period divisions N.

3. The method according to claim 2, characterized in that If the maximum number of time period divisions N is preset and the number of time periods obtained after steps 1 to 4 is still greater than N, the adjacent time periods are merged in the order of the remaining time period lengths from small to large until the number of time periods is reduced to N, and the time period division result is output.