Order cancellation method and related device

Through the collaborative work of the remote dictionary service database and the Kafka cluster, efficient cancellation of orders on e-commerce platforms is achieved, resource waste caused by order locking is solved, and real-time and throughput of the system are improved.

CN112330420BActive Publication Date: 2025-01-07AGRICULTURAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011362027.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2025-01-07
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

During festival promotions on e-commerce platforms, customers' order locking behavior leads to unpaid orders, wasting activity quotas and commodity inventory. The existing technology recognizes and cancels orders through timed tasks, but it is inefficient, has large server overhead and cannot meet real-time Sexual needs.

Method used

The order is timed through the remote dictionary service database. When the timing of the target order reaches the threshold, an order lock notification is generated. A cancel message is created through the order lock process and sent to the Kafka cluster. The order cancel process consumes a message to perform the cancel operation. And perform accounts and reconciliation operations if necessary.

Benefits of technology

Improves the efficiency and throughput of order cancellation, can process large batches of messages in a timely manner, meet real-time cancellation needs, release inventory and activity resources, and ensure data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112330420B_ABST
    Figure CN112330420B_ABST
Patent Text Reader

Abstract

The present application discloses an order cancellation method and device, the method comprising: performing a timing operation on a generated order through a remote dictionary service database; when the timing of a target order reaches a threshold, generating an order lock notification for the target order through the remote dictionary service database; creating an order cancellation message according to the order lock notification through an order lock process, and sending the order cancellation message to a Kafka cluster; reading the order cancellation message from the Kafka cluster through an order cancellation process; consuming the order cancellation message through an order cancellation process to perform an order cancellation operation on the target order. It can be seen that the use of a remote dictionary service database can perform a timing operation on the target order, and the lock and cancellation notifications dedicated to the target order can be sent in a timely manner through the order lock process and the order cancellation process, and because the Kafka cluster has a high throughput, it can process large batches of messages, improve the throughput of the system, and thus efficiently realize automatic cancellation of the target order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to an order cancellation method and related devices. Background Art

[0002] In many holiday promotion scenarios on e-commerce platforms, malls often offer discounts to customers, but customers may lock their orders (i.e. place an order without paying). This behavior wastes the mall's activity quota and store inventory, and has a certain negative impact on the mall's promotional activities.

[0003] In the related art, the method of scheduled tasks is mainly used to identify the above-mentioned locking behavior.

[0004] According to the data volume of the mall user group and the mall order, a timer program is used to traverse the order status at a preset time or based on a fixed period, so as to achieve the purpose of automatically canceling the above-mentioned types of orders. However, this method is inefficient, has a large server overhead, and cannot meet real-time requirements. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides an order cancellation method and device.

[0006] In a first aspect, in order to solve the above technical problems, an embodiment of the present application provides an order cancellation method, comprising:

[0007] Perform timing operations on generated orders through the remote dictionary service database;

[0008] When the timing of the target order reaches a threshold, an order locking notification for the target order is generated through a remote dictionary service database;

[0009] Creating an order cancellation message according to the order lock notification through the order lock process, and sending the order cancellation message to the Kafka cluster;

[0010] Reading the order cancellation message from the Kafka cluster through an order cancellation process;

[0011] The order cancellation message is consumed by the order cancellation process to perform an order cancellation operation on the target order.

[0012] Optionally, creating an order cancellation message according to the order locking notification through the order locking process includes:

[0013] Querying the order status of the target order through the order locking process;

[0014] If the order status is unfinished, an order cancellation message is created according to the order lock notification.

[0015] Optionally, after consuming the order cancellation notification through the order cancellation process and performing an order cancellation operation on the target order, the method further includes:

[0016] Creating an order settlement message for the target order through the order cancellation process, and sending the order settlement message to the Kafka cluster;

[0017] Reading the order settlement message from the Kafka cluster through a data settlement process;

[0018] According to the resource occupancy information of the target order, the order occupancy message is consumed by the data occupancy process to perform an order occupancy operation, so as to release the occupied resources determined according to the resource occupancy information on the platform to which the target order belongs.

[0019] Optionally, after consuming the order settlement message through the data settlement process according to the resource occupation information of the target order, the method further includes:

[0020] Generate an order reconciliation message through the data reconciliation process, and send the order reconciliation message to the Kafka cluster;

[0021] Reading the order reconciliation message from the Kafka cluster through a data reconciliation process;

[0022] According to the target order and the order log generated by the target order based on the order settlement operation, performing an order settlement operation on the order settlement operation through the data settlement process;

[0023] If it is determined based on the order reconciliation operation that the data reconciliation is inconsistent, the data reconciliation process is instructed to re-perform the order reconciliation operation.

[0024] Optionally, the method further includes:

[0025] Generating the target order in response to the resource acquisition request;

[0026] Wherein, if the resources are from multiple resource entities, the target order includes sub-orders corresponding to different resource entities, each of which has a corresponding sub-order payment summary and a sub-order occupancy summary;

[0027] The sub-order payment summary is used to record the payment data of the sub-order, and the sub-order occupancy summary is used to record the resource occupancy information of the sub-order;

[0028] The consuming the order settlement message through the data settlement process to perform the order settlement operation includes:

[0029] Determine resource occupancy information of the target order according to the sub-order occupancy summary of the target order;

[0030] The order settlement operation is performed by consuming the order settlement message through the data settlement process;

[0031] The performing an order reconciliation operation on the order settlement operation through the data reconciliation process according to the target order and the order log generated by the target order based on the order settlement operation, includes:

[0032] Determining payment data of the target order according to the sub-order payment summary of the target order;

[0033] According to the payment data and the order log generated by the target order based on the order settlement operation, an order settlement operation is performed on the order settlement operation through the data settlement process.

[0034] In a second aspect, in order to solve the above technical problems, the embodiment of the present application provides an order cancellation device, including:

[0035] A timing unit, used for performing timing operations on generated orders through a remote dictionary service database;

[0036] An order lock notification generating unit, configured to generate an order lock notification for a target order through a remote dictionary service database when the timing of the target order reaches a threshold;

[0037] An order cancellation message creation unit, configured to create an order cancellation message according to the order lock notification through an order lock process, and send the order cancellation message to a Kafka cluster;

[0038] An order cancellation message reading unit, configured to read the order cancellation message from the Kafka cluster through an order cancellation process;

[0039] An order cancellation message consumption unit is used to consume the order cancellation message through the order cancellation process to perform an order cancellation operation on the target order.

[0040] Optionally, the order cancellation message creating unit includes:

[0041] An order status query unit, used to query the order status of the target order through an order locking process;

[0042] The order cancellation message creation subunit is used to create an order cancellation message according to the order lock notification when the order status is uncompleted.

[0043] Optionally, the device further comprises:

[0044] An order settlement message creation unit, configured to create an order settlement message for the target order through the order cancellation process, and send the order settlement message to a Kafka cluster;

[0045] An order settlement message reading unit, configured to read the order settlement message from the Kafka cluster through a data settlement process;

[0046] The order settlement message consumption unit is used to consume the order settlement message through the data settlement process according to the resource occupation information of the target order to perform an order settlement operation, so as to release the occupied resources determined according to the resource occupation information on the platform to which the target order belongs.

[0047] Optionally, the device further comprises:

[0048] An order reconciliation message generating unit, configured to generate an order reconciliation message through the data reconciliation process, and send the order reconciliation message to a Kafka cluster;

[0049] An order reconciliation message reading unit, configured to read the order reconciliation message from the Kafka cluster through a data reconciliation process;

[0050] An order reconciliation operation performing unit, configured to perform an order reconciliation operation on the order reconciliation operation through the data reconciliation process according to the target order and an order log generated by the target order based on the order reconciliation operation;

[0051] The order reconciliation operation re-instruction unit is used to instruct the data reconciliation process to re-perform the order reconciliation operation when it is determined that the data reconciliation is inconsistent based on the order reconciliation operation.

[0052] Optionally, the device further comprises:

[0053] A target order generating unit, configured to generate the target order in response to the resource acquisition request;

[0054] Wherein, if the resources are from multiple resource entities, the target order includes sub-orders corresponding to different resource entities, each of which has a corresponding sub-order payment summary and a sub-order occupancy summary;

[0055] The sub-order payment summary is used to record the payment data of the sub-order, and the sub-order occupancy summary is used to record the resource occupancy information of the sub-order;

[0056] The order settlement message consumption unit includes:

[0057] A target order resource occupancy information determining unit, configured to determine the resource occupancy information of the target order according to the sub-order occupancy summary of the target order;

[0058] An order settlement operation unit, configured to consume the order settlement message through the data settlement process to perform the order settlement operation;

[0059] The order reconciliation operation unit includes:

[0060] A target order payment data determining unit, configured to determine the payment data of the target order according to the sub-order payment summary of the target order;

[0061] An order reconciliation operation unit is used to perform an order reconciliation operation on the order settlement operation through the data reconciliation process according to the payment data and the order log generated by the target order based on the order settlement operation.

[0062] Compared with the prior art, the embodiments of the present application have the following advantages:

[0063] In an embodiment of the present application, a timing operation is performed on a generated order through a remote dictionary service database; when the timing of a target order reaches a threshold, an order lock notification for the target order is generated through the remote dictionary service database; an order cancellation message is created according to the order lock notification through the order lock process, and the order cancellation message is sent to the Kafka cluster; the order cancellation message is read from the Kafka cluster through the order cancellation process; the order cancellation message is consumed through the order cancellation process to perform an order cancellation operation on the target order. It can be seen that the use of a remote dictionary service database can perform a timing operation on the target order, and the lock and cancellation notifications dedicated to the target order can be sent in a timely manner through the order lock process and the order cancellation process, and because the Kafka cluster has a high throughput, it can process large batches of messages and improve the throughput of the system, thereby efficiently realizing automatic cancellation of the target order. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0065] Figure 1 A flowchart of an order cancellation method provided in an embodiment of the present application;

[0066] Figure 2 A schematic diagram of an order cancellation device provided in an embodiment of the present application;

[0067] Figure 3 An order data model design diagram provided for an embodiment of the present application;

[0068] Figure 4 A flowchart of automatic order cancellation provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] The inventor of this application has found through research that with the rapid development of the modern Internet and the increasing maturity of the e-commerce system, online shopping has become a very common behavior in today's society. In order to improve customer stickiness and reduce customer acquisition costs, major e-commerce platforms often launch various holiday promotions to attract customers. Promotional activities mainly include the following scenarios:

[0071] 1. A certain number of discounted products (or limited gifts). In this case, some merchants will offer a certain number of discounted products. After the above products are sold out, the discount activity ends and users can only purchase them at prices other than the discounted price.

[0072] In this scenario, to protect the interests of merchants, e-commerce platforms cannot sell goods at special prices to buyers that exceed the quantity set by merchants. They also cannot allow special-price goods to be maliciously locked, resulting in the inability to carry out promotions normally. Therefore, it is necessary to cancel unpaid orders and release inventory in a timely manner.

[0073] 2. Buyers place orders at discounted amounts by using coupons or points. During promotions, buyers may qualify for discounted amounts through coupons or points and place orders at discounted amounts. The corresponding points or coupons will be deducted when the buyer places an order. To protect the interests of buyers, coupons or points need to be returned after the order is manually or automatically canceled.

[0074] 3. E-commerce platforms subsidize merchants' products. In order to give back to new and old customers, e-commerce platforms will initiate activities to subsidize products so that users can buy at affordable prices. In this case, since the e-commerce platform directly subsidizes, it generally limits the number of purchases or the number of times buyers can participate in the activity. After automatically canceling the order, it is also necessary to release the buyer's activity usage and allow the buyer to participate in the activity again.

[0075] In various promotional scenarios, there are customers who lock orders (i.e. place orders without paying), which results in the inventory and activity resources not being recovered in a timely manner, resulting in waste and having a significant negative impact on promotional activities. Therefore, in promotional scenarios with massive data and high concurrency, how to ensure efficient and accurate order cancellation, timely release of withheld inventory and activity resources, and effectively maintain data consistency and transaction accuracy are the primary issues that e-commerce applications need to face.

[0076] In order to solve the above technical problems, in an embodiment of the present application, a timing operation is performed on the generated order through a remote dictionary service database; when the timing of the target order reaches a threshold, an order lock notification for the target order is generated through the remote dictionary service database; through the order lock process, an order cancellation message is created according to the order lock notification, and the order cancellation message is sent to the Kafka cluster; the order cancellation message is read from the Kafka cluster through the order cancellation process; the order cancellation message is consumed through the order cancellation process to perform an order cancellation operation on the target order. It can be seen that the use of a remote dictionary service database can perform a timing operation on the target order, and the lock and cancellation notifications dedicated to the target order can be sent in time through the order lock process and the order cancellation process, and because the Kafka cluster has a high throughput, it can process large batches of messages and improve the throughput of the system, thereby efficiently realizing the automatic cancellation of the target order.

[0077] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.

[0078] Exemplary Methods

[0079] See also Figure 1 , which is a flow chart of an order cancellation method provided in an embodiment of the present application.

[0080] In the embodiment of the present application, the method can be implemented, for example, through the following steps S101-S105.

[0081] S101: performing a timing operation on the generated order through the remote dictionary service database.

[0082] The remote dictionary service database is an in-memory database used to store temporary order data and perform order timing operations. Key space notification is an event notification technology that comes with the remote dictionary service database. When certain events occur in the data in the database, notification users will be sent to specific message consumers. Database refers to an application used to store data, including structured, unstructured, and key-value applications. Message producer refers to the upstream of the data pipeline, usually the creator of the message. The message producer actively sends messages to the message platform. Message consumer refers to the downstream of the data pipeline, usually the processor of the message. The message platform sends messages to message consumers through push data and pull data models.

[0083] After the user places an order through the e-commerce platform, the backend server creates an order snapshot and stores it in the remote dictionary service database, and starts the timing operation, such as Figure 4 As shown, operation A1 is to perform a timing operation on the generated order through the remote dictionary service database (ie, the Redis cluster).

[0084] It should be noted that each time a user places an order, an order is generated, and only the order overview data is recorded, not detailed payment information, resource usage and other data. And when placing orders at different stores at the same time, only one order is generated, but multiple sub-orders can be generated. Order snapshot refers to the order overview snapshot data, which is only used for users to view historical order data, which is conducive to read-write separation operations, and can contain order number, product information, activity information, delivery address and other information.

[0085] For example, when a user places an order in the mall through the mobile mall client, the remote dictionary service database (i.e., the Redis cluster) starts timing the generated order.

[0086] S102: When the timing of the target order reaches a threshold, an order locking notification for the target order is generated through the remote dictionary service database.

[0087] In the embodiments of the present application, Figure 4 As shown, operation A2 is to generate an order lock notification for the target order through the remote dictionary service database after the order timing is completed. When the timing duration of the target order reaches the threshold, an order lock notification is generated and sent to the order lock dedicated process to lock the order. It should be noted that the threshold of the timing duration of the target order can be set by the e-commerce platform according to actual conditions, and the embodiment of the present application does not make specific limitations here.

[0088] For example, the timing threshold can be set to 15 minutes. When the timing of the target order reaches 15 minutes, an order lock notification for the target order can be generated and sent to the order lock dedicated process.

[0089] S103, through the order locking process, creating an order cancellation message according to the order locking notification, and sending the order cancellation message to the Kafka cluster.

[0090] In the embodiments of the present application, Figure 4 As shown, operations A3 and A4 are to query the order status of the target order through the order locking process. If the order status is completed, that is, the user has not paid, the order locking dedicated process creates an order cancellation message according to the order locking notification and sends the order cancellation message to the Kafka cluster.

[0091] For example, when the order status of the target order is queried through the order locking process and it is found that the target order has not been paid, in order to avoid the user's locking behavior (that is, only placing an order but not paying), which results in the inability to recover inventory and activity resources in time and cannot be provided to other users who really need to purchase in time, therefore, when it is found that the target order has not been paid, the order locking dedicated process creates an order cancellation message based on the order locking notification and sends the order cancellation message to the Kafka cluster.

[0092] S104, reading the order cancellation message from the Kafka cluster through an order cancellation process.

[0093] S105: Consume the order cancellation message through the order cancellation process to perform an order cancellation operation on the target order.

[0094] In the embodiments of the present application, Figure 4 As shown in B1, the order cancellation process reads the order cancellation message from the Kafka cluster, that is, the Kafka cluster pushes the order cancellation message to the order cancellation dedicated daemon process. When the data platform receives the order cancellation message, it cancels the order. The data platform stores the order data.

[0095] In addition, after S105, the unpaid orders have been cancelled. At this time, the account settlement operation for the cancelled orders can also be performed, specifically:

[0096] Creating an order settlement message for the target order through the order cancellation process, and sending the order settlement message to the Kafka cluster;

[0097] Reading the order settlement message from the Kafka cluster through a data settlement process;

[0098] According to the resource occupancy information of the target order, the order occupancy message is consumed by the data occupancy process to perform an order occupancy operation, so as to release the occupied resources determined according to the resource occupancy information on the platform to which the target order belongs.

[0099] When performing a balancing operation, the target order to be balancing can be canceled by Figure 3 The data model design diagram consists of:

[0100] User model, which includes user ID, user information, etc.

[0101] The order model refers to the model of the target order, which may include order number, user number, order information, user information, etc.

[0102] Order snapshot refers to the order overview snapshot data, which is only used for users to view historical order data, which is conducive to read-write separation operations and can contain order number, product information, activity information, delivery address and other information;

[0103] There can be multiple sub-orders under an order model. A sub-order refers to the user's actual order data. A unified shopping behavior in each store will only generate one sub-order.

[0104] Each sub-order has a corresponding sub-order payment summary and sub-order occupancy summary. The sub-order payment summary is used to record the payment data of the sub-order, including the actual amount, discount amount, credit amount and other data; the sub-order occupancy summary is used to record the resource occupancy information of the sub-order, including the activity quota occupancy data, points bean deduction status, coupon usage status, inventory occupancy status and other data.

[0105] Payment flow refers to the user's actual payment information, including actual payment information, payment channels and other data.

[0106] The outbound delivery note contains the outbound delivery record of the ordered goods.

[0107] Coupon, records the coupon usage data.

[0108] Activity participation records record the user's activity participation data.

[0109] User points record the user's point usage.

[0110] like Figure 4 As shown in B3, after the order cancellation operation is executed, an order settlement message for the target order is created through the order cancellation process, and the order settlement message is sent to the Kafka cluster. When the Kafka cluster receives the order settlement message, Figure 4 As shown in C1, the order settlement message is read from the Kafka cluster through the data settlement process, and then Figure 4 As shown in C2, according to the resource occupancy information of the target order, the order balancing operation is performed by consuming the order balancing message through the data balancing process, so as to release the occupied resources determined according to the resource occupancy information on the platform to which the target order belongs. Among them, the order balancing operation is performed by consuming the order balancing message through the data balancing process, including: determining the resource occupancy information of the target order according to the sub-order occupancy summary of the target order; and performing the order balancing operation by consuming the order balancing message through the data balancing process.

[0111] For example, resource occupancy information may include activity quota occupancy data, point bean deduction status, coupon usage status, inventory occupancy status, etc. When performing order balancing operations, the inventory occupancy of the product, activity quota occupancy, and points and coupons used by the user are released, that is, each sub-order of the user is balanced. Assuming that an order uses 10 points and a 20-yuan coupon, when the order is cancelled, the 10 points and 20-yuan coupon are returned to the user, and can be recorded in the log of the e-commerce platform background.

[0112] After consuming the order settlement message through the data settlement process according to the resource occupation information of the target order, the following may also be included:

[0113] An order reconciliation message is generated through the data reconciliation process and sent to the Kafka cluster.

[0114] like Figure 4 As shown in C3, after the order balance operation is completed, it is necessary to check whether the balance operation is correct. At this time, the target order needs to be reconciled to determine whether the data is consistent. Data consistency means that the system will not have long or short accounts when processing transaction data. For example, if a user places an order first and then cancels the order, the remaining available inventory of the product will not change. There will be no data errors such as occupied inventory not being released.

[0115] Read order reconciliation messages from the Kafka cluster through the data reconciliation process. Perform order reconciliation operations on the order reconciliation operations based on the target order and the order logs generated by the target order based on the order reconciliation operations through the data reconciliation process;

[0116] like Figure 4 As shown in D1, the reconciliation daemon consumes the reconciliation message, and performs an order reconciliation operation on the order reconciliation operation through the data reconciliation process according to the target order and the order log generated based on the order reconciliation operation. Among them, according to the target order and the order log generated based on the order reconciliation operation of the target order, the order reconciliation operation is performed on the order reconciliation operation through the data reconciliation process, including:

[0117] Determine the payment data of the target order according to the sub-order payment summary of the target order;

[0118] According to the payment data and the order log generated by the target order based on the order settlement operation, the order settlement operation is reconciled through the data reconciliation process.

[0119] In the embodiment of the present application, for example, after the account is settled, a series of occupied resources such as coupons are released, and there is a record in the log, and the account can be reconciled according to the record in the log. Assume that the product is priced at 150 yuan, a coupon of 20 yuan and a voucher of 30 yuan are used, and the user should actually spend 100 yuan. After canceling the order, in the order settlement operation, the user should be returned a coupon of 20 yuan and a voucher of 30 yuan. At this time, the reconciliation operation is to determine whether the coupon of 20 yuan and the voucher of 30 yuan are returned to the user after the settlement operation.

[0120] If the data reconciliation is determined to be inconsistent based on the order reconciliation operation, the data reconciliation process is instructed to re-perform the order reconciliation operation.

[0121] In the embodiment of the present application, for example, assuming that the product is priced at 150 yuan, a coupon of 20 yuan and a voucher of 30 yuan are used, the user should actually spend 100 yuan. After the order is canceled, in the order settlement operation, the user should be returned a coupon of 20 yuan and a voucher of 30 yuan. At this time, the reconciliation operation is to determine whether the coupon of 20 yuan and the voucher of 30 yuan are returned to the user after the settlement operation. If any of the coupon of 20 yuan and the voucher of 30 yuan is not returned to the user, then it is determined that the data reconciliation is inconsistent, and the data settlement process is instructed to re-settlement the order.

[0122] Using the method provided in the embodiment of the present application, the generated order is timed through the remote dictionary service database; when the timing of the target order reaches the threshold, an order lock notification for the target order is generated through the remote dictionary service database; through the order lock process, an order cancellation message is created according to the order lock notification, and the order cancellation message is sent to the Kafka cluster; the order cancellation message is read from the Kafka cluster through the order cancellation process; the order cancellation message is consumed through the order cancellation process to perform an order cancellation operation on the target order. It can be seen that the use of the remote dictionary service database can perform a timing operation on the target order, and the lock and cancellation notifications dedicated to the target order can be sent in time through the order lock process and the order cancellation process, and because the Kafka cluster has a high throughput, it can process large batches of messages and improve the throughput of the system, thereby efficiently realizing the automatic cancellation of the target order.

[0123] Exemplary Devices

[0124] See also Figure 2 , which is a schematic diagram of an order cancellation device provided in an embodiment of the present application, the device comprising:

[0125] A timing unit 201 is used to perform timing operations on the generated orders through the remote dictionary service database;

[0126] An order lock notification generating unit 202, configured to generate an order lock notification for a target order through a remote dictionary service database when the timing of the target order reaches a threshold;

[0127] An order cancellation message creation unit 203 is used to create an order cancellation message according to the order lock notification through an order lock process, and send the order cancellation message to a Kafka cluster;

[0128] An order cancellation message reading unit 204, configured to read the order cancellation message from the Kafka cluster through an order cancellation process;

[0129] The order cancellation message consumption unit 205 is used to consume the order cancellation message through the order cancellation process to perform an order cancellation operation on the target order.

[0130] Optionally, the order cancellation message creating unit 203 includes:

[0131] An order status query unit, used to query the order status of the target order through an order locking process;

[0132] The order cancellation message creation subunit is used to create an order cancellation message according to the order lock notification when the order status is uncompleted.

[0133] Optionally, the device further comprises:

[0134] An order settlement message creation unit, configured to create an order settlement message for the target order through the order cancellation process, and send the order settlement message to a Kafka cluster;

[0135] An order settlement message reading unit, configured to read the order settlement message from the Kafka cluster through a data settlement process;

[0136] The order settlement message consumption unit is used to consume the order settlement message through the data settlement process according to the resource occupation information of the target order to perform an order settlement operation, so as to release the occupied resources determined according to the resource occupation information on the platform to which the target order belongs.

[0137] Optionally, the device further comprises:

[0138] An order reconciliation message generating unit, configured to generate an order reconciliation message through the data reconciliation process, and send the order reconciliation message to a Kafka cluster;

[0139] An order reconciliation message reading unit, configured to read the order reconciliation message from the Kafka cluster through a data reconciliation process;

[0140] An order reconciliation operation performing unit, configured to perform an order reconciliation operation on the order reconciliation operation through the data reconciliation process according to the target order and an order log generated by the target order based on the order reconciliation operation;

[0141] The order reconciliation operation re-instruction unit is used to instruct the data reconciliation process to re-perform the order reconciliation operation when it is determined that the data reconciliation is inconsistent based on the order reconciliation operation.

[0142] Optionally, the device further comprises:

[0143] A target order generating unit, configured to generate the target order in response to the resource acquisition request;

[0144] Wherein, if the resources are from multiple resource entities, the target order includes sub-orders corresponding to different resource entities, each of which has a corresponding sub-order payment summary and a sub-order occupancy summary;

[0145] The sub-order payment summary is used to record the payment data of the sub-order, and the sub-order occupancy summary is used to record the resource occupancy information of the sub-order;

[0146] The order settlement message consumption unit includes:

[0147] A target order resource occupancy information determining unit, configured to determine the resource occupancy information of the target order according to the sub-order occupancy summary of the target order;

[0148] An order settlement operation unit, configured to consume the order settlement message through the data settlement process to perform the order settlement operation;

[0149] The order reconciliation operation unit includes:

[0150] A target order payment data determining unit, configured to determine the payment data of the target order according to the sub-order payment summary of the target order;

[0151] An order reconciliation operation unit is used to perform an order reconciliation operation on the order settlement operation through the data reconciliation process according to the payment data and the order log generated by the target order based on the order settlement operation.

[0152] The configuration of each unit or module of the device of the present application can refer to Figure 1 The method shown in the figure is implemented and will not be described in detail here.

[0153] By using the device provided in the embodiment of the present application, the generated order is timed through the remote dictionary service database; when the timing of the target order reaches the threshold, an order lock notification for the target order is generated through the remote dictionary service database; through the order lock process, an order cancellation message is created according to the order lock notification, and the order cancellation message is sent to the Kafka cluster; the order cancellation message is read from the Kafka cluster through the order cancellation process; the order cancellation message is consumed through the order cancellation process to perform an order cancellation operation on the target order. It can be seen that the use of the remote dictionary service database can perform a timing operation on the target order, and the lock and cancellation notifications dedicated to the target order can be sent in time through the order lock process and the order cancellation process, and because the Kafka cluster has a high throughput, it can process large batches of messages and improve the throughput of the system, thereby efficiently realizing the automatic cancellation of the target order.

[0154] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0155] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An order cancellation method, characterized in that: The method comprises: Generate a target order for a resource acquisition request, wherein if the resource originates from multiple resource entities, the target order includes sub-orders corresponding to different resource entities, each sub-order having a corresponding sub-order payment summary and a sub-order occupancy summary; the sub-order payment summary is used to record the payment data of the sub-order, and the sub-order occupancy summary is used to record the resource occupancy information of the sub-order; Performing a timing operation on the target order through a remote dictionary service database; When the timing of the target order reaches a threshold, generating an order locking notification for the target order through a remote dictionary service database; Creating an order cancellation message according to the order lock notification through the order lock process, and sending the order cancellation message to the Kafka cluster; The step of creating an order cancellation message according to the order locking notification through the order locking process includes: querying the order status of the target order through the order locking process; if the order status is unfinished, creating an order cancellation message according to the order locking notification; Reading the order cancellation message from the Kafka cluster through an order cancellation process; The order cancellation message is consumed by the order cancellation process to perform an order cancellation operation on the target order; After consuming the order cancellation message through the order cancellation process and performing an order cancellation operation on the target order, the method further includes: creating an order settlement message for the target order through the order cancellation process, and sending the order settlement message to a Kafka cluster; reading the order settlement message from the Kafka cluster through a data settlement process; determining resource occupancy information of the target order according to the sub-order occupancy summary of the target order, and consuming the order settlement message through the data settlement process to perform an order settlement operation, so as to release occupied resources determined according to the resource occupancy information on the platform to which the target order belongs; the resource occupancy information includes: activity quota occupancy data, point bean deduction status, coupon usage status and inventory occupancy status; Generate an order reconciliation message through the data reconciliation process, and send the order reconciliation message to the Kafka cluster; read the order reconciliation message from the Kafka cluster through the data reconciliation process; perform an order reconciliation operation through the data reconciliation process according to the target order and the order log generated by the target order based on the order reconciliation operation; if it is determined that the data reconciliation is inconsistent based on the order reconciliation operation, instruct the data reconciliation process to re-perform the order reconciliation operation.

2. The method according to claim 1, characterized in that The method further comprises: The performing an order reconciliation operation on the order settlement operation through the data reconciliation process according to the target order and the order log generated by the target order based on the order settlement operation, includes: Determining payment data of the target order according to the sub-order payment summary of the target order; An order reconciliation operation is performed through the data reconciliation process according to the payment data and the order log generated by the target order based on the order reconciliation operation.

3. An order cancellation device, characterized in that: The device comprises: A target order generating unit is used to generate a target order for a resource acquisition request; wherein, if the resource originates from multiple resource entities, the target order includes sub-orders corresponding to different resource entities, each sub-order having a corresponding sub-order payment summary and a sub-order occupancy summary; the sub-order payment summary is used to record the payment data of the sub-order, and the sub-order occupancy summary is used to record the resource occupancy information of the sub-order; A timing unit, used for performing a timing operation on the target order through a remote dictionary service database; an order lock notification generating unit, configured to generate an order lock notification for the target order through a remote dictionary service database when the timing of the target order reaches a threshold; An order cancellation message creation unit, configured to create an order cancellation message according to the order lock notification through an order lock process, and send the order cancellation message to a Kafka cluster; The order cancellation message creation unit includes: an order status query unit, which is used to query the order status of the target order through the order locking process; an order cancellation message creation subunit, which is used to create an order cancellation message according to the order locking notification when the order status is unfinished; An order cancellation message reading unit, configured to read the order cancellation message from the Kafka cluster through an order cancellation process; An order cancellation message consumption unit, configured to consume the order cancellation message through the order cancellation process to perform an order cancellation operation on the target order; The order cancellation message consumption unit includes: a target order resource occupancy information determination unit, configured to determine the resource occupancy information of the target order according to the sub-order occupancy summary of the target order; An order settlement message creation unit, configured to create an order settlement message for the target order through the order cancellation process, and send the order settlement message to a Kafka cluster; An order settlement message reading unit, configured to read the order settlement message from the Kafka cluster through a data settlement process; An order settlement message consumption unit, configured to consume the order settlement message through the data settlement process to perform an order settlement operation, so as to release the occupied resources determined according to the resource occupation information on the platform to which the target order belongs; the resource occupation information includes: activity quota occupation data, point bean deduction status, coupon usage status and inventory occupation status; An order reconciliation message generating unit, configured to generate an order reconciliation message through the data reconciliation process, and send the order reconciliation message to a Kafka cluster; An order reconciliation message reading unit, configured to read the order reconciliation message from the Kafka cluster through a data reconciliation process; An order reconciliation operation performing unit, configured to perform an order reconciliation operation through the data reconciliation process according to the target order and an order log generated by the target order based on the order reconciliation operation; The order reconciliation operation re-instruction unit is used to instruct the data reconciliation process to re-perform the order reconciliation operation when it is determined that the data reconciliation is inconsistent based on the order reconciliation operation.

4. The device according to claim 3, characterized in that The device also includes: The order reconciliation operation unit includes: A target order payment data determining unit, configured to determine the payment data of the target order according to the sub-order payment summary of the target order; An order reconciliation operation unit is used to perform an order reconciliation operation through the data reconciliation process according to the payment data and the order log generated by the target order based on the order settlement operation.

Citation Information

Patent Citations

  • High-concurrency scene processing method and device based on Redis and Kafka online snap-up system

    CN108418821A