An Optimized Method for Detecting Conflict Orders by Ride-Hailing Drivers
By optimizing the driver order table structure and using message middleware to handle conflicting orders in the online ride-hailing platform, the database performance bottleneck problem caused by driver conflict order detection in the online ride-hailing platform is solved, and the overall performance and efficiency of the system are improved.
Patent Information
- Application Number
- CN202111201251.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-15
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-10-15
AI Technical Summary
In online ride-hailing platforms, as the order volume increases, driver conflict order detection leads to database query performance bottlenecks, affecting order dispatch efficiency.
By storing only necessary fields in the driver order table and using message middleware (such as RocketMQ) to handle conflicting order information, it reduces direct queries to the order table, splits the table strategy and regularly cleans completed/cancelled orders to improve query performance.
It improves the efficiency of driver conflict order detection, reduces the pressure on order tables in the order dispatch process, and improves overall system performance.
Smart Images

Figure CN113902201B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of online car-hailing, and in particular to an optimization method for detecting conflict orders of online car-hailing drivers. Background Art
[0002] In the main process of the online ride-hailing platform, dispatching orders is an indispensable link. During the dispatching process, one of the rules for whether the driver can dispatch orders is to verify whether there are conflicting orders in the corresponding time period. If there are conflicting orders, the driver cannot be dispatched. Due to the daily order volume and the accumulation of historical orders, the current mainstream online ride-hailing platforms store more and more data. There will be a performance bottleneck when using the driver ID to obtain whether there are conflicting orders in the corresponding time period.
[0003] As the number of online ride-hailing orders gradually increases, the order table will cause more and more data in the database to increase with the increase in the number of orders. The order table is generally based on the user dimension, that is, the corresponding trip information or order information is obtained through the user ID, and the query of the online ride-hailing dispatch link is mainly based on the driver ID dimension.
[0004] As the amount of data in the order table increases, there will generally be a large number of requests to query driver orders during the dispatch process, which may result in slow database queries or performance bottlenecks.
[0005] The data in the order table is generally the basic information field of the order, while the driver conflict order query only needs to know whether there is a conflicting order number. As business needs increase, order business fields will be added to the order table. In this way, there will be more and more fields in the order table, and the driver conflict order detection will also be affected. Summary of the invention
[0006] In view of the above problems, the present invention is proposed to provide an optimization method for detecting conflicting orders of online car-hailing drivers that overcomes the above problems or at least partially solves the above problems.
[0007] According to one aspect of the present invention, a method for optimizing the detection of conflicting orders for online car-hailing drivers is provided, the method comprising:
[0008] At the entrance of the online car-hailing platform, users place orders, and the platform agent layer assembles order information to request the order system;
[0009] The order system places an order successfully and returns the order number to the platform agent layer;
[0010] The platform proxy layer receives the order number returned by the order system, assembles the order information and requests the order;
[0011] The dispatch system receives the dispatch request and screens the drivers;
[0012] Calling the order system according to the driver information of the screened driver assembly, finding out whether the screened driver has conflicting orders, and obtaining conflicting order information;
[0013] The dispatching system makes dispatching decisions based on the conflicting order information;
[0014] The dispatch calls the order system to bind the driver to the order, and the order is updated to the waiting-for-service status. At the same time, the order MQ message is sent to the order message consumption system and written into the driver's order information table. The driver's order table status is waiting for service, and the order starts to be served.
[0015] Optionally, the order information includes the online car-hailing platform order number, city, longitude and latitude of getting on and off the car, reservation time, and basic information of the passenger.
[0016] Optionally, the searching for whether the screened driver has any conflicting orders specifically includes: the order system receives a request for dispatching conflicting orders, and determines whether the order MQ switch is abnormal; if so, obtains the conflicting order from the order table; otherwise, it means that the driver's order table information is synchronized with the order table, and the conflicting order is obtained from the driver's order table; the order MQ switch is a downgrade switch. When there is an abnormality in MQ, it is manually switched to the order table to prevent the situation where the conflicting order cannot be found.
[0017] Optionally, the dispatch system makes dispatch decisions based on the conflicting order information, specifically including: if the driver has a conflicting order, the corresponding driver is unavailable; if the driver does not have a conflicting order, the corresponding driver is available, and the order is bound.
[0018] Optionally, the optimization method also includes: deleting completed and canceled orders from the driver order table.
[0019] The present invention provides an optimization method for detecting conflicting orders of online car-hailing drivers, the optimization method comprising: online car-hailing platform entrance, user ordering, platform proxy layer assembling order information to request order system; order system successfully places order and returns order number to the platform proxy layer; the platform proxy layer accepts order number returned by order system, assembles dispatch information to request dispatch; dispatch system receives dispatch request and screens drivers; calls order system according to driver information assembled by the screened drivers, searches whether the screened drivers have conflicting orders, and obtains conflicting order information; dispatch system makes dispatch decision according to the conflicting order information; dispatch calls order system, binds driver, updates order to waiting service state, sends order MQ message to order message consumption system at the same time, writes driver order information table, driver order table state is waiting service, and order starts service. Solve the online car-hailing dispatch link, when requesting order to obtain driver conflicting orders, because the order table data increases with the increase of business, the database pressure and data storage volume will increase, and the new driver conflicting order detection process scheme is used to improve the efficiency of obtaining driver conflicting orders, reduce the pressure of dispatch link on order table, and improve overall performance.
[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0022] Figure 1 A flowchart of an optimization method for detecting conflicting orders for online ride-hailing drivers provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0024] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0025] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0026] Basic information of database, database: 1
[0027] Order table: order; table structure: list some fields
[0028]
[0029] Order number rules:
[0030] Prefix (BX|PX) + yyMMddHHmmss (12 digits) + last three digits of the machine IP + auto-increment sequence (4 digits)
[0031] Case: BX2109081758561620001
[0032] Driver order table: driver_order_0-driver_order_255 (the order number field is the same as the order table)
[0033] Table structure: List some fields
[0034]
[0035] Order number rule: prefix BX|PX)+yyMMddHHmmss(12 digits)+last three digits of machine IP+auto-increment sequence(4 digits)
[0036] Case: BX2109081758561620001
[0037] Table partitioning strategy: driver_id%256=corresponding table number
[0038] Order message middleware MQ:
[0039] Message middleware: RocketMQ, version: 4.2.0
[0040] Scenarios for driver conflict ticket inquiries:
[0041] Get from the order table: query directly by driver ID
[0042] Get from the driver order table: first use driver_id%256 to get the table number, then query by driver ID;
[0043] Query conditions: scheduled pickup time range + driver ID + order status (including status in all services), so that you can get whether there are any orders in progress during the query time period for the driver.
[0044] For example: Driver ID = 8011, the corresponding data table is: driver_order_075.
[0045] like Figure 1 As shown, the user places an order at the entrance of the online car-hailing platform, and the platform agent layer assembles the order information to request the order system, which includes: the online car-hailing platform order number, city, longitude and latitude of boarding and disembarking, reservation time, basic information of the passenger, etc., including all public information of the order.
[0046] The order system places the order successfully and returns the order number to the platform agent layer.
[0047] The platform proxy layer accepts the order number returned by the order system, assembles the order information and requests the order.
[0048] The dispatch system receives the dispatch request and starts screening drivers.
[0049] The screened drivers are assembled with driver information and the order system is called to request whether the driver has any conflicting orders.
[0050] The order system receives the order conflict detection request and determines whether the order MQ switch is abnormal;
[0051] If there is no exception, it means that the driver order table information is synchronized with the order table. The conflicting orders are obtained from the driver order table.
[0052] Exception, get conflicting orders from the order table.
[0053] This switch is a downgrade switch. When MQ is abnormal, manually switch to the order table to prevent the situation where conflicting orders cannot be queried.
[0054] The dispatcher receives conflicting order information returned by the order and makes dispatch decisions.
[0055] The driver has conflicting orders and is unavailable;
[0056] The driver has no conflicting orders and is available for binding.
[0057] The dispatch calls the order system to bind the driver to the order, and the order is updated to the waiting-for-service status. At the same time, the order MQ message is sent to the order message consumption system and written into the driver's order information table. The driver's order table status is waiting for service.
[0058] When the order service starts, the subsequent order service process needs to send MQ messages to the order message consumption system while updating the order status, and update the status of the corresponding order in the driver order table.
[0059] Driver order table data exit:
[0060] Reason for exit: Since the driver order table is used to query whether the driver has conflicting orders, the order status of conflicting orders must be in service. Therefore, for completed or canceled orders, we can exit the data from the driver order table to ensure the lightweight of the driver order table and improve the efficiency of driver conflict order detection.
[0061] Exit rules: You can use the order reservation time + order status to exit the data of orders with a reservation time less than 1 day from the current time and an order status equal to completed, as well as the canceled order data. This will not affect the business and can ensure query efficiency.
[0062] Example: Current time: 2021-09-13
[0063] Exit condition: booking_date<2021-09-12and status=completed or status=cancelled.
[0064] Data exit frequency: You can exit data during the off-peak period of business requests every day, such as midnight, or 1 or 2 a.m.
[0065] Beneficial effect: By adding a driver order table, which is an order information table with the driver as the dimension, the table fields are greatly reduced. Basically, only fields such as driver ID, order number, order status, order appointment time, etc. are required. There is no need for so many other business fields in the original order table. The data table becomes lightweight. At the same time, obtaining conflicting order information from the driver order table can also reduce the requests for the original order table in the dispatching link.
[0066] The driver order table is written after the driver is assigned to the driver. This reduces the number of orders written before the driver is assigned to the driver. At the same time, daily data exit can ensure that the driver order table contains ongoing orders, which greatly reduces the data in the data table and improves the query performance of driver conflicting orders.
[0067] The driver order table is divided into two tables according to the driver ID. As the number of drivers on the platform increases, the amount of data in a single table will not be too large, thus ensuring the query performance.
[0068] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An optimization method for detecting conflicting orders of online car-hailing drivers. It is characterized in that The optimization method comprises: At the entrance of the online car-hailing platform, users place orders, and the platform agent layer assembles order information to request the order system; The order system places an order successfully and returns the order number to the platform agent layer; The platform proxy layer receives the order number returned by the order system, assembles the order information and requests the order; The dispatch system receives the dispatch request and screens the drivers; Calling the order system according to the driver information of the screened driver assembly, finding out whether the screened driver has conflicting orders, and obtaining conflicting order information; The searching for whether the screened driver has conflicting orders specifically includes: The order system receives the order conflict detection request and determines whether the order MQ switch is abnormal; if so, obtains the conflicting order from the order table; otherwise, it indicates that the driver order table information is synchronized with the order table, and obtains the conflicting order from the driver order table; The order MQ switch is a downgrade switch. When MQ is abnormal, manually switch to the order table to prevent the situation where conflicting orders cannot be found. The dispatching system makes dispatching decisions based on the conflicting order information; The dispatch calls the order system to bind the driver to the order, and the order is updated to the waiting-for-service status. At the same time, the order MQ message is sent to the order message consumption system and written into the driver's order information table. The driver's order table status is waiting for service, and the order starts to be served.
2. According to claim 1, an optimization method for detecting conflicting orders of online car-hailing drivers, It is characterized in that The order information includes the online car-hailing platform order number, city, longitude and latitude of getting on and off the car, reservation time, and basic information of the passenger.
3. According to claim 1, an optimization method for detecting conflicting orders of online car-hailing drivers, It is characterized in that The dispatching system makes dispatching decisions according to the conflicting order information, specifically including: The driver has conflicting orders and the corresponding driver is unavailable; The driver has no conflicting orders and the corresponding driver is available to bind the orders.
4. According to claim 1, an optimization method for detecting conflicting orders of online car-hailing drivers, It is characterized in that The optimization method also includes: deleting completed and canceled orders from the driver order table.
