Pre-embedded list storage method and device, equipment and storage medium

Through dynamic address management and sorting algorithms within FPGA, the problem of low utilization of pre-buyed storage space in high-frequency transactions is solved, and efficient storage and processing speed is improved.

CN118964226AActive Publication Date: 2024-11-15SHENGLI YUAN TECH (HANGZHOU) CO LTD

Patent Information

Application Number
CN202411437804.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2024-11-15
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

In high-frequency trading, the storage space utilization rate of pre-paid orders is low, resulting in low storage efficiency and slow order processing speed.

Method used

By implementing dynamic address management within the FPGA, the first-level address management area and the second-level data storage area are used to sort and store pre-buried orders, dynamically allocate storage space, reduce storage space waste, and improve order processing speed.

Benefits of technology

It greatly improves the utilization rate of storage space, saves internal resource consumption of FPGAs, improves order information processing speed, and realizes storage and processing sorted from small to large by order number.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964226A_ABST
    Figure CN118964226A_ABST
Patent Text Reader

Abstract

The invention discloses a pre-embedded list storage method and device, equipment and a storage medium, and relates to the technical field of data storage, and the method comprises the steps: querying whether a first-level address management region address of an ordering channel number exists in preset FPGA internal address management or not according to the ordering channel number corresponding to the pre-embedded list when the pre-embedded list is received; if yes, the first-level address management area is read according to the address, the maximum order number of each second-level data storage area is obtained, and the insertion position of the pre-embedded order is determined based on the size relation between the maximum order number and the order number of the pre-embedded order; querying a secondary data storage area address in the primary address management area by using the insertion position, and reading a secondary data storage area based on the secondary data storage area address to obtain each target order number; and determining a to-be-inserted address of the pre-embedded order based on the size sequence of the target order numbers, and storing the pre-embedded order to a secondary data storage area according to the to-be-inserted address. According to the method and the device, optimized storage of the pre-embedded list is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a pre-buried order storage method, device, equipment and storage medium. Background Art

[0002] In the process of securities and futures trading, for professional investors in high-frequency trading, processing orders with '0 delay' is one of the technical goals, so the function of pre-buried orders came into being. Orders are placed in advance before the market opens, and the orders are directly reported to the exchange after the market opens. Therefore, the storage space will be relatively large if the number of orders is large. Since different platforms store different orders, in order to ensure the maximum utilization of storage space, a storage management algorithm for pre-buried orders is generated. Therefore, in FPGA (Field Programmable Gate Array), under the same resource storage format, these storage spaces can be reused as much as possible. Flexible use of storage space is one of the research topics of high-frequency trading counters. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for storing pre-buried orders, which can optimize the storage method of pre-buried orders, greatly reduce storage space and improve space utilization. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a method for storing a pre-buried order, comprising:

[0005] When receiving a pre-buried order, querying whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order;

[0006] If it exists, read the preset first-level address management area according to the address of the preset first-level address management area, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order;

[0007] Using the insertion position to query the preset secondary data storage area address in the preset primary address management area, and reading the preset secondary data storage area based on the preset secondary data storage area address to obtain each target order number of the stored pre-buried order;

[0008] The address to be inserted of the pre-buried order is determined based on the order of magnitude of each target order number, and the pre-buried order is stored in the preset secondary data storage area according to the address to be inserted.

[0009] Optionally, after querying, according to the order channel number corresponding to the pre-buried order, whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management, the method further includes:

[0010] If the preset first-level address management area address corresponding to the order channel number does not exist in the preset FPGA internal address management, a new first-level address management area and a second-level address management area are created to store the information of the pre-buried order.

[0011] Optionally, the determining the insertion position of the pre-placed order based on the size relationship between the maximum order number and the order number of the pre-placed order includes:

[0012] If the order number of the pre-buried order is smaller than the maximum order number, the preset secondary data storage area corresponding to the maximum order number is determined as the insertion position of the pre-buried order.

[0013] Optionally, the method further includes:

[0014] If the number of addresses of the preset second-level address management area stored in the preset first-level address management area reaches a first quantity threshold, apply for a new first-level address management area, and store the new first-level address management area address corresponding to the new first-level address management area into the preset first-level address management area;

[0015] If the number of pre-buried orders stored in the preset secondary address management area reaches the second quantity threshold, a new secondary address management area is applied for, and the new secondary address management area address corresponding to the new secondary address management area is stored in the current primary address management area.

[0016] Optionally, the method further includes:

[0017] If the first-level address management area of ​​the next link does not exist in the preset first-level address management area, when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the address of the preset first-level address management area can be reused when the front end applies for the address of the first-level address management area;

[0018] If the first-level address management area of ​​the next link exists in the preset first-level address management area, and the first-level address management area of ​​the previous link does not exist, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the front end can reuse the address of the preset first-level address management area when applying for the address of the first-level address management area, and write the address of the first-level address management area of ​​the next link into the preset FPGA internal address management;

[0019] If the preset first-level address management area contains the first-level address management area of ​​the next link and the first-level address management area of ​​the previous link, and the first-level address management area of ​​the previous link is an address read from the non-preset FPGA internal address management, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recovered to the preset address cache pool, so that the preset first-level address management area address can be reused when the front end applies for the first-level address management area address, and the address of the first-level address management area of ​​the next link is written into the first address bit corresponding to the first-level address management area of ​​the previous link to eliminate invalid links.

[0020] Optionally, after storing the pre-buried order in the preset secondary data storage area according to the address to be inserted, the method further includes:

[0021] If the number of pre-placed orders in the preset secondary data storage area reaches a third quantity threshold, a new secondary data storage area is reapplied for, and the order numbers in the preset secondary data storage area that meet the preset conditions are stored in the new secondary data storage area.

[0022] Optionally, the method further includes:

[0023] When the front end deletes the pre-buried order, if there is a pre-buried order in the preset secondary data storage area, the address of the preset secondary data storage area is recycled to the preset address cache pool, so that the preset secondary address management area address can be reused when the front end applies for the address of the secondary address management area;

[0024] When the pre-buried order is deleted at the front end, if there are several pre-buried orders in the preset secondary data storage area, the pre-buried orders in the preset secondary data storage area are deleted according to the address to be inserted, and after the remaining pre-buried orders in the preset secondary data storage area are rearranged, the corresponding arranged pre-buried orders are written into the preset secondary data storage area.

[0025] In a second aspect, the present application discloses a pre-buried order storage device, comprising:

[0026] The address query module is used to query whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management when receiving the pre-buried order according to the order channel number corresponding to the pre-buried order;

[0027] An insertion position determination module is used to read the preset first-level address management area according to the address of the preset first-level address management area, if it exists, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the relationship between the maximum order number and the order number of the pre-buried order;

[0028] An order number acquisition module is used to query the preset secondary data storage area address in the preset primary address management area using the insertion position, and read the preset secondary data storage area based on the preset secondary data storage area address to obtain each target order number of the stored pre-buried order;

[0029] The pre-buried order storage module is used to determine the address to be inserted of the pre-buried order based on the size order of each target order number, and store the pre-buried order in the preset secondary data storage area according to the address to be inserted.

[0030] In a third aspect, the present application discloses an electronic device, comprising:

[0031] Memory, used to store computer programs;

[0032] The processor is used to execute the computer program to implement the pre-buried order storage method as described above.

[0033] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned pre-buried order storage method.

[0034] When storing a pre-buried order, the present application first queries whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order when the pre-buried order is received; if so, read the preset first-level address management area according to the preset first-level address management area address, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order; then query the preset second-level data storage area address in the preset first-level address management area using the insertion position, and read the preset second-level data storage area based on the preset second-level data storage area address to obtain each target order number of the stored pre-buried order; finally, determine the address to be inserted of the pre-buried order based on the size order of each target order number, and store the pre-buried order in the preset second-level data storage area according to the address to be inserted. It can be seen that the present application allocates dynamic addresses to the order channel numbers of pre-buried orders through FPGA internal address management, the first-level address management area, and the second-level data storage area, which greatly increases the utilization rate of storage space. Each index is dynamically allocated, which greatly saves the consumption of FPGA internal resources, greatly reduces storage space, and further improves the processing speed of order information. The orders are sorted from small to large according to the order numbers, which facilitates the FPGA to process the pre-buried orders in sequence. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0036] Figure 1 A flow chart of a method for storing a pre-buried order disclosed in this application;

[0037] Figure 2 A schematic diagram of a data format of a first-level address management area disclosed in this application;

[0038] Figure 3 A schematic diagram of a process flow after a secondary data storage area is full of 16 data disclosed in the present application;

[0039] Figure 4 This is a schematic diagram of the structure of a pre-buried single storage device disclosed in this application;

[0040] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] The current storage method builds a dynamic storage space according to the internal storage resources of FPGA and the external storage resources of FPGA. Each index can apply for a space to store the current order number. After the current index is full, another storage space is applied. And the pre-buried orders under the current index are stored in order from small to large according to the order number. After the pre-buried order is sent out, the pre-buried order of the current order number is deleted to ensure that the read pre-buried orders are valid. However, if the current pre-buried order cannot be reported to the exchange for 1v2 search, when querying all the pre-buried orders under the current index, the query time response will be very slow, because all the order numbers need to be read from the external storage resources of FPGA, so it takes a long time, but the resource reuse rate is relatively high. In order to solve the above technical problems, the present application discloses a pre-buried order storage method, which can optimize the pre-buried order storage method on the basis of the existing high-frequency trading system, greatly reducing the storage space and improving the utilization rate of the space.

[0043] See also Figure 1 As shown, an embodiment of the present invention discloses a method for storing a pre-buried order, comprising:

[0044] Step S11, when receiving a pre-buried order, query whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order.

[0045] In this embodiment, the storage of the pre-buried order is divided into three parts in this application, namely, FPGA internal address management, first-level address management area, and second-level data storage area. Each index in the FPGA internal address management is unique, and what is stored is the address of the first-level address management area. A total of 16 data can be stored in one piece in the first-level address management area, 15 of which are the addresses of the second-level data storage area, and the maximum order number of the current second-level data storage area address. There is also an address of the next first-level address management area for data storage. Secondary data storage area: This piece can store a total of 16 data, all of which are the order numbers of the pre-buried order, and the order numbers are arranged from small to large. And each order number carries other related field information that needs to be stored.

[0046] When receiving a pre-buried order, the preset first-level address management area address corresponding to the order channel number is queried in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order. The order channel number corresponding to the pre-buried order here also refers to the current index. According to the order index, all order numbers under the current index can be queried, and all order numbers smaller than a certain order number can also be queried. According to the order index, all order numbers under the current index can also be deleted. When the order of the index is queried next time, the query returns directly that there is no order. In this way, the corresponding first-level address management area address can be queried more simply and efficiently. If the preset first-level address management area address corresponding to the order channel number does not exist in the preset FPGA internal address management, a new first-level address management area and a second-level address management area are created to store the information of the pre-buried order. That is, there is no pre-buried order hanging, indicating that the pre-buried order is the first order under the channel, and it is necessary to apply for three storage areas by itself. It should also be noted that when the front end deletes one of the pre-buried orders, and this pre-buried order is the last pre-buried order under the index, the data in the corresponding index in the FPGA internal address management needs to be cleared at this time. This data refers to the storage data corresponding to the pre-buried order. If all of them are cleared, the pre-buried order will not be found when it is queried again.

[0047] Step S12: If it exists, read the preset first-level address management area according to the preset first-level address management area address, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order.

[0048] In this embodiment, if there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management, it means that there is a corresponding pre-buried order for the current order channel number. At this time, the newly placed pre-buried order needs to be mounted under the channel to generate a tree structure with the previous order. If there is no pre-buried order hanging, then it is necessary to re-apply for an address as the start of the tree. After that, the preset first-level address management area is read according to the preset first-level address management area address to obtain the maximum order number of each corresponding preset second-level data storage area. Then, it is determined which second-level data storage area (data format stored in the first-level storage area, corresponding second-level data storage area address, and corresponding second-level data storage area The maximum order number of the order number) of the currently indexed pre-buried order is in, and the position where the current pre-buried order is inserted can be quickly found by comparing the order number of the pre-buried order with the maximum order number of each piece of the first-level storage area. That is to say, if the order number of the pre-buried order is less than the maximum order number, the preset second-level data storage area corresponding to the maximum order number is determined as the insertion position of the pre-buried order.

[0049] Step S13, using the insertion position to query the preset secondary data storage area address in the preset primary address management area, and reading the preset secondary data storage area based on the preset secondary data storage area address to obtain the target order numbers of the stored pre-buried orders.

[0050] In this embodiment, the insertion position can be used to query the address of the secondary data storage area (if it is the first pre-buried order under this channel, then the corresponding maximum order number of the secondary data storage is infinite). The data storage format is as follows: Figure 2 shown.

[0051] But if Figure 3 As shown, when the secondary data storage area has enough 16 pre-buried orders, it is necessary to apply for a new secondary address management area, and then store the address of the corresponding secondary address management area into the current primary address management area. In addition, when the primary address management area has enough 15 secondary address management areas, it is necessary to apply for a primary address management area, and then store the address of the newly applied primary address management area into the first address of the previous primary address management area, forming an address link, which is convenient for jumping to the next primary address management area.

[0052] Finally, the preset secondary data storage area is read according to the preset secondary data storage area address queried from the primary address management area to obtain the target order numbers of the stored pre-buried orders.

[0053] Step S14: determining the address to be inserted of the pre-buried order based on the order of magnitude of each target order number, and storing the pre-buried order in the preset secondary data storage area according to the address to be inserted.

[0054] In this embodiment, after obtaining the target order numbers of the stored pre-buried orders, it is determined that the order number of the current index pre-buried order should be inserted into which address of the current secondary data storage area, and the corresponding order number is stored in order (arranged from small to large) in the secondary data storage area. That is, the address to be inserted of the pre-buried order is determined based on the size order of each target order number, and the pre-buried order is stored in the preset secondary data storage area according to the address to be inserted. However, if the current order becomes 16 addresses after insertion, it is necessary to apply for another secondary data storage area, and then store the first 8 order numbers in the previous secondary data storage area, and the last 8 order numbers in the last secondary data storage area. Because the order number corresponding to the pre-buried order is irregular, it is necessary to reserve space so that when subsequent orders come, there is a place to write, so as to avoid applying too frequently. For example, the order numbers 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18 corresponding to the pre-buried order of channel 0 are received. The first 8 order numbers 1 to 10 are stored in the first secondary data storage area, and the last 8 order numbers 11 to 18 are stored in the second secondary data storage area. At this time, if there is another 9, it can be directly written into the first area, without introducing a large number of logical operations due to the inability to insert, which wastes resources.

[0055] In addition, when there is only one pre-buried order in the current secondary data storage area, the front end wants to delete the pre-buried order. At this time, the current secondary address management area is directly recovered to the preset address buffer pool, and enters the queue sequence for use when applying next time. If there are only multiple pre-buried orders in the current secondary data storage area when the front end deletes, then find the location of the current pre-buried order, remove it, and rearrange it and write it to the secondary data storage area. In this way, in addition to making full use of the characteristics of parallel processing in FPGA, based on the characteristics of the algorithm itself, the processing speed of order information in the high-frequency trading system is further improved, and the space of the address buffer pool is more flexible, and the address is dynamically allocated, which supports applying for as much as you want, and releasing it when the space is used up. And this application is also applicable to storage processing related to other fields.

[0056] When storing a pre-buried order, the present application first queries whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order when the pre-buried order is received; if so, read the preset first-level address management area according to the preset first-level address management area address, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order; then query the preset second-level data storage area address in the preset first-level address management area using the insertion position, and read the preset second-level data storage area based on the preset second-level data storage area address to obtain each target order number of the stored pre-buried order; finally, determine the address to be inserted of the pre-buried order based on the size order of each target order number, and store the pre-buried order in the preset second-level data storage area according to the address to be inserted. It can be seen that the present application allocates dynamic addresses to the order channel numbers of pre-buried orders through FPGA internal address management, the first-level address management area, and the second-level data storage area, which greatly increases the utilization rate of storage space. Each index is dynamically allocated, which greatly saves the consumption of FPGA internal resources, greatly reduces storage space, and further improves the processing speed of order information. The orders are sorted from small to large according to the order numbers, which facilitates the FPGA to process the pre-buried orders in sequence.

[0057] Based on the previous embodiment, it can be known that when the first-level address management area has enough 15 second-level address management areas, it is necessary to apply for a first-level address management area, and then store the address of the newly applied first-level address management area into the first address of the previous first-level address management area to form an address link, which is convenient for jumping to the next first-level address management area. Next, when there is only one second-level address management area left in the first-level address management area, and there is only one pre-buried order left in the second-level address management area, the front end needs to delete the pre-buried order, and the possible scenario will be explained.

[0058] The first type is that the current first-level address management area does not have the first-level address management area of ​​the next link:

[0059] That is to say, if the first-level address management area of ​​the next link does not exist in the preset first-level address management area, when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the address of the preset first-level address management area can be reused when the front end applies for the address of the first-level address management area. The address cache pool in this application: supports the functions of applying for addresses and returning addresses. At present, the address cache pool built by FPGA internal storage resources and FPGA external storage resources will first apply for 8 addresses and put them in the address cache pool when initialized. When there is no data in the address cache pool, 8 addresses will be applied for and stored in the address cache pool. Each application is 8 addresses. If there is no data in the internal storage resources of FPGA, but there is data in the external storage resources of FPGA, the address in the external storage resources of FPGA needs to be moved to the internal storage resources of FPGA, and each move is 8 addresses. When the front end applies for an address, it will be directly read out from the address cache pool and sent out. When the front end returns the address, it will be placed in the address cache pool for queuing. The queuing method is as follows: The first method: When there is no data in the FPGA external storage resources and the FPGA internal storage resources are not full of data, it is directly stored in the FPGA internal storage resources. The second method: When the FPGA internal storage resources are full of data, it starts to be stored in the FPGA external storage resources. The third method: When there is data in the FPGA external storage resources, at this time, even if the FPGA internal storage resources are not full, it needs to be stored in the FPGA external storage resources. In this way, the recycled address needs to enter the address cache pool, which can achieve absolute utilization of space and will not waste space.

[0060] The second type is that the current first-level address management area has the next link, but no previous link. The first-level address management area is the address read out by the FPGA internal address management:

[0061] That is to say, if the first-level address management area of ​​the next link exists in the preset first-level address management area, and the first-level address management area of ​​the previous link does not exist, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the front end can reuse the address of the preset first-level address management area when applying for the address of the first-level address management area, and write the address of the first-level address management area of ​​the next link into the preset FPGA internal address management. At this time, the current first-level address management area is recycled, and the address of the first-level address management area of ​​the next link is written into the FPGA internal address management.

[0062] The third type is that the current first-level address management area has a next link and a previous link. The address of the first-level address management area is not the address read out by the FPGA internal address management:

[0063] That is to say, if the preset first-level address management area contains the first-level address management area of ​​the next link and the first-level address management area of ​​the previous link, and the first-level address management area of ​​the previous link is the address read from the non-preset FPGA internal address management, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the front end can reuse the address of the preset first-level address management area when applying for the address of the first-level address management area, and write the address of the first-level address management area of ​​the next link into the first address bit corresponding to the first-level address management area of ​​the previous link to eliminate invalid links. At this time, the current first-level address management area is recycled, and the address of the first-level address management area of ​​the next link is written into the first address bit of the first-level address management area of ​​the previous link, forming the function of eliminating invalid links of the link.

[0064] In this way, the space of the address cache pool is more flexible, and the addresses are dynamically allocated, supporting the application of as much as you want to use, and the space is quickly released after use, which greatly increases the utilization rate of storage space and greatly saves the consumption of FPGA internal resources.

[0065] See also Figure 4 As shown, an embodiment of the present invention discloses a pre-buried order storage device, comprising:

[0066] The address query module 11 is used to query whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management when receiving the pre-buried order according to the order channel number corresponding to the pre-buried order;

[0067] The insertion position determination module 12 is used to read the preset first-level address management area according to the address of the preset first-level address management area, if it exists, to obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the relationship between the maximum order number and the order number of the pre-buried order;

[0068] An order number acquisition module 13 is used to query the preset secondary data storage area address in the preset primary address management area using the insertion position, and read the preset secondary data storage area based on the preset secondary data storage area address to obtain each target order number of the stored pre-buried order;

[0069] The pre-buried order storage module 14 is used to determine the address to be inserted of the pre-buried order based on the order of magnitude of each target order number, and store the pre-buried order in the preset secondary data storage area according to the address to be inserted.

[0070] When storing a pre-buried order, the present application first queries whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order when the pre-buried order is received; if so, read the preset first-level address management area according to the preset first-level address management area address, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order; then query the preset second-level data storage area address in the preset first-level address management area using the insertion position, and read the preset second-level data storage area based on the preset second-level data storage area address to obtain each target order number of the stored pre-buried order; finally, determine the address to be inserted of the pre-buried order based on the size order of each target order number, and store the pre-buried order in the preset second-level data storage area according to the address to be inserted. It can be seen that the present application allocates dynamic addresses to the order channel numbers of pre-buried orders through FPGA internal address management, the first-level address management area, and the second-level data storage area, which greatly increases the utilization rate of storage space. Each index is dynamically allocated, which greatly saves the consumption of FPGA internal resources, greatly reduces storage space, and further improves the processing speed of order information. The orders are sorted from small to large according to the order numbers, which facilitates the FPGA to process the pre-buried orders in sequence.

[0071] In some specific embodiments, the device is also used to create a new first-level address management area and a second-level address management area to store the information of the pre-buried order if the preset first-level address management area address corresponding to the order channel number does not exist in the preset FPGA internal address management.

[0072] In some specific embodiments, the insertion position determination module 12 can be specifically used to determine the preset secondary data storage area corresponding to the maximum order number as the insertion position of the pre-buried order if the order number of the pre-buried order is less than the maximum order number.

[0073] In some specific embodiments, the device is also used to apply for a new first-level address management area if the number of preset second-level address management area addresses stored in the preset first-level address management area reaches a first quantity threshold, and store the new first-level address management area address corresponding to the new first-level address management area in the preset first-level address management area; if the number of pre-buried orders stored in the preset second-level address management area reaches a second quantity threshold, apply for a new second-level address management area, and store the new second-level address management area address corresponding to the new second-level address management area in the current first-level address management area.

[0074] In some specific embodiments, the device is also used for, if there is no first-level address management area of ​​the next link in the preset first-level address management area, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recovered to the preset address cache pool, so that the preset first-level address management area address can be reused when the front end applies for the first-level address management area address; if there is a first-level address management area of ​​the next link in the preset first-level address management area, and there is no first-level address management area of ​​the previous link, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recovered to the preset address cache pool, so that the preset first-level address management area address can be reused when the front end applies for the first-level address management area address. The first-level address management area address of the next link is reused, and the address of the first-level address management area of ​​the next link is written into the preset FPGA internal address management; if the first-level address management area of ​​the next link and the first-level address management area of ​​the previous link exist in the preset first-level address management area, and the first-level address management area of ​​the previous link is the address read from the non-preset FPGA internal address management, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recovered to the preset address cache pool, so that the front end can reuse the address of the preset first-level address management area when applying for the address of the first-level address management area, and write the address of the first-level address management area of ​​the next link into the first address bit corresponding to the first-level address management area of ​​the previous link to eliminate invalid links.

[0075] In some specific embodiments, the device is also used to reapply for a new secondary data storage area if the number of pre-placed orders in the preset secondary data storage area reaches a third quantity threshold, and store the order numbers in the preset secondary data storage area that meet the preset conditions in the new secondary data storage area.

[0076] In some specific embodiments, the device is also used for, when the front end deletes the pre-buried order, if there is a pre-buried order in the preset secondary data storage area, reclaiming the address of the preset secondary data storage area to a preset address cache pool, so that the preset secondary address management area address can be reused when the front end applies for the address of the secondary address management area; when the front end deletes the pre-buried order, if there are several pre-buried orders in the preset secondary data storage area, deleting the pre-buried order in the preset secondary data storage area according to the address to be inserted, and after rearranging the remaining pre-buried orders in the preset secondary data storage area, writing the corresponding arranged pre-buried orders into the preset secondary data storage area.

[0077] Furthermore, the present application also discloses an electronic device. Figure 5This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0078] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the pre-buried order storage method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0079] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0080] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.

[0081] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the pre-buried order storage method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0082] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed pre-buried order storage method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiment, and will not be repeated here.

[0083] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0084] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0085] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0086] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0087] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for storing a pre-buried order, characterized in that: include: When receiving a pre-buried order, query whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management according to the order channel number corresponding to the pre-buried order; If it exists, read the preset first-level address management area according to the address of the preset first-level address management area, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order; Using the insertion position to query the preset secondary data storage area address in the preset primary address management area, and reading the preset secondary data storage area based on the preset secondary data storage area address to obtain each target order number of the stored pre-buried order; The address to be inserted of the pre-buried order is determined based on the order of magnitude of each target order number, and the pre-buried order is stored in the preset secondary data storage area according to the address to be inserted.

2. The method for storing a pre-buying order according to claim 1, characterized in that: After querying, according to the order channel number corresponding to the pre-buried order, whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management, the method further includes: If the preset first-level address management area address corresponding to the order channel number does not exist in the preset FPGA internal address management, a new first-level address management area and a second-level address management area are created to store the information of the pre-buried order.

3. The method for storing pre-buying orders according to claim 1, characterized in that: The step of determining the insertion position of the pre-buried order based on the size relationship between the maximum order number and the order number of the pre-buried order includes: If the order number of the pre-buried order is smaller than the maximum order number, the preset secondary data storage area corresponding to the maximum order number is determined as the insertion position of the pre-buried order.

4. The method for storing a pre-buying order according to claim 1, characterized in that: Also includes: If the number of addresses of the preset second-level address management area stored in the preset first-level address management area reaches a first quantity threshold, apply for a new first-level address management area, and store the new first-level address management area address corresponding to the new first-level address management area into the preset first-level address management area; If the number of pre-buried orders stored in the preset secondary address management area reaches the second quantity threshold, a new secondary address management area is applied for, and the new secondary address management area address corresponding to the new secondary address management area is stored in the current primary address management area.

5. The method for storing pre-buying orders according to claim 1, characterized in that: Also includes: If the first-level address management area of ​​the next link does not exist in the preset first-level address management area, when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the address of the preset first-level address management area can be reused when the front end applies for the address of the first-level address management area; If the first-level address management area of ​​the next link exists in the preset first-level address management area, and the first-level address management area of ​​the previous link does not exist, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recycled to the preset address cache pool, so that the front end can reuse the address of the preset first-level address management area when applying for the address of the first-level address management area, and write the address of the first-level address management area of ​​the next link into the preset FPGA internal address management; If the preset first-level address management area contains the first-level address management area of ​​the next link and the first-level address management area of ​​the previous link, and the first-level address management area of ​​the previous link is an address read from the non-preset FPGA internal address management, then when the front end deletes the pre-buried order, the address of the preset first-level address management area is recovered to the preset address cache pool, so that the preset first-level address management area address can be reused when the front end applies for the first-level address management area address, and the address of the first-level address management area of ​​the next link is written into the first address bit corresponding to the first-level address management area of ​​the previous link to eliminate invalid links.

6. The method for storing a pre-buying order according to claim 1, characterized in that: After storing the pre-buried order in the preset secondary data storage area according to the address to be inserted, the method further includes: If the number of pre-placed orders in the preset secondary data storage area reaches a third quantity threshold, a new secondary data storage area is reapplied for, and the order numbers in the preset secondary data storage area that meet the preset conditions are stored in the new secondary data storage area.

7. The method for storing a pre-buried order according to any one of claims 1 to 6, characterized in that: Also includes: When the front end deletes the pre-buried order, if there is a pre-buried order in the preset secondary data storage area, the address of the preset secondary data storage area is recycled to the preset address cache pool, so that the preset secondary address management area address can be reused when the front end applies for the address of the secondary address management area; When the pre-buried order is deleted at the front end, if there are several pre-buried orders in the preset secondary data storage area, the pre-buried orders in the preset secondary data storage area are deleted according to the address to be inserted, and after the remaining pre-buried orders in the preset secondary data storage area are rearranged, the corresponding arranged pre-buried orders are written into the preset secondary data storage area.

8. A pre-buried single storage device, characterized in that: include: The address query module is used to query whether there is a preset first-level address management area address corresponding to the order channel number in the preset FPGA internal address management when receiving the pre-buried order according to the order channel number corresponding to the pre-buried order; An insertion position determination module is used to read the preset first-level address management area according to the address of the preset first-level address management area, if it exists, obtain the maximum order number of each corresponding preset second-level data storage area, and determine the insertion position of the pre-buried order based on the relationship between the maximum order number and the order number of the pre-buried order; An order number acquisition module is used to query the preset secondary data storage area address in the preset primary address management area using the insertion position, and read the preset secondary data storage area based on the preset secondary data storage area address to obtain each target order number of the stored pre-buried order; The pre-buried order storage module is used to determine the address to be inserted of the pre-buried order based on the size order of each target order number, and store the pre-buried order in the preset secondary data storage area according to the address to be inserted.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the pre-buried order storage method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the pre-buried order storage method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Indexing method and device based on key value pair KV system, electronic equipment and medium

    CN111241108A

  • High-speed parallel storage method based on FPGA storage and calculation integrated framework

    CN111813709A

  • Management control method and device of nonvolatile memory, equipment and medium

    CN118276779A

  • Storage control device, storage control program, and storage control method

    JP2016149051A

  • Address coding method and apparatus, and computer device and computer-readable storage medium

    WO2021189977A1

Cited By

  • Embedded single storage management method based on FPGA (Field Programmable Gate Array) in financial system

    CN122547711A

  • FPGA-based pre-embedded single storage management method in a financial system

    CN122547711B