Method and device for realizing security report accelerated processing based on assembly line optimization, processor and computer readable storage medium thereof

By optimizing the processing of securities orders through a pipeline, issues of data integrity and transmission stability were resolved, resulting in an efficient and robust securities trading process that ensures the accuracy and continuity of orders during transmission.

CN119048239APending Publication Date: 2024-11-29GUOTAI JUNAN SECURITIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411246871.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Existing technologies present data integrity challenges in securities trading, such as data loss, sequence disorder, and duplicate transmission. Furthermore, existing methods may lead to increased periods of unavailable order placement or reliance on the duplicate order rejection mechanism of the exchange's front-end gateway, affecting the continuity and efficiency of trading.

Method used

A pipeline-based optimization approach is adopted to break down securities order processing into multiple steps that are executed in parallel, including message restoration, inspection and preprocessing, encoding and decoding, scheduling and transmission. Through high-availability connections and order scheduling strategies, the integrity and reliability of messages during transmission are ensured.

Benefits of technology

It improves the processing efficiency and throughput of securities orders, ensures accurate order transmission under various network conditions, and enhances the stability and reliability of the trading process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048239A_ABST
    Figure CN119048239A_ABST
Patent Text Reader

Abstract

The invention relates to a method for realizing security report accelerated processing based on assembly line optimization. The method comprises the following steps: a first-stage assembly line: receiving binary stream messages from an internal message bus and an exchange callback protocol stack; the second-stage assembly line is used for checking and preprocessing the received message; the third-level assembly line is used for message encoding and decoding; the fourth-level assembly line is used for scheduling and executing the coded uplink message and reporting the uplink message to the exchange preposed gateway through a TCP (Transmission Control Protocol); and the fifth-level assembly line is used for converting the decoded downlink message into a binary stream transmission format. By the adoption of the method and device for achieving security report accelerated processing based on assembly line optimization, the processor and the computer readable storage medium of the processor, the overall report efficiency and yield are improved; the security order can be ensured to be accurately transmitted to the target exchange in an efficient and robust mode under various network conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, in particular to the field of transaction channels, and specifically refers to a method, device, processor and computer-readable storage medium thereof for realizing accelerated processing of securities orders based on pipeline optimization. Background Art

[0002] With the rapid development of my country's securities market, securities investors have put forward higher and higher requirements for the stability and performance of trading channels. As a trading channel that connects the front-end gateways of various exchanges and exchanges data, securities trading quotations need to solve the data integrity challenges encountered by securities orders in the process of transmission to the exchanges, including key issues such as data loss, sequence disorder and repeated transmission, as well as efficient and stable order submission under the premise of data integrity.

[0003] In order to ensure the integrity and reliability of order data, some existing methods choose to reject all orders when the connection is disconnected, and restore the uplink message based on the exchange message confirmation when the connection is established. This method increases the duration and frequency of orders that cannot be placed and reduces the continuity of orders; some existing methods choose to cache all orders when the connection is disconnected, and restore the uplink message based on the exchange message confirmation when the connection is established. This method will cause repeated transmission of orders and needs to rely on the duplicate order rejection mechanism of the exchange's front-end gateway; and in order to prevent problems such as thread conflicts and race conditions, existing methods usually use a single-threaded approach to process orders. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, device, processor and computer-readable storage medium for accelerating the processing of securities orders based on pipeline optimization, which are simple to operate, efficient and stable, and have a wide range of applications.

[0005] In order to achieve the above-mentioned purpose, the method, device, processor and computer-readable storage medium for realizing accelerated processing of securities orders based on pipeline optimization of the present invention are as follows:

[0006] The method for accelerating the processing of securities orders based on pipeline optimization is mainly characterized in that the method comprises the following steps:

[0007] (1) In the first-level pipeline, binary stream messages are received from the internal message bus and the exchange callback protocol stack, and the messages are restored from their transmission format to the original data structure or object, and forwarded to the second-level pipeline;

[0008] (2) In the second-stage pipeline, the received message is checked and preprocessed, and the message is assigned to a quotation processing unit according to a specific routing rule and forwarded to the third-stage pipeline;

[0009] (3) In the third-level pipeline, the uplink message is encoded into the message format agreed upon by the exchange's front-end gateway, the message is encoded and decoded, and the downlink message is decoded into the message format used by the internal trading system;

[0010] (4) In the fourth-level pipeline, the encoded uplink message is scheduled and executed based on the quotation processing unit, and reported to the exchange front-end gateway through the TCP protocol;

[0011] (5) In the fifth stage of the pipeline, the decoded downlink message is converted into a binary stream transmission format and sent to the internal transaction system through the message bus.

[0012] Preferably, the step (2) specifically comprises the following steps:

[0013] (2.1) Perform business logic processing on the uplink and downlink messages routed to the trading gateway, and establish a one-to-one high-availability connection with the exchange front-end gateway;

[0014] (2.2) Assign quotation processing units to messages according to specific routing rules. If an uplink order message is received from the internal trading system, a specific quotation processing unit is matched according to the trading market, seat channel, and business type of the order; if a downlink return message is received from the exchange front-end gateway, a specific quotation processing unit is obtained according to the connection channel used; and forwarded to the third-level pipeline.

[0015] Preferably, the step (3) specifically comprises the following steps:

[0016] (3.1) If an up order message is received from the internal trading system, proceed to step (3.2); if a down report message is received from the exchange front gateway, proceed to step (3.3); if a disconnection response is received from the exchange front gateway, proceed to step (3.4); if a connection completion response is received from the exchange front gateway, proceed to step (3.5); if a login completion response is received from the exchange front gateway, proceed to step (3.6);

[0017] (3.2) Directly construct an order request that complies with the exchange interface specification, and forward it to the fourth-level pipeline to be reported to the exchange front-end gateway; if an error occurs during the above processing, simulate the construction of a rejection report message, and forward it to the fifth-level pipeline to be reported to the internal trading system, and end the step;

[0018] (3.3) Decode the message format used by the internal trading system, update the report index table maintained by the quotation processing unit, and forward it to the fifth-level pipeline to be reported to the internal trading system, ending the step;

[0019] (3.4) Based on the connection channel information provided by the quotation processing unit, a connection session establishment request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to execute session establishment, and the step ends;

[0020] (3.5) Based on the connection channel information provided by the quotation processing unit and the breakpoint index of the last return in the return index table, a login authentication request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to be reported to the exchange front-end gateway, and the step ends;

[0021] (3.6) Based on the next order contract number expected by the exchange front-end gateway in the response content, construct an order synchronization request that complies with the exchange interface specification and forward it to the fourth-level pipeline, submit the uplink order to be synchronized to the exchange front-end gateway, and end the step.

[0022] Preferably, the step (4) specifically comprises the following steps:

[0023] (4.1) If the third-level pipeline forwards the order message to the fourth-level pipeline after processing the order message, and the fourth-level pipeline reports normally when processing the order message, then continue with step (4.2); if the fourth-level pipeline is blocked and waiting when processing the order message, then continue with step (4.3); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection disconnection message, then continue with step (4.5); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection completion message, then continue with step (4.6); if the third-level pipeline forwards the quotation synchronization request to the fourth-level pipeline after processing the login message, then continue with step (4.7);

[0024] (4.2) The order message is submitted based on the quotation processing unit, and the step ends;

[0025] (4.3) Cache the order to the end of the blocking queue and wait for the next wake-up, and continue with step (4.4);

[0026] (4.4) The order message is awakened based on the offer processing unit, and the step ends;

[0027] (4.5) Processing the session establishment request based on the offer processing unit, and ending the step;

[0028] (4.6) Based on the offer processing unit, the login authentication request is processed, and the step ends;

[0029] (4.7) The offer processing unit processes the offer synchronization request and ends the step.

[0030] Preferably, the step (4.2) is specifically as follows:

[0031] Check the order blocking queue of the quotation processing unit. If there is no blocking message waiting in the queue at this time, and the current quotation processing unit is in a tradable state, the order is sent to the TCP protocol stack to execute the exchange order, and the order is entered into the order cache queue as an in-transit order.

[0032] Preferably, the step (4.4) is specifically as follows:

[0033] Traverse all quotation processing units in the tradable state, resubmit the head order of the order blocking queue, if the submission is successful, the order is removed from the blocking queue and enters the order cache queue as an in-transit order.

[0034] Preferably, the step (4.5) specifically comprises the following steps:

[0035] (4.5.1) Setting the quotation processing unit to a non-tradable state;

[0036] (4.5.2) Attempt to establish a session based on the connection channel information provided by the offer processing unit. If the current connection channel is in an unstable state, release the old connection channel and switch to the backup link to establish the session.

[0037] Preferably, the step (4.6) specifically comprises the following steps:

[0038] (4.6.1) Setting the quotation processing unit to a non-tradable state;

[0039] (4.6.2) The login authentication message is sent to the exchange front-end gateway. If the login authentication is successful, the exchange front-end gateway will retransmit the report message in order from the breakpoint.

[0040] Preferably, the step (4.7) specifically comprises the following steps:

[0041] (4.7.1) Setting the quotation processing unit to a non-tradable state;

[0042] (4.7.2) According to the order breakpoint information contained in the quotation synchronization request, the orders that have not been received by the exchange front-end gateway are dequeued from the order ready queue, and these orders are cached in order at the head of the order blocking queue waiting for the next wake-up;

[0043] (4.7.3) Set the quotation processing unit to a tradable state.

[0044] The device for realizing accelerated processing of securities orders based on pipeline optimization has the following main features: the device comprises:

[0045] a processor configured to execute computer executable instructions;

[0046] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for accelerating the processing of securities orders based on pipeline optimization are implemented.

[0047] The processor for realizing accelerated processing of securities orders based on pipeline optimization has the main feature that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing accelerated processing of securities orders based on pipeline optimization are realized.

[0048] The main feature of the computer-readable storage medium is that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for accelerating the processing of securities orders based on pipeline optimization.

[0049] The method, device, processor and computer-readable storage medium thereof for accelerating the processing of securities orders based on pipeline optimization of the present invention are used to split large tasks into multiple small tasks or steps for parallel execution, thereby improving the overall order efficiency and output; the method effectively solves the data integrity challenges encountered by securities orders in the process of transmission to the exchange by optimizing the order scheduling strategy, including key issues such as data loss, sequence disorder and repeated transmission. The present invention can ensure that under various network conditions, securities orders can be accurately and correctly transmitted to the target exchange in an efficient and robust manner. This technological innovation significantly improves the throughput and reliability of the transaction process, and provides solid technical support for the efficient operation and stability of the financial market. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of a method for accelerating the processing of securities orders based on pipeline optimization according to the present invention DETAILED DESCRIPTION

[0051] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.

[0052] The method for accelerating the processing of securities orders based on pipeline optimization of the present invention comprises the following steps:

[0053] (1) In the first-level pipeline, binary stream messages are received from the internal message bus and the exchange callback protocol stack, and the messages are restored from their transmission format to the original data structure or object, and forwarded to the second-level pipeline;

[0054] (2) In the second-stage pipeline, the received message is checked and preprocessed, and the message is assigned to a quotation processing unit according to a specific routing rule and forwarded to the third-stage pipeline;

[0055] (3) In the third-level pipeline, the uplink message is encoded into the message format agreed upon by the exchange's front-end gateway, the message is encoded and decoded, and the downlink message is decoded into the message format used by the internal trading system;

[0056] (4) In the fourth-level pipeline, the encoded uplink message is scheduled and executed based on the quotation processing unit, and reported to the exchange front-end gateway through the TCP protocol;

[0057] (5) In the fifth stage of the pipeline, the decoded downlink message is converted into a binary stream transmission format and sent to the internal transaction system through the message bus.

[0058] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:

[0059] (2.1) Perform business logic processing on the uplink and downlink messages routed to the trading gateway, and establish a one-to-one high-availability connection with the exchange front-end gateway;

[0060] (2.2) Assign quotation processing units to messages according to specific routing rules. If an uplink order message is received from the internal trading system, a specific quotation processing unit is matched according to the trading market, seat channel, and business type of the order; if a downlink return message is received from the exchange front-end gateway, a specific quotation processing unit is obtained according to the connection channel used; and forwarded to the third-level pipeline.

[0061] As a preferred embodiment of the present invention, the step (3) specifically comprises the following steps:

[0062] (3.1) If an up order message is received from the internal trading system, proceed to step (3.2); if a down report message is received from the exchange front gateway, proceed to step (3.3); if a disconnection response is received from the exchange front gateway, proceed to step (3.4); if a connection completion response is received from the exchange front gateway, proceed to step (3.5); if a login completion response is received from the exchange front gateway, proceed to step (3.6);

[0063] (3.2) Directly construct an order request that complies with the exchange interface specification, and forward it to the fourth-level pipeline to be reported to the exchange front-end gateway; if an error occurs during the above processing, simulate the construction of a rejection report message, and forward it to the fifth-level pipeline to be reported to the internal trading system, and end the step;

[0064] (3.3) Decode the message format used by the internal trading system, update the report index table maintained by the quotation processing unit, and forward it to the fifth-level pipeline to be reported to the internal trading system, ending the step;

[0065] (3.4) Based on the connection channel information provided by the quotation processing unit, a connection session establishment request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to execute session establishment, and the step ends;

[0066] (3.5) Based on the connection channel information provided by the quotation processing unit and the breakpoint index of the last return in the return index table, a login authentication request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to be reported to the exchange front-end gateway, and the step ends;

[0067] (3.6) Based on the next order contract number expected by the exchange front-end gateway in the response content, construct an order synchronization request that complies with the exchange interface specification and forward it to the fourth-level pipeline, submit the uplink order to be synchronized to the exchange front-end gateway, and end the step.

[0068] As a preferred embodiment of the present invention, the step (4) specifically comprises the following steps:

[0069] (4.1) If the third-level pipeline forwards the order message to the fourth-level pipeline after processing the order message, and the fourth-level pipeline reports normally when processing the order message, then continue with step (4.2); if the fourth-level pipeline is blocked and waiting when processing the order message, then continue with step (4.3); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection disconnection message, then continue with step (4.5); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection completion message, then continue with step (4.6); if the third-level pipeline forwards the quotation synchronization request to the fourth-level pipeline after processing the login message, then continue with step (4.7);

[0070] (4.2) The order message is submitted based on the quotation processing unit, and the step ends;

[0071] (4.3) Cache the order to the end of the blocking queue and wait for the next wake-up, and continue with step (4.4);

[0072] (4.4) The order message is awakened based on the offer processing unit, and the step ends;

[0073] (4.5) Processing the session establishment request based on the offer processing unit, and ending the step;

[0074] (4.6) Based on the offer processing unit, the login authentication request is processed, and the step ends;

[0075] (4.7) The offer processing unit processes the offer synchronization request and ends the step.

[0076] As a preferred embodiment of the present invention, the step (4.2) is specifically as follows:

[0077] Check the order blocking queue of the quotation processing unit. If there is no blocking message waiting in the queue at this time, and the current quotation processing unit is in a tradable state, the order is sent to the TCP protocol stack to execute the exchange order, and the order is entered into the order cache queue as an in-transit order.

[0078] As a preferred embodiment of the present invention, the step (4.4) is specifically:

[0079] Traverse all quotation processing units in the tradable state, resubmit the head order of the order blocking queue, if the submission is successful, the order is removed from the blocking queue and enters the order cache queue as an in-transit order.

[0080] As a preferred embodiment of the present invention, the step (4.5) specifically comprises the following steps:

[0081] (4.5.1) Setting the quotation processing unit to a non-tradable state;

[0082] (4.5.2) Attempt to establish a session based on the connection channel information provided by the offer processing unit. If the current connection channel is in an unstable state, release the old connection channel and switch to the backup link to establish the session.

[0083] As a preferred embodiment of the present invention, the step (4.6) specifically comprises the following steps:

[0084] (4.6.1) Setting the quotation processing unit to a non-tradable state;

[0085] (4.6.2) The login authentication message is sent to the exchange front-end gateway. If the login authentication is successful, the exchange front-end gateway will retransmit the report message in order from the breakpoint.

[0086] As a preferred embodiment of the present invention, the step (4.7) specifically comprises the following steps:

[0087] (4.7.1) Setting the quotation processing unit to a non-tradable state;

[0088] (4.7.2) According to the order breakpoint information contained in the quotation synchronization request, the orders that have not been received by the exchange front-end gateway are dequeued from the order ready queue, and these orders are cached in order at the head of the order blocking queue waiting for the next wake-up;

[0089] (4.7.3) Set the quotation processing unit to a tradable state.

[0090] The device for realizing accelerated processing of securities orders based on pipeline optimization of the present invention comprises:

[0091] a processor configured to execute computer executable instructions;

[0092] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for accelerating the processing of securities orders based on pipeline optimization are implemented.

[0093] The processor of the present invention is used to realize accelerated processing of securities orders based on pipeline optimization, wherein the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing accelerated processing of securities orders based on pipeline optimization are realized.

[0094] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for accelerating the processing of securities orders based on pipeline optimization.

[0095] In the specific implementation mode of the present invention, refer to Figure 1 The overall process of this embodiment includes the following parts:

[0096] A: Build the first-level pipeline, receive binary stream messages from the internal message bus and the exchange callback protocol stack, and restore the messages from their transmission format to the original data structure or object, and then forward them to the next-level pipeline for message preprocessing. This process isolates the traffic between the quotation and the internal trading system and the external exchange front-end gateway, avoiding the overflow of internal bus messages or exchange callback messages caused by the blocking of quotation messages, and involves the following key classes:

[0097] A1: Quote application class: implements the common initialization process of the five-level pipeline and provides a unified processing entry for upstream messages. It restores the binary stream message from the internal message bus to the original order message object and then forwards it to the next level pipeline for message preprocessing.

[0098] A2: Exchange callback class: implements the callback class interface of the exchange front-end gateway and provides a unified processing entry for downlink messages, restores the binary message stream from the TCP protocol stack to the original return message object, and then forwards it to the next level pipeline for message preprocessing.

[0099] A3: Internal order message class: Define the fields of the order message according to the format agreed upon by the internal trading system, such as trading market, seat number, business type, contract code, buying and selling direction, declared price, declared quantity, order number, etc.

[0100] A4: External reporting message class: Define the fields of the reporting message according to the format agreed upon by the exchange's front-end gateway, such as trading market, seat number, business type, contract code, buying and selling direction, transaction price, transaction quantity, transaction number, etc.

[0101] B: Build the second-level pipeline, check and pre-process the received messages, assign the quotation processing unit to the messages according to specific routing rules, and then forward them to the next-level pipeline for message encoding and decoding. This process realizes the support of multiple exchanges for a single quotation, as well as the static load balancing of the exchange front-end, involving the following key classes:

[0102] B1: Message preprocessing class: implements the main process of the secondary pipeline. If an uplink order message is received from the internal trading system, a specific quotation processing unit is matched according to the trading market, seat channel, and business type of the order. If a downlink return message is received from the exchange front-end gateway, a specific quotation processing unit is obtained according to the connection channel used, and then forwarded to the next level of pipeline for message encoding and decoding;

[0103] B2: Quote processing unit class: It mainly processes the business logic of the upstream and downstream messages routed to the trading gateway, and establishes a one-to-one high-availability connection with the exchange front-end gateway to ensure that the order messages sent upstream to the exchange front-end gateway are kept in order, not duplicated, and not lost, and to ensure that the return messages sent downstream to the internal trading system are kept in order, not duplicated, and not lost.

[0104] C: Build the third-level pipeline, encode the uplink message into the message format agreed upon by the exchange front-end gateway, decode the downlink message into the message format used by the internal trading system, and then forward it to the next-level pipeline for message scheduling and execution. This process involves the following key classes:

[0105] C1: Message engine class: distributes messages to different message codecs according to the message type number. During the system initialization phase, the mapping relationship between all message codecs and message type numbers will be registered to this message engine;

[0106] C2: Order message encoding class: Encode the internal order message, construct an order request that complies with the exchange interface specification, and then forward it to the fourth-level pipeline to be reported to the exchange front-end gateway. If an error occurs during the above processing, a rejection report message is simulated and constructed, and then forwarded to the fifth-level pipeline to be reported to the internal trading system;

[0107] C3: Report message decoding class: decodes the downlink report message from the exchange front-end gateway into the message format used by the internal trading system, updates the report index table maintained by the quotation processing unit, and then forwards it to the fifth-level pipeline to be reported to the internal trading system;

[0108] C4: Connection response decoding class: decodes the connection response message. If the connection is successful, it constructs a login authentication request that complies with the exchange interface specification based on the connection channel information provided by the quotation processing unit and the breakpoint index of the last report in the report index table, and then forwards it to the fourth-level pipeline to be reported to the exchange front-end gateway; if the connection fails, it constructs a connection session establishment request that complies with the exchange interface specification, and then forwards it to the fourth-level pipeline to execute session establishment;

[0109] C5: Authentication response decoding class: decodes the authentication response message. If the authentication is successful, it constructs an order synchronization request that complies with the exchange interface specification based on the next order contract number expected by the exchange front-end gateway in the response content, and then forwards it to the fourth-level pipeline to report the upstream order to be synchronized to the exchange front-end gateway; if the authentication fails, the operation and maintenance personnel are required to manually modify the login authentication information.

[0110] The third-level pipeline's processing logic for different messages is executed after the second-level pipeline; the third-level pipeline can obtain different messages from the message queue, including order messages, report messages, disconnection messages, connection completion messages, and login completion messages, and then execute different code processing logic according to the message type; after the third-level pipeline completes message processing, it will forward the message to the fourth-level pipeline.

[0111] D: Construct the fourth-level pipeline, schedule and execute the encoded uplink message based on the quotation processing unit, and report it to the exchange front-end gateway through the TCP protocol. This process effectively solves the data integrity challenge encountered by securities orders during transmission to the exchange. The specific steps are as follows:

[0112] D1: The order message is submitted based on the offer processing unit. First, the order blocking queue of the offer processing unit is checked. If there is no blocking message waiting in the queue at this time, and the current offer processing unit is in a tradable state, then the order will be sent to the TCP protocol stack to execute the exchange order, and enter the order ready queue as an in-transit order;

[0113] D2: Block order messages based on the quotation processing unit. If an exception occurs during the order submission process, such as disconnection of the exchange, overflow of the TCP protocol stack, the number of requests sent per second exceeding the permitted number, or there are unprocessed blocking messages in the initial order blocking queue, or the current quotation processing unit is not yet in a tradable state, then the order will be cached at the end of the blocking queue and wait for the next wake-up;

[0114] D3: The order message is woken up based on the offer processing unit. After each message processing is completed, the four-level pipeline thread will traverse all the offer processing units in the tradable state. The head order of the order blocking queue will be re-submitted, and the successfully submitted order will be removed from the blocking queue and enter the order ready queue as an in-transit order. This process is called processing backlog. In order to ensure that the order backlog can be processed normally when the thread message queue is empty, the offer introduces an idle message in the thread message queue. There is always and only one idle message during the program running, ensuring that the four-level pipeline thread can process the backlog at any time.

[0115] D4: based on the offer processing unit, the session establishment request is processed. First, the offer processing unit is set to a non-tradable state (to be connected). Then, the session is attempted to be established according to the connection channel information provided by the offer processing unit. If the current connection channel is in an unstable state, the old connection channel is released and the session is switched to the standby link for establishment.

[0116] D5: Based on the offer processing unit, the login authentication request is processed. First, the offer processing unit is set to a non-tradable state (pending authentication), and then the login authentication message (including the reporting breakpoint) is reported to the exchange front-end gateway. If the login authentication is successful, the exchange front-end gateway will retransmit the reporting message in order from the breakpoint to ensure that the downlink message is not duplicated or lost;

[0117] D6: Based on the quotation processing unit, the quotation processing unit is first set to a non-tradable state (pending synchronization). Then, according to the order breakpoint information contained in the quotation synchronization request, the orders that have not been received by the exchange front gateway are dequeued from the order ready queue, and these orders are cached in order to the head of the order blocking queue waiting for the next wake-up, so as to achieve non-duplication and non-loss of uplink messages. Finally, the quotation processing unit is set to a tradable state.

[0118] D1 to D5 are the processing logic of the fourth-level pipeline for different messages, which are executed after step C; after the third-level pipeline processes the order message, it will forward the order message to the fourth-level pipeline. There are two situations when the fourth-level pipeline processes the order: a. Normal submission, then continue with D1, b. Blocking and waiting, then continue with D2. If the order processing result is blocked, in order to prevent starvation, the order needs to be awakened at a certain time, then continue with D3; after the third-level pipeline processes the connection disconnection message, it will forward the session establishment request to the fourth-level pipeline, then continue with D4; after the third-level pipeline processes the connection completion message, it will forward the session establishment request to the fourth-level pipeline, then continue with D5; after the third-level pipeline processes the login message, it will forward the quotation synchronization request to the fourth-level pipeline, then continue with D6.

[0119] E: Build the fifth-level pipeline to convert the decoded downlink message into binary stream transmission format and send it to the internal transaction system through the message bus.

[0120] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.

[0121] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0122] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0123] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0124] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0125] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.

[0126] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0127] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0128] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0129] The method, device, processor and computer-readable storage medium thereof for accelerating the processing of securities orders based on pipeline optimization of the present invention are used to split large tasks into multiple small tasks or steps for parallel execution, thereby improving the overall order efficiency and output; the method effectively solves the data integrity challenges encountered by securities orders in the process of transmission to the exchange by optimizing the order scheduling strategy, including key issues such as data loss, sequence disorder and repeated transmission. The present invention can ensure that under various network conditions, securities orders can be accurately and correctly transmitted to the target exchange in an efficient and robust manner. This technological innovation significantly improves the throughput and reliability of the transaction process, and provides solid technical support for the efficient operation and stability of the financial market.

[0130] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.

Claims

1. A method for accelerating the processing of securities orders based on pipeline optimization. It is characterized in that The method comprises the following steps: (1) In the first-level pipeline, binary stream messages are received from the internal message bus and the exchange callback protocol stack, and the messages are restored from their transmission format to the original data structure or object, and forwarded to the second-level pipeline; (2) In the second-stage pipeline, the received message is checked and preprocessed, and the message is assigned to a quotation processing unit according to a specific routing rule and forwarded to the third-stage pipeline; (3) In the third-level pipeline, the uplink message is encoded into the message format agreed upon by the exchange's front-end gateway, the message is encoded and decoded, and the downlink message is decoded into the message format used by the internal trading system; (4) In the fourth-level pipeline, the encoded uplink message is scheduled and executed based on the quotation processing unit, and reported to the exchange front-end gateway through the TCP protocol; (5) In the fifth stage of the pipeline, the decoded downlink message is converted into a binary stream transmission format and sent to the internal transaction system through the message bus.

2. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 1, It is characterized in that The step (2) specifically comprises the following steps: (2.1) Perform business logic processing on the uplink and downlink messages routed to the trading gateway, and establish a one-to-one high-availability connection with the exchange front-end gateway; (2.2) Assign quotation processing units to messages according to specific routing rules. If an uplink order message is received from the internal trading system, a specific quotation processing unit is matched according to the trading market, seat channel, and business type of the order; if a downlink return message is received from the exchange front-end gateway, a specific quotation processing unit is obtained according to the connection channel used; and forwarded to the third-level pipeline.

3. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 1, It is characterized in that The step (3) specifically comprises the following steps: (3.1) If an up order message is received from the internal trading system, proceed to step (3.2); if a down report message is received from the exchange front gateway, proceed to step (3.3); if a disconnection response is received from the exchange front gateway, proceed to step (3.4); if a connection completion response is received from the exchange front gateway, proceed to step (3.5); if a login completion response is received from the exchange front gateway, proceed to step (3.6); (3.2) Directly construct an order request that complies with the exchange interface specification, and forward it to the fourth-level pipeline to be reported to the exchange front-end gateway; if an error occurs during the above processing, simulate the construction of a rejection report message, and forward it to the fifth-level pipeline to be reported to the internal trading system, and end the step; (3.3) Decode the message format used by the internal trading system, update the report index table maintained by the quotation processing unit, and forward it to the fifth-level pipeline to be reported to the internal trading system, ending the step; (3.4) Based on the connection channel information provided by the quotation processing unit, a connection session establishment request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to execute session establishment, and the step ends; (3.5) Based on the connection channel information provided by the quotation processing unit and the breakpoint index of the last return in the return index table, a login authentication request that complies with the exchange interface specification is constructed and forwarded to the fourth-level pipeline to be reported to the exchange front-end gateway, and the step ends; (3.6) Based on the next order contract number expected by the exchange front-end gateway in the response content, construct an order synchronization request that complies with the exchange interface specification and forward it to the fourth-level pipeline, submit the uplink order to be synchronized to the exchange front-end gateway, and end the step.

4. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 1, It is characterized in that The step (4) specifically comprises the following steps: (4.1) If the third-level pipeline forwards the order message to the fourth-level pipeline after processing the order message, and the fourth-level pipeline reports normally when processing the order message, then continue with step (4.2); if the fourth-level pipeline is blocked and waiting when processing the order message, then continue with step (4.3); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection disconnection message, then continue with step (4.5); if the third-level pipeline forwards the session establishment request to the fourth-level pipeline after processing the connection completion message, then continue with step (4.6); if the third-level pipeline forwards the offer synchronization request to the fourth-level pipeline after processing the login message, then continue with step (4.7); (4.2) Report the order message based on the offer processing unit and end the step; (4.3) Cache the order to the end of the blocking queue and wait for the next wake-up, and continue with step (4.4); (4.4) The order message is awakened based on the offer processing unit, and the step ends; (4.5) Processing the session establishment request based on the offer processing unit, and ending the step; (4.6) Based on the offer processing unit, the login authentication request is processed, and the step ends; (4.7) The offer processing unit processes the offer synchronization request and ends the step.

5. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 4, It is characterized in that The step (4.2) is specifically: Check the order blocking queue of the quotation processing unit. If there is no blocking message waiting in the queue at this time, and the current quotation processing unit is in a tradable state, the order is sent to the TCP protocol stack to execute the exchange order, and the order is entered into the order cache queue as an in-transit order.

6. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 4, It is characterized in that The step (4.4) is specifically: Traverse all quotation processing units in the tradable state, resubmit the head order of the order blocking queue, if the submission is successful, the order is removed from the blocking queue and enters the order cache queue as an in-transit order.

7. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 4, It is characterized in that The step (4.5) specifically comprises the following steps: (4.5.1) Setting the quotation processing unit to a non-tradable state; (4.5.2) Attempt to establish a session based on the connection channel information provided by the offer processing unit. If the current connection channel is in an unstable state, release the old connection channel and switch to the backup link to establish the session.

8. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 4, It is characterized in that The step (4.6) specifically comprises the following steps: (4.6.1) Setting the quotation processing unit to a non-tradable state; (4.6.2) The login authentication message is reported to the exchange front-end gateway. If the login authentication is successful, the exchange front-end gateway will retransmit the report message in order from the breakpoint.

9. The method for accelerating the processing of securities orders based on pipeline optimization according to claim 4, It is characterized in that The step (4.7) specifically comprises the following steps: (4.7.1) Setting the quotation processing unit to a non-tradable state; (4.7.2) According to the order breakpoint information contained in the quotation synchronization request, the orders that have not been received by the exchange front-end gateway are dequeued from the order ready queue, and these orders are cached in order at the head of the order blocking queue waiting for the next wake-up; (4.7.3) Set the quotation processing unit to a tradable state.

10. A device for accelerating the processing of securities orders based on pipeline optimization, It is characterized in that The device comprises: a processor configured to execute computer executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, each step of the method for accelerating the processing of securities orders based on pipeline optimization as described in any one of claims 1 to 9 is implemented.

11. A processor for accelerating securities order processing based on pipeline optimization, It is characterized in that The processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the method for accelerating the processing of securities orders based on pipeline optimization described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for accelerating the processing of securities orders based on pipeline optimization as described in any one of claims 1 to 9.