Risk control transaction implementation method, device and storage medium

By building a risk control transaction implementation device on the FPGA chip, parallel processing technology is used to solve the problem of long execution time of traditional methods under large data volumes, and more efficient risk control transaction processing is achieved.

CN117853110BActive Publication Date: 2025-05-06YUSUR TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311717066.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2025-05-06
Estimated Expiration
2043-12-13

AI Technical Summary

Technical Problem

In the case of large amount of data, the traditional risk control transaction implementation method has a long execution time, and there is a problem of low execution efficiency of the transaction process.

Method used

The risk control transaction implementation device is adopted based on the FPGA chip. The transaction processing module receives transaction instructions and generates query instructions. The hardware database module performs parallel processing on the FPGA chip, querys and updates the relevant record tables from the preset memory to complete the risk control transaction.

Benefits of technology

By converting the logic of transaction execution into hardware circuits and performing parallel processing on the FPGA chip, the speed and efficiency of transaction processing are improved, the delay time is reduced, and the problem of long execution time is solved when the data volume is large.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117853110B_ABST
    Figure CN117853110B_ABST
Patent Text Reader

Abstract

The present invention provides a risk control transaction implementation method, device and storage medium, the method comprising: receiving a transaction instruction through a transaction processing module, the transaction instruction including a transaction order number, a transaction price and a transaction time; generating a query instruction based on the transaction order number through the transaction processing module and sending it to a hardware database module, so that after receiving the query instruction, the hardware database module executes the query instruction, queries from a preset memory to obtain order information corresponding to a target order indicated by the transaction order number and returns it to the transaction processing module; after receiving the order information, the transaction processing module queries and updates an unsuccessful quantity record table, an unsuccessful amount record table, a gradient price table, a buying direction transaction table or a selling direction transaction table based on the order information, the transaction price and the transaction time, to complete the risk control transaction; it can solve the problem of long execution time and low transaction process execution efficiency when the data volume is large; it can improve the transaction processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, device and storage medium for implementing risk control transactions. Background Art

[0002] In recent years, with the rapid development of the capital market and the application of algorithmic trading technology (especially high-frequency trading) worldwide, the securities industry faces huge technical challenges in the field of low-latency trading. High-precision, low-latency trading capabilities are one of the core competitiveness of securities companies. High-speed data acquisition and strategy calculation capabilities are the core of various high-frequency trading algorithms. As the delay in publishing real-time securities market information has been reduced to microseconds, the industry's requirements for high-frequency trading delays have also reached the microsecond level. Therefore, an efficient risk control transaction implementation method is needed.

[0003] At present, traditional methods for implementing risk control transactions include: using full memory optimization in the form of software to store and calculate risk control transaction data.

[0004] However, when using full-memory optimization in the form of software to store and calculate risk control transaction data, the execution time is greatly affected by the amount of data, and the execution time jitter is large. When the amount of data is large, the execution time is long, and there is a problem of low efficiency in the transaction process execution. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a risk control transaction implementation method, device and storage medium to eliminate or improve one or more defects in the prior art. It can solve the problem of long execution time and low transaction process execution efficiency when the data volume is large.

[0006] One aspect of the present invention provides a risk control transaction implementation method, which is applied to a risk control transaction implementation device, wherein the risk control transaction implementation device includes a transaction processing module and a hardware database module; the risk control transaction implementation device is constructed based on an FPGA chip; the method includes the following steps:

[0007] Receive a transaction instruction through a transaction processing module, the transaction instruction including a transaction order number, a transaction price and a transaction time;

[0008] Generate a query instruction based on the transaction order number through the transaction processing module and send it to the hardware database module, so that after receiving the query instruction, the hardware database module executes the query instruction, queries from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and returns it to the transaction processing module;

[0009] After receiving the order information, the transaction processing module queries and updates the untransacted quantity record table, untransacted amount record table, gradient price table, buy-side transaction table or sell-side transaction table based on the order information, transaction price and transaction time to complete the risk control transaction.

[0010] Optionally, the order information includes the buying and selling direction of the target order when the order is placed, the placing result of the target order, the placing price of the target order, or the placing quantity of the target order.

[0011] Optionally, based on the order information, the transaction price and the transaction time, query and update the untransacted quantity record table, the untransacted amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table, including:

[0012] When the pending order result indicates that the target order is successfully executed, the unexecuted quantity is updated in the unexecuted quantity record table;

[0013] In the unfulfilled amount record table, the unfulfilled amount is updated based on the pending order price and the filled quantity of the target order;

[0014] In the gradient price table, update the unfilled quantity corresponding to the pending order price;

[0015] When the buying and selling direction of the target order is the buy direction when the order is placed, query the buy direction transaction table, and compare the buy direction transaction price in the buy direction transaction table with the transaction price; when the transaction price is less than the buy direction transaction price, update the buy direction transaction table based on the transaction price and transaction time; or, compare the buy direction transaction time in the buy direction transaction table with the transaction time; when the difference between the transaction time and the buy direction transaction time is greater than the preset time length, update the buy direction transaction table based on the transaction price and transaction time.

[0016] Optionally, based on the order information, the transaction price and the transaction time, the untransacted quantity record table, the untransacted amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table are queried and updated respectively, further comprising:

[0017] When the buying and selling direction of the target order is the selling direction when the order is placed, query the selling direction transaction table, and compare the selling direction transaction price in the selling direction transaction table with the transaction price; when the transaction price is greater than the selling direction transaction price, update the selling direction transaction table based on the transaction price and transaction time; or, compare the selling direction transaction time in the selling direction transaction table with the transaction time; when the difference between the transaction time and the selling direction transaction time is greater than the preset time length, update the selling direction transaction table based on the transaction price and transaction time.

[0018] Optionally, when the target order is the first order, based on the transaction time and transaction price, the buy side transaction table and / or the sell side transaction table are updated (determining whether to update the buy side transaction table or the sell side transaction table is determined based on the buy and sell direction when the order is placed).

[0019] Optionally, based on the order information, transaction price and transaction time, the untransacted quantity record table, untransacted amount record table, gradient price table, buy-side transaction table or sell-side transaction table are queried and updated respectively. After the risk control transaction is completed, the following is also included:

[0020] Based on the transaction instructions and order information, an update receipt is generated and sent to the user terminal.

[0021] Optionally, the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table is stored in a preset memory;

[0022] Alternatively, the untraded quantity record table, the untraded amount record table, the buy-side transaction table or the sell-side transaction table is stored in the transaction processing module; and the gradient price table is stored in a preset memory.

[0023] Optionally, the order information also includes the rule group hit when the target order is placed and the index address of the rule group.

[0024] Another aspect of the present invention provides a risk control transaction implementation device, which is applied to the above-mentioned risk control transaction implementation method, and the risk control transaction implementation device includes:

[0025] The transaction processing module is used to: receive a transaction instruction, which includes a transaction order number, a transaction price and a transaction time; generate a query instruction based on the transaction order number through the transaction processing module and send it to the hardware database module;

[0026] The hardware database module is used to: after receiving the query instruction, execute the query instruction, query from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and return it to the transaction processing module;

[0027] The transaction processing module is also used to: after receiving the order information, based on the order information, transaction price and transaction time, query and update the untransacted quantity record table, untransacted amount record table, gradient price table, buy direction transaction table or sell direction transaction table to complete the risk control transaction.

[0028] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the above-mentioned risk control transaction implementation method are implemented.

[0029] The risk control transaction realization method, device and storage medium of the present invention are applied to the risk control transaction realization device, which includes a transaction processing module and a hardware database module; the transaction processing module receives the transaction instruction, and the transaction instruction includes the transaction order number, the transaction price and the transaction time; the transaction processing module generates a query instruction based on the transaction order number and sends it to the hardware database module, so that the hardware database module executes the query instruction after receiving the query instruction, queries the order information corresponding to the target order indicated by the transaction order number from the preset memory and returns it to the transaction processing module; after receiving the order information, the transaction processing module queries and updates the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buying direction transaction table or the selling direction transaction table based on the order information, the transaction price and the transaction time, and completes the risk control transaction; it can solve the problem that the execution time is long and the transaction process execution efficiency is low when the data volume is large; the risk control transaction realization device is constructed based on the FPGA chip, the transaction execution logic is converted into a hardware circuit, and parallel processing is performed on the FPGA chip. In this way, the speed and efficiency of transaction processing can be improved, and the delay time can be reduced.

[0030] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0031] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0033] Figure 1 It is a structural schematic diagram of a risk control transaction implementation device in one embodiment of the present invention;

[0034] Figure 2 The present invention is a flowchart of a method for implementing risk control transactions in another embodiment of the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0036] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0037] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0038] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0039] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0040] The following is an introduction to the risk control transaction implementation device provided by this application.

[0041] like Figure 1 The figure shows a schematic diagram of the structure of a risk control transaction implementation device provided by an embodiment of the present application. In this embodiment, the risk control transaction implementation device is constructed based on an FPGA (Field-Programmable Gate Array) chip. FPGA chips have programmable logic and parallel processing capabilities, and are suitable for high-performance, low-latency application scenarios, such as risk control and transaction implementation. Based on the programmable characteristics of FPGA chips, the logic of transaction execution can be converted into hardware circuits and processed in parallel on the FPGA chip. In this way, the speed and efficiency of transaction processing can be improved, and the delay time can be reduced.

[0042] according to Figure 1 It can be seen that the risk control transaction implementation device at least includes: a transaction processing module 110 and a hardware database module 120.

[0043] The transaction processing module 110 is used to: receive a transaction instruction, which includes a transaction order number, a transaction price and a transaction time; generate a query instruction based on the transaction order number through the transaction processing module and send it to the hardware database module 120.

[0044] In this embodiment, the transaction instruction is a transaction message, which is sent by the upstream terminal to the transaction processing module. The upstream terminal refers to the upper-level component or system where the transaction data is generated or in the transmission process, including but not limited to the transaction place or market terminal, transaction access gateway or external transaction system.

[0045] The hardware database module 120 is implemented based on the FPGA chip, and the storage data corresponding to the hardware database module 120 is stored in a preset memory (Double Data Rate, DDR). The preset memory can be a memory set in a memory slot on the FPGA chip, or a memory connected to the FPGA chip. This embodiment does not limit the connection method between the preset memory and the FPGA chip.

[0046] In one example, memory slots are integrated on the FPGA chip. These memory slots can accommodate various types of memory modules, such as DDR memory modules; by connecting the memory slots to the FPGA chip, high-speed data read and write operations can be achieved, and sufficient storage capacity can be provided for the risk control transaction implementation device.

[0047] In another example, the memory is connected to the FPGA chip through an external interface, wherein the external interface includes but is not limited to a PCIe (Peripheral Component Interconnect Express) interface or an Ethernet interface. In this case, the memory can be located in the host system where the FPGA chip is located, or connected to a remote storage device through a network.

[0048] Another way is to connect the memory to the FPGA chip through an external interface, such as using a PCIe (Peripheral Component Interconnect Express) interface or an Ethernet interface. In this case, the memory can be located in the host system where the FPGA chip is located, or connected to a remote storage device through a network. Doing so can provide greater storage capacity and flexibility, but may introduce additional latency and communication overhead.

[0049] In actual implementation, when the storage data corresponding to the hardware database module 120 is small, the storage data can be stored in the hardware database module 120. The user can adjust the storage location of the storage data according to actual conditions. This embodiment does not limit the storage location of the storage data corresponding to the hardware database module 120.

[0050] In this embodiment, the hardware database module 120 is used to: after receiving a query instruction, execute the query instruction, query from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and return it to the transaction processing module 110.

[0051] In this embodiment, the transaction order number corresponds to the order one by one and is used to uniquely indicate the order; the transaction order number can be letters, numbers, or a combination of letters and numbers. This embodiment does not limit the implementation method of the transaction order number.

[0052] The transaction processing module 110 is also used to: after receiving the order information, query and update the untransacted quantity record table, untransacted amount record table, gradient price table, buy-side transaction table or sell-side transaction table based on the order information, transaction price and transaction time to complete the risk control transaction.

[0053] Among them, the buy direction transaction table is used to record the smallest buy direction transaction price and the time of the smallest buy direction transaction price in the past three minutes. If there are multiple smallest buy transaction prices within three minutes, the time closest to the current time is taken.

[0054] The sell transaction table is used to record the largest sell transaction price and the time of the largest sell transaction price in the past three minutes. If there are multiple largest sell transaction prices in three minutes, the time closest to the current time is taken.

[0055] The untraded quantity record table is used to record the untraded quantity of the stock in units of stocks; the untraded amount record table is used to record the untraded amount of the stock in units of stocks; the gradient price table is used to record the untraded quantity corresponding to each price in units of cents.

[0056] In one example, the untraded quantity record table, the untraded amount record table, the gradient price table, the buy-side transaction table, or the sell-side transaction table is stored in a preset memory.

[0057] In another example, the untransacted quantity record table, the untransacted amount record table, the buyer's transaction table or the seller's transaction table is stored in the transaction processing module; and the gradient price table is stored in a preset memory.

[0058] In the case where the gradient price table is stored in a preset memory, before updating the gradient price table, it is also necessary to query the memory address table to obtain the storage address of the gradient price table in the preset memory, and update the gradient price table based on the storage address.

[0059] In addition, in this embodiment, the risk control transaction implementation device also includes a bus arbitration module, which is implemented based on an arbitrator and is used to avoid conflicts caused by simultaneous access to the bus during the process of querying or updating the table.

[0060] The following is an introduction to the risk control transaction implementation method provided by this application.

[0061] like Figure 2 The flowchart of the risk control transaction implementation method provided by an embodiment of the present application is shown. Figure 1 Taking the risk control transaction realization device shown in FIG. 1 as an example, the method at least includes steps S201 to S203:

[0062] Step S201, receiving a transaction instruction through a transaction processing module.

[0063] Among them, the transaction instruction includes the transaction order number, transaction price and transaction time.

[0064] Step S202, the transaction processing module generates a query instruction based on the transaction order number and sends it to the hardware database module, so that after receiving the query instruction, the hardware database module executes the query instruction, queries from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and returns it to the transaction processing module.

[0065] Step S203, after receiving the order information, the transaction processing module queries and updates the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buying transaction table or the selling transaction table based on the order information, the transaction price and the transaction time to complete the risk control transaction.

[0066] In this embodiment, the order information includes the buying and selling direction of the target order when the order is placed, the result of the target order, the price of the target order, or the quantity of the target order.

[0067] When the target order is placed in the buy direction, it is necessary to query and update the buy direction transaction table. In this embodiment, the buy direction transaction table includes the minimum buy direction transaction price and the minimum buy direction transaction price time in the past three minutes. Compare the transaction price in the transaction instruction with the buy direction transaction price in the buy direction transaction table. If the transaction price is less than the buy direction transaction price, update the buy direction transaction table based on the transaction price and transaction time; or compare the buy direction transaction time in the buy direction transaction table with the transaction time; if the difference between the transaction time and the buy direction transaction time is greater than the preset time, update the buy direction transaction table based on the transaction price and transaction time.

[0068] Specifically, based on the order information, transaction price and transaction time, query and update the undelivered quantity record table, undelivered amount record table, gradient price table, buy direction transaction table or sell direction transaction table, including: when the pending order result indicates that the target order is successfully executed, update the undelivered quantity in the undelivered quantity record table; update the undelivered amount in the undelivered amount record table based on the pending order price and the transaction quantity of the target order; update the undelivered quantity corresponding to the pending order price in the gradient price table; when the buying and selling direction of the target order when the target order is placed is in the buy direction, query the buy direction transaction table, and compare the buy direction transaction price in the buy direction transaction table with the transaction price; when the transaction price is less than the buy direction transaction price, update the buy direction transaction table based on the transaction price and transaction time; or, compare the buy direction transaction time in the buy direction transaction table with the transaction time; when the difference between the transaction time and the buy direction transaction time is greater than the preset time length, update the buy direction transaction table based on the transaction price and transaction time.

[0069] Among them, updating the unfulfilled quantity based on the pending order quantity of the target order means subtracting the filled quantity of the current order from the original unfulfilled quantity; updating the unfulfilled amount based on the filled price and the pending order quantity of the target order means subtracting the amount of the current order (filled quantity*pending order amount) from the original unfulfilled amount.

[0070] When the target order is placed in the selling direction, it is necessary to query and update the selling direction transaction table. In this embodiment, the selling direction transaction table includes the maximum selling direction transaction price and the maximum selling direction transaction price time in the past three minutes. The transaction price in the transaction instruction is compared with the buying direction transaction price in the selling direction transaction table. If the transaction price is greater than the selling direction transaction price, the buying direction transaction table is updated based on the transaction price and transaction time; or, the selling direction transaction time in the selling direction transaction table is compared with the transaction time; if the difference between the transaction time and the selling direction transaction time is greater than the preset time, the selling direction transaction table is updated based on the transaction price and transaction time.

[0071] Specifically, based on the order information, transaction price and transaction time, the untransacted quantity record table, the untransacted amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table are queried and updated respectively, and the following is also included:

[0072] When the buying and selling direction of the target order is the selling direction when the order is placed, query the selling direction transaction table, and compare the selling direction transaction price in the selling direction transaction table with the transaction price; when the transaction price is greater than the selling direction transaction price, update the selling direction transaction table based on the transaction price and transaction time; or, compare the selling direction transaction time in the selling direction transaction table with the transaction time; when the difference between the transaction time and the selling direction transaction time is greater than the preset time length, update the selling direction transaction table based on the transaction price and transaction time.

[0073] In addition, when the target order is the first order, the table to be updated is identified in the buy-side transaction table and the sell-side transaction table according to the buy-side transaction direction at the time of placing the order, and is updated based on the transaction time and transaction price.

[0074] When the buying and selling direction at the time of placing the order is the buying direction, the buying direction transaction table is confirmed as the table to be updated, and the buying direction transaction table is updated according to the transaction time and transaction price.

[0075] When the buying and selling direction at the time of placing the order is the selling direction, the selling direction transaction table is confirmed as the table to be updated, and the selling direction transaction table is updated according to the transaction time and transaction price.

[0076] In this embodiment, after the query and update are completed, an update receipt needs to be generated based on the transaction instruction and part of the content in the order information, and sent to the user terminal. Among them, the order information also includes information such as the transaction result and the transaction stock identifier. The content of the update receipt includes but is not limited to the operation code, transaction order number, transaction stock identifier, transaction price, transaction quantity, error code, transaction result, transaction message timestamp, transaction message input event or transaction result output time, etc.

[0077] The operation code is used to indicate the transaction type; the error code is used to indicate the error type of the current transaction. If the error code is 0, it indicates that the pending order corresponding to the target order is not found; if the error code is 1, it indicates that the quantity of the target order to be withdrawn is greater than the remaining quantity of the corresponding pending order; the transaction can only be normal if the pending order quantity of the target order obtained by query is greater than or equal to the transaction quantity, otherwise the transaction is abnormal and terminated.

[0078] Specifically, based on the order information, transaction price and transaction time, the undeal quantity record table, undeal amount record table, gradient price table, buy-side transaction table or sell-side transaction table are queried and updated respectively. After the risk control transaction is completed, it also includes: based on the transaction instruction and order information, an update receipt is generated and sent to the user terminal

[0079] In addition, the order information also includes the rule group hit when the target order is placed and the index address of the rule group, which refers to the rules and corresponding index addresses used to match the orders of buyers and sellers on the trading exchange or trading platform. The rule group is a set of rules that define transaction matching. These rules can include price priority, time priority, quantity matching, etc. When the buy order and sell order are submitted to the trading exchange, the trading exchange will match the orders according to these rules and decide whether to trade. The index address of the rule group refers to the address used to quickly find the rule group applicable to a specific order. In the trading exchange, in order to improve the matching efficiency, a data structure (such as a red-black tree, a hash table, etc.) is usually used to store the rule group and its corresponding index address. By using the index address, the trading exchange can quickly locate the rule group applicable to a specific order and perform a matching operation.

[0080] In summary, the present embodiment provides a risk control transaction implementation method, which is applied to a risk control transaction implementation device, and the risk control transaction implementation device includes a transaction processing module and a hardware database module; the transaction processing module receives a transaction instruction, and the transaction instruction includes a transaction order number, a transaction price and a transaction time; the transaction processing module generates a query instruction based on the transaction order number and sends it to the hardware database module, so that after receiving the query instruction, the hardware database module executes the query instruction, queries from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and returns it to the transaction processing module; after receiving the order information, the transaction processing module queries and updates the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buying direction transaction table or the selling direction transaction table based on the order information, the transaction price and the transaction time, and completes the risk control transaction; it can solve the problem that the execution time is long and the transaction process execution efficiency is low when the data volume is large; the risk control transaction implementation device is constructed based on the FPGA chip, the transaction execution logic is converted into a hardware circuit, and parallel processing is performed on the FPGA chip. In this way, the speed and efficiency of transaction processing can be improved, and the delay time can be reduced.

[0081] Corresponding to the above method, the present invention also provides a risk control transaction implementation device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the device implements the steps of the risk control transaction implementation method as mentioned above.

[0082] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned risk control transaction implementation method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0083] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0084] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0085] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0086] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for implementing risk control transactions, characterized in that: Applied to a risk control transaction implementation device, the risk control transaction implementation device includes a transaction processing module and a hardware database module; the risk control transaction implementation device is constructed based on an FPGA chip; the method includes the following steps: Receiving a transaction instruction through the transaction processing module, wherein the transaction instruction includes a transaction order number, a transaction price and a transaction time; The transaction processing module generates a query instruction based on the transaction order number and sends it to the hardware database module, so that after receiving the query instruction, the hardware database module executes the query instruction, queries from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number, and returns it to the transaction processing module; After receiving the order information, the transaction processing module queries and updates the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table based on the order information, the transaction price and the transaction time to complete the risk control transaction; the order information includes the buy and sell direction when the target order is placed, the result of the placing order of the target order, the placing order price of the target order or the placing order quantity of the target order; Based on the order information, the transaction price and the transaction time, respectively querying and updating the undeal quantity record table, the undeal amount record table, the gradient price table, the buy direction transaction table or the sell direction transaction table, further includes: In the case that the buying and selling direction when the target order is placed is the selling direction, querying the selling direction transaction table, comparing the selling direction transaction price in the selling direction transaction table with the transaction price; in the case that the transaction price is greater than the selling direction transaction price, updating the selling direction transaction table based on the transaction price and the transaction time; or, comparing the selling direction transaction time in the selling direction transaction table with the transaction time; in the case that the difference between the transaction time and the selling direction transaction time is greater than a preset time length, updating the selling direction transaction table based on the transaction price and the transaction time; When the pending order result indicates that the target order is successfully executed, the unexecuted quantity is updated in the unexecuted quantity record table; In the unfulfilled amount record table, the unfulfilled amount is updated based on the pending order price and the filled quantity of the target order; In the gradient price table, updating the unfulfilled quantity corresponding to the pending order price; In the case that the buying and selling direction when the target order is placed is the buy direction, the buy direction transaction table is queried, and the buy direction transaction price in the buy direction transaction table is compared with the transaction price; in the case that the transaction price is less than the buy direction transaction price, the buy direction transaction table is updated based on the transaction price and the transaction time; or, the buy direction transaction time in the buy direction transaction table is compared with the transaction time; in the case that the difference between the transaction time and the buy direction transaction time is greater than a preset time length, the buy direction transaction table is updated based on the transaction price and the transaction time.

2. The risk control transaction implementation method according to claim 1, characterized in that: When the target order is the first order, the table to be updated is identified in the buy-side transaction table and the sell-side transaction table according to the buy-side transaction direction when the target order is placed, and is updated based on the transaction time and the transaction price.

3. The risk control transaction implementation method according to claim 1, characterized in that: Based on the order information, the transaction price and the transaction time, respectively querying and updating the undeal quantity record table, the undeal amount record table, the gradient price table, the buy-side transaction table or the sell-side transaction table, after completing the risk control transaction, further includes: Based on the transaction instruction and the order information, an update receipt is generated and sent to the user terminal.

4. The risk control transaction implementation method according to claim 1, characterized in that: The unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buyer's transaction table or the seller's transaction table are stored in the preset memory; Alternatively, the uncompleted quantity record table, the uncompleted amount record table, the buyer's transaction table or the seller's transaction table is stored in the transaction processing module; The gradient price table is stored in the preset memory.

5. The risk control transaction implementation method according to claim 1, characterized in that: The order information also includes the rule group hit when the target order is placed and the index address of the rule group.

6. A risk control transaction implementation device, characterized in that: The risk control transaction realization device comprises: The transaction processing module is used to: receive a transaction instruction, wherein the transaction instruction includes a transaction order number, a transaction price and a transaction time; generate a query instruction based on the transaction order number through the transaction processing module and send the query instruction to the hardware database module; The hardware database module is used to: after receiving the query instruction, execute the query instruction, query from the preset memory to obtain the order information corresponding to the target order indicated by the transaction order number and return it to the transaction processing module; The transaction processing module is further used to: after receiving the order information, query and update the unsuccessful transaction quantity record table, the unsuccessful transaction amount record table, the gradient price table, the buying transaction table or the selling transaction table based on the order information, the transaction price and the transaction time, so as to complete the risk control transaction; The order information includes the buying and selling direction of the target order when the order is placed, the result of the target order, the price of the target order or the quantity of the target order; Based on the order information, the transaction price and the transaction time, respectively querying and updating the undeal quantity record table, the undeal amount record table, the gradient price table, the buy direction transaction table or the sell direction transaction table, further includes: In the case that the buying and selling direction when the target order is placed is the selling direction, querying the selling direction transaction table, comparing the selling direction transaction price in the selling direction transaction table with the transaction price; in the case that the transaction price is greater than the selling direction transaction price, updating the selling direction transaction table based on the transaction price and the transaction time; or, comparing the selling direction transaction time in the selling direction transaction table with the transaction time; in the case that the difference between the transaction time and the selling direction transaction time is greater than a preset time length, updating the selling direction transaction table based on the transaction price and the transaction time; When the pending order result indicates that the target order is successfully executed, the unexecuted quantity is updated in the unexecuted quantity record table; In the unfulfilled amount record table, the unfulfilled amount is updated based on the pending order price and the filled quantity of the target order; In the gradient price table, updating the unfulfilled quantity corresponding to the pending order price; In the case that the buying and selling direction when the target order is placed is the buy direction, the buy direction transaction table is queried, and the buy direction transaction price in the buy direction transaction table is compared with the transaction price; in the case that the transaction price is less than the buy direction transaction price, the buy direction transaction table is updated based on the transaction price and the transaction time; or, the buy direction transaction time in the buy direction transaction table is compared with the transaction time; in the case that the difference between the transaction time and the buy direction transaction time is greater than a preset time length, the buy direction transaction table is updated based on the transaction price and the transaction time.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the risk control transaction implementation method as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Data processing method and system

    CN111897839A

  • A national debt futures transaction system based on sub-account risk control

    CN113159939A