+

CN107122490A - The data processing method and system of aggregate function in a kind of Querying by group - Google Patents

The data processing method and system of aggregate function in a kind of Querying by group Download PDF

Info

Publication number
CN107122490A
CN107122490A CN201710351866.0A CN201710351866A CN107122490A CN 107122490 A CN107122490 A CN 107122490A CN 201710351866 A CN201710351866 A CN 201710351866A CN 107122490 A CN107122490 A CN 107122490A
Authority
CN
China
Prior art keywords
data
group
querying
fpga
aggregate function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710351866.0A
Other languages
Chinese (zh)
Other versions
CN107122490B (en
Inventor
王丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710351866.0A priority Critical patent/CN107122490B/en
Publication of CN107122490A publication Critical patent/CN107122490A/en
Application granted granted Critical
Publication of CN107122490B publication Critical patent/CN107122490B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/244Grouping and aggregation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种分组查询中聚合函数的数据处理方法及系统,包括主CPU将待查询数据文件划分成数据块,并将所述数据块分配到多个计算节点;各计算节点CPU分别将所述数据块传输给FPGA,所述FPGA与所述计算节点CPU通过PCIe接口对应连接;所述FPGA获取所述数据块,按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算,并通过所述计算节点CPU向所述主CPU返回计算结果;计算算法采用Opencl语言并行优化实现,并移植在所述FPGA上;主CPU合并所述计算结果,得到最终的查询结果。本申请通过FPGA并行加速提高了计算节点的处理能力,进而提高了分组查询聚合函数的计算速度。

The present application discloses a data processing method and system for aggregation functions in group query, including the main CPU dividing the data file to be queried into data blocks, and distributing the data blocks to multiple computing nodes; each computing node CPU respectively The data block is transmitted to the FPGA, and the FPGA is correspondingly connected to the computing node CPU through the PCIe interface; the FPGA obtains the data block, and performs SQL group query on the data block according to the calculation algorithm of the aggregation function in the group query Calculate the aggregation function, and return the calculation result to the main CPU through the calculation node CPU; the calculation algorithm is realized by using Opencl language parallel optimization, and transplanted on the FPGA; the main CPU merges the calculation results to obtain the final query result. The present application improves the processing capability of computing nodes through FPGA parallel acceleration, thereby improving the computing speed of group query aggregation functions.

Description

一种分组查询中聚合函数的数据处理方法及系统Data processing method and system for aggregate function in group query

技术领域technical field

本申请涉及大数据处理领域,特别涉及一种分组查询中聚合函数的数据处理方法及系统。The present application relates to the field of big data processing, in particular to a data processing method and system for aggregate functions in group query.

背景技术Background technique

近年来,随着信息技术的发展,大数据处理技术作为新时代的高科技产物已经广泛应用在各行各业中。In recent years, with the development of information technology, big data processing technology, as a high-tech product of the new era, has been widely used in various industries.

大数据处理中采用了分布式处理技术,可以将不同地点的不同类型指令集和体系架构的计算节点使用通信网络连接起来,构成分布式处理系统。在主控制单元的统一控制管理下,各个计算节点协调地完成数据处理任务。Distributed processing technology is used in big data processing, which can connect computing nodes of different types of instruction sets and architectures in different locations using communication networks to form a distributed processing system. Under the unified control and management of the main control unit, each computing node coordinates to complete the data processing task.

分组查询计算是一项常见的数据处理任务,可以将同类别的处理对象划分为一组进行计算,得到目标聚合函数值,使得数据中的信息更加一目了然。Spark大数据处理系统作为大数据处理领域中最为热门的快速通用计算平台,可以支持外接设备使用SQL语句进行分组查询计算操作。Group query calculation is a common data processing task. It can divide the processing objects of the same category into a group for calculation, and obtain the target aggregation function value, making the information in the data more clear at a glance. As the most popular fast general-purpose computing platform in the field of big data processing, the Spark big data processing system can support external devices to use SQL statements to perform group query and computing operations.

随着数据存储规模和计算规模的不断增大,数据库的SQL分组查询计算操作面临着巨大的挑战。由于在当今信息爆炸时代,数据逐渐呈现出海量、类型多、价值密度低等特点,导致数据库的SQL分组查询计算操作的处理量和复杂度大大增加。相对于数据爆发式的增长速度,现有技术中计算节点的计算能力是有限的,因而处理时间也大大增加。因此,如何有效提高分组查询计算操作的速度,以适应当前社会的发展需求,已经成为本领域技术人员亟待解决的技术问题。With the continuous increase of data storage scale and calculation scale, the SQL group query calculation operation of the database is facing a huge challenge. In today's era of information explosion, data is gradually showing the characteristics of massive volume, multiple types, and low value density, which has greatly increased the processing volume and complexity of SQL group query calculation operations in the database. Compared with the explosive growth rate of data, the computing power of computing nodes in the prior art is limited, so the processing time is also greatly increased. Therefore, how to effectively increase the speed of group query computing operations to meet the development needs of the current society has become a technical problem to be solved urgently by those skilled in the art.

发明内容Contents of the invention

本申请的目的在于提供一种分组查询中聚合函数的数据处理方法及系统,以提高大数据平台进行分组查询聚合函数计算操作的速度。The purpose of this application is to provide a data processing method and system for aggregate functions in group query, so as to improve the speed of group query aggregate function calculation operations on the big data platform.

为解决上述技术问题,本申请提供一种分组查询中聚合函数的数据处理方法,包括:In order to solve the above technical problems, the application provides a data processing method for aggregate functions in group query, including:

主CPU将待查询数据文件划分成数据块,并将所述数据块分配到多个计算节点;The main CPU divides the data file to be queried into data blocks, and distributes the data blocks to multiple computing nodes;

各计算节点CPU分别将所述数据块传输给FPGA,所述FPGA与所述计算节点CPU通过PCIe接口对应连接;Each computing node CPU transmits the data block to the FPGA respectively, and the FPGA and the computing node CPU are correspondingly connected through a PCIe interface;

所述FPGA获取所述数据块,按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算,并通过所述计算节点CPU向所述主CPU返回计算结果;所述分组查询中聚合函数的计算算法的代码采用Opencl语言并行优化实现,并移植和部署在所述FPGA上;The FPGA acquires the data block, performs the calculation of the SQL group query aggregation function on the data block according to the calculation algorithm of the aggregation function in the group query, and returns the calculation result to the main CPU through the computing node CPU; The code of the calculation algorithm of the aggregation function in the group query adopts Opencl language parallel optimization, and is transplanted and deployed on the FPGA;

所述主CPU合并所述计算结果,得到最终的查询结果。The main CPU combines the calculation results to obtain the final query result.

可选地,在所述主CPU将待查询数据文件划分成数据块之前,还包括:Optionally, before the main CPU divides the data file to be queried into data blocks, it also includes:

所述主CPU解析查询语句;The main CPU parses the query statement;

依据所述查询语句加载所述待查询数据文件。The data file to be queried is loaded according to the query statement.

可选地,所述FPGA获取所述数据块包括:Optionally, obtaining the data block by the FPGA includes:

所述FPGA在本地内存申请空间;The FPGA applies for space in the local memory;

从DDR中将所述数据块加载到所述空间得到数据列。Loading the data block from the DDR into the space results in a data column.

可选地,所述FPGA按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算包括:Optionally, the calculation of the SQL group query aggregation function on the data block by the FPGA according to the calculation algorithm of the aggregation function in the group query includes:

在数据向量中加载所述数据列中的数据;loading data in said data column in a data vector;

判断所述数据向量中的数据是否满足SQL分组查询计算中聚合函数的查询条件;若是,执行所述SQL分组查询聚合函数的计算操作,并将结果向量中相应位的数据由第一标志位改写为第二标志位;Judging whether the data in the data vector satisfies the query condition of the aggregate function in the SQL group query calculation; if so, execute the calculation operation of the SQL group query aggregate function, and rewrite the corresponding bit data in the result vector by the first flag bit is the second flag;

根据所述聚合函数的查询条件合并所述结果向量得到计算结果。Combining the result vectors according to the query condition of the aggregation function to obtain a calculation result.

可选地,所述FPGA按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算包括:Optionally, the calculation of the SQL group query aggregation function on the data block by the FPGA according to the calculation algorithm of the aggregation function in the group query includes:

以unroll循环展开的方式按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算。The SQL group query aggregate function is calculated on the data block in the manner of unroll loop expansion according to the calculation algorithm of the aggregate function in the group query.

本申请还提供了一种分组查询中聚合函数的数据处理系统,包括:The present application also provides a data processing system for aggregation functions in group query, including:

主CPU:用于将待查询数据文件划分成数据块,并将所述数据块分配到多个计算节点;接收并合并各个FPGA进行SQL分组查询聚合函数计算的计算结果,得到最终的查询结果,其中,所述FPGA与所述计算节点CPU通过PCIe接口对应连接;Main CPU: used to divide the data file to be queried into data blocks, and distribute the data blocks to multiple computing nodes; receive and merge the calculation results of each FPGA for SQL group query aggregation function calculation to obtain the final query result, Wherein, the FPGA is correspondingly connected to the computing node CPU through a PCIe interface;

计算节点CPU:用于将分配得到的所述数据块传输给所述FPGA,并向所述主CPU传递所述FPGA返回的所述计算结果;Computing node CPU: used to transmit the allocated data block to the FPGA, and transmit the calculation result returned by the FPGA to the main CPU;

所述FPGA:用于获取所述数据块,按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算,并通过所述计算节点CPU向所述主CPU返回所述计算结果;所述分组查询中聚合函数的计算算法的代码采用Opencl语言并行优化实现,并移植和部署在所述FPGA上。The FPGA: used to obtain the data block, perform the SQL group query aggregation function calculation on the data block according to the calculation algorithm of the aggregation function in the group query, and return the data to the main CPU through the computing node CPU. Calculation results; the code of the calculation algorithm of the aggregation function in the group query is realized by using Opencl language parallel optimization, and transplanted and deployed on the FPGA.

可选地,所述主CPU还用于:Optionally, the main CPU is also used for:

解析查询语句;依据所述查询语句加载所述待查询数据文件。Analyzing the query statement; loading the data file to be queried according to the query statement.

可选地,所述FPGA在获取所述数据块时,具体用于:Optionally, when the FPGA obtains the data block, it is specifically used for:

在本地内存申请空间;并从DDR中将所述数据块加载到所述空间得到数据列。Applying for a space in the local memory; and loading the data block from the DDR into the space to obtain a data column.

可选地,所述FPGA在按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算时,具体用于:Optionally, when the FPGA performs the calculation of the SQL group query aggregation function on the data block according to the calculation algorithm of the aggregation function in the group query, it is specifically used for:

在数据向量中加载所述数据列中的数据;判断所述数据向量中的数据是否满足SQL分组查询中聚合函数的查询条件;若是,执行所述SQL分组查询聚合函数的计算操作,并将结果向量相应位的数据由第一标志位改写为第二标志位;根据所述聚合函数的查询条件合并所述结果向量得到计算结果。Load the data in the data column in the data vector; judge whether the data in the data vector satisfies the query condition of the aggregate function in the SQL group query; if so, execute the calculation operation of the SQL group query aggregate function, and send the result The data of the corresponding bit of the vector is rewritten from the first flag bit to the second flag bit; and the result vector is combined according to the query condition of the aggregation function to obtain the calculation result.

可选地,所述FPGA在按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算时具体用于:Optionally, the FPGA is specifically used to:

以unroll循环展开的方式按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算。The SQL group query aggregate function is calculated on the data block in the manner of unroll loop expansion according to the calculation algorithm of the aggregate function in the group query.

本申请所提供的分组查询中聚合函数的数据处理方法中,主CPU将待查询数据文件划分成数据块,并将所述数据块分配到多个计算节点;各计算节点CPU分别将所述数据块传输给FPGA,所述FPGA与所述计算节点CPU通过PCIe接口对应连接;所述FPGA获取所述数据块,按照分组查询中聚合函数的计算算法对所述数据块进行SQL分组查询聚合函数的计算,并通过所述计算节点CPU向所述主CPU返回计算结果;所述分组查询中聚合函数的计算算法的代码采用Opencl语言并行优化实现,并移植和部署在所述FPGA上;所述主CPU合并所述计算结果,得到最终的查询结果。In the data processing method of the aggregation function in the group query provided by the present application, the main CPU divides the data file to be queried into data blocks, and distributes the data blocks to a plurality of computing nodes; The block is transmitted to the FPGA, and the FPGA is correspondingly connected to the computing node CPU through the PCIe interface; the FPGA obtains the data block, and performs SQL group query aggregation function on the data block according to the calculation algorithm of the aggregation function in the group query Calculate, and return the calculation result to the main CPU through the calculation node CPU; the code of the calculation algorithm of the aggregation function in the group query adopts Opencl language parallel optimization, and transplants and deploys on the FPGA; the main CPU The CPU combines the calculation results to obtain the final query result.

可见,相比于现有技术,本申请所提供的分组查询中聚合函数的数据处理方法,通过设置与各个计算节点CPU采用PCIe接口对应连接的FPGA,构成了异构并行加速计算系统,利用FPGA硬件并行的特点,在FPGA上利用Opencl高级综合语言进行分组查询聚合函数计算算法的并行优化实现,,以便于提高对分块之后的数据进行分组查询计算的计算速度。通过各个FPGA有效地提高单个计算节点的计算能力和计算速度,进而可以快速获得整个待查询数据文件的查询结果,提高分组查询计算的速度。It can be seen that compared with the prior art, the data processing method of the aggregation function in the group query provided by the present application constitutes a heterogeneous parallel accelerated computing system by setting FPGAs correspondingly connected to the CPUs of each computing node using PCIe interfaces. The characteristics of hardware parallelism, using the Opencl high-level comprehensive language on the FPGA to carry out the parallel optimization of the group query aggregation function calculation algorithm, in order to improve the calculation speed of the group query calculation of the data after the block. Through each FPGA, the computing power and computing speed of a single computing node can be effectively improved, and then the query results of the entire data file to be queried can be quickly obtained, and the speed of group query computing can be improved.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对本申请实施例描述中需要使用的附图作简要的介绍。当然,下面有关本申请实施例的附图描述的仅仅是本申请中的一部分实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图,所获得的其他附图也属于本申请的保护范围。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings that need to be used in the description of the embodiments of the present application. Of course, the following drawings related to the embodiments of the application describe only a part of the embodiments of the application, and those of ordinary skill in the art can obtain other The accompanying drawings, and other obtained drawings also belong to the protection scope of the present application.

图1为本申请所提供的分组查询中聚合函数的数据处理方法的硬件场景示意图;Fig. 1 is the hardware scenario schematic diagram of the data processing method of aggregation function in the group query provided by the present application;

图2为本申请所提供的分组查询中聚合函数的数据处理方法的流程图;Fig. 2 is the flow chart of the data processing method of aggregate function in the group query provided by the present application;

图3为图2中FPGA对数据块进行SQL分组查询聚合函数计算的流程图;Fig. 3 is the flow chart that FPGA carries out SQL grouping query aggregate function calculation to data block in Fig. 2;

图4为FPGA对两个数据列进行SQL分组查询聚合函数计算的流程图;Fig. 4 is the flow chart that FPGA performs SQL grouping query aggregate function calculation to two data columns;

图5为本申请所提供的一种分组查询中聚合函数的数据处理系统的结构框图。FIG. 5 is a structural block diagram of a data processing system for aggregate functions in group query provided by the present application.

具体实施方式detailed description

为了对本申请实施例中的技术方案进行更加清楚、完整地描述,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行介绍。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Apparently, the described embodiments are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

请参考图1,图1为本申请所提供的分组查询中聚合函数的数据处理方法的硬件场景示意图,包括主服务器101、子服务器102、FPGA(Field Programmable Gate Array,现场可编程门阵列)103。Please refer to Fig. 1, Fig. 1 is the schematic diagram of the hardware scene of the data processing method of aggregation function in the group query provided by the present application, including main server 101, sub-server 102, FPGA (Field Programmable Gate Array, Field Programmable Gate Array) 103 .

主服务器101的主CPU通过响应主机端程序,可以完成相应的数据库操作,实现人机交互。子服务器102的CPU,即计算节点CPU,与FGPA103通过PCIe接口对应连接,构成了计算节点,具有单独对数据进行处理的能力。不同计算节点中的子服务器102通过通信网络连接起来,并受到主服务器101的主CPU的统一控制和管理。The main CPU of the main server 101 can complete corresponding database operations by responding to the host-side program, and realize human-computer interaction. The CPU of the sub-server 102, that is, the CPU of the computing node, is correspondingly connected with the FGPA 103 through the PCIe interface to form a computing node, which has the ability to process data independently. The sub-servers 102 in different computing nodes are connected through a communication network, and are uniformly controlled and managed by the main CPU of the main server 101 .

请参考图2,图2为本申请所提供的分组查询中聚合函数的数据处理方法的流程图。该方法具体包括以下步骤:Please refer to FIG. 2 . FIG. 2 is a flow chart of the data processing method of the aggregation function in the group query provided by the present application. The method specifically includes the following steps:

步骤201:主CPU将待查询数据文件划分成数据块。Step 201: The main CPU divides the data file to be queried into data blocks.

主CPU是在整个大数据处理系统中管理各种数据操作进程的控制中心。当对数据库进行分组查询操作时,由于数据规模一般都比较大,因此主CPU首先将待查询数据文件划分成数据块,以便于后续的查询操作的进行。The main CPU is the control center that manages various data operation processes in the entire big data processing system. When performing a group query operation on the database, since the data scale is generally relatively large, the main CPU first divides the data file to be queried into data blocks, so as to facilitate subsequent query operations.

具体地,所述待查询数据文件可以是主CPU在接收到查询语句之后,依据所述查询语句从指定存储区加载得到的。Specifically, the data file to be queried may be obtained by the main CPU after receiving the query statement and loading it from a designated storage area according to the query statement.

步骤202:主CPU将数据块分配到多个计算节点。Step 202: the main CPU distributes the data blocks to multiple computing nodes.

主CPU将各个数据块通过通信网络分别分配到多个计算节点中,以便各个计算节点分别对各自的数据块进行并行处理。The main CPU distributes each data block to a plurality of computing nodes through a communication network, so that each computing node processes each data block in parallel.

步骤203:各计算节点CPU分别将数据块传输给FPGA。Step 203: Each computing node CPU transmits the data block to the FPGA respectively.

如前所述,本申请所提供的分组查询中聚合函数的数据处理方法中,FPGA与计算节点中的计算节点CPU通过PCIe接口对应连接,可以实现数据的传输通信。计算节点CPU在接收到主CPU分配的数据块之后,即可将数据块通过数据接口传输给FPGA,以便FPGA对该数据块进行处理,执行分组查询操作。As mentioned above, in the data processing method of the aggregation function in the group query provided by this application, the FPGA and the CPU of the computing node in the computing node are correspondingly connected through the PCIe interface, so that data transmission and communication can be realized. After the computing node CPU receives the data block allocated by the main CPU, it can transmit the data block to the FPGA through the data interface, so that the FPGA can process the data block and perform group query operations.

步骤204:FPGA获取数据块。Step 204: FPGA obtains the data block.

具体地,当FPGA在获取计算节点传输的数据块时,首先在其本地内存中申请足够的存储空间,然后可以从DDR(Double Data Rate,双倍速率同步动态随机存储器)中将计算节点CPU传输来的数据块加载到所申请到的存储空间中,得到数据列,以便在后续步骤中针对数据列进行并行分组查询中聚合函数的计算。Specifically, when the FPGA obtains the data block transmitted by the computing node, it first applies for enough storage space in its local memory, and then transfers the computing node CPU from the DDR (Double Data Rate, double-rate synchronous dynamic random access memory) The incoming data blocks are loaded into the requested storage space to obtain the data columns, so that in the subsequent steps, the calculation of the aggregate function in the parallel grouping query can be performed on the data columns.

值得一提的是,将数据块存储在FPGA的本地内存中,可以减少计算节点通信网络中全局内存的访问和使用,进而提升计算节点的计算性能,提高分组查询计算的速度。It is worth mentioning that storing data blocks in the local memory of the FPGA can reduce the access and use of the global memory in the computing node communication network, thereby improving the computing performance of the computing nodes and increasing the speed of group query calculations.

步骤205:FPGA按照分组查询中聚合函数的计算算法对数据块进行SQL分组查询聚合函数的计算。Step 205: The FPGA calculates the aggregation function of the SQL group query on the data block according to the calculation algorithm of the aggregation function in the group query.

由于FPGA可以实现异构加速计算,因此可以将分组查询中聚合函数的计算算法的代码采用Opencl高级综合语言并行优化实现,并高效移植和部署到各个FPGA上,以便利用FPGA对数据块进行SQL分组查询聚合函数的计算。在分布式系统框架下,各个FPGA分别按照分组查询中聚合函数的计算算法对其获取到的数据块进行SQL分组查询聚合函数的计算,得到该数据块的计算结果。利用FPGA的硬件并行的优势,可以大大提升各个计算节点处理数据的速度,实现异构并行加速。Since FPGA can realize heterogeneous accelerated computing, the code of the calculation algorithm of the aggregation function in the group query can be optimized and implemented in parallel using the Opencl high-level synthesis language, and can be efficiently transplanted and deployed to each FPGA, so that the SQL grouping of data blocks can be performed using the FPGA Query the computation of aggregate functions. Under the framework of the distributed system, each FPGA calculates the SQL group query aggregation function for the acquired data block according to the calculation algorithm of the aggregation function in the group query, and obtains the calculation result of the data block. Using the advantages of FPGA hardware parallelism can greatly increase the speed of data processing of each computing node and realize heterogeneous parallel acceleration.

需要说明的是,这里所述的SQL分组查询中聚合函数的计算具体可以为分组求和、分组求算数平均值、分组求最值等,可分别使用相应的聚合函数,通过Opencl编程语言在FPGA中实现,本申请实施例对SQL分组查询聚合函数计算的具体内容并不做限定。It should be noted that the calculation of the aggregate function in the SQL group query described here can specifically be summation by group, calculation of the arithmetic mean value by group, maximum value by group, etc., and corresponding aggregation functions can be used respectively. implementation, the embodiment of this application does not limit the specific content of SQL group query aggregate function calculation.

步骤206:FPGA通过计算节点CPU向主CPU返回计算结果。Step 206: the FPGA returns the calculation result to the main CPU through the computing node CPU.

每个计算节点中的FPGA,将其在步骤205中得到的计算结果经PCIe接口传输给对应的计算节点CPU,计算节点CPU再进一步将该计算结果经通信网络返回给主CPU。The FPGA in each computing node transmits the calculation result obtained in step 205 to the corresponding computing node CPU through the PCIe interface, and the computing node CPU further returns the calculation result to the main CPU through the communication network.

步骤207:主CPU合并计算结果,得到最终的查询结果。Step 207: The main CPU merges the calculation results to obtain the final query result.

在分布式系统框架下,主CPU接收到的来自各个计算节点的计算结果,分别对应着分配到各个计算节点的数据块,因此,主CPU可以将各个计算结果进行合并,得到待查询数据文件的最终的查询结果。Under the framework of a distributed system, the calculation results received by the main CPU from each computing node correspond to the data blocks allocated to each computing node. Therefore, the main CPU can combine the calculation results to obtain the data file to be queried. The final query result.

可见,本申请所提供的分组查询中聚合函数的数据处理方法利用FPGA构成了异构并行加速计算系统。之所以采用FPGA进行数据库分组查询聚合函数的异构计算,是因为FPGA具有硬件并行的优势,在每个时钟周期内相比较CPU可以执行较多的处理任务,为满足应用需求提供快速的响应时间;此外,它还具有动态可重构、稳定性良好、低功耗等优点,因此,非常适合作为异构计算中的加速器件。采用FPGA作为硬件加速器件,利用其硬件并行的优势进行异构加速计算,可以大大提高大数据处理框架中单个节点的计算能力,降低其数据中心的功耗,同时还可以减少因计算集群的快速扩张带来的网络传输开销。因此,通过将分组查询聚合函数的计算算法采用Opencl高级综合语言在FPGA上进行并行优化实现,并在各个计算节点中分别使用FPGA进行计算,可以有效提高对整个待查询数据文件的分组查询聚合函数计算的速度。It can be seen that the data processing method of the aggregation function in the group query provided by the present application utilizes FPGA to form a heterogeneous parallel accelerated computing system. The reason why FPGA is used for heterogeneous calculation of database group query aggregation function is because FPGA has the advantage of hardware parallelism, and compared with CPU, FPGA can perform more processing tasks in each clock cycle, providing fast response time to meet application requirements ; In addition, it also has the advantages of dynamic reconfigurability, good stability, low power consumption, etc., so it is very suitable as an acceleration device in heterogeneous computing. Using FPGA as a hardware acceleration device, taking advantage of its hardware parallelism to perform heterogeneous accelerated computing, can greatly improve the computing power of a single node in the big data processing framework, reduce the power consumption of its data center, and at the same time reduce the speed of computing clusters. Network transmission overhead caused by expansion. Therefore, by using the Opencl high-level comprehensive language to perform parallel optimization on the FPGA for the calculation algorithm of the group query aggregation function, and using the FPGA for calculation in each computing node, the group query aggregation function for the entire data file to be queried can be effectively improved. Computing speed.

请参考图3,图3为图2中FPGA对数据块进行SQL分组查询聚合函数的计算的流程图,可以包括以下步骤:Please refer to FIG. 3. FIG. 3 is a flow chart of the calculation of the SQL group query aggregation function performed by the FPGA on the data block in FIG. 2, which may include the following steps:

步骤301:在数据向量中加载数据列中的数据。Step 301: Load the data in the data column in the data vector.

FPGA在获取数据块得到数据列之后,针对每个数据列,可以定义一个数据向量,然后将该数据列中的数据加载到该数据向量中。每个数据列的数据向量的数据位数与该数据列的数据位数相一致。After the FPGA acquires the data block to obtain the data column, a data vector can be defined for each data column, and then the data in the data column is loaded into the data vector. The number of data bits of the data vector of each data column is consistent with the number of data bits of the data column.

步骤302:判断数据向量中的数据是否满足SQL分组查询中聚合函数的查询条件;若是,进入步骤303。Step 302: Determine whether the data in the data vector satisfies the query condition of the aggregation function in the SQL group query; if so, go to step 303.

对每个数据向量中的每个数据进行判断:判断该位数据是否满足SQL分组查询中聚合函数的查询条件;若是,则进入步骤303以完成相应的后续操作。当然,FPGA针对每个数据向量中的每个数据的判断是并行完成的,可以有效提高数据的处理速度。Judging each data in each data vector: judging whether the bit data satisfies the query condition of the aggregation function in the SQL group query; if so, enter step 303 to complete the corresponding follow-up operation. Of course, the judgment of the FPGA for each data in each data vector is done in parallel, which can effectively improve the data processing speed.

步骤303:执行SQL分组查询聚合函数的计算操作,并将结果向量中相应位的数据由第一标志位改写为第二标志位。Step 303: Execute the calculation operation of the SQL group query aggregation function, and rewrite the corresponding bit data in the result vector from the first flag bit to the second flag bit.

如前所述,SQL分组查询聚合函数的计算具体可以为多种内容,并通过相应的聚合函数得以实现。FPGA根据SQL分组查询中的聚合函数,对经步骤302判断为符合查询条件的数据,执行SQL分组查询聚合函数的计算操作。同时,为了区分和表示该位数据是否符合查询条件,可以将结果向量中的相应位的数据由第一标志位改写为第二标志位。As mentioned above, the calculation of the aggregation function of the SQL group query can specifically be various contents, and can be realized through the corresponding aggregation function. According to the aggregation function in the SQL group query, the FPGA executes the calculation operation of the SQL group query aggregation function for the data judged to meet the query conditions in step 302 . At the same time, in order to distinguish and indicate whether the bit data meets the query condition, the corresponding bit data in the result vector can be rewritten from the first flag bit to the second flag bit.

其中,结果向量、数据向量和数据列均是一一对应的关系,即结果向量中的数据,表示的是对应的数据向量或数据列中的相应位的数据是否符合聚合函数的查询条件。为了区分和表示,结果向量中的所有数据可以默认初始化为第一标志位;当判断数据向量中相应位的数据符合聚合函数的查询条件时,可以将结果向量中相应位的数据改写为第二标志位。具体的,可以将第一标志位设置为0,将第二标志位设置为1;或者将第一标志位设置为1,将第二标志位设置为0,本申请对此并不做限定。Among them, the result vector, data vector and data column are in a one-to-one correspondence relationship, that is, the data in the result vector indicates whether the corresponding data in the corresponding data vector or data column meets the query condition of the aggregation function. In order to distinguish and express, all the data in the result vector can be initialized as the first flag by default; when it is judged that the data of the corresponding bit in the data vector meets the query conditions of the aggregation function, the data of the corresponding bit in the result vector can be rewritten as the second Flag bit. Specifically, the first flag bit can be set to 0, and the second flag bit can be set to 1; or the first flag bit can be set to 1, and the second flag bit can be set to 0, which is not limited in this application.

需要说明的是,本步骤中,可以先执行SQL分组查询聚合函数的计算操作,在将结果向量中相应位数据由第一标志位改写为第二标志位,也可以先将结果向量中相应位数据由第一标志位改写为第二标志位,再执行SQL分组查询聚合函数的计算操作,本申请实施例对两者的先后顺序并不做限定,可依据具体情况和编程习惯进行选择。It should be noted that in this step, the calculation operation of the SQL group query aggregate function can be performed first, and the corresponding bit data in the result vector is rewritten from the first flag bit to the second flag bit, or the corresponding bit in the result vector can be first The data is rewritten from the first flag bit to the second flag bit, and then the calculation operation of the SQL group query aggregation function is executed. The embodiment of the present application does not limit the order of the two, and can be selected according to the specific situation and programming habits.

值得一提的是,在本申请实施例中,在具体进行SQL分组查询聚合函数的计算时,优选以unroll循环展开的方式对数据进行处理,即所述分组查询中聚合函数的计算算法优选以unroll循环展开的方式编写代码进行实现,以进一步增加FPGA在每个时钟周期内的工作量,从而缩短整个算法运行的时间,进一步提高分组查询聚合函数的计算速度。It is worth mentioning that, in the embodiment of the present application, when calculating the aggregation function of the SQL group query, it is preferable to process the data in the manner of unroll loop expansion, that is, the calculation algorithm of the aggregation function in the group query is preferably The code is written and implemented in the way of unroll loop expansion to further increase the workload of the FPGA in each clock cycle, thereby shortening the running time of the entire algorithm and further improving the calculation speed of the group query aggregation function.

步骤304:根据聚合函数的查询条件合并结果向量得到计算结果。Step 304: Combine the result vectors according to the query condition of the aggregation function to obtain the calculation result.

针对经过步骤303得到的多个数据列各自对应的结果向量,FPGA根据聚合函数的查询条件对其进行合并,得到该计算节点的数据块的计算结果,以便于后续步骤的完成。For the result vectors corresponding to the plurality of data columns obtained in step 303, the FPGA merges them according to the query condition of the aggregation function to obtain the calculation result of the data block of the computing node, so as to facilitate the completion of the subsequent steps.

下面,以待查询的数据列为两个的情况为例,具体介绍FPGA进行SQL分组查询计算的过程,其流程图如图4所示,包括以下步骤:Next, taking the case where there are two data columns to be queried as an example, the process of FPGA performing SQL group query calculation is introduced in detail. The flowchart is shown in Figure 4, including the following steps:

步骤401:在数据向量1中加载数据列1的数据;在数据向量2中加载数据列2的数据。Step 401: Load the data of data column 1 in data vector 1; load the data of data column 2 in data vector 2.

以待查询的数据列为两个的情况为例,可以将所述的两个数据列分别命名为数据列1和数据列2,各自对应的数据向量分别命名为数据向量1和数据向量2,并将两个数据列分别加载到各自对应的数据向量中。容易理解的是,数据向量1与数据列1数据位数相同;数据向量2与数据列2数据位数相同。Taking the case where there are two data columns to be queried as an example, the two data columns may be named data column 1 and data column 2 respectively, and the corresponding data vectors are named data vector 1 and data vector 2 respectively, And load the two data columns into their respective data vectors. It is easy to understand that data vector 1 has the same number of data bits as data column 1; data vector 2 has the same number of data bits as data column 2.

步骤402:以unroll循环展开方式判断数据向量1和数据向量2中的每位数据是否满足聚合函数的查询条件;若是,进入步骤403。Step 402: Determine whether each bit of data in data vector 1 and data vector 2 satisfies the query condition of the aggregation function by unrolling; if so, go to step 403.

对数据向量1和数据向量2中的每位数据并行进行判断,若满足聚合函数的查询操作,则进入步骤403。Judgment is performed on each bit of data in data vector 1 and data vector 2 in parallel, and if the query operation of the aggregation function is satisfied, then go to step 403 .

并且,本实施例中步骤402中的判断操作以及后续步骤403和404中针对判断结果所执行的一系列操作采用unroll循环展开的方式进行,可以进一步提升数据处理的速度。Moreover, in this embodiment, the judgment operation in step 402 and a series of operations performed on the judgment result in subsequent steps 403 and 404 are performed in an unroll loop, which can further increase the speed of data processing.

步骤403:执行SQL分组查询聚合函数的计算操作,并将结果向量1或结果向量2中相应位的数据由0改写为1。Step 403: Execute the calculation operation of the SQL group query aggregation function, and rewrite the corresponding bit data in the result vector 1 or the result vector 2 from 0 to 1.

同样可以理解的是,结果向量1与数据列1数据位数相同;而结果向量2与数据列2数据位数相同。It can also be understood that the result vector 1 has the same number of data bits as the data column 1; and the result vector 2 has the same number of data bits as the data column 2.

这里将前文所述的结果向量的数据的第一标志位设置为0、第二标志位设置为1,当然也可采用其他设置方式,这里不再赘述。若数据向量1中的数据经过步骤402判断为符合聚合函数查询条件时,即将结果向量1中相应位的数据由0改写为1;同理,若数据向量2中的数据被判断为符合聚合函数的查询条件时,则将结果向量2中相应位的数据由0改写为1。Here, the first flag bit of the data of the result vector described above is set to 0, and the second flag bit is set to 1. Of course, other setting methods can also be used, which will not be repeated here. If the data in the data vector 1 is judged to meet the aggregation function query condition by step 402, the data in the corresponding bit in the result vector 1 will be rewritten from 0 to 1; similarly, if the data in the data vector 2 is judged to meet the aggregation function When the query condition is specified, the data in the corresponding bit in the result vector 2 is rewritten from 0 to 1.

步骤404:根据聚合函数的查询条件合并结果向量1和结果向量2,得到计算结果。Step 404: Combine the result vector 1 and the result vector 2 according to the query condition of the aggregation function to obtain the calculation result.

将经过步骤403处理后的结果向量1和结果向量2进行合并,即可得到该计算节点所有数据的计算结果,从而以便于返回该计算结果以完成接下来的步骤。By merging the result vector 1 and result vector 2 processed in step 403, the calculation result of all the data of the computing node can be obtained, so that the calculation result can be returned to complete the next steps.

下面对本发明实施例提供的分组查询中聚合函数的数据处理系统进行介绍。下文描述的分组查询中聚合函数的数据处理系统与上文描述的分组查询中聚合函数的数据处理方法可相互对应参照。The data processing system for the aggregation function in the group query provided by the embodiment of the present invention is introduced below. The data processing system of the aggregation function in the group query described below and the data processing method of the aggregation function in the group query described above can be referred to in correspondence.

请参阅图5,图5为本申请所提供的一种分组查询中聚合函数的数据处理系统的结构框图;包括主CPU501、计算节点CPU502、FPGA503。Please refer to FIG. 5 . FIG. 5 is a structural block diagram of a data processing system for aggregation functions in group query provided by the present application; it includes a main CPU 501 , a computing node CPU 502 , and an FPGA 503 .

主CPU501通过通信网络和多个计算节点CPU502连接,通过主机端程序可以控制各个计算节点间的数据传输和程序调度。计算节点具体是由计算节点CPU502和FPGA503所构成的,并且计算节点CPU502和FPGA503之间采用PCIe高速接口实现连接。每个FPGA503上均移植和部署了分组查询中聚合函数的计算算法的Opencl语言并行优化代码。每个计算节点均具有单独存储和处理数据的能力,多个计算节点在主CPU501的统一控制和管理下,构成了异构并行加速计算系统。The main CPU 501 is connected to a plurality of computing node CPUs 502 through a communication network, and can control data transmission and program scheduling between each computing node through a host computer program. The computing node is specifically composed of a computing node CPU502 and an FPGA503, and the computing node CPU502 and the FPGA503 are connected through a PCIe high-speed interface. The Opencl language parallel optimization code of the calculation algorithm of the aggregation function in the group query is transplanted and deployed on each FPGA503. Each computing node has the ability to store and process data independently, and multiple computing nodes form a heterogeneous parallel accelerated computing system under the unified control and management of the main CPU 501 .

主CPU501用于将待查询数据文件划分成数据块,并将所述数据块分配到多个计算节点。具体地,在将待查询数据文件划分成数据块之前,主CPU501还用于解析程序中的查询语句,并依据所述查询语句从指定存储区中加载待查询数据文件。当FPGA503返回计算结果后,主CPU501对来自不同计算节点的FPGA503的不同计算结果进行合并,得到待查询数据文件完整的最终查询结果。The main CPU 501 is used to divide the data file to be queried into data blocks, and distribute the data blocks to multiple computing nodes. Specifically, before dividing the data file to be queried into data blocks, the main CPU 501 is also used to parse the query statement in the program, and load the data file to be queried from the designated storage area according to the query statement. After the FPGA 503 returns the calculation results, the main CPU 501 merges the different calculation results of the FPGA 503 from different computing nodes, and obtains the complete final query result of the data file to be queried.

计算节点CPU502从通信网络中接收到来自主CPU501的数据块后,将该数据块传输给FPGA503,以便FPGA503对该数据块执行SQL分组查询聚合函数的计算操作得到计算结果,从而向主CPU501传递FPGA503返回的计算结果。After the calculation node CPU502 receives the data block from the main CPU501 from the communication network, it transmits the data block to the FPGA503, so that the FPGA503 performs the calculation operation of the SQL grouping query aggregation function on the data block to obtain the calculation result, thereby transmitting the FPGA503 return to the main CPU501 calculation results.

FPGA503作为本申请提供的分组查询中聚合函数的数据处理系统中的硬件加速器件,在从计算节点CPU502获取到数据块之后,用于按照分组查询中聚合函数的计算算法对该数据块进行SQL分组查询聚合函数的计算,以获得该数据块的计算结果,并通过计算节点CPU502向主CPU501返回计算结果。如前所述,所述分组查询聚合函数的计算算法采用Opencl高级综合语言并行优化实现,并高效移植和部署到各个FPGA上,以便利用FPGA对数据块进行SQL分组查询聚合函数的计算。并且,所述分组查询中聚合函数的计算算法优选以unroll循环展开的方式编写代码进行实现,以便在FPGA进行SQL分组查询聚合函数的计算时,进一步增加FPGA在每个时钟周期内的工作量,从而提高分组查询聚合函数的计算速度。FPGA503 is used as the hardware acceleration device in the data processing system of the aggregation function in the group query provided by this application. After obtaining the data block from the computing node CPU502, it is used to perform SQL grouping on the data block according to the calculation algorithm of the aggregation function in the group query Query the calculation of the aggregation function to obtain the calculation result of the data block, and return the calculation result to the main CPU 501 through the calculation node CPU 502 . As mentioned above, the calculation algorithm of the group query aggregation function is realized by parallel optimization of the Opencl high-level synthesis language, and is efficiently transplanted and deployed to each FPGA, so that the SQL group query aggregation function can be calculated on the data block by the FPGA. And, the calculation algorithm of the aggregate function in the group query is preferably implemented by writing code in an unroll loop expansion mode, so that when the FPGA performs the calculation of the SQL group query aggregate function, the workload of the FPGA is further increased in each clock cycle, In this way, the calculation speed of the aggregation function of the group query is improved.

其中,当FPGA503从计算节点CPU502获取数据块时,具体用于在本地内存申请空间,并从DDR中将计算节点502传输的数据块加载到申请的空间得到数据列。而当FPGA503进行SQL分组查询聚合函数的计算时,其首先在数据向量中加载数据列中的数据;然后判断所述数据向量中的数据是否满足SQL分组查询计算中聚合函数的查询条件;若是,执行所述SQL分组查询聚合函数的计算操作,并将结果向量相应位的数据由第一标志位改写为第二标志位;最后根据所述聚合函数的查询条件合并所述结果向量得到计算结果。Wherein, when the FPGA503 obtains the data block from the computing node CPU502, it is specifically used to apply for space in the local memory, and loads the data block transmitted by the computing node 502 from the DDR into the applied space to obtain a data column. And when FPGA503 carried out the calculation of SQL grouping query aggregation function, it first loaded the data in the data column in the data vector; Then judge whether the data in the data vector satisfies the query condition of the aggregation function in the SQL grouping query calculation; if, Execute the calculation operation of the SQL grouping query aggregation function, and rewrite the corresponding bit data of the result vector from the first flag bit to the second flag bit; finally combine the result vectors according to the query conditions of the aggregation function to obtain the calculation result.

可见,本申请所提供的分组查询中聚合函数的数据处理系统,通过在每个计算节点中设置FPGA503,并在FPGA503上移植和部署了分组查询中聚合函数计算算法的Opencl语言并行优化代码,构成了异构并行加速计算系统,因而可以利用FPGA503的硬件并行特点,加速单个计算节点的处理进程,进而实现对整个待查询文件进行分组查询聚合函数的数据处理进程的加速。It can be seen that the data processing system of the aggregation function in the group query provided by the present application, by setting FPGA503 in each computing node, and transplanting and deploying the Opencl language parallel optimization code of the aggregation function calculation algorithm in the group query on the FPGA503, constitutes A heterogeneous parallel accelerated computing system is established, so the hardware parallel feature of FPGA503 can be used to accelerate the processing process of a single computing node, and then realize the acceleration of the data processing process of the group query aggregation function for the entire file to be queried.

本申请中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the present application is described in a progressive manner, each embodiment focuses on the differences from other embodiments, and the same and similar parts of the various embodiments can be referred to each other. As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.

专业人员还可以进一步意识到,结合本文中所公开的实施例描述的方法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals can further realize that the method steps described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, in In the above description, the components and steps of each example have been generally described in terms of functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

以上对本申请所提供的分组查询中聚合函数的数据处理方法及系统进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The data processing method and system of the aggregation function in the group query provided by this application have been introduced in detail above. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application. It should be pointed out that those skilled in the art can make several improvements and modifications to the application without departing from the principles of the application, and these improvements and modifications also fall within the protection scope of the claims of the application.

Claims (10)

1. the data processing method of aggregate function in a kind of Querying by group, it is characterised in that comprise the following steps:
Data file to be checked is divided into data block by host CPU, and the data block is assigned into multiple calculate nodes;
Each calculate node CPU is respectively by the transmission of data blocks to FPGA, and the FPGA and calculate node CPU passes through PCIe Interface correspondence is connected;
The FPGA obtains the data block, and the data block is carried out according to the computational algorithm of aggregate function in Querying by group The calculating of SQL Querying by group aggregate functions, and result of calculation is returned to the host CPU by the calculate node CPU;Described point The code of the computational algorithm of aggregate function is realized using Opencl language parallel optimization in group polling, and is transplanted and be deployed in and be described On FPGA;
The host CPU merges the result of calculation, obtains final Query Result.
2. the data processing method of aggregate function in Querying by group according to claim 1, it is characterised in that in the master Data file to be checked is divided into before data block by CPU, in addition to:
The host CPU parses query statement;
The data file to be checked is loaded according to the query statement.
3. the data processing method of aggregate function in Querying by group according to claim 1, it is characterised in that the FPGA Obtaining the data block includes:
The FPGA is in local memory application space;
The data block is loaded into the space from DDR and obtains data row.
4. the data processing method of aggregate function in Querying by group according to claim 3, it is characterised in that the FPGA The calculating bag of SQL Querying by group aggregate functions is carried out to the data block according to the computational algorithm of aggregate function in Querying by group Include:
The data in the data row are loaded in data vector;
Judge whether the data in the data vector meet the querying condition of aggregate function in SQL Querying by group;If so, performing The calculating operation of SQL Querying by group aggregate functions, and the data of corresponding positions in result vector are rewritten as the by the first flag bit Two flag bits;
The result vector is merged according to the querying condition of the aggregate function and obtains result of calculation.
5. the data processing method of aggregate function in Querying by group according to claim 4, it is characterised in that the FPGA The calculating bag of SQL Querying by group aggregate functions is carried out to the data block according to the computational algorithm of aggregate function in Querying by group Include:
In the way of unroll loop unrollings according to Querying by group in aggregate function computational algorithm to the data block carry out SQL The calculating of Querying by group aggregate function.
6. the data handling system of aggregate function in a kind of Querying by group, it is characterised in that including:
Host CPU:For data file to be checked to be divided into data block, and the data block is assigned to multiple calculate nodes; Receive and merge each FPGA and carry out the result of calculation that SQL Querying by group aggregate function is calculated, obtain final Query Result, its In, the FPGA is connected with the calculate node CPU by the way that PCIe interface is corresponding;
Calculate node CPU:Institute is transmitted for the obtained transmission of data blocks will to be distributed to the FPGA, and to the host CPU State the result of calculation of FPGA returns;
The FPGA:For obtaining the data block, according to the computational algorithm of aggregate function in Querying by group to the data block The calculating of SQL Querying by group aggregate functions is carried out, and described calculate is returned to the host CPU by the calculate node CPU tying Really;In the Querying by group code of the computational algorithm of aggregate function using Opencl language parallel optimization realize, and transplant and It is deployed on the FPGA.
7. according to claim 6 in Querying by group aggregate function data handling system, it is characterised in that the host CPU It is additionally operable to:
Parse query statement;The data file to be checked is loaded according to the query statement.
8. according to claim 6 in Querying by group aggregate function data handling system, it is characterised in that FPGA tool Body is used for:
In local memory application space;And from DDR by the data block be loaded into the space obtain data row.
9. according to claim 8 in Querying by group aggregate function data handling system, it is characterised in that FPGA tool Body is used for:
The data in the data row are loaded in data vector;Judge whether the data in the data vector meet SQL points The querying condition of aggregate function in group polling;If so, perform SQL Querying by group aggregate functions calculating operation, and by result to The data of amount corresponding positions are rewritten as the second flag bit by the first flag bit;According to merging the querying condition of the aggregate function Result vector obtains result of calculation.
10. according to claim 9 in Querying by group aggregate function data handling system, it is characterised in that the FPGA Specifically for:
In the way of unroll loop unrollings according to Querying by group in aggregate function computational algorithm to the data block carry out SQL The calculating of Querying by group aggregate function.
CN201710351866.0A 2017-05-18 2017-05-18 Data processing method and system for aggregation function in packet query Active CN107122490B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710351866.0A CN107122490B (en) 2017-05-18 2017-05-18 Data processing method and system for aggregation function in packet query

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710351866.0A CN107122490B (en) 2017-05-18 2017-05-18 Data processing method and system for aggregation function in packet query

Publications (2)

Publication Number Publication Date
CN107122490A true CN107122490A (en) 2017-09-01
CN107122490B CN107122490B (en) 2021-01-29

Family

ID=59727519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710351866.0A Active CN107122490B (en) 2017-05-18 2017-05-18 Data processing method and system for aggregation function in packet query

Country Status (1)

Country Link
CN (1) CN107122490B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612682A (en) * 2017-09-25 2018-01-19 郑州云海信息技术有限公司 A kind of data processing method based on SHA512 algorithms, apparatus and system
CN107612681A (en) * 2017-09-25 2018-01-19 郑州云海信息技术有限公司 A data processing method, device and system based on SM3 algorithm
CN107704268A (en) * 2017-09-27 2018-02-16 郑州云海信息技术有限公司 MD5 hash functions computational methods, system and computer-readable recording medium
CN108108472A (en) * 2018-01-02 2018-06-01 联想(北京)有限公司 Data processing method and server
CN108984470A (en) * 2018-06-19 2018-12-11 四川斐讯信息技术有限公司 A kind of FPGA mine machine calculates the lifting system and method for power
CN110209631A (en) * 2019-05-10 2019-09-06 普华诚信信息技术有限公司 Big data processing method and its processing system
CN111614651A (en) * 2020-05-14 2020-09-01 南京艾科朗克信息科技有限公司 Low-delay TDS protocol analysis method based on FPGA
CN111858038A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and medium for reading data in FPGA board memory
CN112328620A (en) * 2020-11-05 2021-02-05 浪潮云信息技术股份公司 Distributed database query acceleration method
CN115840640A (en) * 2022-11-28 2023-03-24 贵州电网有限责任公司 Operation acceleration system and method for power edge intelligent algorithm
CN116186096A (en) * 2023-02-07 2023-05-30 山东浪潮科学研究院有限公司 Relational database aggregation query method, device, equipment and medium based on FPGA
CN116305192A (en) * 2023-02-07 2023-06-23 成都海泰方圆科技有限公司 Data file processing method and device, electronic equipment and storage medium
CN119885247A (en) * 2025-03-28 2025-04-25 苏州元脑智能科技有限公司 Data query method, system, device, medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009114483A1 (en) * 2008-03-08 2009-09-17 Mentor Graphics Corporation High-frequency vlsi interconnect and intentional inductor impedance extraction in the presence of a multi-layer conductive substrate
CN103631911A (en) * 2013-11-27 2014-03-12 中国人民大学 OLAP query processing method based on array storage and vector processing
CN105159610A (en) * 2015-09-01 2015-12-16 浪潮(北京)电子信息产业有限公司 Large-scale data processing system and method
CN106547627A (en) * 2016-11-24 2017-03-29 郑州云海信息技术有限公司 The method and system that a kind of Spark MLlib data processings accelerate
CN106598738A (en) * 2016-12-13 2017-04-26 郑州云海信息技术有限公司 Computer cluster system and parallel computing method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009114483A1 (en) * 2008-03-08 2009-09-17 Mentor Graphics Corporation High-frequency vlsi interconnect and intentional inductor impedance extraction in the presence of a multi-layer conductive substrate
CN103631911A (en) * 2013-11-27 2014-03-12 中国人民大学 OLAP query processing method based on array storage and vector processing
CN105159610A (en) * 2015-09-01 2015-12-16 浪潮(北京)电子信息产业有限公司 Large-scale data processing system and method
CN106547627A (en) * 2016-11-24 2017-03-29 郑州云海信息技术有限公司 The method and system that a kind of Spark MLlib data processings accelerate
CN106598738A (en) * 2016-12-13 2017-04-26 郑州云海信息技术有限公司 Computer cluster system and parallel computing method thereof

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612681A (en) * 2017-09-25 2018-01-19 郑州云海信息技术有限公司 A data processing method, device and system based on SM3 algorithm
CN107612682A (en) * 2017-09-25 2018-01-19 郑州云海信息技术有限公司 A kind of data processing method based on SHA512 algorithms, apparatus and system
CN107704268A (en) * 2017-09-27 2018-02-16 郑州云海信息技术有限公司 MD5 hash functions computational methods, system and computer-readable recording medium
CN108108472A (en) * 2018-01-02 2018-06-01 联想(北京)有限公司 Data processing method and server
CN108108472B (en) * 2018-01-02 2022-05-31 联想(北京)有限公司 Data processing method and server
CN108984470A (en) * 2018-06-19 2018-12-11 四川斐讯信息技术有限公司 A kind of FPGA mine machine calculates the lifting system and method for power
CN110209631A (en) * 2019-05-10 2019-09-06 普华诚信信息技术有限公司 Big data processing method and its processing system
CN111614651A (en) * 2020-05-14 2020-09-01 南京艾科朗克信息科技有限公司 Low-delay TDS protocol analysis method based on FPGA
US11687242B1 (en) 2020-06-30 2023-06-27 Inspur Electronic Information Industry Co., Ltd. FPGA board memory data reading method and apparatus, and medium
CN111858038A (en) * 2020-06-30 2020-10-30 浪潮电子信息产业股份有限公司 Method, device and medium for reading data in FPGA board memory
CN112328620A (en) * 2020-11-05 2021-02-05 浪潮云信息技术股份公司 Distributed database query acceleration method
CN115840640A (en) * 2022-11-28 2023-03-24 贵州电网有限责任公司 Operation acceleration system and method for power edge intelligent algorithm
CN116186096A (en) * 2023-02-07 2023-05-30 山东浪潮科学研究院有限公司 Relational database aggregation query method, device, equipment and medium based on FPGA
CN116305192A (en) * 2023-02-07 2023-06-23 成都海泰方圆科技有限公司 Data file processing method and device, electronic equipment and storage medium
CN116305192B (en) * 2023-02-07 2023-11-14 成都海泰方圆科技有限公司 Data file processing method and device, electronic equipment and storage medium
CN119885247A (en) * 2025-03-28 2025-04-25 苏州元脑智能科技有限公司 Data query method, system, device, medium and program product
CN119885247B (en) * 2025-03-28 2025-07-22 苏州元脑智能科技有限公司 Data query method, system, device, medium and program product

Also Published As

Publication number Publication date
CN107122490B (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN107122490A (en) The data processing method and system of aggregate function in a kind of Querying by group
US11361217B2 (en) Chip and chip-based data processing method
CN106951926B (en) Deep learning method and device of hybrid architecture
CN113469350B (en) Deep convolutional neural network acceleration method and system suitable for NPU
JP2020537786A (en) Neural network processing system with multiple processors and neural network accelerators
CN109447241B (en) A Dynamic Reconfigurable Convolutional Neural Network Accelerator Architecture for the Internet of Things
CN106228238A (en) The method and system of degree of depth learning algorithm is accelerated on field programmable gate array platform
Li et al. An FPGA design framework for CNN sparsification and acceleration
CN110659278A (en) Graph data distributed processing system based on CPU-GPU heterogeneous architecture
CN116384312A (en) A Circuit Yield Analysis Method Based on Parallel Heterogeneous Computing
CN107679409A (en) A kind of acceleration method and system of data encryption
CN119166159A (en) A model optimization method and related device
CN115221111A (en) Processor data operation method, processor, device and storage medium
Wu et al. Skeletongcn: a simple yet effective accelerator for gcn training
Lee et al. Task parallelism-aware deep neural network scheduling on multiple hybrid memory cube-based processing-in-memory
Zhang et al. Edgenn: Efficient neural network inference for cpu-gpu integrated edge devices
US12412108B2 (en) System and method for inference generation via optimization of inference model portions
CN105955896B (en) A reconfigurable DBF algorithm hardware accelerator and control method
CN110555522B (en) Data processing method, data processing device, computer equipment and storage medium
CN114297260B (en) Distributed RDF data query method, device and computer equipment
CN113553031B (en) Software definition variable structure computing architecture and left-right brain integrated resource joint distribution method realized by using same
CN117992197A (en) Neural network model mapping scheduling operation method and device, electronic equipment and medium
CN106598913A (en) KNL cluster acceleration solving method and apparatus
CN105608046A (en) Multi-core processor architecture based on MapReduce programming model
CN116402091A (en) Hybrid engine intelligent computing method and device for artificial intelligent chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201202

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载