Order matching method and device, equipment and medium
By dividing historical transaction information into multiple intervals and determining price sub-ranges, the problems of slow market order matching speed and unreasonable price are solved, and more efficient order matching and price rationality are achieved.
Patent Information
- Application Number
- CN202411966802.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
AI Technical Summary
When the order amount is large, the matching process is slow and the price of the matching large order is not optimal, resulting in a higher final matching price.
By extracting the historical transaction information before the transaction to be matched, dividing it into multiple historical transaction intervals according to the transaction time, and determining multiple price sub-ranges for each interval, the order matching transaction to be matched at any price in each price sub-range until the matched is successful.
It improves the speed and price rationality of order matching, ensures the rationality of price distribution and order matching efficiency.
Smart Images

Figure CN119887329A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to an order matching method, device, equipment and medium. Background Art
[0002] For market buy orders, the system will search for the best or lowest price sell order from the current sell orders and try to trade at that price. If the number of sell orders is not enough to meet the total number of market buy orders, the system will continue to search for the next best price sell order until all market buy orders are traded or there are no more matching sell orders in the market.
[0003] Since a market buy order does not specify a price, it selects the lowest price from the limit order or the newly generated sell order for trading, which focuses on faster time. On the contrary, a sell order needs to select the highest price among the buy orders.
[0004] When the market order amount is large, the matching process requires multiple order combinations, which is slow. Or the price of the matched large order is not optimal, resulting in a higher final matching price.
[0005] Therefore, there is an urgent need for an order matching method to improve the speed and price rationality of order matching. Summary of the invention
[0006] The present application provides an order matching method, device, equipment and medium for improving the matching speed and price rationality of market orders.
[0007] In a first aspect, the present application provides an order matching method, the method comprising:
[0008] Based on the triggered transaction to be matched, extract the historical transaction information that has been completed before the transaction to be matched; divide the historical transaction information into multiple historical transaction intervals according to the transaction time;
[0009] For each historical trading interval, multiple price sub-intervals corresponding to the historical trading interval are determined; the order of the transaction to be matched is matched at any price in each price sub-interval; if there is a successfully matched order, the historical matching time of the price corresponding to the successfully matched order in the historical trading information is determined; according to the current matching time of the successfully matched order and the historical matching time, the price sub-interval of the next round of matching is determined, until the successfully matched orders meet the transaction to be matched.
[0010] In a possible implementation manner, determining the price subrange for the next round of matching according to the current matching time of the successfully matched order and the historical matching time includes:
[0011] If the current matching time falls within the matching duration interval corresponding to the historical matching time, then based on the price sub-interval where the successfully matched order is located, multiple price sub-intervals are re-determined and order matching is continued; wherein the prices between the re-determined price sub-intervals are closer.
[0012] In a possible implementation manner, determining the price subrange for the next round of matching according to the current matching time of the successfully matched order and the historical matching time includes:
[0013] If the current matching time is greater than the maximum value of the matching time interval, the order matching will continue in the first price sub-interval, where the price in the first price sub-interval is higher than the price corresponding to the successfully matched order;
[0014] If the current matching time is less than the minimum value of the matching time interval, the order matching will continue in the second price sub-interval, where the second price sub-interval is a price lower than the price corresponding to the successfully matched order.
[0015] In a possible implementation manner, dividing the historical transaction information into multiple historical transaction intervals according to transaction time includes:
[0016] Determine a first quantity of a historical transaction interval according to the total transaction quantity of the historical transaction information; determine a sub-value of each historical transaction interval according to the total transaction value of the historical transaction information and the first quantity;
[0017] Based on the transaction time of the highest transaction price in the historical transaction information, a first historical transaction interval located before and after the transaction time and having a cumulative amount equal to the sub-value is divided;
[0018] Determine, according to the first transaction and the last transaction included in the first historical transaction interval, a second historical transaction interval that is located before the transaction time of the first transaction and after the transaction time of the last transaction and has a cumulative amount equal to the sub-value;
[0019] Until the first number of historical trading intervals are divided.
[0020] In a possible implementation manner, determining a plurality of price sub-ranges corresponding to the historical trading range includes:
[0021] Determine the reference price and price gradient of the historical trading range;
[0022] According to the price drop gradient and the reference price, a plurality of price sub-ranges corresponding to the historical trading range are determined.
[0023] In a possible implementation manner, determining the reference price and the price difference gradient of the historical trading interval includes:
[0024] Determine the reference price according to the first price of the first transaction in the historical transaction interval, the second price of the last transaction and the highest price or the lowest price in the historical transaction interval;
[0025] Determine a total price drop gradient according to the difference between the first price and the second price and the highest price or the lowest price in the historical trading range respectively;
[0026] Determining a second number of price subranges based on the total number of transactions in the historical trading range;
[0027] A price drop gradient is determined according to the total price drop gradient and the second quantity.
[0028] In a possible implementation, matching the order of the to-be-matched transaction at any price in each price subrange includes:
[0029] Determine a pre-generated order based on the transaction to be matched, where the total amount of the pre-generated order is higher than the total amount of the transaction to be matched;
[0030] The total amount of the pre-generated order is divided into sub-amounts that need to be successfully matched in each historical trading interval;
[0031] For each historical trading range, the number of orders to be matched in each price sub-range is determined based on the reference price of the historical trading range and the sub-amount;
[0032] Orders are matched according to the median price of each price sub-range and the number of orders to be matched.
[0033] In a second aspect, the present application provides an order matching device, the device comprising:
[0034] A division module is used to extract historical transaction information that has been completed before the triggered transaction to be matched based on the transaction to be matched; and divide the historical transaction information into multiple historical transaction intervals according to the transaction time;
[0035] The matching module is used to determine, for each historical trading interval, a plurality of price sub-intervals corresponding to the historical trading interval; match orders for the to-be-matched transaction at any price in each price sub-interval; if there is a successfully matched order, determine the historical matching time of the price corresponding to the successfully matched order in the historical trading information; determine the price sub-interval for the next round of matching according to the current matching time of the successfully matched order and the historical matching time, until the successfully matched orders meet the to-be-matched transaction.
[0036] In a possible implementation, the matching module is specifically configured to, if the current matching time falls within the matching duration interval corresponding to the historical matching time, re-determine multiple price sub-intervals based on the price sub-interval in which the successfully matched order is located and continue order matching; wherein the prices between the re-determined price sub-intervals are closer.
[0037] In a possible implementation, the matching module is specifically configured to continue order matching with a first price sub-range if the current matching time is greater than the maximum value of the matching time interval, and the first price sub-range is a price higher than the price corresponding to the successfully matched order; if the current matching time is less than the minimum value of the matching time interval, continue order matching with a second price sub-range, and the second price sub-range is a price lower than the price corresponding to the successfully matched order.
[0038] In a possible implementation, the division module is specifically used to determine a first number of historical transaction intervals based on the total number of transactions in the historical transaction information; determine a sub-value of each historical transaction interval based on the total transaction value of the historical transaction information and the first number; divide the first historical transaction interval located before and after the transaction time and with a cumulative amount of the sub-value based on the transaction time of the highest transaction price in the historical transaction information; determine a second historical transaction interval located before the transaction time of the first transaction and after the transaction time of the last transaction and with a cumulative amount of the sub-value based on the first transaction and the last transaction included in the first historical transaction interval; until the first number of historical transaction intervals are divided.
[0039] In a possible implementation, the matching module is specifically used to determine a reference price and a price difference gradient of the historical trading interval; and determine a plurality of price sub-intervals corresponding to the historical trading interval according to the price difference gradient and the reference price.
[0040] In a possible implementation, the matching module is specifically used to determine the reference price based on the first price of the first transaction in the historical trading interval, the second price of the last transaction and the highest price or the lowest price in the historical trading interval; determine the total price drop gradient based on the difference between the first price and the second price and the highest price or the lowest price in the historical trading interval respectively; determine the second number of price sub-intervals based on the total number of transactions in the historical trading interval; determine the price drop gradient based on the total price drop gradient and the second number.
[0041] In a possible implementation, the matching module determines a pre-generated order based on the transaction to be matched, and the total amount of the pre-generated order is higher than the total amount of the transaction to be matched; the total amount of the pre-generated order is evenly divided into sub-amounts that need to be matched successfully in each historical trading interval; for each historical trading interval, the number of orders to be matched in each price sub-range is determined based on the reference price of the historical trading interval and the sub-amount; and the order is matched according to the median price of each price sub-range and the number of orders to be matched.
[0042] In a third aspect, the present application provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any method described in the first aspect when executing a computer program stored in the memory.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any method described in the first aspect.
[0044] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes the steps of any method described in the first aspect.
[0045] In an embodiment of the present application, based on the triggered transaction to be matched, historical transaction information that has been completed before the transaction to be matched is extracted, and the historical transaction information is divided into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, multiple price sub-intervals corresponding to the historical transaction interval are determined, and the order of the transaction to be matched is matched in parallel at any price in each price sub-interval, so as to ensure the rationality of price distribution and order matching efficiency; if there is a successfully matched order, the historical matching time of the price corresponding to the order in the historical transaction information is determined, and the rationality of the current price is judged according to the current matching time and the historical matching time, so as to determine the price sub-interval for the next round of matching, until the successfully matched orders meet the transaction to be matched, thereby further improving the efficiency of order matching and the rationality of price. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0047] Figure 1 A schematic diagram of an order matching process provided for some embodiments of the present application;
[0048] Figure 2 A historical order schematic diagram provided for some embodiments of the present application;
[0049] Figure 3 A schematic diagram of price sub-ranges provided for some embodiments of the present application;
[0050] Figure 4 Another schematic diagram of price subranges provided for some embodiments of the present application;
[0051] Figure 5 A schematic diagram of the structure of an order matching device provided for some embodiments of the present application;
[0052] Figure 6 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application clearer, this application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0054] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0055] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0056] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0057] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0059] Before introducing the order matching method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced.
[0060] For market buy orders, the system will search for the best or lowest price sell order from the current sell orders and try to trade at that price. If the number of sell orders is not enough to meet the total number of market buy orders, the system will continue to search for the next best price sell order until all market buy orders are traded or there are no more matching sell orders in the market.
[0061] Since a market buy order does not specify a price, it selects the lowest price from the limit order or the newly generated sell order for trading, which focuses on faster time. On the contrary, a sell order needs to select the highest price among the buy orders.
[0062] When the market order amount is large, the matching process requires multiple order combinations, which is slow. Or the price of the matched large order is not optimal, resulting in a higher final matching price.
[0063] Therefore, there is an urgent need for an order matching method to improve the speed and price rationality of order matching.
[0064] Based on this, the present application provides an order matching method, device, equipment, medium and computer program product. In this method, based on the triggered transaction to be matched, extract the historical transaction information that has been completed before the transaction to be matched; divide the historical transaction information into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, determine the multiple price sub-intervals corresponding to the historical transaction interval; match the order of the transaction to be matched at any price in each price sub-interval; if there is a successfully matched order, determine the historical matching time of the price corresponding to the successfully matched order in the historical transaction information; determine the price sub-interval of the next round of matching according to the current matching time of the successfully matched order and the historical matching time, until each successfully matched order meets the transaction to be matched.
[0065] Embodiment 1:
[0066] Figure 1 A schematic diagram of an order matching process provided for some embodiments of the present application. Figure 1As shown, the process includes:
[0067] S101: Based on the triggered transaction to be matched, extract historical transaction information that has been completed before the transaction to be matched; and divide the historical transaction information into multiple historical transaction intervals according to transaction time.
[0068] The method in the embodiment of the present application is applied to an electronic device, which may be a server, a PC or other electronic device.
[0069] In order to improve the speed and price rationality of order matching, based on the triggered transactions to be matched, historical transaction information that has been completed before the transactions to be matched can be extracted, and the historical transaction information can be divided into multiple historical transaction intervals according to the transaction time.
[0070] Specifically, in a possible implementation, historical transaction information that has been completed within a preset time period T before the triggered transaction to be matched may be extracted. Figure 2 A historical order diagram is provided for some embodiments of the present application. Figure 2 As shown, the horizontal axis represents the transaction time in the historical transaction information that has been completed, and the vertical axis represents the price of the historical transaction that has been completed.
[0071] The historical transaction information is divided into multiple historical transaction intervals according to the transaction time. In a possible implementation, a preset time period T is received as input, such as T=5 minutes, representing the order price of the historical transactions completed in the last 5 minutes and the transaction quantity v of the historical transactions completed within T minutes.
[0072] In a possible implementation, the number of historical trading intervals can be freely set according to actual needs, or the number of historical trading intervals can be determined according to the total number of transactions v of historical trading information. The word value of each historical trading interval is determined according to the total transaction value in the historical trading information and the number of historical trading intervals. If the total number of transactions in the preset time range, such as 10 minutes of historical trading information, is large, and the order system liquidity of the historical trading information is good, more times and more refined historical trading interval divisions are performed to reduce slippage in the subsequent matching process and improve the efficiency of order matching. Slippage is a situation in which there is a gap between the original price point when the trader places an order during the transaction and the price point of the final actual transaction. In layman's terms, the actual transaction price of the trading order is different from the price of the pending order. Slippage essentially reflects the deviation between the actual transaction price of the investor and the set transaction price.
[0073] S102: for each historical trading interval, determining a plurality of price sub-intervals corresponding to the historical trading interval; and matching orders for the to-be-matched transaction at any price in each price sub-interval.
[0074] In order to ensure the rationality of the price of order matching, for each historical trading interval, multiple price sub-ranges corresponding to the historical trading interval can be determined, and orders can be pre-generated at any price in each price sub-range. Order matching can be performed in parallel for the pre-generated orders at multiple prices, thereby improving the rationality of the price distribution of order matching and the efficiency of order matching.
[0075] In a possible implementation, the price average or median of each historical trading interval can be calculated as a reference price, and the price difference gradient can be determined based on the difference between the reference price and the highest price or the lowest price. Multiple price sub-intervals can be determined based on the reference price and the price difference gradient. Orders can be pre-generated based on any price in each price sub-interval, and orders at any price in each price sub-interval can be matched, thereby improving the efficiency of order matching.
[0076] S103: If there is a successfully matched order, determine the historical matching time of the price corresponding to the successfully matched order in the historical transaction information; determine the price sub-range of the next round of matching according to the current matching time of the successfully matched order and the historical matching time, until all successfully matched orders meet the to-be-matched transactions.
[0077] In order to further improve the efficiency of order matching, if there are successfully matched orders, the historical matching time of the price corresponding to the successfully matched order in the historical transaction information is determined. According to the current matching time and the historical matching time of the successfully matched order, it is judged whether the current matching time is too fast or too slow, and then the price sub-range of the next round of matching is determined, until the successfully matched orders meet the total value of the transactions to be matched.
[0078] Specifically, if the current matching time of a successfully matched order is less than the historical matching time, it means that the current matching time may be too fast, which means that the price corresponding to the successfully matched order is too high, and it can be determined that the price sub-range of the next round of matching is lower than the price corresponding to the currently successfully matched order. If the current matching time of a successfully matched order is greater than the historical matching time, it means that the current matching time may be too slow, which means that the price corresponding to the successfully matched order is too low, and it can be determined that the price sub-range of the next round of matching is higher than the price corresponding to the currently successfully matched order. This continues until all successfully matched orders meet the total value of the transactions to be matched.
[0079] In an embodiment of the present application, based on the triggered transaction to be matched, historical transaction information that has been completed before the transaction to be matched is extracted, and the historical transaction information is divided into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, multiple price sub-intervals corresponding to the historical transaction interval are determined, and the order of the transaction to be matched is matched in parallel at any price in each price sub-interval, so as to ensure the rationality of price distribution and order matching efficiency; if there is a successfully matched order, the historical matching time of the price corresponding to the order in the historical transaction information is determined, and the rationality of the current price is judged according to the current matching time and the historical matching time, so as to determine the price sub-interval for the next round of matching, until the successfully matched orders meet the transaction to be matched, thereby further improving the efficiency of order matching and the rationality of price.
[0080] Embodiment 2:
[0081] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, on the basis of the above embodiment, in the embodiment of the present application, the historical transaction information is divided into multiple historical transaction intervals according to the transaction time, including:
[0082] Determine a first quantity of a historical transaction interval according to the total transaction quantity of the historical transaction information; determine a sub-value of each historical transaction interval according to the total transaction value of the historical transaction information and the first quantity;
[0083] Based on the transaction time of the highest transaction price in the historical transaction information, a first historical transaction interval located before and after the transaction time and having a cumulative amount equal to the sub-value is divided;
[0084] Determine, according to the first transaction and the last transaction included in the first historical transaction interval, a second historical transaction interval that is located before the transaction time of the first transaction and after the transaction time of the last transaction and has a cumulative amount equal to the sub-value;
[0085] Until the first number of historical trading intervals are divided.
[0086] In order to further improve the rationality of price distribution of order matching and improve the efficiency of order matching, when dividing historical transaction information into multiple historical transaction intervals according to transaction time, the first quantity of the historical transaction interval can be determined according to the total transaction quantity of the historical transaction information, for example, the logarithm of the total transaction quantity is taken to determine the first quantity; the sub-value of each historical transaction interval is determined according to the ratio of the total transaction value of the historical transaction information and the first quantity. Based on the transaction time of the highest transaction price in the historical transaction information, the first historical transaction interval located before and after the transaction time and with a cumulative amount of the sub-value is divided.
[0087] Similarly, based on the first transaction and the last transaction included in the first historical transaction interval, a second historical transaction interval is determined, which is located before the transaction time of the first transaction and after the transaction time of the last transaction and has a cumulative amount equal to the sub-value; until the first number of historical transaction intervals are divided.
[0088] Specifically, for example, the logarithm of the total number of transactions v of the historical transaction information is taken, and s = ln v is calculated, and s historical transaction intervals are obtained from the complete interval of the historical transaction information within the preset time. Among them, the sub-values of historical transactions in each historical transaction interval are equal. For another example, if there are v = 200 historical transactions within the preset time of 5 minutes, then s = lnv = ln200≈5, and the total transaction value of the current 200 transactions needs to be divided into 5 equal parts. Assuming that the total transaction value of the 200 historical transactions is 300 yuan, the sub-value of each historical transaction interval is 300 / 5 = 60 yuan. Obtain the highest transaction price B in the last 5 minutes. The total transaction value of the calculated historical transactions is 300 yuan, the number of historical transaction intervals divided is 5, and the sub-value of each historical transaction interval is 60 yuan. According to the sub-value of 60 yuan, the highest transaction price B in the historical transaction information is accumulated to the left (earlier in time) and to the right (later in time) in units of a single historical transaction order. The accumulated value to the left is 60 / 2=30 yuan, and the price B1 of the first transaction included in the historical transaction interval B is obtained. The accumulated value to the right is 60 / 2=30 yuan, and the price B2 of the last transaction included in the historical transaction interval B is obtained. The sub-value from B1 to B2 is 60. Similarly, according to the first transaction B1 and the last transaction B2 included in the historical transaction interval B, determine the historical transaction interval C that is before the transaction time of the first transaction B1 and after the transaction time of the last transaction B2 and has a cumulative amount of sub-value 60, until the 5 historical transaction intervals are divided. If sorted by transaction transaction time, it is from the order of occurrence of ACB, with B as the highest point of the hump. As mentioned above Figure 2 As shown, taking the middle three intervals of ABC as an example.
[0089] In an embodiment of the present application, when the historical transaction information is divided into multiple historical transaction intervals according to the transaction time, the first number of historical transaction intervals can be determined according to the total number of transactions in the historical transaction information, and the sub-value of each historical transaction interval can be determined according to the total transaction value and the first number of transactions in the historical transaction information. Based on the transaction time of the highest transaction price in the historical transaction information, the first historical transaction interval located before and after the transaction time and with a cumulative amount of the sub-value is divided. Similarly, based on the first transaction and the last transaction contained in the first historical transaction interval, the second historical transaction interval located before the transaction time of the first transaction and after the transaction time of the last transaction and with a cumulative amount of the sub-value is determined; until the first number of historical transaction intervals are divided, the rationality of the price distribution of order matching is further improved and the efficiency of order matching is improved.
[0090] Embodiment 3:
[0091] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, on the basis of the above embodiments, in the embodiment of the present application, the determination of multiple price sub-ranges corresponding to the historical trading range includes:
[0092] Determine the reference price and price gradient of the historical trading range;
[0093] According to the price drop gradient and the reference price, a plurality of price sub-ranges corresponding to the historical trading range are determined.
[0094] In order to further improve the rationality of price distribution of order matching and improve the efficiency of order matching, when determining the multiple price sub-ranges corresponding to the historical trading range, the reference price and price difference gradient of the historical trading range can be determined, and the multiple price sub-ranges corresponding to the historical trading range can be determined based on the sum or difference of the reference price and the price difference gradient.
[0095] In an embodiment of the present application, the reference price and price difference gradient of the historical trading interval can be determined, and based on the sum or difference of the reference price and the price difference gradient, multiple price sub-intervals corresponding to the historical trading interval can be determined, thereby further improving the rationality of the price distribution of order matching and improving the efficiency of order matching.
[0096] Embodiment 4:
[0097] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, on the basis of the above embodiments, in the embodiment of the present application, the reference price and price difference gradient of the historical trading interval are determined, including:
[0098] Determine the reference price according to the first price of the first transaction in the historical transaction interval, the second price of the last transaction and the highest price or the lowest price in the historical transaction interval;
[0099] Determine a total price drop gradient according to the difference between the first price and the second price and the highest price or the lowest price in the historical trading range respectively;
[0100] Determining a second number of price subranges based on the total number of transactions in the historical trading range;
[0101] A price drop gradient is determined according to the total price drop gradient and the second quantity.
[0102] In order to further improve the rationality of price distribution and the efficiency of order matching, when determining the reference price and price difference gradient of the historical trading range, the reference price can be determined based on the median or average price of historical transactions in the historical trading range.
[0103] In one possible implementation, a reference price is determined based on a first price of the first transaction in a historical trading interval, a second price of the last transaction, and the highest price or the lowest price in the historical trading interval; a total price drop gradient is determined based on the difference between the first price and the second price and the highest price or the lowest price in the historical trading interval, respectively, and then a second quantity of the price sub-interval is determined based on the logarithm of the total quantity of transactions in the historical trading interval; and a price drop gradient is determined based on the ratio of the total price drop gradient to the second quantity.
[0104] Specifically, for example, according to the first price B1 of the first transaction in the historical trading interval B, the second price B2 of the last transaction and the highest price B in the historical trading interval, the reference price for calculating the historical trading interval B is determined to be (B*2+B1+B2) / 4=B`. The logarithm of the total number of transactions Vb in the historical trading interval B is taken to obtain the second number of the price sub-interval Sb=lnVb, and the price difference gradient d in the historical trading interval B is obtained by (2B-B1-B2) / (2*Sb).
[0105] Assuming the total number of transactions in historical trading interval B is 150, Sb = ln150 = 5, assuming B = 1, B1 = 0.5, B2 = 0.3, calculate d = (2*B-B1-B2) / (2*Sb) = (2*1–0.5 -0.3) / (2*5) = 0.12. Then the price difference gradient in historical trading interval B is d = 0.12. The reference price of historical trading interval B is B` = (B*2+B1+B2) / 4 = 0.7.
[0106] In an embodiment of the present application, a reference price is determined based on the first price of the first transaction in the historical trading interval, the second price of the last transaction, and the highest price or the lowest price in the historical trading interval; a total price drop gradient is determined based on the difference between the first price and the second price and the highest price or the lowest price in the historical trading interval respectively; a second number of price sub-intervals is determined based on the total number of transactions in the historical trading interval; a price drop gradient is determined based on the total price drop gradient and the second number, so as to further improve the rationality of price distribution and the efficiency of order matching.
[0107] Embodiment 5:
[0108] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, on the basis of the above embodiments, in the embodiment of the present application, the order matching of the to-be-matched transaction at any price in each price sub-range includes:
[0109] Determine a pre-generated order based on the transaction to be matched, where the total amount of the pre-generated order is higher than the total amount of the transaction to be matched;
[0110] The total amount of the pre-generated order is divided into sub-amounts that need to be successfully matched in each historical trading interval;
[0111] For each historical trading range, the number of orders to be matched in each price sub-range is determined based on the reference price of the historical trading range and the sub-amount;
[0112] Orders are matched according to the median price of each price sub-range and the number of orders to be matched.
[0113] In order to further improve the efficiency of order matching, in the process of matching the transactions to be matched at any price in each price sub-range, pre-generated orders can be determined based on the transactions to be matched, and the total amount of the pre-generated orders is higher than the total amount of the transactions to be matched; for example, the total amount of the pre-generated orders is a preset multiple of the total amount of the transactions to be matched, thereby avoiding the failure of matching some pre-generated orders and further improving the efficiency of order matching.
[0114] The total amount of pre-generated orders is divided equally into sub-amounts that need to be matched successfully in each historical trading interval. For each historical trading interval, the number of orders to be matched in each price sub-range is determined based on the ratio of the sub-amounts in the historical trading interval to the reference price. Orders are matched according to the median price of each price sub-range and the number of orders to be matched.
[0115] In an embodiment of the present application, pre-generated orders are determined based on the transactions to be matched, and the total amount of the pre-generated orders is higher than the total amount of the transactions to be matched; the total amount of the pre-generated orders is evenly divided into sub-amounts that need to be successfully matched in each historical trading interval; for each historical trading interval, the number of orders to be matched in each price sub-interval is determined based on the reference price of the historical trading interval and the sub-amount; order matching is performed according to the median price of each price sub-interval and the number of orders to be matched, thereby further improving the rationality of the price distribution of order matching and improving the efficiency of order matching.
[0116] The following is a specific example to further illustrate the entire process of order matching in the embodiment of the present application.
[0117] You can accept the input of the pre-generated order amount multiple n. The total amount of the orders to be matched is 60. If n=2 is set, a pre-generated order with a total amount of 120 will be generated.
[0118] The order book composed of pre-generated orders will record the globally unique order number and the total amount of the order book. For example, if the order number is tx0001, the total amount of the order book is 120, and the original amount is 60, then the total amount of all pre-generated orders will not exceed the original amount of 60.
[0119] The total amount of the pre-generated order is also divided according to the first number of the historical trading interval. For example, if the number of historical trading intervals is 3, the amount of the pre-generated order corresponding to each historical trading interval is 40, 40, 40. Taking the above historical trading intervals divided into A, B, and C as an example, the current pre-generated order needs to correspond to the pre-generated order with a sub-amount of 40 in the historical trading intervals A, B, and C respectively. This is explained by taking the historical trading interval B as an example.
[0120] Taking the logarithm of the total transaction quantity Vb of the historical transaction interval B, we get the second quantity Sb of the price sub-interval = 5, and we need to divide it into 5 price sub-intervals to pre-generate sub-orders. Based on the reference price B` = 0.7 and the transaction amount amountB = 40 of the historical transaction interval B, we estimate the number of pre-generated orders to be 57, and the number of sub-orders for each price sub-interval is 57 / 5≈10. Figure 3 A schematic diagram of price sub-ranges is provided for some embodiments of the present application. Figure 3As shown, in the price sub-interval BM0 (Bmiddle0), the median price is B`, 10 orders with price B` are pre-generated, and the total amount of BM0 is 0.7*10=7 yuan; four price sub-intervals are determined to the left and right with a gradient of d=0.12, such as: BL2(B`-2d)---BL1(B`-1d)---BM0(B`)---BR1(B`+1d)---BR2(B`+2d). That is, the price sub-interval BL1 (B left 1) pre-generates 10 orders with the median price B`-1d, and the amount of BL1 is (0.7–0.12)*10=5.8. The price sub-interval BR1 (B right 1) places 10 orders with the median price B`+1d, and the amount is (0.7+0.12)*10=8.2. Similarly, the pre-generated orders for BL2 left interval 2 and BR2 right interval 2 are generated left and right. The median price of BL2 is B`-2d, and the median price of BR2 is B`+2d. This continues until the total amount of the five sub-intervals is equal to the order amount of interval B, which is 40. At the same time, the pre-generated orders of the five median prices are matched in parallel to further improve the price rationality and efficiency of order matching.
[0121] Embodiment 6:
[0122] In order to further improve the price rationality and efficiency of order matching, based on the above embodiments, in the embodiment of the present application, the price sub-range of the next round of matching is determined according to the current matching time and the historical matching time of the successfully matched order, including:
[0123] If the current matching time falls within the matching duration interval corresponding to the historical matching time, then based on the price sub-interval where the successfully matched order is located, multiple price sub-intervals are re-determined and order matching is continued; wherein the prices between the re-determined price sub-intervals are closer.
[0124] The price sub-range for the next round of matching is determined based on the current matching time and historical matching time of the successfully matched order. The historical matching time of the price can be determined based on the price of the successfully matched order. If there is no historical transaction of the price in the historical transaction information, the matching time of the price closest to the price is determined as the historical matching time.
[0125] In a possible implementation, the historical matching time Tbm0 may be determined, and the corresponding matching duration interval is [Tbm0-Tbm0 / 2, Tbm0+Tbm0 / 2].
[0126] If the current matching time falls within the matching duration interval corresponding to the historical matching time, it means that the price of the currently matched order is closest to the current market price. Based on the price sub-interval where the successfully matched order is located, multiple price sub-intervals can be further re-determined to continue order matching; among which, the prices between the re-determined price sub-intervals are closer.
[0127] Specifically, for example, after the pre-generated orders are generated, the matching waiting time of each pre-generated order is based on the matching time T of the completed orders of historical transactions that have been executed in the historical trading interval B as the initial value. For example, the order waiting time in the BM0 interval is the historical transaction time Tbm0 of the orders with the same price as BM0 (B`) in the historical trading interval B.
[0128] When the matching time of BM0 is between Tbm0±Tbm0 / 2, it means that the market price fluctuates around B`. At this time, multiple price sub-intervals will be further re-determined to continue order matching; the prices between the re-determined price sub-intervals are closer. The pre-generated orders of the price sub-intervals BL1, BL2, BR1, BR2 are pruned and merged from [B`-2d, B`-1d] and [B`+1d, B`+2d] to form single BL1` and BR1`. Pre-generated orders with a total amount of (40 / 5)*4 / 2=32 / 2=16 are pre-generated in BL1` and BR1` respectively. Figure 4 Another price sub-range schematic diagram provided for some embodiments of the present application. Figure 4 As shown, similarly, the price sub-ranges BL1` and BR1` are further divided into BL2` and BL1`, BR1` and BR2`. BL2(B`-2d)---BL1(B`-1d)---BM0(B`)---BR1(B`+1d)---BR2(B`+2d) are merged into BL1`(B`-1dl1`)---BM0(B`)---BR1`(B`+1dr1`), and then BL1` and BR1` are split into BL1`(B`-2dl1`)---BL1`(B`-1dl1`)---(BM0(B`) overlaps)---BR1`(B`+1dr1`)---BR1`(B`+2dr1`). It should be noted that the pre-generated orders of BL1` and BR1` overlap with the left and right sub-orders of the pre-generated orders of BM0, as shown above. Figure 4As shown. The reason is that when generating secondary sub-orders, generating them at the latest market price will speed up the matching speed and generate secondary sub-orders for these two price sub-intervals. At the same time, it is necessary to match the three intervals of BL1`, BR1` and BM0 based on the matching time of a certain price in the past T minutes. If it exceeds T bl1`+T bl1` / 2, orders less than the price will be cancelled. If it is less than T bl1`-T bl1` / 2, orders greater than the price will be cancelled. The specific division and pre-generation process of secondary sub-orders can be referred to the above embodiments, and the repeated parts will not be repeated here.
[0129] It should be noted that when matching orders with a total amount of 40 yuan in historical trading interval B, the total amount of matched orders in historical trading interval B will be accumulated. When the amount is greater than or equal to 20 yuan, the remaining unmatched pre-generated orders will be cancelled.
[0130] When the pre-generated order of a price sub-range successfully matches the first sub-order, the total order number is tx0001, and the sub-order number is tx0001-B1. Taking the historical trading interval B as an example, the sub-order tx0001-B1 is removed from the first-level order book B, and the matched amount sumB` of the historical trading interval B is recorded, and the sub-order is submitted to the matching sorting module. The matching sorting module will check whether the cumulative amount of the pre-generated sub-orders of the total order number tx0001 exceeds the total 60 of the original order.
[0131] The above describes the recursive generation and matching of pre-generated orders and secondary sub-orders in historical trading interval B. This is because the price is traded first in interval B. Since there is only one market price, it will only hit a single price sub-interval first. When the trading time is longer, or the price gradient d is smaller, or the price fluctuation is more intense, the market price will fall into historical trading interval A or historical trading interval C. Finally, when the matching amount of the three historical trading intervals A, B, and C reaches the total amount of the transaction to be matched, the matching is completed.
[0132] As above Figure 2 As shown, the historical trading intervals divided by A, B, and C contain historical trading orders with the same price. Historical trading intervals A and C will also perform the same pre-generated order and order matching steps as historical trading interval B. In this way, according to the existing order transaction market value trend, the pre-generated orders of multiple price sub-intervals are matched in parallel to achieve the effect of buying market orders at a better price. Accelerate the matching speed and price rationality of market orders. For example, a market buy order with a total amount of 100 will complete the matching of sub-orders in multiple price intervals of A, B, and C through a multi-level order book of pre-generated excess sub-orders, avoiding most orders being traded in high-price intervals.
[0133] Embodiment 7:
[0134] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, on the basis of the above embodiments, in the embodiment of the present application, the price sub-range of the next round of matching is determined according to the current matching time and the historical matching time of the successfully matched order, including:
[0135] If the current matching time is greater than the maximum value of the matching time interval, the order matching will continue in the first price sub-interval, where the price in the first price sub-interval is higher than the price corresponding to the successfully matched order;
[0136] If the current matching time is less than the minimum value of the matching time interval, the order matching will continue in the second price sub-interval, where the second price sub-interval is a price lower than the price corresponding to the successfully matched order.
[0137] In order to further improve the rationality of the price distribution of order matching and improve the efficiency of order matching, if the current matching time is greater than the maximum value of the matching time interval, it means that the current matched order price is lower than the market price. In order to improve the efficiency of order matching, the order matching will continue in the first price sub-interval. The first price sub-interval is a price higher than the price corresponding to the successfully matched order.
[0138] If the current matching time is less than the minimum value of the matching time interval, it means that the current matching order price is higher than the market price. In order to improve the price rationality of order matching and avoid buying a large number of high-priced orders, the order matching will continue in the second price sub-range. The second price sub-range is a price lower than the price corresponding to the successfully matched order.
[0139] Specifically, further explanation is given with reference to the examples in the above embodiments.
[0140] When the matching time of the middle price B` of the price sub-interval BM0 is greater than Tbm0+Tbm0 / 2, and the matching time is longer, the market price is greater than B`, then the pre-generated orders of BL1 and BL2 with prices less than B` will be cancelled.
[0141] When the matching time of the middle price of the price sub-interval BM0 is less than Tbm0-Tbm0 / 2, and the current middle price is higher than market expectations, the pre-generated orders of BL1 and BL2 with prices greater than B` will be cancelled. Only pruning is required, and no sliding orders are required.
[0142] In an embodiment of the present application, if the current matching time is greater than the maximum value of the matching time interval, order matching will continue with the first price sub-interval, and the first price sub-interval is a price higher than the price corresponding to the successfully matched order; if the current matching time is less than the minimum value of the matching time interval, order matching will continue with the second price sub-interval, and the second price sub-interval is a price lower than the price corresponding to the successfully matched order, thereby further improving the rationality of the price distribution of order matching and improving the efficiency of order matching.
[0143] Embodiment 8:
[0144] Based on the same technical concept, on the basis of the above embodiments, in an embodiment of the present application, an order matching device is provided. Figure 5 A schematic diagram of the structure of an order matching device provided in some embodiments of the present application. Figure 5 As shown, the device comprises:
[0145] The division module 501 is used to extract historical transaction information that has been completed before the triggered transaction to be matched based on the transaction to be matched; and divide the historical transaction information into multiple historical transaction intervals according to the transaction time;
[0146] The matching module 502 is used to determine, for each historical trading interval, multiple price sub-intervals corresponding to the historical trading interval; match the order of the transaction to be matched at any price in each price sub-interval; if there is a successfully matched order, determine the historical matching time of the price corresponding to the successfully matched order in the historical trading information; determine the price sub-interval of the next round of matching according to the current matching time of the successfully matched order and the historical matching time, until the successfully matched orders meet the transaction to be matched.
[0147] In a possible implementation, the matching module 502 is specifically configured to, if the current matching time falls within the matching duration interval corresponding to the historical matching time, re-determine multiple price sub-intervals based on the price sub-interval in which the successfully matched order is located and continue order matching; wherein the prices between the re-determined price sub-intervals are closer.
[0148] In a possible implementation, the matching module 502 is specifically used to continue order matching with a first price sub-range if the current matching time is greater than the maximum value of the matching time interval, and the first price sub-range is a price higher than the price corresponding to the successfully matched order; if the current matching time is less than the minimum value of the matching time interval, continue order matching with a second price sub-range, and the second price sub-range is a price lower than the price corresponding to the successfully matched order.
[0149] In a possible implementation, the division module 501 is specifically used to determine a first number of historical transaction intervals based on the total number of transactions in the historical transaction information; determine a sub-value of each historical transaction interval based on the total transaction value of the historical transaction information and the first number; divide the first historical transaction interval located before and after the transaction time and with a cumulative amount of the sub-value based on the transaction time of the highest transaction price in the historical transaction information; determine a second historical transaction interval located before the transaction time of the first transaction and after the transaction time of the last transaction and with a cumulative amount of the sub-value based on the first transaction and the last transaction included in the first historical transaction interval; until the first number of historical transaction intervals are divided.
[0150] In a possible implementation, the matching module 502 is specifically configured to determine a reference price and a price difference gradient of the historical trading interval; and determine a plurality of price sub-intervals corresponding to the historical trading interval according to the price difference gradient and the reference price.
[0151] In a possible implementation, the matching module 502 is specifically used to determine the reference price based on the first price of the first transaction in the historical trading interval, the second price of the last transaction and the highest price or the lowest price in the historical trading interval; determine the total price drop gradient based on the difference between the first price and the second price and the highest price or the lowest price in the historical trading interval respectively; determine the second number of price sub-intervals based on the total number of transactions in the historical trading interval; determine the price drop gradient based on the total price drop gradient and the second number.
[0152] In a possible implementation, the matching module 502 determines a pre-generated order based on the transaction to be matched, and the total amount of the pre-generated order is higher than the total amount of the transaction to be matched; the total amount of the pre-generated order is evenly divided into sub-amounts that need to be matched successfully in each historical trading interval; for each historical trading interval, the number of orders to be matched in each price sub-range is determined based on the reference price of the historical trading interval and the sub-amount; and the order is matched according to the median price of each price sub-range and the number of orders to be matched.
[0153] In an embodiment of the present application, based on the triggered transaction to be matched, historical transaction information that has been completed before the transaction to be matched is extracted, and the historical transaction information is divided into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, multiple price sub-intervals corresponding to the historical transaction interval are determined, and the order of the transaction to be matched is matched in parallel at any price in each price sub-interval, so as to ensure the rationality of price distribution and order matching efficiency; if there is a successfully matched order, the historical matching time of the price corresponding to the order in the historical transaction information is determined, and the rationality of the current price is judged according to the current matching time and the historical matching time, so as to determine the price sub-interval for the next round of matching, until the successfully matched orders meet the transaction to be matched, thereby further improving the efficiency of order matching and the rationality of price.
[0154] Embodiment 9:
[0155] Based on the same inventive concept, on the basis of the above embodiments, in an embodiment of the present application, an electronic device is provided, which can realize the functions of the order matching device mentioned above. Figure 6 A schematic diagram of the structure of an electronic device provided in some embodiments of the present application. Figure 6 As shown, the electronic device includes: a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604;
[0156] The memory 603 stores a computer program. When the program is executed by the processor 601, the processor 601 executes the steps included in any of the order matching methods described in the above embodiments.
[0157] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0158] The communication interface 602 is used for communication between the above electronic device and other devices.
[0159] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0160] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0161] In an embodiment of the present application, based on the triggered transaction to be matched, historical transaction information that has been completed before the transaction to be matched is extracted, and the historical transaction information is divided into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, multiple price sub-intervals corresponding to the historical transaction interval are determined, and the order of the transaction to be matched is matched in parallel at any price in each price sub-interval, so as to ensure the rationality of price distribution and order matching efficiency; if there is a successfully matched order, the historical matching time of the price corresponding to the order in the historical transaction information is determined, and the rationality of the current price is judged according to the current matching time and the historical matching time, so as to determine the price sub-interval for the next round of matching, until the successfully matched orders meet the transaction to be matched, thereby further improving the efficiency of order matching and the rationality of price.
[0162] Embodiment 10:
[0163] Based on the same inventive concept, on the basis of the above embodiments, in an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the steps included in the order matching method as described in any of the above embodiments.
[0164] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.
[0165] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes the steps of any of the order matching methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the above order matching method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0166] In an embodiment of the present application, based on the triggered transaction to be matched, historical transaction information that has been completed before the transaction to be matched is extracted, and the historical transaction information is divided into multiple historical transaction intervals according to the transaction time; for each historical transaction interval, multiple price sub-intervals corresponding to the historical transaction interval are determined, and the order of the transaction to be matched is matched in parallel at any price in each price sub-interval, so as to ensure the rationality of price distribution and order matching efficiency; if there is a successfully matched order, the historical matching time of the price corresponding to the order in the historical transaction information is determined, and the rationality of the current price is judged according to the current matching time and the historical matching time, so as to determine the price sub-interval for the next round of matching, until the successfully matched orders meet the transaction to be matched, thereby further improving the efficiency of order matching and the rationality of price.
[0167] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0168] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0171] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An order matching method, characterized in that: The method comprises: Based on the triggered transaction to be matched, extract the historical transaction information that has been completed before the transaction to be matched; divide the historical transaction information into multiple historical transaction intervals according to the transaction time; For each historical trading interval, multiple price sub-intervals corresponding to the historical trading interval are determined; the order of the transaction to be matched is matched at any price in each price sub-interval; if there is a successfully matched order, the historical matching time of the price corresponding to the successfully matched order in the historical trading information is determined; according to the current matching time of the successfully matched order and the historical matching time, the price sub-interval of the next round of matching is determined, until the successfully matched orders meet the transaction to be matched.
2. The method according to claim 1, characterized in that Determining the price sub-range for the next round of matching according to the current matching time of the successfully matched order and the historical matching time includes: If the current matching time falls within the matching duration interval corresponding to the historical matching time, then based on the price sub-interval where the successfully matched order is located, multiple price sub-intervals are re-determined and order matching is continued; wherein the prices between the re-determined price sub-intervals are closer.
3. The method according to claim 1, characterized in that Determining the price sub-range for the next round of matching according to the current matching time of the successfully matched order and the historical matching time includes: If the current matching time is greater than the maximum value of the matching time interval, the order matching will continue in the first price sub-interval, where the price in the first price sub-interval is higher than the price corresponding to the successfully matched order; If the current matching time is less than the minimum value of the matching time interval, the order matching will continue in the second price sub-interval, where the second price sub-interval is a price lower than the price corresponding to the successfully matched order.
4. The method according to any one of claims 1 to 3, characterized in that: The dividing the historical transaction information into a plurality of historical transaction intervals according to the transaction time includes: Determine a first quantity of a historical transaction interval according to the total transaction quantity of the historical transaction information; determine a sub-value of each historical transaction interval according to the total transaction value of the historical transaction information and the first quantity; Based on the transaction time of the highest transaction price in the historical transaction information, a first historical transaction interval located before and after the transaction time and having a cumulative amount equal to the sub-value is divided; Determine, according to the first transaction and the last transaction included in the first historical transaction interval, a second historical transaction interval that is located before the transaction time of the first transaction and after the transaction time of the last transaction and has a cumulative amount equal to the sub-value; Until the first number of historical trading intervals are divided.
5. The method according to any one of claims 1 to 3, characterized in that: The determining of the multiple price sub-ranges corresponding to the historical trading range includes: Determine the reference price and price gradient of the historical trading range; According to the price drop gradient and the reference price, a plurality of price sub-ranges corresponding to the historical trading range are determined.
6. The method according to claim 5, characterized in that The determining of the reference price and price difference gradient of the historical trading range includes: Determining the reference price according to the first price of the first transaction in the historical transaction interval, the second price of the last transaction and the highest price or the lowest price in the historical transaction interval; Determine a total price drop gradient according to the difference between the first price and the second price and the highest price or the lowest price in the historical trading range respectively; Determining a second number of price subranges based on the total number of transactions in the historical trading range; A price drop gradient is determined according to the total price drop gradient and the second quantity.
7. The method according to any one of claims 1 to 3, characterized in that: The order matching of the transaction to be matched at any price in each price sub-range includes: Determine a pre-generated order based on the transaction to be matched, where the total amount of the pre-generated order is higher than the total amount of the transaction to be matched; The total amount of the pre-generated order is divided into sub-amounts that need to be successfully matched in each historical trading interval; For each historical trading range, the number of orders to be matched in each price sub-range is determined based on the reference price of the historical trading range and the sub-amount; Orders are matched according to the median price of each price sub-range and the number of orders to be matched.
8. An order matching device, characterized in that: The device comprises: A division module is used to extract historical transaction information that has been completed before the triggered transaction to be matched based on the transaction to be matched; and divide the historical transaction information into multiple historical transaction intervals according to the transaction time; The matching module is used to determine, for each historical trading interval, a plurality of price sub-intervals corresponding to the historical trading interval; match orders for the to-be-matched transaction at any price in each price sub-interval; if there is a successfully matched order, determine the historical matching time of the price corresponding to the successfully matched order in the historical trading information; determine the price sub-interval for the next round of matching according to the current matching time of the successfully matched order and the historical matching time, until the successfully matched orders meet the to-be-matched transaction.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.