CN113254389A - Data processing method and device based on FPGA, electronic equipment and storage medium - Google Patents

Data processing method and device based on FPGA, electronic equipment and storage medium Download PDF

Info

Publication number
CN113254389A
CN113254389A CN202110628908.7A CN202110628908A CN113254389A CN 113254389 A CN113254389 A CN 113254389A CN 202110628908 A CN202110628908 A CN 202110628908A CN 113254389 A CN113254389 A CN 113254389A
Authority
CN
China
Prior art keywords
financial
data
storage
code
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110628908.7A
Other languages
Chinese (zh)
Other versions
CN113254389B (en
Inventor
郭国峰
祝磊
胡国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huayun Information System Technology Co.,Ltd.
Original Assignee
Shenzhen Huayun Information System Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huayun Information System Co ltd filed Critical Shenzhen Huayun Information System Co ltd
Priority to CN202110628908.7A priority Critical patent/CN113254389B/en
Publication of CN113254389A publication Critical patent/CN113254389A/en
Application granted granted Critical
Publication of CN113254389B publication Critical patent/CN113254389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • G06F15/7867Architectures of general purpose stored program computers comprising a single central processing unit with reconfigurable architecture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a data processing method and device based on an FPGA (field programmable gate array), electronic equipment and a storage medium, which are applied to the FPGA, wherein the method comprises the following steps: receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial instrument; selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy; and determining that the first key data is a first storage address, and storing the first financial code into a first storage space corresponding to the first storage address. Therefore, the method can be easily realized on the FPGA, and the financial codes corresponding to the financial tools can be quickly stored on the FPGA.

Description

Data processing method and device based on FPGA, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus based on an FPGA, an electronic device, and a storage medium.
Background
The financial market, including the monetary market and the capital market, is the financing market. The fund financing refers to the activity of fund surplus regulation by both the fund supply and demand parties using various financial instruments in the process of economic operation, which is a general term of all financial transaction activities, and various financial instruments such as stocks, securities, deposit slips and the like are traded in the financial market.
Generally, the financial instruments concerned by different users are different, and for each financial instrument concerned by a user, the corresponding financial code (for example, stock code) is acquired and needs to be stored into the corresponding storage space. The corresponding storage address needs to be found through a hash algorithm, so that the financial code corresponding to the financial instrument is stored in the storage space corresponding to the storage address.
At present, due to the editable characteristic of an FPGA (Field Programmable Gate Array), the FPGA is mostly used to store financial codes corresponding to financial instruments. The corresponding storage address needs to be found through a hash algorithm, so that the financial code corresponding to the financial instrument is stored in the storage space corresponding to the storage address.
However, the common hash algorithm usually includes complex mathematical operations, and the FPGA is not suitable for the complex mathematical operations due to the characteristics of the FPGA itself, so the common hash algorithm is not suitable for being implemented on the FPGA, and thus the financial codes corresponding to the financial tools cannot be rapidly stored on the FPGA.
Disclosure of Invention
In order to solve the technical problem that the common hash algorithm is not suitable for being implemented on an FPGA and thus cannot be used for rapidly storing financial codes corresponding to financial instruments on the FPGA, embodiments of the present invention provide a data processing method and apparatus based on an FPGA, an electronic device, and a storage medium.
In a first aspect of the embodiments of the present invention, there is provided a data processing method based on an FPGA, applied to the FPGA, the method including:
receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial instrument;
selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy;
and determining that the first key data is a first storage address, and storing the first financial code into a first storage space corresponding to the first storage address.
In an optional embodiment, the selecting a preset number of first key data from the first financial code based on a preset financial code selection policy includes:
determining a first financial type corresponding to the first financial instrument;
searching a first financial code selection strategy corresponding to the first financial type according to a mapping relation between a preset financial type and a financial code selection strategy;
and selecting first key data with preset digits from the first financial codes according to the first financial code selection strategy.
In an optional embodiment, the selecting a preset number of first key data from the first financial code according to the first financial code selection policy includes:
and converting the first financial code into first system data, and selecting first key data with preset digits from the first system data according to the first financial code selection strategy.
In an optional embodiment, the storing the first financial code in the first storage space corresponding to the first storage address includes:
determining a memory corresponding to the FPGA, wherein the number of the memories is at least one;
reading first data stored in a first storage space corresponding to the first storage address in the memory in parallel;
determining whether the first data is consistent with the first financial code;
if the first data is not consistent with the first financial code, judging whether a first free storage space exists in a first storage space corresponding to the first storage address in the memory;
and if the first free storage space exists in the first storage space corresponding to the first storage address in the memory, storing the first financial code into the first free storage space.
In an optional embodiment, the method further comprises:
and if the first data is consistent with the first financial code, responding to the data storage request, and returning a prompt that the first financial code is stored.
In an optional embodiment, the method further comprises:
and if the first free storage space does not exist in the first storage space corresponding to the first storage address in the memory, processing the first storage address based on a preset linear probing algorithm, and skipping to the step of reading the first data stored in the first storage space corresponding to the first storage address in the memory in parallel.
In an optional embodiment, the method further comprises:
receiving a data query request, wherein the data query request carries a second financial code corresponding to a second financial tool;
selecting second key data with preset digits from the second financial codes based on a preset financial code selection strategy;
determining that the second key data is a second storage address, and inquiring second data stored in a second storage space corresponding to the second storage address;
and in the case that the second data is consistent with the second financial code, returning a prompt of successful query in response to the data query request.
In an optional embodiment, the selecting, based on a preset financial code selection policy, a preset number of second key data from the second financial code includes:
determining a second financial type corresponding to the second financial instrument;
searching a second financial code selection strategy corresponding to the second financial type according to a mapping relation between a preset financial type and a financial code selection strategy;
and selecting second key data with preset digits from the second financial codes according to the second financial code selection strategy.
In an optional embodiment, the selecting, according to the second financial code selection policy, a preset number of second key data from the second financial code includes:
and converting the second financial code into second binary data, and selecting second key data with preset digits from the second binary data according to the second financial code selection strategy.
In an optional embodiment, the querying second data stored in the second storage space corresponding to the second storage address includes:
determining a memory corresponding to the FPGA, wherein the number of the memories is at least one;
and reading second data stored in a second storage space corresponding to the second storage address in the memory in parallel.
In an optional embodiment, the method further comprises:
under the condition that the second data is not consistent with the second financial code, judging whether a second free storage space exists in a second storage space corresponding to the second storage address in the memory;
and if the second free storage space exists in the second storage space corresponding to the second storage address in the memory, responding to the data query request and returning a prompt of invalid query.
In an optional embodiment, the method further comprises:
and if the second free storage space does not exist in the second storage space corresponding to the second storage address in the memory, processing the second storage address based on a preset linear probing algorithm, and skipping to the step of reading the second data stored in the second storage space corresponding to the second storage address in the memory in parallel.
In a second aspect of the embodiments of the present invention, there is also provided an FPGA-based data processing apparatus, applied to an FPGA, the apparatus including:
the request receiving module is used for receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial tool;
the data selection module is used for selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy;
and the data storage module is used for determining that the first key data is a first storage address and storing the first financial code into a first storage space corresponding to the first storage address.
In a third aspect of the embodiments of the present invention, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor configured to implement the FPGA-based data processing method according to any one of the first aspect described above when executing the program stored in the memory.
In a fourth aspect of the embodiments of the present invention, there is further provided a storage medium, where instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the FPGA-based data processing method according to any one of the first aspect.
In a fifth aspect of the embodiments of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to perform any of the above-mentioned FPGA-based data processing methods.
According to the technical scheme provided by the embodiment of the invention, a data storage request is received, wherein the data storage request carries a first financial code corresponding to a first financial tool, first key data with preset digits are selected from the first financial code based on a preset financial code selection strategy, the first key data are determined to be a first storage address, and the first financial code is stored in a first storage space corresponding to the first storage address. Therefore, the method can be easily realized on the FPGA, and the financial codes corresponding to the financial tools can be quickly stored on the FPGA.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a data processing method based on an FPGA according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a method for selecting first key data with a preset number of bits according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an implementation of a first financial code storage method according to an embodiment of the present invention;
fig. 4 is a schematic implementation flow diagram of another FPGA-based data processing method according to an embodiment of the present invention;
fig. 5 is a schematic implementation flow chart of a method for selecting second key data with a preset number of bits according to an embodiment of the present invention;
fig. 6 is a schematic flowchart illustrating an implementation of a second data query method according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an FPGA-based data processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device shown in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As shown in fig. 1, an implementation flow diagram of a data processing method based on an FPGA provided in an embodiment of the present invention is applied to an FPGA, and the method specifically includes the following steps:
s101, receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial tool.
Generally, the financial instruments concerned by different users are different, and for each user, the user wants to store the financial codes corresponding to the financial instruments concerned by the user into the corresponding storage space. Here, the financial instrument refers to a stock, a security, a deposit receipt, etc., and the corresponding financial code refers to a stock code, a security code, etc., which are not limited in the embodiment of the present invention.
In order to store the financial codes corresponding to the financial instruments concerned by the user into the corresponding storage spaces, the user may trigger a data storage request at a terminal side or other device sides, and forward the data storage request to the FPGA, and the FPGA receives the data storage request, where the data storage request carries the first financial code corresponding to the first financial instrument.
For example, taking securities as an example, in order to store the security codes corresponding to the securities concerned by the user into the corresponding storage space, the user may trigger a data storage request on the terminal side, forward the data storage request to the FPGA, and receive the data storage request by the FPGA, where the data storage request carries the security codes corresponding to the securities (e.g., 160091).
S102, based on a preset financial code selection strategy, selecting first key data with preset digits from the first financial code.
For the first financial code, in the embodiment of the present invention, a preset number of bits of the first critical data may be selected from the first financial code based on a preset financial code selection policy. For example, for a security code, in an embodiment of the present invention, 9 digits of first key data (101010111) are selected from the security code based on a preset financial code selection policy, meaning that the first key data has a digit of 9.
For different financial instruments, the corresponding financial types are different, for example, stocks belong to stock types, securities belong to security types, and the financial code selection strategy can also be different correspondingly according to the difference of the financial types. Based on this, the embodiment of the present invention presets a mapping relationship between the financial type and the financial code selection policy, as shown in table 1 below.
Type of finance Financial code selection strategy
Type of stock Financial code selection strategy 1
Type of securities Financial code selection strategy 2
…… ……
TABLE 1
Based on the above, as shown in fig. 2, an implementation flow diagram of the method for selecting the first key data with the preset number of bits provided in the embodiment of the present invention is applied to an FPGA, and the method specifically includes the following steps:
s201, determining a first financial type corresponding to the first financial instrument.
In the embodiment of the invention, the corresponding financial types of different financial instruments are different, so that the first financial type corresponding to the first financial instrument can be determined. For example, if the first financial instrument is a security, then the first financial type corresponding to the first financial instrument may be determined: the type of security.
S202, searching a first financial code selection strategy corresponding to the first financial type according to the mapping relation between the preset financial type and the financial code selection strategy.
In the embodiment of the invention, for a first financial type corresponding to a first financial instrument, a first financial code selection strategy corresponding to the first financial type is searched according to a mapping relation between a preset financial type and a financial code selection strategy.
For example, the first financial type corresponding to the first financial instrument is a security type, and the financial code selection policy 2 corresponding to the security type is searched according to the mapping relationship between the financial type and the financial code selection policy shown in table 1.
S203, according to the first financial code selection strategy, first key data with preset digits are selected from the first financial codes.
In the embodiment of the present invention, for the first financial code selection policy corresponding to the first financial type, the first key data with the preset digit number may be selected from the first financial code according to the first financial code selection policy.
For example, for a financial code selection policy 2 corresponding to a security type, 9 digits of first key data, such as first key data 101010111, may be selected from the security code based on the financial code selection policy 2.
In the embodiment of the invention, the first financial code can be converted into the first binary data, and the first key data with the preset digit can be selected from the first binary data according to the first financial code selection strategy.
For example, for a security code, the security code is converted into binary data, and 9-bit first key data is selected from the binary data according to the financial code selection policy 2, wherein 9 bits of the binary data are selected as the 9-bit first key data.
It should be noted that, the first financial code is converted into the first binary data, specifically, may be converted into binary data, may be converted into octal data, and may be converted into hexadecimal data, and of course, the conversion into binary data is preferred, which is not limited in this embodiment of the present invention.
S103, determining the first key data as a first storage address, and storing the first financial code into a first storage space corresponding to the first storage address.
In the embodiment of the present invention, for the first critical data, it may be determined that the first critical data is a first storage address, so that the first financial code may be stored in a first storage space corresponding to the first storage address, thereby completing the storage of the first financial code.
Therefore, the method can be easily realized on the FPGA, and the financial codes corresponding to the financial tools can be quickly stored on the FPGA.
As shown in fig. 3, an implementation flow diagram of a storage method of a first financial code provided in an embodiment of the present invention is applied to an FPGA, and the method may specifically include the following steps:
s301, determining a memory corresponding to the FPGA, wherein the number of the memories is at least one.
For the FPGA, a corresponding memory may be configured in advance, for example, for the FPGA, four Block RAMs with a bit width of 27 and a depth of 512 are used, 2048 security codes may be stored, 27 bits of stored data include binary data of 1 bit occupied flag bit and 26 bit security codes, each RAM has a corresponding number, for example, 00, 01, 10, 11, and the like, and a storage address of the security code is composed of the number of the RAM and the lower 9 bits of the binary data of the 26 bit security codes.
Based on this, in the embodiment of the present invention, a memory corresponding to the FPGA may be determined, where the number of the memories is at least one. For example, four Block RAMs with 27 bit widths and 512 depth corresponding to the FPGA are determined: RAM00, RAM01, RAM10 and RAM11, and the storage space of each RAM is consistent.
S302, reading first data stored in a first storage space corresponding to the first storage address in the memory in parallel.
In the embodiment of the present invention, for the memory corresponding to the FPGA, in view of the parallel processing capability of the FPGA, the first data stored in the first storage space corresponding to the first storage address in the memory may be read in parallel, so that the first data stored in the first storage space corresponding to the first storage address in the memory may be obtained.
For example, by using the lower 9 bits of binary data of the security code as the first storage address, the first data stored in the first storage space corresponding to the first storage address in the 4 RAMs are read in parallel, which means that the first data stored in the first storage space corresponding to the first storage address is read for each RAM.
S303, judging whether the first data is consistent with the first financial code.
In the embodiment of the invention, whether the first data stored in the first storage space corresponding to the first storage address in the memory is consistent with the first financial code or not can be judged, so that whether the first financial code is stored or not can be determined.
For example, for the first data stored in the first storage space corresponding to the first storage address in the 4 RAMs, it is determined whether the first data is consistent with the security code, and it is determined whether to store the security code according to the determination result.
S304, if the first data is not consistent with the first financial code, judging whether a first free storage space exists in a first storage space corresponding to the first storage address in the memory.
In the embodiment of the present invention, for the first data stored in the first storage space corresponding to the first storage address in the memory, if the first data is consistent with the first financial code, it indicates that the first financial code is already stored, and the first financial code does not need to be stored again, and a prompt that the first financial code is already stored may be returned in response to the data storage request.
In addition, if the first data is not consistent with the first financial code, which indicates that the first financial code is not stored, it may be determined whether a first free storage space exists in the first storage space corresponding to the first storage address in the memory, so as to determine where to store the first financial code according to the determination result.
For example, for first data stored in a first storage space corresponding to the first storage address in 4 RAMs, it is determined whether the first data is consistent with a security code, if so, a prompt that the security code has been stored is returned in response to a data storage request, and if not, it is determined whether a first free storage space exists in the first storage space corresponding to the first storage address in the 4 RAMs.
S305, if the first free storage space exists in the first storage space corresponding to the first storage address in the memory, storing the first financial code into the first free storage space.
In the embodiment of the invention, if the first free storage space exists in the first storage space corresponding to the first storage address in the memory, the first financial code can be stored in the first free storage space, so that the storage of the first financial code is completed.
For example, a first free storage space exists in a first storage space corresponding to the first storage address in the 4 RAMs, so that the security code can be stored in the first free storage space, thereby completing the storage of the security code.
It should be noted that, for the first free storage space, there may be a plurality of first free storage spaces. For example, the number of the first storage spaces corresponding to the first storage addresses in the 4 RAMs is consistent with the number of the RAMs, and is also 4, the number of the first free storage spaces may be 3, 2, or 1, which is not limited in the embodiment of the present invention.
Therefore, one first free storage space is selected from the first free storage spaces according to the number of the RAM, and the first financial code is stored, wherein the first free storage space with the front number can be preferably selected for storing the first financial code, for example, the first free storage space in the RAM10 is selected, or the first free storage space in the RAM11 is selected.
In addition, if the first free memory space does not exist in the first memory space corresponding to the first memory address in the memory, which indicates that a memory address conflict occurs, the first memory address may be processed based on a preset linear probing algorithm, and a step of reading the first data stored in the first memory space corresponding to the first memory address in the memory in parallel, that is, S302, is skipped.
It should be noted that, here, the linear probe algorithm is in essence to make the first memory address increase in a line-up manner. For example, the first memory address is added with 1, or the first memory address is multiplied by 2 and then added with 1, and the way of increasing on the line is specifically, but is not limited in this embodiment of the present invention, and may be any way of increasing on the line.
For example, assuming that the current first storage address 101010100 is processed based on the preset linear probing algorithm, the current first storage address 101010100 is increased by 1, so that the first storage address is updated, and the process may jump to S302 again to continue the first financial code storage process until the first financial code storage is completed.
According to the technical scheme provided by the embodiment of the invention, a data storage request is received, wherein the data storage request carries a first financial code corresponding to a first financial tool, first key data with preset digits is selected from the first financial code based on a preset financial code selection strategy, the first key data is determined to be a first storage address, and the first financial code is stored in a first storage space corresponding to the first storage address.
Therefore, the method can be easily realized on the FPGA, and the financial codes corresponding to the financial tools can be quickly stored on the FPGA.
As shown in fig. 4, an implementation flow diagram of another FPGA-based data processing method provided in the embodiment of the present invention is applied to an FPGA, and the method specifically includes the following steps:
s401, receiving a data query request, wherein the data query request carries a second financial code corresponding to a second financial tool.
Generally, financial instruments of interest are different for different users, and for each user, the user sometimes wants to query the financial code corresponding to the financial instrument of interest. Here, the financial instrument refers to a stock, a security, a deposit receipt, etc., and the corresponding financial code refers to a stock code, a security code, etc., which are not limited in the embodiment of the present invention.
In order to realize that the user can inquire the financial codes corresponding to the concerned financial instruments, the user can trigger a data inquiry request at a terminal test or other equipment side, and forward the data inquiry request to the FPGA, and the FPGA receives the data inquiry request, wherein the data inquiry request carries the second financial codes corresponding to the second financial instruments.
For example, taking securities as an example, in order to enable a user to query the security codes corresponding to the securities concerned by the user, the user may trigger a data query request on a terminal test or other device side, and forward the data query request to the FPGA, and the FPGA receives the data query request, where the data query request carries the security codes corresponding to the securities.
S402, selecting second key data with preset digits from the second financial codes based on a preset financial code selection strategy.
For the second financial code, in the embodiment of the present invention, a preset number of second key data may be selected from the second financial code based on a preset financial code selection policy. For example, for a security code, in an embodiment of the present invention, 9 digits of second key data (101010111) are selected from the security code based on a preset financial code selection policy, meaning that the digits of the second key data are 9.
For different financial instruments, the corresponding financial types are different, for example, stocks belong to the stock type, securities belong to the security type, and correspondingly, the financial code selection strategy is also different along with the difference of the financial types. Based on this, the embodiment of the present invention presets a mapping relationship between the financial type and the financial code selection policy, as shown in table 1 above.
Based on the above, as shown in fig. 5, an implementation flow diagram of the method for selecting the second key data with the preset number of bits provided in the embodiment of the present invention is applied to an FPGA, and the method specifically includes the following steps:
s501, determining a second financial type corresponding to the second financial instrument.
In an embodiment of the present invention, the financial type corresponding to different financial instruments is different, so that the second financial type corresponding to the second financial instrument can be determined. For example, if the second financial instrument is a security, then a second financial type corresponding to the second financial instrument may be determined: the type of security.
S502, searching a second financial code selection strategy corresponding to the second financial type according to the mapping relation between the preset financial type and the financial code selection strategy.
In the embodiment of the invention, for the second financial type corresponding to the second financial instrument, the second financial code selection strategy corresponding to the second financial type is searched according to the mapping relation between the preset financial type and the financial code selection strategy.
For example, the second financial type corresponding to the second financial instrument is a security type, and the financial code selection policy 2 corresponding to the security type is searched according to the mapping relationship between the financial type and the financial code selection policy shown in table 1.
S503, selecting second key data with preset digits from the second financial codes according to the second financial code selection strategy.
In the embodiment of the present invention, for the second financial code selection policy corresponding to the second financial type, the second key data with the preset number of digits may be selected from the second financial code according to the second financial code selection policy.
For example, for a financial code selection policy 2 corresponding to a security type, 9 digits of second key data, such as second key data 101010111, may be selected from the security code according to the financial code selection policy 2.
In the embodiment of the invention, the second financial code can be converted into second binary data, and the second key data with the preset digits is selected from the second binary data according to the second financial code selection strategy.
For example, for a security code, the security code is converted into binary data, and 9-bit second key data is selected from the binary data according to the financial code selection policy 2, wherein 9 bits of the binary data are selected as the 9-bit second key data.
It should be noted that, the second financial code is converted into the second binary data, specifically, may be converted into the binary data, may be converted into the octal data, may be converted into the hexadecimal data, and is of course preferably converted into the binary data, which is not limited in this embodiment of the present invention.
And S403, determining that the second key data is a second storage address, and querying second data stored in a second storage space corresponding to the second storage address.
S404, under the condition that the second data is consistent with the second financial code, responding to the data query request and returning a prompt of successful query.
In this embodiment of the present invention, for the second critical data, it may be determined that the second critical data is a second storage address, so that the second data stored in the second storage space corresponding to the second storage address may be queried.
As shown in fig. 6, an implementation flow diagram of the query method for second data provided in the embodiment of the present invention is applied to an FPGA, and the method specifically includes the following steps:
s601, determining a memory corresponding to the FPGA, wherein the number of the memories is at least one.
In the embodiment of the present invention, this step is similar to the step S301, and the details of the embodiment of the present invention are not repeated herein.
S602, reading the second data stored in the second storage space corresponding to the second storage address in the memory in parallel.
In the embodiment of the invention, for the memory corresponding to the FPGA, the second data stored in the second storage space corresponding to the second storage address in the memory can be read in parallel, so that the second data stored in the second storage space corresponding to the second storage address in the memory can be obtained.
For example, by using the lower 9 bits of binary data of the security code as the second storage address, the second data stored in the second storage space corresponding to the second storage address in the 4 RAMs are read in parallel, which means that the second data stored in the second storage space corresponding to the second storage address is read for each RAM.
And for the second data, judging whether the second data is consistent with the second financial code, and under the condition that the second data is consistent with the second financial code, returning a prompt of successful query in response to the data query request.
Therefore, the financial code can be easily realized on the FPGA, and the financial code corresponding to the financial tool can be quickly inquired on the FPGA.
For example, for the second data stored in the second storage space corresponding to the second storage address in the 4 RAMs, in the case that the second data is consistent with the security code, a prompt of successful query is returned in response to the data query request.
And if the second free storage space exists in the second storage space corresponding to the second storage address in the memory, returning a prompt that the query is invalid in response to the data query request, which means that the second financial code is not stored.
For example, for second data stored in a second storage space corresponding to the second storage address in 4 RAMs, if the second data is not consistent with the security code, it is determined whether a second free storage space exists in the second storage space corresponding to the second storage address in 4 RAMs, and if the second free storage space exists in the second storage space corresponding to the second storage address in 4 RAMs, which indicates that the security code is not stored, a prompt for invalidity of the query is returned in response to the data query request.
In addition, if there is no second free memory space in the second memory space corresponding to the second memory address in the memory, which indicates that a memory address conflict occurs, the second memory address may be processed based on a preset linear probing algorithm, and a step of reading the second data stored in the second memory space corresponding to the second memory address in the memory in parallel, that is, S602, may be skipped.
It should be noted that, here, the linear probing algorithm is substantially a manner of increasing the first memory address in a line-up manner, for example, adding 1 to the first memory address, or multiplying the first memory address by 2 and then adding 1, specifically, the manner of increasing in a line-up manner is not particularly limited in the embodiment of the present invention, and may be any manner of increasing in a line-up manner.
For example, assuming that the current second storage address 101010100 is processed based on the preset linear probe algorithm, the current second storage address 101010100 is increased by 1, so that the second storage address is updated, and the process may jump to S602 to continue the query process of the second financial code until the query process of the second financial code is completed.
Through the above description of the technical solution provided by the embodiment of the present invention, a data query request is received, where the data query request carries a second financial code corresponding to a second financial instrument, second key data with a preset number of bits is selected from the second financial code based on a preset financial code selection policy, the second key data is determined to be a second storage address, second data stored in a second storage space corresponding to the second storage address is queried, and a prompt of successful query is returned in response to the data query request when the second data is consistent with the second financial code.
Therefore, the financial code can be easily realized on the FPGA, and the financial code corresponding to the financial tool can be quickly inquired on the FPGA. It should be noted that, the storing of the financial code and the query process may be performed simultaneously, and the result is output simultaneously, which is not limited in the embodiment of the present invention.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides an FPGA-based data processing apparatus, as shown in fig. 7, applied to an FPGA, where the apparatus may include: a request receiving module 710, a data selecting module 720 and a data storing module 730.
A request receiving module 710, configured to receive a data storage request, where the data storage request carries a first financial code corresponding to a first financial instrument;
the data selecting module 720 is configured to select, based on a preset financial code selecting policy, first key data with a preset digit from the first financial code;
the data storage module 730 is configured to determine that the first critical data is a first storage address, and store the first financial code in a first storage space corresponding to the first storage address.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, which includes a processor 81, a communication interface 82, a memory 83, and a communication bus 84, where the processor 81, the communication interface 82, and the memory 83 complete mutual communication through the communication bus 84,
a memory 83 for storing a computer program;
the processor 81 is configured to implement the following steps when executing the program stored in the memory 83:
receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial instrument; selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy; and determining that the first key data is a first storage address, and storing the first financial code into a first storage space corresponding to the first storage address.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In another embodiment of the present invention, a storage medium is further provided, where instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the FPGA-based data processing method according to any one of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the FPGA-based data processing method of any one of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (15)

1. A data processing method based on FPGA is characterized in that the method is applied to FPGA and comprises the following steps:
receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial instrument;
selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy;
and determining that the first key data is a first storage address, and storing the first financial code into a first storage space corresponding to the first storage address.
2. The method of claim 1, wherein the selecting a predetermined number of first key data from the first financial code based on a predetermined financial code selection policy comprises:
determining a first financial type corresponding to the first financial instrument;
searching a first financial code selection strategy corresponding to the first financial type according to a mapping relation between a preset financial type and a financial code selection strategy;
and selecting first key data with preset digits from the first financial codes according to the first financial code selection strategy.
3. The method of claim 2, wherein the selecting a predetermined number of first key data from the first financial code according to the first financial code selection policy comprises:
and converting the first financial code into first system data, and selecting first key data with preset digits from the first system data according to the first financial code selection strategy.
4. The method of claim 1, wherein storing the first financial code in the first memory space corresponding to the first memory address comprises:
determining a memory corresponding to the FPGA, wherein the number of the memories is at least one;
reading first data stored in a first storage space corresponding to the first storage address in the memory in parallel;
determining whether the first data is consistent with the first financial code;
if the first data is not consistent with the first financial code, judging whether a first free storage space exists in a first storage space corresponding to the first storage address in the memory;
and if the first free storage space exists in the first storage space corresponding to the first storage address in the memory, storing the first financial code into the first free storage space.
5. The method of claim 4, further comprising:
and if the first data is consistent with the first financial code, responding to the data storage request, and returning a prompt that the first financial code is stored.
6. The method of claim 4, further comprising:
and if the first free storage space does not exist in the first storage space corresponding to the first storage address in the memory, processing the first storage address based on a preset linear probing algorithm, and skipping to the step of reading the first data stored in the first storage space corresponding to the first storage address in the memory in parallel.
7. The method of claim 1, further comprising:
receiving a data query request, wherein the data query request carries a second financial code corresponding to a second financial tool;
selecting second key data with preset digits from the second financial codes based on a preset financial code selection strategy;
determining that the second key data is a second storage address, and inquiring second data stored in a second storage space corresponding to the second storage address;
and in the case that the second data is consistent with the second financial code, returning a prompt of successful query in response to the data query request.
8. The method of claim 7, wherein the selecting a predetermined number of second key data from the second financial code based on a predetermined financial code selection policy comprises:
determining a second financial type corresponding to the second financial instrument;
searching a second financial code selection strategy corresponding to the second financial type according to a mapping relation between a preset financial type and a financial code selection strategy;
and selecting second key data with preset digits from the second financial codes according to the second financial code selection strategy.
9. The method of claim 8, wherein selecting a predetermined number of second key data from the second financial code according to the second financial code selection policy comprises:
and converting the second financial code into second binary data, and selecting second key data with preset digits from the second binary data according to the second financial code selection strategy.
10. The method of claim 7, wherein the querying the second data stored in the second storage space corresponding to the second storage address comprises:
determining a memory corresponding to the FPGA, wherein the number of the memories is at least one;
and reading second data stored in a second storage space corresponding to the second storage address in the memory in parallel.
11. The method of claim 10, further comprising:
under the condition that the second data is not consistent with the second financial code, judging whether a second free storage space exists in a second storage space corresponding to the second storage address in the memory;
and if the second free storage space exists in the second storage space corresponding to the second storage address in the memory, responding to the data query request and returning a prompt of invalid query.
12. The method of claim 11, further comprising:
and if the second free storage space does not exist in the second storage space corresponding to the second storage address in the memory, processing the second storage address based on a preset linear probing algorithm, and skipping to the step of reading the second data stored in the second storage space corresponding to the second storage address in the memory in parallel.
13. An FPGA-based data processing apparatus, applied to an FPGA, the apparatus comprising:
the request receiving module is used for receiving a data storage request, wherein the data storage request carries a first financial code corresponding to a first financial tool;
the data selection module is used for selecting first key data with preset digits from the first financial codes based on a preset financial code selection strategy;
and the data storage module is used for determining that the first key data is a first storage address and storing the first financial code into a first storage space corresponding to the first storage address.
14. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 12 when executing a program stored in the memory.
15. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-12.
CN202110628908.7A 2021-06-07 2021-06-07 Data processing method and device based on FPGA, electronic equipment and storage medium Active CN113254389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110628908.7A CN113254389B (en) 2021-06-07 2021-06-07 Data processing method and device based on FPGA, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110628908.7A CN113254389B (en) 2021-06-07 2021-06-07 Data processing method and device based on FPGA, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113254389A true CN113254389A (en) 2021-08-13
CN113254389B CN113254389B (en) 2021-10-29

Family

ID=77186598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110628908.7A Active CN113254389B (en) 2021-06-07 2021-06-07 Data processing method and device based on FPGA, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113254389B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225977A (en) * 2023-05-09 2023-06-06 中信建投证券股份有限公司 Memory address determining method and circuit system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7996288B1 (en) * 2000-11-15 2011-08-09 Iprivacy, Llc Method and system for processing recurrent consumer transactions
CN105095095A (en) * 2014-05-12 2015-11-25 上海大学 Computer system and data reading and writing method
US20180211321A1 (en) * 2013-03-15 2018-07-26 Broadridge Financial Solutions, Inc. Mapping consumer ownership of financial assets to geographic localities and computer-implemented methods and computer systems thereof
CN109766316A (en) * 2018-12-18 2019-05-17 深圳壹账通智能科技有限公司 File acquisition method, device, computer equipment and storage medium
CN111857868A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Security data reading and writing method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7996288B1 (en) * 2000-11-15 2011-08-09 Iprivacy, Llc Method and system for processing recurrent consumer transactions
US20180211321A1 (en) * 2013-03-15 2018-07-26 Broadridge Financial Solutions, Inc. Mapping consumer ownership of financial assets to geographic localities and computer-implemented methods and computer systems thereof
CN105095095A (en) * 2014-05-12 2015-11-25 上海大学 Computer system and data reading and writing method
CN109766316A (en) * 2018-12-18 2019-05-17 深圳壹账通智能科技有限公司 File acquisition method, device, computer equipment and storage medium
CN111857868A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Security data reading and writing method, device, equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225977A (en) * 2023-05-09 2023-06-06 中信建投证券股份有限公司 Memory address determining method and circuit system
CN116225977B (en) * 2023-05-09 2023-08-11 中信建投证券股份有限公司 Memory address determining method and circuit system

Also Published As

Publication number Publication date
CN113254389B (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN107798038B (en) Data response method and data response equipment
CN111062013B (en) Account filtering method and device, electronic equipment and machine-readable storage medium
CN110110165B (en) Dynamic routing method and device for query engine in precomputation system
CN113254389B (en) Data processing method and device based on FPGA, electronic equipment and storage medium
CN111914279B (en) Efficient and accurate privacy intersection system, method and device
CN105989457A (en) Information query method and apparatus thereof
CN111026765A (en) Dynamic processing method, equipment, storage medium and device for strictly balanced binary tree
CN110727895B (en) Sensitive word sending method and device, electronic equipment and storage medium
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN110334019B (en) Test method, test device and readable storage medium
CN111708831A (en) Global primary key generation method and device
US8688542B2 (en) Method, system and apparatus for managing a bid tracking database
CN114429177A (en) Equipment fingerprint feature screening method and device, electronic equipment and storage medium
CN113592495A (en) Block chain-based evidence storing method, device and system
CN112634012A (en) Service data processing method, device, server and storage medium
CN112784552A (en) Table editing method and device
CN112579682A (en) Data model change notification method and device, electronic device and storage medium
US20080270475A1 (en) Data processing systems and methods for connecting business objects to data sources
CN112256706B (en) Method and device for determining handle reference state
CN111476545B (en) Method and device for determining key power supply end, computer equipment and storage medium
CN110209666B (en) data storage method and terminal equipment
CN115563030A (en) Configuration data processing method and device, electronic equipment and storage medium
CN117271849A (en) Method, device and medium for searching quick address matching based on graph database
CN113379506A (en) Quotation scheme generation method and device, electronic equipment and storage medium
TWM640987U (en) video access system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Data processing method, device, electronic equipment and storage medium based on FPGA

Effective date of registration: 20220615

Granted publication date: 20211029

Pledgee: Shenzhen hi tech investment small loan Co.,Ltd.

Pledgor: Shenzhen Huayun Information System Co.,Ltd.

Registration number: Y2022980007817

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 9th Floor, Block A, Shenzhen National Engineering Laboratory Building, No. 20, Gaoxin South 7th Road, High-tech Zone Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Huayun Information System Technology Co.,Ltd.

Address before: No. 904, block a, national engineering laboratory building, Gaoxin South 7th road digital technology park, Yuehai street, Nanshan District, Shenzhen, Guangdong 518000

Patentee before: Shenzhen Huayun Information System Co.,Ltd.

PC01 Cancellation of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230711

Granted publication date: 20211029

Pledgee: Shenzhen hi tech investment small loan Co.,Ltd.

Pledgor: Shenzhen Huayun Information System Co.,Ltd.

Registration number: Y2022980007817