Transaction processing method and apparatus, device and storage medium
By determining the push time of quantitative strategy execution messages within the frequency limiting statistics period of the trading request interface, the call frequency of the trading request interface is controlled, which solves the problems of frequent server attacks and low response success rate under high concurrency requests, and achieves smooth trading process and high success rate.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- FUTU NETWORK TECH (SHENZHEN) CO LTD
- Filing Date
- 2025-11-07
- Publication Date
- 2026-06-04
AI Technical Summary
In high-concurrency transaction scenarios, limited server processing capacity leads to frequent request attacks and reduced response success rates, affecting the virtual resource transaction process and user experience.
By obtaining the frequency limit statistics duration and maximum number of requests of the trading request interface, the message push time of the quantitative strategy execution message is determined, and the quantitative strategy execution message is pushed to the strategy execution end at that time to execute the quantitative trading strategy and control the call frequency of the trading request interface.
This reduces the load on transaction processing, increases the success rate of transaction requests, avoids server overload and frequent request attacks, and ensures a smooth transaction process and a good user experience.
Smart Images

Figure CN2025133255_04062026_PF_FP_ABST
Abstract
Description
Transaction processing methods, apparatus, equipment and storage media
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411740334.2, filed on November 29, 2024, entitled “Transaction Processing Method, Apparatus, Equipment and Storage Medium”. Technical Field
[0003] This application relates to the field of computer technology, and in particular to a transaction processing method, apparatus, device, and storage medium. Background Technology
[0004] Currently, virtual resource trading is often conducted through servers. For example, various trading requests, such as order placement requests, order modification requests, and position closing requests, can be sent from terminal devices to the server. Alternatively, the server can push execution signals to terminal devices to execute quantitative trading strategies, thereby controlling the terminal devices to execute the quantitative trading strategies and completing the trading of virtual resources.
[0005] However, the processing power of a server is limited. In high-concurrency transaction scenarios, not only will the server face attacks from frequent requests, but the success rate of request responses will also decrease, thus affecting the transaction process of virtual resources and the user experience. Summary of the Invention
[0006] This application provides a transaction processing method, apparatus, device, and storage medium, which can reduce the load pressure of transaction processing and improve the success rate of transaction requests.
[0007] In a first aspect, this application provides a trading processing method, which includes: in response to a trigger operation for a first quantitative trading strategy, obtaining the frequency-limiting statistical duration of a trading request interface and the maximum number of requests made by the trading request interface within the frequency-limiting statistical duration; determining the actual number of requests made by the trading request interface within the frequency-limiting statistical duration prior to the current time; determining the message push time of a quantitative strategy execution message based on the maximum number of requests made by the trading request interface and the actual number of requests made, wherein the quantitative strategy execution message is used to trigger the execution of the first quantitative trading strategy; and in response to the arrival of the message push time, pushing the quantitative strategy execution message to the strategy execution end so that the strategy execution end executes the first quantitative trading strategy.
[0008] Secondly, this application provides a trading processing apparatus, comprising: a first acquisition module, configured to acquire, in response to a trigger operation for a first quantitative trading strategy, a frequency-limiting statistical duration of a trading request interface and the maximum number of requests made by the trading request interface within the frequency-limiting statistical duration; a first determination module, configured to determine the actual number of requests made by the trading request interface within the frequency-limiting statistical duration prior to the current time; a second determination module, configured to determine the message push time of a quantitative strategy execution message based on the maximum number of requests made by the trading request interface and the actual number of requests made, wherein the quantitative strategy execution message is used to trigger the execution of the first quantitative trading strategy; and a push module, configured to push the quantitative strategy execution message to a strategy execution end in response to the arrival of the message push time, so that the strategy execution end executes the first quantitative trading strategy.
[0009] Thirdly, this application provides an electronic device, including: a processor and a memory, the memory for storing a computer program, and the processor for calling and running the computer program stored in the memory to perform the methods as described in the first aspect or its various implementations.
[0010] Fourthly, this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.
[0011] Fifthly, this application provides a computer program product including computer program instructions that cause a computer to perform the methods as described in the first aspect or its various implementations.
[0012] Sixthly, this application provides a computer program that causes a computer to perform the methods described in the first aspect or its various implementations.
[0013] Through the technical solution of this application, the electronic device can determine the message push time of the quantitative strategy execution message based on the actual number of requests received within the frequency-limited duration of the transaction request interface and the maximum number of requests received. Then, it pushes the quantitative strategy execution message at that time to execute the quantitative trading strategy through the strategy execution end. In this process, the execution time of the quantitative trading strategy is determined based on the actual number of requests and the maximum number of requests received within the frequency-limited duration of the transaction request interface, thus taking into account the load of the transaction request interface. Therefore, it can avoid attacks from frequent requests to the server in high-concurrency transaction scenarios, reduce the load pressure on transaction processing, and thus ensure the success rate of request response. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below.
[0015] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of this application;
[0016] Figure 2 is a flowchart of a transaction processing method provided in an embodiment of this application;
[0017] Figure 3 is a schematic diagram of a transaction processing method provided in an embodiment of this application;
[0018] Figure 4 is a schematic diagram of a transaction processing device 400 provided in an embodiment of this application;
[0019] Figure 5 is a schematic diagram of an electronic device 500 provided in an embodiment of this application. Detailed Implementation
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0021] As mentioned above, since the server's processing power is limited, in high-concurrency transaction scenarios, the server will face attacks from frequent requests, and the success rate of request response will also decrease.
[0022] To address the aforementioned technical issues, the inventive concept of this application is to determine the message push time for the quantitative strategy execution message based on the actual number of requests received within the frequency limit period of the transaction request interface and the maximum number of requests, and then push the quantitative strategy execution message according to that time to trigger the execution of the quantitative trading strategy by the strategy execution end.
[0023] It should be understood that the technical solution of this application can be applied to the following scenarios, but is not limited to:
[0024] In one embodiment, this application can be applied to virtual resource trading scenarios, specifically to the execution of quantitative trading strategies for stocks, futures, or options.
[0025] Alternatively, this application can also be applied to non-transactional scenarios where a device acquires and responds to multiple requests, such as scenarios where a server acquires and responds to multiple requests sent by a terminal device for displaying page content, but is not limited thereto.
[0026] In one embodiment, as shown in FIG1, the application scenario may include a terminal device 110 and a server 120, and the terminal device 110 and the server 120 may be connected via a wired network or a wireless network.
[0027] The terminal device 110 is equipped with a client application for virtual resource trading, and the server 120 is the server corresponding to this application. It provides multiple trading request interfaces for the respective clients to call to implement the corresponding trading functions. Specifically, the terminal device 110 can install a client, which includes a client front-end and a client back-end. The client front-end provides an interactive interface for users to build and select quantitative trading strategies and receive trigger operations to execute these strategies. The client back-end acts as the strategy execution end, sending trading requests to the trading request interfaces of the server 120 to actually execute the quantitative trading strategy. After receiving a trigger operation for the quantitative trading strategy, the client frontend can determine the message push time for the quantitative strategy execution message to trigger the execution of the quantitative trading strategy based on the actual number of requests sent to the corresponding trading request interface of server 120 and the maximum number of requests that can be handled within the frequency limit period. Then, the client frontend pushes the quantitative strategy execution message to the client backend (i.e., the strategy execution end) according to the message push time. This allows the client backend to send corresponding trading requests to the corresponding trading request interface of server 120 based on the strategy logic in the quantitative trading strategy. (Specifically, the trading request can be a request to place an order, modify an order, cancel an order, reverse a position, or transfer a position. The trading request interface can be a trading request interface for placing an order, modifying an order, canceling an order, reversing a position, or transferring a position.) This enables the trading involved in the quantitative trading strategy.
[0028] Server 120 can be a single server, a server cluster consisting of multiple servers, or a cloud platform control center, but is not limited to these. Terminal device 110 can be a mobile phone, tablet computer, laptop computer, or desktop computer, but is not limited to these.
[0029] It should be noted that the terminal devices and servers in Figure 1 are merely exemplary, and may include other numbers or types of terminal devices or servers.
[0030] After introducing the application scenarios of the embodiments of this application, the technical solution of this application will be described in detail below:
[0031] Figure 2 is a flowchart of a transaction processing method provided in an embodiment of this application. This method can be executed by the terminal device 110 in the above application scenario, but is not limited thereto. As shown in Figure 2, the method may include the following steps:
[0032] S210: In response to the trigger operation for the first quantitative trading strategy, obtain the frequency limit statistics duration of the trading request interface, and the maximum number of requests to the trading request interface within the frequency limit statistics duration.
[0033] S220: Determine the actual number of requests to the transaction request interface within the frequency-limiting statistical period prior to the current time.
[0034] S230: Determine the message push time of the quantitative strategy execution message based on the maximum number of requests and the actual number of requests corresponding to the transaction request interface. The quantitative strategy execution message is used to trigger the execution of the first quantitative trading strategy.
[0035] S240: In response to the arrival of the message push time, push the quantitative strategy execution message to the strategy execution end so that the strategy execution end executes the first quantitative trading strategy.
[0036] In one embodiment, in conjunction with the above application scenario, the client installed on the terminal device includes a client front-end and a client back-end. The client front-end can display a visual interactive interface, allowing the user to trigger the first quantitative trading strategy based on this interface. Then, the client front-end can receive the trigger operation and, in response, execute the aforementioned S210. It should be noted that this trigger operation is used to determine the frequency at which the client front-end sends a corresponding request to the server's corresponding trading request interface, thereby determining the message push time for the quantitative strategy execution message. It does not directly trigger the strategy execution end, i.e., the client back-end, to execute the first quantitative trading strategy. The quantitative strategy execution message is used to trigger the strategy execution end to execute the first quantitative trading strategy.
[0037] For example, suppose the logic of a quantitative trading strategy is as follows: when the technical indicators of the trading object specified in the quantitative trading strategy meet the preset conditions, an order is placed on the trading object. Taking the moving average golden cross opening strategy as an example, when the moving average of the trading object specified in the quantitative trading strategy meets the golden cross within a certain period, a buy order is placed on the trading object, thereby helping investors better seize trading opportunities, achieve more accurate and efficient trading operations, and improve trading efficiency and speed. Investors can define the logic of the preset quantitative trading strategy based on the visual interactive interface provided by the client front-end. That is, investors can directly specify the preset trading conditions and the trading instructions to be executed after the preset trading conditions are met through the visual interactive interface provided by the client front-end. When the corresponding quantitative trading strategy is executed and the specified preset trading conditions are met, the strategy execution end can automatically trigger buy or sell trading instructions and send the corresponding trading request to the corresponding trading request interface on the server to realize the transaction.
[0038] Specifically, the client frontend can determine the message push time for triggering the execution of the first quantitative trading strategy by the client backend, i.e., the strategy execution end, according to the above S210-S230, in response to the triggering operation of the first quantitative trading strategy; and when the message push time is reached, push the quantitative strategy execution message to the strategy execution end; then, the strategy execution end can execute the first quantitative trading strategy. Specifically, the strategy execution end executes the first quantitative trading strategy by sending a trading request to the corresponding trading request interface of the server (specifically, the server corresponding to the client) based on the strategy logic in the first quantitative trading strategy. Specifically, upon receiving a trigger operation for the first quantitative trading strategy, the message push time for the quantitative strategy execution message used to trigger the execution of the first quantitative trading strategy is determined by the actual number of requests to the trading request interface involved in the first quantitative trading strategy within a certain frequency-limited statistical period. This controls the actual execution time of each execution when the same quantitative trading strategy is executed multiple times, or the actual execution time of each quantitative trading strategy when multiple different quantitative trading strategies are triggered and executed sequentially or simultaneously. This, in turn, controls the call interval time for calling the same trading request interface when the same quantitative trading strategy is executed multiple times, or the call interval time for calling the same trading request interface when multiple different quantitative trading strategies are executed simultaneously or sequentially. In other words, it limits the frequency of calls to the trading request interface between different quantitative trading strategies or different execution rounds of the same quantitative strategy, thus avoiding server overload and reduced response success rate due to high concurrency calls to the trading request interface. It is understood that this type of inter-round frequency limitation can be considered a first-type frequency limitation strategy for the trading request interface, which will be described in subsequent embodiments.
[0039] Furthermore, the execution of a single execution round of a quantitative trading strategy often involves multiple calls to the same trading request interface. Similarly, limiting the frequency of calls to the trading request interface within an execution round can prevent server overload and reduced response success rate caused by high concurrency calls to the trading request interface. It is understood that this type of frequency limitation within a round can be considered a second type of frequency limitation strategy for the trading request interface, which will be described in subsequent embodiments.
[0040] To facilitate the distinction between the two types of frequency limiting strategies involved in this application (the first type is the frequency limiting strategy corresponding to S210-240, i.e., the frequency limiting strategy before the execution of the first quantitative trading strategy, which is the frequency limiting strategy at the time of message push for the execution of the quantitative strategy; the second type is the frequency limiting strategy during the execution of the first quantitative trading strategy, i.e., the frequency limiting strategy when the trading request interface responds to the trading request), this application divides the execution of the first quantitative trading strategy into two stages: the inter-round stage and the intra-round stage. In the inter-round stage, the execution conditions of the quantitative trading strategy are not yet met, and the logic defined by the quantitative trading strategy will not be executed, corresponding to the first type of frequency limiting strategy; in the intra-round stage, the logic defined by the quantitative trading strategy will be executed. When a new K-line appears in the market conditions involved in the quantitative trading strategy, after a certain time interval, or when a specific time is reached, the intra-round stage can be entered, corresponding to the second type of frequency limiting strategy.
[0041] For example, taking a quantitative trading strategy as an example, suppose that when executing the quantitative trading strategy, stock A is bought and stock B is shorted. The interval between the two order requests corresponding to buying stock A and shorting stock B is called the intra-round interval under the intra-round phase. When the quantitative trading strategy is triggered again, stock A is bought and stock B is shorted again. The interval between the order request for buying stock A and the previous order request for shorting stock B is called the inter-round interval under the inter-round phase.
[0042] Understandably, in a round of execution of a quantitative trading strategy, if multiple order placement / modification / cancellation operations are required, it's advisable to control the simultaneous issuance of multiple trading requests corresponding to each operation, or to maintain an interval between these requests that is less than a first issuance interval threshold but greater than a second issuance interval threshold. This is because increasing the interval between similar trading requests within a round—for example, waiting several seconds after the first order before placing the second—might cause the second order to be placed at a price other than the optimal price used for the first order, preventing the quantitative trading strategy from achieving its expected returns. Conversely, if the interval between similar trading requests is less than the second issuance interval threshold, it would lead to an excessively high frequency of similar requests, resulting in a heavy load on the risk control system and potentially causing request processing failures.
[0043] The logical relationship between multiple rounds of quantitative trading strategies is not very tight. Therefore, the time corresponding to the inter-round stage can be controlled to be less than the stage time threshold, so as to extend the time corresponding to the intra-round stage. This increases the number of effective trading requests in one round of quantitative trading strategy, making the quantitative trading strategy run more smoothly and avoiding the impact of the first type of frequency limiting strategy.
[0044] In the above process, the frequency of calls to the trading request interface can be controlled in two stages during the execution of the quantitative trading strategy. This ensures that the calls to the trading request interface are made without the user's awareness or the impact on the server load throughout the entire execution of the quantitative trading strategy, thereby improving the success rate of the quantitative trading strategy.
[0045] Furthermore, this application does not impose any restrictions on the specific types and quantities of trading request interfaces and trading requests. For example, in response to a trigger operation for the first quantitative trading strategy, the client can obtain the frequency limit duration and maximum number of requests for one or more trading request interfaces.
[0046] The aforementioned transaction request interface can be any transaction request interface required when executing the first quantitative trading strategy. For example, if executing the first quantitative trading strategy requires one or more operations such as placing an order, modifying an order, canceling an order, reversing a position, or transferring a position, then the aforementioned transaction request interface can be one or more of the following interfaces: order placement transaction request interface, order modification transaction request interface, order cancellation transaction request interface, reversal transaction request interface, and position transfer transaction request interface. Correspondingly, the transaction request corresponding to the transaction request interface can be one or more of the following requests: order placement request, order modification request, order cancellation request, reversal request, and position transfer request.
[0047] Among them, the frequency limiting statistics duration refers to the duration for which the number of requests corresponding to the transaction request interface is counted; the maximum number of requests refers to the concurrency that the transaction request interface corresponding to the server can withstand within the frequency limiting statistics duration.
[0048] In one embodiment, the frequency-limiting statistical duration and the maximum number of requests for the transaction request interface within the frequency-limiting statistical duration can be obtained as follows: Obtain the first historical transaction request of the transaction request interface within a first historical time period; determine the frequency-limiting statistical duration and the maximum number of requests based on the first historical time period and the first historical transaction request. The maximum number of requests for the transaction request interface within the frequency-limiting statistical duration refers to the maximum number of transaction requests that the transaction request interface can receive under a preset load pressure within the frequency-limiting statistical duration. The first historical time period can be the past day, week, or month.
[0049] Specifically, the client can first construct a first distribution chart and a second distribution chart for multiple first historical transaction requests within a first historical time period, based on hourly, minutely, or secondly intervals. The horizontal axis of the first distribution chart represents the first historical time period divided based on hourly, minutely, or secondly intervals, and the vertical axis represents the number of first historical transaction requests within the corresponding first historical time period. The second distribution chart represents multiple first historical transaction requests distributed according to time. Then, the client can identify a preset number of peaks in the first distribution chart. Next, the client can determine a preset percentage (e.g., a preset percentage of 80%) and, based on the second distribution chart, determine the distribution time period corresponding to a preset percentage of the first historical transaction requests among the first historical transaction requests corresponding to each of the preset number of peaks in the second distribution chart. This yields the peak time period corresponding to each of the preset number of peaks (e.g., the preset percentage of first historical transaction requests can be any consecutive historical transaction request among all first historical transaction requests under the corresponding peak, specifically, it can be the first preset percentage of first historical transaction requests in chronological order from earliest to latest among all first historical transaction requests under the corresponding peak). (Transaction requests, but not limited to these). Next, the frequency limiting statistical duration can be determined based on the peak time periods corresponding to each of the preset number of peaks (for example, the average, maximum, minimum, or median of the durations of the peak time periods corresponding to each of the preset number of peaks can be determined as the frequency limiting statistical duration). Then, based on the second distribution chart, the number of first historical transaction requests corresponding to each of the preset number of peaks within the frequency limiting statistical duration can be determined, thus obtaining the number of peak requests corresponding to each of the preset number of peaks (for example, the first historical transaction request corresponding to a peak within the frequency limiting statistical duration can be any consecutive historical transaction request within the frequency limiting statistical duration from all first historical transaction requests under the corresponding peak, specifically, it can be the first historical transaction requests within the frequency limiting statistical duration in chronological order from earliest to latest among the first historical transaction requests under the corresponding peak, but not limited to this). Next, the maximum number of requests for the transaction request interface can be determined based on the number of peak requests corresponding to each of the preset number of peaks (for example, the average, maximum, minimum, or median of the number of peak requests corresponding to each of the preset number of peaks can be determined as the maximum number of requests for the transaction request interface).
[0050] The frequency limiting duration or maximum request quantity for different transaction request interfaces can be the same or different, and this application does not impose any restrictions on this. For example, the frequency limiting duration for multiple transaction request interfaces can each be 30 seconds; the maximum number of requests for the order placement transaction request interface within the frequency limiting duration (e.g., 30 seconds) is 15 (i.e., the maximum frequency limit is 15 times every 30 seconds), and the maximum number of requests for the other transaction request interface within the frequency limiting duration (e.g., 30 seconds) is 20 (i.e., the maximum frequency limit is 20 times every 30 seconds).
[0051] Here, "current time" refers to the time when the trigger operation is received; "actual request count" refers to the number of requests actually received by the corresponding trading request interface of the server within the frequency-limited statistical period. Upon receiving a trigger operation for the first quantitative trading strategy, in response to this trigger operation, the trigger time of the operation, i.e., the current time, is used as the starting time for counting the actual number of requests received by the trading request interface. The frequency-limited statistical period is used as the statistical period for counting the actual number of requests received by the trading request interface, thus determining the statistical period and obtaining the actual number of requests from the trading request interface within the statistical period. Taking Figure 3 as an example, the frequency-limited period for a certain trading request interface is 30 seconds. Upon receiving a trigger operation for the quantitative trading strategy, the trigger time of the operation, i.e., the current time, is used as the starting time for counting the actual number of requests. The actual number of requests within the past 30 seconds, starting from the current time, is counted, totaling 10 trading requests.
[0052] The first type of frequency limiting strategy will be introduced below.
[0053] In one embodiment, S230 may include: determining a request number threshold based on the maximum request number; and determining the message push time based on the actual request number and the request number threshold.
[0054] For example, determining the request quantity threshold based on the maximum request quantity may include: determining a threshold percentage; and determining the request quantity threshold as the product of the threshold percentage and the maximum request quantity. For example, the threshold percentage may be 50%, but is not limited to this.
[0055] For example, determining the message push time based on the actual number of requests and the request number threshold includes: determining the message push time based on the magnitude of the actual number of requests and the request number threshold. Specifically, if the actual number of requests is less than or equal to the request number threshold, the current time is determined as the message push time; if the actual number of requests is greater than the request number threshold, the message push time is determined based on the time interval between the time when the transaction request interface receives the last number of requests received before the current time and the current time, as well as the frequency limiting statistics duration.
[0056] Specifically, the above process will be described below in two cases, depending on whether there is one or multiple transaction request interfaces:
[0057] Scenario 1: The number of transaction request interfaces is one. S230 above may include: determining a request quantity threshold based on the maximum request quantity; if the actual request quantity is less than or equal to the request quantity threshold, determining the current time as the message push time; if the actual request quantity is greater than the request quantity threshold, obtaining the first time interval between the time when the transaction request interface receives the first transaction request and the current time, where the first transaction request is the last number of requests received by the transaction request interface before the current time; obtaining the first rest period based on the frequency limiting statistical duration and the first time interval; and determining the message push time based on the current time and the first rest period.
[0058] Among them, the difference between the frequency limiting statistical duration and the first time interval can be calculated as the first rest duration.
[0059] The first quantity can be a threshold for the number of requests, but is not limited to this.
[0060] For example, suppose that before the current time, the transaction request interface received 10 transaction requests in order of their receiving time from earliest to latest: Transaction Request 1, Transaction Request 2, Transaction Request 3, Transaction Request 4, Transaction Request 5, Transaction Request 6, Transaction Request 7, Transaction Request 8, Transaction Request 9, and Transaction Request 10. If the first number is 7, then the first transaction request can be determined to be Transaction Request 4, which is the 7th to last transaction request in order of its receiving time from earliest to latest.
[0061] One approach is to use the current moment as the starting moment and the first rest period as the time interval, then define the time interval preceding the current moment as the message push moment. For example, the message push moment can be defined as the moment after the first rest period from the current moment.
[0062] Scenario 2: There are multiple transaction request interfaces. S230 above may include: determining a request number threshold corresponding to each of the multiple transaction request interfaces based on their maximum request number; if the actual request number of each of the multiple transaction request interfaces is less than or equal to its corresponding request number threshold, then determining the current time as the message push time; if the actual request number corresponding to at least one target transaction request interface is greater than its corresponding request number threshold, then obtaining a second time interval between the time when the target transaction request interface receives the second transaction request and the current time, wherein the second transaction request is the second-to-last number of requests received by the target transaction request interface before the current time; calculating the maximum value among the differences between the frequency limiting statistical duration and at least one second time interval to obtain a second rest duration; and determining the message push time based on the current time and the second rest duration.
[0063] For example, the message push time can be determined as the second rest period from the current time. The second quantity can be the corresponding request quantity threshold.
[0064] Alternatively, if, among the actual request counts of multiple transaction request interfaces, a first part of the actual request count is less than or equal to the corresponding request count threshold, and a second part of the actual request count is greater than the corresponding request count threshold, then for any target transaction request interface among the multiple transaction request interfaces, obtain the second time interval between the moment when the target transaction request interface receives the second transaction request and the current moment, where the second transaction request is the second-to-last number of requests received by the target transaction request interface before the current moment; calculate the maximum value among the differences between the frequency limiting statistical duration and the multiple second time intervals to obtain the second rest duration; and determine the message push time based on the current moment and the second rest duration.
[0065] In this context, the current moment mentioned above could be the moment when the trigger operation for the first quantitative trading strategy is received.
[0066] In one embodiment, as shown in Figure 3, taking a transaction request interface as an example, assuming the frequency limiting statistics duration is 30 seconds, the maximum number of requests is 15, the request number threshold is the integer value of half the maximum number of requests (7), and the first number is 7; the actual number of requests within the past 30 seconds is counted starting from the current time when the trigger operation for the first quantitative trading strategy is received. If the actual number of requests is less than or equal to 7, the current time is determined as the message push time, that is, the quantitative strategy execution message is directly pushed to the strategy execution end at the current time so that the strategy execution end executes the first quantitative trading strategy. If the number of actual requests within the past 30 seconds, starting from the current time when the trigger operation for the first quantitative trading strategy is received, is greater than 7, then the 7th to last transaction request can be determined from the transaction requests received by the transaction request interface before the current time, and the time interval (e.g., x seconds) between the request time of the 7th to last transaction request and the current time can be obtained. Then, the difference between the frequency limiting statistical duration of 30 seconds and the time interval x seconds can be determined as the rest duration (i.e., (30-x) seconds). After that, the time (30-x) seconds after the current time can be determined as the message push time, and the quantitative strategy execution message can be pushed to the strategy execution end at the message push time so that the strategy execution end can execute the first quantitative trading strategy.
[0067] In one embodiment, taking multiple transaction request interfaces (including order placement request interface and order modification request interface) as an example, it is assumed that the frequency limiting statistics duration for both the order placement request interface and the order modification request interface is 30 seconds, and the maximum number of requests is 15 and 20 respectively; the request number thresholds for the order placement request interface and the order modification request interface are the integer values rounded down from half of the corresponding maximum request number: 7 and 10 respectively, the second number corresponding to the order placement request interface is 7, and the second number corresponding to the order modification request interface is 10; the actual number of order placement requests received by the order placement interface and the second number of order modification requests received by the order modification request interface are counted within the past 30 seconds starting from the current time when the trigger operation for the first quantitative trading strategy is received. If the actual number of modification requests received by the single transaction interface is 10 for the order placement interface and 15 for the modification interface, then it can be determined that the actual number of requests for both the order placement and modification interfaces is greater than the corresponding request number threshold. Next, from the order placement requests received by the order placement interface before the current time, determine the second-to-last order placement request (i.e., the 7th-to-last order placement request), and obtain the time interval (e.g., x1 seconds) between the request time of the 7th-to-last order placement request and the current time. Simultaneously, from the modification requests received by the single transaction interface before the current time... Among the received order modification requests, identify the second-to-last order modification request, i.e., the 10th-to-last order modification request, and obtain the time interval (e.g., x2 seconds) between the request time of the 10th-to-last order modification request and the current time. Then, determine the difference between the frequency limiting statistical duration of 30 seconds and the time interval x1 seconds as the first candidate rest duration (i.e., (30-x1) seconds), and determine the difference between the frequency limiting statistical duration of 30 seconds and the time interval x2 seconds as the second candidate rest duration (i.e., (30-x2) seconds). Finally, determine the maximum value between the first and second candidate rest durations as the second rest duration. Assuming the second candidate rest duration (i.e., (30-x2) seconds) is the maximum value, the time interval between the current time (30 seconds and the current time) can be... The message push time is the time after -x2) seconds. For example, if the time interval between the current time and the time of the last request threshold received by the order transaction request interface before the current time (i.e., the 7th request from the end) is 22 seconds, and the difference between the frequency limiting statistical duration of 30 seconds and the time interval of 22 seconds is determined to be the rest duration of 8 seconds, then the time interval between the current time and the time of the last request threshold received by the order transaction request interface before the current time (i.e., the 10th request from the end) is 16 seconds, and the difference between the frequency limiting statistical duration of 30 seconds and the time interval of 16 seconds is determined to be the rest duration of 14 seconds, then the maximum value of the above two rest durations can be determined to be 14 seconds, and therefore the time after 14 seconds from the current time can be determined to be the message push time.
[0068] In the above process, the request quantity threshold is first determined based on the maximum request quantity, and then the message push time is determined based on the actual request quantity and the request quantity threshold. This ensures that the number of requests within the frequency-limited statistical period will not exceed the maximum request quantity, while maintaining high concurrency processing capability for trading requests to the greatest extent. In other words, the sending frequency of quantitative strategy execution messages that trigger the execution of quantitative trading strategies can be adjusted based on the number and frequency of previously sent trading requests. For example, if a quantitative strategy execution message is originally sent once every 3 seconds, it may need to be sent once every 15 seconds or more when the frequency of trading requests is too high. This limits the quantitative trading strategy from being executed too frequently, thereby reducing the frequency of calls to the trading request interface during the execution of the quantitative trading strategy. The execution of the quantitative trading strategy is triggered by the push of the quantitative strategy execution message. That is, the quantitative trading strategy will only start to be executed when the strategy execution end receives the quantitative strategy execution message. Therefore, it can protect the server's corresponding trading request interface from attacks of frequent requests, and also avoid investors frequently encountering request over-frequency errors, ensuring the success rate of trading interface request calls. This achieves a balance between server load pressure and request success rate, and maximizes resource utilization efficiency.
[0069] In one embodiment, in conjunction with the above embodiments, in response to a trigger operation on the second quantitative trading strategy during the execution of the first quantitative trading strategy by the strategy execution end (the content of the trigger operation is similar to that of the trigger operation on the first quantitative trading strategy), the message push time of the quantitative strategy execution message of the second quantitative trading strategy is determined, and the earliest time is the message push time of the quantitative strategy execution message of the first quantitative trading strategy.
[0070] For example, suppose the client backend, i.e. the strategy execution end, needs to execute the second quantitative trading strategy simultaneously while executing the first quantitative trading strategy. After obtaining the trigger operation for the second quantitative trading strategy, the strategy execution end can determine that the number of trading requests sent to the trading request interface within the corresponding frequency-limited statistical duration of 30 seconds when executing the first quantitative trading strategy is 15, that is, the actual number of requests is 15. If, combined with the above, it is determined that the message push time of the quantitative strategy execution message of the first quantitative trading strategy is 10 seconds after the current time, then it can be determined that the message push time of the quantitative strategy execution message of the second quantitative trading strategy is at least 10 seconds after the current time. In other words, the second quantitative trading strategy can be executed at the earliest 10 seconds after the current time.
[0071] In the above process, when multiple quantitative trading strategies are executed / triggered simultaneously, the strategy execution end can calculate the number of requests for each of the trading request interfaces involved in the multiple quantitative trading strategies. When any one quantitative trading strategy needs to wait for execution, it can control other quantitative trading strategies to also wait for execution, thereby further reducing the load pressure of trading processing and ensuring the success rate of request response.
[0072] The second type of frequency limiting strategy will be introduced below.
[0073] Based on the above, it can be understood that the process of sending a trading request to the trading request interface and the process of the trading request interface processing the trading request both belong to one round of execution of the quantitative trading strategy. In other words, triggering the trading request interface to obtain and respond to the trading request is a phase within the round, which is carried out after the quantitative strategy execution terminal is triggered to execute the quantitative trading strategy through the quantitative strategy execution message. This will be described in the following embodiments.
[0074] In one embodiment, after the quantitative strategy execution message is pushed to the strategy execution end in response to the arrival of the message push time, the strategy execution end can obtain the third transaction request to be sent to the transaction request interface when executing the first quantitative trading strategy; then, it can obtain the historical sending time of the historical transaction request sent to the transaction request interface; then, based on the time interval between the current time and the historical sending time, it determines the sending time of the third transaction request, and sends the third transaction request in response to the arrival of the sending time of the third transaction request.
[0075] Specifically, if the time interval between the current time and the historical sending time is greater than or equal to a preset time interval threshold, a third transaction request is sent to the transaction request interface, thus determining the current time as the sending time of the first transaction request. If the time interval between the current time and the historical sending time is less than the time interval threshold, the request sending time of the third transaction request is determined based on the historical sending time and the time interval threshold. In response to the arrival of the request sending time, a third transaction request is sent to the transaction request interface to instruct the server to perform the corresponding transaction operation based on the transaction request.
[0076] For example, the aforementioned historical transaction request can be the previous transaction request received before the transaction request interface receives the third transaction request. In other words, the historical transaction request can be the transaction request sent before the third transaction request is sent to the transaction request interface.
[0077] For example, the aforementioned time interval threshold represents the minimum interval between the sending times of two adjacent transaction requests sent to the same transaction request interface, for example, it could be 200 milliseconds.
[0078] For example, the policy execution end can first store the third transaction request in the delayed request module. The delayed request module can be a storage unit, such as a message queue, but is not limited to this. Simultaneously, the delayed request module can also record the sending time of each transaction request stored in the delayed request module to compare the time interval between the current time and the historical sending time. Then, the policy execution end can determine the sending time of the third transaction request based on the time interval between the historical sending time and the current time recorded by the delayed request module: if the time interval between the current time and the historical sending time is greater than or equal to a preset time interval threshold, the third transaction request is sent to the transaction request interface through the delayed request module; if the time interval between the current time and the historical sending time is less than the time interval threshold, the request sending time of the third transaction request is determined based on the historical sending time and the time interval threshold; in response to the arrival of the request sending time, the third transaction request is sent to the transaction request interface through the delayed request module.
[0079] Furthermore, when storing the sending time of transaction requests, the delayed request module can save storage space by storing only the sending time of the third transaction request and the historical sending time of the previous transaction request corresponding to the third transaction request. Additionally, when the third transaction request is sent to the transaction request interface, the historical sending time stored in the delayed request module can be updated to the sending time of the third transaction request.
[0080] For example, determining the request sending time of the third transaction request based on the historical sending time and the time interval threshold includes: calculating the time interval threshold and the difference between the time interval between the current time and the historical sending time to obtain the waiting difference; determining the request sending time of the third transaction request to be the time after which the waiting difference has occurred at least from the current time. For example, assuming that the time interval between the current time and the historical sending time is less than the time interval threshold of 200 milliseconds, then the third transaction request needs to be sent to the transaction request interface only after the time interval between the current time and the historical time interval is greater than or equal to 200 milliseconds.
[0081] In the above process, the strategy execution end can control the load of the transaction request interface in processing transaction requests by controlling the time interval between two adjacent transaction requests that need to be sent to the same transaction request interface. This can protect server resources, prevent server downtime, and improve the success rate of transaction request processing.
[0082] In one embodiment, after the aforementioned response to the message push time, push the quantitative strategy execution message to the strategy execution end, the strategy execution end can obtain the third trading request to be sent to the trading request interface when executing the first quantitative trading strategy; then, it can obtain the historical sending time of the historical trading requests sent to the trading request interface; then, based on the historical sending time and historical sending period of the historical trading requests, determine the sending time of the third trading request, wherein the historical trading requests can be the first n trading requests received before the trading request interface receives the third trading request, that is, the historical trading requests can be the first n trading requests sent before sending the third trading request to the trading request interface, where n is greater than or equal to 3, the historical sending time of the historical trading requests refers to the sending time corresponding to each trading request in the historical trading requests, and the historical sending period of the historical trading requests refers to the duration from the sending time of the first trading request to the sending time of the last trading request in the historical trading requests; in response to the arrival of the sending time of the third trading request, send the third trading request.
[0083] Specifically, after obtaining the historical sending time and historical sending period of historical transaction requests, the historical sending frequency of historical transaction requests can be determined based on the historical sending period and the number of requests corresponding to historical transaction requests. Based on the average time interval between the historical sending time and the current time of historical transaction requests, and based on the historical sending frequency and the average time interval, the current request sending interval corresponding to the third transaction request can be obtained. Then, the sending time of the third transaction request can be determined based on the current time of the third transaction request and the current request sending interval.
[0084] The current request sending interval corresponding to the third transaction request can be found in the sending time rule table based on the historical sending frequency and the average time interval. The sending time rule table records the different values of the current request sending interval when the historical sending frequency and the average time interval correspond to different values. It can be understood that the higher the historical sending frequency, the larger the current request sending interval, and the lower the average time interval, the larger the current request sending interval. Furthermore, the current request sending interval can also be determined by the following formula (1):
[0085] Where Int represents the current request sending interval, and f represents the historical sending frequency. This represents the average time interval, with α and β being preset weight values.
[0086] In one embodiment, when the strategy execution end executes the first quantitative trading strategy, it can call multiple trading request interfaces by invoking a combined function interface. This satisfies the need for multiple calls to various trading request interfaces, such as order placement and order cancellation, in trading scenarios like liquidation and complete order cancellation. This improves the efficiency of trading request interface calls and reduces the time interval between processing multiple different types of trading requests, ensuring efficient execution of the quantitative trading strategy to meet timeliness requirements. Specifically, by calling the combined function interface, multiple and / or cyclical calls can be triggered to multiple trading request interfaces related to the trading account information used by the first quantitative trading strategy. This will be described in detail below.
[0087] Specifically, the strategy execution end can obtain the call request to the combination function interface when executing the first quantitative trading strategy. Then, based on the call request and the trading account information applied by the first quantitative trading strategy, it can obtain the associated trading requests to be sent to each of the multiple trading request interfaces. For any given trading request interface, the associated trading requests include all trading requests that actually call the trading request interface when the combination function interface is called once during the execution of the first quantitative trading strategy. Next, the strategy execution end can process the corresponding associated trading requests based on the maximum number of requests for each of the multiple trading request interfaces and the first number of associated trading requests (the first number of requests is the number of associated trading requests to be sent to the trading request interface).
[0088] For example, after receiving a call request for the combined function interface, the strategy execution end can parse the call request to determine the transaction operation information indicated by the call request. The transaction operation information includes at least one of the following, but is not limited to: transaction operation type (e.g., buy, sell, liquidate, cancel order, etc.), virtual resource identifier, transaction operation quantity (i.e., the number of transaction operations under the above transaction operation type performed on the virtual resource corresponding to the virtual resource identifier), and transaction price parameters (e.g., market price, limit price). Next, it can obtain the transaction account information applied to the first quantitative trading strategy. The transaction account information includes at least one of the following, but is not limited to: account position information and account order information (specifically, it can be the information of the account's in-transit orders, which refer to orders that have been submitted but not yet completed). Then, it can determine specific transaction account information from the transaction account information based on the transaction operation information. Finally, based on the specific transaction account information and the transaction operation information, it can determine the multiple transaction request interfaces that need to be called and the associated transaction requests to be sent to each of the multiple transaction request interfaces.
[0089] For example, suppose the account holding information in the trading account information includes 16 holding records for virtual resource 1, and the account order information in the trading account information includes 17 in-transit order records for virtual resource 2. If the trading operation information indicated by the call request is "liquidation, virtual resource 1, market price", then it can be determined that the specific trading account information contains 16 holding records for virtual resource 1. Based on this holding record information and the trading operation information, it can be determined that the trading request interface to be called is the order placement request interface, and that the associated trading requests to be sent to the order placement request interface are order placement requests with a quantity of 16. Then, the virtual resource 1 can be liquidated at the market price through the order placement request interface. If the transaction operation information indicated by the call request is "cancellation, virtual resource 2", then 17 in-transit order records for virtual resource 2 can be identified for a specific transaction account. Based on the in-transit order record information and the transaction operation information, the transaction request interface to be called is the cancellation transaction request interface, and the associated transaction request cancellation request to be sent to the cancellation transaction request interface is identified, wherein the number of cancellation transaction requests is 17.
[0090] For example, the above-mentioned processing of the corresponding related transaction requests based on the maximum number of requests for each of the multiple transaction request interfaces and the first number of requests for the corresponding related transaction requests includes the following three methods, but is not limited to these:
[0091] Method 1: For any target transaction request interface among multiple transaction request interfaces, count the first number of related transaction requests corresponding to the target transaction request interface within the corresponding frequency-limited statistical period; if the first number of requests is less than or equal to the maximum number of requests of the target transaction request interface, trigger the target transaction request interface to execute the first number of related transaction requests; if the first number of requests is greater than the maximum number of requests of the target transaction request interface, trigger the target transaction request interface to execute the first maximum number of related transaction requests among the first number of related transaction requests; trigger the target transaction request interface to return a failure to execute other related transaction requests among the first number of related transaction requests excluding the first maximum number of related transaction requests.
[0092] For example, suppose the order placement request interface can process a maximum of 15 order placement requests within a 30-second time limit, i.e., the maximum number of requests is 15. If the execution of the first quantitative trading strategy requires closing 16 positions, i.e., 16 order placement requests are needed, then in Method 1, the strategy execution end can trigger the order placement request interface to execute the first 15 of the 16 related transaction requests (i.e., order placement requests), and then trigger the order placement request interface to send the corresponding order placement request to instruct the server to execute the corresponding order placement operation according to the order placement request. If the execution of the last of the 16 related transaction requests fails, the strategy execution end can then obtain the error information and notify the investment institution to handle the failed related transaction request.
[0093] Method 2: For any target transaction request interface among multiple transaction request interfaces, calculate the ratio of the corresponding frequency limiting statistical duration to the maximum number of requests for the target transaction request interface to obtain the request processing interval; based on the request sending time interval between every two related transaction requests in the related transaction requests to be sent to the target transaction request interface as the request processing interval, send the corresponding related transaction requests to the target transaction request interface in sequence to trigger the target transaction request interface and execute the corresponding related transaction requests.
[0094] For example, assuming the order transaction request interface can process a maximum of 15 order requests within a 30-second frequency limiting period (i.e., the maximum number of requests is 15), in Method 2, the strategy execution end can determine that the ratio of the 30-second frequency limiting period to the maximum number of requests (15) is 2, resulting in a request processing interval of 2 seconds. Therefore, the strategy execution end can send an order request to the order transaction request interface every 2 seconds, thus confirming that the number of order requests received by the order transaction request interface within the 30-second frequency limiting period is less than the maximum number of requests (15), and the frequency limiting for the order transaction request interface will not be triggered.
[0095] Method 3: For any target transaction request interface among multiple transaction request interfaces, count the number of first requests of related transaction requests corresponding to the target transaction request interface within the corresponding frequency-limited statistical period; in response to the first request number being less than or equal to the maximum request number of the target transaction request interface, trigger the target transaction request interface to execute the first request number of related transaction requests; in response to the third request number being greater than the maximum request number of the target transaction request interface, trigger the target transaction request interface to execute the first maximum request number of related transaction requests; in response to the time when the frequency-limited statistical period after executing the first maximum request number of related transaction requests is reached, trigger the target transaction request interface to execute the other related transaction requests in the first request number of related transaction requests excluding the first maximum request number of related transaction requests.
[0096] For example, assuming the order placement request interface can process a maximum of 15 order placement requests within the 30-second frequency limit statistics period, and the first quantitative trading strategy requires closing 16 positions (i.e., 16 order placement requests), then in Method 3, the strategy execution end can trigger the order placement request interface to execute the first 15 of the 16 related transaction requests (i.e., order placement requests). After waiting for the 30-second frequency limit statistics period, or after the first 15 related transaction requests have been executed, the order placement request interface can be triggered to execute the last of the 16 related transaction requests.
[0097] It should be noted that all the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0098] It should be noted that in the specific implementation of this application, data related to transaction operation information, transaction account information, quantitative trading strategies, etc. are involved. When the embodiments of this application are applied to specific products or technologies, user permission, consent or authorization is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0099] Figure 4 is a schematic diagram of a transaction processing device 400 provided in an embodiment of this application. As shown in Figure 4, the device 400 includes: a first acquisition module 401, a first determination module 402, a second determination module 403, a push module 404, a second acquisition module 405, a third acquisition module 406, a first sending module 407, a fourth acquisition module 408, a fifth acquisition module 409, a first statistics module 410, an execution return module 411, a sixth acquisition module 412, a seventh acquisition module 413, a first calculation module 414, a sending control module 415, an eighth acquisition module 416, a ninth acquisition module 417, a second statistics module 418, and a trigger execution module 419.
[0100] In one embodiment, the first acquisition module 401 is used to acquire, in response to a trigger operation for the first quantitative trading strategy, the frequency-limiting statistical duration of the trading request interface and the maximum number of requests made by the trading request interface within the frequency-limiting statistical duration; the first determination module 402 is used to determine the actual number of requests made by the trading request interface within the frequency-limiting statistical duration prior to the current time; the second determination module 403 is used to determine the message push time of the quantitative strategy execution message based on the maximum number of requests made by the trading request interface and the actual number of requests made, the quantitative strategy execution message being used to trigger the execution of the first quantitative trading strategy; and the push module 404 is used to push the quantitative strategy execution message to the strategy execution end in response to the arrival of the message push time, so that the strategy execution end executes the first quantitative trading strategy.
[0101] In one embodiment, the second determining module 403 is specifically configured to: determine a request number threshold based on the maximum request number; if the actual request number is less than or equal to the request number threshold, determine the current time as the message push time; if the actual request number is greater than the request number threshold, obtain the first time interval between the time when the transaction request interface receives the first transaction request and the current time, wherein the first transaction request is the penultimate number of requests received by the transaction request interface before the current time; calculate the difference between the frequency limiting statistical duration and the first time interval to obtain the first rest duration; and determine the message push time based on the current time and the first rest duration.
[0102] In one embodiment, the second determining module 403 is specifically configured to: determine the request number threshold corresponding to each of the multiple maximum request numbers based on the maximum request number of each of the multiple transaction request interfaces; if the actual request number of each of the multiple transaction request interfaces is less than or equal to the corresponding request number threshold, then determine the current time as the message push time; if the actual request number corresponding to at least one target transaction request interface among the multiple transaction request interfaces is greater than the corresponding request number threshold, then obtain the second time interval between the time when the target transaction request interface receives the second transaction request and the current time, wherein the second transaction request is the second-to-last number of requests received by the target transaction request interface before the current time; calculate the maximum value among the differences between the frequency limiting statistical duration and at least one second time interval to obtain the second rest duration; and determine the message push time based on the current time and the second rest duration.
[0103] In one embodiment, the second acquisition module 405 is configured to: acquire, via the strategy execution end, a third transaction request to be sent to the transaction request interface when executing the first quantitative trading strategy; the third acquisition module 406 is configured to: acquire the historical sending time of the historical transaction request sent to the transaction request interface; the first sending module 407 is configured to: send the third transaction request to the transaction request interface if the time interval between the current time and the historical sending time is greater than or equal to a preset time interval threshold; if the time interval between the current time and the historical sending time is less than the time interval threshold, determine the request sending time of the third transaction request based on the historical sending time and the time interval threshold; and send the third transaction request to the transaction request interface in response to the arrival of the request sending time.
[0104] In one embodiment, the fourth acquisition module 408 is used to: acquire, through the strategy execution end, a call request to the combined function interface when executing the first quantitative trading strategy; the fifth acquisition module 409 is used to: acquire, based on the call request and the trading account information applied by the first quantitative trading strategy, the associated trading requests to be sent to each of the multiple trading request interfaces; the first statistics module 410 is used to: for any target trading request interface among the multiple trading request interfaces, count the number of first requests corresponding to the target trading request interface within the corresponding frequency-limited statistical period; the execution return module 411 is used to: in response to the number of first requests being greater than the maximum number of requests of the target trading request interface, trigger the target trading request interface to execute the first maximum number of associated trading requests among the first number of associated trading requests; trigger the target trading request interface to return a failure to execute other associated trading requests among the first number of associated trading requests excluding the first maximum number of associated trading requests.
[0105] In one embodiment, the sixth acquisition module 412 is used to: acquire, through the strategy execution end, the call request for the combined function interface when executing the first quantitative trading strategy; the seventh acquisition module 413 is used to: acquire, based on the call request and the trading account information applied by the first quantitative trading strategy, the associated trading requests to be sent to each of the multiple trading request interfaces; the first calculation module 414 is used to: for any target trading request interface among the multiple trading request interfaces, calculate the ratio of the corresponding frequency limiting statistical duration to the maximum number of requests of the target trading request interface, and obtain the request processing interval; the sending control module 415 is used to: based on the request sending time interval between every two associated trading requests in the associated trading requests to be sent to the target trading request interface as the request processing interval, sequentially send the corresponding associated trading requests to the target trading request interface, trigger the target trading request interface, and execute the corresponding associated trading requests.
[0106] In one embodiment, the eighth acquisition module 416 is configured to: acquire, through the strategy execution end, a call request to the combined function interface when executing the first quantitative trading strategy; the ninth acquisition module 417 is configured to: acquire, based on the call request and the trading account information applied by the first quantitative trading strategy, the associated trading requests to be sent to each of the multiple trading request interfaces; the second statistics module 418 is configured to: for any target trading request interface among the multiple trading request interfaces, count the first number of associated trading requests corresponding to the target trading request interface within the corresponding frequency-limited statistical duration; the trigger execution module 419 is configured to: in response to the third number of requests being greater than the maximum number of requests of the target trading request interface, trigger the target trading request interface to execute the first maximum number of associated trading requests among the first number of associated trading requests; in response to the time when the frequency-limited statistical duration after the execution of the first maximum number of associated trading requests is reached, trigger the target trading request interface to execute the other associated trading requests among the first number of associated trading requests besides the first maximum number of associated trading requests.
[0107] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device 400 shown in FIG4 can execute the above method embodiments, and the foregoing and other operations and / or functions of each module in the device 400 are respectively for implementing the corresponding processes in the above methods. For the sake of brevity, they will not be repeated here.
[0108] The apparatus 400 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0109] Figure 5 is a schematic diagram of an electronic device 500 provided in an embodiment of this application.
[0110] As shown in Figure 5, the electronic device 500 may include:
[0111] The system includes a memory 510 and a processor 520. The memory 510 stores computer programs and transfers the program code to the processor 520. In other words, the processor 520 can retrieve and run the computer program from the memory 510 to implement the methods described in the embodiments of this application.
[0112] For example, the processor 520 can be used to execute the above-described method embodiments according to instructions in the computer program.
[0113] In some embodiments of this application, the processor 520 may include, but is not limited to:
[0114] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0115] In some embodiments of this application, the memory 510 includes, but is not limited to:
[0116] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0117] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 510 and executed by the processor 520 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0118] As shown in Figure 5, the electronic device may also include:
[0119] Transceiver 530, which can be connected to processor 520 or memory 510.
[0120] The processor 520 can control the transceiver 530 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 530 may include a transmitter and a receiver. The transceiver 530 may further include antennas, and the number of antennas may be one or more.
[0121] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0122] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0123] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, the computer can perform all or part of the corresponding processes in the methods of the embodiments of this application, producing the functions achievable by the methods of the embodiments of this application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).
[0124] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0126] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
Claims
1. A transaction processing method, characterized in that, include: In response to a trigger operation for the first quantitative trading strategy, the frequency limit statistics duration of the trading request interface is obtained, as well as the maximum number of requests to the trading request interface within the frequency limit statistics duration. Determine the actual number of requests made by the transaction request interface within the frequency limiting statistical duration prior to the current time. The message push time of the quantitative strategy execution message is determined based on the maximum number of requests and the actual number of requests corresponding to the transaction request interface. The quantitative strategy execution message is used to trigger the execution of the first quantitative trading strategy. In response to the arrival of the message push time, the quantitative strategy execution message is pushed to the strategy execution end so that the strategy execution end executes the first quantitative trading strategy.
2. The method according to claim 1, characterized in that, The step of determining the message push time for the quantitative strategy execution message based on the maximum and actual request counts corresponding to the transaction request interface includes: Determine the request quantity threshold based on the maximum request quantity; If the actual number of requests is less than or equal to the request number threshold, then the current time is determined to be the message push time; If the actual number of requests is greater than the request number threshold, then the first time interval between the moment when the transaction request interface receives the first transaction request and the current moment is obtained, wherein the first transaction request is the last number of requests received by the transaction request interface before the current moment. The first rest duration is obtained based on the frequency limiting statistical duration and the first time interval; The message push time is determined based on the current time and the first rest duration.
3. The method according to claim 1, characterized in that, The step of determining the message push time for the quantitative strategy execution message based on the maximum and actual request counts corresponding to the transaction request interface includes: Based on the maximum number of requests for each of the multiple transaction request interfaces, a request number threshold corresponding to each of the maximum request numbers is determined; If the actual number of requests for each of the multiple transaction request interfaces is less than or equal to the corresponding request number threshold, then the current time is determined to be the message push time. If the actual number of requests corresponding to at least one target transaction request interface among the multiple transaction request interfaces is greater than the corresponding request number threshold, obtain the second time interval between the moment when the target transaction request interface receives the second transaction request and the current moment, wherein the second transaction request is the second-to-last number of requests received by the target transaction request interface before the current moment; calculate the maximum value among the differences between the frequency limiting statistical duration and at least one of the second time intervals to obtain the second rest duration; determine the message push time based on the current moment and the second rest duration.
4. The method according to claim 1, characterized in that, After responding to the arrival of the message push time and pushing the quantization strategy execution message to the strategy execution end, the response further includes: The third transaction request to be sent to the transaction request interface when executing the first quantitative trading strategy is obtained through the strategy execution terminal; Obtain the historical sending time of the historical transaction request sent to the transaction request interface; If the time interval between the current time and the historical sending time is greater than or equal to a preset time interval threshold, then the third transaction request is sent to the transaction request interface; If the time interval between the current time and the historical sending time is less than the time interval threshold, then the request sending time of the third transaction request is determined based on the historical sending time and the time interval threshold. In response to the arrival of the request sending time, the third transaction request is sent to the transaction request interface.
5. The method according to any one of claims 1-4, characterized in that, After responding to the arrival of the message push time and pushing the quantization strategy execution message to the strategy execution end, the response further includes: The strategy execution terminal obtains the call request for the combination function interface when executing the first quantitative trading strategy; Based on the invocation request and the trading account information to which the first quantitative trading strategy is applied, obtain the associated trading requests to be sent to each of the multiple trading request interfaces; For any target transaction request interface among the multiple transaction request interfaces, count the number of first requests of the associated transaction requests corresponding to the target transaction request interface within the corresponding frequency-limited statistical period; In response to the first request number being greater than the maximum request number of the target transaction request interface, the target transaction request interface is triggered to execute the first maximum number of related transaction requests out of the first number of related transaction requests; The target transaction request interface is triggered, and it returns a failure to execute any other related transaction requests out of the first number of related transaction requests except for the first maximum number of related transaction requests.
6. The method according to any one of claims 1-4, characterized in that, After responding to the arrival of the message push time and pushing the quantization strategy execution message to the strategy execution end, the response further includes: The strategy execution terminal obtains the call request for the combination function interface when executing the first quantitative trading strategy; Based on the invocation request and the trading account information to which the first quantitative trading strategy is applied, obtain the associated trading requests to be sent to each of the multiple trading request interfaces; For any target transaction request interface among the multiple transaction request interfaces, calculate the ratio of the corresponding frequency limiting statistical duration to the maximum number of requests for the target transaction request interface to obtain the request processing interval; Based on the request processing interval of the time interval between every two related transaction requests in the related transaction requests to be sent to the target transaction request interface, the corresponding related transaction requests are sent to the target transaction request interface in sequence, triggering the target transaction request interface to execute the corresponding related transaction requests.
7. The method according to any one of claims 1-4, characterized in that, After responding to the arrival of the message push time and pushing the quantization strategy execution message to the strategy execution end, the response further includes: The strategy execution terminal obtains the call request for the combination function interface when executing the first quantitative trading strategy; Based on the invocation request and the trading account information to which the first quantitative trading strategy is applied, obtain the associated trading requests to be sent to each of the multiple trading request interfaces; For any target transaction request interface among the multiple transaction request interfaces, count the number of first requests of the associated transaction requests corresponding to the target transaction request interface within the corresponding frequency-limited statistical period; In response to the first request number being greater than the maximum request number of the target transaction request interface, the target transaction request interface is triggered to execute the first maximum number of related transaction requests out of the first number of related transaction requests; In response to the time limit statistics after the execution of the maximum number of related transaction requests, the target transaction request interface is triggered to execute other related transaction requests in the first number of related transaction requests, excluding the maximum number of related transaction requests.
8. A transaction processing apparatus, characterized in that, include: The first acquisition module is used to respond to the trigger operation for the first quantitative trading strategy, acquire the frequency limit statistics duration of the trading request interface, and the maximum number of requests of the trading request interface within the frequency limit statistics duration. The first determining module is used to determine the actual number of requests made by the transaction request interface within the frequency limiting statistical duration prior to the current time. The second determining module is used to determine the message push time of the quantitative strategy execution message based on the maximum number of requests and the actual number of requests corresponding to the transaction request interface. The quantitative strategy execution message is used to trigger the execution of the first quantitative trading strategy. The push module is used to push the quantitative strategy execution message to the strategy execution terminal in response to the arrival of the message push time, so that the strategy execution terminal executes the first quantitative trading strategy.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.