Dynamic planning-based bus driver shift arranging and shifting method, electronic equipment and storage medium
By modeling the scheduling and shift problems as Markov decision-making process, and using dynamic programming algorithms to generate the optimal scheduling segment and the least driver solution, the problems of insufficient driver utilization and high cost of employment in traditional methods are solved, and efficient and flexible driver scheduling is achieved.
Patent Information
- Application Number
- CN202510419653.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-25
AI Technical Summary
Traditional human and computer shifting methods are difficult to deal with large-scale and cross-route driver dispatch, resulting in insufficient driver labor utilization, high employment costs for enterprises, and unable to adapt to new bus formats and emergencies that flexibly depart.
Using a dynamic programming method, the scheduling stage is regarded as the Markov decision-making process, the optimal scheduling segment is generated through local optimal rules, and merged into as few shift types as possible. The greedy strategy is used to reduce the number of drivers. The shift stage generates the minimum driver solution through the longest path sub-problem, and the working time balance is adjusted through shift type replacement.
It is close to the optimal solution of traditional algorithms in a very short time, reduces the number of drivers, adapts to flexible departure and emergencies, improves scheduling efficiency, reduces enterprise employment costs, and achieves balanced allocation when driving employees.
Smart Images

Figure CN120373720A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an intelligent transportation system, and more particularly to a bus driver scheduling and shift method, an electronic device, and a storage medium based on dynamic programming. Background Art
[0002] Bus driver scheduling and shift are important components of the operation of the ground bus system. Traditionally, driver scheduling and shift work are usually manually completed by dispatchers. Manual methods are difficult to handle large-scale, cross-line scheduling problems. Therefore, usually only single-line scheduling can be carried out for different lines respectively, and drivers cannot freely transfer between high-frequency and low-frequency lines, resulting in insufficient utilization of driver manpower. An excessive number of drivers and a large number of dispatcher configurations make the employment cost of bus enterprises extremely high.
[0003] In view of the disadvantages of manual scheduling and shift, domestic and foreign bus companies have begun to install various computer scheduling and shift systems. Although these systems have greatly improved the automation of scheduling and shift work, most of them do not use the most advanced methods, and there are problems such as long calculation time and low optimization degree of results. Moreover, they can only handle static timetables, cannot adapt to the new bus business form of flexible departure, and cannot respond to emergencies intelligently.
[0004] Regarding solving the problem of bus driver scheduling and shift and improving scheduling efficiency and optimization degree, there are already some existing technologies. For example:
[0005] CN114154917A discloses a bus driver scheduling method based on task shift fairness. This method calculates all feasible shift combinations for a driver in a day, combines and calculates the task shift combinations that meet the multi-day requirements, and then combines the multi-day task shift combinations into the final driver scheduling plan. This method can effectively allocate all shifts to all drivers on the premise of ensuring the fairness of each driver's task shift as much as possible during any scheduling period, realizing digital adaptive scheduling. However, this method still has the problem of further optimizing the large neighborhood search algorithm to improve the search efficiency and accuracy of the plan.
[0006] CN113033928A discloses a design method of a bus scheduling model based on deep reinforcement learning; CN117808652A discloses a bus vehicle scheduling method based on multi-agent path planning. Although these two methods use Markov processes to model the scheduling problem and have good performance in the bus vehicle scheduling problem. However, the decision rules of the deep reinforcement learning model and the multi-agent path planning model they adopt are opaque, the training process is complex, and the computing power requirement is large. It is difficult to expand and apply to large-scale driver scheduling problems with complex constraints and richer state spaces, and it is also difficult to perform real-time scheduling.
[0007] In the prior art, there are problems that traditional manual scheduling methods are difficult to handle large-scale and cross-line scheduling issues, unable to achieve the free transfer of drivers between high-frequency and low-frequency lines, resulting in insufficient utilization of driver manpower; traditional manual scheduling methods require the allocation of more drivers and a large number of dispatchers than reasonable, leading to high labor costs for bus companies; existing computer scheduling and shift systems do not utilize the most advanced algorithms, suffering from long calculation times and non-optimal results; existing computer scheduling and shift systems can only handle static timetables, unable to adapt to the new bus operation mode of flexible departures, nor can they respond intelligently to emergencies, etc.
[0008] To overcome the defects of manual scheduling and traditional scheduling algorithms, a bus driver scheduling and shift method based on dynamic programming is needed, which can provide a bus company with a driver scheduling and shift tool with extremely fast calculation speed and full utilization of manpower, helping the company achieve cost reduction and efficiency improvement. Summary of the Invention
[0009] The object of the present invention is to overcome the above-mentioned defects of manual scheduling and traditional scheduling algorithms, and provide a bus driver scheduling and shift method, electronic device, and storage medium based on dynamic programming, which can provide a bus company with a driver scheduling and shift tool with extremely fast calculation speed and full utilization of manpower, helping the company achieve cost reduction and efficiency improvement.
[0010] The object of the present invention can be achieved by the following technical solutions:
[0011] A bus driver scheduling and shift method based on dynamic programming of the present invention includes the following steps:
[0012] S1: In the scheduling stage, according to the pre-input parameters, use the dynamic programming algorithm to generate the optimal scheduling segments for each time period;
[0013] S2: According to the preset priorities, merge the scheduling segments generated in S1 into as few shift patterns as possible to reduce the number of drivers required;
[0014] S3: In the shift stage, according to the shift pattern allocation result generated in S2, use the dynamic programming algorithm to generate the shift plan with the fewest drivers by solving the longest path sub-problem with a maximum length constraint;
[0015] S4: Post-process the shift plan generated in S3, and adjust the shift patterns of drivers whose total working hours deviate from the average working hours through the method of shift pattern replacement, so as to make the total working hours of each driver tend to be close.
[0016] Further, in S1, the pre - input parameters include the maximum daily cumulative driving duration, the fatigue driving duration threshold, the maximum weekly cumulative working hours, the working period ranges of each shift type, the shift cycle, the rest mode, and the bus departure schedule.
[0017] These parameters provide constraints for the scheduling decision, ensuring that the generated scheduling segments comply with the driver's working - hour limits, fatigue - driving limits, and the operation requirements of the bus enterprise. For example, the maximum daily cumulative driving duration limits the driver's working hours in a day, the fatigue driving duration threshold avoids long - term continuous driving, and the bus departure schedule clarifies the task requirements for each time period.
[0018] Further, in S1, the dynamic programming algorithm includes: regarding the scheduling decision in the scheduling phase as a Markov Decision Process (MDP), and optimizing the overall scheduling decision by issuing scheduling instructions with a local - optimal rule at each decision point.
[0019] The dynamic programming algorithm models the scheduling decision as a Markov Decision Process (MDP). The core feature of MDP is the lack of after - effect, that is, the optimality of the current decision only depends on the current state, rather than the historical state. By issuing scheduling instructions with a local - optimal rule at each decision point (such as selecting the current optimal driver assignment plan), dynamic programming can gradually optimize the overall scheduling decision. This method utilizes the lack of after - effect in the scheduling process, can approach the optimal solution of the traditional algorithm in a very short time, and significantly improves the computational efficiency.
[0020] Further, in S1, it also includes a dynamic scheduling process, and the dynamic scheduling process includes: dynamically adjusting the scheduling segments according to the actual arrival and departure of vehicles to achieve an intelligent response to sudden situations such as vehicle delays.
[0021] The dynamic scheduling process allows dynamically adjusting the scheduling segments according to the actual arrival and departure of vehicles. For example, when a vehicle is delayed, the dynamic programming algorithm will adjust the assignment of subsequent tasks in real - time to ensure the continuity and feasibility of tasks. This dynamic adjustment mechanism can intelligently respond to sudden situations (such as vehicle delays, sudden increase in temporary tasks, etc.), maintain the flexibility and adaptability of the scheduling plan, and thus improve the robustness of the scheduling system.
[0022] Further, in S2, the specific process of merging into as few shift - type assignments as possible includes: adopting a greedy strategy to merge the segment with the latest end time in the earlier time period with the segment in the later time period, so as to minimize the number of shift types.
[0023] The specific process of merging scheduling segments to generate as few shift patterns as possible adopts a greedy strategy. The core idea of the greedy strategy is to gradually achieve the global optimal goal through local optimal choices. Specifically, this step selects the segment with the latest end time in the earlier time period and merges it with the segments in the later time period, thereby maximizing the coverage of each shift pattern. This method can reduce the number of required shift patterns because the segment with the latest end time usually can cover more subsequent tasks, thus avoiding frequently opening new shift patterns. In this way, the system can minimize the number of shift patterns on the premise of meeting task continuity and driver working time limits, further reducing the number of required drivers, while improving the efficiency and resource utilization rate of the scheduling plan.
[0024] Furthermore, in S3, the dynamic programming algorithm includes: based on the number of drivers required for each shift pattern on each day generated in S2, decomposing the shift scheduling problem into the shift pattern allocation problems of individual drivers, and the shift pattern allocation problem is the longest path sub-problem with a maximum length constraint in graph theory.
[0025] The dynamic programming algorithm is used to generate a shift scheduling plan that uses the fewest drivers. Specifically, based on the number of drivers required for each shift pattern on each day generated in stage S2, this algorithm decomposes the shift scheduling problem into the shift pattern allocation problems of individual drivers. The shift pattern allocation problem of each driver is modeled as the longest path sub-problem with a maximum length constraint in graph theory. In this model, each node represents a shift pattern, the edge represents the transition from one shift pattern to another, and the length of the path represents the total working hours of the driver during the shift cycle. By finding the longest path, the algorithm can ensure that the working hours of each driver are as close as possible to the maximum allowed value, thereby minimizing the number of required drivers.
[0026] Furthermore, in S3, when allocating shift patterns, a reward mechanism is adopted for the days with the largest remaining number of required drivers. The more days covered by an allocation strategy, the higher the priority of selecting this strategy.
[0027] To further optimize the shift scheduling plan, a reward mechanism is adopted when allocating shift patterns. For the days with the largest remaining number of required drivers, the allocation strategy will preferentially cover these days. Specifically, the more high-demand days covered by an allocation strategy, the higher the priority of selecting this strategy. This reward mechanism can effectively reduce the total number of required drivers while ensuring the fairness and feasibility of the shift scheduling plan. In this way, the system can generate an efficient shift scheduling plan on the premise of meeting the driver's rest needs and labor law restrictions.
[0028] Furthermore, in S4, the process of shift pattern replacement includes: replacing the long shift patterns of drivers with longer working hours with the short shift patterns of drivers with shorter working hours, so as to make the total working hours of each driver more average.
[0029] In the process of shift type replacement, the long shift type of drivers with longer working hours is replaced with the short shift type of drivers with shorter working hours, so as to achieve the balanced distribution of the total working hours of each driver. Specifically, the system will identify drivers with total working hours exceeding the average (longer working hours) and drivers with total working hours below the average (shorter working hours), and then look for shift types that can be exchanged. The long shift type usually involves more working hours and responsibilities, while the short shift type is relatively easier. By replacing these shift types, drivers with longer working hours can take on some shorter shifts, thus reducing their total working hours, while drivers with shorter working hours can take on some longer shifts, increasing their total working hours. This replacement process not only improves the fairness of the plan, but also ensures that the total working hours of each driver are closer, meeting the actual needs of bus companies for the balanced distribution of drivers' working hours.
[0030] In the second aspect of the present invention, an electronic device is provided, and the processor is used to execute the program in the memory to implement the bus driver scheduling and shift method based on dynamic programming as described above.
[0031] In the third aspect of the present invention, a storage medium containing computer-executable instructions is provided, and when the computer-executable instructions are executed by a computer processor, they are used to execute the bus driver scheduling and shift method based on dynamic programming as described above.
[0032] The core logic of the present invention is to regard the scheduling decision in the scheduling or shift stage as a Markov Decision Process (MDP), and optimize the overall scheduling decision by issuing scheduling instructions with a certain local optimal rule at each decision point. This method has a fast calculation speed, good solution optimality, and is naturally adapted to dynamic inputs, and has strong application potential in the field of scheduling and shifting.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. The present invention makes full use of the non-aftereffect of the scheduling process, and can approach the optimal solution of the traditional algorithm in a very short time, solving the problem that the traditional algorithm is difficult to balance computational efficiency and solution optimality;
[0035] 2. In the shift stage of the present invention, both reducing the number of required drivers and equalizing the working hours of each driver are taken into account, meeting the application needs of bus companies, with a fast calculation speed and high solution optimality, and can provide an efficient driver scheduling and shift tool for bus companies, effectively reducing the employment cost of bus companies;
[0036] 3. The present invention adopts a dynamic programming algorithm, which can intelligently respond to emergencies such as vehicle delays, dynamically adjust the scheduling segments, and adapt to the new bus operation mode of flexible departure.
[0037] 4. The shift scheduling method of the present invention can achieve cross-line scheduling, and drivers can be freely transferred between high-frequency and low-frequency lines, making full use of the driver human resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a schematic diagram of the overall technical framework of the present invention;
[0039] Figure 2 is a flowchart of the scheduling algorithm of the present invention;
[0040] Figure 3 is a flowchart of the shift algorithm of the present invention;
[0041] Figure 4 is a framework diagram of the driver scheduling system with the method of the present invention as the core;
[0042] Figure 5 is a schematic diagram of the driver scheduling and shift software interface with the method of the present invention as the core. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] The present invention will be described in detail below with reference to the drawings and specific embodiments. In the technical solution, components such as model numbers, material names, connection structures, control methods, algorithms, etc. that are not clearly described are regarded as common technical features disclosed in the prior art.
[0044] Overall, the present invention discloses a bus driver scheduling and shift method, device, and medium based on dynamic programming, which solves the problem that traditional algorithms are difficult to balance computational efficiency and solution optimality. The method includes: using the dynamic programming algorithm to generate optimal scheduling segments for each time period according to the pre-input parameters; merging the segments into as few shift patterns as possible; using the dynamic programming algorithm to generate a driver shift plan with as few drivers as possible according to the scheduling result; automatically performing shift pattern replacement on drivers deviating from the average working hours to ensure that the total working hours of each driver are basically the same.
[0045] Specifically, the present invention provides a bus driver scheduling and shift method based on dynamic programming. Refer to Figure 1 , and the steps include:
[0046] S1: In the scheduling stage, use the dynamic programming algorithm to generate optimal scheduling segments for each time period according to the pre-input parameters;
[0047] S2: In the scheduling stage, merge the segments into as few shift patterns as possible according to the preset priorities;
[0048] S3: In the shift stage, use the dynamic programming algorithm to continuously solve the longest path sub-problem according to the scheduling result and generate a shift plan using the fewest drivers;
[0049] S4: During the shift stage, automatically replace the driver whose working hours deviate from the average working hours, so as to ensure that the total working hours of each driver are basically the same.
[0050] Among them, the driver scheduling plan is manifested as the driving task sequence of each driver within an entire independent operation period (for example, from 5:00 to 21:00 during the day and from 21:00 to 5:00 the next day). Within a task sequence, the adjacent two tasks before and after must meet the condition that the location where the previous task ends is the same as the location where the next task starts, and the time interval between the end of the previous task and the start of the next task is sufficient for the driver to complete the handover. The time span of each task sequence must conform to a certain shift type agreed upon by the enterprise (for example, the morning shift from 5:00 to 12:00, the evening shift from 12:00 to 21:00, etc.).
[0051] Among them, the driver shift is manifested as the rest arrangements and shift type arrangements on weekdays of each driver within an entire shift cycle (for example, one week or one month). The rest arrangements of each driver must conform to a certain shift pattern agreed upon by the enterprise (for example, rest one day after working continuously for six days).
[0052] The basic principle of the present invention is:
[0053] It is easy to prove that on the premise of not considering the fluctuation of vehicle travel time and completely determining the vehicle departure time, the driver scheduling process within an operation period has no aftereffect, that is, the feasible strategies of decisions made later in this process and their subsequent decision-making processes completely depend on decisions made earlier.
[0054] Table 1 Proof of the non-aftereffect of the scheduling process
[0055]
[0056]
[0057] Table 1 gives a detailed explanation of this theorem. When sending out the first vehicle trip, the available drivers in the station are Zhang San, Li Si, and Wang Wu. If Zhang San is allowed to execute the first vehicle trip, then when sending out the second vehicle trip, since Zhang San is still on the road, only one of Li Si and Wang Wu can be selected. Similarly, the feasible decision when sending out the third vehicle trip is determined by the previous two decisions, and so on. Therefore, there are a total of 6 possible driver selections for these three vehicle trips.
[0058] A decision-making process with no aftereffect is a Markov decision-making process. For a Markov decision-making process, the dynamic programming method can be applied to make the final result tend to be good by adjusting the rules of each decision. In the scheduling of bus drivers, a good result generally means using fewer drivers.
[0059] First, this method divides the operation period into several small time segments according to the shift patterns set by the enterprise, and then realizes the dynamic programming method through a discrete event simulation process to generate scheduling segments with the least number of drivers for each small time segment. Then, according to the enterprise's preference for each shift pattern, the scheduling segments are combined into the smallest possible number of shift patterns.
[0060] After the scheduling is completed, the number of on-duty drivers required per day is determined. Next, the rest requirements of the drivers need to be considered, and the on-duty requirements per day are covered with as few drivers as possible. Drivers can adopt different shift patterns, but each person must have at least one day off per week, and the average weekly working hours cannot exceed the maximum value restricted by labor laws (usually 40 or 44 hours in China). This method uses a dynamic programming method with priorities (see Embodiment 2 below) to arrange shifts to minimize the number of drivers required.
[0061] Since the dynamic programming method with priorities gives priority to minimizing the number of drivers, the generated plan will inevitably have the problem of uneven distribution of working hours among drivers. Therefore, this method adds a shift pattern redistribution link from a practical perspective, replacing the long shift patterns of drivers with long working hours with the short shift patterns of drivers with short working hours, so as to make the total working hours of each driver more average.
[0062] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. Features such as component models, material names, connection structures, control methods, algorithms, etc. that are not clearly stated in this technical solution are regarded as common technical features disclosed in the prior art.
[0063] Embodiment 1
[0064] Bus Driver Scheduling
[0065] The scheduling methods of S1 and S2 of the present invention are demonstrated using the departure time table shown in Table 2. Assume that both A and B are loop lines and belong to the same fleet, and drivers can be transferred between the two lines; there are only three shift patterns in this fleet: morning shift (5:00 - 12:00), evening shift (12:00 - 21:00), and peak shift (7:00 - 9:00 and 17:00 - 19:00); the total driving time of drivers per day cannot exceed 8 hours, and they must rest for at least 20 minutes after driving continuously for 4 hours.
[0066] Table 2 Fleet Departure Time Table
[0067]
[0068] Since the fleet has three types of shifts: early shift (5:00 - 12:00), late shift (12:00 - 21:00), and peak shift (7:00 - 9:00 and 17:00 - 19:00), the algorithm divides a day into early flat peak (6:00 - 7:00), early peak (7:01 - 9:00), upper flat peak (9:01 - 12:00), lower flat peak (12:01 - 17:00), and late peak (17:01 - 19:00) according to the shift demarcation points and the departure time ranges of all routes, and divides all trips into these hourly segments according to the departure time. Table 3 lists all the trips belonging to each hourly segment in the order of departure time.
[0069] Table 3 Trips divided by hourly segments
[0070]
[0071]
[0072] According to Figure 2 the algorithm shown, scheduling segments are generated for each hourly segment, and the results are shown in Table 4.
[0073] Table 4 Generated scheduling segments
[0074]
[0075]
[0076] Next, the segments are merged with as few drivers as possible. The merging rule is: first, find the hourly segments that can be merged according to the shift type, and give priority to merging the longer shift types. After determining the hourly segments to be merged, continuously connect the shift type segment with the latest end time of the earlier hourly segment to the shift type segment with the earliest start time of the later hourly segment. The merging results are shown in Table 5.
[0077] Table 5 Scheduling merging results
[0078]
[0079] Therefore, a total of 8 on-duty drivers are required for the fleet on this day, including 3 for the early shift, 3 for the late shift, and 2 for the peak shift.
[0080] S1 can not only perform the scheduling before operation according to the steps described in Embodiment 1, but also has a built-in dynamic scheduling module, which can dynamically schedule drivers according to the actual arrival and departure situations of vehicles during the operation on this day. It can not only automatically handle routine scheduling, but also assist the dispatcher to achieve intelligent response to sudden situations such as vehicle delays.
[0081] Embodiment 2
[0082] Bus driver shift
[0083] Demonstrate the shift methods of S3 and S4 of the present invention using the number of on-duty drivers required shown in Table 6. Assume that the shift cycle is one week, the number of on-duty drivers required per week is the same, and the working hours of each driver per week shall not exceed 40h. The available shift patterns include working five days and having two days off, and working six days and having one day off. Each driver can only work one type of shift per day.
[0084] Table 6 Daily Requirements of On-duty Drivers
[0085] Class Type Number of People Required Man-hours Morning Shift 3 5h Night Shift 3 7h
[0086] Adopt the Figure 3 dynamic programming algorithm shown. Arrange shifts for one driver at a time until all on-duty requirements within seven days are met. Taking the detailed generation process of the first two shifts as an example, illustrate the specific operation process of this algorithm:
[0087] When generating the shift of the first driver, generate the plans with the longest total working hours for working five days and having two days off, and working six days and having one day off respectively. The two alternative plans are working night shifts for 5 days + having 2 days off (working five days and having two days off) and working night shifts for 4 days + working morning shifts for 2 days + having one day off (working six days and having one day off). Since the remaining required number of people each day is 6 at this time, there is no priority determination, and finally the plan of working six days and having one day off with longer total working hours is selected. The rest day of this driver is set as Sunday.
[0088] When generating the shift of the second driver, the alternative plans are also working night shifts for 5 days + having 2 days off (working five days and having two days off) and working night shifts for 4 days + working morning shifts for 2 days + having one day off (working six days and having one day off), but each plan is further divided into 7 variants according to the rest days (for example, the plan of working six days and having one day off has variants with rest days on Monday, Tuesday,..., Sunday). Since the rest day of the first driver is specified as Sunday when generating the shift, the required number of people remaining on Sunday is the largest at this time, and the plan variants covering Sunday have high priority. Finally, the plan of working six days and having one day off with high priority and longer total working hours is selected. The rest day of this driver is set as Saturday.
[0089] And so on, continuously generate the shift plans for individual drivers, and finally obtain the shift schedule shown in Table 7.
[0090] Table 7 Driver Shift Schedule
[0091]
[0092]
[0093] Next, perform shift type replacement on Table 7 to make the total working hours of each driver more balanced. The average total working hours of the 7 drivers should be 36h. The drivers deviating from the average working hours are Driver No. 1, Driver No. 2, Driver No. 3, and Driver No. 7. First, replace Driver No. 1 and Driver No. 7. Take their common working day, Tuesday. Replace the late shift of Driver No. 1 with the early shift of Driver No. 7 on this day. In this way, the total working hours of Driver No. 1 reach the average working hours of 36h, and the replacement is completed. Next, use the same steps to replace the shift types of Driver No. 2 and Driver No. 7, and Driver No. 3 and Driver No. 7. The final shift result is shown in Table 8.
[0094] Table 8 Driver Shift Schedule (After S4 Replacement)
[0095] Driver Number Monday Tuesday Wednesday Thursday Friday Saturday Sunday Total Man-hours 1 Night Shift Morning Shift Night Shift Night Shift Morning Shift Morning Shift Rest 36h 2 Night Shift Night Shift Morning Shift Night Shift Morning Shift Rest Morning Shift 36h 3 Night Shift Night Shift Night Shift Morning Shift Rest Morning Shift Morning Shift 36h 4 Morning Shift Morning Shift Morning Shift Rest Night Shift Night Shift Night Shift 36h 5 Morning Shift Morning Shift Rest Morning Shift Night Shift Night Shift Night Shift 36h 6 Morning Shift Rest Morning Shift Morning Shift Night Shift Night Shift Night Shift 36h 7 Rest Night Shift Night Shift Night Shift Morning Shift Morning Shift Morning Shift 36h
[0096] In summary, the above embodiments prove that the overall solution of the present invention has significant technical advantages, specifically including:
[0097] By regarding the scheduling and shift rotation problems as Markov decision processes and using the dynamic programming algorithm, the overall optimization under the local optimal rule is achieved. This method makes full use of the non-aftereffect of the scheduling process and can approach the optimal solution of the traditional algorithm in a very short time, solving the problem that it is difficult for the traditional algorithm to balance computational efficiency and solution optimality.
[0098] The built-in dynamic scheduling module can dynamically adjust the scheduling segments according to the actual arrival and departure situations of vehicles, intelligently respond to sudden situations such as vehicle delays, maintain the flexibility and adaptability of the scheduling plan, and adapt to the new bus operation mode of flexible departures.
[0099] By means of shift type replacement, the drivers deviating from the average working hours are automatically adjusted, making the total working hours of each driver tend to be average, improving the fairness of the solution, and meeting the actual needs of bus companies for the balanced distribution of drivers' working hours.
[0100] Supports cross-line scheduling. Drivers can be freely transferred between high-frequency and low-frequency lines, making full use of the driver human resources and effectively reducing the employment costs of bus companies.
[0101] From a practical perspective, it not only considers how to generate a scheduling and shift rotation plan with the least number of drivers, but also solves the problem of uneven distribution of drivers' working hours through the shift type reallocation link, making the solution more in line with the actual operation needs of bus companies.
[0102] This method has broad application potential in bus companies, can provide an efficient driver scheduling and shift rotation tool for bus companies, effectively reduce the employment costs of bus companies, and improve the scheduling efficiency and fairness.
[0103] Embodiment 3
[0104] This embodiment provides a bus driver shift scheduling calculation device based on dynamic programming. The device includes a processor and a memory, which are coupled. The memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the above task management method is implemented. The processor can be a general-purpose processor, including a central processing unit (CPU for short) and a network processor (NP for short); it can also be a digital signal processor (DSP for short), an application-specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components; the memory may include a random access memory (RAM for short), and may also include a non-volatile memory, such as at least one disk memory. The memory can be an internal memory of the random access memory (RAM) type, and the processor and the memory can be integrated into one or more independent circuits or hardware, such as an application-specific integrated circuit (ASIC). It should be noted that when the computer program in the above memory is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. Figure 4 shows a typical scheduling system framework composed of these devices; Figure 5 shows a typical form of the shift scheduling software product based on the technology of the present invention.
[0105] This embodiment proposes a bus driver scheduling and shift calculation device based on dynamic programming. Through the efficient cooperation of the processor and the memory, the device realizes the intelligent management of bus driver scheduling and shifts. The processor is responsible for executing the program instructions in the memory, decomposing the scheduling and shift problems into multiple sub-problems using the dynamic programming algorithm, and gradually optimizing the overall scheduling decision through the local optimal rule. Specifically, the device can generate the optimal scheduling segments according to the pre-input parameters (such as the maximum daily cumulative driving duration, fatigue driving duration threshold, etc.), and merge the segments into the fewest possible shift type allocations through the greedy strategy, thereby reducing the number of required drivers. In the shift stage, the device generates the shift plan with the fewest drivers by solving the longest path sub-problem with a maximum length constraint, and balances the working hours of drivers through the shift type replacement method to ensure that the total working hours of each driver tend to be average. In addition, the device also supports the dynamic scheduling function, which can adjust the scheduling segments in real time according to the actual vehicle arrival and departure situations and intelligently respond to emergencies. This device not only improves the scheduling efficiency, but also significantly reduces the labor cost of bus companies, while meeting the requirements of labor laws for the working hours of drivers, and has broad application prospects.
[0106] The device realizes the comprehensive optimization of bus driver scheduling and shifts through an efficient hardware architecture and intelligent algorithms. As the core component, the processor is responsible for executing the program instructions in the memory, decomposing the complex scheduling and shift problems into multiple sub-problems using the dynamic programming algorithm, and gradually optimizing the overall scheduling decision through the local optimal rule. Specifically, the device can generate the optimal scheduling segments according to the pre-input parameters (such as the maximum daily cumulative driving duration, fatigue driving duration threshold, etc.), and merge the segments into the fewest possible shift type allocations through the greedy strategy, thereby reducing the number of required drivers. In the shift stage, the device generates the shift plan with the fewest drivers by solving the longest path sub-problem with a maximum length constraint, and balances the working hours of drivers through the shift type replacement method to ensure that the total working hours of each driver tend to be average. In addition, the device also supports the dynamic scheduling function, which can adjust the scheduling segments in real time according to the actual vehicle arrival and departure situations and intelligently respond to emergencies such as vehicle delays or increased temporary tasks.
[0107] This device not only has a high degree of flexibility and adaptability in hardware design, but also comprehensively supports the bus driver scheduling and shift rotation method through software functional units. The computer program in the memory can be implemented in the form of software functional units and sold or used as an independent product. The program can be stored in a computer-readable storage medium, including several instructions to enable a computer device (such as a personal computer, electronic device or network device) to execute all or part of the steps of the methods in various embodiments of the present invention. In this way, the technical solution of the present invention can not only significantly improve the scheduling efficiency, but also effectively reduce the labor cost of bus companies, while meeting the requirements of the Labor Law for the working hours of drivers, and has broad application prospects and market value.
[0108] Embodiment 4
[0109] This embodiment provides a computer-readable storage medium for storing and executing a bus driver scheduling and shift rotation method based on dynamic programming. The storage medium can be an electronic medium, magnetic medium, optical medium, electromagnetic medium, infrared medium or semiconductor system or propagation medium. The computer instructions stored in the storage medium can enable the computer to efficiently execute the dynamic programming algorithm for scheduling and shift rotation, including core steps such as generating optimal scheduling segments, merging shift patterns allocation, generating shift rotation plans, and balancing the working hours of drivers through shift pattern replacement. By storing pre-input parameters (such as the maximum daily cumulative driving duration, fatigue driving duration threshold, etc.), the storage medium supports the algorithm to issue scheduling instructions at each decision point according to local optimal rules, thereby realizing the optimization of overall scheduling decisions. In addition, the storage medium also supports the dynamic scheduling function, which can adjust the scheduling segments in real time according to the actual arrival and departure of vehicles and intelligently respond to emergencies such as vehicle delays or increased temporary tasks.
[0110] This storage medium not only has a high degree of flexibility and adaptability, but also can be compatible with a variety of hardware platforms, including personal computers, servers, mobile devices, etc. By storing the parameters and data required for the dynamic programming algorithm, the storage medium can support the scheduling and shift rotation needs of bus companies in different operating scenarios. For example, the storage medium can store information such as bus departure schedules, driver shift pattern preferences, shift rotation cycles, etc., to help the algorithm generate efficient scheduling and shift rotation plans that meet the company's needs. In addition, the storage medium can also store the real-time data required for dynamic scheduling to ensure that the algorithm can quickly respond to emergencies and maintain the flexibility and robustness of the scheduling plan. In this way, the storage medium not only improves the scheduling efficiency, but also significantly reduces the labor cost of bus companies, while meeting the requirements of the Labor Law for the working hours of drivers, and has broad application prospects and market value.
[0111] The above description of the embodiments is provided to enable those of ordinary skill in the art to understand and use the invention. It is obvious that those skilled in the art can easily make various modifications to these embodiments and apply the general principles described herein to other embodiments without creative efforts. Therefore, the present invention is not limited to the above embodiments, and all improvements and modifications made by those skilled in the art without departing from the scope of the present invention according to the disclosure of the present invention should be within the protection scope of the present invention.
Claims
1. A bus driver scheduling and shift method based on dynamic programming, characterized in that, Including the following steps: S1: In the scheduling phase, according to the pre-input parameters, use the dynamic programming algorithm to generate the optimal scheduling segments for each time period; S2: According to the preset priorities, merge the scheduling segments generated in S1 into as few shift patterns as possible to reduce the number of drivers required; S3: In the shift phase, according to the shift pattern allocation results generated in S2, use the dynamic programming algorithm to generate the shift plan with the fewest drivers by solving the longest path subproblem with a maximum length constraint; S4: Post-process the shift plan generated in S3. By means of shift pattern replacement, adjust the shift patterns of drivers whose working hours deviate from the average working hours, so that the total working hours of each driver tend to be close.
2. The bus driver shift scheduling method based on dynamic programming according to claim 1, characterized in that, In S1, the pre-input parameters include the maximum daily cumulative driving duration, the fatigue driving duration threshold, the maximum weekly cumulative working hours, the working time period range of each shift pattern, the shift cycle, the rest mode, and the bus departure schedule.
3. A bus driver scheduling and shift method based on dynamic programming according to claim 1, characterized in that, In S1, the dynamic programming algorithm includes: regarding the scheduling decision in the scheduling phase as a Markov decision process, and realizing the optimization of the overall scheduling decision by issuing scheduling instructions with a local optimal rule at each decision point.
4. A bus driver scheduling and shift method based on dynamic programming according to claim 1, characterized in that, In S1, it also includes a dynamic scheduling process, and the dynamic scheduling process includes: dynamically adjusting the scheduling segments according to the actual vehicle arrival and departure situations to achieve an intelligent response to sudden situations such as vehicle delays.
5. The bus driver scheduling and shift method based on dynamic programming according to claim 1, wherein In S2, the specific process of merging into as few shift pattern allocations as possible includes: adopting a greedy strategy to merge the segment with the latest end time in the earlier time period with the segments in the later time period, so as to minimize the number of shift patterns.
6. The bus driver scheduling and shift method based on dynamic programming according to claim 1, characterized in that In S3, the dynamic programming algorithm includes: based on the number of drivers required for each shift pattern on each day generated in S2, decomposing the shift problem into the shift pattern allocation problems of each driver, and the shift pattern allocation problem is the longest path subproblem with a maximum length constraint in graph theory.
7. The bus driver scheduling and shift method based on dynamic programming according to claim 6, characterized in that In S3, when allocating shift patterns, a reward mechanism is adopted for the days with the largest remaining number of drivers required. The more days covered by an allocation strategy, the higher the priority of selecting this strategy.
8. The bus driver scheduling and shift method based on dynamic programming according to claim 1, characterized in that, In S4, the process of shift pattern replacement includes: replacing the long shift pattern of the driver with a long working time with the short shift pattern of the driver with a short working time, so that the total working hours of each driver are more average.
9. An electronic device, comprising a memory and a processor, characterized in that, The processor is used to execute the program in the memory to implement the dynamic programming-based bus driver scheduling and shift method as described in any one of claims 1 to 8.
10. A storage medium containing computer-executable instructions, characterized in that, When executed by a computer processor, the computer-executable instructions are used to execute the dynamic programming-based bus driver scheduling and shift method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Design method, device and system of bus scheduling model based on deep reinforcement learning
CN113033928A
Public transport vehicle scheduling method based on multi-agent path planning
CN117808652A