A method for handling the problem of channel order cancellation within seconds
Through the responsibility chain model and distributed lock technology, the problem of drivers receiving continuous order binding and cancellation notices during the channel order dispatch process is solved, improving the response efficiency and competitiveness of channel orders, and ensuring driver utilization and platform reliability. sex.
Patent Information
- Application Number
- CN202210030658.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-01-12
AI Technical Summary
During the channel order dispatch process, drivers may continuously receive order binding and cancellation information, leading to psychological gaps and doubts about reliability, and the platform's response efficiency is low, affecting competitiveness.
Adopt the responsibility chain model and distributed lock technology to create a chain of pre-order interceptors for channel orders, lock the driver to prevent multiple responses, configure management according to the response time of different channels, and loop through channel callback information to automatically cancel orders.
It avoids the "second cancellation" problem on the driver side, improves the response efficiency and competitiveness of channel orders, and ensures driver utilization and platform reliability.
Smart Images

Figure CN114386832B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data supervision, and in particular to a method for processing the problem of channel order cancellation within seconds. Background Art
[0002] During the channel order dispatching process, the platform will immediately display the order information to the driver after finding the driver. If the decision fails on the channel side, the driver will immediately receive the order cancellation information, causing a psychological gap and doubting the reliability and competitiveness of the platform.
[0003] After the channel order selects a suitable driver, it will immediately bind the order and notify the driver, instead of waiting for channel confirmation before notifying. As a result, when the channel decision fails, the driver will receive order binding information and order cancellation information continuously. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a method for handling the channel order cancellation problem in seconds, which overcomes the above problems or at least partially solves the above problems.
[0005] According to one aspect of the present invention, a method for processing the problem of channel order cancellation within seconds is provided, and the processing method comprises:
[0006] The order sources include channel orders and free platform orders;
[0007] After entering the order dispatching process, determine whether the order is a channel order. If so, use the channel order binding strategy; otherwise, the free platform order will be immediately bound to the driver when the driver is found during the order dispatching process;
[0008] Adopt the responsibility chain model to create a pre-binding interceptor chain for channel orders;
[0009] In the channel order binding strategy, the driver is locked to prevent the same driver from being assigned to multiple orders.
[0010] The driver binding lock verification interceptor of the channel order;
[0011] Configure management of response times across different channels.
[0012] Optionally, the processing method also includes: if all interceptors are successfully released, the driver is bound to the order, and after the binding is successful, the driver is notified and the driver's status is changed to bound.
[0013] Optionally, the configuration management of the response time of different channels specifically includes:
[0014] According to the different requirements of response time between channels, configure and manage the response time of different channels and obtain the configuration content;
[0015] Storing the configuration content in a distributed cache;
[0016] In the channel order waiting channel confirmation interceptor, first check whether it has passed the channel. If not, notify the channel that there is an available driver, and wait for the current dispatch process according to the configuration information;
[0017] During the waiting time, the open platform is called cyclically to query the channel callback information. If the callback fails, the current order dispatching process is intercepted and the order is automatically canceled.
[0018] Optionally, the method of locking the driver to prevent the same driver from being assigned to multiple orders specifically includes:
[0019] Using redis distributed lock technology, the key-value pairs of driver and order information are stored in the redis cluster;
[0020] Before storing, check whether the key-value pair exists in the cluster. If it exists, it proves that it is locked. If it does not exist, it proves that it is not locked.
[0021] After locking the driver, the channel is notified that there is an available driver.
[0022] Optionally, the chain of responsibility model is adopted to create a pre-order binding interceptor chain for a channel order, specifically including:
[0023] Connect the parameter assembly interceptor, driver conflict verification interceptor, channel order driver binding lock verification interceptor, and channel order waiting channel confirmation interceptor into a responsibility chain in the order of execution in the responsibility chain mode to obtain an interceptor chain;
[0024] Before an order is bound, it will first enter the interceptor chain; if the order is successfully released by all interceptors, it will enter the driver binding stage.
[0025] The present invention provides a method for processing the problem of channel order cancellation in seconds, the processing method comprising: the order source includes channel orders and free platform orders; after entering the order dispatching process, it is determined whether the order is a channel order, if so, the channel order binding strategy is used; otherwise, the free platform order finds the driver and binds it immediately during the order dispatching process; the responsibility chain mode is adopted to create a channel order pre-binding interceptor chain; in the channel order binding strategy, the driver is locked to prevent the same driver from being answered to multiple orders; the driver binding lock of the channel order is verified by the interceptor; and the response time of different channels is configured and managed. The response efficiency of the channel order to the channel end is increased, and the competitiveness of the channel order is improved.
[0026] 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
[0027] 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.
[0028] Figure 1 A channel order dispatching flow chart provided by an embodiment of the present invention;
[0029] Figure 2 A flow chart of a channel order waiting for channel confirmation interceptor provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] 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.
[0031] 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.
[0032] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0033] like Figure 1 and Figure 2 As shown in the figure, the difference between channel orders and free platform orders in the dispatching link is that after the channel order finds a driver, it is fed back to the channel. The channel will confirm again and may or may not want this driver. However, during the dispatching process of free platform orders, once a driver is found, this driver will definitely be used. In the dispatching logic, the two are distinguished. After entering the dispatching process, it is determined whether it is a channel order. If it is, the channel order binding strategy is used. The two different strategy codes are completely decoupled.
[0034] Use the responsibility chain mode to create a pre-binding interceptor chain for channel orders. Connect the parameter assembly interceptor, driver conflict verification interceptor, channel order driver binding lock verification interceptor, and channel order waiting channel confirmation interceptor into a responsibility chain in the order of execution using the responsibility chain mode. When an order enters the pre-binding stage, it will first enter the interceptor chain. If all interceptors are successfully released, it will enter the driver binding stage.
[0035] In the channel order binding strategy, the driver is locked to prevent the same driver from being answered to multiple orders. Using redis distributed lock technology, the key-value pairs of driver and order information are stored in the redis cluster. Before storing, check whether the key-value pair exists in the cluster. If it exists, it proves that it is locked. If it does not exist, it proves that it is not locked. In this way, the effect of locking the driver is achieved in the scenario of multiple servers and multiple threads concurrently. After locking the driver, notify the channel that there is an available driver.
[0036] The channel order driver binding lock verification interceptor will query the redis cluster for the value of the current order number based on the driver ID. If it exists, it proves that the driver has been locked by the order. If it does not exist, the lock fails. If the order number is not the current order number, it proves that other orders have locked the driver, and the lock also fails. If the lock fails, the current dispatch process is intercepted and the order is automatically canceled. The reason for the cancellation is that there is no available driver.
[0037] Considering the different requirements for response time among channels, the response time of different channels is configured and managed. The configuration content is placed in the distributed cache to improve the efficiency of interface query configuration and the response speed of dispatching orders. In the channel order waiting channel confirmation interceptor, first check whether the channel has been notified. If not, notify the channel that there are available drivers, and wait for the current dispatching process according to the configuration information. Within the waiting time range, call the open platform cyclically to query the channel callback information. If the channel callback fails or the channel cancels the order, the current dispatching process is intercepted and the order is automatically canceled.
[0038] If all interceptors are successfully released, the driver will be bound to the order, and the driver will be notified after the binding is successful. The driver's status will be changed to bound.
[0039] Beneficial effect: When a channel order fails to be dispatched because the channel abandons the driver who responded to the platform, the driver will not be aware of it, avoiding the "instant cancellation" problem where the driver receives the order cancellation notification immediately after receiving the order binding notification.
[0040] Avoid binding channel orders to drivers during the period of channel decision failure, which prevents drivers from receiving orders normally and improves driver utilization.
[0041] Increase the response efficiency of channel orders to the channel side and improve the competitiveness of channel orders.
[0042] 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. A method for handling the problem of channel order cancellation within seconds, characterized in that: The processing method comprises: The order sources include channel orders and free platform orders; After entering the order dispatching process, determine whether the order is a channel order. If so, use the channel order binding strategy; otherwise, the free platform order will be immediately bound to the driver when the driver is found during the order dispatching process; Use the responsibility chain model to create a pre-binding interceptor chain for channel orders, including: Connect the parameter assembly interceptor, driver conflict verification interceptor, channel order driver binding lock verification interceptor, and channel order waiting channel confirmation interceptor into a responsibility chain in the order of execution in the responsibility chain mode to obtain an interceptor chain; Before an order is bound, it will first enter the interceptor chain; if the order is successfully released by all interceptors, it will enter the driver binding stage; In the channel order binding strategy, the driver is locked to prevent the same driver from being assigned to multiple orders. The driver binding lock verification interceptor of the channel order; Configure the response time of different channels, including: According to the different requirements of response time between channels, configure and manage the response time of different channels and obtain the configuration content; Storing the configuration content in a distributed cache; In the channel order waiting channel confirmation interceptor, first check whether it has passed the channel. If not, notify the channel that there is an available driver, and wait for the current dispatch process according to the configuration content; During the waiting time, the open platform is called cyclically to query the channel callback information. If the callback fails, the current order dispatching process is intercepted and the order is automatically canceled.
2. A method for handling the problem of channel order cancellation within seconds according to claim 1, characterized in that: The processing method also includes: if all interceptors are successfully released, the driver is bound to the order, and after the binding is successful, the driver is notified and the driver's status is changed to the bound order.
3. A method for handling the problem of channel order cancellation within seconds according to claim 1, characterized in that: The method of locking the driver to prevent the same driver from being answered to multiple orders specifically includes: Using redis distributed lock technology, the key-value pairs of driver and order information are stored in the redis cluster; Before storing, check whether the key-value pair exists in the cluster. If it exists, it proves that it is locked. If it does not exist, it proves that it is not locked. After locking the driver, the channel is notified that there is an available driver.
