Intercity dynamic carpooling scheduling optimization method and device based on two-stage scheduling
Through a two-stage scheduling method, combining online and offline vehicle scheduling, using Markov decision-making process and deep Q-learning algorithm to optimize inter-city dynamic carpooling, it solves the problems of large calculation amount and feedback delay in the existing technology, and achieves faster matching. and lower computational effort.
Patent Information
- Application Number
- CN202410994378.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-24
Smart Images

Figure CN118551900B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intercity passenger transport planning, and in particular to an intercity dynamic carpooling scheduling optimization method and device based on two-stage scheduling. Background Art
[0002] The inter-city dynamic carpooling problem is a complex variant of the vehicle routing problem. It can also be considered as a special dynamic dial-up car-hailing problem or a dynamic pickup and delivery problem. The latest and most mainstream method to solve the inter-city dynamic carpooling problem is single-stage scheduling: real-time orders are stored in a buffer, and then all orders in the buffer are scheduled regularly at fixed intervals in a delayed scheduling manner, and the matching success information and license plate information are fed back at the same time when the information is fed back. Among them, when the matching success information is fed back to the passenger, the passenger must be served; when the license plate information is fed back to the passenger, the matching relationship between the passenger and the vehicle cannot be changed. Although this scheduling method has high scheduling accuracy, the amount of calculation is too large, and the matching success information is fed back to the passenger late.
[0003] In view of this, the applicant filed this application after studying the existing technology. Summary of the invention
[0004] The present invention aims to provide an inter-city dynamic carpooling scheduling optimization method and device based on two-stage scheduling, so as to solve the problems of excessive calculation amount in the existing method and late feedback of matching success information to passengers.
[0005] In order to solve the above technical problems, the present invention is implemented through the following technical solutions:
[0006] An inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling includes:
[0007] S1, based on the inter-city carpooling order information and vehicle information, with the goal of maximizing total profit, a two-stage scheduling model is constructed: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling;
[0008] S2, obtain the current intercity carpooling order information and current vehicle information;
[0009] S3, according to the intercity carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model, the vehicle is matched to the passenger who has placed a new order through the one-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicle to the passenger who has placed a new order, and if the match is successful, the matching success information and the license plate information are fed back to the passenger at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicle to the passenger who has placed a new order through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passenger; if the match fails, the passenger order is placed in the set of unmatched passengers;
[0010] S4, based on the Markov decision process and the deep Q learning algorithm, determine whether to execute the two-stage scheduling model at the current moment; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, skip this step, otherwise, based on the large neighborhood search algorithm, match all vehicles that have not been dispatched to all passengers who have not been successfully matched and have not timed out and successfully matched passengers, and if the matching is successful, feedback the matching success information to the passenger, and if the matching fails, put the passenger order into the set of unsuccessfully matched passengers;
[0011] S5, based on the current intercity carpooling order information and vehicle information, update the system information, and feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all the passengers.
[0012] The present invention also provides an inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling, comprising:
[0013] A model building module is used to build a two-stage scheduling model based on inter-city carpooling order information and vehicle information with the goal of maximizing total profit: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling;
[0014] The information acquisition module is used to obtain the current inter-city carpooling order information and current vehicle information;
[0015] The first-stage scheduling module is used to match vehicles to passengers who have placed new orders through the first-stage scheduling model according to the inter-city carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicles to the passengers who have placed new orders, and if the match is successful, the matching success information and the license plate information are fed back to the passengers at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicles to the passengers who have placed new orders through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passengers; if the match fails, the passenger order is placed in the set of unmatched passengers;
[0016] The two-stage scheduling module is used to determine whether to execute the two-stage scheduling model at the current moment based on the Markov decision process and the deep Q learning algorithm; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, this step is skipped; otherwise, based on the large neighborhood search algorithm, all vehicles that have not been dispatched are matched to all passengers who have not been successfully matched and have not timed out and passengers who have been successfully matched. If the match is successful, the matching success information is fed back to the passenger; if the match fails, the passenger order is placed in the set of unsuccessfully matched passengers;
[0017] The information update module is used to update the system information according to the current intercity carpooling order information and vehicle information, and to feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all passengers.
[0018] In summary, compared with the prior art, the present invention has the following beneficial effects: the inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling proposed by the present invention, wherein the first-stage scheduling is divided into online vehicle scheduling and offline vehicle scheduling. Online vehicle scheduling is based on the nearest insertion algorithm, matching vehicles that have been dispatched but have not left the city to passengers with new orders, and offline vehicle scheduling is based on the best insertion algorithm, matching vehicles that have not been dispatched to passengers with new orders. Then, the Markov decision process and the deep Q learning algorithm are used to determine whether to execute the second-stage scheduling, and based on the large neighborhood search algorithm, all vehicles that have not been dispatched are matched to all passengers with orders that have not been successfully matched and have not timed out and have been successfully matched. The present invention takes profit maximization as the goal, finds the best vehicle scheduling path, and solves how to combine the first-stage scheduling algorithm and the second-stage scheduling algorithm while maintaining high scheduling accuracy, so as to achieve the purpose of faster feedback of passenger acceptance information and reduce the overall calculation amount. The two-stage scheduling method not only reduces the total running time, but also greatly shortens the average feedback time for passengers to accept information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of an inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling provided in Embodiment 1 of the present invention.
[0021] Figure 2 A process flow chart of an inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling provided in Embodiment 1 of the present invention.
[0022] Figure 3 This is a flow chart of online vehicle scheduling provided in Example 1 of the present invention.
[0023] Figure 4 This is a flowchart of offline vehicle scheduling provided in Example 1 of the present invention.
[0024] Figure 5 A flow chart of vehicle dispatching based on a large neighborhood search algorithm provided in Example 1 of the present invention.
[0025] Figure 6 A schematic diagram of pseudo code of an improved Shaw removal operator provided in Embodiment 1 of the present invention.
[0026] Figure 7 A schematic diagram of pseudo code of the optimal insertion operator provided in the first embodiment of the present invention.
[0027] Figure 8 This is a pseudo code diagram of the retrieval service start time provided in the first embodiment of the present invention.
[0028] Fig. 9 A schematic diagram of an inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling provided in the second embodiment of the present invention.
[0029] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0031] Embodiment 1
[0032] Embodiment 1 of the present invention provides an inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling, which can be implemented by an inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling (hereinafter referred to as scheduling optimization device), and in particular, is executed by one or more processors in the scheduling optimization device.
[0033] In this embodiment, the scheduling optimization device may be an electronic device equipped with a processor, the processor having a computer program of the inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling and the computer program can be executed, such as a computer, a smart phone, a smart tablet, etc.
[0034] like Figure 1-Figure 2 As shown, an inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling includes steps S1 to S5.
[0035] S1, based on inter-city carpooling order information and vehicle information, with the goal of maximizing total profit, construct a two-stage scheduling model: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling.
[0036] The comparison of different scheduling stages is shown in Table 1.
[0037] Table 1. Comparison of different scheduling stages
[0038]
[0039] S2, obtain the current intercity carpooling order information and current vehicle information.
[0040] Preferably, the intercity carpooling order information includes: order number, order time, departure latitude and longitude at the scheduled boarding time, destination latitude and longitude, passenger status, number of passengers and the city to which they belong.
[0041] Vehicle information includes: vehicle serial number, reporting time, latitude and longitude of the starting point, latitude and longitude of the real-time location, vehicle status, number of remaining available vehicle seats, number of orders received and the city to which it belongs.
[0042] S3, according to the intercity carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model, the vehicle is matched to the newly ordered passenger through the one-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicle to the newly ordered passenger, and if the match is successful, the matching success information and the license plate information are fed back to the passenger at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicle to the newly ordered passenger through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passenger; if the match fails, the passenger order is placed in the set of unmatched passengers.
[0043] As shown in Table 2, the goal of the online vehicle scheduling is to maximize the total profit, and the constraints include passenger capacity constraints, order hard time window constraints, total time constraints for picking up and dropping off passengers, insertion time constraints, and vehicle driving route constraints.
[0044] like Figure 3 As shown, the online vehicle scheduling is based on the nearest insertion algorithm, and the specific process of matching the dispatched vehicles to the passengers who have placed new orders is as follows:
[0045] A1. Get the new order q and the set of dispatched vehicles in the current intercity carpooling order information ;
[0046] A2, according to the current vehicle Real-time location of With order Departure place right Sort in ascending order;
[0047] A3, initialize the drop-off point n=0, the best path is empty;
[0048] A4, let n=n+1, and when n is not greater than |, using the objective function of online vehicle scheduling, find the order q to insert The path with the least time among the nth vehicles ;
[0049] A5, Judgment Does it meet the constraints of the online vehicle scheduling? If so, for The path of the nth vehicle in , otherwise proceed to the next iteration, n=n+1;
[0050] A6, until n equals |When Optimal scheduling solution for online vehicle dispatching.
[0051] Table 2. Online vehicle scheduling
[0052]
[0053] As shown in Table 3, the goal of offline vehicle scheduling is to maximize the total profit, and the constraints include vehicle capacity constraints, order hard time window constraints, total time constraints for picking up and dropping off passengers, insertion time constraints, vehicle driving route constraints, and the vehicle must travel a fixed section of highway.
[0054] like Figure 4 As shown, the specific process of offline vehicle scheduling to match unscheduled vehicles to passengers who have placed new orders through the optimal insertion algorithm is as follows:
[0055] B1, obtain the new order q and the set of vehicles that have not been dispatched in the intercity carpooling order information at the current moment ;
[0056] B2, initialize the drop-off point n=0, the best path Empty and vehicle x=0;
[0057] B3, let n=n+1, and when n is not greater than |, find order q and insert it into the set of vehicles that have not been dispatched The most profitable path among the nth vehicles ;
[0058] B4, Judgment Whether the constraints and objective function of the offline vehicle scheduling are met, and Corresponding feedback to the order Is the time of receiving information better than of, that is ( )> ( ), if so, then x=n, , otherwise proceed to the next iteration, n=n+1;
[0059] B5, iterate until n is greater than |, determine whether x is 0, if not 0, then The path of vehicle x is updated to , and obtain the optimal scheduling solution for offline vehicle scheduling.
[0060] Table 3. Offline vehicle scheduling
[0061]
[0062] As shown in Table 4-5, the goal of the two-stage scheduling model is to maximize the total profit of the system. The constraints include vehicle capacity constraints, order hard time window constraints, total time constraints for picking up and dropping off passengers, insertion time constraints, vehicle route constraints, vehicles must travel on a fixed section of highway, and passengers who have been fed back with successful matching information must be served.
[0063] The objective function of the two-stage scheduling model is:
[0064] ;
[0065] in:
[0066] .
[0067] Table 4. Decision variables of the two-stage vehicle scheduling model
[0068]
[0069] Table 5. Constraints of the two-stage vehicle scheduling model
[0070]
[0071] S4, based on the Markov decision process and deep Q learning algorithm, determine whether to execute the two-stage scheduling model at the current moment; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, skip this step, otherwise based on the large neighborhood search algorithm, match all vehicles that have not yet departed to all passengers who have not been successfully matched and have not timed out and successfully matched passengers. If the match is successful, the matching success information is fed back to the passenger, and if the match fails, the passenger order is placed in the set of unsuccessfully matched passengers.
[0072] Preferably, the Markov decision process includes states, actions and rewards. The states include: the number of orders that have not been matched with vehicles at the current moment and the number of orders that have been matched with vehicles but have not been dispatched, the total number of vehicles that have not been dispatched at the current moment, the rewards obtained after the last fine scheduling, and the remaining time from the earliest tolerable pickup time of all orders that need to be scheduled in this two-stage scheduling.
[0073] The actions include: executing the two-stage scheduling at the current moment and not executing the two-stage scheduling at the current moment.
[0074] The reward is the difference between the profit after this decision and the profit after the previous decision.
[0075] For the state variables, the remaining time to the earliest tolerable boarding time can be understood as: for example, the current time is 9 o'clock, and the earliest scheduled boarding time among all orders that need to be scheduled is 8:50, then the earliest tolerable boarding time among all orders that need to be scheduled is 9:30, and the remaining time to the earliest tolerable boarding time is 9:30 minus 9 o'clock, which is 30 minutes.
[0076] Preferably, the calculation formula for the profit in the reward is:
[0077] .
[0078] Assume that state, action and reward are represented as , , , the value function of reinforcement learning using multi-layer perceptron (MLP) parameters ,in, Iterate to The parameters of the Q network at this time. The loss function when using the time difference method to measure the Q function training is:
[0079] ;
[0080] Among them, the value function ;
[0081] is the discount factor; Memory buffer A record in the state Action Afterwards get reward , and from the state Change to status .
[0082] express expectations;
[0083] Indicates uniform random sampling from the memory buffer D;
[0084] It means applying a function (i.e. the function in the brackets [ ]) to multiple records uniformly randomly sampled from the experience playback buffer D (the specific number of sampled records is the parameter "the number of records extracted each time" in the last row of Table 8) and calculating its mathematical expectation;
[0085] Strategy Interactions with the environment are recorded and stored in a memory buffer middle,
[0086] ;
[0087] in, As the training time decreases linearly; using double deep Q learning, is the objective function, The previous iteration results, in Iterative Updates After that, the objective function Updated to .
[0088] Preferably, the large neighborhood search algorithm includes an insertion operator and a removal operator. All vehicles that have not been dispatched at this moment are given to all passengers whose orders have not been successfully matched and have not timed out, as well as those who have been successfully matched.
[0089] like Figure 5 As shown in the figure, the vehicle dispatching process based on the large neighborhood search algorithm is as follows:
[0090] C1, obtain the current scheduling result S;
[0091] C2, initialization iteration number ep=0, acceptable solution not improved number nt=0, maximum iteration number epn, maximum acceptable solution not improved number ntn, simulated annealing initial temperature TP, temperature attenuation coefficient (i.e. temperature change rate) TK, optimal solution BS=S, current solution CS=S;
[0092] C3, use the remove operator to remove S, and insert all passengers who have not been successfully matched and have not timed out into S again through the insert operator;
[0093] C4, Judgment ( ) is greater than ( ), if yes, then CS=S, nt=0, jump to step C8; otherwise, continue to step C5;
[0094] C5, Judgment ( ) is greater than ( ), if not, CS=S, jump to step C7; if yes, continue to step C6;
[0095] C6, Judgment Is it greater than ; If not, jump to step C7; If yes, then CS=S; TP=TP*TK;
[0096] C7, continue to the next iteration, nt=nt+1;
[0097] C8, ep=ep+1;
[0098] C9, determine whether ep reaches the maximum number of iterations epn, or whether nt reaches ntn. If so, S=BS and output the scheduling result; otherwise, return to step C3.
[0099] The insertion operator is the optimal insertion operator; the removal operator is the improved Shaw removal operator, which removes orders by order similarity. The pseudo codes of the removal operation (removal operator) and the insertion operation (insertion operator) are as follows: Figure 6 and Figure 7 Remove the , is the parameter that controls the number of removal orders; , is a random factor; order and The formula for the similarity of the order is:
[0100] ;
[0101] in, is the order distance similarity weight, is the order time similarity weight, express The normalized distance between two points; Indicates order Place of departure; Indicates order destination; Indicates order The scheduled pickup time to the order The normalized time of the scheduled boarding time;
[0102] Among them, the order distance and order time are each normalized using the min-max method, and the formula is:
[0103] ,in, is the sample data, is the sample minimum value, is the sample maximum value.
[0104] Preferably, the matching by large neighborhood search algorithm When all vehicles that have not started are The formula for determining the time of vehicle departure is:
[0105] ;
[0106] in, Indicates vehicle Departure time, For vehicles Passed by ( ) boarding points, Indicates the starting point of the vehicle; Indicates vehicle At the node Waiting time; Indicates vehicle In the passing Waiting time at each boarding point; Indicates vehicle In the passing Waiting time at each boarding point; Representation Node The latest service start time; Indicates vehicle In the passing +1 latest start time of service for the boarding point.
[0107] like Figure 8 Vehicle shown The start time vector of the service With waiting time vector The method of obtaining . Among them, Representation Node The earliest service start time, Representation Node The latest service start time. The maximum delay time of all receiving nodes is:
[0108] ;
[0109] It is also possible that the vehicle arrives at each node in advance, so the maximum delay time of the vehicle should be:
[0110] .
[0111] S5, based on the current intercity carpooling order information and vehicle information, update the system information, and feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all the passengers.
[0112] Preferably, when the order is not matched to a vehicle, ; When a vehicle is matched but not dispatched , and feedback the matching success information to the passenger, but not the license plate information; when When the vehicle corresponding to the passengers of And feedback the license plate information, and the matching relationship between the passenger and the vehicle cannot be changed afterwards; when Passengers boarding time ;when The service is completed when the passengers get off the bus. If the order is not served within the specified time window, Indicates rejection of the order.
[0113] The vehicle did not start at the beginning , the matching relationship between the vehicle and the successfully matched passenger can be changed. When the vehicle has departed but has not arrived at the entrance or exit of the city to which it belongs, that is, it has not left the city to which it belongs , the matching relationship between the vehicle and the successfully matched passenger cannot be changed, but passengers can be inserted into the vehicle's itinerary. At this time, the matching relationship between the vehicle and the passenger cannot be changed and no more passengers can be inserted. After completing a trip, the vehicle updates the latitude and longitude of the starting point to the latitude and longitude of the destination of the last passenger sent, and the city to which it belongs. , Vehicle Status , Number of available vehicle seats remaining .
[0114] The relevant symbols are defined as:
[0115] For the city collection, ; For a city, ; For the city Entrance and exit of
[0116] is the collection of all passenger orders; For a passenger order, ;
[0117] Orders for passengers The order time; Orders for passengers The scheduled boarding time; Orders for passengers The latitude and longitude of the departure point; Orders for passengers The destination latitude and longitude;
[0118] Orders for passengers status, Represents passenger orders The various states of the order: no vehicle matched, matched but not dispatched, license plate information fed back, boarded, disembarked, rejected;
[0119] Orders for passengers the number of passengers; Orders for passengers The city of ;
[0120] ,in Represents passenger orders The order set whose states are 0, 1, 2, 3, 4, and 5;
[0121] The earliest boarding time constraint for order passengers; The latest boarding time constraint for passengers in the order;
[0122] is the fare per passenger; is the set of all vehicles, K= ∪ ∪ , Gathering vehicles that have not yet departed; It is a collection of vehicles that have started but have not left their city; Gather vehicles that have left their cities; For a vehicle, ;
[0123] For vehicles The registration time of class; For vehicles The latitude and longitude of the starting point; For vehicles The real-time location latitude and longitude; For vehicles The city of ;
[0124] For vehicles status, Respectively represent vehicles The various states of the vehicle: not yet departed, departed but not leaving the city, and left the city;
[0125] For vehicles The number of remaining available vehicle seats; For vehicles Number of orders received;
[0126] is the maximum passenger capacity of the vehicle;
[0127] For vehicles Passed by ( ) boarding points, of which Indicates the starting point of the vehicle;
[0128] For vehicles Passed by ( ) drop-off points;
[0129] is the speed of the vehicle, the vehicle travels at a constant speed;
[0130] is the total time constraint for the vehicle to pick up passengers; is the total time constraint for the vehicle to drop off passengers; To insert a time constraint, that is, the maximum value of the increase in the total time spent on picking up each additional passenger;
[0131] is the cost per kilometer traveled by the vehicle; The fixed cost of using each vehicle;
[0132] is the point set of online vehicle scheduling, that is, the set of departure locations of dispatched orders. ,in , , , ;
[0133] , is the set of real-time location points of vehicles that have started but have not left their cities;
[0134] , which is the destination collection of the dispatched orders;
[0135] is the point set for offline vehicle scheduling, ,in , , ;
[0136] , is the set of starting positions of all vehicles that have departed; , is the set of departure points for all orders that have been matched with vehicles but not dispatched; , is the set of destination points for all orders that have been matched with vehicles but not dispatched;
[0137] The time when the system starts scheduling;
[0138] The time when the system ends scheduling;
[0139] For the general arrive The number of groups of timestamps into which this period is discretized;
[0140] For the general arrive This period of time is discrete A collection of timestamps for the group, ;
[0141] is the starting time of a timestamp, where ;
[0142] for time The starting position point set of the vehicle;
[0143] for time The collection of pickup locations for the order;
[0144] , is the set of entry and exit points of all cities, For the city The entry and exit points, For the city entry and exit points;
[0145] for time The set of drop-off locations for the order;
[0146] For The set of orders that have not been successfully matched and have not timed out and successfully matched;
[0147] For The vehicles that have not departed at the scheduled time are gathered;
[0148] For The two-stage scheduling state at time, ;
[0149] is a point set, ;
[0150] is an edge set, including: ① , vehicle starting point Starting point with passengers Connected, ,② , passenger starting point Starting with another passenger Connected, ③ , passenger starting point City entry and exit points Connected, ④ , city entry and exit points With passenger destination Connected, ⑤ , passenger destination Destination with another passenger Connected, ;
[0151] Indicates connection from The point set, ; Indicates connection to The node set of ;
[0152] For Node To Node The vehicle travel time; Departure point To the destination node The vehicle travel time;
[0153] , , Indicates the corresponding service node;
[0154] is a 0-1 decision variable, representing the vehicle in the online vehicle scheduling Whether the order is matched;
[0155] is a 0-1 decision variable, representing the vehicle in the online vehicle dispatch Whether it passes through the arc , , ;
[0156] Represents vehicles scheduled online Through the arc ; Represents vehicles scheduled online Through the arc ; Represents vehicles scheduled online Through the arc ; Represents vehicles scheduled online Through the arc ;
[0157] Represents a vehicle for online vehicle dispatching Service Node moment, , ; Represents vehicles scheduled online Service Node moment; Represents vehicles scheduled online Service Node moment;
[0158] Represents vehicles scheduled online In its city The entrance and exit moments; Represents vehicles scheduled online Passed by +1 pick-up point time; Represents vehicles scheduled online Passed by - 1 pick-up point time; Represents vehicles scheduled online Passed by - 1 pick-up point time;
[0159] Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ;
[0160] Represents a vehicle that is scheduled offline In the city The entrance and exit moments; Represents a vehicle that is scheduled offline At the time of the starting position; Represents a vehicle that is scheduled offline In the The real-time location of the order moment, Indicates vehicle Number of orders received;
[0161] Represents a vehicle that is scheduled offline In the city The entrance and exit moments; Represents a vehicle that is scheduled offline Passed by +1 pick-up point time; Represents a vehicle that is scheduled offline Passed by - 1 pick-up point time;
[0162] Represents the vehicle of the two-stage vehicle scheduling model Through the arc , the value is 0 or 1;
[0163] is the decision variable of the two-stage vehicle scheduling model, with a value of 0 or 1, indicating that if the vehicle Through the arc ,but ,otherwise ;
[0164] Represents the vehicle of the two-stage vehicle scheduling model Whether it passes through the arc , the value is 0 or 1;
[0165] For vehicles Start serving nodes Moment, ; Indicates vehicle Start at the moment of destination; Indicates vehicle Start at the departure point; The vehicle representing the two-stage scheduling model At the departure point Number of passengers after The vehicle representing the two-stage scheduling model At the destination node of passengers.
[0166] In another specific embodiment, in order to verify the effectiveness of the two-stage scheduling method proposed in the present invention, the vehicle and order data of two routes from Anxi County to Xiamen City from July 1, 2022 to June 30, 2023 and from Zhangzhou City to Xiamen City from March 1, 2023 to March 31, 2023 were selected as research objects.
[0167] The training set and the test set are divided in a ratio of 4:1. The training set from Anxi County to Xiamen City is the data from September 12, 2022 to June 30, 2023, and the test set is the data from July 1, 2022 to September 11, 2022; the test set from Zhangzhou City to Xiamen City is the data from March 19, 2023 to March 25, 2023, and the data for the rest of the time period is the training set. Among them, the Anxi County to Xiamen City line selects the dispatch results of July 1, 2022 for display, with 899 orders and 54 vehicles on that day; the Zhangzhou City to Xiamen City line selects the results of March 19, 2023 for display, with 3146 orders and 295 vehicles on that day.
[0168] The evaluation method is to schedule vehicles on a daily basis, and put each trip information into the trip set The total simulation scheduling running time is used to evaluate the computational workload. The shorter the total simulation scheduling running time, the smaller the computational workload; the scheduling accuracy is comprehensively evaluated by the total profit, the average vehicle full load rate, the total number of passengers picked up, and the average total time for picking up and dropping off passengers; the shorter the average feedback time for acceptance information, the earlier the vehicle will feedback acceptance information to the passenger.
[0169] Evaluation indicators include: total simulation scheduling running time (unit: seconds);
[0170] Total profit (unit: yuan): ;
[0171] Average vehicle load factor: ;
[0172] Total number of passengers received: ;
[0173] Average total time for picking up and dropping off passengers (unit: minutes): ;
[0174] Average feedback information reception time (unit: seconds):
[0175] Where: Collection for itinerary The number of trips in For a particular trip; For itinerary The number of completed ridesharing orders, ; For itinerary Total time spent on picking up and dropping off passengers; For itinerary Number of passengers carried; For feedback to order The moment to receive information.
[0176] The experimental parameter settings are shown in Table 6-8:
[0177] Table 6. Constraint parameter settings
[0178]
[0179] Table 7. LNS algorithm parameter settings
[0180]
[0181] Table 8. DQN training parameter settings
[0182]
[0183] The experimental results are shown in Table 9:
[0184] Table 9. Comparison of experimental results between single-stage scheduling and two-stage scheduling
[0185]
[0186] Among them, the single-stage scheduling is to run the large neighborhood search algorithm every 3 minutes, and the parameter settings are the same as those in Table 7. It can be seen that in the experimental results of the two routes, the total profit, average vehicle load factor, total number of passengers picked up, and average total time for picking up and dropping off passengers on each route of the two-stage scheduling are not much different from those of the single-stage scheduling, and some indicators are even better. However, compared with the single-stage scheduling, the two-stage scheduling not only has a shorter total running time (the running time on the Anxi-Xiamen route data set is reduced by 22.49%, and the running time on the Zhangzhou-Xiamen route data set is reduced by 21.52%), but also the average feedback time to the passengers to accept the information is greatly shortened, which is shortened by 97.44% in the Anxi-Xiamen route data set and 93.46% in the Zhangzhou-Xiamen route data set.
[0187] In summary, compared with the prior art, the present invention has the following beneficial effects:
[0188] The present invention aims to maximize profits and find the best vehicle dispatch path. It solves the problem of how to combine the one-stage dispatch algorithm and the two-stage dispatch algorithm while maintaining high dispatch accuracy, so as to achieve the purpose of faster feedback of passenger acceptance information and reduce the overall calculation amount. The two-stage dispatch method not only reduces the total running time, but also greatly shortens the average feedback time for passenger acceptance information.
[0189] Embodiment 2
[0190] like Fig. 9 As shown, the second embodiment of the present invention further provides an inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling, comprising:
[0191] A model building module is used to build a two-stage scheduling model based on inter-city carpooling order information and vehicle information with the goal of maximizing total profit: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling;
[0192] The information acquisition module is used to obtain the current inter-city carpooling order information and current vehicle information;
[0193] The first-stage scheduling module is used to match vehicles to passengers who have placed new orders through the first-stage scheduling model according to the inter-city carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicles to the passengers who have placed new orders, and if the match is successful, the matching success information and the license plate information are fed back to the passengers at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicles to the passengers who have placed new orders through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passengers; if the match fails, the passenger order is placed in the set of unmatched passengers;
[0194] The two-stage scheduling module is used to determine whether to execute the two-stage scheduling model at the current moment based on the Markov decision process and the deep Q learning algorithm; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, this step is skipped; otherwise, based on the large neighborhood search algorithm, all vehicles that have not been dispatched are matched to all passengers who have not been successfully matched and have not timed out and passengers who have been successfully matched. If the match is successful, the matching success information is fed back to the passenger; if the match fails, the passenger order is placed in the set of unsuccessfully matched passengers;
[0195] The information update module is used to update the system information according to the current intercity carpooling order information and vehicle information, and to feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all passengers.
[0196] Embodiment 3
[0197] The third embodiment of the present invention also provides an inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling as described above.
[0198] Embodiment 4
[0199] The fourth embodiment of the present invention further provides a computer-readable storage medium, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a device where the computer-readable storage medium is located, the above-mentioned inter-city dynamic carpooling scheduling optimization method is implemented.
[0200] In the several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0201] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0202] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling, It is characterized in that include: S1, based on the inter-city carpooling order information and vehicle information, with the goal of maximizing total profit, a two-stage scheduling model is constructed: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling; S2, obtain the current intercity carpooling order information and current vehicle information; S3, according to the intercity carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model, the vehicle is matched to the passenger who has placed a new order through the one-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicle to the passenger who has placed a new order, and if the match is successful, the matching success information and the license plate information are fed back to the passenger at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicle to the passenger who has placed a new order through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passenger; if the match fails, the passenger order is placed in the set of unmatched passengers; S4, based on the Markov decision process and the deep Q learning algorithm, determine whether to execute the two-stage scheduling model at the current moment; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, skip this step, otherwise execute the two-stage scheduling model, that is, based on the large neighborhood search algorithm, match all vehicles that have not been dispatched to all passengers who have not been successfully matched and have not timed out and successfully matched passengers, and if the matching is successful, feedback the matching success information to the passenger, and if the matching fails, put the passenger order into the set of unsuccessfully matched passengers; S5, based on the current intercity carpooling order information and vehicle information, update the system information, and feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all passengers; Among them, each scheduling model includes decision variables, objective functions and constraints, and the decision variables of the online vehicle scheduling are: , represents the vehicle of online vehicle scheduling There is a matching order q, then ,otherwise , , , ; , represents the vehicle of online vehicle scheduling Through the arc ,but ,otherwise , , , , ; , represents the vehicle of online vehicle scheduling Service Node moment, , ; in is the collection of vehicles that have started but have not left their city; Indicates vehicle status, , respectively represent vehicles The various states of the vehicle are: not started, started but not leaving the city, and left the city; , = , is the set of all vehicles; is the order set when no vehicle is matched; Indicates passenger orders status, Represents passenger orders The various states of the order, namely, no vehicle matched, matched but not dispatched, license plate information fed back, boarded, disembarked, and rejected; Q, = ; The point set representing online vehicle scheduling, i.e., the set of departure locations for dispatched vehicle orders; ,in , is the set of real-time location points of vehicles that have started but have not left their cities. For vehicles The real-time location latitude and longitude; , Orders for passengers The latitude and longitude of the departure point; , is the set of entry and exit points of all cities, For the city The entry and exit points, For the city entry and exit points; , is the destination collection of the dispatched orders, Orders for passengers The destination latitude and longitude; The objective function of the online vehicle scheduling is: ; in, represents the fare per passenger, Indicates passenger orders the number of passengers; represents the fixed cost of using each vehicle; It represents the cost per kilometer traveled by the vehicle; Indicates the speed of the vehicle, and the vehicle travels at a constant speed; Indicates vehicle Service Node moment, For vehicles The real-time location latitude and longitude, For vehicles Number of orders received; For vehicles Passed by ( ) drop-off points; Indicates vehicle Service Node moment; For vehicles The latitude and longitude of the starting point; For vehicles Passed by ( ) boarding points, of which Indicates the starting point of the vehicle; The constraints of the online vehicle scheduling are: There is at most one vehicle that can service this order: ; Decision variable consistency: , ; Passenger pick-up and drop-off points are added to the vehicle path in pairs: ; Vehicle driving route is continuous: ; Passenger capacity constraints: ; Order hard time window constraints: ; Total time constraints for picking up and dropping off guests: ; Insert time constraints: , ; in, Represents vehicles scheduled online Through the arc , Indicates passenger orders The latitude and longitude of the departure point; Orders for passengers The destination latitude and longitude; Orders for passengers The order time; Orders for passengers The scheduled boarding time; The earliest boarding time constraint for the order passengers; The latest boarding time constraint for passengers in the order; , , Indicates the corresponding service node; Indicates the city Entrance and exit of , represents a collection of cities; Represents vehicles scheduled online Order The starting point, Orders for passengers The latitude and longitude of the departure point; Represents vehicles scheduled online In its city The entrance and exit moments; Represents vehicles scheduled online Passed by +1 pick-up point time; Indicates the maximum passenger capacity of the vehicle. represents the total time constraint for picking up passengers by the vehicle, represents the total time constraint of the vehicle for dropping off passengers, Indicates the insertion time constraint; The decision variables for offline vehicle scheduling are: , and ; in, , , , vehicles in offline vehicle scheduling Pickup orders If there is an order ,otherwise ; , , , , vehicles in offline vehicle scheduling Through the arc ,but ,otherwise ; For vehicles in offline vehicle dispatch In the service node moment; , ; in, The point set representing offline vehicle scheduling; ,in , is the set of starting positions of all vehicles that have departed; , is the set of departure points for all orders that have been matched with vehicles but not dispatched; , is the set of destination points for all orders that have been matched with vehicles but not dispatched; The objective function of the offline vehicle scheduling is: ; The constraints of the offline vehicle scheduling are: There is at most one vehicle serving this passenger: ; Decision variable consistency: , ; Passenger pick-up and drop-off points are added to the vehicle path in pairs: ; Vehicle driving route is continuous: , ; The vehicle has to travel a fixed section of highway: ; Order hard time window constraints: ; Total time constraints for picking up and dropping off guests: , ; Insert time constraints: , ; in, Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ; Indicates vehicle The city of , ; Represents a vehicle that is scheduled offline In its city The entrance and exit time, , L is the itinerary set; Represents a vehicle that is scheduled offline At the time of the starting position; Represents a vehicle that is scheduled offline In the The real-time location of the order moment, Indicates vehicle Number of orders received; Represents a vehicle that is scheduled offline In the city The entrance and exit moments; Represents a vehicle that is scheduled offline Passed by +1 pick-up point time, Represents a vehicle that is scheduled offline Passed by - 1 pick-up point time; The online vehicle dispatch is based on the nearest insertion algorithm, and matches the dispatched vehicles to the passengers who have placed new orders as follows: A1. Get the new order q and the set of dispatched vehicles in the current intercity carpooling order information ; A2, according to the current vehicle Real-time location of With order Departure place right Sort in ascending order; A3, initialize the drop-off point n=0, the best path is empty; A4, let n=n+1, and when n is not greater than |, using the objective function of online vehicle scheduling, find the order q to insert The path with the least time among the nth vehicles ; A5, Judgment Does it meet the constraints of the online vehicle scheduling? If so, for The path of the nth vehicle in , otherwise proceed to the next iteration, n=n+1; A6, until n equals |When Optimal scheduling solution for online vehicle dispatch; The offline vehicle dispatching matches the undeparted vehicles to the newly ordered passengers through the optimal insertion algorithm as follows: B1, obtain the new order q and the set of vehicles that have not been dispatched in the intercity carpooling order information at the current moment ; B2, initialize the drop-off point n=0, the best path Empty and vehicle x=0; B3, let n=n+1, and when n is not greater than |, find order q and insert it into the set of vehicles that have not been dispatched The most profitable path among the nth vehicles ; B4, Judgment Whether the constraints and objective function of the offline vehicle scheduling are met, and Corresponding feedback to the order Is the time of receiving information better than of, that is ( )> ( ), if so, then x=n, , otherwise proceed to the next iteration, n=n+1; B5, iterate until n is greater than |, determine whether x is 0, if not 0, then The path of vehicle x is updated to , and obtain the optimal scheduling solution for offline vehicle scheduling.
2. According to the inter-city dynamic carpooling scheduling optimization method based on two-stage scheduling as described in claim 1, Features ,The decision variables of the two-stage scheduling model are: , which means that if the vehicle of the two-stage scheduling model Through the arc ,but ,otherwise , , , ; , represents the vehicle of the two-stage scheduling model Start serving nodes Moment, , ; , represents the service node of the two-stage scheduling model Rear vehicle The number of passengers in , ; The objective function of the two-stage scheduling model is: ; in: ; For the general arrive The number of groups of timestamps into which this period is discretized; The time when the system starts scheduling; The time when the system ends scheduling; For The two-stage scheduling state at time, ; is the starting time of a timestamp, where ; For The set of orders that have not been successfully matched and have not timed out and successfully matched; For The vehicles that have not departed at the scheduled time are gathered; Represents the vehicle of the two-stage vehicle scheduling model Through the arc , the value is 0 or 1; is the decision variable of the two-stage scheduling model, with a value of 0 or 1, indicating that if the vehicle Through the arc ,but ,otherwise ; For vehicles Start serving nodes Moment, , ; The constraints of the two-stage scheduling model are: , , indicating that each order can be served by at most one vehicle; , indicating that the passengers matched to the vehicle must be served; , , which means that if the vehicle If it serves the passengers’ origin, then it needs to serve the passengers’ destination; , , ; Any vehicle Need to drop off all passengers on each trip and pick up new passengers for the next trip; , , indicating that any vehicle It must start from its starting position point; , , , indicating that any vehicle The driving routes are all continuous; , , indicating that any vehicle All of them have to drive a fixed section of highway; , , This means ensuring that each passenger's departure point must arrive before his destination; , , , , represents the relationship between the start service times of two nodes in a sequential service; , , represents the hard time window constraint of the order; , , , , , indicating that the total pick-up time added by the newly inserted passenger is less than the maximum insertion limit time; , , represents the maximum time constraint of the vehicle from departure to leaving the starting city; , , represents the maximum time constraint from the time the vehicle arrives at the destination city to the time it delivers all passengers; , , , , , , , , represents the relationship between the number of passengers in the vehicle after two nodes served in the service sequence; , , , indicating that the number of passengers on the trip cannot exceed the maximum passenger capacity; in, Indicates connection from The point set of ; Indicates connection to The node set of ; express time The collection of pickup locations for the order; express time The starting position point set of the vehicle; The vehicle representing the two-stage scheduling model Through the arc ; Departure point To the destination node The vehicle travel time; Indicates vehicle Start at the moment of destination; Indicates vehicle Start at the departure point; The vehicle representing the two-stage scheduling model At the departure point Number of passengers after The vehicle representing the two-stage scheduling model At the destination node of passengers.
3. According to claim 2, a method for optimizing inter-city dynamic carpooling scheduling based on two-stage scheduling, Features ,The variables of the Markov decision process include state, action and reward, where, The states include: The number of orders that have not been matched with a vehicle at the moment and the number of orders that have been matched with a vehicle but have not been dispatched, The total number of vehicles that have not been dispatched at the time, the reward obtained after the last two-stage scheduling, and the remaining time to the earliest tolerable boarding time for all orders that need to be scheduled in this two-stage scheduling; The actions include: executing two-stage scheduling at the current decision moment and not executing two-stage scheduling at the current decision moment; The reward is: the difference between the profit after this decision and the profit after the previous decision.
4. According to claim 3, a method for optimizing inter-city dynamic carpooling scheduling based on two-stage scheduling, Features ,The calculation formula of the profit in the reward is: 。 5. According to claim 4, a method for optimizing inter-city dynamic carpooling scheduling based on two-stage scheduling, Features The large neighborhood search algorithm includes an insertion operator and a removal operator. All vehicles that have not been dispatched at this moment are given to all passengers whose orders have not been successfully matched and have not timed out, as well as those whose orders have been successfully matched, among which, The insertion operator is the optimal insertion operator; the removal operator is the improved Shaw removal operator, which removes orders by order similarity. The formula of order similarity is: ; in, is the order distance similarity weight, is the order time similarity weight, express The normalized distance between two points; Indicates order Place of departure; Indicates order destination; Indicates order The scheduled pickup time to the order The normalized time of the scheduled boarding time; Among them, the order distance and order time are each normalized using the min-max method, and the formula is: ,in, is the sample data, is the sample minimum value, is the sample maximum value.
6. According to claim 5, a method for optimizing inter-city dynamic carpooling scheduling based on two-stage scheduling, Features , matching through large neighborhood search algorithm When all vehicles that have not started are The formula for determining the time of vehicle departure is: ; in, Indicates vehicle Departure time, For vehicles Passed by ( ) pick-up point, Indicates the starting point of the vehicle; Indicates vehicle At the node Waiting time; Indicates vehicle In the passing Waiting time at each boarding point; Indicates vehicle In the passing Waiting time at each boarding point; Representation Node The latest service start time; Indicates vehicle In the passing +1 latest start time of service for the boarding point.
7. According to claim 6, a method for optimizing inter-city dynamic carpooling scheduling based on two-stage scheduling, Features , the updated system information is specifically: Update the passenger and vehicle status based on the current passenger intercity carpooling order information and vehicle information: Order status when the order is not matched to a vehicle ; When a vehicle is matched but not dispatched , and feedback the matching success information to the passenger, but not the license plate information; when When the vehicle corresponding to the passengers of The license plate information will be fed back, and the matching relationship between the passenger and the vehicle cannot be changed afterwards; when Passengers boarding time ;when The service is completed when the passengers get off the bus. ; If the order is not served within the specified time window, Indicates rejection of the order; The vehicle did not start at the beginning , at this time, the matching relationship between the vehicle and the successfully matched passenger can also be changed; When the vehicle has departed but has not reached the entrance or exit of the city to which it belongs, that is, has not left the city to which it belongs , the matching relationship between the vehicle and the successfully matched passenger cannot be changed, but passengers can be inserted into the vehicle itinerary; When the vehicle has left the city , at this time, the matching relationship between the vehicle and the passenger cannot be changed and no more passengers can be inserted; After completing a trip, the vehicle updates the latitude and longitude of the starting point to the latitude and longitude of the destination of the last passenger it sent, and the city to which it belongs is Updated to , Vehicle Status Updated to 0, the number of available vehicle seats remaining Updated to ; in, For vehicles The city of .
8. An inter-city dynamic carpooling scheduling optimization device based on two-stage scheduling, It is characterized in that include: A model building module is used to build a two-stage scheduling model based on inter-city carpooling order information and vehicle information with the goal of maximizing total profit: wherein the two-stage scheduling model includes a one-stage scheduling model and a two-stage scheduling model; the one-stage scheduling model includes online vehicle scheduling and offline vehicle scheduling; The information acquisition module is used to obtain the current inter-city carpooling order information and current vehicle information; The first-stage scheduling module is used to match vehicles to passengers who have placed new orders through the first-stage scheduling model according to the inter-city carpooling order information at the current moment, the current vehicle information and the two-stage scheduling model; wherein the online vehicle scheduling is based on the nearest insertion algorithm, matching the dispatched vehicles to the passengers who have placed new orders, and if the match is successful, the matching success information and the license plate information are fed back to the passengers at the same time, and if the match fails, the offline vehicle scheduling is performed; the offline vehicle scheduling matches the undispatched vehicles to the passengers who have placed new orders through the best insertion algorithm, and if the match is successful, the matching success information is fed back to the passengers; if the match fails, the passenger order is placed in the set of unmatched passengers; Among them, each scheduling model includes decision variables, objective functions and constraints, and the decision variables of the online vehicle scheduling are: , represents the vehicle of online vehicle scheduling There is a matching order q, then ,otherwise , , , ; , represents the vehicle of online vehicle scheduling Through the arc ,but ,otherwise , , , , ; , represents the vehicle of online vehicle scheduling Service Node moment, , ; in is the collection of vehicles that have started but have not left their city; Indicates vehicle status, , respectively represent vehicles The various states of the vehicle are: not started, started but not leaving the city, and left the city; , = , is the set of all vehicles; is the order set when no vehicle is matched; Indicates passenger orders status, Represents passenger orders The various states of the order, namely, no vehicle matched, matched but not dispatched, license plate information fed back, boarded, disembarked, and rejected; Q, = ; The point set representing online vehicle scheduling, i.e., the set of departure locations for dispatched vehicle orders; ,in , is the set of real-time location points of vehicles that have started but have not left their cities. For vehicles The real-time location latitude and longitude; , Orders for passengers The latitude and longitude of the departure point; , is the set of entry and exit points of all cities, For the city The entry and exit points, For the city entry and exit points; , is the destination collection of the dispatched orders, Orders for passengers The destination latitude and longitude; The objective function of the online vehicle scheduling is: ; in, represents the fare per passenger, Indicates passenger orders the number of passengers; represents the fixed cost of using each vehicle; It represents the cost per kilometer traveled by the vehicle; Indicates the speed of the vehicle, and the vehicle travels at a constant speed; Indicates vehicle Service Node moment, For vehicles The real-time location latitude and longitude, For vehicles Number of orders received; For vehicles Passed by ( ) drop-off points; Indicates vehicle Service Node moment; For vehicles The latitude and longitude of the starting point; For vehicles Passed by ( ) boarding points, of which Indicates the starting point of the vehicle; The constraints of the online vehicle scheduling are: There is at most one vehicle that can service this order: ; Decision variable consistency: , ; Passenger pick-up and drop-off points are added to the vehicle path in pairs: ; Vehicle driving route is continuous: ; Passenger capacity constraints: ; Order hard time window constraints: ; Total time constraints for picking up and dropping off guests: ; Insert time constraints: , ; in, Represents vehicles scheduled online Through the arc , Indicates passenger orders The latitude and longitude of the departure point; Orders for passengers The destination latitude and longitude; Orders for passengers The order time; Orders for passengers The scheduled boarding time; The earliest boarding time constraint for the order passengers; The latest boarding time constraint for passengers in the order; , , Indicates the corresponding service node; Indicates the city Entrance and exit of , represents a collection of cities; Represents vehicles scheduled online Order The starting point, Orders for passengers The latitude and longitude of the departure point; Represents vehicles scheduled online In its city The entrance and exit moments; Represents vehicles scheduled online Passed by +1 pick-up point time; Indicates the maximum passenger capacity of the vehicle. represents the total time constraint for picking up passengers by the vehicle, represents the total time constraint of the vehicle for dropping off passengers, Indicates the insertion time constraint; The decision variables for offline vehicle scheduling are: , and ; in, , , , vehicles in offline vehicle scheduling Pickup orders If there is an order ,otherwise ; , , , , vehicles in offline vehicle scheduling Through the arc ,but ,otherwise ; For vehicles in offline vehicle dispatch In the service node moment; , ; in, The point set representing offline vehicle scheduling; ,in , is the set of starting positions of all vehicles that have departed; , is the set of departure points for all orders that have been matched with vehicles but not dispatched; , is the set of destination points for all orders that have been matched with vehicles but not dispatched; The objective function of the offline vehicle scheduling is: ; The constraints of the offline vehicle scheduling are: There is at most one vehicle serving this passenger: ; Decision variable consistency: , ; Passenger pick-up and drop-off points are added to the vehicle path in pairs: ; Vehicle driving route is continuous: , ; The vehicle has to travel a fixed section of highway: ; Order hard time window constraints: ; Total time constraints for picking up and dropping off guests: , ; Insert time constraints: , ; in, Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ; Represents a vehicle that is scheduled offline Through the arc ; Indicates vehicle The city of , ; Represents a vehicle that is scheduled offline In its city The entrance and exit time, , L is the itinerary set; Represents a vehicle that is scheduled offline At the time of the starting position; Represents a vehicle that is scheduled offline In the The real-time location of the order moment, Indicates vehicle Number of orders received; Represents a vehicle that is scheduled offline In the city The entrance and exit moments; Represents a vehicle that is scheduled offline Passed by +1 pick-up point time, Represents a vehicle that is scheduled offline Passed by - 1 pick-up point time; The online vehicle dispatch is based on the nearest insertion algorithm, and matches the dispatched vehicles to the passengers who have placed new orders as follows: A1. Get the new order q and the set of dispatched vehicles in the current intercity carpooling order information ; A2, according to the current vehicle Real-time location of With order Departure place right Sort in ascending order; A3, initialize the drop-off point n=0, the best path is empty; A4, let n=n+1, and when n is not greater than |, using the objective function of online vehicle scheduling, find the order q to insert The path with the least time among the nth vehicles ; A5, Judgment Does it meet the constraints of the online vehicle scheduling? If so, for The path of the nth vehicle in , otherwise proceed to the next iteration, n=n+1; A6, until n equals |When Optimal scheduling solution for online vehicle dispatch; The offline vehicle dispatching matches the undeparted vehicles to the newly ordered passengers through the optimal insertion algorithm as follows: B1, obtain the new order q and the set of vehicles that have not been dispatched in the intercity carpooling order information at the current moment ; B2, initialize the drop-off point n=0, the best path Empty and vehicle x=0; B3, let n=n+1, and when n is not greater than |, find order q and insert it into the set of vehicles that have not been dispatched The most profitable path among the nth vehicles ; B4, Judgment Whether the constraints and objective function of the offline vehicle scheduling are met, and Corresponding feedback to the order Is the time of receiving information better than of, that is ( )> ( ), if so, then x=n, , otherwise proceed to the next iteration, n=n+1; B5, iterate until n is greater than |, determine whether x is 0, if not 0, then The path of vehicle x is updated to , get the best scheduling solution for offline vehicle scheduling; The two-stage scheduling module is used to determine whether to execute the two-stage scheduling model at the current moment based on the Markov decision process and the deep Q learning algorithm; if it is determined that the two-stage scheduling model does not need to be executed at the current moment, this step is skipped, otherwise the two-stage scheduling model is executed, that is, based on the large neighborhood search algorithm, all vehicles that have not been dispatched are matched to all passengers who have not been successfully matched and have not timed out and passengers who have been successfully matched. If the match is successful, the matching success information is fed back to the passenger, and if the match fails, the passenger order is placed in the set of unsuccessfully matched passengers; The information update module is used to update the system information according to the current intercity carpooling order information and vehicle information, and to feedback the license plate information to the passengers picked up by the vehicle at the current time, and output the itinerary information after the vehicle has picked up all passengers.
