A method and device for monitoring stock trading risks

By adopting FPGA technology and flow and parallel processing mode in the stock trading risk monitoring system, the problem of delay in risk control results calculation in the existing technology is solved, real-time and effective risk monitoring is achieved, and abnormal trading behavior is avoided.

CN117874066BActive Publication Date: 2025-04-04YUSUR TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311684852.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-04-04
Estimated Expiration
2043-12-08

AI Technical Summary

Technical Problem

In the existing technology, the stock trading risk monitoring system adopts a non-real-time processing system, which leads to delayed calculation of risk control results, and cannot meet the real-time risk control requirements, resulting in abnormal trading behaviors and losses.

Method used

The stock trading risk monitoring method based on field programmable logic gate array (FPGA) is adopted, and the database is built using on-chip cache and memory to realize real-time risk control calculations, and the processing speed is improved through the flow-through and parallel processing mode.

Benefits of technology

Real-time and effective risk control calculations are realized, reducing the delay time for transaction packet processing, no more than 20 microseconds, and avoiding the risk of transaction violations of relevant laws and regulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117874066B_ABST
    Figure CN117874066B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for monitoring stock trading risks. The database is built based on FPGA on-chip cache and memory. The database based on the on-chip cache can quickly obtain the corresponding index of the memory database, provide 100 million query performance, effectively reduce the number of memory addressing times, and improve the database response performance; based on the memory database, it can provide 10 million query performance and 64GB data storage space to meet the storage, update, and query requirements of valid information of all-day trading messages. The database receives and parses stock trading messages in real time, and retrieves the historical database located in the memory space according to the parsed entrustment message identification information, performs risk control calculation and feedback result output according to the historical trading data, so as to realize risk control of the stock trading message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of risk monitoring, and in particular to a method and device for monitoring stock trading risks. Background Art

[0002] In stock trading, all parties involved in the investment expect to obtain considerable returns through stock trading. Some investors will rely on their superior information, funds and number of shares held to obtain illegal excess returns through illegal and abnormal transactions. The exchange focuses on cracking down on behaviors that profit from illegal and abnormal transactions, including price manipulation.

[0003] The current risk control system of securities companies adopts the technical path of server-operating system-software to complete risk control. This technical path adopts a non-real-time processing system. The application layer software serially receives transaction messages, parses the message fields, queries the relevant historical data in the traditional database as required, and couples the valid fields of the message with the historical data in the database for calculation. The lifting and suppression algorithm is implemented according to the quantitative control requirements proposed by the exchange, and finally the risk control message is output according to the calculation results, and the database is updated according to the risk control results.

[0004] Since the current technical solution adopts a non-real-time system and is based on a traditional database structure and serial processing method, the delay required to calculate the risk control results is 10 milliseconds, which cannot meet the securities companies' requirements for real-time risk control. Based on the existing calculation method and processing speed, securities companies can only use the method of directly sending transaction messages and bypassing risk control calculations. When the threshold of the abnormal transaction lifting and suppressing algorithm is triggered, the overall risk control system design is completed by canceling the order. According to the analysis of the characteristics of the solution, it has obvious loopholes. The exchange will complete the transaction according to the transaction message that has been sent; when the system completes the lifting and suppressing risk control calculation and sends the cancellation order, the transaction has been completed and triggers the lifting and suppressing risk control conditions of the exchange, resulting in actual abnormal trading behavior and causing losses. Therefore, how to quickly and effectively prevent the relevant stock trading behavior from meeting the requirements of the exchange and complete the risk control of the relevant stock trading behavior has become a practical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a stock trading risk monitoring method and device to eliminate or improve one or more defects existing in the prior art, complete risk control calculations in real time and effectively, complete relevant risk control before sending transaction messages, and solve the problem of abnormal transactions caused by high delays in message risk control calculations in the prior art.

[0006] One aspect of the present invention provides a method for monitoring stock trading risks. The method is based on a field programmable gate array, and the field programmable gate array is provided with an on-chip cache space and a memory space. The method comprises the following steps:

[0007] Receiving stock trading messages, the stock trading messages at least including: entrustment messages, transaction messages, order cancellation messages and market transaction information messages;

[0008] Parsing the valid fields of the stock transaction message to obtain the entrustment message identification information, stock identification information and account identification information of the current stock transaction message;

[0009] Retrieving the historical database located in the memory space according to the delegation message identification information, querying the historical delegation message and determining whether the current delegation message already exists;

[0010] When the current entrustment message does not exist in the historical entrustment message, query the corresponding database index in the on-chip cache space according to the stock identification information and the account identification information, and query the historical database in the memory space according to the database index to obtain the historical transaction data of the stock corresponding to the stock identification information;

[0011] A risk control calculation is performed based on the historical transaction data, and the risk control calculation result is output and fed back via a first set path to achieve risk control of the stock transaction message.

[0012] In some embodiments, after searching the history database located in the memory space according to the delegation message identification information, searching the history delegation message and determining whether the current delegation message already exists, the method further includes:

[0013] When the current entrustment message exists in the historical entrustment messages, the query result is returned without performing risk control calculation; when the current entrustment message does not exist in the historical entrustment messages, risk control calculation is performed.

[0014] In some embodiments, performing valid field parsing on the stock transaction message to obtain the entrustment message includes:

[0015] Analyze the time, stock index and corresponding market trading volume recorded in market information reports;

[0016] Parsing the message time, message date, the entrustment message identification information, the stock identification information, the account identification information, the buying and selling entrustment direction, the price type, the entrustment price, the entrustment quantity and the entrustment amount in the entrustment message;

[0017] Parsing the message time, the transaction message identification information, the stock identification information, the transaction price, the transaction quantity and the transaction time in the transaction message;

[0018] Parse the message time, message identification information, order cancellation result and order cancellation quantity in the order cancellation message.

[0019] In some embodiments, performing risk control calculation based on the historical transaction data includes:

[0020] Calculating a first risk control factor, where the first risk control factor is used to determine and mark whether the current price increase or decrease of the target stock is greater than the increase or decrease threshold;

[0021] Calculating a second risk control factor, where the second risk control factor is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume within a specified time window is greater than a trading volume threshold;

[0022] Calculating a third risk control factor, where the third risk control factor is used to determine and mark whether the sum of the target stock transaction amount and the estimated possible transaction amount within a specified time window is greater than a transaction amount threshold;

[0023] Calculating a fourth risk control factor, where the fourth risk control factor is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume relative to the total market trading volume within a specified time window is greater than a trading ratio threshold;

[0024] When the first risk control factor is established, it is determined that there is a risk of manipulation of the target stock transaction;

[0025] and / or, when the second risk control factor and the third risk control factor are both established, it is determined that there is a risk of price manipulation in the target stock transaction;

[0026] And / or, when the fourth risk control factor is established, it is determined that there is a risk of price manipulation in the target stock transaction.

[0027] In some embodiments, after performing risk control calculation according to the historical transaction data and outputting the risk control calculation result through a set path for feedback, the process further includes:

[0028] When there is a risk of manipulation of the target stock, an alarm message is generated and prompted to a designated object via a second set path;

[0029] When there is no risk of price manipulation in the target stock transaction, a prompt message is generated and fed back to the designated object via the second set path.

[0030] In some embodiments, after performing risk control calculation according to the historical transaction data and outputting the risk control calculation result through a set path for feedback, the process further includes:

[0031] When there is a risk of price manipulation in the target stock transaction, the transaction corresponding to the stock transaction message is terminated.

[0032] In some embodiments, the method further comprises:

[0033] For multiple concurrent stock transaction messages, a pipeline plus parallel mode is used to perform stock transaction risk monitoring.

[0034] On the other hand, the present invention also provides a stock trading risk monitoring device, including a processor and a memory, characterized in that computer instructions are stored in the memory, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the above method.

[0035] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of the above method when executed by a processor.

[0036] The beneficial effects of the present invention are at least:

[0037] The stock trading risk monitoring method and device described in the present invention completes database construction based on FPGA (Field Programmable Gate Array) on-chip cache and memory. The database based on the on-chip cache can quickly obtain the corresponding index of the memory database, provide 100 million query performance, effectively reduce the number of memory addressing times, and improve the database response performance; based on the memory database, it can provide 10 million query performance and 64 gigabytes of data storage space to meet the storage, update, and query requirements of valid information of trading messages throughout the day. The database receives and parses stock trading messages in real time, and retrieves the historical database located in the memory space according to the parsed entrustment message identification information, performs risk control calculations and feedback results based on the historical trading data, so as to achieve risk control of the stock trading messages.

[0038] Furthermore, the present invention adopts a pipeline plus parallel processing mode, which can improve the processing speed, meet the performance requirement that the delay time of stock transaction message processing does not exceed 20 microseconds, and avoid the risk of transactions violating relevant laws and regulations.

[0039] 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.

[0040] 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

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

[0042] Figure 1 The figure is a flow chart of a method for monitoring stock trading risks according to an embodiment of the present invention.

[0043] Figure 2 The present invention is a flowchart of risk control calculation in a stock trading risk monitoring method according to an embodiment of the present invention.

[0044] Figure 3 The figure is a flow chart of a stock trading risk monitoring system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] The current technical solution adopts a non-real-time system, and the delay required for calculating the risk control results is 10 milliseconds. It is impossible to complete the stock trading risk calculation in real time and effectively, and complete the relevant risk control before sending the transaction message, resulting in abnormal trading behavior and related losses. The present invention proposes a stock trading risk monitoring method. The stock trading risk monitoring method is based on FPGA on-chip cache and memory to complete database construction. At the same time, the present invention adopts a pipeline plus parallel processing mode, which can improve the processing speed and meet the performance requirement that the delay time of stock trading message processing does not exceed 20 microseconds, thereby avoiding the risk of transactions violating relevant laws and regulations.

[0051] Figure 1 The present invention is a flowchart of a method for monitoring stock trading risks according to an embodiment of the present invention. Specifically, the present invention provides a method for monitoring stock trading risks, which is based on a field programmable logic gate array, and the field programmable logic gate array is provided with an on-chip cache space and a memory space. The method includes the following steps S101 to S105:

[0052] Step S101: receiving stock trading messages, wherein the stock trading messages include at least: entrustment messages, transaction messages, order cancellation messages and market transaction information messages.

[0053] Step S102: parsing the valid fields of the stock trading message to obtain the entrustment message identification information, stock identification information and account identification information of the current stock trading message.

[0054] Step S103: searching the history database in the memory space according to the delegation message identification information, querying the history delegation message and determining whether the current delegation message already exists.

[0055] Step S104: When the current entrustment message does not exist in the historical entrustment message, the corresponding database index is queried in the on-chip cache space according to the stock identification information and the account identification information, and the historical database in the memory space is queried according to the database index to obtain the historical transaction data of the stock corresponding to the stock identification information.

[0056] Step S105: Perform risk control calculation based on historical transaction data, and output the risk control calculation result via the first set path as feedback to achieve risk control of stock transaction messages.

[0057] In step S101, a stock transaction related message is received through a PCIe interface (PCI-Express, a high-speed serial computer expansion bus standard), a network port or a USB interface (Universal Serial Bus, a universal serial bus standard).

[0058] In step S102, the account identification information is used to confirm whether the source of the stock transaction requires risk control. Risk control requirements are controlled according to accounts or account groups, which means that when opening an account at a securities company, investors need to undergo strict real-name verification to ensure the authenticity and controllability of each account, in order to prevent criminals from using securities accounts to conduct fraud, money laundering and other criminal activities, protect the interests of investors, and maintain market order.

[0059] In step S105: the risk control calculation result is output through the PCIe interface, network port or USB interface. The result is prohibition, warning or pass, and the subsequent operation belongs to the upstream counter behavior.

[0060] In some embodiments, a historical database located in the memory space is retrieved according to the delegation message identification information, and after querying the historical delegation message and determining whether the current delegation message already exists, when the current delegation message exists in the historical delegation message, the query result is returned without performing risk control calculation; when the current delegation message does not exist in the historical delegation message, risk control calculation is performed.

[0061] In some embodiments, performing valid field parsing on a stock trading message to entrust the message includes:

[0062] Analyze the time, stock index and corresponding market trading volume recorded in market information reports;

[0063] Parsing the message time, message date, message identification information, stock identification information, account identification information, buy and sell order direction, price type, order price, order quantity and order amount in the order message;

[0064] Parsing the message time, transaction message identification information, stock identification information, transaction price, transaction quantity and transaction time in the transaction message;

[0065] Parse the message time, message identification information, order cancellation result and order cancellation quantity in the order cancellation message.

[0066] Figure 2 The following is a flow chart of risk control calculation in the stock trading risk monitoring method according to an embodiment of the present invention. In some embodiments, risk control calculation is performed based on historical trading data, including the following steps S201 to S205:

[0067] Step S201: Calculate a first risk control factor, which is used to determine and mark whether the current price fluctuation of the target stock is greater than a fluctuation threshold.

[0068] Step S202: Calculate a second risk control factor, where the second risk control factor is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume within a specified time window is greater than a trading volume threshold.

[0069] Step S203: Calculate a third risk control factor, where the third risk control factor is used to determine and mark whether the sum of the target stock transaction amount and the estimated possible transaction amount within the specified time window is greater than the transaction amount threshold.

[0070] Step S204: Calculate the fourth risk control factor, which is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume within the specified time window is greater than the trading ratio threshold relative to the total market trading volume.

[0071] Step S205: When the first risk control factor is established, it is determined that there is a risk of price manipulation in the target stock transaction.

[0072] And / or, when the second risk control factor and the third risk control factor are both established, it is determined that there is a risk of price manipulation in the target stock transaction;

[0073] And / or, when the fourth risk control factor is established, it is determined that there is a risk of price manipulation in the target stock transaction.

[0074] In some embodiments, after performing risk control calculation based on historical transaction data and outputting the risk control calculation result through a set path for feedback, the process further includes:

[0075] When there is a risk of manipulation of the target stock, an alarm message is generated and sent to the designated party via the second set path;

[0076] When there is no risk of price manipulation in the target stock transaction, a prompt message is generated and fed back to the designated object via the second set path.

[0077] In some embodiments, after performing risk control calculations based on historical transaction data and outputting the risk control calculation results through a set path for feedback, it also includes: when there is a risk of price manipulation in the target stock transaction, terminating the transaction corresponding to the stock transaction message.

[0078] In some embodiments, the method further includes: performing stock trading risk monitoring for multiple concurrent stock trading messages in a pipeline plus parallel mode.

[0079] In some embodiments, the first set path and the second set path perform data transmission based on a PCIe interface, a network port, or a USB interface.

[0080] On the other hand, the present invention also provides a stock trading risk monitoring device, including a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the above method.

[0081] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0082] The present invention is described below in conjunction with a specific embodiment:

[0083] Figure 3 This is a flow chart of the stock trading risk monitoring system described in one embodiment of the present invention. The technical solution used is mainly based on the FPGA platform, which completes the real-time reception and analysis of stock trading related messages, and searches the historical database related to the price manipulation calculation according to the valid fields of the analysis, and finally completes the risk control calculation and result output according to the exchange's requirements for the control of abnormal price manipulation transactions.

[0084] The present invention designs an on-chip + memory composite database, which is used to store transaction-related historical data and provide high-speed data query and update functions. The database is mainly built based on the FPGA on-chip cache and memory. Among them, the database based on the on-chip cache mainly completes basic index query, can provide rapid acquisition of the corresponding index of the memory database, and provides 100 million query performances, which can effectively reduce the number of memory addressing times and improve the database response performance; the memory database mainly completes historical data storage, and its address corresponds one-to-one with the on-chip database index, which can provide a relatively large data storage space, provide 10 million query performances and 64 gigabytes of data storage space, which can meet the storage, update, query and other needs of effective information of transaction messages throughout the day.

[0085] The processing flow of this technical solution includes the following steps S301 to S305:

[0086] Step S301: The business message receiving module mainly provides business data access function. This module mainly completes: receiving stock trading related messages through high-speed interfaces such as PCIe bus, network interface, USB interface, etc., including: entrustment messages, transaction messages, order cancellation messages, market transaction information messages, etc.

[0087] Step S302: The service message parsing module mainly completes the functions of service message type identification, valid field information parsing, and partial information preprocessing. The valid fields for parsing various types of messages include:

[0088] Bank information document instructions: including time, stock index and corresponding market transaction volume.

[0089] Entrustment message instructions: including message time, message date, entrustment message identification information, stock identification information, account identification information, buy and sell entrustment direction, price type, entrustment price, entrustment quantity, entrustment amount, etc.

[0090] Transaction message instructions: including message time, entrustment message identification information, stock identification information, transaction price, transaction quantity, transaction time, etc.

[0091] Cancellation (cancellation) order message instruction: includes message time, entrustment message identification information, entrustment / cancellation order result, etc.

[0092] Order cancellation message instruction: includes message time, entrustment message identification information, order cancellation result, order cancellation quantity, etc.

[0093] Step S303: After receiving and parsing the entrustment message, the price manipulation related data retrieval module searches the historical database according to the parsed entrustment message identification information to determine whether the entrustment is a duplicate order; calculates the database index according to the stock identification information and the account identification information, and further queries the price manipulation related historical data according to the index information, including but not limited to the unfulfilled entrustment volume, the proprietary trading volume within the time window, the proprietary trading amount within the time window, the market trading volume, the lowest buy price within the time window and the highest sell price within the time window.

[0094] Step S304: The price manipulation risk control calculation module calculates the price manipulation related calculation factors according to the valid field information of the current message and the relevant historical data queried, including:

[0095] C1: Current price fluctuation > fluctuation threshold;

[0096] C2: Trading volume within the time window + expected possible trading volume > trading volume threshold;

[0097] C3: Transaction amount within the time window + estimated possible transaction amount > transaction amount threshold;

[0098] C4: (trading volume within the time window + expected possible trading volume) / total market trading volume within the time window > percentage threshold;

[0099] The output result is: Result = C1 & (C2 | C3) & C4. When C1 is established, it is judged that the target stock transaction has the risk of price manipulation. And / or, when C2 and C3 are established at the same time, it is judged that the target stock transaction has the risk of price manipulation; and / or, when C4 is established, it is judged that the target stock transaction has the risk of price manipulation.

[0100] Step S305: The risk control result output module mainly completes the packaging of the intermediate results and final results of the risk control calculation according to the system requirements, and outputs them through bus interfaces such as PCIe interface, network port or USB interface as required.

[0101] The module processing adopts pipeline and parallel processing mode to maximize the processing speed. It can achieve the technical requirement that the real-time processing delay of business messages does not exceed 20 microseconds, meet the real-time processing delay requirements of business messages, complete the front-end control of transaction messages, and avoid the risk of related transactions violating relevant laws and regulations.

[0102] In summary, the present invention provides a stock trading risk monitoring method and device, which can perform stock trading risk calculation in real time and effectively, and promptly control messages that can cause trading abnormalities; perform effective field analysis on the received stock trading message to obtain the entrustment message identification information, stock identification information and account identification information of the current stock trading message; retrieve the historical database located in the memory space according to the entrustment message identification information, and when the current entrustment message does not exist in the historical entrustment message, query the corresponding database index in the on-chip cache space according to the stock identification information and the account identification information, and query the historical database in the memory space according to the database index to obtain the historical trading data of the stock corresponding to the stock identification information; perform risk control calculation according to the historical trading data to achieve risk control of the stock trading message.

[0103] Furthermore, the present invention adopts a pipeline plus parallel processing flow mode to improve the business message processing capability, achieve a risk control calculation delay time of no more than 20 microseconds, and meet the real-time processing time delay requirements of business messages.

[0104] An embodiment of the present invention further provides a computer device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or in other ways.

[0105] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0106] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as the program instructions / modules corresponding to the key shielding method of the vehicle-mounted display device in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory.

[0107] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0108] The one or more modules are stored in the memory, and when executed by the processor, the method described in this embodiment is performed.

[0109] 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 edge computing server deployment 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.

[0110] 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.

[0111] 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.

[0112] 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.

[0113] The above description is only a preferred embodiment of the present invention and is 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 monitoring stock trading risks, characterized in that: The method is based on a field programmable logic gate array, and the field programmable logic gate array is provided with an on-chip cache space and a memory space. The method comprises the following steps: Receiving stock trading messages, the stock trading messages at least including: entrustment messages, transaction messages, order cancellation messages and market transaction information messages; Parsing the valid fields of the stock transaction message to obtain the entrustment message identification information, stock identification information and account identification information of the current stock transaction message; Retrieving the historical database located in the memory space according to the delegation message identification information, querying the historical delegation message and determining whether the current delegation message already exists; When the current entrustment message does not exist in the historical entrustment message, query the corresponding database index in the on-chip cache space according to the stock identification information and the account identification information, and query the historical database in the memory space according to the database index to obtain the historical transaction data of the stock corresponding to the stock identification information; Performing risk control calculation according to the historical transaction data, and outputting the risk control calculation result through a first set path as feedback, so as to achieve risk control of the stock transaction message; wherein performing risk control calculation according to the historical transaction data includes: Calculating a first risk control factor, where the first risk control factor is used to determine and mark whether the current price increase or decrease of the target stock is greater than the increase or decrease threshold; Calculating a second risk control factor, where the second risk control factor is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume within a specified time window is greater than a trading volume threshold; Calculating a third risk control factor, where the third risk control factor is used to determine and mark whether the sum of the target stock transaction amount and the estimated possible transaction amount within a specified time window is greater than a transaction amount threshold; Calculating a fourth risk control factor, where the fourth risk control factor is used to determine and mark whether the sum of the target stock's trading volume and the estimated possible trading volume relative to the total market trading volume within a specified time window is greater than a trading ratio threshold; When the first risk control factor is established, it is determined that there is a risk of manipulation of the target stock transaction; and / or, when the second risk control factor and the third risk control factor are both established, it is determined that there is a risk of price manipulation in the target stock transaction; And / or, when the fourth risk control factor is established, it is determined that there is a risk of price manipulation in the target stock transaction.

2. The stock trading risk monitoring method according to claim 1, characterized in that: After searching the history database located in the memory space according to the delegation message identification information, searching the history delegation message and judging whether the current delegation message already exists, the method further includes: When the current entrustment message exists in the historical entrustment messages, the query result is returned without performing risk control calculation; when the current entrustment message does not exist in the historical entrustment messages, risk control calculation is performed.

3. The stock trading risk monitoring method according to claim 1, characterized in that: Parsing the entrustment message for valid fields of the stock transaction message includes: Analyze the time, stock index and corresponding market trading volume recorded in market information reports; Parsing the message time, message date, the entrustment message identification information, the stock identification information, the account identification information, the buying and selling entrustment direction, the price type, the entrustment price, the entrustment quantity and the entrustment amount in the entrustment message; Parsing the message time, the transaction message identification information, the stock identification information, the transaction price, the transaction quantity and the transaction time in the transaction message; Parse the message time, message identification information, order cancellation result and order cancellation quantity in the order cancellation message.

4. The stock trading risk monitoring method according to claim 1, characterized in that: After performing risk control calculation according to the historical transaction data and outputting the risk control calculation result through a set path for feedback, the method further includes: When there is a risk of manipulation of the target stock, an alarm message is generated and prompted to a designated object via a second set path; When there is no risk of price manipulation in the target stock transaction, a prompt message is generated and fed back to the designated object via the second set path.

5. The stock trading risk monitoring method according to claim 1, characterized in that: After performing risk control calculation according to the historical transaction data and outputting the risk control calculation result through a set path for feedback, the method further includes: When there is a risk of price manipulation in the target stock transaction, the transaction corresponding to the stock transaction message is terminated.

6. The stock trading risk monitoring method according to claim 1, characterized in that: The method further comprises: performing stock transaction risk monitoring in a pipeline plus parallel mode for multiple concurrent stock transaction messages.

7. The method for monitoring stock trading risks according to claim 4, characterized in that: The first setting path and the second setting path perform data transmission based on a PCIe interface, a network port or a USB interface.

8. A stock trading risk monitoring device, comprising a processor and a memory, characterized in that: The memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the device implements the steps of the method as claimed in any one of claims 1 to 7.

9. 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 method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • FPGA-based message deduplication method and device and FPGA chip

    CN111770023A

  • Transaction clearing message transmission method and device

    CN114827310A