Intelligent bus scheduling method and system applied to public transportation and medium
Through the intelligent bus scheduling system, combined with passenger flow data and genetic algorithms to optimize the departure interval, the problem of insufficient flexibility of the bus scheduling algorithm in the existing technology is solved, efficient and personalized bus scheduling is achieved, reducing air driving rates and resource waste, and improving passenger experience.
Patent Information
- Application Number
- CN202510477211.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-19
AI Technical Summary
The existing intelligent bus scheduling algorithm is difficult to meet the personalized requirements of different cities and different passenger flow needs, and cannot effectively deal with traffic pressure during peak hours, resulting in high bus air driving rates, serious resource waste, and lack of consideration for designated tasks and vehicle return.
The intelligent bus scheduling system is adopted to obtain passenger flow data and run time, calculate the dispatch interval using formulas, and generate a timetable in combination with genetic algorithms and multi-threading technology, consider the number of vehicles and designated tasks, introduce a scheduling key mechanism to ensure the security of the system, and provide peak-period strategies and scheduling methods to optimize scheduling.
It realizes highly customized bus scheduling based on a variety of complex factors, improves the flexibility and efficiency of scheduling, reduces vehicle air driving rate, meets personalized needs, and improves passenger travel experience.
Smart Images

Figure CN120509633A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of public transportation, and in particular to an intelligent bus scheduling method, system and medium applied to public transportation. Background Art
[0002] With the acceleration of urbanization, bus systems, as a key component of public transportation, are bearing the brunt of growing passenger demand. Traditional bus scheduling methods rely on fixed schedules or manual adjustments, lacking a dynamic response to actual demand. This approach not only fails to effectively address peak traffic pressures but also struggles to adapt flexibly to changing passenger flow over time. This results in high bus idle rates, significant resource waste, and a negative impact on passenger travel experience. To improve the flexibility and efficiency of bus scheduling, a growing number of intelligent scheduling algorithms have emerged in recent years. These algorithms leverage big data analytics and intelligent methods to optimize bus departure times. However, existing intelligent scheduling algorithms still lack flexibility and customization, making it difficult to meet the personalized requirements of different cities and passenger flows. For example, in some cities, buses may perform multiple designated missions and, upon completing a mission, must return to their starting or ending point and rejoin the departure sequence. Furthermore, after arriving at a stop, buses often remain at that stop for a certain period of time. These issues significantly complicate manual scheduling. Therefore, how to develop a bus scheduling algorithm that can be highly customized based on multiple complex factors (such as passenger flow, time intervals, number of vehicles, departure rules, etc.) has become a technical problem that needs to be solved urgently in the current intelligent transportation field. Summary of the Invention
[0003] The present invention aims to at least solve the technical problems existing in the prior art, and in particular innovatively proposes an intelligent bus scheduling method, system and medium for public transportation.
[0004] In order to achieve the above-mentioned object of the present invention, the present invention provides an intelligent bus scheduling method for public transportation, comprising the following steps:
[0005] S1: Start the intelligent bus scheduling system, input the scheduling key into the intelligent bus scheduling system, and determine whether the input scheduling key is consistent with the scheduling key generated by the system:
[0006] If the scheduling key input into the intelligent bus scheduling system is consistent with the scheduling key generated by the system, the intelligent bus scheduling system will be entered;
[0007] If the scheduling key entered into the smart bus scheduling system is inconsistent with the scheduling key generated by the system, you cannot enter the smart bus scheduling system; you need to enter the correct smart bus scheduling key to use this system to ensure system security;
[0008] S2, generates a schedule in the intelligent bus scheduling system to realize intelligent scheduling of public transportation buses.
[0009] In a preferred embodiment of the present invention, step S2 includes the following steps:
[0010] S21, obtaining the route's passenger flow data, running time, and user-entered parameters through the dispatching system;
[0011] S22, performing time interval standardization processing on the passenger flow data in step S21;
[0012] S23, based on the standardized passenger flow data in step S22, calculate the departure interval within 30 minutes according to Formula 1:
[0013] S24, according to the parameters input by the user in step S21, obtain the maximum and minimum values of the half-hour departure interval I max-min ;
[0014] S25, according to step S24 I max-min , randomly generate uplink and downlink schedules. If the lengths of uplink and downlink schedules in a set of generated schedules are the same, then the schedule is retained;
[0015] S26, according to the timetable in step S25, the number of vehicles in each pair of timetables is calculated and scored.
[0016] In a preferred embodiment of the present invention, the method for generating a scheduling key in step S1 includes the following steps:
[0017] S11, obtain the MAC address of the network card of the running device;
[0018] S12, sorting the MAC address of the network card of the running device into a standard format, which is a 12-bit string M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 , will remove ":" or / and "-";
[0019] S13, transforming the sorted MAC into another character string using a character transformation method;
[0020] S14, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12Can be converted to 4-bit binary;
[0021] S15, since the number of bits in step S14 is less than the number of bits in step S13, the first 48 bits are taken, which are consistent with the number of bits of the 48-bit binary address;
[0022] S16, combining the two 48-bit values into one 48-bit value using a combining function;
[0023] S17, therefore, simplifying it means that the system generates a scheduling key.
[0024] In a preferred embodiment of the present invention, the method for obtaining the scheduling key input by the user in step S1 includes the following steps:
[0025] S1-1, obtain the MAC address of the network card of the running device;
[0026] S1-2, after obtaining the address, send the address to the scheduling key generator. The key code generator enters the MAC address into the scheduling key system, and the scheduling key system generates a scheduling key, specifically:
[0027] S1-3, organize the address MAC into a standard form, which is a 12-bit string M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 , will remove ":" or / and "-";
[0028] S1-4, transforming the sorted MAC into another character string using a character transformation method;
[0029] S1-5, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12 Can be converted to 4-bit binary;
[0030] S1-6, since the number of bits in step S1-4 is less than that in step S1-3, the first 48 bits are taken, which are consistent with the number of bits of the 48-bit binary address;
[0031] S1-7, using a merge function to merge two 48-bit values into one 48-bit value;
[0032] S1-8, since the combined result is too long and difficult for the user to input, it is simplified to generate a scheduling key by the system and send the generated scheduling key to the user.
[0033] In a preferred embodiment of the present invention, step S27 is further included, wherein step S27 includes an off-peak period strategy and scheduling method, and the off-peak period strategy and scheduling method include: one or any combination of unilateral scheduling, bilateral scheduling, sequential scheduling, and fixed scheduling.
[0034] In a preferred embodiment of the present invention, step S28 is further included. When the user needs to specify the total number of shifts, step S28 is entered; a window mutation mechanism is introduced until a departure schedule that meets the conditions is found.
[0035] In a preferred embodiment of the present invention, step S29 is also included to obtain the number of shifts that each vehicle needs to run. Now a parameter of the number of off-duty times is added. When the user specifies the number of off-duty times, vehicles with fewer shifts and vehicles with more shifts are divided into two groups.
[0036] In a preferred embodiment of the present invention, in step S23, formula 1 is:
[0037]
[0038] Among them, I interval Indicates the departure interval within 30 minutes;
[0039] N class Indicates the number of shifts in half an hour (theoretical number of departures);
[0040] C represents the passenger flow in half an hour (unit: person);
[0041] L actual Indicates the actual number of passengers in the vehicle;
[0042] L represents the actual number of people carried by the vehicle;
[0043] R period Indicates the full load rate during peak or off-peak periods based on the time period;
[0044] In step S24, the minimum departure interval calculation formula for each period is:
[0045]
[0046] Among them, I min Indicates the minimum departure interval when the total number of vehicles is specified;
[0047] max(,) means taking the larger value;
[0048] T run is the running time (unit: minutes);
[0049] T wait is the waiting time (unit: minutes);
[0050] M vehicles is the total number of vehicles;
[0051] The scoring strategy in step S26 is:
[0052]
[0053] Among them, Score vehicles Indicates the vehicle number score;
[0054] C1 represents the first constant of the preset shift;
[0055] Vehicles indicates the total number of vehicles required;
[0056] Score specified =C2,
[0057] Among them, Score specified Indicates the score of the specified number of vehicles;
[0058] C2 represents the second constant of the preset shift;
[0059] Score frequency =Total Buses×C3,
[0060] Among them, Score frequency represents the vehicle shift frequency score;
[0061] Total Buses indicates the total number of buses;
[0062] C3 represents the third constant of the preset shift;
[0063]
[0064] Among them, Score smoothing Indicates the smoothing score value of the vehicle shift;
[0065] min(,) means taking a smaller value;
[0066] C4 represents the fourth constant of the preset shift;
[0067] C5 represents the fifth constant of the preset shift;
[0068] Average Absolute Difference Between Adjacent Elements represents the average of the absolute differences between adjacent elements, reflecting the smoothness of the timetable;
[0069] Peak Period Score=|Actual Peak Flow-Required Peak Flow|,
[0070] Among them, Peak Period Score represents the score of peak period passenger flow matching;
[0071] Actual Peak Flow represents the actual passenger flow (specifically, it can be quantified as the number of trips per half hour);
[0072] Required Peak Flow indicates the required passenger flow (specifically, the passenger flow the user wants);
[0073] || means taking the absolute value;
[0074] Off-Peak Period Score = | Actual Peak Flow - Required Peak Flow, where Off-peak Period Score represents the score for off-peak period passenger flow matching.
[0075] Actual peak flow represents the actual passenger flow (specifically, it can be quantified as the number of shifts per half hour);
[0076] Required Peak Flow indicates the required passenger flow (specifically, the passenger flow the user wants);
[0077] Score flow match =-(peak Period Score×C5+Off-Peak Period Score×C6)×C7,
[0078] Among them, Score flow match Indicates the customer flow matching score;
[0079] Peak Period Score represents the score of peak period passenger flow matching;
[0080] C5 represents the fifth constant of the preset shift;
[0081] Off-Peak Period Score indicates the score of off-peak period passenger flow matching;
[0082] C6 represents the sixth constant of the preset shift;
[0083] C7 represents the seventh constant of the preset shift;
[0084]
[0085] Among them, Score max buses Indicates the maximum score of passenger flow schedule;
[0086] C8 represents the eighth constant of the preset shift;
[0087] Total Buses indicates the total number of buses;
[0088] Max Buses indicates the maximum number of buses per vehicle. If the total number of buses exceeds the maximum number of buses, points will be deducted.
[0089] C9 represents the ninth constant of the preset shift.
[0090] The present invention also discloses a computer system, comprising:
[0091] processor;
[0092] a memory for storing processor-executable instructions;
[0093] Wherein, the processor is configured to implement the intelligent bus scheduling method applied to public transportation when executing the executable instructions.
[0094] The present invention also discloses a computer-readable storage medium, comprising:
[0095] a memory having a computer program stored thereon;
[0096] A processor is used to execute the program in the memory to implement the intelligent bus scheduling method applied to public transportation.
[0097] In summary, due to the adoption of the above technical solution, the present invention can solve the problem in the prior art that bus scheduling does not take into account designated tasks, return to position, waiting time, etc.
[0098] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0100] Figure 1 It is a schematic block diagram of the process of the present invention.
[0101] Figure 2 It is another schematic block diagram of the process of the present invention.
[0102] Figure 3 It is a schematic framework diagram of the generation of a departure timetable according to the present invention.
[0103] Figure 4 It is a schematic diagram showing the bilateral scheduling sequence of the present invention.
[0104] Figure 5 It is a schematic diagram showing the bilateral dispatch fixed schedule of the present invention.
[0105] Figure 6 It is a schematic diagram showing the unilateral scheduling sequence of the present invention.
[0106] Figure 7 This is a schematic diagram showing the unilateral dispatching fixed schedule of the present invention. DETAILED DESCRIPTION
[0107] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0108] The present invention discloses an intelligent bus scheduling method for public transportation, such as Figure 1 As shown, the following steps are included:
[0109] S1: Start the intelligent bus scheduling system, input the scheduling key into the intelligent bus scheduling system, and determine whether the input scheduling key is consistent with the scheduling key generated by the system:
[0110] If the scheduling key input into the intelligent bus scheduling system is consistent with the scheduling key generated by the system, the intelligent bus scheduling system will be entered;
[0111] If the scheduling key entered into the smart bus scheduling system is inconsistent with the scheduling key generated by the system, you cannot enter the smart bus scheduling system; you need to enter the correct smart bus scheduling key to use this system to ensure system security;
[0112] S2, generates a schedule in the intelligent bus scheduling system to realize intelligent scheduling of public transportation buses.
[0113] In a preferred embodiment of the present invention, the method for generating a scheduling key in step S1 includes the following steps:
[0114] S11, obtain the MAC address of the network card of the running device;
[0115] S12: Arrange the MAC address of the network card of the running device into a standard format. The standard format is a 12-bit string, and the “:” or “ / ” and “-” are removed. For example, the general format is M1M2:M3M4:M5M6:M7M8:M9M 10 :M 11 M 12 、M1M2-M3M4-M5M6-M7M8-M9M 10 -M11 M 12 , that is:
[0116] M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 ,
[0117] M m is one of the numbers 0 to 9 and uppercase letters A to F, m = 1, 2, 3, ..., 12;
[0118] S13, transform the sorted MAC into other strings using character transformation:
[0119] StMAC=MACimfo(MACdre),
[0120] Wherein, StMAC represents the transformed character string; the result is 128 bits;
[0121] MACimfo() represents a transformation method. In the present invention, the MD5 algorithm whose result is 128 bits is adopted; other types of algorithms, such as SHA1, may also be adopted;
[0122] MACdre represents an address in standard format;
[0123] S14, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12 Can be converted to 4-bit binary; assuming E7A512D04656, the corresponding 48-bit binary is 111001111010010100010010110100000100011001010110;
[0124] S15, since the number of bits in step S14 is less than that in step S13, correspondingly, StMAC=MACimfo(MACdre)=MACimfo(E7A512D04656)=00011011001001100101101101110111100011011000111101000001010110100010000101100011011101001111110001100011010101010111, the first 48 bits (000110110010011001011011011101111000110110001111) are consistent with the number of bits of the 48-bit binary address;
[0125] S16, using a merge function to merge the two 48-bit values into one 48-bit value, namely:
[0126]
[0127] Among them, a j is the j-th bit value in a 48-bit value; j = 1, 2, 3, ..., 48;
[0128] b j is the j-th value in another 48-bit value;
[0129] c j is the j-th value in the combined value;
[0130] Similarly, merging 11100111101001010001001011010000010001100101010110 and 000110110010011001011011011101111000110110001111 to get 111111001000001101001001001101001111100101111001.
[0131] S17, so it is simplified to FC8349A7CBD9, which is hexadecimal; at this time FC8349A7CBD9 is the scheduling key generated by the system.
[0132] In a preferred embodiment of the present invention, the method for obtaining the scheduling key input by the user in step S1 includes the following steps:
[0133] S1-1, obtain the MAC address of the network card of the running device;
[0134] S1-2, after obtaining the address, send the address to the scheduling key generator. The key code generator enters the MAC address into the scheduling key system, and the scheduling key system generates a scheduling key, specifically:
[0135] S1-3, organize the address MAC into a standard format. The standard format is a 12-bit string, and the ":" or " / " and "-" will be removed. For example, the general format is M1M2:M3M4:M5M6:M7M8:M9M 10 :M 11 M 12 、M1M2-M3M4-M5M6-M7M8-M9M 10 -M 11 M 12 , that is:
[0136] M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 ,
[0137] M m is one of the numbers 0 to 9 and uppercase letters A to F, m = 1, 2, 3, ..., 12;
[0138] S1-4, transform the sorted MAC into other strings using character transformation:
[0139] StMAC=MACimfo(MACdre),
[0140] Wherein, StMAC represents the transformed character string; the result is 128 bits;
[0141] MACimfo() represents a transformation method. In the present invention, the MD5 algorithm whose result is 128 bits is adopted; other types of algorithms, such as SHA1, may also be adopted;
[0142] MACdre represents an address in standard format;
[0143] S1-5, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12 Can be converted to 4-bit binary; assuming E7A512D04656, the corresponding 48-bit binary is 111001111010010100010010110100000100011001010110;
[0144] S1-6, since the number of bits in step S1-4 is less than that in step S1-3, the corresponding StMAC=MACimfo(MACdre)=MACimfo(E7A512D04656)=0001101100100110010110110111011110001101100011101111010000010101 1010001000010110001100111011110100111111000110001100010110101010111, take the first 48 bits (00011011001001100101101101110111100011011000111), which is consistent with the 48-bit binary address;
[0145] S1-7, use the merge function to merge the two 48-bit values into one 48-bit value, that is:
[0146]
[0147] Among them, a j is the j-th bit value in a 48-bit value; j = 1, 2, 3, ..., 48;
[0148] b j is the j-th value in another 48-bit value;
[0149] c j is the j-th value in the combined value;
[0150] Similarly, merging 11100111101001010001001011010000010001100101010110 and 000110110010011001011011011101111000110110001111 to get 111111001000001101001001001101001111100101111001.
[0151] S1-8, because the combined result is too long and difficult for the user to input, it is simplified to FC8349A7CBD9, which is also hexadecimal; at this time, FC8349A7CBD9 is the scheduling key generated by the system, and the generated scheduling key is
[0152] In a preferred embodiment of the present invention, Figure 2 As shown, the following steps are included:
[0153] S21, obtain the passenger flow data, running time and user input parameters of the route through the dispatching system.
[0154] The passenger flow data and running time are both presented in the form of time + data, for example, the passenger flow distribution per hour.
[0155] The parameters input by the user include but are not limited to the maximum interval between peak hours in the morning and evening, the maximum interval between off-peak hours, the number of vehicles, designated tasks, etc.
[0156] S22, the passenger flow data in step S21 is normalized by time interval. Regardless of the time interval input by the user, the data is uniformly processed into 30-minute time periods; the passenger flow in each 30-minute time period is averaged to facilitate the subsequent calculation of departure intervals.
[0157] S23, based on the standardized passenger flow data in step S22, calculate the departure interval within 30 minutes according to the following formula:
[0158]
[0159] Among them, I interval Indicates the departure interval within 30 minutes;
[0160] N class Indicates the number of shifts in half an hour (theoretical number of departures);
[0161] C represents the passenger flow in half an hour (unit: person);
[0162] L actual Indicates the actual number of passengers in the vehicle;
[0163] L represents the actual number of people carried by the vehicle;
[0164] R period Indicates the full load rate during peak or off-peak periods according to the time period (for example, the full load rate during peak period is 80% and the full load rate during off-peak period is 50%).
[0165] S24: Based on the parameters input by the user in step S21 (maximum interval during peak hours in the morning and evening, and maximum interval during off-peak hours), obtain the maximum and minimum values of the half-hour departure interval (default 1). max-min ;
[0166] In step S24, if the user specifies the total number of vehicles, the minimum departure interval for each period is calculated as follows:
[0167]
[0168] Among them, I min Indicates the minimum departure interval when the total number of vehicles is specified;
[0169] max(,) means taking the larger value;
[0170] Trun is the running time (unit: minutes);
[0171] T wait is the waiting time (unit: minutes);
[0172] N vehicles is the total number of vehicles;
[0173] S25, according to step S24 I max-min , randomly generate uplink and downlink schedules. If the uplink and downlink schedules in a set of generated schedules have the same length, then the schedule will be retained (the default is 10,000 pairs);
[0174] If there is a designated task in the randomly generated schedule in step S25, the schedule will be modified in two ways:
[0175] If the first type of task specified is to depart from the starting point and return to the starting point, or depart from the end point and return to the end point, this type of task will not be inserted into the schedule in advance and will be treated as a special shift.
[0176] If the designated second type of task is to depart from the starting point and return to the destination, or depart from the destination and return to the starting point, this type of task will be inserted into the schedule in advance and treated as a normal shift;
[0177] The randomly generated departure schedule in step S25 draws on the principles of genetic algorithms, with each set of schedules acting as a seed in the algorithm. This approach directly selects the optimal solution from a large number of seeds, replacing the mutation operation used in traditional genetic algorithms. Furthermore, the algorithm utilizes multithreading to fully utilize CPU resources. Even when processing 13,000 seeds, the entire process takes less than a minute on an AMD R7 6800H processor, significantly improving computational efficiency.
[0178] Furthermore, in step S25, if the user has specified a fixed value for the departure interval for a certain period of time, the departure interval for this period of time will no longer be randomized;
[0179] S26, according to the timetable in step S25, calculate the number of vehicles in each pair of timetables and score them;
[0180] like Figure 3 As shown, in step S26, the number of vehicles for each pair of schedules is calculated using a loop traversal method. The idea is as follows: 0 vehicles are initially assigned to the starting point and the end point respectively; during the scheduling process, when it is the start point's turn to depart, if there are no vehicles available at the starting point, the number of upbound vehicles is increased by 1; similarly, when it is the end point's turn to depart, if there are no vehicles available at the end point, the number of downbound vehicles is increased by 1.
[0181] like Figure 3As shown in the figure, in the departure schedule optimization model, factors such as passenger flow matching, number of flights, and number of vehicles are scored. The default scoring strategy is as follows:
[0182]
[0183] Among them, Score vehicles Indicates the vehicle number score;
[0184] C1 represents the first constant of the preset shift;
[0185] Vehicles indicates the total number of vehicles required;
[0186] Score specified =C2,
[0187] Among them, Score specified Indicates the score of the specified number of vehicles;
[0188] C2 represents the second constant of the preset shift;
[0189] Score frequency =Total Buses×C3,
[0190] Among them, Score frequency represents the vehicle shift frequency score;
[0191] Total Buses indicates the total number of buses;
[0192] C3 represents the third constant of the preset shift;
[0193]
[0194] Among them, Score smoothing Indicates the smoothing score value of the vehicle shift;
[0195] min(,) means taking a smaller value;
[0196] C4 represents the fourth constant of the preset shift;
[0197] C5 represents the fifth constant of the preset shift;
[0198] AverageAbsolute Difference Between Adjacent Elements represents the average of the absolute differences between adjacent elements, reflecting the smoothness of the timetable;
[0199] Peak Period Score=|Actual Peak Flow-Required Peak Flow|,
[0200] Among them, Peak Period Score represents the score of peak period passenger flow matching;
[0201] || means taking the absolute value;
[0202] Actual Peak Flow represents the actual passenger flow (specifically, it can be quantified as the number of trips per half hour);
[0203] Required Peak Flow indicates the required passenger flow (specifically, the passenger flow the user wants);
[0204] Off-Peak Period Score=|Actual Peak Flow-Required Peak Flow,
[0205] Among them, Off-Peak Period Score represents the score of off-peak period passenger flow matching;
[0206] Actual Peak Flow indicates the actual passenger flow;
[0207] Required Peak Flow indicates the required passenger flow;
[0208] The calculation formulas for Peak Period Score and Off-Peak Period Score are the same. The difference is that for peak period, only the peak time period is used. The same applies to off-peak period. For example, if the peak period is from 7 to 9 o'clock, then the peak period score only calculates the score from 7 to 9 o'clock.
[0209] Score flow match =-(Peak Period Score×C5+Off-Peak Period Score×C6)×C7,
[0210] Among them, Score flow match Indicates the customer flow matching score;
[0211] Peak Period Score represents the score of peak period passenger flow matching;
[0212] C5 represents the fifth constant of the preset shift;
[0213] Peak Period Score indicates the score of passenger flow matching during off-peak period;
[0214] C6 represents the sixth constant of the preset shift;
[0215] C7 represents the seventh constant of the preset shift;
[0216]
[0217] Among them, Score max buses Indicates the maximum score of passenger flow schedule;
[0218] C8 represents the eighth constant of the preset shift;
[0219] Total Buses indicates the total number of buses;
[0220] Max Buses indicates the maximum number of buses per vehicle. If the total number of buses exceeds the maximum number of buses, points will be deducted.
[0221] The deduction is (Total Buses-Max Buses)×C9, which means the total number of buses minus the maximum number of buses;
[0222] Total Buses means the total number of buses;
[0223] Max Buses indicates the maximum number of buses;
[0224] Max Buses = Number of vehicles * Maximum number of buses at the beginning;
[0225] C9 represents the ninth constant of the preset shift; the overall formula of the scoring rule: Total Score = Score vehicles +Score specified +Score frequency +Score smoothing +Score flow match +Score max buses ,
[0226] Total Score indicates the total score of the timetable;
[0227] This is actually a cumulative process. The Total Score is initially 0. Each time a parameter is calculated, it is added. For example, after calculating the Score vehicles , Total Score + = Score vehicles , and so on.
[0228] The above constants (C1 to C9) are the scoring measures for each scoring item. Based on actual line tests, the recommended ratio of each constant can be referred to as:
[0229] C1=C2,
[0230] If the specified vehicle is not met, C2 = 0;
[0231] C8: It means that if the user specifies the maximum number of shifts, then points are added within the range, usually C1 = 100C8 (this is a relatively strong constraint); of course, if not specified, this item does not need to be scored.
[0232] C9: It means how many points should be deducted for more than one shift, usually C8 = 100C9.
[0233] C3 = C1 / 1000000 (this step represents that the weights of C1 or C2 are much greater than the subsequent parameters, playing a screening role).
[0234] C7: Passenger flow matching factor. If the user pays more attention to the passenger flow and shift matching, then set C3 to 0. Because once the user pays more attention to the passenger flow and shift matching, it actually specifies a rough number of shifts (the number of passenger flow shifts), and the shift score is not of reference significance. At the same time, C7 = C3.
[0235] All other parameters are based on C3. (Setting C3 to zero only means not considering C3, not that all those based on C3 are 0).
[0236] Smoothing degree of C4 / C5: C4 = 5C5 (to prevent the score of the smoothing degree from being greater than C1 and C2).
[0237] C4 = 100C3.
[0238] C5: Expansion multiple of the degree of mismatch of passenger flow during peak hours.
[0239] C6: Expansion multiple of the degree of mismatch of passenger flow during off-peak hours.
[0240] It is recommended that C5 = 3C6, indicating that the proportion during peak hours is three times that during off-peak hours.
[0241] In S27, select the schedule with the highest score, and combine the off-peak strategy and dispatching method input by the user to generate the final departure schedule. The departure schedule only includes vehicle IDs and does not involve driver IDs.
[0242] In the step S27, the off-peak strategy and dispatching method include the following:
[0243] S271, Unilateral dispatching: Buses can depart at any time from the starting point; the departure time at the end point needs to meet the following conditions: Assume the planned departure time at the end point is t0, and the time when the first vehicle from the starting point arrives at the end point is t1. Only when t0 < t1 can the bus depart from the end point.
[0244] S272, Bilateral dispatching: Buses are allowed to depart at any time from both the starting point and the end point, without being restricted by the above conditions.
[0245] S273, sequential scheduling: The number of shifts for each vehicle is kept close, and the difference in the number of shifts between vehicles does not exceed two, to ensure the balance of the overall scheduling.
[0246] S274, Fixed Schedule: Vehicles are dispatched on a first-come, first-served basis, with no requirement for the same number of shifts. Generally, vehicles with earlier IDs have more frequent departures.
[0247] In order to ensure that the vehicles can return to their positions, the off-peak period strategy in step S27 will allocate an even number of shifts (excluding designated tasks) to each vehicle in advance.
[0248] Furthermore, sequential scheduling in step S27 only requires a single allocation of vehicle shifts, ensuring that each vehicle has no more than two shifts. Fixed scheduling requires a secondary allocation. During the initial allocation, vehicles are directly assigned to the departure schedule without considering homing issues. This generates an initial departure shift for each vehicle. Based on this initial allocation, a secondary allocation is performed to adjust the vehicle shifts to an even number while maintaining consistency with the initial allocation as much as possible. For example, if vehicles with IDs 1, 2, and 3 initially have shifts 17, 15, and 12, after the secondary allocation, the shifts are adjusted to 16, 14, and 14 as much as possible.
[0249] In step S27, the result diagram of all scheduling strategies is as follows: Figure 4 As shown, this is the result diagram of bilateral scheduling sequence scheduling, as Figure 5 As shown, this is the result diagram of bilateral scheduling fixed schedule, as Figure 6 As shown, this is the result diagram of unilateral scheduling sequence scheduling, as Figure 7 As shown, this is the result of unilateral scheduling fixed schedule
[0250] Based on the above technical solution, optional steps are provided for the two parameters of specifying the total number of shifts and the number of days off:
[0251] Optional step S28 is entered when the user needs to specify the total number of trips. In step S25, a schedule based on passenger flow and user needs is generated. However, due to time constraints, the time required to randomly select a specific total number of trips in step S25 often exceeds ten minutes. To reduce this time, a window mutation mechanism is introduced based on step S25 until a departure schedule that meets the requirements is found.
[0252] Step S28-1, the window mutation in step S28 refers to taking two consecutive departure intervals as a mutation window (the number of windows starts from 1). For example, for the departure time series 06:00, 06:10, and 06:20, there are two consecutive departure intervals of 10 minutes and 20 minutes. These two intervals are randomly mutated. After each mutation, a departure point and a departure interval need to be added to the end of the departure time interval sequence (this departure interval is at the last train, and the passenger flow will not change much before and after, so usually it is only necessary to copy the previous departure interval).
[0253] Step S28-2: Set mutation restriction conditions. If the two departure intervals in the randomly selected mutation window are both fixed intervals (i.e., non-adjustable intervals), the mutation operation will be prohibited and deemed a mutation failure.
[0254] In step S28-3, the number of mutation windows in step S28-1 is adjusted using a slow start algorithm similar to the TCP congestion control algorithm, with the initial number of mutation windows set to 1. If multiple mutations (reaching a preset threshold) on the same departure schedule still do not produce the desired result, the number of mutation windows is doubled until the desired total number of departures is reached.
[0255] Step S29 is an extension of step S274. Based on step S274, the number of shifts required for each vehicle is determined. Now, a parameter for the number of off-duty days is added. When the user specifies the number of off-duty days, vehicles with fewer shifts and those with more shifts are divided into two groups. The following operations are performed on each group: The average number of shifts for each group is calculated (rounded to an even number). For each vehicle ID, a fluctuation range with a step size of 2, centered around the average, is determined. For example, the correspondence between vehicle IDs and shift times for the group with fewer shifts is shown in Table 1.
[0256] Table 1 Correspondence
[0257] Vehicle ID Number of vehicles 2 2 4 6 3 6
[0258] If the average value is 4, the fluctuation range for ID 2 is [0, 2], and the fluctuation range for IDs 3 and 4 is [-2, 0]. Then, fluctuation adjustments are made one by one in ID order: each time a value is selected from the fluctuation range to update the current shift value, and the remaining total shift value is also updated simultaneously. For example, when adjusting ID 2, if the fluctuation value is 2, the shift value becomes 4, and the remaining total shift value is updated to 14-4=10; when adjusting ID 4, if the fluctuation value is 0, the shift value becomes 6, and the remaining total shift value is updated to 4. Finally, when the traversal reaches the last ID, the remaining total shift value is directly assigned to that ID, and the variance of the adjusted group is calculated and retained.
[0259] The off-duty number in step S29 is that when the user specifies the off-duty number, vehicles with fewer shifts (h1) and vehicles with more shifts (h2) are divided into two groups according to the off-duty number. Each group is averaged based on the original basis so that the number of shifts in each group is roughly the same, but the number of shifts between groups is quite different. The off-duty number represents the group with fewer shifts.
[0260] In step S29, the maximum number of results that can be generated by each group follows the following formula:
[0261]
[0262] NumberMax: The maximum number of results that can be obtained;
[0263] n represents the number of vehicles in each group;
[0264] span i Indicates the length of the shift fluctuation range corresponding to each vehicle ID;
[0265] In step S210, based on the number of results in each of the two groups obtained in step S29, all the results in the two groups are combined in pairs and their variances are added during the combination process. Then, all the combinations are sorted according to the size of the variance (the combination with a smaller variance has a higher priority). Finally, the method in step S27 is called to calculate each group of combinations in sequence according to the sorted order. If the method in step S27 can be successfully run and obtain a result during the calculation process, the calculation is terminated immediately and there is no need to continue the calculation of subsequent combinations. At the same time, it is ensured that there is at least one combination in the two combinations that can successfully output the result.
[0266] The scheduling implementation plan of the present invention targets the complex multi-objective and multi-constrained characteristics of public transportation operations. Based on existing passenger flow data and combined with the off-peak period strategy and scheduling method input by the user, the optimal schedule is screened through an adjustable scoring mechanism to generate a departure schedule that meets actual needs. The present invention particularly emphasizes the flexibility of the scoring rules. Users can adjust the weights and assessment indicators according to their own needs in order to generate a departure plan that best meets actual operational requirements, fully reflecting the characteristics of personalization and customization. After adjusting the scoring rules, users can quickly generate a scientific and reasonable departure plan through repeated trial calculations and optimization. After the plan is executed, combined with the accumulation and feedback of actual operational data, the scoring rules and scheduling methods can be further optimized to form a closed-loop feedback mechanism, thereby realizing an efficient and intelligent scheduling model, and completely changing the blindness and inefficiency of traditional experience-based scheduling.
[0267] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
Claims
1. An intelligent bus scheduling method for public transportation, characterized in that: The following steps are involved: S1: Start the intelligent bus scheduling system, input the scheduling key into the intelligent bus scheduling system, and determine whether the input scheduling key is consistent with the scheduling key generated by the system: If the scheduling key input into the intelligent bus scheduling system is consistent with the scheduling key generated by the system, the intelligent bus scheduling system will be entered; If the scheduling key entered into the smart bus scheduling system is inconsistent with the scheduling key generated by the system, you cannot enter the smart bus scheduling system; you need to enter the correct smart bus scheduling key to use this system to ensure system security; S2, generates a schedule in the intelligent bus scheduling system to realize intelligent scheduling of public transportation buses.
2. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: Step S2 includes the following steps: S21, obtaining the route's passenger flow data, running time, and user-entered parameters through the dispatching system; S22, performing time interval standardization processing on the passenger flow data in step S21; S23, based on the standardized passenger flow data in step S22, calculate the departure interval within 30 minutes according to Formula 1: S24, according to the parameters input by the user in step S21, obtain the maximum and minimum values of the half-hour departure interval I max-min ; S25, according to step S24 I max-min , randomly generate uplink and downlink schedules. If the lengths of uplink and downlink schedules in a set of generated schedules are the same, then the schedule is retained; S26, according to the timetable in step S25, the number of vehicles in each pair of timetables is calculated and scored.
3. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: The method for generating a scheduling key in step S1 includes the following steps: S11, obtain the MAC address of the network card of the running device; S12, sorting the MAC address of the network card of the running device into a standard format, which is a 12-bit string M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 , will remove ":" or / and "-"; S13, transforming the sorted MAC into another character string using a character transformation method; S14, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12 Can be converted to 4-bit binary; S15, since the number of bits in step S14 is less than the number of bits in step S13, the first 48 bits are taken, which are consistent with the number of bits of the 48-bit binary address; S16, combining the two 48-bit values into one 48-bit value using a combining function; S17, therefore, simplifying it means that the system generates a scheduling key.
4. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: The method for obtaining the scheduling key input by the user in step S1 includes the following steps: S1-1, obtain the MAC address of the network card of the running device; S1-2, after obtaining the address, send the address to the scheduling key generator. The key code generator enters the MAC address into the scheduling key system, and the scheduling key system generates a scheduling key, specifically: S1-3, organize the address MAC into a standard form, which is a 12-bit string M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 , will remove ":" or / and "-"; S1-4, transforming the sorted MAC into another character string using a character transformation method; S1-5, corresponding to M1M2M3M4M5M6M7M8M9M 10 M 11 M 12 Convert to 48-bit binary, that is, M1 can be converted to 4-bit binary, M2 can be converted to 4-bit binary, M3 can be converted to 4-bit binary, ..., M 12 Can be converted to 4-bit binary; S1-6, since the number of bits in step S1-4 is less than that in step S1-3, the first 48 bits are taken, which are consistent with the number of bits of the 48-bit binary address; S1-7, using a merge function to merge two 48-bit values into one 48-bit value; S1-8, since the combined result is too long and difficult for the user to input, it is simplified to generate a scheduling key by the system and send the generated scheduling key to the user.
5. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: The method further includes step S27, wherein step S27 includes off-peak period strategies and scheduling methods, and the off-peak period strategies and scheduling methods include: one of unilateral scheduling, bilateral scheduling, sequential scheduling, fixed scheduling, or any combination thereof.
6. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: The method further includes step S28. When the user needs to specify the total number of trips, the method enters step S28; a window mutation mechanism is introduced until a departure schedule that meets the conditions is found.
7. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: The process also includes step S29, obtaining the number of shifts each vehicle needs to run, and adding a parameter for the number of off-duty times. When the user specifies the number of off-duty times, the vehicles with fewer shifts and the vehicles with more shifts are divided into two groups.
8. The intelligent bus scheduling method for public transportation according to claim 1, characterized in that: In step S23, formula 1 is: Among them, I interval Indicates the departure interval within 30 minutes; N class Indicates the number of half-hour shifts; C represents the passenger flow in half an hour; L actual Indicates the actual number of passengers in the vehicle; L represents the actual number of people carried by the vehicle; R period Indicates the full load rate during peak or off-peak periods based on the time period; In step S24, the minimum departure interval calculation formula for each period is: Among them, I min Indicates the minimum departure interval when the total number of vehicles is specified; max(,) means taking the larger value; T run is the runtime; T wait It is the waiting time; N vehicles is the total number of vehicles; In step S26, the scoring strategy is: Among them, Score vehicles Indicates the vehicle number score; C1 represents the first constant of the preset shift; Vehicles indicates the total number of vehicles required; Score specified =C2, Among them, Score specified Indicates the score of the specified number of vehicles; C2 represents the second constant of the preset shift; Score frequency =Total Buses×C3, Among them, Score frequency represents the vehicle shift frequency score; Total Buses indicates the total number of buses; C3 represents the third constant of the preset shift; Among them, Score smoothing Indicates the smoothing score value of the vehicle shift; min(,) means taking a smaller value; C4 represents the fourth constant of the preset shift; C5 represents the fifth constant of the preset shift; Average Absolute Difference Between Adjacent Elements represents the average of the absolute differences between adjacent elements, reflecting the smoothness of the timetable; Peak Period Score=|Actual Peak Flow-Required Peak Flow|, Among them, Peak Period Score represents the score of peak period passenger flow matching; Actual Peak Flow indicates the actual passenger flow; Required Peak Flow indicates the required passenger flow; | | means taking the absolute value; Off-Peak Period Score = | Actual Peak Flow - Required Peak Flow, where Off-Peak Period Score represents the score for off-peak period passenger flow matching. Actual Peak Flow indicates the actual passenger flow; Required Peak Flow indicates the required passenger flow; Score flow match =-(Peak Period Score×C5+Off-Peak Period Score×C6)×C7, Among them, Score flow match Indicates the customer flow matching score; Peak Period Score represents the score of peak period passenger flow matching; C5 represents the fifth constant of the preset shift; Off-Peak Period Score indicates the score of off-peak period passenger flow matching; C6 represents the sixth constant of the preset shift; C7 represents the seventh constant of the preset shift; Among them, Score max buses Indicates the maximum score of passenger flow schedule; C8 represents the eighth constant of the preset shift; Total Buses indicates the total number of buses; Max Buses indicates the maximum number of buses per vehicle. If the total number of buses exceeds the maximum number of buses, points will be deducted. C9 represents the ninth constant of the preset shift.
9. A computer system, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the intelligent bus scheduling method for public transportation as described in one of claims 1 to 8 when executing the executable instructions.
10. A computer-readable storage medium, characterized in that include: a memory having a computer program stored thereon; A processor is used to execute the program in the memory to implement the intelligent bus scheduling method for public transportation as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Intelligent bus schedule generation method
CN107153924A
Method and system for generating login keys for network communication devices
CN107483479A
Shift adjustment method based on vehicle-mounted intelligent terminal equipment and historical passenger flow big data
CN108898872A
Bus intelligent scheduling method, intelligent terminal and storage medium
CN109460936A
Method and device for generating scheduling timetable of public transport vehicle
CN111709562A