A Simulated Shenzhen Stock Exchange Stock Trading Matching System

By simulating the Shenzhen Stock Exchange stock trading matching system, using tgw distribution manager and data queue to achieve 24-hour unlimited matching transactions and function expansion, it solves the time and order volume limitations of the existing system, improves test depth and system stability, Meets the needs of complex trading desks.

CN112465645BActive Publication Date: 2024-09-06ACCELECOM INFORMATION & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011503069.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-18
Publication Date
2024-09-06
Estimated Expiration
2040-12-18

AI Technical Summary

Technical Problem

The existing transaction matching system is subject to time constraints, order volume restrictions and poor functional scalability. It cannot meet the testing needs of complex trading desks, resulting in extended product release time and limited testing depth.

Method used

Designed a simulated Shenzhen Stock Exchange stock trading matching system, including the matching center and tgw distribution manager. By setting up front-end and back-end risk control, data queues and temporary storage space, 24-hour unlimited matching transactions and function expansion were achieved, using production The customer mode is used to process orders to ensure system stability.

Benefits of technology

It achieves 24-hour unlimited matching transactions and function expansion, solves the problem of time and order volume restrictions, improves test depth and system stability, and ensures that the functional verification and release time of complex trading desks are shortened.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112465645B
    Figure CN112465645B
Patent Text Reader

Abstract

The present invention belongs to the field of stock trading. The existing transaction matching system has too many restrictions, is limited by time, is limited by order volume, and cannot expand functions. The present invention provides a system for simulating Shenzhen Stock Exchange stock trading matching, including a matching center and a TGW distribution manager, the TGW distribution manager is arranged between the counter and the matching center, and a series of front-end risk control and a first data queue are arranged between the TWG distribution manager and the counter, and a second data queue is arranged between the TWG distribution manager and the matching component, and the first queue includes a front-end message receiving queue, a first listener, and an exchange message queue; the second queue is connected to a back-end message receiving queue, a second listener, a back-end risk component, and a return TGW message queue. The method for simulating Shenzhen Stock Exchange stock trading matching provided by the present invention can match transactions 24 hours a day without any transaction restrictions, and can expand the matching system of functions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of stock trading and relates to a quantitative trading matching system in the field of financial technology, and in particular to a stock trading matching system of the Shenzhen Stock Exchange. Background Art

[0002] With the development of the financial market, the market demand for financial transactions is growing, and more and more companies are developing trading tools. Trading tools are generally called counters. Hereinafter, counters are used to refer to trading tools. Every company will encounter the problem of counter testing environment. For example, the main function of the counter is trading, and the essence of trading is buying and selling. Without a matching system, the trading function of the counter cannot be verified. At present, the method adopted by various companies is generally to access the matching system provided by the exchange, which provides a series of functions such as risk control and matching.

[0003] The matching system provided by the exchange has the following limitations: the trading hours are short, generally less than 3 hours, that is, only 3 hours of trading time is provided on a working day (not weekends). For trading counters with complex businesses, the testing time is far from enough. Limited by the testing time, the release time of counter products will also be greatly extended; and the function cannot be expanded. For testing tools, functional scalability is very important. For example, each counter has an important function of fund calculation, but in the case of a large number of orders, funds cannot be calculated manually. If the exchange also performs a fund calculation after receiving the order, it can be mutually verified with the counter system. The exchange matching system has too many restrictions, such as each account can only submit 50,000 orders per day, which greatly limits the depth of testing. Summary of the invention

[0004] 1. Technical problems to be solved:

[0005] The existing transaction matching system has too many limitations, is limited by time, is limited by order volume, and cannot expand its functions.

[0006] 2. Technical solution:

[0007] In order to solve the above problems, the present invention provides a matching system for simulating stock transactions of the Shenzhen Stock Exchange, including a matching center and a tgw distribution manager, the tgw distribution manager is arranged between the counter and the matching center, a front-end risk control and a first data queue connected in series are arranged between the twg distribution manager and the counter, a second data queue is arranged between the twg distribution manager and the matching component, the first queue includes a front-end message receiving queue, a first listener, and an exchange message queue, one end of the front-end message receiving queue is connected to the front-end risk control, and the other end is connected to the tgw distribution manager, the counter, the first listener, the exchange message queue and the tgw distribution manager are connected in sequence, the second queue is connected to the back-end message receiving queue, the second listener, the back-end risk component, and the return tgw message queue, the tgw management distributor, the back-end message receiving queue, the second listener, the back-end risk component and the matching center are connected in sequence, one end of the return tgw message queue is connected to the tgw distribution manager, and the other end is connected to the matching center, The return tgw message queue is also connected to the back-end risk component, wherein the tgw is a trading gateway connected to the counter; the front-end risk control performs preliminary verification on the received orders; the front-end message receiving queue receives orders from the counter that pass the front-end risk control; the exchange message queue receives data messages from the exchange; the first listener monitors the exchange queue of the tgw, and once there is data, it is immediately sent to the user who logs in to the tgw; the back-end message receiving queue receives orders from each tgw that pass the front-end risk control; the second listener monitors the back-end message receiving queue, and once there is data, it is immediately transmitted to the back-end risk control; the back-end risk control simulates the risk control of the exchange, performs secondary verification on the received orders, and sends the orders to the matching center after passing; the matching center matches the received orders, following the principles of price priority and time priority; the return tgw message queue receives order data sent by the matching center and the back-end risk control; the tgw distribution manager is a bridge connecting multiple tgws and exchanges to realize data exchange between the two.

[0008] The front-end risk control performs preliminary verification on the received orders, including monitoring the current server date, obtaining the server date every second and saving it. If the read date is inconsistent with the last saved date, the data of non-current dates in the database will be cleared.

[0009] It also includes a temporary storage space, which will continuously receive customers' insurance policies and store them in an orderly manner.

[0010] The first data queue and the second data queue are independent, and the user can copy data from the first data queue and / or the second data queue into the newly developed data queue, thereby realizing the additional functions the user wants without affecting the operation of the system.

[0011] 3. Beneficial effects:

[0012] The method for simulating Shenzhen Stock Exchange stock trading matching provided by the present invention can carry out matching trading 24 hours a day without any trading restrictions, and can expand the function of the matching system. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is a schematic diagram of the present invention.

[0014] Figure 2 This is a system schematic diagram of Example 1.

[0015] Figure 3 This is a schematic diagram of the process of Example 1.

[0016] Figure 4 This is a schematic diagram of Example 2.

[0017] Figure 5 Schematic diagram of Example 3. DETAILED DESCRIPTION

[0018] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0019] like Figure 1 As shown, the matching system includes a matching center and a tgw distribution manager, wherein the tgw distribution manager is arranged between the counter and the matching center, a front-end risk control and a first data queue connected in series are arranged between the twg distribution manager and the counter, and a second data queue is arranged between the twg distribution manager and the matching component.

[0020] The matching system is divided into the TGW part and the exchange part. The TGW part is between the left side of the TGW distribution manager and the counter, and the exchange part is on the right side of the TGW distribution manager.

[0021] The first data queue and the second data queue are independent, and the user can copy data from the first data queue and / or the second data queue into the newly developed data queue, thereby realizing the additional functions the user wants without affecting the operation of the system.

[0022] Example 1

[0023] tgw: the trading gateway connected to the counter; front-end risk control: perform preliminary verification of the received orders; front-end message receiving queue: receive orders from the counter that pass the front-end risk control; exchange message queue: receive data messages from the exchange; first listener: monitor the exchange queue of tgw, and once there is data, send it immediately to the user who logs in to the tgw; back-end message receiving queue: receive orders from each tgw that pass the front-end risk control; second listener: monitor the back-end message receiving queue, and once there is data, immediately transmit it to the back-end risk control; back-end risk control: simulate the risk control of the exchange, perform secondary verification on the received orders, and send the orders to the matching center after passing; matching center: match the received orders for buying and selling, following the principles of price priority and time priority; return tgw message queue: receive order data sent by the matching center and back-end risk control; tgw distribution manager: a bridge connecting multiple tgws and exchanges to realize data exchange between the two.

[0024] like Figure 2 As shown, the first queue includes a front-end message receiving queue, a first listener, and an exchange message queue. One end of the front-end message receiving queue is connected to the front-end risk control, and the other end is connected to the tgw distribution manager. The counter, the first listener, the exchange message queue and the tgw distribution manager are connected in sequence.

[0025] The second queue is connected to the backend message receiving queue, the second listener, the backend risk component, and the return TGW message queue. The TGW management distributor, the backend message receiving queue, the second listener, the backend risk component and the matching center are connected in sequence. One end of the return TGW message queue is connected to the TGW distribution manager and the other end is connected to the matching center. The return TGW message queue is also connected to the backend risk component.

[0026] like Figure 3 As shown, the first step: the counter sends a login, the matching system will respond with a login response, and then send a platform status message and a platform information message.

[0027] Step 2: The counter sends a return synchronization message, and the matching system responds with a corresponding response message.

[0028] Step 3: The counter sends a new order message. The front-end and back-end risk control of the matching system will verify the validity of the order. If it fails, it will respond with a rejection. If it passes, it will enter the matching center, which will decide the final status of the order, whether it is a pending order, fully executed or partially executed. The corresponding message will also be sent back to the counter.

[0029] Step 4: The counter sends a cancellation order message, and the front-end and back-end risk control of the matching system will verify the validity of the order. If it fails, it will respond with a rejection order. If it passes, it will enter the matching center, which will cancel the order and return the corresponding message to the counter.

[0030] Example 2

[0031] like Figure 4 As shown in Example 1, the front-end risk control performs preliminary verification on the received orders, including monitoring the date of the current server, obtaining the server date every second and saving it, until the read date is inconsistent with the last saved date, then clearing the data of non-current dates in the database. This system uses a monitoring thread to monitor the date of the current server, and automatically clears historical data after crossing trading days to solve the problem of excessive accumulation of data for a long time and the inability of the system to run. It also solves the problem of not being able to test during non-trading time.

[0032] Example 3

[0033] like Figure 5 As shown, on the basis of the above embodiment, a temporary storage space is also included, which will continuously receive the customer's insurance policies and store them in order. This system design adopts the producer-consumer model. No matter how many orders the customer places, the background processing will not be affected, and the data will still be processed in order at its own processing speed. This can solve the problem of system processing overload and subsequent crash caused by too many orders.

[0034] Although the present invention has been disclosed as above in terms of preferred embodiments, they are not intended to limit the present invention. Anyone skilled in the art can make various changes or modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection defined by the claims of this application.

Claims

1. A system for simulating stock trading on the Shenzhen Stock Exchange, characterized in that: It includes a matching center and a tgw distribution manager, the tgw distribution manager is arranged between the counter and the matching center, a front-end risk control and a first data queue are arranged in series between the tgw distribution manager and the counter, a second data queue is arranged between the tgw distribution manager and the matching component, the first queue includes a front-end message receiving queue, a first listener, and an exchange message queue, one end of the front-end message receiving queue is connected to the front-end risk control, and the other end is connected to the tgw distribution manager, the counter, the first listener, the exchange message queue and the tgw distribution manager are connected in sequence, and the second queue is connected The back-end message receiving queue, the second listener, the back-end risk component, and the return tgw message queue. The tgw management distributor, the back-end message receiving queue, the second listener, the back-end risk component and the matching center are connected in sequence. One end of the return tgw message queue is connected to the tgw distribution manager and the other end is connected to the matching center. The return tgw message queue is also connected to the back-end risk component, wherein the tgw: the transaction gateway connected to the counter; the front-end risk control: performs preliminary verification of the received orders; the front-end message receiving queue: receives orders from the counter through the front-end risk control; the exchange message queue: receives Data messages from the exchange; the first listener: listens to the exchange queue of tgw, and once there is data, it is immediately sent to the user who logs in to the tgw; the back-end message receiving queue: receives orders from each tgw that pass the front-end risk control; the second listener: listens to the back-end message receiving queue, and once there is data, it is immediately transmitted to the back-end risk control; back-end risk control: simulates the risk control of the exchange, performs a secondary check on the received orders, and sends the orders to the matching center after passing; matching center: matches the received orders, following the principle of price priority and time priority; send back tgw message queue: receives the matching center and back-end message queue The order data sent by the front-end risk control; TGW distribution manager: a bridge connecting multiple TGWs and exchanges to realize data exchange between the two; the front-end risk control performs preliminary verification on the received orders, including monitoring the date of the current server, obtaining the server date every second and saving it, until the read date is inconsistent with the last saved date, then clearing the data of non-current dates in the database, the first data queue and the second data queue are independent, and the user can copy data from the first data queue and / or the first data queue into the newly developed data queue, so as to realize the additional functions the user wants without affecting the system operation.

2. The simulated Shenzhen Stock Exchange stock trading matching system as claimed in claim 1, characterized in that: It also includes a temporary storage space, which will continuously receive customers' insurance policies and store them in an orderly manner.