A real-time optimization method and device for inter-city dynamic carpooling based on a shared network
Through the real-time optimization method of intercity dynamic carpooling based on the shared network, using geographical coordinate gridding and dynamic planning to optimize routes, the problem of low efficiency in intercity carpooling is solved, the efficiency and service quality of carpooling are improved, and intercity dynamics are optimized. Benefit distribution in carpooling scenarios.
Patent Information
- Application Number
- CN202410745207.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing intercity carpooling technology is inefficient in dynamic real-time scenarios, especially due to the scattered spatiotemporal distribution and large span of intercity travel, which leads to high time complexity in building a shared network. The pruning strategy cannot effectively prune, affecting the speed and speed of network construction. Quality of order service sequence.
A real-time optimization method for intercity dynamic carpooling based on shared networks is used to generate multiple geographical grids through geographic coordinate rasterization, estimate travel time between grids, prune to build a shared network, and define the sharing degree of nodes. And based on dynamic programming preprocessing, the time complexity of path feasibility is reduced and the route construction is optimized.
It has significantly improved the interests of the platform, drivers, and passengers in the intercity dynamic carpooling scenario, improved the carpooling efficiency and order service quality, alleviated the pain points in intercity carpooling, and increased the pick-up rate, full load rate, and profit.
Smart Images

Figure CN118313537B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intercity passenger transport planning, and in particular to a real-time optimization method and device for intercity dynamic carpooling based on a shared network. Background Art
[0002] The intercity carpooling travel mode refers to a fixed online car-hailing fleet managed by a company that runs back and forth between two cities, specifically providing intercity carpooling travel services to users.
[0003] The sharing network quantifies the importance of a passenger in the carpooling problem by judging certain spatiotemporal relationships between two passengers. However, due to the high time complexity of sharing network construction, it is not easy to apply in actual real-time scenarios. Although some subsequent literature has discussed the pruning method of shared travel networks within the city to accelerate the construction of sharing networks, due to the scattered spatiotemporal distribution and large span of inter-city travel, the pruning strategy within the city cannot correctly prune out invalid trip combinations ( Figure 2 An example diagram of the reason why pruning is ineffective is given), which makes the network construction speed still very slow, and a more efficient pruning strategy is needed for network construction. The static model of intercity carpooling has been proposed in 2022; and some scholars have also proposed a neighborhood search algorithm for heuristic solution to this problem. However, in dynamic real-time scenarios, iterative algorithms such as neighborhood search and genetic algorithms (such as CN202310551393.4, CN202311101518.X) are too inefficient. A method widely used in dynamic real-time scenarios is a construction method based on insertion, that is, without changing the original path order, new passenger requests are inserted into the existing vehicle path according to the optimization goal. In real scenarios, due to the low efficiency of the shortest travel time query function, the efficiency of the naive insertion operator is very low. In addition, due to the scattered time and space distribution, large span, and compact capacity of intercity travel, the order in which the orders are served will have a great impact on the quality of the solution. No method has been found to mention a suitable order service construction order method ( Figure 3 An example diagram is given of the effect of different service orders on the quality of the solution).
[0004] In view of this, this application is filed. Summary of the invention
[0005] The present invention provides a method and device for real-time optimization of inter-city dynamic carpooling based on a shared network, which can at least partially improve the above-mentioned problems.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A real-time optimization method for inter-city dynamic carpooling based on a shared network, comprising:
[0008] Acquire a current inter-city travel route, and perform geographic coordinate gridding processing on the current inter-city travel route to obtain a plurality of geographic grids;
[0009] Preprocessing each of the geographic grids to obtain a plurality of coordinate point sets, and estimating the travel time between grids based on the coordinate point sets to generate a travel time estimation value;
[0010] Obtain multiple carpooling order sets TR received by the inter-city carpooling platform, perform sharing network pruning and construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, obtain time complexity, and construct a sharing network SG based on the carpooling order set TR and the time complexity;
[0011] According to the shared network SG, the sum of the weighted out-degree and the weighted in-degree of each node is defined to obtain the shared degree of the node, and a new node sequence is constructed according to the shared degree of each node and the carpooling order set TR, wherein the new node sequence sorts the shared degree of each node in the carpooling order set TR in descending order from large to small;
[0012] Based on the new node sequence, the given route set is preprocessed based on dynamic programming to reduce the time complexity of judging the feasibility of the path. When the constraints are met, the starting point and the end point are inserted to construct the route and obtain the optimized route.
[0013] The present invention also provides a real-time optimization device for inter-city dynamic carpooling based on a shared network, which comprises:
[0014] A geographic coordinate gridding unit, used to obtain a current inter-city travel route and perform geographic coordinate gridding processing on the current inter-city travel route to obtain a plurality of geographic grids;
[0015] The inter-grid travel time estimation unit is used to pre-process each of the geographic grids to obtain a plurality of coordinate point sets, and estimate the inter-grid travel time based on the coordinate point sets to generate a travel time estimation value;
[0016] A shared network pruning construction unit is used to obtain multiple carpooling travel order sets TR received by the inter-city carpooling travel platform, perform shared network pruning construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, obtain time complexity, and construct a shared network SG according to the carpooling travel order set TR and the time complexity;
[0017] A passenger service sequence construction unit based on sharing degree is used to define the sum of the weighted out-degree and the weighted in-degree of each node of the sharing network SG according to the sharing network SG, obtain the sharing degree of the node, and construct a new node sequence according to the sharing degree of each node and the carpooling travel order set TR, wherein the new node sequence sorts the sharing degree of each node in the carpooling travel order set TR in descending order from large to small;
[0018] The dynamic programming and linear insertion operator design unit is used to perform dynamic programming preprocessing on a given route set based on a new node sequence, reduce the time complexity of judging the feasibility of the path, and insert the starting point and the end point to construct the route and obtain the optimized route when the constraints are met.
[0019] In summary, the real-time optimization method for inter-city dynamic carpooling based on a sharing network improves the interests of the platform, drivers, and passengers in the inter-city dynamic carpooling scenario through the pruning construction of the sharing network and the construction of the order service sequence, and can alleviate the pain points in inter-city dynamic carpooling. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of a real-time optimization method for inter-city dynamic carpooling based on a shared network provided by the first embodiment of the present invention;
[0021] Figure 2 It is a schematic diagram of the reason why pruning is invalid provided by the present invention;
[0022] Figure 3 is a schematic diagram of the impact of different service orders provided by the present invention on the quality of the solution;
[0023] Figure 4 is a schematic diagram of the parameter description of the gridded coordinates provided by the present invention;
[0024] Figure 5 It is a schematic diagram of uniformly generating coordinate points in a grid provided by the present invention;
[0025] Figure 6 is a schematic diagram of a pseudo code of the pruning method provided by the present invention;
[0026] Figure 7 is a pseudo code schematic diagram of constructing a passenger service sequence through sharing degree provided by the present invention;
[0027] Figure 8 It is a schematic diagram of the effect of inserting a waypoint on the arrival time provided by the present invention;
[0028] Fig. 9 is a pseudo code schematic diagram of the insertion operator provided by the present invention;
[0029] Fig.10It is a schematic diagram of the experimental results of the comparison of the reception rate provided by the present invention;
[0030] Fig.11 is a schematic diagram of experimental results of full load rate comparison provided by the present invention;
[0031] Fig.12 It is a schematic diagram of the experimental results of profit comparison provided by the present invention;
[0032] Fig.13 Schematic diagram of experimental results of comparison of detour coefficients provided by the present invention;
[0033] Fig.14 It is a module schematic diagram of a real-time optimization device for inter-city dynamic carpooling based on a shared network provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] refer to Figure 1 As shown, the first embodiment of the present invention discloses a real-time optimization method for inter-city dynamic carpooling based on a shared network, which can be executed by a real-time optimization device for inter-city dynamic carpooling based on a shared network (hereinafter referred to as an optimization device), and in particular, executed by one or more processors in the optimization device to implement the following method:
[0036] S101, obtaining a current inter-city travel route, and performing geographic coordinate grid processing on the current inter-city travel route to obtain a plurality of geographic grids;
[0037] Specifically, step S101 includes: obtaining a current inter-city travel route, and performing geographic coordinate gridding on the current inter-city travel route, and the formula is:
[0038]
[0039] Among them, lon is the longitude of the given geographic coordinates, lat is the latitude of the given geographic coordinates, minX represents the real latitude of the lower left corner of the entire rectangular grid area, minY represents the real longitude of the lower left corner of the entire rectangular grid area, maxX represents the real latitude of the upper right corner of the entire rectangular grid area, maxY represents the real longitude of the upper right corner of the entire rectangular grid area, sizeX is the length of each grid, sizeY is the width of each grid, Grid(lon,lat) is the grid number for calculating the given geographic coordinates, To round the result down, x1 is the horizontal coordinate of the given geographic coordinates, and y1 is the vertical coordinate of the given geographic coordinates.
[0040] In this embodiment, for a given inter-city travel route, the formula for the geographic coordinate gridding method is as follows:
[0041]
[0042] Where lon and lat represent the longitude and latitude of a given coordinate, minX and maxX are the starting and ending geographic coordinates of the horizontal coordinate, minX and minY are the starting and ending geographic coordinates of the vertical coordinate; sizeX and sizeY are the length and width of each grid; Grid(lon,lat) means to calculate the corresponding grid number for a given geographic coordinate (lon,lat); Refers to rounding the result down. For this gridding method, a clearer parameter description is as follows Figure 4 shown.
[0043] S102, pre-processing each of the geographic grids to obtain a plurality of coordinate point sets, and estimating the travel time between grids based on the coordinate point sets to generate a travel time estimation value;
[0044] Specifically, step S102 includes: pre-processing each of the geographic grids, uniformly generating g coordinate points, and recording the geographic grid numbered x as ;
[0045] The coordinate point set of g coordinate points is recorded as ,in, is the g-th geographical coordinate point uniformly generated in the geographical grid numbered x;
[0046] The travel time for the geographic grids numbered x and y is estimated using the formula:
[0047]
[0048] in, It is the shortest travel time query function, used to query two real geographic coordinates and The shortest travel time, is the uniformly generated first Geographic coordinate points, is the uniformly generated first Geographic coordinate points.
[0049] In this embodiment, the travel time between any two grids needs to be estimated through offline preprocessing. First, for each geographic grid, g coordinate points need to be uniformly generated. For the grid numbered x, it is recorded as , the set of coordinate points for evenly generating g coordinate points for the grid is recorded as ,in represents a geographic coordinate point, which is the u-th coordinate point uniformly generated in the grid x; then for any two grids numbered x and y, the estimated travel time is shown in the following formula:
[0050]
[0051] in, Is the shortest travel time query function, which is used here to query two real geographic coordinates and The shortest travel time. Figure 5 Shows an example of uniformly generating coordinates in a grid.
[0052] It should be noted that although this method requires calling a large number of travel time query functions tt(), which is very time-consuming, it is completed in the offline stage. After offline processing, the travel time between each two grids is saved. The time complexity of each call to query the travel time between two grids is O(1), because the query is a random access operation of a two-dimensional matrix. In addition, the ttg() function is only used in the pruning construction of the shared network and will not be used in subsequent scheduling, because the grid travel time generated in this way has a certain and irreversible error with the actual situation, which is difficult to ignore in real scheduling.
[0053] In actual use, the shortest travel time query function can be directly obtained by calling an existing interface, such as using Baidu Map API, etc. In this implementation, OSRM (Open Source Routing Machine) is used to directly calculate and obtain.
[0054] S103, obtaining multiple carpooling order sets TR received by the inter-city carpooling platform, performing shared network pruning and construction based on the geographic grid, pruning unreasonable orders in the grid, calculating reasonable orders in the grid, obtaining time complexity, and constructing a shared network SG according to the carpooling order set TR and the time complexity;
[0055] Specifically, step S103 includes: obtaining a plurality of carpooling travel order sets TR received by the inter-city carpooling travel platform, wherein one order is regarded as one trip, and the trip corresponding to the passenger p is , Represents the starting coordinates of the trip, Represents the coordinates of the end point of the trip, The departure city of the trip. represents the expected boarding time for the trip, Represents the latest acceptable drop-off time for the trip, , is the waiting service constraint, is the detour constraint, represents the actual boarding time of the trip, Represents the actual drop-off time of the trip;
[0056] Enumerate all geographic grids, prune unreasonable orders, and calculate reasonable orders within the grid, reducing the time complexity from enumerating all orders for each order to Optimized to enumerate reasonable orders within the grid , where n is the total number of orders in the current time period, K is the large constant for the shortest path query, and m is the total number of grids after gridding;
[0057] Construct a sharing network SG based on the carpooling order set TR and time complexity. , LN is an edge set, where for a shareable trip and , establish the edge Weight , the calculation formula of the edge weight is: , is the ith shareable trip, is the jth sharable trip.
[0058] If it meets the preset time and space rules, it means two trips and It is shareable, and the preset time and space rules are: , a: , b: , c: , d: ; Or, the preset time and space rules are: , a: , b: , c: , d: .
[0059] In this embodiment, the time complexity of violently constructing a shared network is , where n is the total number of orders in the current time period, and K is a large constant for shortest path query, which is not applicable in large-scale instances. The proposed real-time optimization method for inter-city dynamic carpooling based on a sharing network takes into account the sparsity of the sharing network and the scattered spatial and temporal distribution and large span of inter-city travel. A construction method based on grid pruning is proposed to reduce the time complexity to an average of , where m is the total number of grids after gridding. This method is effective because in large-scale instances, the number of grids m must be much smaller than the number of orders n.
[0060] First, let’s briefly explain the definition of a sharing network and the problem of building a sharing network: At a certain moment, the intercity carpooling platform receives a set of carpooling orders TR, each of which is also called a trip. The trip corresponding to passenger p is .in Represents the starting coordinates of the trip; Represents the coordinates of the end point of the trip; The departure city of the trip; represents the expected pickup time for the trip; represents the latest acceptable drop-off time for the trip; The actual boarding time for the trip; Represents the actual drop-off time for the trip. ,in is the waiting service constraint, which is the maximum tolerable time for passenger p from initiating a carpooling request to getting on the car, that is, ; is the detour constraint, which is the maximum detour time that passenger p can tolerate from getting on to getting off the bus, that is, If the passenger Being served, then On the contrary .
[0061] The shared network is denoted as SG, with , is the output of the problem. That is, the sharing network is constructed based on the trip set TR, each trip in TR is a node; LN is the edge set, when and If it meets a certain time-space relationship, it is a node and Create a directed edge , the weight of the directed edge is recorded as For the following two time and space rules, if one of them is met, it means that the two itineraries and It is shareable, and the time and space rules are shown in Table 1 below:
[0062] Table 1 Time and space rules table
[0063]
[0064] For any shareable trip and , directed edge Edge weight The calculation of is shown in the following formula:
[0065]
[0066]
[0067] The method of constructing a shared network by pruning is based on the grid. The basic idea is to enumerate all grids for each order, prune out unreasonable orders, and only calculate reasonable orders within the grid, so that the time complexity is reduced from enumerating all orders for each order to Optimized for .
[0068] Specifically, for the itinerary For , we can know that the acceptable time interval for boarding is , where the grid is , then for any grid x, we can know the travel The time interval to reach grid x is Based on this, according to the definition of acceptable pickup time interval, for any order in grid x, its acceptable pickup time must be consistent with the itinerary The acceptable boarding time interval corresponding to grid x There is an intersection. Then for orders without intersection, they can be directly filtered out without making specific rule judgments. The specific pseudo code diagram of the pruning method is in Figure 6 Given in.
[0069] S104, according to the shared network SG, define the sum of the weighted out-degree and the weighted in-degree of each node, obtain the shared degree of the node, and construct a new node sequence according to the shared degree of each node and the carpooling order set TR, wherein the new node sequence sorts the shared degree of each node in the carpooling order set TR in descending order from large to small;
[0070] Specifically, step S104 includes: according to the shared network SG, defining the sum of the weighted out-degree and the weighted in-degree of each node as the shared degree of the node , the calculation formula of sharing degree is:
[0071]
[0072] in, is the sharing degree, which indicates that the node for which the sharing degree needs to be calculated is , It shows that in the edge set LN of the shared network SG, find all the slave nodes The edge pointing out is called the out-edge. It shows that in the edge set LN of the shared network SG, all the nodes pointing to it are found The edge of is called the in-edge;
[0073] According to the sharing degree of each node and the carpooling order set TR, a new node sequence is constructed , where the new node sequence The new node sequence is obtained by sorting the sharing degree of each node in the carpooling order set TR in descending order from large to small. The sharing degree of the first element in is the largest.
[0074] Based on the new node sequence, the real-time route set of vehicle k , define two arrays and ,in, is the latest arrival time of the rth waypoint, is the actual arrival time of the rth waypoint;
[0075] When the real-time route set of vehicle k is determined The coordinates of the rth waypoint For passengers The latest arrival time of the rth waypoint at the starting point or end point of The calculation formula is:
[0076]
[0077] The actual arrival time of the rth waypoint The calculation formula is:
[0078]
[0079] When a waypoint is inserted after the rth waypoint in the route, the time increment generated With constraints, the formula is:
[0080]
[0081] And transform, the transformation formula is:
[0082]
[0083] Use the relaxation time idea to optimize the constraint judgment process, starting from the last path point and enumerating from the back to the front, any element in the slk array The state transfer equation is:
[0084]
[0085] in, To insert a waypoint after the rth waypoint of the current route, the maximum time increment allowed by inserting the waypoint is stored in the slk array, starting from the last waypoint of the current route and enumerating forward, and the maximum time increment allowed by inserting the waypoint for each waypoint;
[0086] After processing the slk array, the time constraint of the route can be determined within O(1) time complexity;
[0087] At the waypoint Then insert a new waypoint , we only need to determine whether the time added by insertion is greater than , the judgment rules are:
[0088]
[0089] in, For the waypoint Then insert new waypoints The resulting time increment.
[0090] In this embodiment, for the constructed shared network, the sum of the weighted out-degree and weighted in-degree of each node is defined as the shared degree of the node. It is a node (trip) in the shared network SG The sum of the weighted degrees of The calculation of is shown in the following formula:
[0091]
[0092] in Indicates that the nodes whose sharing degree needs to be calculated are ,right Indicates that in the edge set LN of the shared network SG, find all The edge pointing out is called the outgoing edge; for all the outgoing edges found, calculate all the edge weights The sum of is taken as the sum of weighted out-degree. Similarly, Indicates that in the edge set LN of the shared network SG, find all the points The edges found are called in-edges; for all in-edges found, calculate all edge weights The sum of the two is the sum of the weighted in-degree. degree of sharing.
[0093] Construct a new node sequence based on the sharing degree of each node and the original node set TR Node sequence The sharing degree of each node in the original node set TR is sorted in descending order from large to small. The node sequence The sharing degree of the first element in is the largest. Formally speaking, for the node sequence Any subscript within , satisfying the conditions: .
[0094] The platform will follow the node sequence The order of the node elements in the middle is used to serve each passenger, that is, passengers with a large degree of sharing are given priority, that is, passengers with a large degree of sharing are given priority to be inserted into the path of a certain vehicle. Among them, Figure 3 It has been demonstrated that different service sequences bring different benefits to intercity travel. Figure 7 A pseudo code diagram for constructing passenger service sequence by sharing degree is given.
[0095] S105, based on the new node sequence, the given route set is preprocessed based on dynamic programming to reduce the time complexity of judging the feasibility of the path, and the starting point and the end point are inserted to construct the route under the condition that the constraints are met to obtain the optimized route.
[0096] Specifically, step S105 includes: obtaining a set of vehicles operated by the platform under the condition that the constraints are met , where vehicle k corresponds to vehicle , is the real-time geographic coordinates of the vehicle, is the coordinate of vehicle k time, is the real-time passenger number of vehicle k, is the set of trips served by vehicle k in the current trip, , , is the real-time route set of vehicle k, , For real-time route collection The coordinates of the i-th waypoint in , Counting the number of trips served by the vehicle;
[0097] For vehicle k, its vehicle route is abstractly represented as the actual boarding time and the actual alighting time of the passengers. When a set of constraints are met, the vehicle route is considered feasible. The formula is:
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104] Among them, Q is the maximum passenger capacity constraint of the vehicle, Q=6, and the starting point and end point of the passenger are inserted into the real-time route set of vehicle k After that, the new route is generated Total driving time is the smallest among all possible insertions, reducing the time complexity of selecting the optimal insertion position to O(Q), and the total time complexity of the insertion operator is , get the optimal route.
[0105] In this example, consider inserting a passenger into the path of a given vehicle. The time complexity of the naive insertion operator is . Enumerating and searching for the optimal insertion position requires a time complexity of the power of 2, while judging the feasibility of the path requires a time complexity of the power of 1, so a total time complexity of the power of 3 is required. The real-time optimization method for inter-city dynamic carpooling based on a shared network first proposes a method based on dynamic programming. Through preprocessing with a complexity of O(Q), the time complexity of judging the feasibility of the path is reduced to O(1). Then, a method for selecting the insertion position based on greed is proposed, which reduces the time complexity of selecting the optimal insertion position to O(Q), and proves the greedy optimality of this method. The total time complexity of the insertion operator is .
[0106] First, formalize the concepts of vehicles and routes:
[0107] The platform operates a fleet of vehicles that transport passengers from their origin to their destination under given constraints. , the vehicle corresponding to vehicle k .in is the current coordinate of vehicle k; is the coordinate of vehicle k time of day; is the real-time passenger capacity of vehicle k; is the set of trips (passengers) served by vehicle k in the current trip, , and there is . is the real-time route set of vehicle k, , Is a route set The coordinates of the i-th waypoint in ,exist , so that , that is, the waypoint coordinates must be the starting or ending coordinates of a passenger served by the vehicle in the current trip. If the vehicle has already served a waypoint, this waypoint will be deleted from the route set, so there is Number of elements in . is the trip count of the vehicle service. Whenever the vehicle completes the service of the last coordinate in the route, The count is increased by 1.
[0108] For vehicle k, the vehicle route can be abstractly represented as the actual boarding time and the actual alighting time of the passenger. Specifically, the vehicle route is feasible when a set of constraints are met, as shown in the following formula:
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115] The formula is the passenger capacity constraint; the formula Make sure all passengers on the bus are going from the same city to another city; formula Ensure that the passenger boarding time does not exceed the constraint; Formula Ensure that the passenger's getting off time does not exceed the constraint; Formula Ensure that the vehicle visits the passenger pick-up point first, and then the passenger drop-off point; Formula It is an inter-city traffic constraint. It is necessary to ensure that the starting point of the passengers served is unified first, and then the end point of the passengers served is unified. After visiting the end point of a certain passenger, the starting point of any other passenger cannot be visited.
[0116] The optimal position of insertion refers to inserting the passenger's starting and ending points into the route of vehicle k After that, the new route generated Total driving time is the smallest of all possible insertions.
[0117] Next, we introduce a method based on dynamic programming to quickly determine the feasibility of a route with O(1) complexity. For the sake of convenience, for a route , first define two arrays and ,in represents the latest arrival time of the rth waypoint, represents the actual arrival time of the rth waypoint. Just for passengers When the starting point or end point of , the calculation formula is as follows:
[0118]
[0119] for , the calculation formula is as follows:
[0120]
[0121] According to the definition, when a waypoint is inserted after the rth waypoint in the route, the time increment generated is The constraints are as follows:
[0122]
[0123] And can be converted into the following formula:
[0124]
[0125] According to the above formula, the idea of slack time can be used to optimize the constraint judgment process. , you only need to enumerate the route once from back to front, maintain an array slk, and the rth element in the array slk The meaning is: for the current route , if a waypoint is to be inserted after the rth waypoint, what is the maximum time increment allowed for inserting the waypoint? According to the definition of array slk, for the route Any waypoint in To insert a waypoint into a path, Corresponding It is only relevant to the insertion position greater than r, but not to the insertion position less than r. This is because inserting a new waypoint after position r will only affect the waypoints after r, but not the waypoints before r. Figure 8 This feature can be observed intuitively in . In formal terms, this method needs to start from the last waypoint and enumerate from the back to the front. The state transition equation is shown as follows:
[0126]
[0127] After processing the slk array, the time constraints of the route can be determined within O(1) time complexity. Then insert a new waypoint , we only need to determine whether the time added by the insertion is greater than , the judgment rules are as follows:
[0128]
[0129] Among them It means that at the waypoint Then insert new waypoints The time increment generated is related to the definition of slk. The complexity of determining the time constraint is O(1), because it only needs to be calculated according to the formula It can judge whether the waypoints meet the constraints one by one without recalculating the entire path.
[0130] Similarly, the optimal insertion position can be found in O(Q). You only need to find the starting point in the real-time route. The insertion position with the smallest time increment and meeting the time constraint is then found to find the end point The insertion position with the smallest time increment and meeting the time constraints. If the start and end points can be inserted to construct a route while meeting the constraints, then the route is optimal. Fig. 9 This is a pseudo code diagram of the insertion operator.
[0131] In this embodiment, the intercity passenger transport order data of Blue Ocean (Fujian) Information Technology Co., Ltd. is used for numerical simulation to explain the characteristics of the intercity dynamic carpooling real-time optimization method based on the shared network. The selected order information is all order data from July 1 to July 3, 2023 for the Anxi-Xiamen line, with a total of 3292 orders and a total of 60 vehicles, initially 30 vehicles in Anxi and 30 vehicles in Xiamen. The map data comes from OpenStreetMap, and the travel time calculation uses the back-end interface of OSRM (open source route machine).
[0132] All experiments were run on an Ubuntu 20.04 LTS operating system, with a 12th Gen Inteli7-12700(20) @ 2.111GHz processor, an Intel(R) UHD Graphics 770 graphics card, and 32GB of memory. All codes were written using vim 8.1.3741, and compiled and run using Python 3.10.12. The platform started service at 6:00 and ended service at 22:30, with scheduling performed every 15 minutes. After 22:30, no more passengers initiating carpooling trips were accepted, and the overall results were counted after serving all passengers in the current vehicle.
[0133] In terms of the construction of shared networks, the comparison algorithm is the angle-based (i.e., the shared network mainly used in urban shared networks) shared network pruning construction method.
[0134] In terms of real-time optimization of inter-city dynamic carpooling, there are two main algorithms for comparison. One is the traditional order construction method of first come first served, that is, the orders are inserted into the vehicle route in order according to the order in which the orders arrive at the platform; the other is the random order construction method, that is, for a batch of orders, the order is randomly disrupted and the orders are inserted into the vehicle route in order. The experimental parameter settings are shown in Table 2:
[0135] Table 2 Experimental parameter settings
[0136]
[0137] The evaluation indicators of grid-based shared network pruning construction include accuracy and time, where the complete shared network (i.e., the shared network constructed by brute force method) is recorded as , as shown in Table 3:
[0138] Table 3 Evaluation index table of shared network pruning construction
[0139]
[0140] The evaluation indicators of real-time optimization of inter-city dynamic carpooling based on sharing network are shown in Table 4:
[0141] Table 4 Evaluation index table of real-time optimization of inter-city dynamic carpooling
[0142]
[0143] in Both represent sets Length.
[0144] The experimental results of grid-based shared network pruning construction are shown in Table 5:
[0145] Table 5 Experimental results of shared network pruning construction
[0146]
[0147] The experimental results of real-time optimization of inter-city dynamic carpooling based on sharing degree order are shown in Table 6:
[0148] Table 6 Experimental results of real-time optimization of inter-city dynamic carpooling
[0149]
[0150] In addition, since the platform's fleet size (i.e., the number of vehicles) will affect the experimental results from the supply and demand aspects, the present invention also observed the impact of different methods on the experimental results when the number of vehicles was 40 (the most scarce capacity), 50, 60, 70, and 80 (the most abundant capacity). Fig.10 Average full load factor Fig.11 Total profit see Fig.12 ; Average detour coefficient see Fig.13 .
[0151] By analyzing the experimental results, it can be found that the grid pruning method proposed in this invention is superior to the angle-based pruning method in terms of time and accuracy. The inter-city dynamic carpooling real-time optimization method based on sharing degree order proposed in this invention achieves better scheduling results than other methods regardless of whether the transportation capacity is in short supply or in sufficient capacity. Figure 10 to Figure 11 , it can be found that: (1) As the number of vehicles increases, the pick-up rate shows an upward trend. However, the pick-up rate of the method of the present invention is the highest, which is about 5% higher than the traditional first-come-first-served method on average. In the implementation case, an average of 164 more passengers were served; (2) As the number of vehicles increases, the full load rate shows a downward trend. However, the full load rate of the method of the present invention is the highest. From a numerical analysis, when vehicle resources are relatively limited, each vehicle can carry about 0.4 more passengers; when vehicle resources are relatively abundant, each vehicle can carry about 0.2 more passengers; (3) As the number of vehicles increases, the interest rate shows an upward trend. However, the profit of the method of the present invention is the highest, which is about 7,150 yuan higher than the traditional first-come-first-served method on average; (4) When using the sharing degree for pre-sorting, the detour coefficient is 0.01~0.02 smaller than other methods. In this example, it means that each driver can reduce the working time by about 67~134 minutes and each passenger can reduce the riding time by 4~8 minutes.
[0152] In short, compared with the traditional first-come, first-served method, (1) (2) (3) illustrate that the platform interests are improved under the real-time optimization method of inter-city dynamic carpooling based on a sharing network, and (4) illustrate that the interests of passengers and drivers are improved under the method of the present invention.
[0153] Specifically, the inter-city dynamic carpooling real-time optimization method based on a shared network of the present invention can alleviate the pain points in inter-city dynamic carpooling. The inter-city dynamic carpooling real-time optimization method based on a shared network of the present invention simultaneously improves the interests of the platform, drivers, and passengers in the inter-city dynamic carpooling scenario through the pruning construction of the shared network and the construction of the order service sequence.
[0154] See also Fig.14 The second embodiment of the present invention further provides a real-time optimization device for inter-city dynamic carpooling based on a shared network, which includes:
[0155] The geographic coordinate gridding unit 201 is used to obtain the current inter-city travel route and perform geographic coordinate gridding processing on the current inter-city travel route to obtain multiple geographic grids;
[0156] The inter-grid travel time estimation unit 202 is used to pre-process each of the geographic grids to obtain a plurality of coordinate point sets, and estimate the inter-grid travel time based on the coordinate point sets to generate a travel time estimation value;
[0157] A shared network pruning construction unit 203 is used to obtain multiple carpooling order sets TR received by the inter-city carpooling travel platform, perform shared network pruning construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, obtain time complexity, and construct a shared network SG according to the carpooling order set TR and the time complexity;
[0158] The sharing-degree-based passenger service sequence construction unit 204 is used to define the sum of the weighted out-degree and the weighted in-degree of each node of the sharing network SG, obtain the sharing degree of the node, and construct a new node sequence according to the sharing degree of each node and the carpooling travel order set TR, wherein the new node sequence sorts the sharing degree of each node in the carpooling travel order set TR in descending order from large to small;
[0159] The dynamic programming and linear insertion operator design unit 205 is used to perform dynamic programming preprocessing on a given route set based on a new node sequence, reduce the time complexity of judging the feasibility of a path, and insert the starting point and the end point to construct a route to obtain an optimized route when the constraints are met.
[0160] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A real-time optimization method for inter-city dynamic carpooling based on a shared network, characterized in that: include: Acquire a current inter-city travel route, and perform geographic coordinate grid processing on the current inter-city travel route to obtain a plurality of geographic grids; Preprocessing each of the geographic grids to obtain a plurality of coordinate point sets, and estimating the travel time between grids based on the coordinate point sets to generate a travel time estimation value; Obtain multiple carpooling order sets TR received by the inter-city carpooling platform, perform sharing network pruning and construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, obtain time complexity, and construct a sharing network SG based on the carpooling order set TR and the time complexity; According to the shared network SG, the sum of the weighted out-degree and the weighted in-degree of each node is defined to obtain the shared degree of the node, and a new node sequence is constructed according to the shared degree of each node and the carpooling order set TR, wherein the new node sequence sorts the shared degree of each node in the carpooling order set TR in descending order from large to small; Based on the new node sequence, the given route set is preprocessed based on dynamic programming to reduce the time complexity of judging the feasibility of the path, and the starting point and the end point are inserted to construct the route to obtain the optimized route when the constraints are met; Get multiple carpooling order sets TR received by the inter-city carpooling platform, and perform shared network pruning construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, and obtain the time complexity, which is specifically: Get multiple carpooling travel order sets TR received by the intercity carpooling travel platform, where one order is regarded as one trip, and the trip corresponding to passenger p is , Represents the starting coordinates of the trip, Represents the coordinates of the end point of the trip, The departure city of the trip. represents the expected boarding time for the trip, Represents the latest acceptable drop-off time for the trip, , is the waiting service constraint, is the detour constraint, represents the actual boarding time of the trip, Represents the actual drop-off time of the trip; Enumerate all geographic grids, prune unreasonable orders, and calculate reasonable orders within the grid, reducing the time complexity from enumerating all orders for each order to Optimized to enumerate reasonable orders within the grid , where n is the total number of orders in the current time period, K is the large constant for the shortest path query, and m is the total number of grids after gridding; Construct a sharing network SG based on the carpooling order set TR and time complexity. , LN is an edge set, where for a shareable trip and , establish the edge Weight , the calculation formula of the edge weight is: , is the ith shareable trip, is the jth sharable trip; According to the shared network SG, the sum of the weighted out-degree and the weighted in-degree of each node is defined to obtain the shared degree of the node, and a new node sequence is constructed according to the shared degree of each node and the carpooling order set TR, wherein the new node sequence sorts the shared degree of each node in the carpooling order set TR in descending order from large to small, specifically: According to the shared network SG, the sum of the weighted out-degree and the weighted in-degree of each node is defined as the shared degree of the node. , the calculation formula of sharing degree is: in, is the sharing degree, which indicates that the node for which the sharing degree needs to be calculated is , It shows that in the edge set LN of the shared network SG, find all the slave nodes The edge pointing out is called the out-edge. It shows that in the edge set LN of the shared network SG, all the nodes pointing to it are found The edge of is called the in-edge; According to the sharing degree of each node and the carpooling order set TR, a new node sequence is constructed , where the new node sequence The new node sequence is obtained by sorting the sharing degree of each node in the carpooling order set TR in descending order from large to small. The sharing degree of the first element in is the largest; Based on the new node sequence, the given route set is preprocessed based on dynamic programming to reduce the time complexity of judging the feasibility of the path. Specifically: Based on the new node sequence, the real-time route set of vehicle k , define two arrays and ,in, is the latest arrival time of the rth waypoint, is the actual arrival time of the rth waypoint; When the real-time route set of vehicle k is determined The coordinates of the rth waypoint For passengers The latest arrival time of the rth waypoint at the starting point or end point of The calculation formula is: The actual arrival time of the rth waypoint The calculation formula is: When a waypoint is inserted after the rth waypoint in the route, the time increment generated With constraints, the formula is: And transform, the transformation formula is: Use the relaxation time idea to optimize the constraint judgment process, starting from the last path point and enumerating from the back to the front, any element in the slk array The state transfer equation is: in, To insert a waypoint after the rth waypoint of the current route, the maximum time increment allowed by inserting the waypoint is stored in the slk array, starting from the last waypoint of the current route and enumerating forward, and the maximum time increment allowed by inserting the waypoint for each waypoint; After processing the slk array, the time constraint of the route can be determined within O(1) time complexity; At the waypoint Then insert a new waypoint , we only need to determine whether the time added by insertion is greater than , the judgment rules are: in, For the waypoint Then insert new waypoints The resulting time increment; When the constraints are met, insert the start and end points to construct the route and obtain the optimized route, which is as follows: Obtain the vehicle collection operated by the platform while meeting the constraints , where vehicle k corresponds to vehicle , is the real-time geographic coordinates of the vehicle, is the coordinate of vehicle k time, is the real-time passenger number of vehicle k, is the set of trips served by vehicle k in the current trip, , , is the real-time route set of vehicle k, , For real-time route collection The coordinates of the i-th waypoint in , Counting the number of trips served by the vehicle; For vehicle k, its vehicle route is abstractly represented as the actual boarding time and the actual alighting time of the passengers. When a set of constraints are met, the vehicle route is considered feasible. The formula is: Among them, Q is the maximum passenger capacity constraint of the vehicle, Q=6, and the starting point and end point of the passenger are inserted into the real-time route set of vehicle k After that, the new route is generated Total driving time is the smallest among all possible insertions, reducing the time complexity of selecting the optimal insertion position to O(Q), and the total time complexity of the insertion operator is , get the optimal route.
2. The real-time optimization method for inter-city dynamic carpooling based on a shared network according to claim 1 is characterized in that: The current intercity travel route is obtained, and the current intercity travel route is subjected to geographic coordinate gridding processing to obtain multiple geographic grids, specifically: The current intercity travel route is obtained, and the geographic coordinate grid of the current intercity travel route is converted into the following formula: Among them, lon is the longitude of the given geographic coordinates, lat is the latitude of the given geographic coordinates, minX represents the real latitude of the lower left corner of the entire rectangular grid area, minY represents the real longitude of the lower left corner of the entire rectangular grid area, maxX represents the real latitude of the upper right corner of the entire rectangular grid area, maxY represents the real longitude of the upper right corner of the entire rectangular grid area, sizeX is the length of each grid, sizeY is the width of each grid, Grid(lon,lat) is the grid number for calculating the given geographic coordinates, To round the result down, x1 is the horizontal coordinate of the given geographic coordinates, and y1 is the vertical coordinate of the given geographic coordinates.
3. The real-time optimization method for inter-city dynamic carpooling based on a shared network according to claim 2 is characterized in that: Preprocess each of the geographic grids to obtain a plurality of coordinate point sets, and estimate the travel time between grids based on the coordinate point sets to generate a travel time estimation value, specifically: Each of the geographic grids is preprocessed to generate g coordinate points uniformly, and the geographic grid numbered x is recorded as ; The coordinate point set of g coordinate points is recorded as ,in, is the g-th geographical coordinate point uniformly generated in the geographical grid numbered x; The travel time for the geographic grids numbered x and y is estimated using the formula: in, It is the shortest travel time query function, used to query two real geographic coordinates and The shortest travel time, is the uniformly generated first Geographic coordinate points, is the uniformly generated first Geographic coordinate points.
4. The real-time optimization method for inter-city dynamic carpooling based on a shared network according to claim 3 is characterized in that: If it meets the preset time and space rules, it means two trips and It is shareable, and the preset time and space rules are: , a: , b: , c: , d: ; Alternatively, the preset time and space rules are: , a: , b: , c: , d: .
5. A real-time optimization device for dynamic inter-city carpooling based on a shared network, used to implement a real-time optimization method for dynamic inter-city carpooling based on a shared network as claimed in claim 1, characterized in that: include: A geographic coordinate gridding unit, used to obtain a current inter-city travel route and perform geographic coordinate gridding processing on the current inter-city travel route to obtain a plurality of geographic grids; The inter-grid travel time estimation unit is used to pre-process each of the geographic grids to obtain a plurality of coordinate point sets, and estimate the inter-grid travel time based on the coordinate point sets to generate a travel time estimation value; A shared network pruning construction unit is used to obtain multiple carpooling travel order sets TR received by the inter-city carpooling travel platform, perform shared network pruning construction based on the geographic grid, prune unreasonable orders in the grid, calculate reasonable orders in the grid, obtain time complexity, and construct a shared network SG according to the carpooling travel order set TR and the time complexity; A passenger service sequence construction unit based on sharing degree is used to define the sum of the weighted out-degree and the weighted in-degree of each node of the sharing network SG according to the sharing network SG, obtain the sharing degree of the node, and construct a new node sequence according to the sharing degree of each node and the carpooling travel order set TR, wherein the new node sequence sorts the sharing degree of each node in the carpooling travel order set TR in descending order from large to small; The dynamic programming and linear insertion operator design unit is used to perform dynamic programming preprocessing on a given route set based on a new node sequence, reduce the time complexity of judging the feasibility of the path, and insert the starting point and the end point to construct the route and obtain the optimized route when the constraints are met.
