WO2022001131A1 - Method and apparatus for reconstructing market quotations based on quote-by-quote data, and device - Google Patents

Method and apparatus for reconstructing market quotations based on quote-by-quote data, and device Download PDF

Info

Publication number
WO2022001131A1
WO2022001131A1 PCT/CN2021/076925 CN2021076925W WO2022001131A1 WO 2022001131 A1 WO2022001131 A1 WO 2022001131A1 CN 2021076925 W CN2021076925 W CN 2021076925W WO 2022001131 A1 WO2022001131 A1 WO 2022001131A1
Authority
WO
WIPO (PCT)
Prior art keywords
order
data
transaction
gear
market
Prior art date
Application number
PCT/CN2021/076925
Other languages
French (fr)
Chinese (zh)
Inventor
陈尧
厉剑
郝锐
郭雷
阚宏伟
Original Assignee
浪潮电子信息产业股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浪潮电子信息产业股份有限公司 filed Critical 浪潮电子信息产业股份有限公司
Publication of WO2022001131A1 publication Critical patent/WO2022001131A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method, apparatus, device, and readable storage medium for reconstructing market conditions based on transaction-by-transaction data.
  • Level-2 quotations (a fee-based quotation service provided by Shanghai and Shenzhen Stock Exchanges) including ten grades of quotations and transaction-by-transaction data have been successively launched.
  • Level-2 transaction-by-transaction data of the Shenzhen Stock Exchange includes transaction-by-transaction and transaction-by-transaction, which enables the recipient of the Shenzhen Stock Exchange's Level-2 quotation to reconstruct the market quotation by itself using the transaction-by-transaction data and transaction rules to match the transaction.
  • the self-reconstructed market market can maintain all the levels consistent with the exchange's matching machine at any time. This market situation can enable users to have a more in-depth and detailed understanding of the entire market. understanding.
  • tick-by-tick data The core idea of self-reconstructing market conditions based on tick-by-tick data is to maintain the volume-price relationship of the market by itself. In the current situation of more than 10,000 securities in the Shenzhen Stock Exchange, receiving the rapidly generated transaction-by-transaction data and maintaining the volume-price relationship of the order book by itself requires extremely high performance for saving the data structure of the order book and order and updating the algorithm. . When the market is very active, underperforming methods and programs can collapse under the onslaught of tick-by-tick data.
  • the data structures used to save the market include linked lists, balanced trees, hash tables, and so on.
  • the purpose of this application is to provide a method, device, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data, so as to solve the need to frequently perform multiple types of For data operations, a single data structure cannot meet the current performance requirements. Its specific plan is as follows:
  • the present application provides a method for reconstructing market conditions based on transaction-by-transaction data, including:
  • a market jump table and an order hash table are generated, wherein the market jump table includes a plurality of tiers divided according to the order price, the tiers include the order price and the order quantity, and the order hash table Including a plurality of order data items, the key of the order data item is the order number of the order, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
  • the transaction-by-transaction data is transaction-by-transaction data
  • generating a market jump table and an order hash table including:
  • a market jump table, an order hash table and a gear hash table are generated, wherein the gear hash table includes a plurality of gear data items, the key of the gear data item is the commission price, and the The value of the above gear data item is the handicap gear pointer;
  • updating the handicap jump table according to the transaction-by-transmission commission data includes:
  • the corresponding target gear data item in the gear hash table is determined according to the entrusted price in the transaction-by-transmission data; according to the disk of the target gear data item
  • the handicap gear pointer is used to determine the corresponding target gear in the handicap jump table, and update the commission quantity of the target gear.
  • determining the corresponding target gear data item in the gear hash table according to the entrusted price in the one-by-one entrustment data includes:
  • the method further includes:
  • the target order data item is deleted.
  • the method further includes:
  • the updated handicap jump table is traversed in the order of the entrusted prices to generate the market data of the target securities, including:
  • the updated handicap jump table is traversed in the order of the order price, and a preset number of stalls are selected as the market data of the target securities.
  • the handicap jump table includes a buy handicap jump table and a sell handicap jump table, and the updated handicap jump table is traversed in the order of the order price to generate the market data of the target securities ,include:
  • the present application provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
  • Data structure generation module used to generate a handicap jump table and an order hash table for the target securities, wherein the handicap jump table includes multiple tiers divided according to the entrusted price, and the tiers include the entrusted price and the order quantity , the order hash table includes a plurality of order data items, the key of the order data item is the entrusted order number, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
  • One-by-one data receiving module used to receive one-by-one data
  • the first data update module when the transaction-by-transaction data is the transaction-by-transmission commission data, update the handicap jump table according to the transaction-by-transmission commission data, and add and the transaction-by-transaction data in the order hash table.
  • the order data item corresponding to the order number of the order data of the order data;
  • the second data update module when the transaction-by-transaction data is transaction-by-transaction data, according to the order number in the transaction-by-transaction data, determine the corresponding target order data item in the order hash table; update The unsettled quantity in the target order data item; determine the corresponding target gear in the handicap jump table according to the handicap gear pointer of the target order data item, and update the order quantity in the target gear;
  • Market quotation generation module used to traverse the updated handicap jump table in the order of the order price, and generate the market quotation data of the target securities.
  • the present application provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
  • Memory used to store computer programs
  • Processor for executing the computer program to implement the steps of the method for reconstructing market conditions based on tick-by-tick data as described above.
  • the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the computer program is used to realize the above-mentioned market reconstruction based on tick-by-tick data Quotes method steps.
  • a method for reconstructing market conditions based on transaction-by-transaction data includes: for a target security, generating a market jump table and an order hash table, wherein the market jump table includes a plurality of gears divided according to the entrusted price , each level includes the order price and order quantity, the order hash table includes multiple order data items, the key of the order data item is the order number of the order, and the value of the order data item includes the unfilled quantity and the handicap gear pointer; receive Tick-by-tick data; when the tick-by-tick data is the order-by-order data, update the market jump table according to the order-by-order data, and add the order data item corresponding to the order number of the order-by-order data in the order hash table; When the transaction data is transaction data, determine the corresponding target order data item in the order hash table according to the order number in the transaction data; update the unexecuted quantity in the target order data item; according to the target order data item The handicap gear pointer determines
  • this method uses the skip table to save the volume-price relationship of the market, uses the linear structure of the first layer of the skip table to improve the performance of market output, and uses the order hash table to speed up the speed of positioning and deducting gears after receiving each transaction. Therefore, the performance of reconstructing market quotations based on transaction-by-transaction data can be improved, and the delay in receiving quotations by the back-end trading system can be reduced.
  • the present application also provides an apparatus, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data.
  • Fig. 1 is a realization flow chart of Embodiment 1 of a method for reconstructing market conditions based on transaction-by-transaction data provided by this application;
  • Fig. 2 is the schematic diagram of skip table result provided by this application.
  • Fig. 3 is a realization flow chart of Embodiment 2 of a method for reconstructing market conditions based on transaction-by-transaction data provided by the present application;
  • Fig. 4 is the realization flow chart of a kind of method application embodiment based on data reconstruction of market conditions provided by this application;
  • FIG. 5 is a functional block diagram of an embodiment of an apparatus for reconstructing market conditions based on transaction-by-transaction data provided by the present application.
  • the present application provides a method, device, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data, generating a market jump table to save the market data, and generating an order hash table to facilitate order update, It supports rapid addition, deletion, modification, and checking of market and order data. Based on the above data structure, it realizes rapid reconstruction of market conditions.
  • the first embodiment includes:
  • the handicap jump table includes a plurality of gears divided according to the order price
  • the gears include the order price and the order quantity
  • the order hash table includes a plurality of order data items.
  • this embodiment uses an order hash table, the key of the order hash table is the order number, and the value includes the unsettled quantity and the skip table node pointer of the corresponding gear.
  • the corresponding stall is searched from the market jump table according to the order price in the order-by-order data, and the order quantity of the stall is updated according to the quantity in the order-by-order data.
  • This method of using the handicap jump table to query the corresponding gear has a time complexity of logarithmic time.
  • an order data item corresponding to the order number of the order-by-order order data needs to be added to the order hash table.
  • transaction-by-transaction data is transaction-by-transaction data
  • the unfilled quantity determine the corresponding target gear in the market skip table according to the market gear pointer of the target order data item, and update the order quantity in the target gear;
  • the buyer's market consists of multiple gears with prices ranging from high to the bottom, and the seller's market consists of multiple gears with prices ranging from low to high.
  • Each gear is the commission price and the corresponding number of orders.
  • the unexecuted quantity of the corresponding order data item and the order quantity of the stall are updated according to the order number and transaction quantity of the buyer or seller; for the order cancellation data in the transaction message , it will be updated accordingly according to the order number and order cancellation quantity of the buyer or seller.
  • This embodiment provides a method for reconstructing market conditions based on transaction-by-transaction data, using a skip table to save the market, as shown in Figure 2, the skip table is a probabilistic multi-level indexed linked list, which can maintain the On the basis of the linear structure, adding multiple levels of indexes improves the query efficiency, so the efficiency of skipping table query, adding, and deleting is equivalent to a balanced tree in probability, and adding and deleting operations do not need to maintain subtree balance.
  • the first layer of the skip table is a linear structure, it is more suitable for the traversal operation when sending market quotations than the balanced tree, and can achieve logarithmic time complexity.
  • this method uses the skip table to save the volume-price relationship of the market, uses the linear structure of the first layer of the skip table to improve the performance of market output, and uses the order hash table to speed up the speed of positioning and deducting gears after receiving each transaction. Therefore, the performance of reconstructing market quotations based on transaction-by-transaction data can be improved, and the delay in receiving quotations by the back-end trading system can be reduced.
  • the embodiment has described the process of updating the market according to the order-by-order data and the transaction data, wherein the time complexity of the process of searching for the corresponding gear position in the market jump table according to the order-by-order data is logarithmic time.
  • the embodiment further optimizes the process to reduce query time. Specifically, in this embodiment, a gear hash table is set, and the corresponding relationship between the commission price and the handicap node pointer is stored in the gear hash table, thereby reducing the query time from logarithmic time to unit time.
  • the second embodiment specifically includes:
  • the handicap jump table includes a plurality of gears divided according to the order price, and the gears include the order price and the order quantity;
  • the order hash table includes a plurality of order data items, and the keys of the order data items are: The order number of the order, the value of the order data item includes the untraded quantity and the handicap gear pointer;
  • the gear hash table includes a plurality of gear data items, the key of the gear data item is the commission price, and the The value of the above gear data item is the market gear pointer.
  • this embodiment uses a gear hash table to store the commission price and the skip table node pointer corresponding to the gear, and reduces the query time from the logarithmic time complexity of the skip table to the completion in unit time.
  • the corresponding gear data item After receiving the entrusted data one by one, the corresponding gear data item is searched according to the entrusted price. If there is a corresponding gear data item, the corresponding gear is determined according to the handicap gear pointer of the gear data item. Update the number of orders on the order, and add the order data item corresponding to the order number of the order-by-order data in the order hash table; if there is no corresponding gear data item, you need to add a gear data item, and add a gear to record the order price and quantity, and also need to add an order data item to record the order number, unfilled quantity and the corresponding gear.
  • the back-end trading system When sending quotations, if the back-end trading system cannot process the continuously outputted market quotations containing all the gears, it can output only a preset number of gears each time, for example, output the same ten gears as the Level-2 market snapshot, You can also add a timer to output market conditions at regular intervals, or use a combination of the above two methods.
  • S306 specifically includes: according to a preset period, traversing the updated handicap jump table in the order of the order price, and selecting a preset number of stalls as the target securities market data.
  • a method for reconstructing market conditions based on transaction-by-transaction data utilizes a data structure in which a skip table and two hash tables cooperate with each other to jointly complete the process of reconstructing market conditions based on transaction-by-transaction data.
  • the skip table is used to save the market
  • the linear structure of the first layer of the skip table is used to improve the performance of market output
  • the logarithmic time complexity that is consistent with the balance tree is achieved in probability when adding and deleting operations are required
  • Use the gear hash table to speed up the speed of locating the existing gear after receiving one-by-one orders
  • use the order hash table to speed up the speed of positioning the deducted gear after receiving the one-by-one transaction. Therefore, this embodiment can improve the market quotation reconstruction performance and reduce the delay in receiving quotations by the back-end trading system.
  • the data structure used to reconstruct the market quotation of a single security is shown in Table 1, including the two-way trading table, gear hash table, and order hash table. Each node of the handicap table is used to store The price and quantity of a stall.
  • the top layer uses a security hash table to store the correspondence between security codes and six data structure instances.
  • the first step is to create a corresponding data structure for all securities traded on that day according to the securities information file before the market opening, and write the securities code and corresponding data structure into the securities hash table.
  • the second step is to receive the data one by one, and use the security hash table to query the corresponding data structure according to the security code.
  • the third step is to judge the data type of each transaction. If it is a transaction-by-transmission message and is not a market order, use the order price as the key value to find the gear hash table. If there is a corresponding gear, the order quantity will be accumulated to the order quantity of the skip table node of the corresponding gear; if there is no corresponding gear, a new skip table node will be created to record the price and quantity of the order, and the skip table node will be inserted into the skip table node. At the same time, the record of the price and the jump table node pointer of the corresponding gear is added to the gear hash table. Finally, record the order number and the skip table node pointer of the corresponding gear in the order hash table.
  • the fourth step if it is a transaction message one by one, when the transaction type is transaction, use the buy and sell order numbers as the key to query the order hash table, and the buy and sell orders are deducted from the transaction quantity, and then based on the order.
  • the value of the table is searched for the corresponding gear, and the transaction quantity is deducted from the corresponding gear.
  • the transaction type is cancel order
  • use the buy order number or sell order number as the key to query the order hash table, deduct the transaction quantity for the buy or sell order, and then find the corresponding gear according to the value of the order hash table,
  • the transaction quantity is deducted from the corresponding gear.
  • the quantity of the corresponding order or stall is zero after deduction, the corresponding order and stall are deleted.
  • the fifth step is to judge whether the price of buying one tranche is lower than the selling price of one tranche, if so, send the quotation, if not, wait for further transaction messages.
  • the sixth step go back to the second step, until the end of the all-day trading time.
  • the following describes an apparatus for reconstructing market conditions based on transaction-by-transaction data provided by the embodiments of the present application.
  • the methods of market conditions can refer to each other.
  • the device for reconstructing market conditions based on transaction-by-transaction data in this embodiment includes:
  • Data structure generation module 501 used to generate a market jump table and an order hash table for the target securities, wherein the market jump table includes a plurality of tiers divided according to the order price, and the notch includes the order price and the order price Quantity, the order hash table includes a plurality of order data items, the key of the order data item is the order number, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
  • Pen-by-transaction data receiving module 502 used for receiving pen-by-transaction data
  • the first data update module 503 is configured to update the handicap jump table according to the transaction-by-transmission data when the transaction-by-transaction data is the transaction-by-transmission data, and add the same value as the transaction-by-transaction data in the order hash table.
  • the order data item corresponding to the order order number of the order data;
  • the second data updating module 504 is used for determining the corresponding target order data item in the order hash table according to the order number in the transaction data when the transaction data is transaction transaction data; Update the unsettled quantity in the target order data item; determine the corresponding target gear in the handicap jump table according to the market gear pointer of the target order data item, and update the order quantity in the target gear;
  • Market quotation generation module 505 used for traversing the updated handicap jump table according to the order of the order price, and generating the market quotation data of the target securities.
  • the apparatus for reconstructing market quotations based on transaction-by-transaction data in this embodiment is used to implement the aforementioned method for reconstructing market quotations based on transaction-by-transaction data. Therefore, the specific implementation of the device can be found in the previous section Reconstructing market quotations based on transaction-by-transaction data.
  • the embodiment part of the method for example, the data structure generation module 501, the transaction-by-transaction data receiving module 502, the first data update module 503, the second data update module 504, and the market quotation generation module 505 are respectively used to realize the above-mentioned transaction-by-transaction based data. Steps S101, S102, S103, S104, S105 in the method for data reconstruction of market conditions. Therefore, reference may be made to the descriptions of the corresponding partial embodiments for specific implementations thereof, which will not be described herein again.
  • the apparatus for reconstructing market quotations based on transaction-by-transaction data in this embodiment is used to implement the aforementioned method for reconstructing market quotations based on transaction-by-transaction data, its function corresponds to that of the above method, and will not be repeated here.
  • the present application also provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
  • Memory used to store computer programs
  • Processor for executing the computer program to implement the steps of the method for reconstructing market conditions based on tick-by-tick data as described above.
  • the present application provides a readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, is used to realize the above-mentioned reconstruction of market conditions based on tick-by-tick data steps of the method.
  • a software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
  • RAM random access memory
  • ROM read only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

A method and apparatus for reconstructing market quotations based on quote-by-quote data, a device and a readable storage medium can generate a quotation skip list and an order hash table, wherein the quotation skip list comprises multiple ticks divided by order price, each tick comprising an order price and an order quantity, and the order hash table comprises multiple order data items, the order data items comprising unfilled quantity, quotation tick pointer and order number as a key. The present application uses a skip list to store the price-volume relationships of quotations, uses a linear structure of the first layer of the skip list to improve the performance of market quotation output, and uses the order hash table to accelerate tick deduction after quote-by-quote matching. Thus, the performance of reconstructing market quotations based on quote-by-quote data is improved, and delay of a back-end trading system in receiving quotations is reduced.

Description

一种基于逐笔数据重构市场行情的方法、装置及设备A method, device and equipment for reconstructing market conditions based on transaction-by-transaction data
本申请要求于2020年06月29日提交至中国专利局、申请号为202010609099.0、发明名称为“一种基于逐笔数据重构市场行情的方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on June 29, 2020, the application number is 202010609099.0, and the invention name is "a method, device and equipment for reconstructing market conditions based on transaction-by-transaction data", The entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及计算机技术领域,特别涉及一种基于逐笔数据重构市场行情的方法、装置、设备及可读存储介质。The present application relates to the field of computer technology, and in particular, to a method, apparatus, device, and readable storage medium for reconstructing market conditions based on transaction-by-transaction data.
背景技术Background technique
近年来,随着我国证券市场的快速发展,相关的交易技术也突飞猛进。为了更好的服务市场,上海证券交易所和深圳证券交易所都对交易系统进行了大幅度的升级改造。在行情发布方面,相继推出了包含十档行情和逐笔数据的Level-2行情(沪深交易所提供的收费行情服务)。目前深圳证券交易所的Level-2逐笔数据包含逐笔委托和逐笔成交,这就使得深圳证券交易所Level-2行情的接收方可以利用逐笔数据和交易规则自行重构市场行情,与交易所每三秒发布一次的十档快照行情相比,自行重构的市场行情可以随时保持与交易所撮合机一致的全部档位,这种行情可以使其用户对整个市场有更加深入和细致的了解。In recent years, with the rapid development of my country's securities market, related trading technologies have also advanced by leaps and bounds. In order to better serve the market, both the Shanghai Stock Exchange and the Shenzhen Stock Exchange have significantly upgraded their trading systems. In terms of market information release, Level-2 quotations (a fee-based quotation service provided by Shanghai and Shenzhen Stock Exchanges) including ten grades of quotations and transaction-by-transaction data have been successively launched. At present, the level-2 transaction-by-transaction data of the Shenzhen Stock Exchange includes transaction-by-transaction and transaction-by-transaction, which enables the recipient of the Shenzhen Stock Exchange's Level-2 quotation to reconstruct the market quotation by itself using the transaction-by-transaction data and transaction rules to match the transaction. Compared with the ten-speed snapshot market that is released every three seconds by the exchange, the self-reconstructed market market can maintain all the levels consistent with the exchange's matching machine at any time. This market situation can enable users to have a more in-depth and detailed understanding of the entire market. understanding.
基于逐笔数据自行重构市场行情的核心思路是自行维护盘口的量价关系。在当前深圳证券交易所存在一万余只证券的情况下,接收快速产生的逐笔数据并自行维护盘口的量价关系,对于保存盘口和订单的数据结构以及更新算法的性能要求极高。在市场交易非常活跃时,性能不足的方法和程序会在大量的逐笔数据的冲击下崩溃。The core idea of self-reconstructing market conditions based on tick-by-tick data is to maintain the volume-price relationship of the market by itself. In the current situation of more than 10,000 securities in the Shenzhen Stock Exchange, receiving the rapidly generated transaction-by-transaction data and maintaining the volume-price relationship of the order book by itself requires extremely high performance for saving the data structure of the order book and order and updating the algorithm. . When the market is very active, underperforming methods and programs can collapse under the onslaught of tick-by-tick data.
在维护盘口的量价关系的过程中,需要在保存盘口的数据结构上频繁执行大量的增加、删除、修改、查询、遍历操作,但多数数据结构都只能优化上述操作中的某些方面。在常用的撮合引擎的开源实现中,用于保存盘口的数据结构包括链表、平衡树、哈希表等。如果使用链表来保存盘口, 有利于增加、删除、遍历,不利于查询;如果使用平衡树来保存盘口,有利于查询,不利于增加、删除、遍历;如果使用哈希表来保存盘口,有利于查询、增加、删除,但是在生成行情时无法直接以价格优先的顺序遍历盘口。In the process of maintaining the volume-price relationship of the market, it is necessary to frequently perform a large number of addition, deletion, modification, query, and traversal operations on the data structure that saves the market, but most data structures can only optimize some of the above operations. aspect. In the open source implementation of common matching engines, the data structures used to save the market include linked lists, balanced trees, hash tables, and so on. If you use a linked list to save the market, it is good for adding, deleting, traversing, but not good for query; if you use a balanced tree to save the market, it is good for querying, but not conducive to adding, deleting, and traversing; if you use a hash table to save the market , which is beneficial to query, add, and delete, but cannot directly traverse the market in the order of price priority when generating quotations.
可见,在基于逐笔数据重构市场行情的过程中,需要频繁进行多种类型的数据操作,单一的数据结构无法满足当前的性能需求。It can be seen that in the process of reconstructing market conditions based on data one by one, multiple types of data operations need to be performed frequently, and a single data structure cannot meet the current performance requirements.
发明内容SUMMARY OF THE INVENTION
本申请的目的是提供一种基于逐笔数据重构市场行情的方法、装置、设备及可读存储介质,用以解决在基于逐笔数据重构市场行情的过程中,需要频繁进行多种类型的数据操作,单一的数据结构无法满足当前的性能需求的问题。其具体方案如下:The purpose of this application is to provide a method, device, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data, so as to solve the need to frequently perform multiple types of For data operations, a single data structure cannot meet the current performance requirements. Its specific plan is as follows:
第一方面,本申请提供了一种基于逐笔数据重构市场行情的方法,包括:In a first aspect, the present application provides a method for reconstructing market conditions based on transaction-by-transaction data, including:
针对目标证券,生成盘口跳表和订单哈希表,其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;For the target securities, a market jump table and an order hash table are generated, wherein the market jump table includes a plurality of tiers divided according to the order price, the tiers include the order price and the order quantity, and the order hash table Including a plurality of order data items, the key of the order data item is the order number of the order, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
接收逐笔数据;receive tick-by-tick data;
在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;When the trade-by-trade data is trade-by-trade order data, update the market jump table according to the trade-by trade-off data, and add the order number corresponding to the trade-by-trade entrustment data in the order hash table 's order data item;
在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;When the transaction-by-transaction data is transaction-by-transaction data, determine the corresponding target order data item in the order hash table according to the order number in the transaction-by-transaction data; update the unexecuted order data item in the target order data item Quantity; according to the handicap gear pointer of the target order data item, determine the corresponding target gear in the handicap jump table, and update the order quantity in the target gear;
按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。Traverse the updated handicap jump table according to the order of the order price, and generate the market data of the target security.
优选的,所述针对目标证券,生成盘口跳表和订单哈希表,包括:Preferably, for the target securities, generating a market jump table and an order hash table, including:
针对目标证券,生成盘口跳表、订单哈希表和档位哈希表,其中所述档位哈希表包括多个档位数据项,所述档位数据项的键为委托价格,所述档位数据项的值为盘口档位指针;For the target securities, a market jump table, an order hash table and a gear hash table are generated, wherein the gear hash table includes a plurality of gear data items, the key of the gear data item is the commission price, and the The value of the above gear data item is the handicap gear pointer;
相应的,所述在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,包括:Correspondingly, when the transaction-by-transaction data is the transaction-by-transmission commission data, updating the handicap jump table according to the transaction-by-transmission commission data includes:
在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据中的委托价格,确定所述档位哈希表中相应的目标档位数据项;根据目标档位数据项的盘口档位指针,确定所述盘口跳表中相应的目标档位,更新目标档位的委托数量。When the transaction-by-transaction data is the transaction-by-transmission entrustment data, the corresponding target gear data item in the gear hash table is determined according to the entrusted price in the transaction-by-transmission data; according to the disk of the target gear data item The handicap gear pointer is used to determine the corresponding target gear in the handicap jump table, and update the commission quantity of the target gear.
优选的,所述根据所述逐笔委托数据中的委托价格,确定所述档位哈希表中相应的目标档位数据项,包括:Preferably, determining the corresponding target gear data item in the gear hash table according to the entrusted price in the one-by-one entrustment data includes:
判断所述档位哈希表中是否存在所述逐笔委托数据的委托价格;Judging whether there is the commission price of the one-by-one commission data in the gear hash table;
若存在,确定与所述逐笔委托数据的委托价格相对应的目标档位数据项;If there is, determine the target gear data item corresponding to the order price of the order-by-order order data;
若不存在,则在所述盘口跳表增加与所述逐笔委托数据的委托价格相对应的档位,在所述档位哈希表增加与所述逐笔委托数据的委托价格相对应的档位数据项。If it does not exist, add a gear corresponding to the order price of the one-by-one order data in the handicap jump table, and add a gear corresponding to the order price of the one-by-one order data in the gear hash table the gear data item.
优选的,在所述更新目标订单数据项中的未成交数量之后,还包括:Preferably, after updating the unfilled quantity in the target order data item, the method further includes:
若更新后的未成交数量为0,则删除所述目标订单数据项。If the updated unexecuted quantity is 0, the target order data item is deleted.
优选的,在所述根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量之后,还包括:Preferably, after determining the corresponding target gear in the handicap jump table according to the market gear pointer of the target order data item, and updating the order quantity in the target gear, the method further includes:
若更新后的委托数量为0,则删除所述目标档位。If the updated order quantity is 0, the target gear is deleted.
优选的,所述按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据,包括:Preferably, the updated handicap jump table is traversed in the order of the entrusted prices to generate the market data of the target securities, including:
按照预设周期,以委托价格的大小顺序遍历更新后的盘口跳表,选取预设数量的档位,以作为所述目标证券的市场行情数据。According to a preset period, the updated handicap jump table is traversed in the order of the order price, and a preset number of stalls are selected as the market data of the target securities.
优选的,所述盘口跳表包括买入盘口跳表和卖出盘口跳表,所述按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据,包括:Preferably, the handicap jump table includes a buy handicap jump table and a sell handicap jump table, and the updated handicap jump table is traversed in the order of the order price to generate the market data of the target securities ,include:
判断买入盘口跳表的委托价格是否低于卖出盘口跳表的委托价格;Determine whether the order price of the buy order jumping table is lower than the order price of the selling order jumping table;
若是,按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。If so, traverse the updated handicap jump table in the order of the order price to generate the market data of the target security.
第二方面,本申请提供了一种基于逐笔数据重构市场行情的装置,包括:In a second aspect, the present application provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
数据结构生成模块:用于针对目标证券,生成盘口跳表和订单哈希表,其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;Data structure generation module: used to generate a handicap jump table and an order hash table for the target securities, wherein the handicap jump table includes multiple tiers divided according to the entrusted price, and the tiers include the entrusted price and the order quantity , the order hash table includes a plurality of order data items, the key of the order data item is the entrusted order number, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
逐笔数据接收模块:用于接收逐笔数据;One-by-one data receiving module: used to receive one-by-one data;
第一数据更新模块:用于在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;The first data update module: when the transaction-by-transaction data is the transaction-by-transmission commission data, update the handicap jump table according to the transaction-by-transmission commission data, and add and the transaction-by-transaction data in the order hash table. The order data item corresponding to the order number of the order data of the order data;
第二数据更新模块:用于在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;The second data update module: when the transaction-by-transaction data is transaction-by-transaction data, according to the order number in the transaction-by-transaction data, determine the corresponding target order data item in the order hash table; update The unsettled quantity in the target order data item; determine the corresponding target gear in the handicap jump table according to the handicap gear pointer of the target order data item, and update the order quantity in the target gear;
市场行情生成模块:用于按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。Market quotation generation module: used to traverse the updated handicap jump table in the order of the order price, and generate the market quotation data of the target securities.
第三方面,本申请提供了一种基于逐笔数据重构市场行情的设备,包括:In a third aspect, the present application provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
存储器:用于存储计算机程序;Memory: used to store computer programs;
处理器:用于执行所述计算机程序,以实现如上所述的基于逐笔数据重构市场行情的方法的步骤。Processor: for executing the computer program to implement the steps of the method for reconstructing market conditions based on tick-by-tick data as described above.
第四方面,本申请提供了一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时用于实现如上所述的基于逐笔数据重构市场行情的方法的步骤。In a fourth aspect, the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the computer program is used to realize the above-mentioned market reconstruction based on tick-by-tick data Quotes method steps.
本申请所提供的一种基于逐笔数据重构市场行情的方法,包括:针对 目标证券,生成盘口跳表和订单哈希表,其中盘口跳表包括按照委托价格划分的多个档位,每个档位包括委托价格和委托数量,订单哈希表包括多个订单数据项,订单数据项的键为委托订单号,订单数据项的值包括未成交数量和盘口档位指针;接收逐笔数据;在逐笔数据为逐笔委托数据时,根据逐笔委托数据更新盘口跳表,在订单哈希表中增加与逐笔委托数据的委托订单号相对应的订单数据项;在逐笔数据为逐笔成交数据时,根据逐笔成交数据中的委托订单号,确定订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定盘口跳表中相应的目标档位,更新目标档位中的委托数量;按照委托价格的大小顺序遍历更新后的盘口跳表,生成目标证券的市场行情数据。A method for reconstructing market conditions based on transaction-by-transaction data provided by the present application includes: for a target security, generating a market jump table and an order hash table, wherein the market jump table includes a plurality of gears divided according to the entrusted price , each level includes the order price and order quantity, the order hash table includes multiple order data items, the key of the order data item is the order number of the order, and the value of the order data item includes the unfilled quantity and the handicap gear pointer; receive Tick-by-tick data; when the tick-by-tick data is the order-by-order data, update the market jump table according to the order-by-order data, and add the order data item corresponding to the order number of the order-by-order data in the order hash table; When the transaction data is transaction data, determine the corresponding target order data item in the order hash table according to the order number in the transaction data; update the unexecuted quantity in the target order data item; according to the target order data item The handicap gear pointer determines the corresponding target gear in the handicap jump table, and updates the order quantity in the target gear; traverses the updated handicap jump table according to the order of the order price to generate the market data of the target securities.
可见,该方法使用跳表保存盘口的量价关系,利用跳表第一层的线性结构提高市场行情输出时的性能,使用订单哈希表加速接收逐笔成交后定位扣减档位的速度,因此,能够提高基于逐笔数据重构市场行情的性能,降低后端交易系统接收行情的延迟。It can be seen that this method uses the skip table to save the volume-price relationship of the market, uses the linear structure of the first layer of the skip table to improve the performance of market output, and uses the order hash table to speed up the speed of positioning and deducting gears after receiving each transaction. Therefore, the performance of reconstructing market quotations based on transaction-by-transaction data can be improved, and the delay in receiving quotations by the back-end trading system can be reduced.
此外,本申请还提供了一种基于逐笔数据重构市场行情的装置、设备及可读存储介质,其技术效果与上述方法的技术效果相对应,这里不再赘述。In addition, the present application also provides an apparatus, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data.
附图说明Description of drawings
为了更清楚的说明本申请实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application or the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only For some embodiments of the present application, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为本申请所提供的一种基于逐笔数据重构市场行情的方法实施例一的实现流程图;Fig. 1 is a realization flow chart of Embodiment 1 of a method for reconstructing market conditions based on transaction-by-transaction data provided by this application;
图2为本申请所提供的跳表结果示意图;Fig. 2 is the schematic diagram of skip table result provided by this application;
图3为本申请所提供的一种基于逐笔数据重构市场行情的方法实施例二的实现流程图;Fig. 3 is a realization flow chart of Embodiment 2 of a method for reconstructing market conditions based on transaction-by-transaction data provided by the present application;
图4为本申请所提供的一种基于逐笔数据重构市场行情的方法应用实 施例的实现流程图;Fig. 4 is the realization flow chart of a kind of method application embodiment based on data reconstruction of market conditions provided by this application;
图5为本申请所提供的一种基于逐笔数据重构市场行情的装置实施例的功能框图。FIG. 5 is a functional block diagram of an embodiment of an apparatus for reconstructing market conditions based on transaction-by-transaction data provided by the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make those skilled in the art better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
目前,基于逐笔数据重构市场行情的过程中,需要频繁对盘口数据进行各种数据操作,因此,在证券数量较大时,对保存盘口的数据结构以及更新算法的性能要求极高。At present, in the process of reconstructing market conditions based on the data one by one, various data operations need to be performed frequently on the market data. Therefore, when the number of securities is large, the data structure for saving the market and the performance of the update algorithm are extremely demanding. .
针对该问题,本申请提供一种基于逐笔数据重构市场行情的方法、装置、设备及可读存储介质,生成盘口跳表保存盘口数据,且生成订单哈希表以方便更新订单,支持快速增、删、改、查的盘口和订单数据,基于上述数据结构实现了对市场行情的快速重构。In response to this problem, the present application provides a method, device, device and readable storage medium for reconstructing market conditions based on transaction-by-transaction data, generating a market jump table to save the market data, and generating an order hash table to facilitate order update, It supports rapid addition, deletion, modification, and checking of market and order data. Based on the above data structure, it realizes rapid reconstruction of market conditions.
下面对本申请提供的一种基于逐笔数据重构市场行情的方法实施例一进行介绍,参见图1,实施例一包括:The first embodiment of a method for reconstructing market conditions based on transaction-by-transaction data provided by the present application will be introduced below. Referring to FIG. 1, the first embodiment includes:
S101、针对目标证券,生成盘口跳表和订单哈希表;S101. For the target securities, generate a handicap skip table and an order hash table;
其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项。在市场行情重构的场景下,除了要保存盘口,还要保存每笔尚未全部成交的订单。在具体实施时,本实施例使用订单哈希表,订单哈希表的键为订单编号,值包括未成交数量和对应档位的跳表节点指针。Wherein the handicap jump table includes a plurality of gears divided according to the order price, the gears include the order price and the order quantity, and the order hash table includes a plurality of order data items. In the scenario of market restructuring, in addition to saving the market, it is also necessary to save each order that has not been fully filled. In specific implementation, this embodiment uses an order hash table, the key of the order hash table is the order number, and the value includes the unsettled quantity and the skip table node pointer of the corresponding gear.
S102、接收逐笔数据;S102. Receive data one by one;
S103、在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订 单号相对应的订单数据项;S103. When the transaction-by-transaction data is the transaction-by-transmission data, update the handicap jump table according to the transaction-by-transmission data, and add the order number corresponding to the transaction-by-transmission data in the order hash table. the corresponding order data item;
具体的,在接收到逐笔委托数据之后,根据逐笔委托数据中的委托价格从盘口跳表中查找对应的档位,根据逐笔委托数据中的数量更新该档位的委托数量。这种利用盘口跳表查询对应的档位的方式,时间复杂度为对数时间。此外,还需要在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项。Specifically, after receiving the order-by-order data, the corresponding stall is searched from the market jump table according to the order price in the order-by-order data, and the order quantity of the stall is updated according to the quantity in the order-by-order data. This method of using the handicap jump table to query the corresponding gear has a time complexity of logarithmic time. In addition, an order data item corresponding to the order number of the order-by-order order data needs to be added to the order hash table.
S104、在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;S104. When the transaction-by-transaction data is transaction-by-transaction data, determine a corresponding target order data item in the order hash table according to the order number in the transaction-by-transaction data; update the target order data item in the target order data item. The unfilled quantity; determine the corresponding target gear in the market skip table according to the market gear pointer of the target order data item, and update the order quantity in the target gear;
S105、按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。S105 , traverse the updated handicap jump table according to the order of the order price, and generate market data of the target security.
在市场行情数据中,买方盘口由价格由高到底的多个档位组成,卖方盘口则由价格由低到高的多个档位组成,每个档位上都是委托价格和对应的委托数量。In the market data, the buyer's market consists of multiple gears with prices ranging from high to the bottom, and the seller's market consists of multiple gears with prices ranging from low to high. Each gear is the commission price and the corresponding number of orders.
在市场行情重构的场景中,收到逐笔成交数据之后,需要查找对应的订单数据项,并进行未成交数量的更新。具体的,对于逐笔成交消息中的成交数据,根据买方或卖方的委托订单号和成交数量更新相应订单数据项的未成交数量和档位的委托数量;对于逐笔成交消息中的撤单数据,则根据是买方或卖方的委托订单编号和撤单数量做出相应更新。In the scenario of market reconstruction, after receiving the transaction data one by one, it is necessary to find the corresponding order data item and update the number of unfilled transactions. Specifically, for the transaction data in the transaction message, the unexecuted quantity of the corresponding order data item and the order quantity of the stall are updated according to the order number and transaction quantity of the buyer or seller; for the order cancellation data in the transaction message , it will be updated accordingly according to the order number and order cancellation quantity of the buyer or seller.
可以理解的是,如果更新后的未成交数量为零,还要删除对应的订单数据项。同理,如果更新后的委托数量为零,则删除对应的档位。It is understandable that if the updated untraded quantity is zero, the corresponding order data item should also be deleted. Similarly, if the updated order quantity is zero, the corresponding gear will be deleted.
在发送市场行情时,需要遍历买卖两个方向的盘口。具体的,每次收到逐笔数据并更新盘口之后,如果盘口的价格不存在交叉关系,就可以对外发送市场行情。When sending market quotes, it is necessary to traverse the market in both directions of buying and selling. Specifically, after each transaction is received and the market is updated, if there is no cross relationship between the prices of the market, the market can be sent to the outside world.
本实施例所提供一种基于逐笔数据重构市场行情的方法,采用跳表保存盘口,如图2所示,跳表是一种概率化的多层次索引的链表,能够在保持链表的线性结构的基础上,增加多个层次的索引提高查询效率,所以跳表查询、增加、删除的效率在概率上与平衡树相当,且增加和删除操作不 需要保持子树平衡。而且,由于跳表第一层是线性结构,比平衡树更适合发送市场行情时的遍历操作,能够达到对数时间复杂度。This embodiment provides a method for reconstructing market conditions based on transaction-by-transaction data, using a skip table to save the market, as shown in Figure 2, the skip table is a probabilistic multi-level indexed linked list, which can maintain the On the basis of the linear structure, adding multiple levels of indexes improves the query efficiency, so the efficiency of skipping table query, adding, and deleting is equivalent to a balanced tree in probability, and adding and deleting operations do not need to maintain subtree balance. Moreover, since the first layer of the skip table is a linear structure, it is more suitable for the traversal operation when sending market quotations than the balanced tree, and can achieve logarithmic time complexity.
可见,该方法使用跳表保存盘口的量价关系,利用跳表第一层的线性结构提高市场行情输出时的性能,使用订单哈希表加速接收逐笔成交后定位扣减档位的速度,因此,能够提高基于逐笔数据重构市场行情的性能,降低后端交易系统接收行情的延迟。It can be seen that this method uses the skip table to save the volume-price relationship of the market, uses the linear structure of the first layer of the skip table to improve the performance of market output, and uses the order hash table to speed up the speed of positioning and deducting gears after receiving each transaction. Therefore, the performance of reconstructing market quotations based on transaction-by-transaction data can be improved, and the delay in receiving quotations by the back-end trading system can be reduced.
下面开始详细介绍本申请提供的一种基于逐笔数据重构市场行情的方法实施例二,实施例二基于前述实施例一实现,并在实施例一的基础上进行了一定程度上的拓展。The second embodiment of a method for reconstructing market conditions based on transaction-by-transaction data provided by the present application will be described in detail below.
实施例一对根据逐笔委托数据和逐笔成交数据更新盘口的过程进行了说明,其中根据逐笔委托数据在盘口跳表查找对应档位的过程的时间复杂度为对数时间,本实施例对该过程做进一步优化,减少查询时间。具体的,本实施例设置了档位哈希表,利用其存储委托价格与盘口节点指针的对应关系,从而将查询时间从对数时间降低到单位时间。The embodiment has described the process of updating the market according to the order-by-order data and the transaction data, wherein the time complexity of the process of searching for the corresponding gear position in the market jump table according to the order-by-order data is logarithmic time. The embodiment further optimizes the process to reduce query time. Specifically, in this embodiment, a gear hash table is set, and the corresponding relationship between the commission price and the handicap node pointer is stored in the gear hash table, thereby reducing the query time from logarithmic time to unit time.
参见图3,实施例二具体包括:Referring to Figure 3, the second embodiment specifically includes:
S301、针对目标证券,生成盘口跳表、订单哈希表和档位哈希表;S301. For the target securities, generate a handicap skip table, an order hash table and a gear hash table;
其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量;所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;所述档位哈希表包括多个档位数据项,所述档位数据项的键为委托价格,所述档位数据项的值为盘口档位指针。Wherein the handicap jump table includes a plurality of gears divided according to the order price, and the gears include the order price and the order quantity; the order hash table includes a plurality of order data items, and the keys of the order data items are: The order number of the order, the value of the order data item includes the untraded quantity and the handicap gear pointer; the gear hash table includes a plurality of gear data items, the key of the gear data item is the commission price, and the The value of the above gear data item is the market gear pointer.
S302、接收逐笔数据;S302. Receive data one by one;
S303、在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据中的委托价格,确定所述档位哈希表中相应的目标档位数据项;根据目标档位数据项的盘口档位指针,确定所述盘口跳表中相应的目标档位,更新目标档位的委托数量;在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;S303, when the transaction-by-transmission data is transaction-by-transmission entrustment data, determine a corresponding target gear data item in the gear hash table according to the commission price in the transaction-by-transmission data; according to the target gear data item the handicap gear pointer, determine the corresponding target gear in the handicap jump table, update the order quantity of the target gear; add the order number corresponding to the order-by-order order data in the order hash table the corresponding order data item;
在实际的证券交易中,交易者报出独立档位价格,由于成交和撤单造 成档位数量扣减到零的情况不多,大部分操作仍然是针对现有的档位修改数量。针对这种操作特点,本实施例使用一个档位哈希表保存委托价格和对应档位的跳表节点指针,将查询时间由跳表的对数时间复杂度降低到在单位时间内完成。In actual securities trading, traders quote the price of independent tranches. Due to the transaction and cancellation of orders, the number of tranches is rarely deducted to zero, and most operations are still aimed at modifying the quantity of existing tranches. In view of this operational feature, this embodiment uses a gear hash table to store the commission price and the skip table node pointer corresponding to the gear, and reduces the query time from the logarithmic time complexity of the skip table to the completion in unit time.
收到逐笔委托数据之后,根据委托价格查找对应的档位数据项,若存在对应的档位数据项,根据该档位数据项的盘口档位指针确定对应的档位,对该档位上的委托数量进行更新,并在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;若不存在对应的档位数据项,需要增加一个档位数据项,并增加一个档位以记录委托价格和委托数量,同时需要增加一个订单数据项以记录委托订单编号、未成交数量以及对应档位。After receiving the entrusted data one by one, the corresponding gear data item is searched according to the entrusted price. If there is a corresponding gear data item, the corresponding gear is determined according to the handicap gear pointer of the gear data item. Update the number of orders on the order, and add the order data item corresponding to the order number of the order-by-order data in the order hash table; if there is no corresponding gear data item, you need to add a gear data item, and add a gear to record the order price and quantity, and also need to add an order data item to record the order number, unfilled quantity and the corresponding gear.
具体的,判断所述档位哈希表中是否存在所述逐笔委托数据的委托价格;若存在,确定与所述逐笔委托数据的委托价格相对应的目标档位数据项,在所述订单哈希表增加与所述逐笔委托数据的委托订单号相对应的订单数据项,在订单哈希表中增加与逐笔委托数据的委托订单号相对应的订单数据项;若不存在,则在所述盘口跳表增加与所述逐笔委托数据的委托价格相对应的档位,在所述档位哈希表增加与所述逐笔委托数据的委托价格相对应的档位数据项,在所述订单哈希表增加与所述逐笔委托数据的委托订单号相对应的订单数据项。Specifically, it is judged whether there is the commission price of the one-by-one commission data in the gear hash table; if there is, the target gear data item corresponding to the commission price of the one-by-bit commission data is determined, and in the An order data item corresponding to the order number of the order-by-order data is added to the order hash table, and an order data item corresponding to the order number of the order-by-order data is added to the order hash table; if it does not exist, Then, add the stall corresponding to the commission price of the one-by-one order data in the handicap jump table, and add the stall data corresponding to the commission price of the one-by-one order data in the stall hash table. item, and an order data item corresponding to the order number of the order-by-order order data is added to the order hash table.
S304、在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;S304, when the transaction-by-transaction data is transaction-by-transaction data, determine the corresponding target order data item in the order hash table according to the order number in the transaction-by-transaction data; update the target order data item in the The unfilled quantity; determine the corresponding target gear in the market skip table according to the market gear pointer of the target order data item, and update the order quantity in the target gear;
可以理解的是,若更新后的未成交数量为0,则删除所述目标订单数据项。同理,若更新后的委托数量为0,则删除所述目标档位。It can be understood that, if the updated unexecuted quantity is 0, the target order data item is deleted. Similarly, if the updated order quantity is 0, the target gear is deleted.
S305、判断更新后的盘口跳表是否存在交叉关系,若不存在,则进入S306;S305, determine whether there is a cross relationship in the updated handicap jump table, if not, enter S306;
具体的,判断买入盘口跳表的委托价格是否低于卖出盘口跳表的委托价格,若低于,则判定不存在交叉关系,否则判定存在交叉关系。Specifically, it is determined whether the entrusted price of the buy order jumping table is lower than the order price of the selling order jumping table, if it is lower, it is determined that there is no cross relationship, otherwise it is determined that there is a cross relationship.
S306、按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。S306 , traverse the updated handicap jump table in the order of the order price, and generate market data of the target security.
在发送行情时,如果后端交易系统无法处理连续输出的包含全部档位的市场行情,可以每次只输出预设数量的档位,例如输出与Level-2行情快照相同的十个档位,还可以增加一个计时器以固定的时间间隔输出市场行情,或综合使用上述两种方法。When sending quotations, if the back-end trading system cannot process the continuously outputted market quotations containing all the gears, it can output only a preset number of gears each time, for example, output the same ten gears as the Level-2 market snapshot, You can also add a timer to output market conditions at regular intervals, or use a combination of the above two methods.
具体的,在同时采用以上两种方式时,S306具体包括:按照预设周期,以委托价格的大小顺序遍历更新后的盘口跳表,选取预设数量的档位,以作为所述目标证券的市场行情数据。Specifically, when the above two methods are adopted at the same time, S306 specifically includes: according to a preset period, traversing the updated handicap jump table in the order of the order price, and selecting a preset number of stalls as the target securities market data.
可见,本实施例提供的一种基于逐笔数据重构市场行情的方法,利用一个跳表和两个哈希表相互配合的数据结构,共同完成基于逐笔数据重构市场行情的过程。具体的,使用跳表保存盘口,利用跳表第一层的线性结构提高市场行情输出时的性能,同时在需要增加和删除操作时在概率上达到与平衡树一致的对数时间复杂度;使用档位哈希表加速接收逐笔委托后定位现有档位的速度;使用订单哈希表加速接收逐笔成交后定位扣减档位的速度。因此,本实施例能够提高市场行情重构性能,降低后端交易系统接收行情的延迟。It can be seen that a method for reconstructing market conditions based on transaction-by-transaction data provided by this embodiment utilizes a data structure in which a skip table and two hash tables cooperate with each other to jointly complete the process of reconstructing market conditions based on transaction-by-transaction data. Specifically, the skip table is used to save the market, the linear structure of the first layer of the skip table is used to improve the performance of market output, and the logarithmic time complexity that is consistent with the balance tree is achieved in probability when adding and deleting operations are required; Use the gear hash table to speed up the speed of locating the existing gear after receiving one-by-one orders; use the order hash table to speed up the speed of positioning the deducted gear after receiving the one-by-one transaction. Therefore, this embodiment can improve the market quotation reconstruction performance and reduce the delay in receiving quotations by the back-end trading system.
基于以上实施例,下面以具体应用为例,对本申请的基于逐笔数据重构市场行情的方法进行说明。Based on the above embodiments, the method for reconstructing market conditions based on transaction-by-transaction data of the present application will be described below by taking a specific application as an example.
用于单只证券的市场行情重构的数据结构如表1所示,包括买卖双向的盘口跳表、档位哈希表、订单哈希表,盘口跳表的每个节点用于存储一个档位的价格和数量。顶层使用一个证券哈希表保存证券代码和六个数据结构实例的对应关系。The data structure used to reconstruct the market quotation of a single security is shown in Table 1, including the two-way trading table, gear hash table, and order hash table. Each node of the handicap table is used to store The price and quantity of a stall. The top layer uses a security hash table to store the correspondence between security codes and six data structure instances.
表1Table 1
Figure PCTCN2021076925-appb-000001
Figure PCTCN2021076925-appb-000001
Figure PCTCN2021076925-appb-000002
Figure PCTCN2021076925-appb-000002
基于以上数据结构,本实施例的基于逐笔数据快速重构市场行情的过程如图4所示,包括:Based on the above data structure, the process of rapidly reconstructing market conditions based on transaction-by-transaction data in this embodiment is shown in Figure 4, including:
第一步,根据开盘前的证券信息文件,为当天交易的所有证券创建对应的数据结构,将证券代码和对应数据结构写入到证券哈希表。The first step is to create a corresponding data structure for all securities traded on that day according to the securities information file before the market opening, and write the securities code and corresponding data structure into the securities hash table.
第二步,接收逐笔数据,使用证券哈希表根据证券代码查询对应数据结构。The second step is to receive the data one by one, and use the security hash table to query the corresponding data structure according to the security code.
第三步,判断逐笔数据类型,如果是逐笔委托消息并且不是市价委托,则使用委托价格作为键值查找档位哈希表。如果存在对应档位就将委托数量累加到对应档位的跳表节点的委托数量上;如果不存在对应档位就创建新的跳表节点记录委托的价格和数量,并将跳表节点插入跳表,同时在档位哈希表中增加价格和对应档位的跳表节点指针的记录。最后,在订单哈希表中记录订单编号和对应档位的跳表节点指针。The third step is to judge the data type of each transaction. If it is a transaction-by-transmission message and is not a market order, use the order price as the key value to find the gear hash table. If there is a corresponding gear, the order quantity will be accumulated to the order quantity of the skip table node of the corresponding gear; if there is no corresponding gear, a new skip table node will be created to record the price and quantity of the order, and the skip table node will be inserted into the skip table node. At the same time, the record of the price and the jump table node pointer of the corresponding gear is added to the gear hash table. Finally, record the order number and the skip table node pointer of the corresponding gear in the order hash table.
第四步,如果是逐笔成交消息,当成交类型是成交时,使用买入和卖出订单编号作为键查询订单哈希表,买入和卖出订单分别扣减成交数量,再根据订单哈希表的值查找对应档位,在对应档位上扣减成交数量。当成交类型是撤单时,使用买入订单编号或者卖出订单编号作为键查询订单哈希表,买入或卖出订单扣减成交数量,再根据订单哈希表的值查找对应档位,在对应档位上扣减成交数量。当对应订单或档位在扣减后数量为零时,删除对应订单和档位。The fourth step, if it is a transaction message one by one, when the transaction type is transaction, use the buy and sell order numbers as the key to query the order hash table, and the buy and sell orders are deducted from the transaction quantity, and then based on the order. The value of the table is searched for the corresponding gear, and the transaction quantity is deducted from the corresponding gear. When the transaction type is cancel order, use the buy order number or sell order number as the key to query the order hash table, deduct the transaction quantity for the buy or sell order, and then find the corresponding gear according to the value of the order hash table, The transaction quantity is deducted from the corresponding gear. When the quantity of the corresponding order or stall is zero after deduction, the corresponding order and stall are deleted.
第五步,判断买一档价格是否小于卖一档价格,如果是则发送行情, 不是则等待进一步的成交消息。The fifth step is to judge whether the price of buying one tranche is lower than the selling price of one tranche, if so, send the quotation, if not, wait for further transaction messages.
第六步,返回第二步,直到全天交易时间结束。The sixth step, go back to the second step, until the end of the all-day trading time.
下面对本申请实施例提供的一种基于逐笔数据重构市场行情的装置进行介绍,下文描述的一种基于逐笔数据重构市场行情的装置与上文描述的一种基于逐笔数据重构市场行情的方法可相互对应参照。The following describes an apparatus for reconstructing market conditions based on transaction-by-transaction data provided by the embodiments of the present application. The methods of market conditions can refer to each other.
如图5所示,本实施例的基于逐笔数据重构市场行情的装置,包括:As shown in Figure 5, the device for reconstructing market conditions based on transaction-by-transaction data in this embodiment includes:
数据结构生成模块501:用于针对目标证券,生成盘口跳表和订单哈希表,其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;Data structure generation module 501: used to generate a market jump table and an order hash table for the target securities, wherein the market jump table includes a plurality of tiers divided according to the order price, and the notch includes the order price and the order price Quantity, the order hash table includes a plurality of order data items, the key of the order data item is the order number, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
逐笔数据接收模块502:用于接收逐笔数据;Pen-by-transaction data receiving module 502: used for receiving pen-by-transaction data;
第一数据更新模块503:用于在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;The first data update module 503 is configured to update the handicap jump table according to the transaction-by-transmission data when the transaction-by-transaction data is the transaction-by-transmission data, and add the same value as the transaction-by-transaction data in the order hash table. The order data item corresponding to the order order number of the order data;
第二数据更新模块504:用于在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;The second data updating module 504 is used for determining the corresponding target order data item in the order hash table according to the order number in the transaction data when the transaction data is transaction transaction data; Update the unsettled quantity in the target order data item; determine the corresponding target gear in the handicap jump table according to the market gear pointer of the target order data item, and update the order quantity in the target gear;
市场行情生成模块505:用于按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。Market quotation generation module 505 : used for traversing the updated handicap jump table according to the order of the order price, and generating the market quotation data of the target securities.
本实施例的基于逐笔数据重构市场行情的装置用于实现前述的基于逐笔数据重构市场行情的方法,因此该装置中的具体实施方式可见前文中的基于逐笔数据重构市场行情的方法的实施例部分,例如,数据结构生成模块501、逐笔数据接收模块502、第一数据更新模块503、第二数据更新模块504、市场行情生成模块505,分别用于实现上述基于逐笔数据重构市场行情的方法中步骤S101,S102,S103,S104,S105。所以,其具体实施方 式可以参照相应的各个部分实施例的描述,在此不再展开介绍。The apparatus for reconstructing market quotations based on transaction-by-transaction data in this embodiment is used to implement the aforementioned method for reconstructing market quotations based on transaction-by-transaction data. Therefore, the specific implementation of the device can be found in the previous section Reconstructing market quotations based on transaction-by-transaction data. The embodiment part of the method, for example, the data structure generation module 501, the transaction-by-transaction data receiving module 502, the first data update module 503, the second data update module 504, and the market quotation generation module 505 are respectively used to realize the above-mentioned transaction-by-transaction based data. Steps S101, S102, S103, S104, S105 in the method for data reconstruction of market conditions. Therefore, reference may be made to the descriptions of the corresponding partial embodiments for specific implementations thereof, which will not be described herein again.
另外,由于本实施例的基于逐笔数据重构市场行情的装置用于实现前述的基于逐笔数据重构市场行情的方法,因此其作用与上述方法的作用相对应,这里不再赘述。In addition, since the apparatus for reconstructing market quotations based on transaction-by-transaction data in this embodiment is used to implement the aforementioned method for reconstructing market quotations based on transaction-by-transaction data, its function corresponds to that of the above method, and will not be repeated here.
此外,本申请还提供了一种基于逐笔数据重构市场行情的设备,包括:In addition, the present application also provides a device for reconstructing market conditions based on transaction-by-transaction data, including:
存储器:用于存储计算机程序;Memory: used to store computer programs;
处理器:用于执行所述计算机程序,以实现如上文所述的基于逐笔数据重构市场行情的方法的步骤。Processor: for executing the computer program to implement the steps of the method for reconstructing market conditions based on tick-by-tick data as described above.
最后,本申请提供了一种可读存储介质,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时用于实现如上文所述的基于逐笔数据重构市场行情的方法的步骤。Finally, the present application provides a readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, is used to realize the above-mentioned reconstruction of market conditions based on tick-by-tick data steps of the method.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments may be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. A software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
以上对本申请所提供的方案进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The solutions provided by this application have been introduced in detail above, and specific examples are used to illustrate the principles and implementations of this application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of this application; , for those of ordinary skill in the art, according to the idea of the application, there will be changes in the specific embodiments and application scope. To sum up, the content of this specification should not be construed as a limitation to the application.

Claims (10)

  1. 一种基于逐笔数据重构市场行情的方法,其特征在于,包括:A method for reconstructing market conditions based on transaction-by-transaction data, comprising:
    针对目标证券,生成盘口跳表和订单哈希表,其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;For the target securities, a market jump table and an order hash table are generated, wherein the market jump table includes a plurality of tiers divided according to the order price, the tiers include the order price and the order quantity, and the order hash table Including a plurality of order data items, the key of the order data item is the order number of the order, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
    接收逐笔数据;receive tick-by-tick data;
    在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;When the trade-by-trade data is trade-by-trade order data, update the market jump table according to the trade-by trade-off data, and add the order number corresponding to the trade-by-trade entrustment data in the order hash table 's order data item;
    在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;When the transaction-by-transaction data is transaction-by-transaction data, determine the corresponding target order data item in the order hash table according to the order number in the transaction-by-transaction data; update the unexecuted order data item in the target order data item Quantity; according to the handicap gear pointer of the target order data item, determine the corresponding target gear in the handicap jump table, and update the order quantity in the target gear;
    按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。Traverse the updated handicap jump table according to the order of the order price, and generate the market data of the target security.
  2. 如权利要求1所述的方法,其特征在于,所述针对目标证券,生成盘口跳表和订单哈希表,包括:The method of claim 1, wherein generating a market skip table and an order hash table for the target securities, comprising:
    针对目标证券,生成盘口跳表、订单哈希表和档位哈希表,其中所述档位哈希表包括多个档位数据项,所述档位数据项的键为委托价格,所述档位数据项的值为盘口档位指针;For the target securities, a market jump table, an order hash table and a gear hash table are generated, wherein the gear hash table includes a plurality of gear data items, the key of the gear data item is the commission price, and the The value of the above gear data item is the handicap gear pointer;
    相应的,所述在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,包括:Correspondingly, when the transaction-by-transaction data is the transaction-by-transmission commission data, updating the handicap jump table according to the transaction-by-transmission commission data includes:
    在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据中的委托价格,确定所述档位哈希表中相应的目标档位数据项;根据目标档位数据项的盘口档位指针,确定所述盘口跳表中相应的目标档位,更新目标档位的委托数量。When the transaction-by-transaction data is the transaction-by-transmission entrustment data, the corresponding target gear data item in the gear hash table is determined according to the entrusted price in the transaction-by-transmission data; according to the disk of the target gear data item The handicap gear pointer is used to determine the corresponding target gear in the handicap jump table, and update the commission quantity of the target gear.
  3. 如权利要求2所述的方法,其特征在于,所述根据所述逐笔委托数据中的委托价格,确定所述档位哈希表中相应的目标档位数据项,包括:The method according to claim 2, wherein the determining the corresponding target gear data item in the gear hash table according to the entrusted price in the one-by-one entrustment data comprises:
    判断所述档位哈希表中是否存在所述逐笔委托数据的委托价格;Judging whether there is the commission price of the one-by-one commission data in the gear hash table;
    若存在,确定与所述逐笔委托数据的委托价格相对应的目标档位数据项;If there is, determine the target gear data item corresponding to the order price of the order-by-order order data;
    若不存在,则在所述盘口跳表增加与所述逐笔委托数据的委托价格相对应的档位,在所述档位哈希表增加与所述逐笔委托数据的委托价格相对应的档位数据项。If it does not exist, add a gear corresponding to the order price of the one-by-one order data in the handicap jump table, and add a gear corresponding to the order price of the one-by-one order data in the gear hash table the gear data item.
  4. 如权利要求1所述的方法,其特征在于,在所述更新目标订单数据项中的未成交数量之后,还包括:The method of claim 1, further comprising: after updating the unfilled quantity in the target order data item:
    若更新后的未成交数量为0,则删除所述目标订单数据项。If the updated unexecuted quantity is 0, the target order data item is deleted.
  5. 如权利要求1所述的方法,其特征在于,在所述根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量之后,还包括:The method according to claim 1, characterized in that, after determining the corresponding target gear in the market jumping table according to the market gear pointer of the target order data item, and updating the order quantity in the target gear ,Also includes:
    若更新后的委托数量为0,则删除所述目标档位。If the updated order quantity is 0, the target gear is deleted.
  6. 如权利要求1-5任意一项所述的方法,其特征在于,所述按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据,包括:The method according to any one of claims 1 to 5, wherein the step of traversing the updated handicap table according to the order of the entrusted prices, to generate the market data of the target securities, includes:
    按照预设周期,以委托价格的大小顺序遍历更新后的盘口跳表,选取预设数量的档位,以作为所述目标证券的市场行情数据。According to a preset period, the updated handicap jump table is traversed in the order of the order price, and a preset number of stalls are selected as the market data of the target securities.
  7. 如权利要求6所述的方法,其特征在于,所述盘口跳表包括买入盘口跳表和卖出盘口跳表,所述按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据,包括:The method according to claim 6, wherein the handicap jump table includes a buy handicap table and a sell handicap table, and the updated handicap jump table is traversed according to the order of the order price , to generate the market data of the target securities, including:
    判断买入盘口跳表的委托价格是否低于卖出盘口跳表的委托价格;Determine whether the order price of the buy order jumping table is lower than the order price of the selling order jumping table;
    若是,按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。If so, traverse the updated handicap jump table in the order of the order price, and generate the market data of the target security.
  8. 一种基于逐笔数据重构市场行情的装置,其特征在于,包括:A device for reconstructing market conditions based on transaction-by-transaction data, characterized in that it includes:
    数据结构生成模块:用于针对目标证券,生成盘口跳表和订单哈希表,其中所述盘口跳表包括按照委托价格划分的多个档位,所述档位包括委托价格和委托数量,所述订单哈希表包括多个订单数据项,所述订单数据项的键为委托订单号,所述订单数据项的值包括未成交数量和盘口档位指针;Data structure generation module: used to generate a handicap jump table and an order hash table for the target securities, wherein the handicap jump table includes multiple tiers divided according to the entrusted price, and the tiers include the entrusted price and the order quantity , the order hash table includes a plurality of order data items, the key of the order data item is the order number, and the value of the order data item includes the unfilled quantity and the handicap gear pointer;
    逐笔数据接收模块:用于接收逐笔数据;One-by-one data receiving module: used to receive one-by-one data;
    第一数据更新模块:用于在所述逐笔数据为逐笔委托数据时,根据所述逐笔委托数据更新所述盘口跳表,在所述订单哈希表中增加与所述逐笔委托数据的委托订单号相对应的订单数据项;The first data update module: when the transaction-by-transaction data is the transaction-by-transmission commission data, update the handicap jump table according to the transaction-by-transmission commission data, and add and the transaction-by-transaction data in the order hash table. The order data item corresponding to the order number of the order data of the order data;
    第二数据更新模块:用于在所述逐笔数据为逐笔成交数据时,根据所述逐笔成交数据中的委托订单号,确定所述订单哈希表中相应的目标订单数据项;更新目标订单数据项中的未成交数量;根据目标订单数据项的盘口档位指针确定所述盘口跳表中相应的目标档位,更新目标档位中的委托数量;The second data update module: when the transaction-by-transaction data is transaction-by-transaction data, according to the order number in the transaction-by-transaction data, determine the corresponding target order data item in the order hash table; update The unsettled quantity in the target order data item; determine the corresponding target gear in the handicap jump table according to the handicap gear pointer of the target order data item, and update the order quantity in the target gear;
    市场行情生成模块:用于按照委托价格的大小顺序遍历更新后的盘口跳表,生成所述目标证券的市场行情数据。Market quotation generation module: used to traverse the updated handicap jump table in the order of the size of the entrusted price, and generate the market quotation data of the target securities.
  9. 一种基于逐笔数据重构市场行情的设备,其特征在于,包括:A device for reconstructing market conditions based on transaction-by-transaction data, characterized in that it includes:
    存储器:用于存储计算机程序;Memory: used to store computer programs;
    处理器:用于执行所述计算机程序,以实现如权利要求1-7任意一项所述的基于逐笔数据重构市场行情的方法的步骤。Processor: used to execute the computer program to implement the steps of the method for reconstructing market conditions based on transaction-by-transaction data according to any one of claims 1-7.
  10. 一种可读存储介质,其特征在于,所述可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时用于实现如权利要求1-7任意一项所述的基于逐笔数据重构市场行情的方法的步骤。A readable storage medium, characterized in that, a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the computer program is used to implement the stroke-by-stroke-based method according to any one of claims 1-7. The steps of a method for data reconstruction of market conditions.
PCT/CN2021/076925 2020-06-29 2021-02-19 Method and apparatus for reconstructing market quotations based on quote-by-quote data, and device WO2022001131A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010609099.0A CN111861743A (en) 2020-06-29 2020-06-29 Method, device and equipment for reconstructing market quotation based on stroke-by-stroke data
CN202010609099.0 2020-06-29

Publications (1)

Publication Number Publication Date
WO2022001131A1 true WO2022001131A1 (en) 2022-01-06

Family

ID=72989930

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076925 WO2022001131A1 (en) 2020-06-29 2021-02-19 Method and apparatus for reconstructing market quotations based on quote-by-quote data, and device

Country Status (2)

Country Link
CN (1) CN111861743A (en)
WO (1) WO2022001131A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742652A (en) * 2022-04-14 2022-07-12 上海宽睿信息科技有限责任公司 K line data generation method and device
CN115378847A (en) * 2022-08-23 2022-11-22 国联证券股份有限公司 Security market delay measurement system and method
CN117391860A (en) * 2023-11-07 2024-01-12 中科驭数(北京)科技有限公司 Method, device, equipment and storage medium for processing wind control form removing

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111861743A (en) * 2020-06-29 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and equipment for reconstructing market quotation based on stroke-by-stroke data
CN112529705A (en) * 2020-12-04 2021-03-19 深圳市富途网络科技有限公司 Method for processing orders of port stocks and related products
CN112965860B (en) * 2021-03-11 2022-02-11 中科驭数(北京)科技有限公司 Snapshot market distribution method, device, equipment and storage medium
CN113065964B (en) * 2021-04-13 2024-05-03 上证所信息网络有限公司 Data storage system and method adopting variable step jump table
CN113468080B (en) * 2021-06-10 2024-02-09 山东英信计算机技术有限公司 Caching method, system and related device for full-flash metadata
CN114238209A (en) * 2021-11-16 2022-03-25 上海金仕达软件科技有限公司 Test method and device for snapshot market data, electronic equipment and storage medium
CN115686869B (en) * 2022-12-29 2023-03-21 杭州迈拓大数据服务有限公司 Resource processing method, system, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180217987A1 (en) * 2017-01-31 2018-08-02 Salesforce.Com, Inc. Key-value storage using a skip list
CN109255710A (en) * 2018-09-20 2019-01-22 海南新软软件有限公司 A kind of market transaction software subscript is concerned about single method, apparatus and system
CN109683811A (en) * 2018-11-22 2019-04-26 华中科技大学 A kind of request processing method mixing memory key-value pair storage system
CN109741179A (en) * 2018-12-25 2019-05-10 北京字节跳动网络技术有限公司 Full gear market data real-time computing technique and device
CN111861743A (en) * 2020-06-29 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and equipment for reconstructing market quotation based on stroke-by-stroke data

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9251214B2 (en) * 2010-04-08 2016-02-02 Microsoft Technology Licensing, Llc In-memory database system
US20160062954A1 (en) * 2012-09-15 2016-03-03 Numbergun Llc Flexible high-speed generation and formatting of application-specified strings
CN109934582B (en) * 2019-02-25 2023-12-19 矩阵元技术(深圳)有限公司 Digital currency transaction data processing method, server, client and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180217987A1 (en) * 2017-01-31 2018-08-02 Salesforce.Com, Inc. Key-value storage using a skip list
CN109255710A (en) * 2018-09-20 2019-01-22 海南新软软件有限公司 A kind of market transaction software subscript is concerned about single method, apparatus and system
CN109683811A (en) * 2018-11-22 2019-04-26 华中科技大学 A kind of request processing method mixing memory key-value pair storage system
CN109741179A (en) * 2018-12-25 2019-05-10 北京字节跳动网络技术有限公司 Full gear market data real-time computing technique and device
CN111861743A (en) * 2020-06-29 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and equipment for reconstructing market quotation based on stroke-by-stroke data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742652A (en) * 2022-04-14 2022-07-12 上海宽睿信息科技有限责任公司 K line data generation method and device
CN115378847A (en) * 2022-08-23 2022-11-22 国联证券股份有限公司 Security market delay measurement system and method
CN115378847B (en) * 2022-08-23 2023-10-31 国联证券股份有限公司 Securities market time delay measuring system and method
CN117391860A (en) * 2023-11-07 2024-01-12 中科驭数(北京)科技有限公司 Method, device, equipment and storage medium for processing wind control form removing

Also Published As

Publication number Publication date
CN111861743A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2022001131A1 (en) Method and apparatus for reconstructing market quotations based on quote-by-quote data, and device
US11544284B2 (en) Aggregation framework system architecture and method
US10872095B2 (en) Aggregation framework system architecture and method
US11403317B2 (en) Aggregation framework system architecture and method
US10565194B2 (en) Computer system for join processing
US20130346274A1 (en) Electronic financial trading platform with real-time data analysis and reporting
US20170286510A1 (en) Aggregation framework system architecture and method
US10255108B2 (en) Parallel execution of blockchain transactions
US8407133B2 (en) Live alerts
US20170213209A1 (en) Enterprise blockchains and transactional systems
US7539689B2 (en) Bundling database
US20080222086A1 (en) Live profile
CN109298935A (en) A kind of method and application of the multi-process single-write and multiple-read without lock shared drive
US20140164353A1 (en) Optimizing parallel queries using interesting distributions
EP2858025A1 (en) An order book management device in a hardware platform
CN112015741A (en) Method and device for storing massive data in different databases and tables
EP3913496A1 (en) Enabling data access by external cloud-based analytics system
CN111488616A (en) Method and device for realizing preplan machine of service data block chain
CN111488615A (en) Cross-link realization method and device for service data block chain
JP2020017296A (en) Method and system of determining whether specific item is included in dataset including multiple items
CA3238645A1 (en) Generating cryptographic proof of a series of transactions
US8321408B1 (en) Quick access to hierarchical data via an ordered flat file
CN104881336A (en) Data backup method and device
CN111488343A (en) E-commerce data uplink method and device based on business data block chain
US20070198465A1 (en) Live profile

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21832111

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21832111

Country of ref document: EP

Kind code of ref document: A1