Order book data construction method and system based on FPGA

By combining FPGA caching and memory, order book data is constructed, solving the problem of slow order book construction speed in high-frequency trading, enabling rapid response to trading needs and improving the speed of trading decisions.

CN120872855AActive Publication Date: 2025-10-31HUNDSUN TECH

Patent Information

Application Number
CN202511374997.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2025-10-31
Estimated Expiration
2045-09-25

AI Technical Summary

Technical Problem

In high-frequency trading scenarios, existing technologies have slow order book construction speeds when implemented purely in software, resulting in excessively long transaction processing times. Furthermore, the complex interaction between FPGA and software systems can lead to packet loss, further impacting order book construction speed.

Method used

An FPGA-based order book data construction method is adopted. By combining the FPGA's cache and memory, and leveraging the FPGA's high-speed parallel processing capabilities, order book data is constructed. The cache maintains the optimal buy and sell order table, and the memory stores the full market information, achieving high-speed execution through pure hardware.

Benefits of technology

It improved the speed of order book data construction, reduced data access latency, ensured that downstream businesses could respond quickly to changes in market conditions, and avoided the problem of frequent hardware and software interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120872855A_ABST
    Figure CN120872855A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an order book data construction method and system based on an FPGA, and the order book data construction method based on the FPGA is applied to a programmable logic component, and comprises the steps: obtaining transaction quotation data, and decoding the transaction quotation data; performing data recombination on the decoded transaction market data according to a preset format to obtain market information; and synchronously sending the market information to a target memory and a target cache, and constructing order book data in the target cache based on the market information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of data processing technology, and in particular to an FPGA-based order book data construction method and system. Background Technology

[0002] In the financial sector, an order book is an electronic list recording all buy and sell orders in the financial market. It includes information such as the prices and quantities that market participants are willing to buy / sell, and the difference between the lowest selling price and the highest buying price. By establishing an order book through order placement and execution, new market data fluctuations can be obtained more quickly, providing a reference for downstream operations.

[0003] With the development of computer and internet technologies, faster parsing of market information in trading scenarios allows for quicker order book construction, effectively meeting downstream business needs. Current technologies typically implement order book construction purely through software. However, in high-frequency trading scenarios (e.g., to capture instantaneous price differences in the market, trading instructions need to be completed within microseconds or even nanoseconds), pure software implementations, based on software CPU instruction structures, mean that executing a program line by line, leading to relatively long construction times and impacting downstream business transactions.

[0004] To address this issue, the invention patent with publication number CN114549129A proposes a low-latency, high-throughput real-time order book generation method. The disclosed content proposes a hardware-software integrated solution combining FPGA hardware and software systems. By dividing the contract order book into mutually exclusive large and small tables, the small table is stored in the FPGA hardware and the large table is stored in the software system. This hardware-software integrated approach stores the complete order book, fully utilizing the advantages of high concurrency and low latency of FPGA hardware and the flexible and large capacity of software storage, thereby increasing practicality and reducing costs.

[0005] However, because the large and small tables of the contract order book are mutually exclusive and stored separately in the FPGA hardware and software system, each transaction processing requires traversing both tables, thus increasing processing time. Furthermore, since the FPGA hardware and software system support order book generation through mutual dependence, they need to interact frequently. This interaction logic is complex, and during periods of high market volume (such as the pre-market auction), slow software interaction processing can lead to packet loss, further reducing order book construction speed. While this approach can improve order book construction speed compared to purely software-based methods, the combined hardware and software solution still has room for improvement. Therefore, an effective solution to address these issues is urgently needed. Summary of the Invention

[0006] In view of this, embodiments of this specification provide an FPGA-based order book data construction method. One or more embodiments of this specification also relate to an FPGA-based order book data construction system and an electronic device, to address the technical deficiencies existing in the prior art.

[0007] According to a first aspect of the embodiments of this specification, a first FPGA-based order book data construction method is provided, applied to a programmable logic component, comprising: Acquire market data and decode the market data; The decoded market data is reconstructed according to a preset format to obtain market information. The market information is simultaneously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache.

[0008] According to a second aspect of the embodiments of this specification, a second FPGA-based order book data construction method is provided, applied to a programmable logic component, comprising: Acquire market data and decode the market data; The decoded market data is reorganized according to a preset format to obtain first and second market data. The first market information is simultaneously sent to the target memory and the target cache, and the price level information is constructed based on the first market information in the target cache. The gear information is read from the target cache, and the gear information and the second market information are combined to construct the order book data.

[0009] According to a third aspect of the embodiments of this specification, a third FPGA-based order book data construction method is provided, applied to a programmable logic component, comprising: Acquire transaction market data and decode the transaction market data to obtain transaction-by-transaction data and snapshot data; The data is reorganized according to a preset format to obtain market information; The market information is simultaneously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache. The order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

[0010] According to a fourth aspect of the embodiments of this specification, a fourth FPGA-based order book data construction method is provided, applied to a programmable logic component, including: Acquire multi-source heterogeneous data and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams; The multi-source heterogeneous sub-data for each channel is processed to obtain the corresponding market information for each channel. Each channel's corresponding market data is sent to the corresponding target memory and target cache, and the order book data corresponding to each channel is constructed based on the market data in the target cache. The order book data corresponding to each path is merged to obtain the order book data.

[0011] According to a fifth aspect of the embodiments of this specification, a fifth FPGA-based order book data construction method is provided, applied to a programmable logic component, including: Acquire market data and decode the market data; The decoded market data is reconstructed according to a preset format to obtain market information. The market information is synchronously sent to the target memory and the target cache. An optimal buy / sell price table is constructed based on the market information in the target cache, and order book data is constructed based on the optimal buy / sell price table. If the structured data corresponding to the optimal buy / sell price level table meets the data update conditions, the associated price level elements are deleted and / or adjusted in the structured data, and the target order book data is constructed based on the deletion and / or adjustment results.

[0012] According to a sixth aspect of the embodiments of this specification, a first FPGA-based order book data construction system is provided, including a server and a terminal, wherein the server is configured with programmable logic components, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct order book data based on the market information in the target cache; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

[0013] According to a seventh aspect of the embodiments of this specification, a second FPGA-based order book data construction system is provided, including a server and a terminal, wherein the server is configured with programmable logic components, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain first market information and second market information; synchronously send the first market information to a target memory and a target cache, and construct price level information based on the first market information in the target cache; read the price level information from the target cache, and assemble the price level information and the second market information to construct order book data; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

[0014] According to an eighth aspect of the embodiments of this specification, a third FPGA-based order book data construction system is provided, including a server and a terminal, wherein the server is configured with programmable logic components, including: The server is configured to acquire market data through a programmable logic component, decode the market data to obtain tick-by-tick data and snapshot data; reassemble the tick-by-tick data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache, and construct order book data based on the market information in the target cache; compare the order book data and the snapshot data, determine the optimal order book data based on the comparison result; and send the optimal order book data to the terminal. The terminal is used to render and display a list of trading quotes on the trading page based on the optimal order book data; or, it is used to execute a trading strategy based on the optimal order book data.

[0015] According to a ninth aspect of the embodiments of this specification, a fourth FPGA-based order book data construction system is provided, including a server and a terminal, wherein the server is configured with programmable logic components, including: The server is configured to acquire multi-source heterogeneous data through a programmable logic component, and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams; process each corresponding multi-source heterogeneous sub-data stream to obtain corresponding market data; send each corresponding market data sub-data stream to a corresponding target memory and target cache, and construct corresponding order book sub-data streams based on the market data sub-data streams in the target cache; merge the corresponding order book sub-data streams to obtain order book data; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

[0016] According to a tenth aspect of the embodiments of this specification, a fifth FPGA-based order book data construction system is provided, including a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct an optimal buy / sell price level table based on the market information in the target cache; construct order book data based on the optimal buy / sell price level table; when the structured data corresponding to the optimal buy / sell price level table meets the data update conditions, delete and / or adjust related price level elements in the structured data; construct target order book data based on the deletion and / or adjustment results; and send the target order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the target order book data; or, it is used to execute a trading strategy based on the target order book data.

[0017] According to an eleventh aspect of the embodiments of this specification, an electronic device is provided, the electronic device being a programmable logic component, the programmable logic component being used to perform the above-described steps of constructing order book data based on FPGA.

[0018] The FPGA-based order book data construction method provided in this embodiment is applied to a programmable logic component (PLC). To improve the speed of order book data construction and reduce the impact of slow data access, this application proposes a pure hardware order book data construction scheme. After obtaining market data, the PLC first decodes the market data and then reassembles it according to a preset format to obtain market information. To support the rapid construction of order book data, the market information can be simultaneously sent to the target memory and the target cache. The target memory can directly store the market information, while the target cache, due to limited storage space, can detect whether the market information needs to be stored, so that the target cache can maintain data associated with specific data structures. Based on this, order book data can be constructed based on the market information in the target cache. This achieves the acceleration of market data reading using the PLC's cache and the support for data reading operations through the PLC's memory, thereby improving the speed of order book data construction while ensuring normal business operation. In trading scenarios, it can facilitate downstream businesses to respond quickly to dynamically changing market conditions. Attached Figure Description

[0019] Figure 1 This is a flowchart of a first FPGA-based order book data construction method provided in one embodiment of this specification; Figure 2a This is a schematic diagram of a first FPGA-based order book data construction process provided in one embodiment of this specification; Figure 2b This is a schematic diagram of a second FPGA-based order book data construction process provided in one embodiment of this specification; Figure 2c This is a schematic diagram of a third FPGA-based order book data construction process provided in one embodiment of this specification; Figure 2d This is a schematic diagram of a fourth FPGA-based order book data construction process provided in one embodiment of this specification; Figure 2e This is a schematic diagram of a fifth FPGA-based order book data construction process provided in one embodiment of this specification; Figure 2f This is a schematic diagram of a sixth FPGA-based order book data construction process provided in one embodiment of this specification; Figure 3 This is a flowchart of a second FPGA-based order book data construction method provided in one embodiment of this specification; Figure 4 This is a flowchart of a third FPGA-based order book data construction method provided in one embodiment of this specification; Figure 5 This is a flowchart of a fourth FPGA-based order book data construction method provided in one embodiment of this specification; Figure 6 This is a flowchart of a fifth FPGA-based order book data construction method provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the structure of a first FPGA-based order book data construction system provided in one embodiment of this specification; Figure 8 This is a schematic diagram of the structure of a second FPGA-based order book data construction system provided in one embodiment of this specification; Figure 9 This is a schematic diagram of the structure of a third FPGA-based order book data construction system provided in one embodiment of this specification; Figure 10 This is a schematic diagram of the structure of a fourth FPGA-based order book data construction system provided in one embodiment of this specification; Figure 11This is a schematic diagram of the structure of a fifth FPGA-based order book data construction system provided in one embodiment of this specification. Detailed Implementation

[0020] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0021] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0023] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0024] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0025] FPGA (Field-Programmable Gate Array) is an integrated circuit that can be configured using hardware description languages ​​such as VHDL or Verilog to perform specific functions.

[0026] DDR (Double Data Rate) is a type of DRAM technology that can transmit data once on the rising edge and once on the falling edge of each clock cycle, thus doubling the data transfer rate.

[0027] HBM (High Bandwidth Memory) is a high-bandwidth memory technology specifically designed for high-performance graphics accelerators, network devices, high-performance computing (HPC), and other fields. Unlike traditional DDR SDRAM, HBM uses 3D stacking technology to vertically stack multiple DRAM chips together and uses a wider data bus to achieve higher data transfer rates and lower power consumption.

[0028] Cache is a small but very fast memory located between the CPU and main memory. In this embodiment, the cache mentioned is the internal cache of the FPGA.

[0029] In practical applications, order books that record all buy and sell orders in financial markets are typically built using pure software. However, in high-frequency trading scenarios, the core of high-frequency trading is to capture instantaneous price differences in the market to meet the buying and selling needs of different users. Therefore, user-triggered trading instructions need to be completed within microseconds or even nanoseconds. Software implementation methods lead to longer construction times, severely impacting downstream business processing.

[0030] In view of this, this specification provides an FPGA-based order book data construction method. One or more embodiments of this specification also relate to an FPGA-based order book data construction system and an electronic device, which will be described in detail in the following embodiments.

[0031] This embodiment provides an FPGA-based order book data construction method that utilizes FPGAs to accelerate high-frequency trading processing. FPGAs offer ultra-high parallelism, high parallel processing capabilities, and low latency. By replacing traditional software with FPGAs for message processing, message processing time is compressed to the nanosecond level. Therefore, FPGAs enable hardware-level parallel computing, allowing for faster processing of market data and execution of trading decisions, significantly reducing trading latency. In high-frequency trading scenarios, this results in faster response times for trading decisions, enabling users to quickly capture anticipated price differences for trading. Furthermore, since the latency of an FPGA is deterministic, it eliminates jitter and provides predictable response times, thus avoiding performance fluctuations and ensuring that trading instructions are responded to and executed in an extremely short time.

[0032] Based on this, by analyzing the daily market data through code, it was found that most orders are close to being filled, meaning that almost all orders are placed within the optimal ten bid and ask prices. The cache read speed is only a few nanoseconds, while DDR / HBM reads take hundreds of nanoseconds; the cache read time is significantly shorter than the DDR / HBM read time. Based on these characteristics, the FPGA-based order book data construction method provided in this embodiment utilizes a combination of DDR / HBM and cache in the FPGA to support rapid order book data construction. The FPGA's cache maintains the optimal ten bid and ask prices, thereby accelerating access. When a new order appears, the corresponding market data can be sent to both DDR / HBM and the cache simultaneously. DDR / HBM stores the entire market data, while the cache only stores market data related to the optimal ten bid and ask prices. Downstream processing prioritizes searching for the corresponding price level information in the cache, directly reading and constructing the order book data corresponding to the order's market data. If a price level is missing in the cache due to order cancellation or other reasons, the cache can quickly read the corresponding data from the DDR / HBM within the FPGA because the DDR / HBM contains all the data. This maintains the optimal buy / sell price level table and enables the rapid construction of the order book to meet the high-speed trading needs of downstream users.

[0033] See Figure 1 , Figure 1 A flowchart of a first FPGA-based order book data construction method according to an embodiment of this specification is shown. This method is applied to a programmable logic component. The FPGA-based order book data construction provided in this embodiment can be applied to order book construction scenarios in securities, futures, and other trading businesses. By maintaining the optimal buy / sell price table through the cache of the programmable logic component and storing the full market information in memory, it achieves high-speed execution entirely in hardware, significantly improving the order book data construction speed, so that downstream processes can quickly respond to the constructed order book data for trading operations. Specifically, it includes the following steps.

[0034] Step S102: Obtain transaction market data and decode the transaction market data.

[0035] Specifically, programmable logic components refer to FPGAs; market data refers to the market data used to build order books in real time in securities or futures scenarios, including tick data and snapshot data. Snapshot data refers to fields used to record the trading status or market conditions at a specific point in time, such as yesterday's closing price, opening price, lowest price, highest price, etc. Tick data includes order data and transaction data, such as order quantity, order price, transaction volume, transaction amount, etc.

[0036] Decoding transaction data refers to processing transaction data according to the exchange's business encoding format to obtain individual data and / or snapshot data for each order, which is convenient for subsequent use.

[0037] Based on this, in order to improve the speed of order book data construction and reduce the impact of slow data access, this application proposes a pure hardware-based order book data construction scheme. After obtaining market data, the programmable logic component (PLC) first decodes the market data and then reassembles it according to a preset format to obtain market information. To support the rapid construction of order book data, the market information can be simultaneously sent to target memory and target cache. Target memory can directly store the market information, while the target cache, due to limited storage space, can detect whether market information needs to be stored, ensuring it can maintain data associated with specific data structures. Based on this, order book data can be constructed from the market information in the target cache. This achieves accelerated market data reading using the PLC's cache and supports data reading operations through the PLC's memory, thereby improving the speed of order book data construction while ensuring normal business operation. In trading scenarios, it facilitates downstream businesses in quickly responding to dynamically changing market conditions.

[0038] Furthermore, considering that the data obtained in a transaction scenario may come from different nodes, the obtained data can be preprocessed before being decoded according to a set protocol. In this embodiment, the specific implementation method is as follows: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain transaction market data; decode the transaction market data according to a binary protocol or information exchange protocol to obtain transaction-by-transaction data.

[0039] Specifically, multi-source heterogeneous data refers to data sent from multiple market data sources when inputting into programmable logic components, including various data types, thus requiring preprocessing. Preprocessing mainly involves filtering the multi-source heterogeneous data, removing non-trading market data, and deleting trading market data irrelevant to the final order book. For example, when building a securities order book, data such as government bond market data needs to be deleted beforehand. Correspondingly, the binary protocol and information exchange protocol refer to the exchange's business encoding format protocol; the binary protocol is called the Binary Protocol, and the information exchange protocol is called the FAST protocol (Financial Information eXchange).

[0040] In practice, the data is decoded according to the business encoding format of the exchange's securities market information to obtain the tick-by-tick market data. This can be accomplished by the decoding module in the FPGA, which does not cache data and can achieve full-speed data throughput. The decoded tick-by-tick data can then be reassembled to improve data processing efficiency.

[0041] Step S104: Reconstruct the decoded market data according to a preset format to obtain market information.

[0042] Specifically, the preset format refers to the format used for data reorganization of market data; correspondingly, market information refers to information such as price, quantity, starting storage address, maximum number of price increments, channel, security code, and time corresponding to each order.

[0043] Based on this, by reconstructing the decoded data, a one-to-one mapping of price and price increments can be completed according to the price and quantity of each order. By using information such as the starting storage address, maximum number of price increments, channel, security code, and time of market information, the storage addresses of each stock in the target memory DDR / HBM can be allocated, so that it can be used as index information when storing data later.

[0044] Furthermore, when decoding transaction data to obtain individual data, data reassembly can be performed only on individual data to obtain market information corresponding to each order, which can then be synchronously sent to the target cache and target memory for use in building the order book data.

[0045] In practical applications, data reconstruction processing for market data can be achieved through a reconstruction module in a programmable logic component. This module can reconstruct the structure of each field data output by the decoding module according to the output format to obtain market information for subsequent use.

[0046] Step S106: The market information is synchronously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache.

[0047] Specifically, the target memory refers to DDR / HBM in the programmable logic unit (PLU), and the target cache refers to the cache in the PLU. The read time of the target cache is significantly shorter than the read time of the target memory (cache reads in just a few nanoseconds, while DDR / HBM reads take hundreds of nanoseconds). Correspondingly, the order book data is the data used to construct the market data list, which is the table of best bid and ask prices that needs to be displayed on the user's end, such as a table of the top ten best bid and ask prices.

[0048] Therefore, after obtaining market information, to improve the speed of order book data construction, the market information can be synchronously stored in the target cache and target memory. This allows for the construction of order book data based on the market information in the target cache, enabling rapid response to downstream trading demands and delivery to the user end. This allows the user end to quickly build the corresponding order book data's trading market information list. Furthermore, when users require more market information, order book data with more price levels can be built based on the market information in the target memory, allowing the user end to view a more comprehensive trading market information list, meeting users' market information viewing needs in different scenarios. As shown in Table 1 below, after the order book data is constructed, it can be pushed to users and institutions for order book display, trading decisions, etc.

[0049] Table 1: Order Book Data

[0050] Furthermore, to improve the order book data construction speed by utilizing the combination of cache and memory in the FPGA hardware, market information can be synchronously sent to the target cache and target memory. Since the target cache has limited storage space, it is necessary to detect whether market information is stored in the target cache in real time. In this embodiment, the specific implementation is as follows: Check whether the market information meets the storage conditions of the target cache; if yes, store the market information synchronously in the target cache and the target memory; if no, store the market information in the target memory.

[0051] Specifically, the storage conditions refer to whether the market information falls within the scope of the target cache's maintained data. Based on this, after obtaining market information, it can be simultaneously sent to the target cache and target memory. However, since the target cache has limited storage space and cannot maintain all the data, the market information needs to be checked to see if it meets the target cache's storage conditions before being written to it. If it does, the market information falls within the target cache's maintained data scope and can be simultaneously stored in both the target cache and target memory, allowing downstream users to quickly read data directly from the target cache. If not, the target cache does not need to store the market information, so it can be stored only in target memory. When the target cache needs the data, it can then be read from target memory.

[0052] In other words, the FPGA hardware's cache and DDR / HBM synchronously receive market information. During write operations, market information can be directly written to the DDR / HBM. However, when writing to the cache, it's necessary to determine whether the price and quantity in the market information fall within the range of the optimal buy / sell order book maintained by the cache. If so, the information can be written; otherwise, it needs to be discarded. During subsequent order book data construction, data can be quickly read from the cache first. When the data in the optimal buy / sell order book maintained by the cache is insufficient, the corresponding data is then read from the DDR / HBM to complete the data, ensuring that the cache always maintains a complete optimal buy / sell order book. By fully utilizing the logic resources of the FPGA's cache and DDR / HBM, the entire construction process is implemented purely in hardware, accelerating order book construction. This avoids both the slowness issues of purely software implementations and the frequent hardware-software interactions inherent in combined hardware and software implementations.

[0053] In addition to the aforementioned detection and processing before writing data to the target cache, data detection and processing can also be performed after the market information is synchronously sent to both the target cache and the target memory and the write operation is completed. This can be understood as follows: after the current tick data is used to construct market information, it can be synchronously stored in both the target cache and the target memory. Since the target cache only maintains the optimal buy / sell level table (e.g., the optimal ten-level buy / sell table), if this data belongs to the optimal ten-level buy / sell table, it can be stored in the target cache and updated with the structured data of the optimal ten-level buy / sell table. Similarly, the structured data in the target memory will also be updated. However, if this data does not belong to the optimal ten-level buy / sell table, storing it in the target cache does not affect the table's structure and content. Therefore, this data can be synchronously stored in both the target cache and the target memory, and then released from the target cache (i.e., deleted from the target cache) to avoid consuming storage resources. The target memory, using a full storage strategy, will not release this data, so it can store this data and update the structured data.

[0054] In practice, for market information written to the target cache and target memory, it is possible to determine whether the market information needs to be written to the target cache before writing, or to determine whether the data needs to be released after writing. This ensures that data that does not belong to the target cache can be selectively discarded, thereby improving resource utilization and avoiding waste of cache storage resources.

[0055] Furthermore, after storing market information in the target cache, in order to support the subsequent rapid retrieval of data from the cache to build the order book, an optimal buy / sell price level table can be constructed. In this embodiment, the specific implementation is as follows: If the market information is successfully stored in the target cache, the market information stored in the target cache is analyzed; an optimal buy / sell price level table is constructed based on the analysis results, and order book data is obtained based on the optimal buy / sell price level table, wherein the price level elements of the optimal buy / sell price level table are more than or equal to the price level elements of the order book data.

[0056] Specifically, the optimal buy / sell price level table refers to a table structure that selects a certain number of price levels. For example, in a securities trading scenario, if it is necessary to construct an optimal buy / sell price level table, then 20 data points with the optimal buy / sell prices can be selected for construction, as shown in Table 2 below. It can be set according to actual needs, and this embodiment does not impose any limitations on it.

[0057] In the optimal buy / sell ten-level table, the higher the buy price, the higher the priority of the corresponding data, and the lower the sell price, the higher the priority of the corresponding data. The level information includes multiple level elements, which include level, quantity, and price, such as Buy 1 - 1000 transactions - 10.04 in Table 2.

[0058] Table 2: Optimal Buy / Sell Ten-Level Table

[0059] Based on this, in order to quickly build order book data by using the price level information stored in the target cache after the market information is successfully stored in the target cache, the data stored in the target cache can be analyzed, and the optimal buy / sell price level table can be built according to the analysis results. This enables the maintenance of the optimal buy / sell price level table through the target cache, and supports the direct reading of the structured data of the optimal buy / sell price level table from the target cache when order book data needs to be built, thereby improving the order book construction speed.

[0060] Furthermore, in actual processing, the optimal buy / sell price level table may experience missing levels due to order cancellations or complete executions. Therefore, the optimal buy / sell price level table can maintain more level elements than the order book data. For example, the final order book data may include 20 level elements from the top ten best buy / sell prices, but the optimal buy / sell price level table in the target cache can maintain the top fifteen best buy / sell prices (30 level elements). In this way, when a level is missing from the optimal buy / sell price level table in the target cache, it can be quickly filled without having to read the next level's element from the target memory, thus enabling faster construction of the order book data.

[0061] Furthermore, upon receiving new market information in real time, the cached data needs to be dynamically updated to ensure that the subsequently built order book is more accurate and meets current trading requirements. In this embodiment, the specific implementation is as follows: Receive target market information and determine the order price and quantity information corresponding to the target market information; If the order price information is associated with the optimal buy / sell price tier table and is not a newly added price, the structured data corresponding to the optimal buy / sell price tier table is updated according to the quantity information; When the order price information is associated with the optimal buy / sell tier table and is a newly added price, the tier element to be updated is determined based on the order price information and the quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier element to be updated. If the order price information and the quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, the candidate price element is read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell price table is updated based on the candidate price element. When the order price information and quantity information are associated with the optimal buy / sell tier table and the order is cancelled or fully executed, and the tier elements in the optimal buy / sell tier table are more than the tier elements in the order book data, the tier elements to be updated are determined based on the order price information and quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier elements to be updated; in the idle state or when the tier elements in the optimal buy / sell tier table are less than a set threshold, candidate tier elements are read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell tier table is updated based on the candidate tier elements. The order book data is constructed based on the updated structured data.

[0062] Specifically, target market information refers to newly received market information; order price information refers to the order price or transaction price recorded in the target market information; and quantity information refers to the number of buy or sell orders. Correspondingly, structured data refers to the data structure corresponding to the optimal buy / sell price table.

[0063] Correspondingly, the case where order price information is associated with the optimal buy / sell tier table and is a newly added type refers to order price information that is not in the original optimal buy / sell tier table, but belongs to the optimal buy / sell tier table and needs to be maintained. Tier elements to be updated refer to tier elements that need to be inserted and / or deleted in the current optimal buy / sell tier table. Tier elements include tier, price, and quantity.

[0064] Correspondingly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed—specifically, when the number of orders / executions (buy or sell) for a certain price level becomes 0—the corresponding price level element in the optimal buy / sell price table needs to be deleted. However, to ensure the integrity of the price level count, the price level elements need to be replenished. The replenished price level elements are the candidate price level elements, and these candidate price level elements are read from the target memory.

[0065] Correspondingly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, and the optimal buy / sell price table has more price elements than the order book data, specifically when the order cancellation or full execution causes the order / execution (buy or sell) for a certain price level to become 0, the corresponding price element in the optimal buy / sell price table needs to be deleted. Since the optimal buy / sell price table has more price elements than the order book data, it can be filled by the next price element in the optimal buy / sell price table. Price elements to be updated refer to those that need to be adjusted and / or deleted in the current optimal buy / sell price table. Price elements include price, price, and quantity. Idle state refers to situations where no new market information is received, or the new market information is not for that stock, or other situations that do not affect the current processing speed of the target memory and target cache. In the idle state, or when the optimal buy / sell price table has fewer than a set threshold of price elements, a certain number of candidate price elements can be read from the target memory and stored in the target cache.

[0066] Based on this, considering that the order book displayed at this time is built based on the price level information in the target cache, and that new market information will cause changes to the order book, it is necessary to determine the order price information and quantity information corresponding to the target market information. Then, the order price information and quantity information can be combined to determine how to update the order book data to match the current transaction operation.

[0067] Firstly, if the optimal buy / sell price table associated with the order price information is determined based on the order price information and it is not a newly added price, it means that the order price associated with the target market information is within the price range included in the optimal buy / sell price table and is the same as the price of one of the price levels, but the number of transactions has changed. For example, the original number of sell orders for price A in the list was 10,000, and the new market information added an order for this transaction with a number of 1,000, so the original number of orders needs to be updated.

[0068] Secondly, when the order price information is associated with the optimal buy / sell price level table and the order price information is a newly added type, the order price corresponding to the target market information is located between the first and last prices in the optimal buy / sell price level table, and is not equal to the price already recorded in the table. Therefore, it is necessary to rebuild the optimal buy / sell price level table. First, determine the price level elements to be inserted and the price level elements to be deleted based on the target market information. Then, update the structured data corresponding to the optimal buy / sell price level table based on the price level elements to be updated. This can be understood as inserting new price level elements and deleting old price level elements from the table that exceed the set price level requirements, such as removing the price level element with the lowest buy price or the price level element with the highest sell price. In this way, the updated structured data can be used to build order book data.

[0069] Thirdly, if the order price and quantity information are associated with the optimal buy / sell price table and the order is either cancelled or fully executed, it means that the order / execution (buy or sell) for a certain price level has been cancelled to 0. The corresponding price level element in the optimal buy / sell price table needs to be deleted. However, to ensure the integrity of the price level count, the price level elements need to be replenished. In this embodiment, because the target memory contains all market data, the target cache can directly read the required candidate price level information from memory and insert this candidate price level information into the corresponding position in the optimal buy / sell price table, thereby maintaining a complete optimal buy / sell price table.

[0070] Fourthly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, if the number of price elements in the optimal buy / sell price table exceeds the number of price elements in the order book data, the next price element in the optimal buy / sell price table can be used to fill the gap. In idle states, or when the number of price elements in the optimal buy / sell price table is less than a set threshold, a certain number of candidate price elements are read from the target memory and stored in the target cache. For example, if the order book data requires 20 price elements for the tenth optimal price level, and the optimal buy / sell price table contains 30 price elements for the fifteenth optimal price level, when the third sell order in the optimal buy / sell price table is cancelled to 0, the fourth sell order can be directly updated to the third, and the subsequent price elements can be updated sequentially, without needing to read the eleventh price element from the target memory. This continues until the fifteenth optimal price level is less than the set threshold, such as when only the tenth optimal price level remains. In this case, the eleventh to fifteenth optimal buy / sell price elements can be read from the target memory as candidate price elements, stored in the target cache, and the optimal buy / sell price table updated. Of course, in an idle state, such as when there are no new orders or when the new orders are for other stocks, a certain number of candidate position elements can be read from the target memory and stored in the target cache.

[0071] In practical implementation, after the FPGA synchronously sends market information to the cache module, the cache module calculates, stores, and maintains a table of optimal bid and ask prices, as shown in Table 2. The structure corresponding to this table can then be built based on the data in the cache, ensuring rapid updates when orders or trades are received in real time. If the order price is outside the top ten bid and ask prices, no update to the order book data is needed. If the order price is within the top ten bid and ask prices and matches one of them, only the order volume corresponding to that price needs to be updated. If the order price is within the top ten bid and ask prices but not recorded in the table, a new price level is added, and levels that do not meet the list requirements are removed, reconstructing a new list. When an order is cancelled or fully executed, the price of the corresponding level is deleted, and the new level element is read from the DDR / HBM and inserted into the corresponding position in the top ten bid and ask table, reconstructing a new list. If the number of price levels in the cache (15 levels for buy and sell) exceeds the number of price levels required by the order book (10 levels for buy and sell), when an order is cancelled or fully executed, the price of the corresponding price level is deleted, and the price level of the next price level in the cache is sequentially promoted until the number of price levels in the cache is less than a certain number or is in an idle state. Then, the new price level is read from DDR / HBM, inserted into the corresponding position in the optimal buy and sell price level table, and a new list is reconstructed to generate price level information with higher real-time performance and accuracy.

[0072] For example, in a securities trading scenario, after the trading data for a stock is submitted to the FPGA, the market information is constructed through data decoding and reconstruction, and then synchronously sent to the DDR / HBM and cache. Based on this, to improve the speed of order book generation on the user's end during centralized and continuous bidding phases, a table of the top ten best bid and ask prices for the stock can be maintained in the cache. This table records the prices and quantities corresponding to buy 1 to buy 10, and the prices and quantities corresponding to sell 1 to sell 10. Simultaneously, a structure for the top ten best bid and ask prices table is constructed, allowing for the rapid generation of the top ten bid and ask prices for the stock based on the structure in the cache.

[0073] Furthermore, upon receiving new order data, it's necessary to determine the corresponding buy / sell price and transaction quantity. If the buy / sell price is not within the price range of the list, the cached structure does not need to be updated. If the buy / sell price is within the price range of the list and matches a price in the list (e.g., a buy price of 10.02, corresponding to the third-tier buy price in the list), the transaction quantity can be added to the transaction quantity corresponding to the third-tier buy price, thus updating the tier information in real time. If the buy price is within the price range of the list but differs from prices included in the list (e.g., a buy price of 10.00, not included in the list, and the lowest buy price is 9.95), then the buy price of 10.00 and its corresponding transaction quantity can be inserted into the list, while the price and quantity corresponding to 9.95 are deleted, updating the tier information in real time.

[0074] Furthermore, if a new order cancellation is received, the corresponding buy / sell price and transaction quantity need to be determined. If the buy / sell price is not within the price range of the list, the cached structure does not need to be updated. If the buy / sell price is within the price range of the list, and the transaction quantity becomes 0 (e.g., the buy price is 10.02, corresponding to the third buy price in the list, and the buy quantity is 700; after the order cancellation, the buy quantity for that price level changes to 0), then the price level element needs to be deleted, the price level element of 9.96 read from DDR / HBM is inserted into the last price level of the buy order book, and the price levels are reordered to obtain the updated price level information. If the cache already has the price level element of 9.96, the price level information can be updated directly without reading from DDR / HBM.

[0075] In summary, such as Figure 2aThe schematic diagram illustrates the FPGA-based order book data construction method provided in this embodiment. After the exchange / brokerage submits multi-source heterogeneous data to the FPGA, to improve the order book data construction speed and reduce the impact of slow data access, the multi-source heterogeneous data is first filtered to remove transaction market data irrelevant to the final order book. The transaction market data is then obtained based on the filtering results. This transaction market data is then decoded to obtain individual data, which is then reassembled to obtain the market information for each corresponding order. To support the rapid construction of the order book data, the market information can be simultaneously sent to the cache and DDR / HBM. Since the cache has limited storage space, it can detect whether the market information needs to be stored, allowing the cache to maintain data associated with specific data structures. Based on this, the order book data can be quickly constructed from the market information in the cache. This achieves accelerated market data reading using the FPGA's cache and supports data reading operations via the FPGA's DDR / HBM, thereby improving the order book data construction speed while ensuring normal business operation. In trading scenarios, this allows downstream businesses to respond more quickly to dynamically changing market conditions.

[0076] Furthermore, considering the limited storage resources of the target cache in the FPGA, to better improve hardware resource utilization, the market information can be divided into first market information and second market information after data reorganization. The target cache stores only the first market information, while the second market information can be read and used when constructing the order book data. In this embodiment, the specific implementation is as follows: When the market information includes first market information and second market information, the first market information is simultaneously sent to the target memory and the target cache, and gear information is constructed based on the first market information in the target cache; the gear information is read from the target cache, and the gear information and the second market information are assembled to construct order book data.

[0077] Specifically, the first market data includes the price, quantity, starting storage address, and maximum number of price levels for each order. The second market data includes the channel, security code, and time for each order. It can be understood that information with a lower update frequency or that does not require real-time updates is the second market data, while information with a higher update frequency or that requires real-time updates is the first market data. Correspondingly, price level information specifically refers to information composed of one or more price level elements. It can be understood that price level information only maintains information such as the price, price level, and quantity of a particular stock; information such as the stock name is not considered price level information.

[0078] Based on this, after reconstructing the decoded market data according to a preset format, the first and second market data are obtained. To conserve storage resources in the target cache, the first market data can be simultaneously sent to the target memory and the target cache. This process can be understood as follows: by reconstructing the decoded data item by item, a one-to-one mapping between price and price increments can be achieved based on the price and quantity of each order. The starting storage address and maximum number of price increments of the first market data can be used to allocate storage addresses for each stock in the target memory (DDR / HBM), facilitating subsequent data storage as index information. The reconstructed first market data, once input into the target cache, can be directly stored in the corresponding list without further reconstruction, allowing for direct retrieval and use. The second market data can include information such as channel, security code, order time, transaction time, and market category. Therefore, the second market data does not need to enter the target memory and target cache; it can be directly combined with the real-time price increment information in the target cache to assemble the order book data.

[0079] Furthermore, since the price level information is the information corresponding to different buy and sell price levels in each transaction, and the second market information is the stock, time, channel, and other information of that transaction, after constructing the price level information based on the first market information in the target cache, the price level information and the second market information can be assembled through a preset assembly protocol, so that the final order book data can be obtained based on the assembly result.

[0080] In practical implementation, considering that each transaction's data, after being reassembled, will yield first and second market information, and that the first market information will be simultaneously sent to the target cache and target memory, while the second market information is still a necessary element in forming the order book data, after obtaining the second market information order book, it can be stored in the module that assembles the gear position information and market information, such as... Figure 2b The diagram shows that the second market information can be stored in the assembly module. After reading the gear information from the cache, it can be directly assembled with the second market information stored in the assembly module to obtain order book data for subsequent sending to the user terminal.

[0081] In summary, by dividing market information into first market information and second market information after data reorganization, and only sending the first market information to the target cache and target memory simultaneously, the storage resources of the target cache can be effectively saved, without affecting the order book data construction speed, thus ensuring the transaction needs of users.

[0082] In practical applications, the A-share market processes data by sending a snapshot every 3 seconds. This can be understood as summarizing the highest price, lowest price, and trading volume within that 3-second period into a single snapshot and sending it to downstream systems. In this example, the preprocessed market data includes both real-time tick-by-tick data and snapshot data sent every 3 seconds. Therefore, there's a possibility that the snapshot data might be output to the user's end faster than the order book data at some point. To more quickly build the order book data, the snapshot data and the order book data can be compared and the faster data selected to synthesize the optimal order book data. The specific implementation method is as follows: Based on the decoding results, the step-by-step data and snapshot data are determined, and the data is reorganized according to a preset format to obtain market information. The market information is then synchronously sent to the target memory and the target cache, and the order book data is constructed based on the market information in the target cache. During the data sending phase, the order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

[0083] Specifically, the data transmission phase refers to the stage of sending order book data to the user's end. Correspondingly, comparing order book data and snapshot data can be understood as comparing the transaction volume, transaction price, and / or number of transactions contained in the order book data and snapshot data, respectively. The transaction volume, transaction price, and / or number of transactions indicate which data better matches the real-time market conditions. In other words, since order transaction information is incremental, the larger the transaction volume, transaction price, and / or number of transactions recorded in the order book data and snapshot data for a given order, the closer it is to the real-time market conditions.

[0084] Based on this, and combined with the snapshot data sending logic, after obtaining the transaction-by-transaction data and snapshot data, the transaction-by-transaction data can be further reassembled and synchronously sent to the target cache. After constructing the real-time order book data corresponding to the current stage from the transaction-by-transaction data, there may be two situations: one is that the snapshot data is the latest snapshot data issued at the current moment, in which case the snapshot data may be able to send real-time market data to the user faster and more accurately than the order book data; the other is that the snapshot data is snapshot data that has been issued for more than a set time period and has not been updated, in which case the order book data may be able to send real-time market data to the user faster and more accurately. Therefore, during the data sending stage, the order book data and snapshot data can be compared, and the optimal order book data can be determined based on the comparison results before being sent to the user.

[0085] See Figure 2cThe diagram shows that after decoding the transaction data and snapshot data, the transaction data is reassembled inside the FPGA until the order book data is obtained, while the snapshot data can be directly sent to the user. In order to send the optimal order book data to the user, the order book data and the snapshot data corresponding to the current moment can be compared. The optimal order book data is determined based on the comparison result and sent to the user to display the latest and most accurate trading information.

[0086] Furthermore, since the optimization processing of order book data and snapshot data occurs before the order book data is sent to the user terminal, the optimization process does not affect the FPGA's internal process of reconstructing data item by item and then splitting the market information into first and second market information for separate processing. In other words, see [link to relevant documentation]. Figure 2d The diagram illustrates that after decoding the transaction-by-transaction data and snapshot data, the transaction-by-transaction data is reassembled to obtain first market data and second market data. The first market data is simultaneously sent to DDR / HBM and cache. At this point, price level information can be constructed based on the first market data in the cache. Then, the price level information and second market data can be combined to obtain order book data. Finally, the snapshot data and order book data can be compared to determine the optimal order book data to be sent to the user. All details not described in detail herein can be found in the same or corresponding descriptions above, and will not be elaborated upon further in this embodiment.

[0087] Furthermore, to improve the overall data processing speed, a multi-path setup can be implemented to process the preprocessing, decoding, reassembly, and gear information construction of each data source in parallel. Finally, the multi-path data is aggregated into a unified order book. The specific implementation method is as follows: The process involves acquiring multi-source heterogeneous data, splitting the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams, using each multi-source heterogeneous sub-data stream as the multi-source heterogeneous data, and performing preprocessing on the multi-source heterogeneous data to obtain market data. This process continues until the order book data construction stage, where the corresponding order book sub-data stream for each stream is determined, and the corresponding order book sub-data streams for each stream are merged to obtain the order book data.

[0088] Specifically, at least two complementary multi-source heterogeneous sub-data streams refer to the multi-source heterogeneous data being split according to a set rule, resulting in independent and separately processable sub-data streams that do not affect each other. These sub-data streams are then processed individually through different pathways. Correspondingly, the order book data is the order book data obtained after processing each multi-source heterogeneous data stream through its corresponding pathway. The order book data from each pathway is then concatenated to form the final order book data. The processing procedure for each order book data stream can be found in the above description of the FPGA-based order book data construction process; this embodiment does not impose any limitations on it.

[0089] See Figure 2e As shown in the diagram, after acquiring multi-source heterogeneous data, the multi-source heterogeneous data can be split into at least two complementary multi-source heterogeneous sub-data streams. Then, each multi-source heterogeneous sub-data stream will be filtered, decoded, and reassembled. After obtaining the market data sub-information corresponding to its own channel, the market data sub-information can be synchronously sent to the cache and DDR / HBM corresponding to its own channel. This allows the construction of the order book sub-data corresponding to that channel based on the market data sub-information in the cache. After the order book data is constructed for each channel, the order book data can be obtained by summarizing them.

[0090] Furthermore, to accelerate the construction of order book sub-data for each channel and save cache storage resources in each channel, after the reorganization process for each channel, the market information can be split into first market information and second market information. See [link / reference]. Figure 2f As shown in the diagram, the first line sub-information in any path is simultaneously sent to DDR / HBM and cache. At this point, the corresponding gear information for that path can be constructed based on the first line sub-information in the cache. Then, the gear information and the second line sub-information can be combined to obtain the order book sub-data for that path. The order book data for each path can then be aggregated to obtain the order book data for subsequent processing. After obtaining the order book data, it can also be compared with snapshot data to perform optimal selection processing, enabling the sending of the optimal order book data to the user terminal. All details not described in detail herein can be found in the same or corresponding descriptions above; this embodiment will not elaborate further.

[0091] Furthermore, in order to provide users with more accurate and real-time order book data, compensation can be applied to relevant order elements in the event of packet loss. In this embodiment, the specific implementation is as follows: If the target market information is in a packet loss state and related market information is received, determine the related price level element corresponding to the related market information in the structured data corresponding to the optimal buy / sell price level table; if the structured data meets the data update conditions based on the related market information and the related price level element, delete and / or adjust the related price level element in the structured data, and construct the order book data based on the deletion and / or adjustment results.

[0092] Specifically, related market information refers to market information received after the target market information; related price range elements refer to the price range elements corresponding to the related market information; and data update conditions refer to the conditions under which abnormal data occurs in the related price range elements due to packet loss. In this case, it is necessary to delete and / or adjust the related price range elements to achieve packet loss compensation, so that the order book data can still quickly display accurate market information.

[0093] Therefore, when packet loss occurs during order book data synthesis, the prices and quantities in the optimal buy / sell price table will be inaccurate. However, continuous bidding requires rapid execution. When packets are lost at certain price levels, the order book price information after the packet loss can be calculated using a cache, and compensation can be made by refreshing the subsequent buy / sell price levels. However, there are cases where the quantity at a certain price level is negative or there is a skipped price level execution after the calculation and synthesis. When the quantity is negative or there is a skipped price level execution, in order to avoid affecting the rapid construction of order book data, related price level elements can be deleted and / or adjusted from the structured data, and the order book data can be constructed based on the deletion and / or adjustment results.

[0094] For example, the partial order book data corresponding to the current moment is shown in Table 3 below: Table 3: Normal Order Book File Elements

[0095] If the newly received market data is in the following order: Cancellation (10700), New Order (9600), Order Execution (11300), Execution (9900), then the generated order book data without packet loss is shown in Table 4 below: Table 4: Order Book Item Element Without Packet Loss

[0096] Based on this, if the order is cancelled (10700), the new order (9600) is lost, and the subsequent order is executed (11300), and the transaction is completed (9900). The order book data generated after the loss is shown in Table 5 below: Table 5: Order Book Item Elements of Packet Loss

[0097] Therefore, when it is found that the sell order at level 2 (11 300) was successfully executed, according to market trading logic, it means that a sell order at level 1 was canceled or executed, but the data may have been lost. To ensure the accuracy of the order book data, it is necessary to delete and / or adjust the related level elements, that is, delete the original sell order at level 1 (10 700), and adjust the latest transaction (11500) - (11300) = (11200) to the new sell order at level 1, and then adjust the level elements after the new sell order at level 1 in turn. In addition, when it is found that the quantity of buy order at level 1 (9-300) becomes negative, it means that a new order at level 1 was lost. At this time, it is necessary to delete the level 1, adjust the original buy order at level 2 (8400) to the new buy order at level 1, and then adjust the level elements after the new buy order at level 1 in turn. The order book data after the data loss compensation is shown in Table 6 below.

[0098] Table 6: Order Book File Elements After Packet Loss Compensation

[0099] It should be noted that although the compensated buy price (8400) after packet loss differs from the actual buy price (9300) in the order book without packet loss, the continuous bidding phase aims for a transaction. When the actual transaction price reaches buy price (8400), the corresponding price level will automatically refresh to maintain the latest data, thus ensuring the accuracy of the order book data. In other words, through the above packet loss compensation steps, it is possible to ensure that even if a packet is lost at a certain point in time, the correct price level can be quickly compensated by continuously and dynamically updating the sell and buy prices, thus improving the accuracy and real-time performance of the order book data.

[0100] See Figure 3 , Figure 3 A flowchart is shown of a second FPGA-based order book data construction method according to an embodiment of this specification, which is applied to a programmable logic component and specifically includes the following steps.

[0101] Step S302: Obtain transaction market data and decode the transaction market data.

[0102] This embodiment describes a second FPGA-based order book data construction method. Any content not described in detail can be found in the same or corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.

[0103] Furthermore, considering that the data obtained in a transaction scenario may come from different nodes, the obtained data can be preprocessed before being decoded according to a set protocol. In this embodiment, the specific implementation method is as follows: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain market data; decode the market data according to a binary protocol or information exchange protocol to obtain transaction-by-transaction data. Based on this, reassemble the decoded market data according to a preset format to obtain first market information and second market information, including: reassembling the transaction-by-transaction data according to a preset format to obtain first market information and second market information.

[0104] Specifically, multi-source heterogeneous data refers to data input into programmable logic components from multiple market data sources, including various data types, thus requiring preprocessing. Preprocessing involves filtering the multi-source heterogeneous data, removing non-trading market data, and deleting trading market data irrelevant to the final order book. For example, when building a securities order book, data such as government bond market data needs to be deleted beforehand. Correspondingly, the binary protocol and information exchange protocol refer to the exchange's business encoding format protocol; the binary protocol is called the Binary Protocol, and the information exchange protocol is called the FAST protocol (Financial Information eXchange).

[0105] In practice, the data is decoded according to the business encoding format of the exchange's securities market information to obtain the tick-by-tick market data. This can be accomplished by the decoding module in the FPGA, which does not cache data and can achieve full-speed data throughput. The decoded tick-by-tick data can then be reassembled to improve data processing efficiency.

[0106] Step S304: Reconstruct the decoded market data according to a preset format to obtain first market information and second market information.

[0107] Specifically, the preset format refers to the format used for data reorganization processing of trading market data. The first market information includes the price, quantity, starting storage address, and maximum number of price increments for each order. The second market information includes information such as the channel, security code, and time of each order.

[0108] By reconstructing the decoded, transaction-by-transaction data, a one-to-one mapping between price and price tiers can be established based on the price and quantity of each order. Using the starting storage address and maximum number of price tiers for the first market data, the storage addresses for each stock in the target memory (DDR / HBM) can be allocated, facilitating subsequent data storage as index information. The reconstructed first market data, once input into the target cache, can be directly stored in the corresponding list without further reconstruction, allowing for direct retrieval and use when needed.

[0109] The second market information may include information such as channel, security code, order time, transaction time, and market category. The second market information does not need to be entered into the target memory and target cache. It can be directly combined with the real-time price information in the target cache to assemble the order book data.

[0110] In practical applications, the data reconstruction processing for market data can be achieved through the reconstruction module in the programmable logic component. It can reconstruct the structure of each field data output by the decoding module according to the output format to obtain the first market information and the second market information.

[0111] Step S306: The first market information is synchronously sent to the target memory and the target cache, and the price level information is constructed based on the first market information in the target cache.

[0112] Specifically, the target memory is the DDR / HBM in the programmable logic component, and the target cache is the cache in the programmable logic component. The read time of the target cache is much shorter than the read time of the target memory (the cache read speed is only a few nanoseconds, while the DDR / HBM read takes hundreds of nanoseconds).

[0113] Furthermore, to improve the order book construction speed by utilizing the combination of cache and memory in the FPGA hardware, the first market data can be simultaneously sent to the target cache and target memory. Since the target cache has limited storage space, it is necessary to detect whether the first market data is stored in the target cache in real time. In this embodiment, the specific implementation is as follows: Detect whether the first market information meets the storage conditions of the target cache; if yes, store the first market information synchronously in the target cache and the target memory; if no, store the first market information in the target memory.

[0114] Specifically, the storage conditions refer to whether the first market data falls within the scope of the target cache's maintained data. Based on this, after obtaining the first market data, it can be simultaneously sent to the target cache and target memory. However, since the target cache has limited storage space and cannot maintain all the data, the first market data needs to be checked to see if it meets the target cache's storage conditions before being written to it. If it does, it means the first market data falls within the scope of the target cache's maintained data, and it can be simultaneously stored in both the target cache and target memory, allowing downstream data to be quickly read directly from the target cache. If not, it means the target cache does not need to store the first market data, so it can be stored only in target memory, and read from target memory when the target cache needs the data.

[0115] In other words, the FPGA hardware's cache and DDR / HBM synchronously receive the first market data. During writing, the first market data can be directly written to the DDR / HBM, while writing to the cache requires checking whether the price and quantity in the first market data are within the range of the optimal buy / sell price table maintained by the cache. If so, it can be written; otherwise, it needs to be discarded. When building subsequent order book data, data can be quickly read from the cache first. When the data in the optimal buy / sell price table maintained by the cache is insufficient, the corresponding data is then read from the DDR / HBM to complete the table, ensuring that the cache always maintains a complete optimal buy / sell price table. By fully utilizing the logic resources of the FPGA's cache and DDR / HBM, the entire construction process is implemented purely in hardware, accelerating order book construction. This avoids both the slowness issues of purely software implementations and the frequent hardware-software interactions associated with combined hardware and software implementations.

[0116] Furthermore, after storing the initial market data in the target cache, in order to support the subsequent rapid retrieval of data from the cache to construct the order book, an optimal buy / sell price level table can be constructed. In this embodiment, the specific implementation is as follows: If the first market information is successfully stored in the target cache, the data stored in the target cache is analyzed, and an optimal buy / sell level table is constructed based on the analysis results. Level information is obtained based on the optimal buy / sell level table, wherein the level elements of the optimal buy / sell level table are more than or equal to the level elements of the level information.

[0117] Specifically, the optimal buy / sell price level table refers to a table structure that selects a certain number of price levels. For example, in a securities trading scenario, if an optimal ten-price buy / sell price level table needs to be constructed, 20 data points with the best buy / sell prices can be selected for construction, as shown in Table 2 above. This can be set according to actual needs, and this embodiment does not impose any limitations. In the optimal ten-price buy / sell price level table, the higher the buy price, the higher the priority of the corresponding data; the lower the sell price, the higher the priority of the corresponding data. Price level information includes multiple price level elements, which include price level, quantity, and price, such as in Table 2, Buy 1—1000 transactions—10.04.

[0118] Based on this, once the first market information is successfully stored in the target cache, in order to quickly complete the order book data construction using the price level information stored in the target cache, the data stored in the target cache can be analyzed. Based on the analysis results, an optimal buy / sell price level table can be constructed. This allows the target cache to maintain the optimal buy / sell price level table, and when order book data needs to be constructed, the structured data of the optimal buy / sell price level table can be directly read from the target cache as price level information for subsequent order book data construction, thereby improving the speed of order book data construction.

[0119] Furthermore, in actual processing, the optimal buy / sell price level table may experience missing price levels due to order cancellations or complete executions. Therefore, the optimal buy / sell price level table can maintain more price level elements than the price level information itself. For example, the final order book data, based on price level information, may include 20 price level elements from the ten optimal buy / sell price levels, while the optimal buy / sell price level table in the target cache can maintain fifteen optimal buy / sell price levels (30 price level elements). In this way, when a price level is missing from the optimal buy / sell price level table in the target cache, it can be quickly filled in without needing to read the next price level element from the target memory, thus enabling faster construction of the order book data.

[0120] Furthermore, upon receiving new market information in real time, the cached data needs to be dynamically updated to ensure that the subsequently built order book data is more accurate and meets current trading requirements. In this embodiment, the specific implementation is as follows: Receive target market information and determine the order price and quantity information corresponding to the target market information; If the order price information is associated with the optimal buy / sell price tier table and is not a newly added price, the structured data corresponding to the optimal buy / sell price tier table is updated according to the quantity information; When the order price information is associated with the optimal buy / sell tier table and is a newly added price, the tier element to be updated is determined based on the order price information and the quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier element to be updated. If the order price information and the quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, the candidate price element is read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell price table is updated based on the candidate price element. When the order price information and quantity information are associated with the optimal buy / sell tier table and the order is cancelled or fully executed, and the tier elements in the optimal buy / sell tier table are more than the tier elements in the tier information, the tier elements to be updated are determined based on the order price information and the quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier elements to be updated; in an idle state or when the tier elements in the optimal buy / sell tier table are less than a set threshold, candidate tier elements are read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell tier table is updated based on the candidate tier elements. Use the updated structured data as gear information.

[0121] Specifically, target market information refers to newly received market information; order price information refers to the order price or transaction price recorded in the target market information; and quantity information refers to the number of buy or sell orders. Correspondingly, structured data refers to the data structure corresponding to the optimal buy / sell price table.

[0122] Correspondingly, the case where order price information is associated with the optimal buy / sell tier table and is a newly added type refers to order price information that is not in the original optimal buy / sell tier table, but belongs to the optimal buy / sell tier table and needs to be maintained. Tier elements to be updated refer to tier elements that need to be inserted and / or deleted in the current optimal buy / sell tier table. Tier elements include tier, price, and quantity.

[0123] Correspondingly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed—specifically, when the number of orders / executions (buy or sell) at a certain price level becomes 0—the corresponding price level element needs to be deleted from the optimal buy / sell price table. However, to ensure the integrity of the price level count, the price level elements need to be replenished. The replenished price level elements are the candidate price level elements, and these candidate price level elements are read from the target memory.

[0124] Correspondingly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, and the optimal buy / sell price table has more price elements than the price information, specifically, due to order cancellation or full execution, the order / execution (buy or sell) for a certain price level becomes 0, requiring the deletion of the corresponding price element in the optimal buy / sell price table. Since the optimal buy / sell price table has more price elements than the order book data, it can be filled by the price element of the next price level in the optimal buy / sell price table. Price elements to be updated refer to price elements that need to be adjusted and / or deleted in the current optimal buy / sell price table. Price elements include price, price, and quantity. Idle state refers to the situation where no new market information is received, or the new market information is not for that stock, or other situations that do not affect the current processing speed of the target memory and target cache. In the idle state, or when the number of price elements in the optimal buy / sell price table is less than a set threshold, a certain number of candidate price elements can be read from the target memory and stored in the target cache.

[0125] Based on this, considering that the order book displayed at this time is built based on the price level information in the target cache, and that new market information will cause changes to the order book, it is necessary to determine the order price information and quantity information corresponding to the target market information. Then, the order price information and quantity information can be combined to determine how to update the price level information to match the current trading operation.

[0126] Firstly, if the optimal buy / sell price table associated with the order price information is determined based on the order price information and it is not a newly added price, it means that the order price associated with the target market information is within the price range included in the optimal buy / sell price table and is the same as the price of one of the price levels, but the number of transactions has changed. For example, the original number of sell orders for price A in the list was 10,000, and the new market information added an order for this transaction with a number of 1,000, so the original number of orders needs to be updated.

[0127] Secondly, when the order price information is associated with the optimal buy / sell price level table and the order price information is a newly added type, the order price corresponding to the target market information is located between the first and last prices in the optimal buy / sell price level table, and is not equal to the price already recorded in the table. Therefore, it is necessary to rebuild the optimal buy / sell price level table. First, the price level elements to be inserted and the price level elements to be deleted can be determined based on the target market information. Then, the structured data corresponding to the optimal buy / sell price level table can be updated based on the price level elements to be updated. This can be understood as inserting new price level elements and deleting old price level elements that exceed the set price level requirements from the table, such as removing the price level element with the lowest buy price or the price level element with the highest sell price. Thus, the updated structured data can be used as price level information.

[0128] Thirdly, if the order price and quantity information are associated with the optimal buy / sell price table and the order is either cancelled or fully executed, it means that the order / execution (buy or sell) for a certain price level has been cancelled to 0. The corresponding price level element in the optimal buy / sell price table needs to be deleted. However, to ensure the integrity of the price level count, the price level elements need to be replenished. In this embodiment, because the target memory contains all market data, the target cache can directly read the required candidate price level information from memory and insert this candidate price level information into the corresponding position in the optimal buy / sell price table, thereby maintaining a complete optimal buy / sell price table.

[0129] Fourthly, when order price and quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, if the number of price elements in the optimal buy / sell price table exceeds the number of price elements in the price information, the next price element in the optimal buy / sell price table can be used to fill the gap. In idle states, or when the number of price elements in the optimal buy / sell price table is less than a set threshold, a certain number of candidate price elements are read from the target memory and stored in the target cache. For example, if the price information requires 20 price elements for the tenth optimal price level, and the optimal buy / sell price table contains 30 price elements for the fifteenth optimal price level, when the third sell order in the optimal buy / sell price table is cancelled to 0, the fourth sell order can be directly updated to the third, and the subsequent price elements can be updated sequentially, without needing to read the eleventh price element from the target memory. This continues until the number of the fifteenth optimal price level is less than the set threshold, such as when only the tenth optimal price level remains. In this case, the eleventh to fifteenth optimal buy / sell price elements can be read from the target memory as candidate price elements, stored in the target cache, and the optimal buy / sell price table updated. Of course, in an idle state, such as when there are no new orders or when the new orders are for other stocks, a certain number of candidate position elements can be read from the target memory and stored in the target cache.

[0130] In practical implementation, after the FPGA synchronously sends the first market information to the cache module, the cache module calculates, stores, and maintains a table of optimal bid and ask prices, as shown in Table 2. The structure corresponding to this table can then be built based on the data in the cache, ensuring rapid updates when orders or trades are received in real time. If the order price is outside the ten bid and ask prices, no update to the order book data is needed. If the order price is within the ten bid and ask prices and matches one of the prices, only the order volume corresponding to that price needs to be updated. If the order price is within the ten bid and ask prices but not recorded in the table, a new price level needs to be added, and levels that do not meet the list requirements need to be removed, reconstructing a new list. When an order is cancelled or fully executed, the price of the corresponding level is deleted, and the new level element is read from the DDR / HBM and inserted into the corresponding position in the ten-level bid and ask table, reconstructing a new list. If the number of price levels in the cache (15 levels) exceeds the number of price levels required for the price information (10 levels), when an order is cancelled or fully executed, the price of the corresponding price level is deleted, and the price level of the next price level in the cache is sequentially promoted until the number of price levels in the cache is less than a certain number or is in an idle state. Then, the new price level is read from DDR / HBM, inserted into the corresponding position in the optimal buy / sell price level table, and a new list is reconstructed to generate price information with higher real-time performance and accuracy.

[0131] For example, in a securities trading scenario, after the trading data for a stock is submitted to the FPGA, it is decoded and reconstructed to build first and second market data. The first market data is then synchronously sent to the DDR / HBM and cache. Building upon this, to improve the speed of order book generation on the user's end during centralized and continuous bidding phases, a table of the ten best bid and ask prices for the stock can be maintained in the cache. This table records the prices and quantities corresponding to buy 1 to buy 10, and sell 1 to sell 10, respectively. Simultaneously, a structure for the ten best bid and ask prices table is constructed, allowing for the rapid generation of the ten bid and ask prices for the stock based on the cached structure.

[0132] Furthermore, upon receiving new order data, it's necessary to determine the corresponding buy / sell price and transaction quantity. If the buy / sell price is not within the price range of the list, the cached structure does not need to be updated. If the buy / sell price is within the price range of the list and matches a price in the list (e.g., a buy price of 10.02, corresponding to the third-tier buy price in the list), the transaction quantity can be added to the transaction quantity corresponding to the third-tier buy price, thus updating the tier information in real time. If the buy price is within the price range of the list but differs from prices included in the list (e.g., a buy price of 10.00, not included in the list, and the lowest buy price is 9.95), then the buy price of 10.00 and its corresponding transaction quantity can be inserted into the list, while the price and quantity corresponding to 9.95 are deleted, updating the tier information in real time.

[0133] Furthermore, if a new order cancellation is received, the corresponding buy / sell price and transaction quantity need to be determined. If the buy / sell price is not within the price range of the list, the cached structure does not need to be updated. If the buy / sell price is within the price range of the list, and the transaction quantity becomes 0 (e.g., the buy price is 10.02, corresponding to the third buy price in the list, and the buy quantity is 700; after the order cancellation, the buy quantity for that price level changes to 0), then the price level element needs to be deleted, the price level element of 9.96 read from DDR / HBM is inserted into the last price level of the buy order book, and the price levels are reordered to obtain the updated price level information. If the cache already has the price level element of 9.96, the price level information can be updated directly without reading from DDR / HBM.

[0134] In addition to the aforementioned detection and processing before writing data to the target cache, the first market information can also be sent synchronously to both the target cache and target memory. Data detection and processing can then be performed after both have completed their write operations. This can be understood as follows: after constructing the first market information from the current data, the first market information can be synchronously stored in both the target cache and target memory. Since the target cache only maintains the optimal buy / sell price table (e.g., the optimal ten-level buy / sell table), if this data belongs to the optimal ten-level buy / sell table, it can be stored in the target cache and updated with the structured data of the optimal ten-level buy / sell table. Similarly, the structured data in the target memory will also be updated. However, if this data does not belong to the optimal ten-level buy / sell table, storing it in the target cache does not affect the table's structure and content. Therefore, this data can be synchronously stored in both the target cache and target memory, and then released from the target cache (i.e., deleted from the target cache) to avoid consuming storage resources. The target memory, using a full storage strategy, will not release this data, so it can be stored and updated with the structured data.

[0135] In practice, for the first market information written to the target cache and target memory, it is possible to determine whether the first market information needs to be written to the target cache before writing, or to determine whether this part of the data needs to be released after writing. This ensures that data that does not belong to the target cache can be selectively discarded, thereby improving resource utilization and avoiding the waste of cache storage resources.

[0136] Step S308: Read the gear information from the target cache, and assemble the gear information and the second market information to construct the order book data.

[0137] Specifically, the price level information refers to the information corresponding to different buy and sell price levels in each transaction, and the second market information refers to the stock, time, channel, and other information of the transaction. Through a preset assembly protocol, the price level information and the second market information can be assembled to obtain the final order book data, as shown in Table 1. The order book data can be pushed to users and institutions for order book display, trading decisions, etc.

[0138] In practical implementation, considering that each transaction's data, after being reassembled, will yield first and second market data, and that the first market data will be simultaneously sent to the target cache and target memory, while the second market data is a necessary element in composing the order book data, after obtaining the second order book data, it can be stored in the module for assembling gear position information and market data, such as... Figure 2bThe diagram shows that the second market information can be stored in the assembly module. After the gear information is read from the cache, it can be directly assembled with the second market information stored in the assembly module to obtain order book data for subsequent sending to the user terminal.

[0139] In summary, by dividing market information into first market information and second market information after data reorganization, and only sending the first market information to the target cache and target memory simultaneously, the storage resources of the target cache can be effectively saved, without affecting the order book data construction speed, thus ensuring the transaction needs of users.

[0140] In practical applications, the A-share market processes data by sending a snapshot every 3 seconds. This can be understood as summarizing the highest price, lowest price, and trading volume within that 3-second period into a single snapshot and sending it to downstream systems. In this example, the preprocessed market data includes both real-time tick-by-tick data and snapshot data sent every 3 seconds. Therefore, there's a possibility that the snapshot data might be output to the user's end faster than the order book data at some point. To more quickly build the order book data, the snapshot data and the order book data can be compared and the faster data selected to synthesize the optimal order book data. The specific implementation method is as follows: Based on the decoding results, the step-by-step data and snapshot data are determined, and the data is reconstructed according to a preset format to obtain first market information and second market information. The first market information is synchronously sent to the target memory and the target cache, and the gear information is constructed based on the first market information in the target cache. The gear information is read from the target cache and assembled with the second market information to construct the order book data. During the data transmission stage, the order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

[0141] Specifically, the data transmission phase refers to the stage of sending order book data to the user's end. Correspondingly, comparing order book data and snapshot data can be understood as comparing the transaction volume, transaction price, and / or number of transactions contained in the order book data and snapshot data, respectively. The transaction volume, transaction price, and / or number of transactions indicate which data better matches the real-time market conditions. In other words, since order transaction information is incremental, the larger the transaction volume, transaction price, and / or number of transactions recorded in the order book data and snapshot data for a given order, the closer it is to the real-time market conditions.

[0142] Based on this, and combined with the snapshot data sending logic, after obtaining the transaction-by-transaction data and snapshot data, the transaction-by-transaction data can be further reassembled and synchronously sent to the target cache. After constructing the real-time order book data corresponding to the current stage from the transaction-by-transaction data, there may be two situations: one is that the snapshot data is the latest snapshot data issued at the current moment, in which case the snapshot data may be able to send real-time market data to the user faster and more accurately than the order book data; the other is that the snapshot data is snapshot data that has been issued for more than a set time period and has not been updated, in which case the order book data may be able to send real-time market data to the user faster and more accurately. Therefore, during the data sending stage, the order book data and snapshot data can be compared, and the optimal order book data can be determined based on the comparison results before being sent to the user.

[0143] See Figure 2d The diagram illustrates that after decoding the transaction-by-transaction data and snapshot data, the transaction-by-transaction data is reassembled to obtain first market data and second market data. The first market data is simultaneously sent to DDR / HBM and cache. At this point, price level information can be constructed based on the first market data in the cache. Then, the price level information and second market data can be combined to obtain order book data. Finally, the snapshot data and order book data can be compared to determine the optimal order book data to be sent to the user. All details not described in detail herein can be found in the same or corresponding descriptions above, and will not be elaborated upon further in this embodiment.

[0144] Furthermore, to improve the overall data processing speed, a multi-path setup can be implemented to process the preprocessing, decoding, reassembly, and gear information construction of each data source in parallel. Finally, the multi-path data is aggregated into a unified order book. The specific implementation method is as follows: The process involves acquiring multi-source heterogeneous data, splitting the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams, using each multi-source heterogeneous sub-data stream as the multi-source heterogeneous data, and performing preprocessing on the multi-source heterogeneous data to obtain market data; up to the order book data construction stage, determining the corresponding order book sub-data stream for each stream, merging the corresponding order book sub-data streams to obtain the order book data.

[0145] Specifically, at least two complementary multi-source heterogeneous sub-data streams refer to the multi-source heterogeneous data being split according to a set rule, resulting in independent and separately processable sub-data streams that do not affect each other. These sub-data streams are then processed individually through different pathways. Correspondingly, the order book data is the order book data obtained after processing each multi-source heterogeneous data stream through its corresponding pathway. The order book data from each pathway is then concatenated to form the final order book data. The processing procedure for each order book data stream can be found in the above description of the FPGA-based order book data construction process; this embodiment does not impose any limitations on it.

[0146] See Figure 2f As shown in the diagram, the first line sub-information in any path is simultaneously sent to DDR / HBM and cache. At this point, the corresponding gear information for that path can be constructed based on the first line sub-information in the cache. Then, the gear information and the second line sub-information can be combined to obtain the order book sub-data for that path. The order book data for each path can then be aggregated to obtain the order book data for subsequent processing. After obtaining the order book data, it can also be compared with snapshot data to perform optimal selection processing, enabling the sending of the optimal order book data to the user terminal. All details not described in detail herein can be found in the same or corresponding descriptions above; this embodiment will not elaborate further.

[0147] Furthermore, in order to provide users with more accurate and real-time order book data, relevant order category elements can be deleted in the event of packet loss. In this embodiment, the specific implementation is as follows: If the target market information is in a packet loss state and related market information is received, determine the related price level element corresponding to the related market information in the structured data corresponding to the optimal buy / sell price level table; if the structured data meets the data update conditions based on the related market information and the related price level element, delete and / or adjust the related price level element in the structured data, and construct the price level information based on the deletion and / or adjustment results.

[0148] Specifically, associated market information refers to market information submitted after the target market information; associated price range elements refer to the price range elements corresponding to the associated market information; and data update conditions refer to the conditions under which abnormal data occurs in the associated price range elements due to packet loss. In this case, the associated price range elements need to be deleted and / or adjusted to achieve packet loss compensation, so that the order book data can still quickly display accurate market information.

[0149] Therefore, when packet loss occurs during the tier information synthesis process, the price and quantity in the optimal buy / sell tier table will be inaccurate. However, continuous bidding requires rapid execution. When packets are lost for a few tiers, the order book tier information after the packet loss can be calculated based on the cache, and compensation can be made by refreshing the subsequent buy / sell tiers. However, there are cases where the quantity for a certain tier is negative or there is a skipped tier execution after calculation and synthesis. When the quantity is negative or there is a skipped tier execution, in order to avoid affecting the rapid construction of the order book data, related tier elements can be deleted and / or adjusted from the structured data, and the tier information can be constructed based on the deletion and / or adjustment results.

[0150] See Figure 4 , Figure 4 A flowchart is shown of a third FPGA-based order book data construction method according to an embodiment of this specification. The method is applied to a programmable logic component and specifically includes the following steps.

[0151] Step S402: Obtain transaction market data and decode the transaction market data to obtain transaction-by-transaction data and snapshot data.

[0152] Step S404: Reorganize the data according to a preset format to obtain market information.

[0153] Step S406: The market information is synchronously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache.

[0154] Step S408: Compare the order book data and the snapshot data, and determine the optimal order book data based on the comparison result.

[0155] In an optional embodiment, the step of synchronously sending the market information to a target memory and a target cache, and constructing order book data based on the market information in the target cache, includes: When the market information includes first market information and second market information, the first market information is simultaneously sent to the target memory and the target cache, and gear information is constructed based on the first market information in the target cache; the gear information is read from the target cache, and the gear information and the second market information are assembled to construct order book data.

[0156] In an optional embodiment, the step of acquiring transaction market data and decoding the transaction market data to obtain tick-by-tick data and snapshot data includes: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain transaction market data; decode the transaction market data according to a binary protocol or information exchange protocol to obtain transaction-by-transaction data and snapshot data.

[0157] In an optional embodiment, the step of acquiring multi-source heterogeneous data and preprocessing the multi-source heterogeneous data to obtain transaction market data includes: The process involves acquiring multi-source heterogeneous data, splitting the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams, using each multi-source heterogeneous sub-data stream as the multi-source heterogeneous data, and performing preprocessing on the multi-source heterogeneous data to obtain market data; up to the order book data construction stage, determining the corresponding order book sub-data stream for each stream, merging the corresponding order book sub-data streams to obtain the order book data.

[0158] This embodiment describes a third FPGA-based order book data construction method. Any content not described in detail can be found in the same or corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.

[0159] See Figure 5 , Figure 5 A flowchart is shown of a fourth FPGA-based order book data construction method according to an embodiment of this specification. The method is applied to a programmable logic component and specifically includes the following steps.

[0160] Step S502: Obtain multi-source heterogeneous data and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams.

[0161] Step S504: Process the multi-source heterogeneous sub-data for each channel to obtain the corresponding market information for each channel.

[0162] Step S506: Send the market data sub-information corresponding to each channel to the corresponding target memory and target cache, and construct the order book sub-data corresponding to each channel based on the market data sub-information in the target cache.

[0163] Step S508: Merge the order book data corresponding to each path to obtain the order book data.

[0164] In an optional embodiment, the processing of the first multi-source heterogeneous sub-data from any one of the at least two complementary multi-source heterogeneous sub-data streams includes: The first multi-source heterogeneous sub-data is processed to obtain transaction market data; the transaction market data is decoded according to a binary protocol or information exchange protocol to obtain transaction-by-transaction sub-data; the transaction-by-transaction sub-data is reassembled according to a preset format to obtain market information.

[0165] In an optional embodiment, the construction of the order book sub-data corresponding to the second multi-source heterogeneous sub-data from any one of the at least two complementary multi-source heterogeneous sub-data streams includes: When the market data sub-information corresponding to the second multi-source heterogeneous sub-data includes first market data sub-information and second market data sub-information, the first market data sub-information is synchronously sent to the target memory and the target cache, and the gear position sub-information is constructed based on the first market data sub-information in the target cache; the gear position sub-information is read from the target cache, and the gear position sub-information and the second market data sub-information are assembled to construct the order book sub-data.

[0166] In an optional embodiment, it further includes: Based on the decoding results, the step-by-step sub-data and snapshot sub-data are determined, and the sub-data is reorganized according to a preset format to obtain market information. The market information corresponding to each channel is sent to the corresponding target memory and target cache. Based on the market information in the target cache, the order book sub-data corresponding to each channel is constructed, and the order book data corresponding to each channel is merged to obtain the order book data. During the data sending stage, the snapshot sub-data corresponding to each channel is merged to obtain snapshot data. The order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison result.

[0167] This embodiment describes the fourth FPGA-based order book data construction method. For any content not described in detail, please refer to the same or corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.

[0168] See Figure 6 , Figure 6 A flowchart is shown of a fifth FPGA-based order book data construction method according to an embodiment of this specification. The method is applied to a programmable logic component and specifically includes the following steps.

[0169] Step S602: Obtain transaction market data and decode the transaction market data.

[0170] Step S604: Reconstruct the decoded market data according to a preset format to obtain market information.

[0171] Step S606: The market information is synchronously sent to the target memory and the target cache. An optimal buy / sell price table is constructed based on the market information in the target cache, and order book data is constructed based on the optimal buy / sell price table.

[0172] Step S608: If the structured data corresponding to the optimal buy / sell price level table meets the data update conditions, delete and / or adjust the associated price level elements in the structured data, and construct the target order book data based on the deletion and / or adjustment results.

[0173] This embodiment describes the fifth FPGA-based order book data construction method. For any content not described in detail, please refer to the same or corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.

[0174] Corresponding to the above method embodiments, this specification also provides a first embodiment of an FPGA-based order book data construction system. Figure 7 A schematic diagram of the structure of a first FPGA-based order book data construction system provided in one embodiment of this specification is shown. Figure 7 As shown, the FPGA-based order book data construction system 700 includes a server 710 and a terminal 720, wherein the server 710 is configured with programmable logic components, including: The server 710 is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct order book data based on the market information in the target cache; and send the order book data to the terminal. The terminal 720 is used to render and display a list of trading quotes on the trading page based on the order book data; or, it is used to execute a trading strategy based on the order book data.

[0175] Corresponding to the above method embodiments, this specification also provides a second embodiment of an FPGA-based order book data construction system. Figure 8 A schematic diagram of a second FPGA-based order book data construction system provided in one embodiment of this specification is shown. Figure 8 As shown, the FPGA-based order book data construction system 800 includes a server 810 and a terminal 820, wherein the server 810 is configured with programmable logic components, including: The server 810 is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain first market information and second market information; synchronously send the first market information to a target memory and a target cache, and construct price level information based on the first market information in the target cache; read the price level information from the target cache, and assemble the price level information and the second market information to construct order book data; and send the order book data to the terminal. The terminal 820 is used to render and display a list of trading quotes on the trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

[0176] Corresponding to the above method embodiments, this specification also provides a third embodiment of an FPGA-based order book data construction system. Figure 9 A schematic diagram of a third FPGA-based order book data construction system according to an embodiment of this specification is shown. Figure 9 As shown, the FPGA-based order book data construction system 900 includes a server 910 and a terminal 920, wherein the server 910 is configured with programmable logic components, including: The server 910 is configured to acquire market data through a programmable logic component, decode the market data to obtain tick-by-tick data and snapshot data; reassemble the tick-by-tick data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache, and construct order book data based on the market information in the target cache; compare the order book data and the snapshot data, determine the optimal order book data based on the comparison result; and send the optimal order book data to the terminal. The terminal 920 is used to render and display a list of trading quotes on the trading page based on the optimal order book data; or, it is used to execute a trading strategy based on the optimal order book data.

[0177] Corresponding to the above method embodiments, this specification also provides a fourth embodiment of an FPGA-based order book data construction system. Figure 10 A schematic diagram of the structure of a fourth FPGA-based order book data construction system provided in one embodiment of this specification is shown. Figure 10 As shown, the FPGA-based order book data construction system 1000 includes a server 1010 and a terminal 1020, wherein the server 1010 is configured with programmable logic components, including: The server 1010 is configured to acquire multi-source heterogeneous data through a programmable logic component, and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams; process each corresponding multi-source heterogeneous sub-data stream to obtain corresponding market data; send each corresponding market data stream to a corresponding target memory and target cache, and construct corresponding order book data based on the market data stream in the target cache; merge the corresponding order book data to obtain order book data; and send the order book data to the terminal. The terminal 1020 is used to render and display a list of trading quotes on the trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

[0178] Corresponding to the above method embodiments, this specification also provides a fifth embodiment of an FPGA-based order book data construction system. Figure 11 A schematic diagram of the structure of a fifth FPGA-based order book data construction system provided in one embodiment of this specification is shown. Figure 11 As shown, the FPGA-based order book data construction system 1100 includes a server 1110 and a terminal 1120, wherein the server 1110 is configured with programmable logic components, including: The server 1110 is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct an optimal buy / sell price table based on the market information in the target cache; construct order book data based on the optimal buy / sell price table; when the structured data corresponding to the optimal buy / sell price table meets the data update conditions, delete and / or adjust related price elements in the structured data; construct target order book data based on the deletion and / or adjustment results; and send the target order book data to the terminal. The terminal 1120 is used to render and display a list of trading quotes on the trading page based on the target order book data; or, it is used to execute a trading strategy based on the target order book data.

[0179] The above is a schematic scheme of the FPGA-based order book data construction system of this embodiment. It should be noted that the technical solution of the FPGA-based order book data construction system and the technical solution of the FPGA-based order book data construction method described above belong to the same concept. For details not described in detail in the technical solution of the FPGA-based order book data construction system, please refer to the description of the technical solution of the FPGA-based order book data construction method described above.

[0180] One embodiment of this specification provides an electronic device, which is a programmable logic component used to execute the steps of the above-described FPGA-based order book data construction method.

[0181] The above is an illustrative scheme of an electronic device according to this embodiment. It should be noted that the technical solution of this electronic device belongs to the same concept as the technical solution of the FPGA-based order book data construction method described above. For details not described in detail in the technical solution of the electronic device, please refer to the description of the technical solution of the FPGA-based order book data construction method described above.

[0182] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0183] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0184] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0185] The preferred embodiments disclosed above are merely illustrative of this specification. Optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described in this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification.

Claims

1. A method for constructing order book data based on FPGA, characterized in that, Applied to programmable logic components, including: Acquire market data and decode the market data; The decoded market data is reconstructed according to a preset format to obtain market information. The market information is simultaneously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache.

2. The method according to claim 1, characterized in that, The process of acquiring and decoding market data includes: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain transaction market data; The transaction data is decoded according to a binary protocol or information exchange protocol to obtain individual transaction data; The step of reconstructing the decoded market data according to a preset format to obtain market information includes: The data is reorganized according to a preset format to obtain market information.

3. The method according to claim 1, characterized in that, After the step of synchronously sending the market information to the target memory and the target cache is executed, the method further includes: Detect whether the market information meets the storage conditions of the target cache; If so, the market information is synchronously stored in the target cache and the target memory; If not, store the market information in the target memory.

4. The method according to claim 1, characterized in that, The process of constructing the order book data based on the market information in the target cache includes: If the market information is successfully stored in the target cache, the market information stored in the target cache is analyzed. Based on the analysis results, an optimal buy / sell price level table is constructed, and order book data is obtained based on the optimal buy / sell price level table, wherein the price level elements of the optimal buy / sell price level table are more than or equal to the price level elements of the order book data.

5. The method according to claim 4, characterized in that, The process of constructing the order book data based on the market information in the target cache includes: Receive target market information and determine the order price and quantity information corresponding to the target market information; If the order price information is associated with the optimal buy / sell price tier table and is not a newly added price, the structured data corresponding to the optimal buy / sell price tier table is updated according to the quantity information; When the order price information is associated with the optimal buy / sell tier table and is a newly added price, the tier element to be updated is determined based on the order price information and the quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier element to be updated. If the order price information and the quantity information are associated with the optimal buy / sell price table and the order is cancelled or fully executed, the candidate price element is read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell price table is updated based on the candidate price element. When the order price information and quantity information are associated with the optimal buy / sell tier table and the order is cancelled or fully executed, and the tier elements in the optimal buy / sell tier table are more than the tier elements in the order book data, the tier elements to be updated are determined based on the order price information and quantity information, and the structured data corresponding to the optimal buy / sell tier table is updated based on the tier elements to be updated; in the idle state or when the tier elements in the optimal buy / sell tier table are less than a set threshold, candidate tier elements are read from the target memory and stored in the target cache, and the structured data corresponding to the optimal buy / sell tier table is updated based on the candidate tier elements. The order book data is constructed based on the updated structured data.

6. The method according to any one of claims 1-5, characterized in that, The step of synchronously sending the market information to the target memory and the target cache, and constructing order book data based on the market information in the target cache, includes: When the market information includes first market information and second market information, the first market information is simultaneously sent to the target memory and the target cache, and the gear information is constructed based on the first market information in the target cache; The gear information is read from the target cache, and the gear information and the second market information are combined to construct the order book data.

7. The method according to any one of claims 2-5, characterized in that, Also includes: Based on the decoding results, determine the transaction data and snapshot data, and perform data reorganization of the transaction data according to a preset format to obtain market information, and synchronously send the market information to the target memory and the target cache, and construct order book data based on the market information in the target cache; During the data transmission phase, the order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

8. The method according to claim 2 or 5, characterized in that, The process of acquiring multi-source heterogeneous data and preprocessing the multi-source heterogeneous data to obtain trading market data includes: The steps are as follows: acquire multi-source heterogeneous data, split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data, use each multi-source heterogeneous sub-data as the multi-source heterogeneous data, and perform preprocessing on the multi-source heterogeneous data to obtain trading market data. Until the order book data construction stage, the corresponding order book sub-data for each path is determined, and the corresponding order book data for each path is merged to obtain the order book data.

9. The method according to claim 5, characterized in that, Also includes: If the target market information is in a packet loss state and related market information is received, the related price level element corresponding to the related market information is determined in the structured data corresponding to the optimal buy / sell price level table; If the structured data meets the data update conditions based on the associated market information and the associated price level elements, the associated price level elements are deleted and / or adjusted in the structured data, and the order book data is constructed based on the deletion and / or adjustment results.

10. A method for constructing order book data based on FPGA, characterized in that, Applied to programmable logic components, including: Acquire market data and decode the market data; The decoded market data is reorganized according to a preset format to obtain first and second market data. The first market information is simultaneously sent to the target memory and the target cache, and the price level information is constructed based on the first market information in the target cache. The gear information is read from the target cache, and the gear information and the second market information are combined to construct the order book data.

11. The method according to claim 10, characterized in that, The process of acquiring and decoding market data includes: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain transaction market data; The transaction data is decoded according to a binary protocol or information exchange protocol to obtain individual transaction data; The step of reconstructing the decoded market data according to a preset format to obtain first market information and second market information includes: The data is reorganized according to a preset format to obtain first market information and second market information.

12. The method according to claim 11, characterized in that, After the step of decoding the transaction market data is executed, the method further includes: The steps are as follows: determine the individual data and snapshot data according to the decoding results, and perform data reorganization of the individual data according to the preset format to obtain the first market information and the second market information. The first market information is sent to the target memory and the target cache simultaneously. The gear information is constructed based on the first market information in the target cache. The gear information is read from the target cache and assembled with the second market information to construct the order book data. During the data transmission phase, the order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

13. The method according to claim 11 or 12, characterized in that, The process of acquiring multi-source heterogeneous data and preprocessing the multi-source heterogeneous data to obtain trading market data includes: The steps are as follows: acquire multi-source heterogeneous data, split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data, use each multi-source heterogeneous sub-data as the multi-source heterogeneous data, and perform preprocessing on the multi-source heterogeneous data to obtain trading market data. Until the order book data construction stage, the corresponding order book sub-data for each path is determined, and the corresponding order book data for each path is merged to obtain the order book data.

14. A method for constructing order book data based on FPGA, characterized in that, Applied to programmable logic components, including: Acquire transaction market data and decode the transaction market data to obtain transaction-by-transaction data and snapshot data; The data is reorganized according to a preset format to obtain market information; The market information is simultaneously sent to the target memory and the target cache, and order book data is constructed based on the market information in the target cache. The order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

15. The method according to claim 14, characterized in that, The step of synchronously sending the market information to the target memory and the target cache, and constructing order book data based on the market information in the target cache, includes: When the market information includes first market information and second market information, the first market information is simultaneously sent to the target memory and the target cache, and the gear information is constructed based on the first market information in the target cache; The gear information is read from the target cache, and the gear information and the second market information are combined to construct the order book data.

16. The method according to claim 14, characterized in that, The process of acquiring transaction market data and decoding the transaction market data to obtain tick-by-tick data and snapshot data includes: Acquire multi-source heterogeneous data and preprocess the multi-source heterogeneous data to obtain transaction market data; The transaction data is decoded according to a binary protocol or information exchange protocol to obtain transaction-by-transaction data and snapshot data.

17. The method according to claim 16, characterized in that, The process of acquiring multi-source heterogeneous data and preprocessing the multi-source heterogeneous data to obtain trading market data includes: The steps are as follows: acquire multi-source heterogeneous data, split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data, use each multi-source heterogeneous sub-data as the multi-source heterogeneous data, and perform preprocessing on the multi-source heterogeneous data to obtain trading market data. Until the order book data construction stage, the corresponding order book sub-data for each path is determined, and the corresponding order book data for each path is merged to obtain the order book data.

18. A method for constructing order book data based on FPGA, characterized in that, Applied to programmable logic components, including: Acquire multi-source heterogeneous data and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams; The multi-source heterogeneous sub-data for each channel is processed to obtain the corresponding market information for each channel. Each channel's corresponding market data is sent to the corresponding target memory and target cache, and the order book data corresponding to each channel is constructed based on the market data in the target cache. The order book data corresponding to each path is merged to obtain the order book data.

19. The method according to claim 18, characterized in that, The processing of the first multi-source heterogeneous sub-data in any one of the at least two complementary multi-source heterogeneous sub-data streams includes: The first multi-source heterogeneous sub-data is processed to obtain the transaction market data sub-data. The transaction data segments are decoded according to a binary protocol or information exchange protocol to obtain individual transaction data. The individual data points are reorganized according to a preset format to obtain market information.

20. The method according to claim 18, characterized in that, The construction of the order book sub-data corresponding to the second multi-source heterogeneous sub-data of any one of the at least two complementary multi-source heterogeneous sub-data streams includes: When the market data sub-information corresponding to the second multi-source heterogeneous sub-data includes first market data sub-information and second market data sub-information, the first market data sub-information is synchronously sent to the target memory and the target cache, and the price level sub-information is constructed based on the first market data sub-information in the target cache. The gear position information is read from the target cache, and the gear position information and the second market information are combined to construct the order book data.

21. The method according to claim 19, characterized in that, Also includes: The process involves determining the individual data and snapshot data based on the decoding results, reorganizing the individual data according to a preset format to obtain market information, sending the market information corresponding to each channel to the corresponding target memory and target cache, constructing the order book data corresponding to each channel based on the market information in the target cache, and merging the order book data corresponding to each channel to obtain the order book data. During the data transmission phase, the corresponding snapshot sub-data of each channel are merged to obtain snapshot data; The order book data and the snapshot data are compared, and the optimal order book data is determined based on the comparison results.

22. A method for constructing order book data based on FPGA, characterized in that, Applied to programmable logic components, including: Acquire market data and decode the market data; The decoded market data is reconstructed according to a preset format to obtain market information. The market information is synchronously sent to the target memory and the target cache. An optimal buy / sell price table is constructed based on the market information in the target cache, and order book data is constructed based on the optimal buy / sell price table. If the structured data corresponding to the optimal buy / sell price level table meets the data update conditions, the associated price level elements are deleted and / or adjusted in the structured data, and the target order book data is constructed based on the deletion and / or adjustment results.

23. An FPGA-based order book data construction system, characterized in that, It includes a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct order book data based on the market information in the target cache; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

24. An FPGA-based order book data construction system, characterized in that, It includes a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain first market information and second market information; synchronously send the first market information to a target memory and a target cache, and construct price level information based on the first market information in the target cache; read the price level information from the target cache, and assemble the price level information and the second market information to construct order book data; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

25. An FPGA-based order book data construction system, characterized in that, It includes a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire market data through a programmable logic component, decode the market data to obtain tick-by-tick data and snapshot data; reassemble the tick-by-tick data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache, and construct order book data based on the market information in the target cache; compare the order book data and the snapshot data, determine the optimal order book data based on the comparison result; and send the optimal order book data to the terminal. The terminal is used to render and display a list of trading quotes on the trading page based on the optimal order book data; or, it is used to execute a trading strategy based on the optimal order book data.

26. An FPGA-based order book data construction system, characterized in that, It includes a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire multi-source heterogeneous data through a programmable logic component, and split the multi-source heterogeneous data into at least two complementary multi-source heterogeneous sub-data streams; process each corresponding multi-source heterogeneous sub-data stream to obtain corresponding market data; send each corresponding market data sub-data stream to a corresponding target memory and target cache, and construct corresponding order book sub-data streams based on the market data sub-data streams in the target cache; merge the corresponding order book sub-data streams to obtain order book data; and send the order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the order book data; or, it is used to execute trading strategies based on the order book data.

27. An FPGA-based order book data construction system, characterized in that, It includes a server and a terminal, wherein the server is configured with a programmable logic component, including: The server is configured to acquire market data through a programmable logic component and decode the market data; reassemble the decoded market data according to a preset format to obtain market information; synchronously send the market information to a target memory and a target cache; construct an optimal buy / sell price level table based on the market information in the target cache; construct order book data based on the optimal buy / sell price level table; when the structured data corresponding to the optimal buy / sell price level table meets the data update conditions, delete and / or adjust related price level elements in the structured data; construct target order book data based on the deletion and / or adjustment results; and send the target order book data to the terminal. The terminal is used to render and display a list of trading quotes on a trading page based on the target order book data; or, it is used to execute a trading strategy based on the target order book data.

28. An electronic device, characterized in that, The electronic device is a programmable logic component, which is used to perform the steps of the method according to any one of claims 1-22.

Citation Information

Patent Citations

  • Market data reconstruction method and related device

    CN111815445A

  • Low-delay high-throughput real-time order book generation method

    CN114549129A

  • Optimization processor for electronic data multiple transaction request messages

    US20190005582A1

Cited By

  • Data processing method, system and device

    CN121280144A

  • Order book gear data processing method, device and equipment based on FPGA (Field Programmable Gate Array)

    CN121743229A