Real-time ride sharing order optimization method and device, electronic equipment and storage medium

By using a spatiotemporal partitioning statistical model and dynamic programming, an effective candidate set of vehicles is generated, which solves the contradiction between the high computational complexity and real-time performance of the carpooling system. This enables carpooling services to achieve second-level response and efficient matching, thereby improving the carpooling success rate and reducing empty mileage.

CN122222241APending Publication Date: 2026-06-16BEIJING BAIJU YIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610170122.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-05
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing carpooling systems have high computational complexity when matching new orders, which cannot meet the real-time requirement of second-level response, resulting in a large number of potential carpooling opportunities being wasted and serious waste of computing resources.

Method used

Using a spatiotemporal partitioning statistical model, a valid candidate set of vehicles is generated based on historical order data. Through dynamic programming, the vehicle and route with the lowest overall cost are found for new orders within seconds. Matching and route planning are performed using future revenue considerations to avoid blind searching.

Benefits of technology

It achieved second-level response for carpooling services, increased the carpooling success rate by 5%-15%, reduced the total empty mileage of the system by 3%-10%, and optimized the efficiency of computing resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222241A_ABST
    Figure CN122222241A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of online car-hailing passenger transport services, and provides a real-time ride-sharing order optimization method and device, electronic equipment and a storage medium. The method comprises the following steps: in response to receiving a new order, obtaining a current position of the new order; inputting parameters of the new order into a space-time partition statistical model to obtain historical order data of a region where the current position is located; calculating comprehensive costs of planning new routes by each candidate vehicle in an effective candidate set of the region where the current position is located according to the historical order data; determining a candidate vehicle corresponding to the minimum comprehensive cost as a target vehicle, and matching the target vehicle with the new order. The real-time ride-sharing order optimization method solves the contradiction between high global optimization complexity and the contradiction between time-consuming calculation and real-time business requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ride-hailing passenger transport service technology, and in particular to a method, apparatus, electronic device, and storage medium for optimizing real-time carpooling orders. Background Technology

[0002] Ride-hailing and carpooling services are an important mode of transportation that has developed from ride-hailing platforms in the context of the sharing economy and smart mobility. Carpooling services match passengers with similar routes and travel times, meeting basic travel needs while improving vehicle utilization, reducing the cost of a single trip, and alleviating road traffic congestion.

[0003] Existing carpooling systems commonly use greedy algorithms and batch matching algorithms to match new orders. Greedy algorithms immediately match orders with the most convenient vehicle along the current route, prioritizing the fastest or shortest path to the destination. This logic contradicts the carpooling business's goal of maximizing matching efficiency and increasing the success rate of rides. Batch matching algorithms accumulate a small batch of orders before processing them in bulk. However, batch matching introduces a delay due to accumulated orders, and its computational complexity increases dramatically with the number of orders, especially during peak hours in large cities, resulting in significant computational time consumption.

[0004] Carpooling systems typically passively wait for ride-sharing orders along the same route, resulting in a large number of potential carpooling opportunities being wasted. Carpooling systems need to blindly search in a huge global solution space, which wastes a lot of computing resources. They cannot obtain the globally optimal matching and path combination, and cannot meet the real-time requirements of carpooling services for second-level response. Summary of the Invention

[0005] The purpose of this application is to solve the aforementioned technical problems by providing a real-time carpooling order optimization method, apparatus, electronic device, and computer-readable storage medium, thereby resolving the contradiction between the high computational complexity of global optimization and the real-time requirements of business operations. To achieve the above objective, the technical solution of this application is as follows: In a first aspect, this application provides a real-time carpooling order optimization method, including: in response to receiving a new order, obtaining the current location of the new order; inputting the parameters of the new order into a spatiotemporal partitioning statistical model to obtain historical order data of the area where the current location is located; calculating the comprehensive cost of planning a new route for each candidate vehicle in the effective candidate set of the area where the current location is located based on the historical order data; determining the candidate vehicle corresponding to the minimum comprehensive cost as the target vehicle, and matching the target vehicle with the new order.

[0006] Secondly, this application provides a real-time carpooling order optimization device, comprising: a receiving module for receiving new orders and obtaining the current location of the new orders; a dynamic programming module for inputting the parameters of the new orders into a spatiotemporal partitioning statistical model to obtain historical order data of the area where the current location is located; a calculation module for calculating the comprehensive cost of planning a new route for each candidate vehicle in the effective candidate set of the area where the current location is located based on the historical order data; and a processing module for determining the candidate vehicle corresponding to the minimum comprehensive cost as the target vehicle, and matching the target vehicle with the new order.

[0007] Thirdly, this application provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-described real-time carpooling order optimization method.

[0008] Fourthly, this application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the above-described real-time carpooling order optimization method.

[0009] Compared with existing technologies, the advantages of the real-time carpooling order optimization method, apparatus, electronic device, and computer-readable storage medium of this application are mainly reflected in: A spatiotemporal partitioning statistical model based on historical order data provides predictive prior knowledge guidance for subsequent comprehensive cost calculation. By incorporating future revenue considerations into the comprehensive cost calculation, the model searches for candidate vehicles and plans new routes within the effective candidate set during vehicle and order matching and route planning. This avoids blindly searching the vast global solution space, which would otherwise result in significant waste of computational resources.

[0010] By using a spatiotemporal partitioning statistical model to generate an effective candidate set of vehicles, and employing dynamic programming, the system can find the vehicle and route with the lowest overall cost for a new order within seconds, thus resolving the contradiction between the high computational complexity of global optimization and the real-time requirements of business operations. Attached Figure Description

[0011] Figure 1 A flowchart illustrating a real-time carpooling order optimization method provided for embodiments of this application; Figure 2 A flowchart illustrating another real-time carpooling order optimization method provided for an embodiment of this application; Figure 3 This is a schematic diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0013] It should be noted that in the description of this application, the term "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence. The terms "S1," "S2," etc., are used only for descriptive purposes of steps and do not specifically refer to an order or sequence, nor are they intended to limit this application; they are merely for the convenience of describing the method of this application and should not be construed as indicating the order of steps.

[0014] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0015] This embodiment provides a real-time carpooling order optimization method. It intelligently trims the search space using historical statistical patterns, decomposing the global problem into sub-problems that can be solved in real time, thereby achieving second-level real-time response for carpooling services. This method can be applied to the application environment of carpooling systems, specifically for ride-hailing services. Carpooling refers to the ability of a vehicle to accept new orders even when there are empty seats, enabling multiple passengers to share vehicle resources and split costs. Specifically, drivers accept orders through their terminals, and passengers place orders through their terminals. The terminals communicate with the carpooling system via a network. Terminals can be, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices.

[0016] In related technologies, carpooling systems use greedy algorithms, where vehicle navigation routes are planned solely based on the fastest or shortest path to the destination. This approach contradicts the goal of maximizing matching efficiency and increasing the success rate of carpooling services. Carpooling systems passively wait for rides along the same route instead of actively guiding vehicles to areas with a high probability of orders, resulting in a significant waste of potential carpooling opportunities. When new orders appear, the matching process lacks intelligent guidance, requiring a blind search within a vast global solution space, leading to severe waste of computational resources and difficulty in finding the globally optimal combination of matches and paths. Attempting to find the globally optimal solution by exhaustively enumerating all possible vehicle, order, and path combinations would result in an explosive increase in the number of possible combinations, causing enormous computational demands that cannot meet the real-time requirements of second-level response in carpooling services. This embodiment addresses these issues by optimizing real-time carpooling orders, thereby achieving the real-time requirement of second-level response for carpooling services.

[0017] like Figure 1 As shown, a method for optimizing real-time carpooling orders includes the following steps: S3. In response to receiving a new order, obtain the current location of the new order.

[0018] S4. Input the parameters of the new order into the spatiotemporal partitioning statistical model to obtain the historical order data of the current location area.

[0019] S5. Based on historical order data, calculate the comprehensive cost of planning a new route for each candidate vehicle in the valid candidate set of the current location area.

[0020] S6. Determine the candidate vehicle corresponding to the minimum comprehensive cost as the target vehicle, and match the target vehicle with the new order.

[0021] For example, when a ride-sharing system receives a new order, it can determine the current location of the new order, such as its coordinates. The coordinates of the new order are input into a spatiotemporal zoning statistical model, which includes a future short-term demand heatmap and a regional travel time reference map. These maps can be displayed using a multidimensional lookup table for real-time access by the ride-sharing system. The future short-term demand heatmap shows the ride-hailing demand status within a region; the regional travel time reference map shows the traffic congestion situation within the region.

[0022] By determining the effective candidate set of the current location area, a suitable range can be effectively delineated for candidate vehicles, greatly reducing computational complexity. At the same time, the effective candidate set is selected from potentially high-demand areas. The carpooling system does not passively wait for vehicles going in the same direction, but actively guides vehicles to these areas with carpooling demand, maximizing the discovery of a large number of potential carpooling opportunities.

[0023] Planning new routes takes into account the overall cost. Within an acceptable range of additional time and distance, proactively selecting routes through areas with potential demand for ride-sharing can greatly increase the probability of matching new orders. Selecting the vehicle with the lowest overall cost to match with new orders can both ensure the ride-sharing success rate and reduce the total empty mileage of the ride-sharing system.

[0024] The optimization method utilizes a spatiotemporal partitioning statistical model based on historical order data to generate short-term demand heatmaps and regional travel time reference maps, providing predictive prior knowledge guidance for subsequent comprehensive cost calculations. Incorporating future revenue considerations into the comprehensive cost calculation, when matching vehicles and orders and planning routes, it searches for candidate vehicles and plans new routes within the effective candidate set, avoiding blind searching in a vast global solution space that wastes significant computational resources. Historical order data is transformed into predictions of future carpooling probabilities and used for proactive route planning to find the globally optimal vehicle matching and route combination for the carpooling system. By using the spatiotemporal partitioning statistical model to generate an effective candidate set of vehicles and employing dynamic programming, it finds the vehicle and route with the minimum comprehensive cost for new orders within seconds, resolving the contradiction between the high computational complexity of global optimization and the real-time requirements of business needs.

[0025] In one specific implementation, such as Figure 1 , Figure 2 As shown, the response before receiving a new order also includes: S1. Obtain the current city's area and perform geographic coordinate gridding to obtain multiple geographic grids.

[0026] For example, the H3 Geo grid system is used to divide the urban area, employing an 8-level grid with hexagonal sides approximately 500m long. The H3 Geo grid system approximates the Earth's surface as a set of continuous, non-overlapping hexagonal grids, and achieves multi-scale spatial representation from coarse to fine through a hierarchical structure. Each hexagonal cell has a unique index code for efficient representation and retrieval of geographic locations. Geographic coordinates are gridded to obtain multiple geographic grids, providing a partitioning basis for constructing a spatiotemporal zoning statistical model.

[0027] S2. Obtain historical order data and vehicle trajectory data of ride-hailing services, map them to various grids, and calculate the historical average order density and historical average travel time in each geographical grid to construct a spatiotemporal zoning statistical model.

[0028] For example, the historical average order density and historical average travel time are calculated for each grid, using a 24-hour period as the unit, hourly. The historical average order density and historical average travel time records for each grid are stored in a multidimensional lookup table, which can be accessed at any time. Historical average order density: the number of orders generated per square kilometer per minute within a geographic grid during the corresponding time period. Historical average travel time: the average travel time for vehicles within a geographic grid to reach adjacent geographic grids. By determining the level of historical average order density, the heat value of a geographic grid can be determined, i.e., whether the geographic grid is a high-demand area; a higher heat value indicates higher demand. By determining the level of historical average travel time, it can be determined whether a geographic grid is congested during the corresponding time period; a higher historical average travel time indicates more congested traffic during the corresponding time period.

[0029] Historical order data includes trip and time data for each order, specifically mileage, pick-up point, drop-off point, speed, and travel time. Vehicle trajectory data includes the vehicle's route. The spatiotemporal zoning statistical model can predict the average order density and average travel time for future time periods using a geographic grid. Referencing historical average order density and average travel time allows for accurate estimation. For example, if the historical time period is 1 PM to 2 PM, and the historical average order density for the geographic grid is 8 orders / km²·min, and the historical average travel time is 2 minutes, then the estimated future time period is also 1 PM to 2 PM, with an average order density of 8 orders / km²·min and an average travel time of 2 minutes.

[0030] In the spatiotemporal partitioning statistical model, the historical order data and vehicle trajectory data of ride-hailing vehicles are updated regularly, such as daily or every other day. This makes the average order density and average travel time of the geographic grid in the future period closer to the real data, and can provide more accurate data support.

[0031] In one specific implementation, the parameters of the new order are input into a spatiotemporal partitioning statistical model to obtain historical order data for the region where the current location is located, including: S41. Input the departure location of the new order into the spatiotemporal partition statistical model to obtain the historical average order density of the departure location of the new order in the geographic grid within the current time period and the preset range.

[0032] The parameters for a new order include its departure and destination locations. The preset range is a geographic grid within a 3km-4km radius of the departure location. The carpooling system queries a spatiotemporal zoning statistical model to obtain the historical average order density of the geographic grid within the preset range for the current time period, thus initially defining the selectable range of valid candidate sets.

[0033] In one specific implementation, based on historical order data, the comprehensive cost of planning a new route for each candidate vehicle in the valid candidate set for the current location area is calculated, including: S42. Based on the historical average order density of the geographic grid in the current location area, select geographic grids whose historical average order density meets the first preset condition and the preset number as potential demand geographic grids.

[0034] S43. Select vehicles that meet the second preset condition in the potential demand geographic grid as candidate vehicles and generate a valid candidate set for new orders.

[0035] S44. Obtain the original route of each candidate vehicle in the valid candidate set, insert the departure point and destination point of the new order into the original route of each candidate vehicle to obtain multiple new routes, and generate a new route sequence.

[0036] S45. Calculate the total cost of each new route in the new route sequence.

[0037] Furthermore, the geographic grids that meet the first preset condition and the preset number include: a preset number of geographic grids whose historical average order density is arranged in descending order. For example, the top 10 geographic grids with the highest historical average order density are selected as potential demand geographic grids, which are understood as having hidden potential for successful carpooling. A route that passes through a potentially hot area is proactively selected to create future carpooling opportunities.

[0038] Furthermore, vehicles that meet the second preset condition include at least one of the following: currently driving towards a potential demand geographic grid and being idle, currently being idle in a potential demand geographic grid and having available spaces; and the angle between the vehicle's current driving direction and the direction in which the destination of the new order points is less than a preset angle.

[0039] Among them, vehicles that meet the second preset condition are those that can travel to or are currently in a potential demand geographic grid, and that are capable of carpooling. These vehicles may be empty and ready to accept new orders; or they may be carrying passengers and ready to accept new orders. For example, a vehicle with a passenger capacity of 3 people can be a candidate vehicle if it is empty, in a potential demand geographic grid, and ready to accept new orders at any time; or if it is transporting its first passenger to the destination of its original route, and the original route passes through a potential demand geographic grid; or if it is transporting its second passenger to the destination of its original route, and the original route passes through a potential demand geographic grid; or if it is nearing the end of its previous order and is transporting its last passenger to the destination of its original route, and the original route passes through a potential demand geographic grid.

[0040] The potential demand geographic grid may also contain original routes that deviate significantly from the destination of the new order. Indiscriminately including these vehicles as candidate vehicles could cause significant deviations from the original routes, negatively impacting the passenger experience. Therefore, vehicles meeting the second preset condition are selected from the potential demand geographic grid as candidate vehicles. The angle between the vehicle's current direction of travel and the direction of the new order's destination is less than a preset angle, which is 45°-60°. Generating a valid candidate set for new orders reduces the computational load from tens of thousands of vehicles across the entire city area to dozens, significantly reducing the time spent searching for candidate vehicles and improving the subsequent calculation time for overall costs.

[0041] In one specific implementation, the original route of each candidate vehicle in the valid candidate set is obtained, and the departure and destination points of the new order are inserted into the original route of each candidate vehicle to generate a new route sequence, including: S441. If the candidate vehicle is an idle vehicle currently traveling toward or within a potential demand geographic grid, then the candidate vehicle's original destination is the departure point of the new order, and the candidate vehicle's original route is from the current departure point to the departure point of the new order.

[0042] For example, if the candidate vehicle's original departure point (current departure point) is A, the candidate vehicle's original destination point and the new order's departure point are both B, and the new order's destination point is C, a new route is generated that passes through A, B, and C in sequence. Multiple route combinations can be derived between A, B, and C based on feasible routes, generating a new route sequence.

[0043] S442. If the candidate vehicle is already carrying passengers and can accept new orders, then the candidate vehicle's original route is the current driving route.

[0044] Among them, the current travel route of vehicles already carrying passengers is a planned route.

[0045] S443. Insert the departure and destination points of the new orders into the original routes of each candidate vehicle. Multiple feasible new routes are generated for each candidate vehicle, resulting in a new route sequence.

[0046] When there are multiple passengers in a candidate vehicle, each with a different destination, different route combinations will occur when the last empty vehicle is used as the final destination. Therefore, multiple feasible new routes are generated for each candidate vehicle. A carpooling service is considered successful when all passengers in the vehicle have been delivered, and the next round of carpooling can continue.

[0047] In one specific implementation, the formula for calculating the comprehensive cost TC is: TC = C - λ F, Where C represents direct cost, in minutes, and the value of C is less than 10; λ represents weighting coefficient, and the value of λ ranges from 0.1 to 10; F represents future potential revenue, in the number of orders per square kilometer per minute.

[0048] Direct cost is calculated by subtracting the estimated total travel time of the original route from the estimated total travel time of the new route, and is used to measure the immediate time loss caused by inserting a new order. By calling the spatiotemporal partitioning statistical model, the historical average travel time of the new route and the original route in the current time period is queried to obtain the estimated total travel time of the new route and the original route.

[0049] If the direct cost of the new route is greater than or equal to 10, the candidate vehicle continues to wait for the next new order. If the direct cost of the new route is less than 10, the calculation continues. When the direct cost of the new route is less than 10, to ensure the user experience of each passenger and avoid excessively long waiting times.

[0050] The potential future benefit is to determine the geographic grid that a candidate vehicle reaches after completing a new route and releasing an empty seat, and then being able to take on the next new order. The parameters of the target grid are input into a spatiotemporal partitioning statistical model to obtain the historical average order density of the geographic grid that the target grid will be mapped to in the future time period.

[0051] By calling a spatiotemporal partitioning statistical model, the historical average order density of the target grid in future time periods is queried. For example, if it takes 30 minutes for a candidate vehicle to travel from its current geographic grid to the target grid, the historical average order density of the target grid in the future time period 30 minutes from now is determined. The higher the historical average order density value, the greater the potential for successful carpooling.

[0052] The value of λ ranges from 0.1 to 10. λ is an adjustable weighting coefficient representing the platform's emphasis on "future revenue." The lower limit of λ (λ=0.1) indicates that the platform is very "conservative" or prioritizes "passenger experience." The system will only consider taking a detour if a 1-minute detour results in at least a 10-unit increase in average order density, which is almost a regression to the traditional shortest path strategy. The upper limit of λ (λ=10.0) indicates that the platform is very "aggressive" or prioritizes "competition rate." The platform is willing to accept a 1-minute detour as long as the average order density increases by 0.1 units, which will lead to a large number of vehicles converging on hotspot areas, causing congestion.

[0053] Furthermore, calculating the comprehensive cost of each new route in the new route sequence includes: S451. Set the baseline range of λ to 4-6; understandably, the preset travel time in the geographic grid is the average time for a vehicle to pass through the geographic grid at normal driving speed, and the road conditions in the geographic grid are during off-peak hours.

[0054] S452. Obtain the historical average travel time of the geographic grids traversed by each new route in the corresponding time period, and determine the geographic grids whose historical average travel time is greater than the preset travel time as congested geographic grids. When the proportion of congested geographic grids to all geographic grids traversed by the new route exceeds the preset ratio, the value of λ is set to be less than 4.

[0055] The value of λ is lowered compared to the lower limit of the baseline range because the direct costs of vehicles are high and unstable under congested road conditions, and the volatility is large. It is not advisable to sacrifice too many certain costs for uncertain future benefits.

[0056] S453. Obtain the historical average travel time of the geographic grids traversed by each new route in the corresponding time period, and determine the geographic grids with historical average travel time less than the preset travel time as overcapacity geographic grids. When the proportion of overcapacity geographic grids to all geographic grids traversed by the new route exceeds the preset ratio, then set the value of λ to be greater than 6.

[0057] At this point, the value of λ is increased compared to the upper limit of the baseline range because the cost of empty driving for candidate vehicles is high, and actively detouring to high-heat areas can significantly improve the efficiency of the carpooling system.

[0058] The preset ratio can be set to 60%-70%.

[0059] Furthermore, calculating the comprehensive cost of each new route in the new route sequence also includes: S454. Obtain real-time traffic data from the congestion geographic grid. Based on the real-time traffic data, determine the road congestion index. The higher the road congestion index, the smaller the value of λ should be.

[0060] S454. Obtain real-time traffic data of the geographic grid with excess capacity. Based on the real-time traffic data, determine the road capacity excess index. The higher the road capacity excess index, the larger the value of λ should be.

[0061] Real-time traffic data can be obtained through GPS systems. This data includes the current average vehicle speed, and sets a road congestion index and a road capacity surplus index. For example, the road congestion index is set from 1 to 4, reflecting the degree of road congestion based on real-time traffic conditions. A higher congestion index indicates increased traffic pressure, and vice versa. Similarly, the road capacity surplus index is set from 1 to 4, reflecting the degree of road smoothness based on real-time traffic conditions. A higher capacity surplus index indicates decreased traffic pressure, and vice versa.

[0062] When determining the road congestion index, set 0.1 ≤ λ < 4; for example, when the road congestion index is 4, set the value of λ to be 0.1-1, and when the road congestion index is 1, set the value of λ to be 3-3.9.

[0063] When determining the road transport capacity surplus index, we set 6 < λ ≤ 10; for example, if the road transport capacity surplus index is 4, we set the value of λ to be 9.1-10, and if the road transport capacity surplus index is 1, we set the value of λ to be 6.1-7. The value of λ is a decimal.

[0064] By integrating historical average travel time with real-time traffic data, the actual traffic conditions of the geographic grid at different time scales can be more accurately reflected. This allows for dynamic adjustment of the weighting coefficient λ, making the route selection strategy more conservative in peak congestion scenarios and more aggressive in scenarios with excess capacity, thereby improving the stability and overall efficiency of the carpooling system under different traffic conditions.

[0065] In one specific implementation, determining the candidate vehicle corresponding to the minimum overall cost as the target vehicle, and matching the target vehicle with the new order includes: S61. Calculate the minimum comprehensive cost, determine the new route corresponding to the minimum comprehensive cost as the target route, and determine the candidate vehicles of the new route corresponding to the minimum comprehensive cost as the target vehicles. S62. Dispatch the order to the target vehicle so that the target vehicle is loaded into the target route.

[0066] A real-time carpooling order optimization method features a proactive carpooling opportunity creation mechanism. Within an acceptable minimum cost, by increasing vehicle mileage and proactively selecting routes through a geographic grid of potential demand, it significantly increases the probability of matching new orders and enhances strategic route planning capabilities for creating future carpooling opportunities. It incorporates a guided search and global optimization matching mechanism, utilizing historical average order density data from geographic grids to predict future carpooling probabilities for proactive route planning, finding the system's globally optimal matching and route combinations. A complete offline and online computing architecture is constructed, combining historical statistical patterns with real-time traffic data and order demand to dynamically adjust matching and route planning strategies. This ensures the carpooling system possesses both intelligence and high computational performance, making millisecond-level globally optimal matching possible on ordinary servers, thus resolving the contradiction between real-time performance and computational complexity.

[0067] The dynamic adjustment of matching and path planning strategies is intelligently guided by historical spatiotemporal patterns, making the search direction clearer. Therefore, it can find a better solution than traditional greedy algorithms or batch matching algorithms, thereby improving the matching rate by 5%-15% and reducing the total empty mileage of the system by 3%-10%.

[0068] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0069] Embodiments of this application also provide a real-time carpooling order optimization device, comprising: The receiving module is used to receive new orders and obtain the current location of the new orders; The dynamic programming module is used to input the parameters of new orders into the spatiotemporal partitioning statistical model to obtain historical order data for the current location's region; The calculation module is used to calculate the comprehensive cost of planning a new route for each candidate vehicle in the effective candidate set of the current location area based on historical order data. The processing module is used to determine the candidate vehicle corresponding to the minimum comprehensive cost as the target vehicle, and then match the target vehicle with the new order.

[0070] For a description of the features in the embodiment corresponding to the real-time carpooling order optimization device, please refer to the relevant description of the embodiment corresponding to the real-time carpooling order optimization method, which will not be repeated here.

[0071] Embodiments of this application also provide an electronic device, such as... Figure 3 As shown, it includes a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the above embodiments of the real-time carpooling order optimization method.

[0072] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the real-time carpooling order optimization method when running.

[0073] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0074] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the real-time carpooling order optimization method.

[0075] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the real-time carpooling order optimization method.

[0076] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0077] The above provides a detailed description of a real-time carpooling order optimization method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for optimizing real-time carpooling orders, characterized in that, include: In response to receiving a new order, obtain the current location of the new order; Input the parameters of the new order into the spatiotemporal partitioning statistical model to obtain the historical order data of the current location area; Based on the historical order data, calculate the comprehensive cost of planning a new route for each candidate vehicle in the effective candidate set of the current location area; The candidate vehicle corresponding to the minimum overall cost is determined as the target vehicle, and the target vehicle is matched with the new order.

2. The real-time carpooling order optimization method according to claim 1, characterized in that, The response before receiving a new order also includes: Obtain the current city's geographical area, perform geographic coordinate gridding processing, and obtain multiple geographic grids; Historical order data and vehicle trajectory data of ride-hailing services are obtained, mapped to various grids, and the historical average order density and historical average travel time in each geographic grid are calculated to construct a spatiotemporal zoning statistical model.

3. The real-time carpooling order optimization method according to claim 2, characterized in that, The parameters for a new order include the departure point and the destination point. Input the parameters of the new order into the spatiotemporal partitioning statistical model to obtain historical order data for the current location's region, including: Input the departure location of the new order into the spatiotemporal partitioning statistical model to obtain the historical average order density of the departure location of the new order in the geographic grid within the current time period and a preset range.

4. The real-time carpooling order optimization method according to claim 3, characterized in that, Based on historical order data, the comprehensive cost of planning a new route for each candidate vehicle in the valid candidate set for the current location area is calculated, including: Based on the historical average order density of the geographic grid in the current location area, geographic grids that meet the first preset condition and a preset number of historical average order densities are selected as potential demand geographic grids. Vehicles that meet the second preset condition in the potential demand geographic grid are selected as candidate vehicles to generate a valid candidate set for new orders; Obtain the original route of each candidate vehicle in the valid candidate set, insert the departure point and destination point of the new order into the original route of each candidate vehicle to obtain multiple new routes, and generate a new route sequence; Calculate the comprehensive cost for each of the new routes in the new route sequence.

5. The real-time carpooling order optimization method according to claim 4, characterized in that, Geographic grids that meet the first preset condition and the preset number include: The historical average order density is arranged in order of a predetermined number of geographic grids from high to low; Vehicles that meet the second preset condition include: The vehicle is currently traveling towards the potential demand geographic grid, is currently in the potential demand geographic grid, or is carrying passengers and is available to accept new orders. The angle between the vehicle's current direction of travel and the direction in which the destination of the new order points is less than a preset angle.

6. The real-time carpooling order optimization method according to claim 4, characterized in that, The formula for calculating the comprehensive cost TC is: TC = C - λ F; Where C represents direct cost, in minutes, and the value of C is less than 10; λ represents weighting coefficient, and the value of λ ranges from 0.1 to 10; F represents future potential revenue, in the number of orders per square kilometer per minute. The direct cost is the estimated total travel time of the new route minus the estimated total travel time of the original route. The potential future revenue is determined by identifying the geographic grid that the candidate vehicle reaches after completing the new route and releasing an empty seat, and is ready to accept the next new order. The parameters of the target grid are input into a spatiotemporal partitioning statistical model to obtain the historical average order density of the target grid mapped to the geographic grid in the future time period.

7. The real-time carpooling order optimization method according to claim 6, characterized in that, Calculating the comprehensive cost of each new route in the new route sequence includes: The reference range for λ is set to 4-6; The historical average travel time of each geographic grid traversed by the new route is obtained under the corresponding time period. The geographic grids whose historical average travel time is greater than the preset travel time are identified as congested geographic grids. When the proportion of the congested geographic grids to all geographic grids traversed by the new route exceeds the preset ratio, the value of λ is set to be less than 4. Obtain the historical average travel time of the geographic grids traversed by each new route in the corresponding time period, and determine the geographic grids whose historical average travel time is less than the preset travel time as geographic grids with excess capacity. When the proportion of the geographic grids with excess capacity to all geographic grids traversed by the new route exceeds the preset ratio, then set the value of λ to be greater than 6.

8. A real-time carpooling order optimization device, characterized in that, include: A receiving module is used to receive a new order and obtain the current location of the new order; The dynamic programming module is used to input the parameters of the new order into the spatiotemporal partitioning statistical model to obtain the historical order data of the current location area; The calculation module is used to calculate the comprehensive cost of planning a new route for each candidate vehicle in the effective candidate set of the current location area based on the historical order data. The processing module is used to determine the candidate vehicle corresponding to the minimum comprehensive cost as the target vehicle, and to match the target vehicle with the new order.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the real-time carpooling order optimization method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the real-time carpooling order optimization method as described in any one of claims 1 to 7.