Order-preserving report method, system and device for real-time flow peak clipping

By introducing real -time traffic peaks in the reporting system, the order method of peak cutting peak cutting, using particle size key and identifying the time to ensure the timeliness of the reporting request, solve the problem of delay in the existing technology medium high -frequency report, improve the processing performance and transaction of the reporting form, and transaction. Opportunities to get ability.

CN119376974APending Publication Date: 2025-01-28民生证券股份有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411347495.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The order reporting system in the prior art has delay problems in high-frequency order reporting scenarios, resulting in the order sent may no longer be applicable to the current market changes, affecting trading opportunities.

Method used

The order method of the preparation of real -time flow peak cutting is adopted, and the formal size Key is pre -processed by the report request, and it is written into the preparation queue and the reporting queue. By judging the latest nature and trailer of the reporting request in the preparation queue, the system ensures that only the latest report requests are processed and sent to avoid delays.

Benefits of technology

Effectively improve the processing performance of the report, so that the system no longer relies on hardware capabilities, achieve higher economic benefits, and ensure the timeliness and accuracy of the report request in the high -frequency report, and enhance the ability of users to obtain transaction opportunities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and particularly discloses an order-preserving report method, system and device for real-time flow peak clipping. The method comprises the following steps: firstly, an upstream service triggers a high-frequency report request for each transaction combination, and a system stores the report request into an order-preserving queue and writes the report request into a full-quantity report queue at the same time; the system processes the report requests in the report queue one by one, queries and verifies the states of the report requests in the order-preserving queue, and judges whether the report requests need to be further sent to the outside or not in combination with key attribute information such as granularity keys, in-transit identifiers and granularity locks in the order-preserving queue; and if the requirements are met, the system sends the report to the outside, and if the requirements are not met, the system skips the report and continues to process the next report request in the report queue, and so on. According to the method provided by the invention, traffic peak clipping can be realized in a high-frequency report scene, the time-lapse report requests in the report queue are automatically filtered, and the report efficiency is ensured while the real-time performance and accuracy of report can also be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, system and device for maintaining order in real-time traffic peak shaving. Background Art

[0002] In the field of financial transactions, due to the ever-changing market conditions, it is necessary to monitor the market in real time and respond to the current market changes with corresponding quotes (i.e. orders) in order to seize more trading opportunities. The traditional method of manually monitoring the market and sending quotes has problems such as low efficiency, operational risks and response delays. These problems not only affect traders' grasp of trading opportunities, but also have an adverse impact on the stability of market prices and market circulation.

[0003] At present, financial institutions mostly use corresponding order systems to implement order work. However, the order systems in the prior art mainly store order requests in a message queue, and the system consumes order data from the message queue in turn and sends order requests to the outside. The order of order requests in the message queue is the order in which the system actually sends orders. This order method has the following shortcomings: first, the order processing performance mainly depends on hardware capabilities and lacks algorithm optimization; second, there is a delay in high-frequency order scenarios, that is, the sent orders may no longer be applicable to the current market changes. The above problems may seriously affect trading opportunities. Summary of the invention

[0004] The purpose of the present invention is to solve some of the above-mentioned problems and to provide a method, system and device for preserving order submission with real-time traffic peak shaving, which can automatically complete the verification and sending of order requests, and at the same time perform peak shaving processing on high-frequency order requests to ensure that the order requests sent are real-time and up-to-date.

[0005] The technical solution of the present invention is as follows: The present invention first provides a method for order preservation for real-time traffic peak shaving, comprising the following steps: S1. Preprocess the order request, including calculating and generating the order granularity key based on the core transaction elements in the order data; S2. Write the pre-processed order request into the order queue, and write the order request into the order queue at the same time; S3. Obtain order request data from the order queue in sequence, determine whether the current order request is the latest order request in the granularity queue corresponding to the order-preserving queue, and determine whether the current order request has an in-transit mark; S3-1. If the judgment result is that it is not the latest order request, skip the current order request, obtain the next order request and make a new judgment; S3-2. If the judgment result is that it is the latest order request and the current order request does not have an in-transit flag, then set an in-transit flag on the current order request and proceed to step S4; S4. Process the current order request and send it out. When the feedback message is successfully received, it means that the current order request has been sent successfully, and the in-transit flag of the current order request is cancelled. It is determined again whether the current order request is the latest order request data in the granularity queue corresponding to the order preservation queue: S4-1, if it is no longer the latest order data, the system obtains the latest order data in the granularity queue and rewrites it into the order queue, so as to prevent the latest order request from being mistakenly skipped by the system because the current order request is in the process of being processed; then return to step S3; S4-2. If it is still the latest order data, the system completes processing the order request and returns to step S3. The system processes the next order request in the order queue until the data in the order queue is empty.

[0006] Furthermore, in step S1, the core transaction elements include the transaction product code, remaining term, buying and selling direction, and clearing speed. Different values ​​of the core transaction elements will generate different granularity key values. Otherwise, the same granularity key value will be generated. For example, if the system calculates and generates the granularity key based on the bond code, remaining term, and clearing speed in the order, then for two order requests with the same bond code, remaining term, and clearing speed, the calculated granularity key value will be the same.

[0007] Furthermore, in step S2, each granularity key in the order-preserving queue corresponds to a granularity queue for storing order request data under the granularity key value.

[0008] Furthermore, in step S2, each granularity queue includes two attribute information: an in-transit flag and a granularity lock. The in-transit flag is a mark on the order request that has not completed the order process in the granularity queue, which is mainly used to block new orders and end checks; that is, for valid order requests that are being processed by the system, an in-transit flag is set, and the status of the in-transit flag can be checked to determine whether there are currently order requests that have not been processed; after the order request is processed, the corresponding in-transit flag needs to be canceled. Granular locks are only locks for the same granularity queue, and the locking granularity is small, so order requests at different granularities do not affect each other. That is, a lock is shared at the same granularity, and different locks are used at different granularities. In this way, the range of the lock is small, and locking will not block the enqueuing of data in other granularities, so the efficiency is high.

[0009] Furthermore, any operation (including reading and writing) on ​​a granularity queue must be performed after obtaining its corresponding granularity lock in advance to ensure thread safety, and operations on different granularity queues will not affect each other. Preferably, a reentrant lock can be used. The advantage of a reentrant lock is that it can be locked again after being locked, without worrying about deadlock problems.

[0010] The present invention also provides a real-time traffic peak shaving order preservation system, which is used to implement the above method. The order preservation system includes: Order preprocessing module: used to preprocess the data of each order request. The preprocessing process includes but is not limited to operations such as generating granular key values ​​based on core transaction elements; Order queue: used to store all order requests triggered by upstream services; Sequence-preserving queue: used to store order requests with different granularity keys. It combines attribute information such as granularity key, in-transit identifier, and granularity lock to implement traffic peak filtering and sequence-preserving processing of order requests. Order processing module: used for processing and sending order requests, including but not limited to operation granularity lock, updating in-transit identification, sending order requests, receiving and sending feedback and other operations.

[0011] The present invention also provides a real-time traffic peak shaving order-preserving order reporting device, including a processor, a memory, and a program stored in the memory for implementing the above method.

[0012] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention uses a dual-queue mode of order queue and order-keeping queue in data processing, optimizes the algorithm for order processing, improves the order processing performance, and makes the system processing performance free from hardware dependence, with higher economic benefits; 2. The present invention introduces attribute information such as granularity key, in-transit identifier and granularity lock into the order-preserving queue. The system implements traffic filtering and order-preserving sending of order requests by using and identifying the status of each attribute, while ensuring thread processing security between different threads, thereby effectively ensuring the timeliness and accuracy of order request processing; 3. The present invention can filter order requests that are no longer applicable to the latest market conditions in high-frequency order scenarios, and process the latest order requests in a timely manner, thereby more effectively obtaining trading opportunities for users. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a process flow chart of the method of the present invention; Figure 2 It is a schematic diagram of the data structure of the order-preserving queue in the present invention; In the figure: 1- granularity key, 2- in-transit identifier, 3- granularity queue, 4- granularity lock. DETAILED DESCRIPTION

[0014] like Figure 1 , 2 As shown, the order-preserving order reporting method for real-time traffic peak shaving of the present invention specifically comprises the following steps: S1. The upstream service triggers an order request. The system first pre-processes the order request. The pre-processing includes generating the order granularity key 1 and other operations based on the core transaction elements in the order. The core transaction elements include the transaction product code, buy and sell direction, and clearing speed. The system will generate different order granularity key 1 values ​​for different core transaction elements of the order, and vice versa. S2. The system writes the pre-processed order request into the order preservation queue. At the same time, the system writes the order request into the order queue. Each granularity key1 in the order preservation queue corresponds to a granularity queue 3, which is used to store all order request data under the granularity key1 value. Each granularity queue 3 contains two attribute information: in-transit identification 2 and granularity lock 4.

[0015] S3. The system obtains order request data from the order queue in sequence, and determines whether the order request is the latest order request in the corresponding granularity queue 3 in the order-preserving queue, and also determines whether it has an in-transit indicator 2: (1) If the judgment result is that it is not the latest order, skip the current order request, then obtain the next order request and make a new judgment; (2) If the judgment result is that it is the latest order and there is no in-transit indicator 2, then the in-transit indicator 2 is set for the current order request, and then the process goes to step S4.

[0016] S4. The system processes the order request and sends it to the outside, and then receives feedback. After successfully receiving the feedback message, it means that the current order request has been sent successfully, and the system cancels its in-transit mark 2; at the same time, it is determined again whether the current order request is the latest order request data in the corresponding granularity queue 3: (1) If it is no longer the latest order request data, the system obtains the latest order data in granularity queue 3 and rewrites it into the order queue, and then returns to step S3; (2) If it is still the latest order request data, the system completes processing of the order request and returns to step S3 to process the next order request in the order queue until the data in the order queue is empty.

[0017] like Figure 2As shown, the data structure of the order-preserving queue in step S2 includes a set of granularity keys 1, each granularity key 1 corresponds to a granularity queue 3, and the granularity queue 3 is used to store order requests under the corresponding granularity; each granularity queue 3 includes an in-transit identifier 2 and a granularity lock 4, wherein the in-transit identifier 2 is used to mark the processing status of an order request in the granularity queue 3, and the granularity lock 4 is used to control the operation of the granularity queue 3. Any operation (including reading and writing) on ​​the granularity queue 3 needs to be controlled based on the granularity lock 4, so as to ensure thread processing safety. Operations of different granularity queues 3 are not affected by each other.

[0018] The order guarantee order system of the present invention comprises: Order preprocessing module: used to preprocess the data of each order request. The preprocessing process includes but is not limited to operations such as generating granular key values ​​based on core transaction elements; Order queue: used to store all order requests triggered by upstream services; Sequence-preserving queue: used to store order requests with different granularity key1, and combine attribute information such as granularity key 1, in-transit identifier 2, and granularity lock 4 to implement traffic peak shaving filtering and sequence-preserving processing of order requests; Order processing module: used for processing and sending order requests, including but not limited to operating granularity lock 4, updating in-transit identification 2, sending order requests, receiving and sending feedback, etc.

[0019] The above are only some embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have combinations and modifications of the aforementioned various technical features. Without departing from the spirit and scope of the present invention, those skilled in the art may improve, modify, or replace the present invention with equivalents, or apply the structure or method of the present invention to other fields to achieve the same effect, which all fall within the scope of protection included in the present invention.

Claims

1. A method for order keeping in real-time traffic peak shaving, characterized in that: The following steps are involved: S1. Preprocess the order request, including calculating and generating the order granularity key based on the core transaction elements in the order data; S2. Write the pre-processed order request into the order queue, and also write the order request into the order queue; S3. Obtain order request data from the order queue in sequence, determine whether the current order request is the latest order request in the granularity queue corresponding to the order-preserving queue, and determine whether the current order request has an in-transit mark; S3-1. If the judgment result is that it is not the latest order request, skip the current order request, obtain the next order request and make a new judgment; S3-2. If the judgment result is that it is the latest order request and the current order request does not have an in-transit flag, set an in-transit flag for the current order request and proceed to step S4; S4. Process the current order request and send it to the outside. When the feedback message is successfully received, it means that the current order request has been sent successfully, and the in-transit mark of the current order request is cancelled; Determine again whether the current order request is the latest order request data in the granularity queue corresponding to the order-preserving queue; S4-1, if it is no longer the latest order request data, the system obtains the latest order data in the granularity queue and rewrites it into the order queue, and then returns to step S3; S4-2. If it is still the latest order request data, the system completes processing of the order request and returns to step S3 to process the next order request in the order queue until the data in the order queue is empty.

2. The method for maintaining the order of real-time traffic peak shaving according to claim 1 is characterized by: In step S1, the core transaction elements include the transaction product code, remaining term, buying and selling direction, and settlement speed; different values ​​of the core transaction elements will generate different granularity key values; otherwise, the same granularity key value will be generated.

3. The method for maintaining the order of real-time traffic peak shaving according to claim 1 is characterized by: In step S2, the system uses a dual-queue mode of a full order queue and an order-preserving queue to perform traffic peak shaving and order-preserving processing on all order requests.

4. The method for maintaining the order of real-time traffic peak shaving according to claim 1 is characterized by: In step S2, each granularity key of the order-preserving queue corresponds to a granularity queue for storing the order request data under the granularity key value.

5. The method for maintaining the order of real-time traffic peak shaving according to claim 4 is characterized by: Each granularity queue contains two attribute information: en-route identification and granularity lock.

6. The method for maintaining the order of real-time traffic peak shaving according to claim 5 is characterized by: All operators of a granularity queue must be controlled through the corresponding granularity lock, and operations on different granularity queues do not affect each other.

7. The method for maintaining the order of real-time traffic peak shaving according to claim 5 is characterized by: The granular lock is a reentrant lock.

8. A real-time traffic peak shaving order preservation system, used to implement the method according to any one of claims 1 to 7, characterized in that: include: Order preprocessing module: preprocesses each order request data. The preprocessing operation includes generating granular key values ​​based on core transaction elements. Order queue: used to store all order requests triggered by upstream services; Sequence-preserving queue: used to store order requests with different granularity keys, and combines granularity keys, in-transit identifiers, and granularity lock information to implement traffic peak shaving filtering and sequence-preserving processing of order requests; Order processing module: used for processing and sending order requests, including operating granularity locks, updating in-transit identification, sending order requests, and receiving feedback.

9. A real-time traffic peak shaving order-preserving order-preserving device, characterized in that: The invention comprises a processor, a memory and a program stored in the memory for implementing the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Out-of-order protection method of transaction system, transaction system, device and medium

    CN121235819A