Hardware acceleration card, acceleration system, method, device, medium and program product

The hardware acceleration card sends configuration information to the host side to calculate the target column offset and request target column field data, which solves the problem of data transmission delay of external acceleration devices and achieves efficient data processing and query performance improvement.

CN118503204BActive Publication Date: 2024-10-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410948789.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-10-11
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

In the prior art, the external acceleration device retrieves the accelerated data after completing the data acceleration processing, which results in a long delay in the round-trip transmission of data and affects the data processing speed.

Method used

Design a hardware accelerator card that calculates the target column offset by sending configuration information from the host side, generates interrupt information, requests the target column field data from the host side, and performs acceleration processing in the hardware accelerator card to avoid transmitting the entire page or unnecessary data , only transmit the target column field data, reducing the transmission bandwidth.

Benefits of technology

It greatly reduces data transmission delay and bandwidth, improves data processing speed, supports access to variable-length fields and ultra-long fields, and improves database query performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503204B_ABST
    Figure CN118503204B_ABST
Patent Text Reader

Abstract

The present invention provides a hardware acceleration card, an acceleration system, a method, a device, a medium and a program product, which relate to the field of data processing technology, and include: the hardware acceleration card calculates the target column offset of each page according to the configuration information sent by the host side to generate the column data request of each page, and sends the interrupt information containing the column data request to the host side; when receiving the reply message fed back by the host side in response to the interrupt information, the target offset of the variable-length column is calculated based on the variable-length column length in the reply message, and the filtering calculation operation is performed based on the column field data in the reply message to determine the filtering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a hardware acceleration card, an acceleration system, a method, a device, a medium and a program product. Background Art

[0002] With the rapid development of the Internet and the Internet of Things, the amount of data is growing exponentially. Traditional software processing methods can no longer meet the needs of large-scale data processing.

[0003] In order to solve the problem of large-scale data processing, database hardware acceleration technology has gradually been widely used and developed. Database hardware acceleration can accelerate database operations and improve data processing efficiency and throughput through dedicated hardware devices, such as Field Programmable Gate Array (FPGA). Hardware acceleration can directly process large-scale data at the hardware level, reducing the bottleneck of software processing and providing higher performance and response speed. At the same time, hardware acceleration can also improve the efficiency of database query and access through parallel computing and optimization algorithms to meet real-time requirements and high concurrent access requirements.

[0004] Then, after completing the data acceleration processing, the existing external acceleration device retrieves the accelerated data from the external acceleration device. The back-and-forth transmission of data will cause a long delay and waiting, resulting in slow data processing speed. Summary of the invention

[0005] The present invention provides a hardware acceleration card, an acceleration system, a method, a device, a medium and a program product, which are used to solve the defect in the prior art that after completing the data acceleration processing, the external acceleration device retrieves the accelerated data from the external acceleration device, and the back-and-forth transmission of data causes a long delay and waiting, resulting in a slow data processing speed.

[0006] The present invention provides a hardware acceleration card, comprising:

[0007] The hardware acceleration card calculates the target column offset of each page according to the configuration information sent by the host side to generate a column data request for each page, and sends interrupt information including the column data request to the host side;

[0008] When receiving a reply message from the host side in response to the interrupt information feedback, a target offset calculation of the variable-length column is performed based on the variable-length column length in the reply message, and a filtering calculation operation is performed based on the column field data in the reply message to determine the filtering result.

[0009] According to a hardware acceleration card provided by the present invention, the hardware acceleration card is specifically used for

[0010] In case of detecting a variable-length column of a first page, suspending processing of the column data of the first page, generating a variable-length column length request, and continuing processing of the column data of a next page;

[0011] The variable-length column length request is combined with the column data request of each page to obtain the interruption information.

[0012] According to a hardware acceleration card provided by the present invention, the hardware acceleration card comprises: a column length register and a column selection register;

[0013] The hardware acceleration card obtains the column length of the target column through the column length register;

[0014] When the column length is greater than a first preset threshold, the target column is a fixed-length column, and the column length of the fixed-length column is directly obtained;

[0015] When the column length is less than or equal to the first preset threshold, the target column is a variable-length column, the page group state of the target column is marked as a suspended state, and the processing of the page corresponding to the target column is suspended until the variable-length column length of the target column is received;

[0016] The column selection register is used to generate the variable-length column length request and the column data request.

[0017] According to a hardware acceleration card provided by the present invention, the hardware acceleration card is specifically used for:

[0018] When the variable-length column length of the target column is received, the page group state of the target column is switched from the suspended state to the ready state, and the page corresponding to the target column continues to be processed.

[0019] According to a hardware acceleration card provided by the present invention, the hardware acceleration card comprises: an on-chip random access memory, a message parsing unit, a data selector, and a type selector;

[0020] Wherein, the on-chip random access memory is used to obtain a reply message;

[0021] The message parsing unit is used to parse the reply message to obtain column field data and variable length column length;

[0022] The data selector is used to transmit the variable-length column length to the hardware acceleration card for variable-length column parsing, and transmit the column field data to the type selector;

[0023] The type selector selects a corresponding first-in-first-out queue interface for the column field data according to different data types to perform filtering and calculation operations.

[0024] According to a hardware acceleration card provided by the present invention, the hardware acceleration card comprises: an input first-in first-out queue interface, a user interface register, an operation array group, a truth value register group and a filtering result register group;

[0025] Wherein, the input FIFO queue interface is used to store the column field data into a comparator array of a corresponding type according to the FIFO queue type;

[0026] Wherein, the user interface register is used to provide a constant register and an operator register containing each column, and a truth table register of the comparison result;

[0027] The operation array group performs filtering calculations on column data and outputs filtering results for each row;

[0028] Wherein, the truth value register group is used to store the output result of the operation array;

[0029] The filtering result register group is used to store a truth table of whether each row meets the filtering condition.

[0030] According to a hardware acceleration card provided by the present invention, the operation array group includes: a string operation array, a lower boundary comparator array and an upper boundary comparator array;

[0031] The string operation array is used to perform string comparison, inclusion and regular expression operations on string type data;

[0032] The lower boundary comparator array and the upper boundary comparator array are used to perform lower boundary comparison operations on numerical type data and upper boundary comparison operations on numerical type data, respectively, to support range query of numerical type data.

[0033] According to a hardware acceleration card provided by the present invention, the truth value register group includes a plurality of registers, each of which corresponds to a comparison operation result of a column in each row;

[0034] The truth register group is also used to compare the value of the page register group with the truth table register in the user interface register after all target columns in a page have completed comparison calculations; and output the results that meet the filtering conditions to the filtering result register group.

[0035] According to a hardware acceleration card provided by the present invention, the hardware acceleration card is specifically used for:

[0036] Initialize the user interface register group according to the where clause of the structured query statement; wherein the where clause is used to configure the constants and operators in the user's filtering conditions for the target column into the user interface register;

[0037] According to the first-in-first-out queue type, the column field data is stored in a comparator array of the corresponding type, and according to the column index in the column field data, the corresponding constant and operator are loaded from the user interface register group;

[0038] Performing batch comparison operations according to the constants, operators and column field data, and outputting the operation results to the columns of the corresponding pages in the truth value register group;

[0039] When all target columns in any target page have completed the comparison operation, comparing the corresponding value of the target page in the truth register group with the truth table register corresponding to the target page in the user interface register group;

[0040] Determine whether each row of data meets all the filtering conditions based on the comparison results, and output the filtering results to the filtering result register group.

[0041] The present invention also provides an acceleration system based on any of the above-mentioned hardware acceleration cards, the system comprising: a hardware acceleration card and a host side;

[0042] The host side sends configuration information including query table information to the hardware acceleration card;

[0043] The hardware acceleration card calculates the target column offset of each page according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message including the column data request and the variable-length column length request to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0044] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0045] The host side transmits a reply message to the hardware acceleration card, wherein the reply message includes at least one of column field data and variable-length column length;

[0046] The hardware acceleration card performs target offset calculation of the variable-length column based on the variable-length column length in the reply message, and performs filtering calculation operations based on the column field data in the reply message to determine a filtering result.

[0047] According to an acceleration system provided by the present invention, the host side is specifically used for:

[0048] According to the attribute information of the column field in the user's query statement, a column attribute description table is constructed;

[0049] Constructing a column selection table according to the column numbers corresponding to the where clause in the query statement;

[0050] The column attribute description table and the column selection table are used as parameters to obtain the configuration information.

[0051] According to an acceleration system provided by the present invention, the host side is specifically used for:

[0052] Determine the specific position of the column field in the database according to the column field request in the interrupt information, so as to obtain the column field data from the database;

[0053] Determine the variable length column length of the corresponding variable length column according to the variable length column length request in the interrupt information;

[0054] The extracted column field data and the variable-length column length are repackaged according to the request type and field index, and then transmitted to the hardware acceleration card as a reply message.

[0055] According to an acceleration system provided by the present invention, the host side is specifically used for:

[0056] Acquire the filtering result from the hardware acceleration card, and determine the row data satisfying the filtering condition according to the page identity information and the row number in the filtering result;

[0057] Return the row data that meets the filter conditions to the upper node of the database query plan.

[0058] The present invention also provides an acceleration method based on any of the above acceleration systems, comprising:

[0059] The host side sends configuration information including query table information to the hardware acceleration card;

[0060] The hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message containing column field data and a variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0061] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0062] The hardware acceleration card obtains a reply message from the host side, performs a target offset calculation of the variable-length column according to the variable-length column length in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

[0063] According to an acceleration method provided by the present invention, the method further includes:

[0064] In a case where the column length of the target column obtained through the column length register in the hardware acceleration card is greater than a first preset threshold, determining that the target column is a fixed-length column, and directly obtaining the column length of the fixed-length column;

[0065] When the column length of the target column is less than or equal to a first preset threshold value obtained through the column length register in the hardware acceleration card, the target column is determined to be a variable-length column, a page group state of the variable-length column is marked as a suspended state, processing of a page corresponding to the variable-length column is suspended, and a response to the variable-length column length request is waited for by the host side;

[0066] The hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request.

[0067] According to an acceleration method provided by the present invention, after the step that the hardware acceleration card continues to process column data of the next page while waiting for the host side to respond to the variable-length column length request, the method further includes:

[0068] When the hardware acceleration card receives the variable-length column length of the variable-length column, the page group state of the variable-length column is switched to a ready state, and a target offset calculation of the variable-length column is performed based on the variable-length column length;

[0069] A column data request for the variable-length column is generated based on the target column offset of the variable-length column.

[0070] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-described acceleration methods is implemented.

[0071] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the acceleration methods described above.

[0072] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the acceleration method described above is implemented.

[0073] The hardware acceleration card, acceleration system, method, device, medium and program product provided by the present invention transmit only the configuration information of the page to the hardware acceleration card. In the hardware acceleration card, the target column offset of each page is calculated according to the configuration information, thereby generating interrupt information according to the target column offset, requesting the target column field data from the host side, and accelerating the target column field data through the hardware acceleration card, thereby avoiding the transmission of the entire page or unnecessary data during the data acceleration process. Only the target column field data needs to be transmitted, which greatly reduces the required transmission bandwidth, and supports the access to variable-length fields and ultra-long fields, effectively improving the data processing speed. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0075] Figure 1 Introducing hardware accelerator card calculation process into related technologies;

[0076] Figure 2 It is the storage format of PostgreSQL database in the related technology;

[0077] Figure 3 A schematic diagram of accessing an overlong field in the related art;

[0078] Figure 4 A schematic diagram of the hardware acceleration card structure provided in an embodiment of the present application;

[0079] Figure 5 Analyze the calculation flow chart in the related technology;

[0080] Figure 6 It is a schematic diagram of the structure of the analytical component described in the embodiments of the present application;

[0081] Figure 7 A workflow diagram of the analysis component provided in the embodiment of the present application;

[0082] Figure 8 A schematic diagram illustrating an example of storage provided in an embodiment of the present application;

[0083] Fig. 9 A schematic diagram of initializing original information provided in an embodiment of the present application;

[0084] Fig.10 A schematic diagram of calculating a fixed-length column provided in an embodiment of the present application;

[0085] Fig.11 A processing flow chart for encountering variable-length columns provided in an embodiment of the present application;

[0086] Fig.12 This is the processing flow after receiving the variable length column length value in the embodiment of the present application;

[0087] Fig.13 A schematic diagram of the structure of a reader provided in an embodiment of the present application;

[0088] Fig.14 This is a schematic diagram of the reading operation in the embodiment of the present application;

[0089] Fig.15 A schematic diagram of the filter structure provided in the embodiment of the present application;

[0090] Fig.16 A schematic diagram of the internal structure of a computing array provided in an embodiment of the present application;

[0091] Fig.17 A flowchart of the filter element described in the embodiment of the present application;

[0092] Fig.18 A schematic diagram of an example flow of filtering calculation provided in an embodiment of the present application;

[0093] Fig.19 This is a schematic diagram of the acceleration system structure described in the embodiments of the present application;

[0094] Fig. 20 A schematic diagram of the message format provided in the embodiment of the present application;

[0095] Fig.21 A schematic diagram of the reply message format provided for an embodiment of the present application;

[0096] Fig. 22 A schematic diagram of a table provided for an embodiment of the present application;

[0097] Fig.23 A schematic diagram of request merging provided for an embodiment of the present application;

[0098] Fig.24 The configuration analysis component workflow provided for the embodiment of the present application;

[0099] Fig.25 An example diagram of user query provided in an embodiment of the present application;

[0100] Fig.26 An example diagram of the invention operation provided for the embodiment of the present application;

[0101] Fig. 27 A schematic diagram of the acceleration method provided in the embodiment of the present application;

[0102] Fig.28 A technical comparison diagram provided for the embodiments of the present application;

[0103] Fig.29 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0104] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0105] Figure 1 The calculation process after introducing the hardware acceleration card in related technologies, such as Figure 1 As shown, including:

[0106] ① The host side obtains the database data from the disk and reads it into the host side memory.

[0107] ②The host side first sends the data to the accelerator card memory.

[0108] ③ Multiple execution units in the accelerator card perform parallel calculations to complete the parsing and filtering calculations of the database pages, and write the results that meet the conditions into the accelerator card memory.

[0109] ④The host side can read the calculation results from inside the accelerator card.

[0110] ⑤ The host side obtains the calculation results of the acceleration card and processes the subsequent business processes.

[0111] Since multiple computing units (CUs) can be created in the accelerator card, and multiple processing elements (PEs) can be created in each computing unit, each PE can perform computing tasks, and multiple PEs can be executed in parallel, thus providing stronger computing power and reducing database computing latency, thus achieving a better user experience.

[0112] Although the use of hardware acceleration technology can provide strong computing power support and improve database query performance, it still faces the following problems:

[0113] First, the host side needs to send data to the accelerator card, and then retrieve it from the accelerator card after the calculation results are completed. Figure 1 As shown in steps ① and ②, delays and waiting will occur during the data transmission process, and the time consumed in data transmission constitutes the main delay.

[0114] On the other hand, how to efficiently access variable-length fields in the database in the acceleration card is still a difficult problem that needs to be solved. In mainstream relational databases, each column field is stored in a row storage manner. Column fields include fixed-length fields and variable-length fields. For fixed-length fields, the field length is stored in the column attribute table; for variable-length fields, the field length is stored in the column data header. Due to the existence of variable-length fields, when the user needs to access the Nth column, it is necessary to parse the first N-1 columns one by one to obtain the offset of the Nth column in the row. The process of parsing each column requires cumulative calculations one by one, which constitutes the main performance bottleneck in the query process.

[0115] Figure 2 For the PostgreSQL database storage format in the related technology, such as Figure 2 As shown in the figure, taking PostgreSQL database as an example, the database stores row records of different lengths in fixed-size pages, and the number of rows stored in the page is marked, as well as the offset of each row in the page. A row contains multiple column fields. For fixed-length fields, their length values ​​are marked in the column field attribute table; for variable-length column fields, the length in the column field attribute table is marked as -1, and the actual length is stored at the beginning of the corresponding column. In order to save storage space, when the column length is short (<128B), 1B is used to represent it, and when the column length is long (>128B), 4B is used to represent it. When the user needs to access column 4, since column 2 is a variable-length field, the database needs to calculate the length of columns 0-3, and then calculate the storage offset of column 4 in the row after accumulation. The accumulation calculation process will cause a large calculation delay.

[0116] In addition, mainstream relational databases store row data in fixed-size pages in data table files, and each row contains multiple fields. Since the page size is fixed, if the length of a field exceeds the page size, the page cannot store the field. This field is called an overlong field. The mainstream database usually handles overlong fields by storing the overlong field in a special overlong field file, storing a pointer in the column field position, pointing to the overlong field file and marking the index information of the overlong field in the file. When using hardware acceleration technology, since the overlong field file is separated from the data file, if access to the overlong field is added, it will cause non-sequential access to the FPGA off-chip storage, and non-sequential access will seriously affect the processing performance of the pipeline in the FPGA. Therefore, the data table file can only be transferred to the FPGA, and the overlong field file is not loaded, resulting in a lack of support for overlong fields in the database. In other words, the related technology cannot achieve support for overlong fields.

[0117] Figure 3 A schematic diagram of accessing an overlong field in the related art, such as Figure 3As shown in the figure, taking the PostgreSQL database as an example, row data is stored in units of 8KB. When the user enters a field length of 10KB (field B4 in the figure), the field cannot be stored in the page. The field content will be stored in a special over-long field file, and the field location stores a pointer to the field content. In the prior art, hardware acceleration only transfers the data table file to the FPGA. When the FPGA parses the over-long field, it cannot access the data in the field content and can only mark it as unprocessable.

[0118] The hardware acceleration card calculates the target column offset of each page according to the configuration information sent by the host side to generate a column data request for each page, and sends interrupt information including the column data request to the host side;

[0119] When receiving a reply message from the host side in response to the interrupt information feedback, a target offset calculation of the variable-length column is performed based on the variable-length column length in the reply message, and a filtering calculation operation is performed based on the column field data in the reply message to determine the filtering result.

[0120] More specifically, Figure 4 A schematic diagram of the hardware acceleration card structure provided in the embodiment of the present application is shown in FIG. Figure 4 As shown, it includes: an analysis component 410, a reading component 420, a filtering component 430 and a writing-back component 440; the reading component 420 is connected to the analysis component 410 and the filtering component 430 respectively, and the filtering component 430 is connected to the writing-back component 440;

[0121] The parsing unit 410 may specifically include: a column offset parsing unit, a column length parsing unit, a vector adder, and a request merging unit;

[0122] The column offset parsing unit may specifically be a programmable gate array into which a column offset parsing function is written;

[0123] The column length analysis unit specifically includes: a column length analysis component, a column length register and a column selection register; the column length analysis component may be a programmable gate array with a column length analysis function written therein;

[0124] The request merging unit may refer to a programmable gate array into which a request merging function is written;

[0125] The reading part may specifically include: an on-chip random access memory, a message parsing unit, a data selector, and a type selector;

[0126] More specifically, the message parsing unit may be a programmable gate array or a processor into which a message parsing function is written;

[0127] Wherein, the filter element may include: an input first-in first-out queue interface, a user interface register, an operation array group, a truth value register group and a filter result register group;

[0128] More specifically, the operation array group includes: a string operation array, a lower boundary comparator array and an upper boundary comparator array;

[0129] The truth value register group includes a plurality of registers, each of which corresponds to a comparison operation result of a column in each row;

[0130] The filtering element is a programmable gate array into which filtering conditions and filtering processing logic are written; and the write-back element is a programmable gate array into which write-back processing logic is written.

[0131] The parsing component 410 is used to calculate the target column offset of each page according to the configuration information sent by the host side to generate a column data request for each page, and send an interrupt message containing the column data request to the field extraction component on the host side;

[0132] The reading component 420 is used for transmitting the variable-length column length to the parsing component when receiving the reply message from the field extraction component in response to the interruption information feedback, so that the parsing component can calculate the target offset of the variable-length column according to the variable-length column length, and transmit the column field data to the filtering component; wherein the reply message includes at least one of the column field data and the variable-length column length;

[0133] The filter element 430 is used to perform filtering and calculation operations on the column field data and output filtering results;

[0134] The write-back component 440 is used to write the filtering result back to the external memory of the hardware acceleration card, and notify the host side to obtain the filtering result.

[0135] In the embodiment of the present application, the parser parses and calculates the offset of the target column in the database page according to the configuration information received from the host side.

[0136] Generate column data requests for these columns and send interrupt information to the field extractor on the host side to request specific field data when necessary.

[0137] In the embodiment of the present application, the reading component is connected to the parsing component and the filtering component, and serves as a middleware responsible for the transmission and reception of data.

[0138] When the field extraction component responds to the request of the parsing component, the reading component receives a reply message from the field extraction component.

[0139] The length information of the variable-length column is transmitted back to the parser so that the parser can complete the target offset calculation of the variable-length column based on it. At the same time, the column field data is transmitted to the filter for further processing.

[0140] In the embodiment of the present application, the filter component receives column field data from the reader component and performs a filter calculation operation according to a preset filter condition.

[0141] The filtering conditions are usually based on the user's query statements, such as those specified in the WHERE clause, and the filtering results are output. These results are the row data that meet the query conditions.

[0142] In an embodiment of the present application, the write-back component is responsible for writing the filtering results generated by the filter component back to the external memory of the hardware acceleration card; after the writing is completed, the write-back component will notify the host side so that the host side can obtain these filtering results and perform further processing.

[0143] In the embodiment of the present application, the interrupt message is sent by the parser to the field extractor when field data is needed, and includes a column data request. The reply message is sent by the field extractor to the reader, and includes the required column field data and / or variable length column length information.

[0144] In an embodiment of the present application, only the configuration information of the page is transmitted to the hardware acceleration card, and the target column offset of each page is calculated in the hardware acceleration card according to the configuration information, thereby generating interrupt information according to the target column offset, requesting the target column field data from the host side, and accelerating the target column field data through the hardware acceleration card, thereby avoiding the transmission of the entire page or unnecessary data during the data acceleration process, and only the target column field data needs to be transmitted, which greatly reduces the required transmission bandwidth, and at the same time supports access to variable-length fields and ultra-long fields, effectively improving the data processing speed.

[0145] Optionally, the hardware acceleration card is specifically used for:

[0146] In case of detecting a variable-length column of a first page, suspending processing of the column data of the first page, generating a variable-length column length request, and continuing processing of the column data of a next page;

[0147] The variable-length column length request is combined with the column data request of each page to obtain the interruption information.

[0148] When the parser detects variable-length columns while processing the first page, it halts further processing of the current page.

[0149] In the embodiment of the present application, once a variable-length column is detected, the parser generates a variable-length column length request to determine the exact length of the variable-length column.

[0150] While waiting for the host side to respond to the variable column length request, the parser will not stop working, but continue to process the column data of the next page. This helps to cover the waiting time and improve the overall processing efficiency.

[0151] The parser will merge the variable-length column length request with the column data request of each page. This merger can reduce the number of interrupt requests to the host side, thereby reducing communication overhead and latency.

[0152] The merged requests are encapsulated into interrupt messages and sent to the field extractor on the host side. The interrupt message includes all pending column data requests, whether they are related to variable-length columns or not. By merging requests, the parser optimizes communication with the host side, reduces the number of data packets, and thus reduces transmission latency.

[0153] This dynamic processing capability of the parser allows the system to respond more flexibly to the data characteristics of different pages, especially to quickly adapt when encountering variable-length columns. Because the parser continues to process other pages while waiting for the length of the variable-length column, this reduces the idle time of the system waiting for a specific request response.

[0154] Figure 5 Analyze the calculation flow chart in related technologies, such as Figure 5 As shown, in the related art, the support for extra-long fields is not considered. The table data page is first loaded from the external memory of the acceleration card to the on-chip cache of the acceleration card by reading the file in the acceleration card. Then the file is parsed and processed row by row. According to the length information of each column field, the offset of the column corresponding to the where clause in the page is calculated. When a fixed-length column is encountered, the column length is obtained from the column attribute description table; when a variable-length field is encountered, the column length information is stored in the page. Since the page is already stored in the on-chip cache at this time, the corresponding column length can be directly obtained from the on-chip cache. It can be seen that the parsing and calculation method in the related art requires the host side to transfer all data table pages to the acceleration card side, resulting in a large amount of redundant data transmission overhead. As mentioned above, the transmission bottleneck between the host side and the acceleration card side will limit the overall performance.

[0155] In the solution of the present application, the parser does not process row by row, but calculates the offset of a column in multiple rows in the page at one time. For fixed-length columns, there is no need to access the host memory, and the results of a column in multiple rows can be directly calculated in batches. For variable-length columns, since the length is stored in the data table page, and the present invention does not transfer all pages to the accelerator card side, the present invention forms an interrupt request for access to the variable-length column length, informing the host side of the address offset that needs to be accessed. After receiving the interrupt request, the host side sends the data at the access address offset to the accelerator card. And after sending the interrupt to the host side, it does not wait for the host side to return the data, but continues to process the column data of the next page. When the host side returns the data, it returns to the original page to continue processing, thereby covering the delay gap of requesting the host side data.

[0156] Optionally, the hardware acceleration card is specifically used for:

[0157] Determine the column start position of each page according to the page meta information in the configuration information;

[0158] When a fixed-length column is read, the column length of the fixed-length column is obtained, and the target column offset of the next column is calculated according to the column length and the column start position of each column, so as to generate a column data request according to the target column offset;

[0159] When a variable-length column is read, a variable-length column length request is generated;

[0160] The variable-length column length request and the column data request of the same read unit are combined to obtain the interruption information.

[0161] Specifically, Figure 6 Schematic diagram of the analytical component structure described in the embodiment of this application, such as Figure 6 As shown, it includes: a parsing component, including: a column offset parsing unit 610, a column length parsing unit 620, a vector adder 630 and a request merging unit 640, the column length parsing unit 620 is respectively connected to the column offset parsing unit 610 and the request merging unit 640, and the vector adder 630 is respectively connected to the column offset parsing unit 610 and the column length parsing unit 620;

[0162] The column offset parsing unit 610 is used to determine the column start position of each page according to the page meta information in the configuration information;

[0163] The column length parsing unit 620 is used to obtain the column length of a fixed-length column, and to generate a variable-length column length request when a variable-length column is read;

[0164] The vector adder 630 is used to calculate the target column offset of the next column according to the column length and the column start position of each column;

[0165] The request merging unit 640 is used to merge the request with the column data request according to the read unit of the target memory and the variable-length column length request to obtain the interrupt information.

[0166] In the embodiment of the present application, the column offset parsing unit is responsible for determining the starting position of the column in each page according to the page meta information in the configuration information. The page meta information generally includes the offset of each row of data in the page and the boundary of each column of data.

[0167] In an optional embodiment, the column offset parsing unit includes multiple page register groups, each page register group includes multiple row registers, which store the offset of the current parsing column in the page, and the parsing starting position of each row in the page is initialized by reading the page meta information.

[0168] In the embodiment of the present application, the column length parsing unit further includes: a column length parsing component, a column length register and a column selection register;

[0169] The column length parsing component obtains the column length of the target column through the column length register;

[0170] When the column length is greater than a first preset threshold, the target column is a fixed-length column, and the column length of the fixed-length column is directly obtained;

[0171] When the column length is less than the first preset threshold, the target column is a variable-length column, the page group state of the target column is marked as a suspended state, and the processing of the page corresponding to the target column is suspended until the variable-length column length of the target column is received;

[0172] The column selection register is used to generate the variable-length column length request and the column data request.

[0173] In the embodiment of the present application, the column length parsing unit is used to obtain the column length of the fixed-length column, that is, to directly read the length information from the column attribute description table.

[0174] When encountering a variable-length column, it is responsible for generating a variable-length column length request in order to request the actual column length data from the host side.

[0175] In the embodiment of the present application, the column length parsing unit is responsible for obtaining the length information of the target column, thereby determining its starting position in the page. The unit contains multiple page register groups, each page register group corresponds to a page in the database, and contains multiple row registers for storing the length of each row of the current parsed column in the page.

[0176] The parsing unit reads the length information of the target column from the column length register. If the read value is greater than 0, it means that the current column is a fixed-length column, and the parsing unit directly uses the length information for calculation. If the read value is less than 0, it means that the current column is a variable-length column, and the parsing unit cannot directly obtain the length information. It is necessary to initiate a column data request to the host side to request the length of the target column.

[0177] The parsing unit determines whether the currently parsed column needs to be filtered by reading the column selection register. If the current column is a variable-length column, the parsing unit generates a data request message including page identity information and column index information and sends it to the host side.

[0178] After sending the variable length column length request, the parsing operation of the current page will be suspended, and the parsing unit will switch to the next ready state page for parsing. When the host side returns the variable length column length information, the parsing unit sets the corresponding page register group to the ready state and continues the parsing operation of the previous page.

[0179] Optionally, the vector adder first reads the length information of the target column from the column length register. The vector adder stores the starting offset position of each row in the corresponding row register. By using its parallel computing capability, the offset positions of multiple rows are added at the same time, and the column length is accumulated to the starting offset position of each row.

[0180] After the calculation is completed, the vector adder writes the new offset position into the corresponding row register to prepare for the next column parsing. When parsing a database page, the vector adder can quickly calculate the offset position of each column in the page.

[0181] In an embodiment of the present application, a request merging unit collects multiple data requests from a parser, including variable-length column length requests and column data requests. The request merging unit analyzes the physical offset and request length of each request to determine whether they are located in the same read unit. The read unit can be a cache line, a disk page, or a read unit of other storage media.

[0182] If multiple requests are located in the same read unit, the request merging unit merges them into one request and updates the request information, such as increasing the request length, to merge the multiple requests into one continuous address range.

[0183] The request merging unit encapsulates the merged request information into interrupt information and sends it to the host side. After receiving the interrupt information, the host side reads multiple data at one time according to the address range and request type in the interrupt information and sends the data to the accelerator card.

[0184] In an embodiment of the present application, the request merging unit is a key component in the database query hardware acceleration system. It optimizes the data transmission process, improves data transmission efficiency, reduces latency, and thus improves the overall performance of database queries by merging variable-length column length requests and column data requests within the same read unit.

[0185] Figure 7 The workflow diagram of the analysis component provided for the embodiment of the present application includes:

[0186] Step 701: Use page meta information to initialize the page register set in the column offset parsing unit. Initialize, set the parsing start position, and mark all page register sets as ready.

[0187] Step 702: Determine whether a variable-length data reply is received. If a reply is received, execute step 703; otherwise, execute step 704. The host side sends the length information of the variable-length data to the reader. After receiving the information, the reader sends the data to the parser. The data includes page identity information, column index number, and length information of each column.

[0188] Step 703: after receiving the variable-length data reply, find the corresponding page register group according to the page identity information, calculate the offset position of the next column in the corresponding page according to the length of the variable-length column, and set the corresponding page register group to the ready state.

[0189] Step 704: Select a page register group, and select the page register group with the least column parsing completed from the page register groups in the ready state, and perform the next column calculation of the page.

[0190] Step 705: Calculate the offset address of the next column according to the column length register, and execute step 706.

[0191] Step 706: For fixed-length data, the column length of the fixed-length column can be directly obtained, and the starting position of the next column can be calculated using a vector adder, and then step 708 is executed.

[0192] Step 707: For a variable-length column, the value in the column length register is less than 0, a data request starting from the current position and having a length of 8B is generated, and the current page group state is marked as suspended, and the reason is: waiting for the variable-length column length. Then, step 708 is executed.

[0193] Step 708 : Check whether the column index exists in the column selection register, if yes, execute step 709 , otherwise execute step 702 .

[0194] Step 709: For the column selected in the column selection register, a data request for the column is generated. The received reply data is sent by the reading component to the filtering component for filtering calculation.

[0195] In an optional embodiment, a fixed-size page in the database includes a number of rows, and page meta information is stored in the header of the page. The page meta information includes the offset of each row in the page.

[0196] Figure 8 The following is a schematic diagram illustrating an example of storage provided in the embodiment of the present application. Figure 8 As shown, first, the meta information of each database page is sent to the column offset parsing unit. This meta information contains the starting position of each row record in the page. The initial value of each row in each page register group is initialized, and the status of all register groups is set to the ready state to prepare for the subsequent offset calculation.

[0197] For this query, the system needs to analyze the query statement and determine the target columns that need to participate in the filtering calculation. In this example, the time column and the unit price column are the key to the query, and their corresponding column indexes are 1 and 3 respectively. These two column fields need to be located in the database page for subsequent filtering calculations.

[0198] Fig. 9 The original information initialization schematic diagram provided in the embodiment of the present application is as follows: Fig. 9 As shown in the figure, in order to quickly locate the target column, the system sends the meta information of each database page to the column offset parsing unit. This meta information contains the starting position of each row record in the page. By initializing the initial value of each row in each page register group and setting the status of all register groups to the ready state, it is ready for the subsequent offset calculation.

[0199] Next, according to the information in the column length register, a vector adder is used to batch calculate the offset addresses of the target columns in the multiple pages.

[0200] Fixed-length column: Get the column length directly from the column length register, and use the vector adder to accumulate multiple columns at once to quickly get the starting position of the next column.

[0201] Variable length column: Since the length information of the variable length column is stored in the data page, and the present invention does not need to transfer the entire page to the accelerator card, the parser will initiate a length data request to the host side. The request information includes the page identity information number, the offset address of each column, and the requested length of 8B. After receiving the request, the host side will return the length information of the variable length column. At this time, the suspended page register group state is set to the ready state, and the subsequent offset calculation is continued.

[0202] Fig.10 A schematic diagram of calculating a fixed-length column provided in an embodiment of the present application is shown in FIG. Fig.10As shown, first, for the first and second columns in the page 0 register group, both are fixed-length columns. Since they are in the ready state, the parser can immediately use the vector adder to calculate the offset addresses of the two columns at one time based on the information in the column length register.

[0203] Fig.11 The processing flow chart of the variable length column provided in the embodiment of the present application is as follows: Fig.11 As shown, the parser turns to the third column, which is the variable-length column. Since the length information of the variable-length column is stored in the data page, the parser needs to initiate a data request to the host side to obtain the length information of the column. At this time, the state of the page 0 register group is set to suspend to wait for the return of the length information. At the same time, the parser starts processing the column offset calculation in the page 1 register group.

[0204] Fig.12 This is the processing flow after receiving the variable length column length value in the embodiment of the present application, such as Fig.12 As shown, after the host side returns the length information of the variable-length column, the parser restores the state of the page 0 register group to the ready state, and uses the vector adder to continue calculating the offset addresses of the remaining columns until the offset calculation of all columns is completed.

[0205] This query involves the time column and the unit price column, and the corresponding column indexes are 1 and 3 respectively. Therefore, the column length parsing unit will generate a column data request when encountering these two selected column data. Since the length of the fixed-length column is known, the variable-length column will definitely generate a request for the column length, so the execution process will not set the register group of the current page to suspend.

[0206] The target storage on the host side has a memory access startup overhead, and usually multiple bytes are accessed at a time to improve efficiency. For example, when the target storage is a RAM, the CPU will access the memory in units of cache line length, accessing one cache line length at a time instead of accessing 1 byte. Assuming the cache line length is 128B, even if the CPU only needs 1 byte, it will actually access 128B. Similarly, when the target storage is an SSD disk, the unit of memory access is page, and the page size is usually 512B. Data can only be read as a whole page, so even if the CPU only accesses 1 byte, 512B of data access will actually be generated.

[0207] For the above reasons, when requesting data, the access addresses of the column field length and the column field data request are often very close. If a memory access is generated for each request, unnecessary access delay will be caused. In order to solve this problem, the present invention merges the data access requests on the host side according to the read unit of the target memory to reduce repeated data requests.

[0208] For example, in this example, the time column and the unit price column generate column data requests, and the name column generates a column length request. If the requests for the time column, column 2 length, and unit price are in the same read unit, these requests are merged together to generate a continuous length request.

[0209] Optionally, the reading component includes: an on-chip random access memory, a message parsing unit, a data selector, and a type selector;

[0210] Wherein, the on-chip random access memory is used to obtain a reply message;

[0211] The message parsing unit is used to parse the reply message to obtain column field data and variable length column length;

[0212] The data selector transmits the variable-length column length to the parser and transmits the column field data to the type selector;

[0213] The type selector selects a corresponding first-in-first-out queue interface for the column field data according to different data types, so as to transmit the column field data to the parsing component through the first-in-first-out queue interface.

[0214] Fig.13 A schematic diagram of the structure of the reading element provided in the embodiment of the present application, such as Fig.13 As shown, it includes: an on-chip random access memory 131, a message parsing unit 132, a data selector 133, and a type selector 134;

[0215] Wherein, the on-chip random access memory 131 is used to obtain the reply message;

[0216] The message parsing unit 132 is used to parse the reply message to obtain column field data and variable length column length;

[0217] The data selector 133 transmits the variable-length column length to the parser and transmits the column field data to the type selector;

[0218] The type selector 134 selects a corresponding first-in-first-out queue interface for the column field data according to different data types, so as to transmit the column field data to the filter element through the first-in-first-out queue interface.

[0219] In the embodiment of the present application, the on-chip RAM is used to temporarily store the reply message data read from the DDR memory. The on-chip RAM has a faster read and write speed, which can reduce the number of accesses to the DDR memory, thereby improving data transmission efficiency.

[0220] The message parsing unit is responsible for parsing the reply message data and extracting the request type and data information therein. The message parsing unit can identify different request types, such as variable-length column length requests and column field data requests, and pass the data information to the corresponding processing unit according to the request type.

[0221] The data selector selects the corresponding output port according to the request type information provided by the message parsing unit and sends the data to the next processing unit. For example, for a variable-length column length request, the data selector sends the data to the parsing unit; for a column field data request, the data selector sends the data to the type selector.

[0222] The type selector selects different FIFO interfaces according to the data type and writes the data into the corresponding FIFO interface. The type selector unit contains multiple FIFO interfaces, corresponding to different data types, such as integers, floating point numbers, strings, etc. In this way, different types of data can be stored in the corresponding FIFO interfaces, which is convenient for subsequent processing units to read and process.

[0223] In the embodiment of the present application, the reading component realizes the function of reading the reply message data from the DDR memory, parsing and distributing it to the parsing component or the filtering component through components such as the on-chip RAM, the message parsing unit, the data selector and the type selector. This design can improve the data transmission efficiency and facilitate the subsequent processing unit to process the data.

[0224] In an optional embodiment, the where clause uses two fields: date and unit price. Fig.14 Schematic diagram of the reading operation in the embodiment of the present application. Fig.14 As shown, the query statement needs to retrieve the product names from the database table that satisfy the date greater than '2020-02-01' and will be less than 10. The table contains fields such as date, name, will and quantity, among which the name field is a variable-length field and the will field is a floating-point number type.

[0225] The parser first parses the SQL query statement, identifies the tables and columns to be queried, and determines the query conditions. In this example, the parser identifies the date and columns to be queried, and sets the query conditions to be greater than '2020-02-01' and less than 10.

[0226] The parser generates access requests to the data pages in the DDR memory based on the query conditions and column field information. Since there is a variable-length name field between the date and the column fields, the length of the name field needs to be parsed first to determine the offset address of the column field. The parser combines the request for the date field and the request for the length of the name field into one request and sends it to the host side.

[0227] The host side extracts the data of the date field and the length information of the name field from the DDR memory according to the request sent by the parser, and encapsulates this information into a request reply message and sends it back to the FPGA accelerator card.

[0228] The reader receives the request reply message, and according to the request type in the message, writes the data of the date field into the date FIFO of the filter, and sends the length information of the name field to the parser.

[0229] After receiving the length information of the name field, the parser updates the status of the corresponding data page to the ready state, and continues to parse the offset addresses of subsequent column fields.

[0230] The parser generates a data request for the field according to the offset address of the field and sends it to the host side. The host side extracts the data of the field from the DDR memory according to the request sent by the parser, and encapsulates the data into a request reply message and sends it back to the FPGA accelerator card.

[0231] The reader receives the request reply message and writes the data of the field into the floating point FIFO of the filter. The filter reads the date field and the data of the field from the date FIFO and the floating point FIFO, and performs filtering calculations to determine whether each row of data meets the query conditions. The row data that meets the query conditions will be written into the filter result register.

[0232] Fig.15 A schematic diagram of the filter structure provided in the embodiment of the present application is shown in FIG. Fig.15 As shown, it includes: an input first-in first-out queue 151, a user interface register 152, an operation array group 153, a truth value register group 154 ​​and a filtering result register group 155;

[0233] The input FIFO queue 151 is used to store the column field data into the comparator array of the corresponding type according to the FIFO queue type;

[0234] Wherein, the user interface register 152 is used to provide a constant register and an operator register containing each column, and a truth table register of the comparison result;

[0235] The operation array group 153 performs filtering calculations on column data and outputs filtering results for each row;

[0236] Wherein, the truth value register group 154 ​​is used to store the output result of the operation array;

[0237] The filtering result register group 155 stores a truth table of whether each row meets the filtering condition.

[0238] In related technologies, when FPGA performs data filtering calculation acceleration, it can implement single instruction multiple data filtering calculation for column storage database, but it can only be performed row by row for row storage database, and the calculation process is performed sequentially. This means that each calculation unit needs to wait until all column data of the previous page are ready before it can start filtering calculations on the columns of the current page one by one, so as to obtain the truth table of each row.

[0239] For the row storage database, the embodiment of the present invention proposes an innovative alternating calculation method. This method is no longer limited to sequential calculation of column data of a single page, but is performed in an interleaved manner. For example, when the column data in the first page is being parsed, the column data in the second page can start to be parsed, and so on. This alternating calculation method can make full use of the computing resources of the FPGA and effectively improve the efficiency of the overall filtering calculation.

[0240] Furthermore, for multiple comparison operations on the same column field, the embodiment of the present invention combines them by means of parallel computing, thereby reducing the number of memory accesses to the on-chip cache. For example, if the filter condition input by the user includes multiple range queries on the same column field, the present invention can combine these comparison operations into one operation and complete it within one clock cycle, thereby improving the efficiency of range queries on numerical data.

[0241] In order to further improve the filtering calculation efficiency of numerical data, the embodiment of the present invention adopts long bit width technology. By loading multiple numerical data into the calculation array at one time, the present invention can perform batch parallel calculation on these data within one clock cycle, significantly improving the calculation speed and throughput.

[0242] Specifically, as the input interface of the filter, the input first-in-first-out queue is connected to the reading component and is responsible for receiving column data of different data types. In order to avoid data conflicts and confusion, different types of column data will be input through different first-in-first-out queues, such as integer type data, floating point type data, string type data, etc. This separate input design ensures orderly transmission and efficient processing of data.

[0243] The user interface register is the core configuration unit of the filter and is configured by the host side. It contains multiple registers:

[0244] Constant register: stores constant values ​​in the where clause filter conditions in SQL statements, such as boundary values ​​in numeric comparisons, string constants in string comparisons, etc.

[0245] Operator register: stores the operators corresponding to the filter conditions, such as greater than, less than, equal to, not equal to, etc. in numerical comparison, and inclusion and regular matching in string comparison.

[0246] Truth table register: stores the truth table corresponding to the logical operation rules in the filter conditions, which is used for subsequent row data filtering calculations.

[0247] By configuring the user interface registers, the host side can flexibly define the filter conditions and control the calculation process of the filter.

[0248] In the embodiment of the present application, the operation array group is the core computing unit of the filter element, which includes multiple operation arrays of different data types, and each operation array contains multiple operators. Each operation array is responsible for processing the filtering calculation of a specific data type, such as a numerical operation array, a floating point operation array, a string operation array, etc.

[0249] When the filter receives data from the input FIFO, it will be assigned to the corresponding operation array for processing according to the data type. Each operation array will perform filter calculations such as comparison and logical operations on a column of data in parallel, and output the calculation results in the form of a truth table of 0 or 1. The truth table is stored in truth registers, and each register corresponds to the comparison operation result of a column in each row.

[0250] Optionally, the operation array group includes: a string operation array, a lower boundary comparator array and an upper boundary comparator array;

[0251] The string operation array is used to perform string comparison, inclusion and regular expression operations on string type data;

[0252] The lower boundary comparator array and the upper boundary comparator array are used to perform lower boundary comparison operations on numerical type data and upper boundary comparison operations on numerical type data, respectively, to support range query of numerical type data.

[0253] Fig.16 The schematic diagram of the internal structure of the computing array provided in the embodiment of the present application is as follows: Fig.16 As shown, the comparator array is the core component in the operation array, which is responsible for performing comparison operations on column data and outputting comparison results. Each comparator array contains multiple comparators, and each comparator can perform comparison operations independently.

[0254] In the embodiment of the present application, each comparator includes the following three inputs and one output:

[0255] Data input 1: Get the field data in the page from FIFO as an operand for the comparison operation.

[0256] Data input 2: Get the constant value in the filter condition from the user interface register group as another operand of the comparison operation.

[0257] Select input: Get the comparison operator in the filter condition from the user interface register group, such as greater than, less than, equal to, not equal to, greater than or equal to, less than or equal to, etc.

[0258] Result output: Output the result of the comparison operation, 0 means that the filtering condition is not met, and 1 means that the filtering condition is met.

[0259] More specifically, the comparator array can perform comparison operations on multiple rows of data in a column at the same time and output the comparison results of the corresponding rows. This batch comparison design greatly improves the efficiency of filtering calculations, especially for numerical data.

[0260] For numerical data, the present invention designs a lower boundary comparator array and an upper boundary comparator array, which are respectively used to process lower boundary and upper boundary range queries in the filtering conditions.

[0261] Lower boundary comparator array: Checks whether each data is greater than or equal to the lower boundary constant, and outputs 1 if the condition is met, otherwise outputs 0.

[0262] Upper boundary comparator array: Checks whether each data is less than or equal to the upper boundary constant, and outputs 1 if the condition is met, otherwise outputs 0.

[0263] If the user enters only one boundary condition, the comparator array in the other boundary condition will output 1, thus ensuring the integrity of the range query.

[0264] More specifically, in the embodiment of the present application, for string type data, the comparator array can perform a variety of string operations, such as: Comparison operation: check whether two strings are equal, unequal, etc. Containment operation: check whether one string contains another string. Regular matching: use regular expressions to perform string matching.

[0265] By supporting a variety of string operations, the comparator array can meet various complex string filtering requirements.

[0266] Optionally, the truth value register group includes a plurality of registers, each of which corresponds to a comparison operation result of a column in each row;

[0267] The truth register group is also used to compare the value of the page register group with the truth table register in the user interface register after all target columns in a page have completed comparison calculations; and output the results that meet the filtering conditions to the filtering result register group.

[0268] In the embodiment of the present application, the truth register group is responsible for storing the output results of the operation array and ultimately determining whether each row of data meets the filtering condition. It contains multiple page register groups, each of which corresponds to a database page, and contains multiple registers, each of which corresponds to the comparison operation result of each row of data in the page on a certain column.

[0269] The truth register group contains multiple page register groups, each of which corresponds to a database page. The page register group contains multiple registers, each of which corresponds to the comparison operation result of each row of data in the page on a certain column. The number of registers is equal to the product of the number of rows in the page and the number of target columns.

[0270] Each register stores a binary value, which indicates the result of the comparison operation on the column of the row data. 0 means that the filter condition is not met, and 1 means that the filter condition is met.

[0271] After the operation array completes the comparison operation on the target column data, it outputs the result to the register of the corresponding page and column in the truth value register group.

[0272] When all target columns in a page have completed the comparison operation, the values ​​of the page register group are compared with the truth table registers in the user interface register group to determine which rows meet the filter conditions. For example, if the filter conditions entered by the user are A>10 AND B<20, a 2x2 truth table will be stored in the truth table register, where column A stores the operation results of A>10 and column B stores the operation results of B<20. After comparing the values ​​in the page register group with the truth table registers, the final result of whether each row meets all the filter conditions can be obtained.

[0273] The result of the logic operation is output to the filter result register group, which stores the truth table of whether each row meets the filter conditions. The truth table consists of 0 or 1. 0 means that all conditions are not met, and 1 means that all conditions are met.

[0274] The truth value register group can store the comparison operation results of multiple pages in parallel, thereby improving the efficiency of filtering calculation.

[0275] In an optional embodiment, the filter result register group is responsible for storing the final result of the filter calculation, that is, judging whether each row of data meets the filter condition. It contains a truth table, which is composed of 0 or 1. 0 means that the row of data does not meet all the filter conditions, and 1 means that the row of data meets all the filter conditions.

[0276] Optionally, the filter result register group contains a truth table, the number of rows in the truth table is equal to the number of rows in the database page, and the number of columns is equal to the number of target columns in the filter condition input by the user. Each element stores a binary value, indicating whether the row of data meets all the filter conditions.

[0277] The values ​​in the truth register group are compared with the truth table registers in the user interface register group to determine which rows meet the filtering conditions. The results of the logic operation are stored in the registers of the corresponding rows and columns in the filter result register group.

[0278] Optionally, the filter element is specifically used for:

[0279] Initialize the user interface register group according to the where clause of the structured query statement; wherein the where clause is used to configure the constants and operators in the user's filtering conditions for the target column into the user interface register;

[0280] According to the first-in-first-out queue type, the column field data is stored in a comparator array of the corresponding type, and according to the column index in the column field data, the corresponding constant and operator are loaded from the user interface register group;

[0281] Performing batch comparison operations according to the constants, operators and column field data, and outputting the operation results to the columns of the corresponding pages in the truth value register group;

[0282] When all target columns in any target page have completed the comparison operation, comparing the corresponding value of the target page in the truth register group with the truth table register corresponding to the target page in the user interface register group;

[0283] Determine whether each row of data meets all the filtering conditions based on the comparison results, and output the filtering results to the filtering result register group.

[0284] In the embodiment of the present application, the filter component is one of the core components in the database query acceleration system, which is responsible for filtering and calculating the data according to the WHERE clause in the SQL statement input by the user, and judging whether each row of data meets the filtering condition. The design of the filter component adopts a variety of optimization technologies, such as parallel computing, batch processing, scalability, etc., so as to achieve efficient filtering and computing performance.

[0285] Specifically, firstly, according to the WHERE clause in the SQL statement input by the user, the constants, operators and truth tables corresponding to the logic operation rules in the filter conditions are configured into the user interface register group.

[0286] Get the target column data from the input FIFO and store the data in the corresponding type of comparator array according to the FIFO type.

[0287] The arithmetic unit performs operations in parallel and outputs the result of each comparison operation to form a truth table corresponding to each row.

[0288] Compare the value of the truth register group with the truth table register in the user interface register group to determine which rows meet the filtering condition. Output the result of the logic operation to the filtering result register group.

[0289] In the embodiment of the present application, by designing the operation array as a parallel structure, multiple data can be compared and operated at the same time, thereby improving the computing efficiency. By loading multiple rows of data in a column into the comparator array at one time, the number of accesses to the FIFO can be reduced, thereby improving the data throughput. By increasing the number of operation arrays, the processing capacity of the filter element can be expanded to meet the needs of larger-scale data processing.

[0290] Fig.17 The filter element workflow diagram described in the embodiment of the present application is as follows: Fig.17 As shown, including:

[0291] Step 1701: Initialize the user interface register group according to the SQL statement where clause. In this step, according to the where clause, the constants and operators in the user's filter conditions for the target column are configured in the interface register. Different from the prior art, the comparison operation of the numerical type in the present invention is classified into upper boundary comparison and lower boundary comparison. The two comparisons can be executed in parallel, and the range query can be completed within one clock cycle, saving the time of loading data from FIFO and the time of comparison operation.

[0292] Step 1702: Get FIFO data, and store the data in the corresponding type of comparator array according to the FIFO type. After completing the initialization configuration of step 1701. Monitor whether each different type of FIFO has data. When the reading component writes data to a certain type of FIFO interface, load the FIFO data from the corresponding interface, obtain the field data from the FIFO code stream, and load it into the corresponding type of comparator array as a comparison parameter. It is worth noting that multiple rows of data in a column will be loaded into the comparator array at a time for batch comparison calculation.

[0293] Step 1703: According to the FIFO data stream header column index, load the corresponding constant and operator from the user interface register group into the comparator array. Obtain the column index from the FIFO code stream, and load the constant and operator of the column from the interface register into the comparator array according to the index.

[0294] Step 1704: Perform comparison operation, and output the operation result to the column of the corresponding page in the truth register group according to the page ID and column index in the head of the FIFO data stream. After completing step 1703, the comparator in the array has loaded two data inputs and one selection input, and after performing batch comparison operation, a 0 or 1 operation result is obtained. Write it to the column of the corresponding page in the truth register.

[0295] Step 1705: Determine whether all target columns in a page have completed comparison operations. If completed, execute step 1706, otherwise execute step 1702. The determination method is whether the number of data written in the page truth register is equal to the number of operators set by the user in the interface register.

[0296] Step 1706: When all target columns in a page are calculated, the value of the truth register group is compared with the truth table register in the user interface register group, and the result is output to the filter result register group. After all target column fields are calculated, the results of the comparison operation of multiple columns are obtained and compared with the truth table register in the user interface register group to determine whether the row meets the filtering condition, and the operation result is output to the filter result register. Then continue to execute step 1702 to load the next column of data.

[0297] Fig.18 The following is a flowchart of an example of filtering calculation provided in the embodiment of the present application. Fig.18 As shown in the figure, taking the data calculation of one page as an example, the where clause uses three fields: date, name, and unit price. There are three numerical comparison operations and one string operation.

[0298] Specifically, the WHERE clause in the SQL statement is deeply parsed to identify the target columns that need to participate in the filtering calculation, namely column 1 (date), column 2 (name), and column 3 (unit price). Then, in the embodiment of the present application, the constants and operators in the filtering conditions corresponding to each column are respectively configured in the user interface register group. For example, the lower limit of the date is set to "2020 / 01 / 01", the upper limit of the unit price is set to "10", the lower limit is set to "2", and the filtering condition of the name is set to "LIKE %Apple%". In addition, in the embodiment of the present application, a truth table is constructed according to the logical operation rules and stored in the truth table register for subsequent logical operations.

[0299] Then, in the embodiment of the present application, the target column data is obtained from the input FIFO, and the data is loaded into the corresponding type of comparator array according to the FIFO type. Fig.18For example, three groups of comparators are created in the embodiment of the present application, and each group can operate three data in parallel, thereby realizing efficient parallel computing. The header of the FIFO code stream marks the page ID and the column index number. According to the column index number, the corresponding constant and operator can be obtained from the user interface register in the embodiment of the present application to prepare for the comparison operation.

[0300] The operator performs operations in parallel, performs comparison operations on each row of data, and outputs the results of each comparison operation to form a truth table corresponding to each row. Each element in the truth table is a 0 or 1, which represents whether the row of data meets the filtering condition on a certain column. For example, for the date column, if the date is greater than "2020 / 01 / 01", output 1, otherwise output 0; for the unit price column, if the unit price is greater than or equal to 2 and less than or equal to 10, output 1, otherwise output 0; for the name column, if the name contains "apple", output 1, otherwise output 0.

[0301] When the calculation of the three target columns of a page is completed, the value of the truth register group is compared with the truth table register in the user interface register group in the embodiment of the present application, and a logical operation is performed to determine whether each row of data meets all the filtering conditions. Finally, the result of the logical operation is output to the filter result register group in the embodiment of the present application. For example, if a row of data meets the filtering conditions in the three columns of date, unit price, and name, the corresponding truth table register outputs 1, otherwise it outputs 0.

[0302] For actual scenarios, there will be multiple pages for calculation. In the embodiment of the present invention, the calculation process does not need to be performed field by field, but the fields of different pages are performed alternately. For example:

[0303] 1) The parser sends the column 1 field of the first page to the filter. When parsing column 2, it will hang when encountering a variable-length field.

[0304] 2) Parse the content and feed the column 1 field of the second page into the filter content.

[0305] 3) The parser obtains the value of the variable-length data in column 2 and sends the column 2 field of the first page to the filter.

[0306] As described above, column field parsing and filtering calculation are performed alternately with different fields on different pages.

[0307] Optionally, the written-back document is specifically used for:

[0308] The page identity information and line number that meet the filtering conditions are written into the external memory of the hardware acceleration card, and an interrupt is sent to the host side to notify the host side to obtain the filtering results.

[0309] In the embodiment of the present application, the writeback is responsible for writing the page identity information and row number that meet the filtering conditions into the external memory of the hardware acceleration card. This information records which pages and row data meet the query conditions specified by the user, which is the basis for subsequent data acquisition and processing.

[0310] The writeback will send an interrupt signal to the host side to notify the host side that the filtering calculation has been completed and the filtering results can be obtained. The interrupt mechanism is an efficient communication method that can ensure that the host side obtains the filtering results in time, thereby improving the overall query efficiency.

[0311] The write-back file stores the filtering results in the external memory and records the page ID and row number, providing the host with a way to quickly locate the data that meets the conditions. The host can quickly find and obtain the target data based on this information for subsequent business processing.

[0312] In the embodiment of the present application, the write-back document is responsible for storing the filtering results, notifying the host side and assisting in data location, so as to provide users with efficient and accurate query services.

[0313] Optionally, the system includes: a hardware acceleration card and a host side;

[0314] The host side sends configuration information including query table information to the hardware acceleration card;

[0315] The hardware acceleration card calculates the target column offset of each page according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message including the column data request and the variable-length column length request to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0316] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0317] The host side transmits a reply message to the hardware acceleration card, wherein the reply message includes at least one of column field data and variable-length column length;

[0318] The hardware acceleration card performs target offset calculation of the variable-length column based on the variable-length column length in the reply message, and performs filtering calculation operations based on the column field data in the reply message to determine a filtering result.

[0319] Specifically, Fig.19 This is a schematic diagram of the acceleration system structure described in the embodiment of the present application. Fig.19As shown, it includes: the hardware acceleration card and the parsing configuration component 191, the field extraction component 192 and the result processing component 193 arranged on the host side; the parsing configuration component 191 is connected to the parsing component 410, the field extraction component 192 is connected to the parsing component 410 and the reading component 420, and the result processing component 193 is connected to the write-back component 440;

[0320] The parsing configuration component 191 is used to send configuration information including query table information to the parsing component on the hardware acceleration card side, so that the parsing component 410 calculates the target column offset corresponding to each page of the query table according to the configuration information and generates a column data request for each page;

[0321] The field extraction component 192 is used to obtain the column field data corresponding to the column field request according to the column field request in the interruption information fed back by the analysis component, and obtain the variable-length column length corresponding to the variable-length column length request when the interruption information includes the variable-length column length request;

[0322] The field extraction component 192 is used to transmit the reply message to the reading component 420, so that the reading component transmits the variable-length column length to the parsing component 410, so that the parsing component performs variable-length column target offset calculation according to the variable-length column length, and transmits the column field data to the filtering component 430; wherein the reply message includes at least one of the column field data and the variable-length column length;

[0323] The result processing component 193 is used to process the filtering result of the hardware acceleration card, extract the row data that meets the filtering condition, and return it to the user end.

[0324] Optionally, the parsing configuration component is specifically used to:

[0325] According to the attribute information of the column field in the user's query statement, a column attribute description table is constructed;

[0326] Constructing a column selection table according to the column numbers corresponding to the where clause in the query statement;

[0327] The column attribute description table and the column selection table are used as parameters to obtain the configuration information.

[0328] In the embodiment of the present application, the scanning query node first parses the SQL statement input by the user to identify the query target, query conditions, return fields and other information. For a SQL statement like FROM table WHERE condition, the scan query node will parse the table as the query target, condition as the query condition, and return all fields.

[0329] More specifically, the scan query node generates a query plan based on the parsed information. The query plan describes how to obtain data that meets the conditions from the database table, including which tables to select, which indexes to use, how to filter data, etc.

[0330] The scan query node will perform the actual query operation according to the query plan, which may include extracting the target column field from the table, performing filtering calculations, and returning the rows that meet the conditions to the upper node.

[0331] In the embodiment of the present application, the configuration parser will construct a column attribute description table based on the information parsed by the scan query node. The column attribute description table records the attribute information of each field in the query target table, including field type, field length, etc. This information is crucial for subsequent data parsing and filtering calculations.

[0332] The configuration parser will also build a column selection description table based on the information parsed by the scan query node. The column selection description table records the column field information that the user needs to filter, such as the columns specified in the WHERE clause. This information is used to guide the filter to perform data filtering calculations.

[0333] In the embodiment of the present application, by sending the column attribute description table and the column selection description table to the parsing component of the FPGA, repeated parsing of SQL statements on the FPGA can be avoided, thereby improving query efficiency.

[0334] The configuration parser can compress or streamline the query information, thereby reducing the amount of data transmission and improving the overall query efficiency. The FPGA parser can quickly and accurately parse the data and perform filtering calculations based on the column attribute description table and column selection description table, thereby improving data parsing efficiency.

[0335] Optionally, the field extraction part is specifically used for:

[0336] Determine the specific position of the column field in the database according to the column field request in the interrupt information, so as to obtain the column field data from the database;

[0337] Determine the variable length column length of the corresponding variable length column according to the variable length column length request in the interrupt information;

[0338] The extracted column field data and the variable-length column length are repackaged according to the request type and field index, and then transmitted to the reader on the hardware acceleration card side as a reply message.

[0339] The accelerator card requests data from the host side through the interrupt mechanism, avoiding frequent polling and improving efficiency. The accelerator card will merge data requests within the same read unit, reducing the number of memory accesses and latency. The accelerator card can directly request the length information of the variable-length field without the need for host-side parsing, improving efficiency. Accelerator cards that support P2P technology can directly access the host-side memory or disk, further reducing data transmission latency.

[0340] In an embodiment of the present application, the field extraction component obtains data from the target address according to the data request message sent by the acceleration card parsing component. Fig. 20 A schematic diagram of the message format provided in the embodiment of the present application, such as Fig. 20 As shown, the accelerator card combines the requests in the same read unit into a request group. A request group includes the page ID of the request and several sub-requests. Each sub-request includes:

[0341] Request type: There are two types: variable length field length and field data.

[0342] Column index number: indicates the index number of the column.

[0343] Line number within the page: Indicates which line within the page is being requested.

[0344] Logical offset: The offset of the requested data in the logical row, indicating the offset of the data that needs to be read in a logical sense.

[0345] Physical offset: The offset of the requested data in the physical row, which is stored in one read unit.

[0346] Request length: The length request for variable-length fields is fixed at 8 bytes; for field data, if it is a fixed-length field, the value is greater than 0, and the data is read according to the actual length of the field. If it is a variable-length field, the value is -1, and the data is read after parsing the actual length.

[0347] In an optional embodiment, variable-length data refers to data with unfixed length, such as a string or text. In a database, in order to save space, variable-length data is usually not directly stored in a row record, but a pointer pointing to the actual location of the data is stored.

[0348] The accelerator card will request 8 bytes of data from the host side. These 8 bytes contain the length information of the variable-length data. The host side will extract the actual length of the variable-length data from these 8 bytes according to the data alignment method.

[0349] Variable-length data may span multiple read units, such as a cache line or disk page. The field extractor extracts data from multiple sub-requests based on the physical offset field and concatenates them into complete field data.

[0350] The field extractor will store the length and field data of the variable-length data in continuous memory space to avoid cross-storage and facilitate parsing by the accelerator card. For an extra-long field, its field offset position header will be marked as an extra-long field, followed by a pointer to the actual position of the extra-long field. The field extractor will extract the extra-long field data from the target location based on the pointer and package it together with the length information into a reply message.

[0351] Fig.21 A schematic diagram of the reply message format provided in the embodiment of the present application, such as Fig.21 As shown, including: Page ID: marks the requested page.

[0352] Request type: variable field length request or field data request.

[0353] Data type: The data type of the tag response, for example: string, floating point, date, etc.

[0354] Column index number: marks the column of data to be replied.

[0355] Data: For fixed-length data, it only contains the field data; for variable-length data, it also contains the actual length of the variable-length data.

[0356] Fig. 22 The table diagram provided for the embodiment of the present application is as follows: Fig. 22 As shown in the figure, assume that the user enters the filtering condition where date>2020-01-01 and unit price<10. Since there is a variable-length field between the date and the unit price, the header in the variable-length field marks the actual length of the field. When performing filtering and parsing, the following steps need to be performed:

[0357] 1) Read the date data (4B) first, and the parser will initiate a field data request for the date column field index 1. At this time, the page register will not be blocked, and the name field will continue to be parsed after the request is issued.

[0358] 2) Parse the name field. Since it is a variable-length field, it is necessary to initiate a request for the length of the variable-length field and set the page register to a suspended state.

[0359] 3) The parser will merge the data access of the date field with the length access of the name field to reduce repeated reading operations on the same read unit.

[0360] Fig.23The schematic diagram of request merging provided by the embodiment of this application is as follows Fig.23 As shown, after the field extractor finds the target data according to the page ID and the in-page offset and extracts it, the extracted data is repackaged according to the request type and field index and then transmitted to the accelerator card side as a response message.

[0361] More specifically, Fig.24 The working process of the configuration parser provided by the embodiment of this application is as follows Fig.24 As shown, it includes:

[0362] Step 2401, construct a column field attribute table;

[0363] The configuration parser obtains the format information of the target table from the database scan query node, including table name, column name, column type, column length, column constraints, etc. This information is usually stored in the metadata of the database, such as the system catalog or data dictionary.

[0364] The configuration parser extracts the attributes of each column field according to the table information provided by the scan query node, including column type (such as integer type, floating-point type, string type), column length (such as 4 bytes, 8 bytes, variable length, etc.), column constraints (such as not null, unique, foreign key, etc.).

[0365] The configuration parser organizes the extracted column attribute information into a column attribute description table. The column attribute description table usually adopts a structured data format, such as an array or a hash table, to facilitate the FPGA parser to read and parse.

[0366] Step 2402, construct a column field selection table; parse the WHERE clause: The configuration parser parses the WHERE clause in the user's SQL statement to identify the filtering conditions specified by the user. For example, for a WHERE clause like WHERE column1 > value1 AND column2 < value2, the configuration parser will identify column1 and column2 as the filtering columns, as well as the corresponding comparison operators and constant values. The configuration parser obtains the corresponding column numbers according to the column names specified in the WHERE clause. The column numbers are usually integers starting from 0 and are used to uniquely identify each column in the table.

[0367] The configuration parser organizes the column numbers specified in the WHERE clause into a column selection description table. The column selection description table usually adopts a data format of an array or a set to facilitate the FPGA parser to read and parse.

[0368] Step 2403, configure the FPGA parser; the configuration parser sends the column attribute description table and the column selection description table to the FPGA parser. The sending method can be to directly write to the memory space of the FPGA or to transmit through the PCIe bus.

[0369] The configuration parser will write the data in the column attribute description table and the column selection description table to the register interface of the FPGA parser. The register interface is where the configuration information is stored inside the FPGA, which makes it easy for the FPGA parser to read and parse it.

[0370] Fig.25 The user query example diagram provided in the embodiment of the present application is as follows: Fig.25 As shown, the grid contains the order number (integer), time (date type), name (string), unit price (floating point), and quantity (floating point). The user uses SQL statements to query the specified date range and specify the product name. In the present invention, the type and length information in the table are used as field attributes, and the column number selected by the where clause is sent to the FPGA as a field selection table.

[0371] In the embodiment of the present application, constructing the column field attribute table and the column selection description table is a key step in the database query hardware accelerated data transmission management method. By constructing these tables, query information can be passed to the FPGA, thereby improving query efficiency.

[0372] Optionally, after receiving the interrupt signal from the accelerator card, the host side will start the data reading operation and extract the filtered calculation results from the FPGA's DDR memory. At this time, since the data page has been pre-loaded into the host side's DDR memory, it is only necessary to use the page ID and row number provided in the filter result to easily locate the specific row data that meets the query conditions. Subsequently, these row data will be sent back to the upper node of the database query plan to complete the filtering calculation operation of the scanning node, and finally present the most accurate query results to the user end.

[0373] In the related art, the data table file on the host side is usually sent to the FPGA side, and then the FPGA side completes the data parsing and filtering calculation through a four-stage pipeline of reading, parsing, filtering, and writing back. However, in the solution of this application, the host side does not send all the data to the FPGA side. Fig.26 The invention operation example diagram provided for the embodiment of the present application is as follows: Fig.26 As shown, in the embodiment of the present application, the parsing component is placed in the first stage of the pipeline, forming a four-stage pipeline of parsing, reading, filtering, and writing back. The accelerator card generates a data access request to the host side, and only the data that needs to be queried is transmitted on the transmission bus.

[0374] More specifically, Fig. 27 A schematic diagram of the acceleration method provided in the embodiment of the present application is shown in FIG. Fig. 27 As shown, it includes: step 2710, the host side sends configuration information including query table information to the hardware acceleration card;

[0375] The parsing configuration component first extracts the table information required by the user query statement from the database query plan, and converts it into configuration information that the hardware accelerator card can understand. This configuration information records the column attributes of the query table in detail, including column type, column length, whether it is a variable-length column, etc., providing precise guidance for subsequent parsing and filtering calculations. Subsequently, the parsing configuration component sends this configuration information to the parsing component on the hardware accelerator card side to ensure that the hardware accelerator card can understand the user's query intent and efficiently execute the query operation.

[0376] Step 2720: the hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message including the column field data and the variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0377] After receiving the configuration information, the parser will perform a detailed calculation of the target column offsets of each page of the query table according to the column attributes recorded in the configuration information. For fixed-length columns, the parser directly uses the column length recorded in the configuration information for calculation; for variable-length columns, the parser will send a variable-length column length request to the field extractor on the host side according to the tag in the configuration information to obtain the length information of the variable-length column.

[0378] Subsequently, the parser generates column data requests for each page based on the calculated target column offset. Each column data request contains the index information of the target column, indicating which column data the field extractor needs to obtain. The parser packages these column data requests into interrupt information and sends it to the field extractor on the host side through the PCIe bus to start the data transfer process.

[0379] Step 2730: the host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0380] Specifically, after receiving the interrupt message sent by the parsing component, the field extractor will obtain the corresponding column field data from the storage medium on the host side according to the column field request in the interrupt message. For fixed-length columns, the field extractor will directly extract data according to the column index information; for variable-length columns, the field extractor will obtain the length information of the variable-length column according to the variable-length column length request contained in the interrupt message, and pack it together with the variable-length column data into a reply message.

[0381] In step 2740, the hardware acceleration card obtains a reply message from the host side, and performs a target offset calculation of the variable-length column according to the length of the variable-length column in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

[0382] The field extractor generates a reply message with the extracted column field data and variable column length, and transmits it to the reader through the PCIe bus. The reply message contains at least one of the column field data and variable column length, ensuring that the reader can obtain all the data required for parsing and filtering calculations.

[0383] The reading component transmits the variable length column length to the parsing component, so that the parsing component calculates the target offset of the variable length column according to the variable length column length, and transmits the column field data to the filtering component;

[0384] After receiving the reply message, the reader will transmit the variable length column length to the parser according to the information in the message, so that the parser can calculate the target offset of the variable length column. At the same time, the reader will transmit the column field data to the filter to provide a data basis for subsequent filtering calculations.

[0385] The filter performs filtering and calculation operations on the column field data and outputs filtering results;

[0386] After receiving the column field data, the filter will perform accurate filtering and calculation operations on the data according to the filtering conditions in the user's query statement. The filter supports various types of operations, including numerical comparison, string matching, Boolean logic operations, etc., and can process multiple data in parallel, thereby improving the efficiency of filtering calculations.

[0387] The write-back component writes the filtering result back to the external memory of the hardware acceleration card, and notifies the host side to obtain the filtering result;

[0388] The result processing component processes the filtering result of the hardware acceleration card, extracts the row data that meets the filtering condition, and returns it to the user end.

[0389] In an embodiment of the present application, by transmitting only the field data that the user needs to query, rather than the entire data page, the amount of data transmission between the host side and the acceleration card side is greatly reduced, effectively alleviating the transmission bottleneck of the PCIe bus and improving data transmission efficiency. The reduction in the amount of data transmission means that the time required for data transmission is also reduced accordingly, thereby reducing transmission delays and improving overall query performance. In addition, the parsing component in the embodiment of the present application can identify variable-length fields, and obtain the length information of the variable-length columns by sending a variable-length column length request to the host side, thereby efficiently accessing the variable-length field data. At the same time, the parsing component can identify extra-long fields, and obtain a pointer to the extra-long field by sending a data request to the host side, thereby achieving access to the extra-long field data.

[0390] In an alternative embodiment, Fig.28 The technical comparison diagram provided for the embodiments of this application is as follows: Fig.28 As shown, suppose there is a data table containing three columns A, B, and C, and the user only queries column B.

[0391] In the related art: all data table file contents need to be sent to an accelerator card; the accelerator card parses the target column and performs calculations.

[0392] In an embodiment of the present application, the accelerator card calculates the offset of the target column and sends an address request to the host side; the host side only sends the target column to the accelerator card.

[0393] By setting up a parsing and filtering state machine in the FPGA, an access request to the host-side memory is generated, thereby avoiding the transmission of redundant data and solving the data transmission performance bottleneck and the support problem of over-long fields between the host side and the accelerator card.

[0394] Optionally, the method further comprises:

[0395] In a case where the column length of the target column obtained through the column length register in the hardware acceleration card is greater than a first preset threshold, determining that the target column is a fixed-length column, and directly obtaining the column length of the fixed-length column;

[0396] When the column length of the target column is less than or equal to a first preset threshold value obtained through the column length register in the hardware acceleration card, the target column is determined to be a variable-length column, a page group state of the variable-length column is marked as a suspended state, processing of a page corresponding to the variable-length column is suspended, and a response to the variable-length column length request is waited for by the host side;

[0397] The hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request.

[0398] In the embodiment of the present application, when the parser detects that there is a variable-length column in a page, in order to avoid unnecessary delays caused by waiting for the length of the variable-length column, the parser will mark the page group state of the page as "suspended state". This means that the parser will suspend the processing of the variable-length column page and shift its attention to the next ready state page.

[0399] The parser obtains the length information of the variable-length column by sending a variable-length column length request to the host side. After receiving the request, the host side extracts the variable-length column length from the storage medium and returns it to the parser. After receiving the variable-length column length, the parser switches the page group state of the variable-length column page from "suspended state" to "ready state". This means that the parser can continue to process the offset calculation of the remaining columns in the variable-length column page.

[0400] Optionally, after the step of the hardware acceleration card continuing to process column data of a next page while waiting for the host side to respond to the variable-length column length request, the method further includes:

[0401] When the hardware acceleration card receives the variable-length column length of the variable-length column, the page group state of the variable-length column is switched to a ready state, and a target offset calculation of the variable-length column is performed based on the variable-length column length;

[0402] A column data request for the variable-length column is generated based on the target column offset of the variable-length column.

[0403] In the embodiment of the present application, while the hardware acceleration card is waiting for the host side to respond to the variable-length column length request, the parsing component does not stop working, but continues to process the column data of the next page.

[0404] When the parser detects a variable-length column in the first page, it marks the page group state of the page as suspended and suspends processing of the page. The parser waits for the host side to return the length information of the variable-length column, which is necessary for processing the variable-length column.

[0405] Once the hardware accelerator card's parser receives the variable-length column length information, it switches the page group state of the first page variable-length column from pending to ready. After the variable-length column length information is available, the parser calculates the target offset of the variable-length column based on this length to determine the specific position of the variable-length column in the page. Based on the calculated target column offset, the parser generates column data requests for the variable-length column, which will be sent to the host side to retrieve the actual column data.

[0406] If possible, the request merging unit will merge the column data request of the variable-length column with other requests to reduce the number of data requests to the host side and improve communication efficiency.

[0407] After the host responds to the column data request, the reading component of the hardware accelerator card will receive and process the column data for subsequent filtering calculations by the filter component. Through this pause and resume mechanism, the system maintains the continuity of the data flow and ensures that all query operations can be performed based on complete and accurate data. This approach allows the system to continue processing other tasks while waiting for specific data, thereby improving the overall throughput and efficiency of the system. By ensuring the accurate acquisition and processing of variable-length columns, the system guarantees the accuracy of query results.

[0408] This method demonstrates the adaptability of the hardware acceleration system to different data modes, especially for data types such as variable-length columns that require dynamic processing. By introducing the suspended state, this solution effectively avoids the delay caused by waiting for the length of the variable-length column and improves the overall parsing efficiency. At the same time, this solution also ensures that the parser can efficiently access the variable-length column data, thereby achieving more accurate filtering calculations.

[0409] Fig.29 A schematic diagram of the structure of an electronic device provided by the present invention, such as Fig.29 As shown, the electronic device may include: a processor (processor) 2910, a communication interface (Communications Interface) 2920, a memory (memory) 2930 and a communication bus 2940, wherein the processor 2910, the communication interface 2920, and the memory 2930 communicate with each other through the communication bus 2940. The processor 2910 may call the logic instructions in the memory 2930 to execute the acceleration method, which includes:

[0410] The host side sends configuration information including query table information to the hardware acceleration card;

[0411] The hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message containing column field data and a variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0412] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0413] The hardware acceleration card obtains a reply message from the host side, performs a target offset calculation of the variable-length column according to the variable-length column length in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

[0414] In addition, the logic instructions in the above-mentioned memory 2930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0415] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the acceleration method provided by the above methods, the method comprising:

[0416] The host side sends configuration information including query table information to the hardware acceleration card;

[0417] The hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message containing column field data and a variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0418] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0419] The hardware acceleration card obtains a reply message from the host side, performs a target offset calculation of the variable-length column according to the variable-length column length in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

[0420] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the acceleration method provided by the above methods, the method comprising:

[0421] The host side sends configuration information including query table information to the hardware acceleration card;

[0422] The hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message containing column field data and a variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request;

[0423] The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request;

[0424] The hardware acceleration card obtains a reply message from the host side, performs a target offset calculation of the variable-length column according to the variable-length column length in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

[0425] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the components may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0426] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a ROM / random access memory, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0427] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A hardware accelerator card, characterized in that: include: The hardware acceleration card calculates the target column offset of each page according to the configuration information sent by the host side to generate a column data request for each page, and sends interrupt information including the column data request to the host side; When receiving a reply message from the host side in response to the interrupt information feedback, performing a target offset calculation of the variable-length column based on the variable-length column length in the reply message, and performing a filtering calculation operation based on the column field data in the reply message to determine a filtering result; Wherein, the hardware acceleration card is specifically used for: Determine the column start position of each page according to the page meta information in the configuration information; When a fixed-length column is read, the column length of the fixed-length column is obtained, and the target column offset of the next column is calculated according to the column length and the column start position of each column, so as to generate a column data request according to the target column offset; When a variable-length column is read, a variable-length column length request is generated; The variable-length column length request and the column data request of the same read unit are combined to obtain the interruption information.

2. The hardware acceleration card according to claim 1, characterized in that: The hardware acceleration card is specifically used for In case of detecting a variable-length column of a first page, suspending processing of the column data of the first page, generating a variable-length column length request, and continuing processing of the column data of a next page; The variable-length column length request is combined with the column data request of each page to obtain the interruption information.

3. The hardware acceleration card according to claim 1, characterized in that: The hardware acceleration card includes: a column length register and a column selection register; The hardware acceleration card obtains the column length of the target column through the column length register; When the column length is greater than a first preset threshold, the target column is a fixed-length column, and the column length of the fixed-length column is directly obtained; When the column length is less than or equal to the first preset threshold, the target column is a variable-length column, the page group state of the target column is marked as a suspended state, and the processing of the page corresponding to the target column is suspended until the variable-length column length of the target column is received; The column selection register is used to generate the variable-length column length request and the column data request.

4. The hardware acceleration card according to claim 3, characterized in that: The hardware acceleration card is specifically used for: When the variable-length column length of the target column is received, the page group state of the target column is switched from the suspended state to the ready state, and the page corresponding to the target column continues to be processed.

5. The hardware acceleration card according to claim 1, characterized in that: The hardware acceleration card includes: an on-chip random access memory, a message parsing unit, a data selector, and a type selector; Wherein, the on-chip random access memory is used to obtain a reply message; The message parsing unit is used to parse the reply message to obtain column field data and variable length column length; The data selector is used to transmit the variable-length column length to the hardware acceleration card for variable-length column parsing, and transmit the column field data to the type selector; The type selector selects a corresponding first-in-first-out queue interface for the column field data according to different data types to perform filtering and calculation operations.

6. The hardware acceleration card according to claim 1, characterized in that: The hardware acceleration card includes: an input first-in first-out queue interface, a user interface register, an operation array group, a true value register group and a filtering result register group; Wherein, the input FIFO queue interface is used to store the column field data into a comparator array of a corresponding type according to the FIFO queue type; Wherein, the user interface register is used to provide a constant register and an operator register containing each column, and a truth table register of the comparison result; The operation array group performs filtering calculations on column data and outputs filtering results for each row; Wherein, the truth value register group is used to store the output result of the operation array; The filtering result register group is used to store a truth table of whether each row meets the filtering condition.

7. The hardware acceleration card according to claim 6, characterized in that: The operation array group includes: a string operation array, a lower boundary comparator array and an upper boundary comparator array; The string operation array is used to perform string comparison, inclusion and regular expression operations on string type data; The lower boundary comparator array and the upper boundary comparator array are used to perform lower boundary comparison operations on numerical type data and upper boundary comparison operations on numerical type data, respectively, to support range query of numerical type data.

8. The hardware acceleration card according to claim 7, characterized in that: The truth value register group includes a plurality of registers, each of which corresponds to a comparison operation result of a column in each row; The truth register group is also used to compare the value of the page register group with the truth table register in the user interface register after all target columns in a page have completed comparison calculations; and output the results that meet the filtering conditions to the filtering result register group.

9. The hardware acceleration card according to claim 8, characterized in that: The hardware acceleration card is specifically used for: Initialize the user interface register group according to the where clause of the structured query statement; wherein the where clause is used to configure the constants and operators in the user's filtering conditions for the target column into the user interface register; According to the first-in-first-out queue type, the column field data is stored in a comparator array of the corresponding type, and according to the column index in the column field data, the corresponding constant and operator are loaded from the user interface register group; Performing batch comparison operations according to the constants, operators and column field data, and outputting the operation results to the columns of the corresponding pages in the truth value register group; When all target columns in any target page have completed the comparison operation, comparing the corresponding value of the target page in the truth register group with the truth table register corresponding to the target page in the user interface register group; Determine whether each row of data meets all the filtering conditions based on the comparison results, and output the filtering results to the filtering result register group.

10. An acceleration system based on the hardware acceleration card according to any one of claims 1 to 9, characterized in that: The system comprises: a hardware acceleration card and a host side; The host side sends configuration information including query table information to the hardware acceleration card; The hardware acceleration card calculates the target column offset of each page according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message including the column data request and the variable-length column length request to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request; The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request; The host side transmits a reply message to the hardware acceleration card, wherein the reply message includes at least one of column field data and variable-length column length; The hardware acceleration card performs target offset calculation of the variable-length column based on the variable-length column length in the reply message, and performs filtering calculation operations based on the column field data in the reply message to determine a filtering result.

11. The acceleration system according to claim 10, characterized in that: The host side is specifically used for: According to the attribute information of the column field in the user's query statement, a column attribute description table is constructed; Constructing a column selection table according to the column numbers corresponding to the where clause in the query statement; The column attribute description table and the column selection table are used as parameters to obtain the configuration information.

12. The acceleration system according to claim 10, characterized in that: The host side is specifically used for: Determine the specific position of the column field in the database according to the column field request in the interrupt information, so as to obtain the column field data from the database; Determine the variable length column length of the corresponding variable length column according to the variable length column length request in the interrupt information; The extracted column field data and the variable-length column length are repackaged according to the request type and field index, and then transmitted to the hardware acceleration card as a reply message.

13. The acceleration system according to claim 10, characterized in that: The host side is specifically used for: Acquire the filtering result from the hardware acceleration card, and determine the row data satisfying the filtering condition according to the page identity information and the row number in the filtering result; Return the row data that meets the filter conditions to the upper node of the database query plan.

14. An acceleration method based on the acceleration system according to any one of claims 10 to 13, characterized in that: include: The host side sends configuration information including query table information to the hardware acceleration card; The hardware acceleration card calculates the target column offset of each page corresponding to the query table according to the configuration information, generates a column data request and a variable-length column length request for each page, and sends an interrupt message containing column field data and a variable-length column length to the host side; wherein the hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request; The host side obtains the column field data corresponding to the column field request according to the column field request in the interrupt information, and obtains the variable length column length corresponding to the variable length column length request when the interrupt information includes the variable length column length request; The hardware acceleration card obtains a reply message from the host side, performs a target offset calculation of the variable-length column according to the variable-length column length in the reply message, performs a filtering calculation operation based on the column field data in the reply message, and determines a filtering result.

15. The acceleration method according to claim 14, characterized in that: The method further comprises: In a case where the column length of the target column obtained through the column length register in the hardware acceleration card is greater than a first preset threshold, determining that the target column is a fixed-length column, and directly obtaining the column length of the fixed-length column; When the column length of the target column is less than or equal to a first preset threshold value obtained through the column length register in the hardware acceleration card, the target column is determined to be a variable-length column, a page group state of the variable-length column is marked as a suspended state, processing of a page corresponding to the variable-length column is suspended, and a response to the variable-length column length request is waited for by the host side; The hardware acceleration card continues to process the column data of the next page while waiting for the host side to respond to the variable-length column length request.

16. The acceleration method according to claim 15, characterized in that: After the step that the hardware acceleration card continues to process column data of the next page while waiting for the host side to respond to the variable-length column length request, the method further includes: When the hardware acceleration card receives the variable-length column length of the variable-length column, the page group state of the variable-length column is switched to a ready state, and a target offset calculation of the variable-length column is performed based on the variable-length column length; A column data request for the variable-length column is generated based on the target column offset of the variable-length column.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the acceleration method as described in any one of claims 14 to 16 is implemented.

18. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the acceleration method according to any one of claims 14 to 16 is implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the acceleration method according to any one of claims 14 to 16 is implemented.