Order processing method and device, electronic equipment and computer medium
By introducing a pre-cancellation mechanism into the matching system, cancellation instructions are allowed to skip the risk control service and directly enter the matching system, which solves the problem of high latency in cancellation operations and achieves high efficiency and accuracy in order processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, after a cancellation order enters the matching system, it needs to wait for the risk control service to process it, which prolongs the order processing time of the matching system and affects efficiency.
A pre-cancellation mechanism is provided, which allows cancellation instructions to skip the risk control service and directly enter the matching system. Unordered orders are processed through the pre-cancellation queue and the book-out cache queue, ensuring the timeliness and accuracy of cancellation operations.
It improved the order processing efficiency of the matching system, ensured the timeliness and accuracy of order cancellation operations, avoided erroneous cancellations when the order placement instruction arrived before the cancellation instruction, and increased the trust of downstream access parties in the feedback reports.
Smart Images

Figure CN121660765A_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to the field of data processing, and more specifically to an order processing method, apparatus, electronic device, and computer medium. Background Technology
[0002] Matching transactions refer to a transaction method in which the seller places a sales order / sales order in the trading market, and the buyer places a purchase order / purchase order in the trading market. The trading market determines the transaction price between the two parties according to certain principles and generates a transaction contract, and physical delivery is carried out at the delivery warehouse specified in the transaction order.
[0003] In related technologies, in the order placement chain of the upstream trading service system, order instructions need to be calculated and assets frozen by the risk control system before entering the matching system. Given the serial execution mechanism of the matching system, when a cancellation request arises, it is necessary to ensure that the cancellation instruction is processed only after the order instruction has entered the matching system; otherwise, a cancellation rejection report will be sent because the order cannot be found in the matching system's order book. Therefore, the waiting delay for cancellation instructions to enter the matching system significantly increases the order processing time of the matching system, severely impacting its order processing efficiency. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide an order processing method, apparatus, electronic device and computer medium to solve the problem of high latency in order cancellation operations of the matching system, and to provide a pre-cancellation mechanism for the matching service, allowing cancellation instructions to skip the risk control service and enter the matching system in advance, thereby realizing the pre-cancellation of orders that have not been "placed", which greatly improves the order processing efficiency of the matching system.
[0005] In a first aspect, embodiments of this application provide an order processing method, including: In response to a cancellation instruction sent by the transaction service system, a first receiving time of the cancellation instruction is determined, and a first target order to be cancelled is determined based on the cancellation instruction, and a first generation time of the cancellation instruction is determined by the transaction service system; the first generation time is greater than the first receiving time. If the first time interval between the first receiving time and the first generation time is less than the first preset time interval, then it is determined whether the first target order is in the order book; If the first target order is not in the order book, the first target order is added to the pre-cancellation queue and a first cancellation response report is sent.
[0006] In some embodiments, it also includes: If the first target order is in the order book, then send a corresponding response report based on the transaction status of the first target order; and If the first target order is not in the order book, then specifically it includes: Identify whether the first target order is in the pre-cancellation queue; If the first target order is in the pre-cancellation queue, the first cancellation response report is sent directly; if the first target order is not in the pre-cancellation queue, the first target order is added to the pre-cancellation queue and the first cancellation response report is sent.
[0007] In some embodiments, sending a corresponding response report based on the transaction status of the first target order specifically includes: Identify whether the first target order has completed a transaction; If the first target order has the aforementioned transaction information, then identify whether the first target order has been partially completed; If the first target order is partially completed, a partial cancellation response report is sent, and the completed portion of the order corresponding to the first target order is obtained and added to the order book cache queue; if the first target order is completely completed, the first target order is added to the order book cache queue. If the first target order does not have the aforementioned transaction information, a second cancellation response report will be sent.
[0008] In some embodiments, the step of if the first target is not in the pre-cancellation queue specifically includes: Based on the order cancellation instruction, a second generation time is determined when the order placement instruction for the first target order is generated in the transaction service system; the second generation time is less than the first generation time. If the second time interval between the first receiving time and the second generating time is less than or equal to the second preset time interval, then it is identified whether the first target order is in the order outbound cache queue; the second preset time interval is less than or equal to the first preset time interval. If the first target order is not in the order outbound cache queue, then the first target order is added to the pre-cancellation queue, and a first cancellation response report is sent; and If the second time interval is greater than the second preset time interval, or if the first target order is in the order cache queue, then a third cancellation response report is sent.
[0009] In some embodiments, it also includes: In response to an order placement instruction sent by the transaction service system, a second receiving time corresponding to the order placement instruction is determined, and a second target order to be placed is determined based on the order placement instruction, as well as a second generation time for the transaction service system to generate the order placement instruction; If the third time interval between the second receiving time and the second generating time is less than the first preset time interval, then it is determined whether the second target order is in the pre-cancellation queue. If the second target order is in the pre-cancellation queue, then an order rejection report is sent.
[0010] In some embodiments, it also includes: If the second target order is not in the pre-cancellation queue, then identify whether the second target order has transaction information; If the second target order has transaction information, the second target order is added to the book-out cache queue, and a corresponding response report is sent according to the transaction status of the second target order.
[0011] In some embodiments, it also includes: Obtain the storage time of each first cached order in the pre-cancellation queue; Clear the first cached orders whose storage time is greater than or equal to the first preset time interval from the pre-cancellation queue; and / or Obtain the storage time of each second cached order in the book-out cache queue; The second cached orders whose storage time is greater than or equal to the second preset time interval are cleared from the book-out cache queue.
[0012] Secondly, embodiments of this application provide an order processing apparatus, including: The response module is used to respond to a cancellation instruction sent by the transaction service system, determine the first receiving time of the cancellation instruction, determine the first target order to be cancelled according to the cancellation instruction, and determine the first generation time of the cancellation instruction by the transaction service system. The analysis module is used to identify whether the first target order is in the pre-cancellation queue if the first time interval between the first receiving time and the first generation time is less than a first preset time interval. The report sending module is used to add the first target order to the pre-cancellation queue and send a cancellation response report if the first target order is not in the pre-cancellation queue.
[0013] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in embodiments of this application.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in embodiments of this application.
[0015] Fifthly, embodiments of this application provide a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the method described in embodiments of this application.
[0016] The order processing method, apparatus, electronic device, and computer medium provided in this application embodiment can respond to a cancellation instruction sent by a transaction service system, determine the first reception time of the cancellation instruction, and determine the first target order to be cancelled and the first generation time of the cancellation instruction generated by the transaction service system based on the cancellation instruction. If the first time interval between the first reception time and the first generation time is less than a first preset time interval, it identifies whether the first target order is in the order book. If the first target order is not in the order book, it adds the first target order to the pre-cancellation queue and sends a first cancellation response report. This enables the matching service system to directly initiate the pre-cancellation process based on the order information in the transaction service system when the cancellation instruction arrives at the matching service system before the order placement instruction, and can provide timely feedback reports to the access party, facilitating subsequent operations. Furthermore, by identifying whether the first target order is in the order book before adding it to the pre-cancellation queue, this application embodiment effectively avoids the erroneous cancellation of the first target order that arrives at the matching service system before the cancellation instruction, ensuring both the efficiency and accuracy of order processing in the matching service system.
[0017] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0018] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A schematic diagram of the order placement process in the prior art is shown; Figure 2 This paper illustrates an implementation environment architecture diagram of the order processing method provided in an embodiment of this application; Figure 3 A flowchart illustrating an embodiment of the order processing method provided in this application is shown; Figure 4 A schematic diagram illustrating the principle of an order processing method provided in an embodiment of this application is shown; Figure 5 A schematic diagram illustrating the principle of an order processing method provided in another embodiment of this application is shown; Figure 6 A flowchart illustrating an order processing method according to another embodiment of this application is shown; Figure 7 A timing diagram of an order processing method provided in an embodiment of this application is shown; Figure 8 A schematic diagram illustrating the principle of an order processing method provided in yet another embodiment of this application is shown; Figure 9 A timing diagram of an order processing method provided in another embodiment of this application is shown; Figure 10 A schematic diagram of the structure of an order processing apparatus provided in an embodiment of this application is shown; Figure 11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device or server according to embodiments of this application is shown. Detailed Implementation
[0019] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] like Figure 1 As shown, in the relevant technologies, after a transaction order is placed, the trading system performs basic verification. Orders that fail the verification are rejected, bypassing the risk control system and the matching system, and are directly written into a report or updated by the report processing system. Orders that pass the basic verification enter the risk control system for risk control rule verification, cost estimation, asset freezing, and other operations. Then, the trading system sends a pre-matching order instruction to the matching system based on the risk control system's assessment results, or, based on the risk control system's rejection result, bypasses the matching service system and is directly written into a report or updated by the report processing system.
[0022] The matching service system executes processing operations in sequence according to the pre-matching order placement instructions sent by the transaction system, such as sequencing, entering the order book / taking the order, and outputting the report to the report processing system. The report processing system executes the corresponding report processing steps, such as distributing the report to the report consumer, writing the report and updating the order, and pushing the report to the service gateway of the first transaction device and / or the second transaction device.
[0023] It is evident that in the relevant technologies, the order request chain includes the transaction system, risk control system, matching service system, and report processing system. Among them, the risk control system involves high-intensity calculations and multiple database interactions, such as risk control rule verification, cost estimation, and asset freezing. It accounts for a relatively long time in the entire chain, with the risk control service portion accounting for approximately 3 / 4 of the total time spent on order placement.
[0024] However, due to the business nature of trading services, there are a large number of cancellation requests for unexecuted orders, especially those initiated by the trading parties before entering the matching system. These orders do not require complete order processing, and especially do not require corresponding transaction matching. Based on this, this application proposes an order processing method that provides a pre-cancellation mechanism for the matching service. This mechanism allows cancellation instructions to bypass the risk control service and enter the matching system in advance, enabling the matching service system to pre-cancel orders that have not yet been "placed," thus greatly improving the order processing efficiency of the matching system.
[0025] For the specific implementation environment of the order processing method proposed in this application, please refer to [link / reference needed]. Figure 2 . Figure 2 The implementation environment architecture diagram of the order processing method provided in the embodiments of this application is shown.
[0026] like Figure 2 As shown, the implementation environment architecture includes: a first trading device 101, a second trading device 102, a trading system server 103, a risk control system server 104, a matching service system server 105, and a report processing server 106.
[0027] There can be multiple first trading devices 101 and second trading devices 102. The trading system server 103 is used to receive multiple demand information (e.g., a buyer placing a purchase order / purchase order in the trading market) initiated by multiple first trading devices 101 for the target resource and multiple supply information (e.g., a seller placing a sales order / sales order in the trading market) sent by multiple second trading devices 102 for the target resource.
[0028] In this embodiment, the transaction system server 103 also receives cancellation instructions for target resources sent by multiple first transaction devices 101 or multiple second transaction devices 102, and sends the cancellation instructions directly to the matching service system server 105. The matching service system server 105 executes the order processing method proposed in this embodiment to pre-cancel orders for orders whose order instructions have not reached the matching service system server 105 in response to the cancellation instructions sent by the transaction system server 103, and refuses to place the order when the order instruction reaches the matching service system server 105.
[0029] The first trading device 101 and the second trading device 102 are terminal devices that can provide users with a trading operation interface. They can be desktop computers, laptops, smartphones, tablets, e-book readers, smart glasses, smartwatches, etc., but are not limited to these.
[0030] The transaction system server 103, risk control system server 104, matching service system server 105, and report processing server 106 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0031] The first trading device 101 and the second trading device 102 are directly or indirectly connected to the trading system server 103 via wired or wireless communication. Optionally, the aforementioned wireless or wired network uses standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to any combination of Local Area Network (LAN), Metropolitan Area Network (MAN), Wide Area Network (WAN), mobile, wired or wireless network, private network, or virtual private network.
[0032] The order processing method proposed in this application can be implemented by an order processing device, which can be installed on a terminal device or a server.
[0033] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation instruction steps as shown in the following embodiments or drawings, the method may include more or fewer operation instruction steps based on conventional or non-creative effort. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.
[0034] It should be noted that the acquisition or use of data in the embodiments of this application requires the user's consent. The relevant data can only be obtained after the user's authorization, and the acquisition or use of the data complies with the provisions of relevant laws and regulations.
[0035] Please refer to Figure 3 , Figure 3A flowchart illustrating an embodiment of the order processing method provided in this application is shown. Figure 3 and Figure 4 As shown, the method includes: Step 301: In response to the cancellation instruction sent by the transaction service system, determine the first receiving time of the cancellation instruction, and determine the first target order to be cancelled based on the cancellation instruction, as well as the first generation time of the cancellation instruction generated by the transaction service system; the first generation time is greater than the first receiving time.
[0036] It should be noted that the first reception time, EventTime (Cancel), is a timed timestamp assigned by the matching service system to the cancellation instruction. Specifically, the first reception time of the cancellation instruction is the response time of the matching service system upon receiving the cancellation instruction sent by the transaction service system. The cancellation instruction contains relevant information about the first target order to be cancelled, including but not limited to the order identifier of the first target order and the first generation time of the cancellation instruction by the transaction service system. It should be understood that the order identifier of the first target order is the Order ID of the first target order in the transaction service system. That is, the Order ID of the first target order to be cancelled is obtained by parsing the cancellation instruction and used to identify the first target order to be cancelled. The first generation time, OrderTime (Cancel), is a timed timestamp assigned by the transaction service system to the cancellation instruction. Specifically, the first generation time of the cancellation instruction is the time when the transaction service system generates the cancellation instruction upon receiving the cancellation instruction submitted by the user.
[0037] It should also be understood that, since the cancellation instruction is generated in the trading service system and then sent to the matching service system, the first generation time of the cancellation instruction in the trading service system is longer than the first reception time of the cancellation instruction in the matching service system.
[0038] Step 302: If the first time interval between the first receiving time and the first generation time is less than the first preset time interval, then identify whether the first target order is in the order book.
[0039] It should be noted that the first preset time interval T1 is the storage time of the pre-cancellation order in the pre-cancellation order queue. The first preset time interval T1 can be statically or dynamically configured according to the number of cancellations in the transaction service system. This application does not make any specific limitation.
[0040] If the first time interval between the first receipt time and the first generation time is greater than or equal to the first preset time interval, i.e., EventTime(Cancel) - OrderTime(Cancel) ≥ T1, it indicates that the order information corresponding to the cancellation instruction has been cleared, and the order's status before clearing cannot be determined. In this case, the matching service system sends a timeout report. If the first time interval between the first receipt time and the first generation time is less than the first preset time interval, i.e., EventTime(Cancel) - OrderTime(Cancel) < T1, it indicates that the order information corresponding to the cancellation instruction is still stored in the matching service system. In this case, it is determined whether the first target order is in the order book.
[0041] It should be understood that the order book is a sequential sequence of normally received order placement instructions in the matching service system. If the first target order is in the order book, it means that the cancellation instruction arrived at the matching service system later than the order placement instruction for the first target order. In this case, a corresponding response report is sent based on the transaction status of the first target order, such as... Figure 4 As shown, the system determines whether the first target order has any completion information. If the first target order has no completion information, it is directly deleted and a second cancellation response report ("canceled") is sent to inform the access party that the first target order has been successfully cancelled. If the first target order has completion information, it determines whether the first target order is partially completed. If the first target order is partially completed, the uncompleted portion of the first target order is deleted and a partial cancellation response report ("partially_canceled") is sent to inform the access party that the uncompleted portion of the first target order has been successfully cancelled. Furthermore, if the first target order is fully completed, a rejection report ("cancel_unknown_order") is sent, indicating that the first target order has been completed and cannot be cancelled.
[0042] Step 303: If the first target order is not in the order book, add the first target order to the pre-cancellation queue and send the first cancellation response report.
[0043] It should be understood that if the first target order is not in the order book, it means that the cancellation instruction for the first target order arrived at the matching service system before the order placement instruction. In this case, the first target order is added to the pre-cancellation queue so that the cancellation operation can be performed when the first target order meets the cancellation conditions, and the first cancellation response report ("Ordercancellation succeeded") is sent.
[0044] Specifically, such as Figure 4As shown, the system identifies whether the first target order is in the pre-cancellation queue. If the first target order is in the pre-cancellation queue, it means that the first target order has already entered the pre-cancellation process, and a first cancellation response report is sent directly without adding the first target order back to the pre-cancellation queue. If the first target order is not in the pre-cancellation queue, it is added to the pre-cancellation queue to allow the first target order to enter the pre-cancellation process, and a first cancellation response report (“Order cancellation succeeded”) is sent. It should be understood that the first cancellation response report (“Order cancellation succeeded”) is used to inform the access party that the cancellation instruction has been executed.
[0045] Therefore, the order processing method proposed in this application can respond to a cancellation instruction sent by the transaction service system, determine the first reception time of the cancellation instruction, and determine the first target order to be cancelled and the first generation time of the cancellation instruction generated by the transaction service system based on the cancellation instruction. If the first time interval between the first reception time and the first generation time is less than a first preset time interval, it identifies whether the first target order is in the order book. If the first target order is not in the order book, it adds the first target order to the pre-cancellation queue and sends a first cancellation response report. This enables the matching service system to directly initiate the pre-cancellation process based on the order information in the transaction service system when the cancellation instruction arrives at the matching service system before the order placement instruction, and can provide timely feedback reports to the access party, facilitating the access party to perform subsequent operations. Moreover, by identifying whether the first target order is in the order book before adding it to the pre-cancellation queue, this application effectively avoids the erroneous cancellation of the first target order that arrives at the matching service system before the cancellation instruction, ensuring both the efficiency and accuracy of order processing in the matching service system.
[0046] In some embodiments, while the above process ensures that the order indicated by the cancellation instruction can be cancelled, the current feedback report is unreliable for downstream access parties. That is, when the first target order has been completed, because the matching service system does not obtain the corresponding transaction information when processing the cancellation instruction, it cannot provide a compensation mechanism for message loss to the downstream access party. In extreme cases, the downstream access party may lose the preceding transaction information and incorrectly judge the status of the order, leading to business anomalies, such as incorrectly unfreezing frozen assets or releasing user purchasing power. The downstream access party refers to the report consumer that consumes the corresponding report, such as a service system that processes order completion-related business based on the first cancellation response report, such as a risk control system. Specifically, the risk control system unfreezes frozen assets and releases user purchasing power based on the first cancellation response report. Correspondingly, the matching service system also has an upstream access party, which is the consumer that issues the corresponding instruction, such as a transaction service system that generates and issues order placement and cancellation instructions.
[0047] Based on this, a corresponding response report is sent according to the transaction status of the first target order. Specifically, this includes: identifying whether the first target order has transaction information; if the first target order has transaction information, identifying whether the first target order has been partially completed; if the first target order has been partially completed, sending a partial cancellation response report, obtaining the completed portion of the first target order, and adding the completed portion of the order to the order book cache queue; if the first target order has been fully completed, adding the first target order to the order book cache queue; and if the first target order has no transaction information, sending a second cancellation response report.
[0048] Furthermore, if the first target order is not in the pre-cancellation queue, the specific steps include: determining the second generation time of the order placement instruction generated by the transaction service system for the first target order based on the cancellation instruction; if the second time interval between the first receiving time and the second generation time is less than or equal to the second preset time interval, identifying whether the first target order is in the order exit cache queue; if the first target order is not in the order exit cache queue, adding the first target order to the pre-cancellation queue and sending a first cancellation response report; and if the second time interval is greater than the second preset time interval, or if the first target order is in the exit cache queue, sending a third cancellation response report.
[0049] In other words, in this embodiment of the application, by adding an order book cache queue, it is possible to distinguish between cancellation orders where the order placement instruction comes first and the cancellation instruction comes later. Specifically, by adding partially completed orders (including the completed portion of partially completed orders and fully completed orders) to the order book cache queue, the partially completed orders send rejection reports ("cancel_unknown_order") based on their transaction history, instead of the first cancellation response report ("Order cancellationsucceeded"). This effectively enables refined processing of partially completed orders, improves the accuracy of reports sent by the matching service system, and increases the trust of downstream access parties in the feedback reports of the matching service system.
[0050] It should be understood that, in the embodiments of this application, the order book cache queue is a cache sequence of orders deleted from the order book, used to provide the matching service system with a status backtracking query for the completed orders, so that the matching service system can distinguish and identify order cancellations where the cancellation instruction arrives before the order placement instruction and order cancellations where the cancellation instruction arrives after the order placement instruction. That is, by using the storage location of the first target order, it can be determined whether the first target order is an order where the cancellation instruction arrives before the order placement instruction or an order where the cancellation instruction arrives after the order placement instruction.
[0051] Specifically, such as Figure 5As shown, in response to the order cancellation instruction sent by the trading service system, the first receiving time of the order cancellation instruction, EventTime(Cancel), is determined, and the order ID of the first target order to be cancelled is determined according to the order cancellation instruction, as well as the first generation time of the order cancellation instruction, OrderTime(Cancel), is determined by the trading service system. The system determines whether the first time interval between the first reception time and the first generation time is greater than the first preset time interval. If yes, i.e., EventTime(Cancel) - OrderTime(Cancel) > T1, a timeout report ("Timeout") is sent. If no, i.e., EventTime(Cancel) - OrderTime(Cancel) < T1, the system determines whether the first target order is in the order book. If the first target order is in the order book, the system further determines whether the first target order has transaction information. If the first target order has no transaction information, the system directly deletes the first target order and sends a second cancellation response report ("canceled"). If the first target order has transaction information, the system determines whether the first target order is partially completed. If the first target order is partially completed, the system deletes the uncompleted portion of the first target order and sends a partial cancellation response report ("partially_canceled"). At the same time, the system obtains the completed portion of the first target order and adds it to the out-of-book cache queue. If the first target order is fully completed, the system sends a rejection report ("cancel_unknown_order").
[0052] If the first target order is not in the order book, it is determined whether the first target order is in the pre-cancellation queue. If the first target order is in the pre-cancellation queue, the first cancellation response ("Order cancellationsucceeded") is sent directly. If the first target order is not in the pre-cancellation queue, the second generation time (OrderTime(New)) of the order placement instruction generated by the transaction service system is determined according to the cancellation instruction.
[0053] It should be noted that the second generation time, OrderTime(New), is a sequence timestamp assigned to the order instruction by the trading service system. Specifically, the trading service system generates the second generation time of the order instruction when it receives the order instruction submitted by the user. The second generation time is less than the first generation time, meaning the sequence timestamps of the trading service system monotonically increase, and the user places the order and then cancels it in the trading service system. The second preset time interval T2 is the maximum storage duration in the order cache queue. The second preset time interval T2 can be statically or dynamically configured based on the transaction status of the matching service system; this application does not impose specific limitations on it.
[0054] If the second time interval between the first receiving time and the second generation time is greater than the second preset time interval (i.e., EventTime(Cancel) - OrderTime(New) > T2), it indicates that the order information corresponding to the cancellation instruction has been cleared or completed, and the order's status before clearing cannot be determined. In this case, the matching service system sends a rejection report ("cancel_unknown_order"). If the second time interval between the first receiving time and the second generation time is less than or equal to the second preset time interval (i.e., EventTime(Cancel) - OrderTime(New) ≤ T2), it further determines whether the first target order is in the order book cache queue. If the first target order is in the order book cache queue, it indicates that the order placement instruction for the first target order arrived at the matching service system before the cancellation instruction, and the order has been partially completed. Since the matching system adds the completed portion to the order book cache queue, a rejection report ("cancel_unknown_order") is sent for the first target order identified in the order book cache queue.
[0055] If the first target order is not in the order book cache queue, it will be added to the pre-cancellation queue, and a first cancellation response ("Order cancellation succeeded") will be sent. It should be understood that the first target order that can be added to the pre-cancellation queue at this time must meet two conditions at the same time, namely (1) EventTime(Cancel) - OrderTime(New)≤T2; (2) It is not in the order book cache queue. That is to say, the matching service system will start the pre-cancellation process for the first target order that has not expired and has not been completed as a pending cancellation order, add it to the pre-cancellation queue, and wait for the conditions to be met to clear (cancel) it.
[0056] In a preferred embodiment, the storage time of each first cached order in the pre-cancellation queue is obtained, and the first cached orders with a storage time greater than or equal to a first preset time interval are cleared from the pre-cancellation queue.
[0057] In addition, the storage time of each second cached order in the outbound cache queue is obtained; and the second cached orders with a storage time greater than or equal to the second preset time interval are cleared from the outbound cache queue.
[0058] In other words, in this embodiment of the application, when the pre-cancellation queue and the order cache queue have stored corresponding orders for a certain period of time, the orders are cleared in the matching service system. The storage time for the pre-cancellation queue is a first preset time interval T1, and the storage time for the order cache queue is a second preset time interval T2.
[0059] Specifically, the matching service system can check the storage time of each first cached order stored in the pre-cancellation queue at a first preset frequency. If the storage time of a first cached order is greater than or equal to a first preset time interval T1, the order is deleted from the pre-cancellation queue. If the storage time of a first cached order is less than a first preset time interval T2, the order is retained in the pre-cancellation queue. Correspondingly, the system checks the storage time of each second cached order stored in the order-out cache queue at a second preset frequency. If the storage time of a second cached order is greater than or equal to a second preset time interval T2, the order is deleted from the order-out cache queue. If the storage time of a second cached order is less than a second preset time interval T2, the order is retained in the order-out cache queue.
[0060] In some embodiments, the first preset time interval T1 and the second preset time interval T2 have the same duration, i.e., T1=T2, so that the storage overhead of the matching service system is minimized.
[0061] It should also be noted that the pre-cancellation queue and the book-out cache queue only retain the order number. This order number can be the corresponding order identifier OrderID in the transaction service system, or it can be the order identifier assigned to it by the matching service system. For example, the partially completed order is assigned a completed identifier by the matching service system. This application does not make any specific restrictions.
[0062] Furthermore, since cancellation orders may arrive at the matching service system before order placement orders, the matching service system, upon receiving the corresponding order placement order, will... Figure 6 As shown, we have: Step 601: In response to the order placement instruction sent by the transaction service system, determine the second receiving time corresponding to the order placement instruction, and determine the second target order to be placed and the second generation time of the order placement instruction generated by the transaction service system according to the order placement instruction.
[0063] It should be noted that the second receiving time, EventTime(New), is a sequenced timestamp assigned to the order placement instruction by the matching service system. Specifically, the response time of the matching service system upon receiving the order placement instruction sent by the transaction service system is the second receiving time of the cancellation instruction. The order placement instruction contains relevant information about the second target order to be placed, including but not limited to the order identifier of the second target order and the second generation time of the cancellation instruction generated by the transaction service system. It should be understood that the order identifier of the second target order is the Order ID of the second target order in the transaction service system. That is, the Order ID of the second target order to be cancelled is obtained by parsing the order placement instruction to identify the second target order to be placed. It should also be understood that the first target order and the second target order can be the same or different. When the first target order and the second target order are the same, they represent the same order that arrived in the matching service system before the order placement instruction. When the first target order and the second target order are different, they represent a new order that arrived in the matching service system before the order placement instruction (in which case the matching service system has not yet received the corresponding first target order).
[0064] The second generation time, OrderTime(New), is a sequenced timestamp assigned to the order instruction by the trading service system. Specifically, the trading service system generates the second generation time of the order instruction when it receives the order instruction submitted by the user.
[0065] Step 602: If the third time interval between the second receiving time and the second generating time is less than the first preset time interval, then identify whether the second target order is in the preset cancellation queue.
[0066] As described above, the first preset time interval T1 is the storage duration of the pre-cancellation order in the pre-cancellation queue. If the third time interval between the second receiving time and the second generation time is greater than or equal to the first preset time interval, i.e., EventTime(New) - OrderTime(New) ≥ T1, it indicates that the storage time of the order has expired, and a timeout report ("Timeout") is sent. If the third time interval between the second receiving time and the second generation time is less than the first preset time interval, i.e., EventTime(New) - OrderTime(New) < T1, it is further determined whether the second target order is in the pre-cancellation queue, so as to determine whether the second target order is an order that needs to be cancelled because the cancellation instruction arrived before the order placement instruction.
[0067] Step 603: If the second target order is in the pre-cancellation queue, send an order rejection report.
[0068] Specifically, if the second target order is in the pre-cancellation queue, it means that the second target order has received the corresponding cancellation instruction first. At this time, there is no need to execute the corresponding operation corresponding to the order instruction, that is, the order has been cancelled in advance and will not continue to be executed. An order rejection report ("The order has been canceled") is sent to inform the access party that the second target order has been cancelled in the previous process and cannot be executed.
[0069] Therefore, the order processing method proposed in this application can effectively intercept orders that have already received cancellation instructions and send rejection reports by identifying the time interval corresponding to the order instruction and the location of the second target order after receiving the order instruction. This achieves the substantial cancellation of the order to be cancelled and greatly saves the processing efficiency of the matching service system for cancelled orders.
[0070] It should be noted that, as Figure 7 As shown, the time interval between the first receiving time EventTime (Cancel) and the first generating time OrderTime (Cancel) is less than the first preset time interval T1, and the time interval between the second receiving time EventTime (New) and the second generating time OrderTime (New) is less than the first preset time interval T1. The second receiving time EventTime (New) can fall within the first preset time interval T1 after the matching service system adds the order to the pre-cancellation queue at the first receiving time EventTime (Cancel). This ensures that when the second target order is the same as the first target order, the order can be found in the pre-cancellation queue. Consequently, when the matching service system sends the first cancellation response report ("Order cancellation succeeded"), it will not send a transaction report for this order, but instead sends an order rejection report ("The order has been canceled").
[0071] Furthermore, in response to the cancellation order, for partially completed orders, when a new order order is received, if the second target order is not in the pre-cancellation queue, it is determined whether the second target order has transaction information. If the second target order has transaction information, it is added to the outbound cache queue, and a corresponding report is sent according to the transaction status of the second target order.
[0072] Specifically, such as Figure 8As shown, in response to the order placement instruction sent by the transaction service system, the second reception time of the order placement instruction, EventTime(New), is determined. Based on the order placement instruction, the order ID of the second target order to be placed, and the second generation time of the order placement instruction, OrderTime(New), generated by the transaction service system, are determined. It is then determined whether the third time interval between the second reception time and the second generation time is greater than the first preset time interval. If yes, i.e., EventTime(New) - OrderTime(New) > T1, a timeout report ("Timeout") is sent. If no, i.e., EventTime(New) - OrderTime(New) < T1, it is determined whether the second target order is in the pre-cancellation queue. If the second target order is in the pre-cancellation queue, an order rejection report ("The order has been canceled") is sent.
[0073] If the second target order is not in the pre-cancellation queue, the order book calculation process begins. This involves determining if the first target order has any completion information. If the second target order has no completion information, it is added to the order sequence and a new order response report ("new order" (price only)) is sent. If the second target order has completion information, the completed portion (including partially completed, fully completed, and orders that were pending orders but completed with a taker) is added to the out-of-book cache queue. Then, it is determined if the second target order has any remaining uncompleted orders. If so, a response report corresponding to the completed portion ("partially filled") is sent, for example, a partially filled report corresponding to the completed order, and a filled report for this order is sent after the order is fully completed. Alternatively, if there are no remaining uncompleted orders, the existing rules apply.
[0074] It should be understood that after adding the completed order to the order book cache queue, the second cached orders in the order book cache queue with a storage time greater than or equal to the second preset time interval T2 can be further cleared to reduce the storage pressure on the matching service system.
[0075] Therefore, the order processing method proposed in this application can add orders with transaction information to the order book cache queue after the order placement instruction enters the order book calculation stage. This enables the matching service system to know the type of order (cancellation instruction first or order placement instruction first) when it receives a cancellation instruction, thus providing technical support for the matching service system to provide accurate reports.
[0076] It should be noted that, as Figure 9As shown, the time interval between the first receiving time EventTime (Cancel) and the first generating time OrderTime (Cancel) is less than the first preset time interval T1; the time interval between the second receiving time EventTime (New) and the second generating time OrderTime (New) is less than the first preset time interval T1; and the time interval between the first receiving time EventTime (Cancel) and the second generating time OrderTime (New) is less than the second preset time interval T2. At this time, the time EventTime (Taker) after the second receiving time adds the order to the order cache queue is between the second receiving time EventTime (New) and the first receiving time EventTime (Cancel), ensuring that the first receiving time EventTime (Cancel) is necessarily within the second preset time interval T2. This ensures that when an order receives the order placement instruction first and then receives the cancellation instruction, it can only send an order rejection report (“cancel unknown_order”) based on the position of the first receiving time EventTime (Cancel).
[0077] Therefore, the order processing method proposed in this application can ensure that the cancellation instructions sent by the transaction service system can be processed more quickly, while ensuring that orders with earlier order instructions will not send "Order cancellation succeeded" reports, and that orders with later order instructions will not be completed when "Order cancellation succeeded" reports are sent.
[0078] It should also be noted that, in order to ensure the above technical effects, the following conditions must also be met: (1) The timing of the matching service system is monotonically increasing, that is, the two instructions Seq(1) and Seq(2) entering the matching service system are: When Seq(1) > Seq(2), it is certain that EvcntTime(1) > EventTime(2); (2) The time for generating a cancellation order in the trading service system must be greater than the time for generating an order, that is, the second generation time is less than the first generation time. This can be expressed as follows: OrderTime(New)<OrderTime(Cancel) (3) The instruction sequencing time of the matching service system must be greater than the instruction generation time of the transaction service system, that is, the second receiving time is greater than the second generation time and the first receiving time is greater than the first generation time. Specifically, it can be expressed as follows: EventTime(New)>OrderTime(New) EventTime(Cancel)>OrderTime(Cancel) (4) The first receiving time is less than the sum of the second generation time and the second preset time interval, which can be expressed as follows: EventTime(Cancel) <OrderTime(New)+ T2。
[0079] Among them, conditions (1) and (3) above can be implemented by editing the code of the matching service system, and condition (2) can be implemented by editing the code of the transaction service system. This application does not make specific limitations on this.
[0080] The reliability of the aforementioned scheme is demonstrated below based on the above scheme and its limitations.
[0081] Proposition 1: If a cancellation order is entered into the matching service system before the order is placed, and the matching service system sends an "Order cancellation succeeded" report for the corresponding cancellation order, then this order will definitely not be completed.
[0082] Assuming the cancellation order enters the matching service system before the order is placed, and the matching service system responds to the cancellation order by sending an "Order cancellation succeeded" report, a transaction report is generated for this order.
[0083] Proof: Because a special cancellation response report "Order cancellation succeeded" was generated, then:
[0084] It should be understood that Equation 1 must be true; otherwise, the matching service system would not be able to respond to the cancellation instruction and send an "Order cancellation succeeded" report, but instead send a "Timeout" report.
[0085] Similarly, the order placement command also includes:
[0086] The pre-cancellation mechanism works as follows: when a "Order cancellation succeeded" pre-cancellation report is sent, the pre-cancellation queue will cache this order number for at least T1 time. One of the necessary conditions for a transaction to generate a completion report is that the order number is not in this pre-cancellation queue when the order is placed. Since we assume that the transaction has been completed, we have:
[0087] Combining equations 2 and 3:
[0088] get:
[0089] Simplifying, we get:
[0090] Substituting equation 4 into condition (2) that the second generation time is less than the first generation time, we get:
[0091] This contradicts condition (3), so the assumption is invalid. Therefore, the cancellation order enters the matching service system before the order is placed. When the cancellation order sends the "Order cancellation succeeded" report, this order will definitely not be completed.
[0092] Proposition 2: After the order is placed, the cancellation order enters the matching service system. The cancellation order will never send an "Order cancellation succeeded" report.
[0093] Transform Proposition 2 into its contrapositive: If the matching service system responds to the cancellation instruction by sending an "Order cancellation succeeded" report, then the cancellation instruction must not have entered the matching service system after the order instruction was placed (i.e., the cancellation instruction entered the matching service system before or at the same time as the order instruction was placed).
[0094] Suppose that the order cancellation instruction enters the matching service system after the order is placed, and the order cancellation instruction sends an "Order cancellation succeeded" report.
[0095] Based on the assumption that "the cancellation instruction enters the matching service system after the order instruction is placed", we have:
[0096] Because the order matching service system sent an "Order cancellation succeeded" report in response to the cancellation command, this order must not be in the order book's output cache at the time of cancellation; otherwise, a "cancel_unknown_order" report would be generated. Therefore:
[0097] get:
[0098]
[0099] Substituting equation 6 into condition (4), we get:
[0100] because
[0101] This contradicts condition (3), so the assumption is invalid. Therefore, the cancellation order enters the matching service system after the order is placed, and the cancellation order will definitely not send an "Order cancellation succeeded" report.
[0102] It should be noted that although the operation of the method of the present invention is described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed in order to achieve the desired result.
[0103] Figure 10 A schematic diagram of the structure of an order processing apparatus provided in an embodiment of this application is shown.
[0104] like Figure 10 As shown, the order processing device 10 includes: The response module 11 is used to respond to the cancellation instruction sent by the transaction service system, determine the first receiving time of the cancellation instruction, determine the first target order to be cancelled according to the cancellation instruction, and the first generation time of the cancellation instruction generated by the transaction service system. The analysis module 12 is configured to identify whether the first target order is in the pre-cancellation queue if the first time interval between the first receiving time and the first generation time is less than a first preset time interval; and if the first target order is not in the pre-cancellation queue, add the first target order to the pre-cancellation queue and send a cancellation response report.
[0105] In some embodiments, the analysis module 12 is further configured to: if the first target order is in the order book, send a corresponding response report based on the transaction status of the first target order; and If the first target order is not in the order book, then specifically it includes: Identify whether the first target order is in the pre-cancellation queue; If the first target order is in the pre-cancellation queue, then the first cancellation response report is sent directly; If the first target is not in the pre-cancellation queue, the first target order is added to the pre-cancellation queue, and a first cancellation response report is sent.
[0106] In some embodiments, the analysis module 12 is further configured to: Identify whether the first target order has completed a transaction; If the first target order has the aforementioned transaction information, then identify whether the first target order has been partially completed; If the first target order is partially completed, a partial cancellation response report is sent, and the completed portion of the order corresponding to the first target order is obtained and added to the order book cache queue; if the first target order is completely completed, the first target order is added to the order book cache queue. If the first target order does not have the aforementioned transaction information, a second cancellation response report will be sent.
[0107] In some embodiments, the analysis module 12 is further configured to: If the first target is not in the pre-cancellation queue, then specifically it includes: Based on the order cancellation instruction, a second generation time is determined when the order placement instruction for the first target order is generated in the transaction service system; the second generation time is less than the first generation time. If the second time interval between the first receiving time and the second generating time is less than or equal to the second preset time interval, then it is identified whether the first target order is in the order outbound cache queue; the second preset time interval is less than or equal to the first preset time interval. If the first target order is not in the order outbound cache queue, then the first target order is added to the pre-cancellation queue, and a first cancellation response report is sent; and If the second time interval is greater than the second preset time interval, or if the first target order is in the order cache queue, then a third cancellation response report is sent.
[0108] In some embodiments, the response module 11 is further configured to: respond to an order placement instruction sent by the transaction service system, determine a second receiving time corresponding to the order placement instruction, determine a second target order to be placed based on the order placement instruction, and determine a second generation time for the transaction service system to generate the order placement instruction; The analysis module 12 is further configured to: identify whether the second target order is in the pre-cancellation queue if the third time interval between the second receiving time and the second generating time is less than the first preset time interval; and if the second target order is in the pre-cancellation queue, send an order rejection report.
[0109] In some embodiments, the analysis module 12 is further configured to: If the second target order is not in the pre-cancellation queue, then identify whether the second target order has transaction information; If the second target order has transaction information, the second target order is added to the book-out cache queue, and a corresponding response report is sent according to the transaction status of the second target order.
[0110] In some embodiments, the analysis module 12 is further configured to: Obtain the storage time of each first cached order in the pre-cancellation queue; Clear the first cached orders whose storage time is greater than or equal to the first preset time interval from the pre-cancellation queue; and / or Obtain the storage time of each second cached order in the book-out cache queue; The second cached orders whose storage time is greater than or equal to the second preset time interval are cleared from the book-out cache queue.
[0111] It should be understood that the modules or modules described in the order processing device 10 are related to the reference. Figure 3 The steps in the described method correspond to each other. Therefore, the operations and features described above for the method also apply to the order processing device 10 and its included modules, and will not be repeated here. The order processing device 10 can be pre-implemented in the browser or other security applications of an electronic device, or it can be loaded into the browser or its security applications of an electronic device through download or other means. The corresponding modules in the order processing device 10 can cooperate with the modules in the electronic device to implement the solutions of the embodiments of this application.
[0112] The division of modules or units mentioned in the detailed description above is not mandatory. In fact, according to the embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0113] The following is for reference. Figure 11 , Figure 11 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of this application is shown. like Figure 11As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1102 or programs loaded from storage section 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the system's operating instructions. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0114] The following components are connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1110 as needed so that computer programs read from them can be installed into storage section 1108 as needed.
[0115] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 2 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program contains program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit (CPU) 1101, it performs the functions defined in the system of this application.
[0116] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operational instructions of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two connected blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified functions or operational instructions, or using a combination of dedicated hardware and computer instructions.
[0118] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including a response module and an analysis module. The names of these units or modules do not necessarily limit the specific unit or module itself. For example, a response module can also be described as "responding to a cancellation instruction sent by a transaction service system, determining a first time of receiving the cancellation instruction, determining a first target order to be cancelled based on the cancellation instruction, and the transaction service system generating the first time of generating the cancellation instruction."
[0119] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs that, when used by one or more processors, execute the order processing method described in this application.
[0120] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. An order processing method, characterized in that, include: In response to a cancellation instruction sent by the transaction service system, a first receiving time of the cancellation instruction is determined, and a first target order to be cancelled is determined based on the cancellation instruction, as well as a first generation time of the cancellation instruction generated by the transaction service system. The first generation time is greater than the first receiving time; If the first time interval between the first receiving time and the first generation time is less than the first preset time interval, then it is determined whether the first target order is in the order book; If the first target order is not in the order book, the first target order is added to the pre-cancellation queue and a first cancellation response report is sent.
2. The order processing method according to claim 1, characterized in that, Also includes: If the first target order is in the order book, then send a corresponding response report according to the transaction status of the first target order; as well as If the first target order is not in the order book, then specifically it includes: Identify whether the first target order is in the pre-cancellation queue; If the first target order is in the pre-cancellation queue, the first cancellation response report is sent directly; if the first target order is not in the pre-cancellation queue, the first target order is added to the pre-cancellation queue and the first cancellation response report is sent.
3. The order processing method according to claim 2, characterized in that, Sending the corresponding response report based on the transaction status of the first target order specifically includes: Identify whether the first target order has completed a transaction; If the first target order has the aforementioned transaction information, then identify whether the first target order has been partially completed; If the first target order is partially completed, a partial cancellation response report is sent, and the completed portion of the order corresponding to the first target order is obtained and added to the order book cache queue; if the first target order is completely completed, the first target order is added to the order book cache queue. If the first target order does not have the aforementioned transaction information, a second cancellation response report will be sent.
4. The order processing method according to claim 3, characterized in that, If the first target is not in the pre-cancellation queue, then specifically it includes: Based on the order cancellation instruction, a second generation time is determined when the order placement instruction for the first target order is generated in the transaction service system; the second generation time is less than the first generation time. If the second time interval between the first receiving time and the second generating time is less than or equal to the second preset time interval, then it is identified whether the first target order is in the order outbound cache queue; the second preset time interval is less than or equal to the first preset time interval. If the first target order is not in the order outbound cache queue, then the first target order is added to the pre-cancellation queue, and a first cancellation response report is sent; and If the second time interval is greater than the second preset time interval, or if the first target order is in the order cache queue, then a third cancellation response report is sent.
5. The order processing method according to claim 1, characterized in that, Also includes: In response to an order placement instruction sent by the transaction service system, a second receiving time corresponding to the order placement instruction is determined, and a second target order to be placed is determined based on the order placement instruction, as well as a second generation time for the transaction service system to generate the order placement instruction; If the third time interval between the second receiving time and the second generating time is less than the first preset time interval, then it is determined whether the second target order is in the pre-cancellation queue. If the second target order is in the pre-cancellation queue, then an order rejection report is sent.
6. The order processing method according to claim 5, characterized in that, Also includes: If the second target order is not in the pre-cancellation queue, then identify whether the second target order has transaction information; If the second target order has transaction information, the second target order is added to the book-out cache queue, and a corresponding response report is sent according to the transaction status of the second target order.
7. The order processing method according to any one of claims 1-6, characterized in that, Also includes: Obtain the storage time of each first cached order in the pre-cancellation queue; Clear the first cached orders from the pre-cancellation queue whose storage time is greater than or equal to the first preset time interval; and / or Get the storage time of each second cached order in the book-out cache queue; The second cached orders whose storage time is greater than or equal to the second preset time interval are cleared from the book-out cache queue.
8. An order processing device, characterized in that, include: The response module is used to respond to a cancellation instruction sent by the transaction service system, determine the first receiving time of the cancellation instruction, determine the first target order to be cancelled according to the cancellation instruction, and determine the first generation time of the cancellation instruction by the transaction service system. The first generation time is greater than the first receiving time; The analysis module is used to identify whether the first target order is in the order book if the first time interval between the first receiving time and the first generation time is less than a first preset time interval; if the first target order is not in the order book, the first target order is added to the pre-cancellation queue and a first cancellation response report is sent.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the order processing method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the order processing method as described in any one of claims 1-7.