Data processing system, method and parallel processing module

CN117667994BActive Publication Date: 2026-08-07ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-06-13
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

这种CPU查询方式,查询速度较慢

Benefits of technology

[0017]The parallel processing module is further configured to read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; and to delete the query results of the first N memory pages of the target data block during the process of reading the query results of the target data block if the target data block is not the first data block among the multiple data blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667994B_ABST
    Figure CN117667994B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data processing system, method and parallel processing module. In the embodiments of the present application, data queries are offloaded to the parallel processing module for parallel query, which can improve the speed of data query compared with traditional CPU data query. When the host performs data partitioning on the data to be queried, the S times of the memory page is directly used as the partitioning boundary, and there is no need to find the element boundary, which can improve the data partitioning efficiency and further help to improve the subsequent data query speed. On the other hand, the host performs data partitioning on the data to be queried by using the S times of the memory page as the partitioning boundary, that is, the data is partitioned by using the memory page boundary, so that the partitioned data blocks are cache line aligned. When the parallel processing module performs data query on the data blocks, there is no need to perform cache line alignment operation, which can reduce the data block replication times and further help to improve the data query speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing system, method and parallel processing module. Background Technology

[0002] With the development of information technology and the explosive growth of data, databases are constantly being developed and utilized. As the core and foundation of information technology, databases carry a wealth of critical data. Based on their advantages, databases are widely used for data storage, management, maintenance, and retrieval.

[0003] A database is a computer software system that stores and manages data according to data structures, often needing to provide different dimensions of data to different users. Therefore, data querying is a fundamental function of a database. In some existing solutions, the central processing unit (CPU) of the device housing the query engine uses operators such as filters to filter data and achieve data querying. This CPU-based query method is relatively slow. Summary of the Invention

[0004] This application provides a data processing system, method, and parallel processing module to improve data query speed.

[0005] This application provides a data processing system, including: a host and a parallel processing module; the host and the parallel processing module are communicatively connected.

[0006] The host is used to store the data to be queried corresponding to the query request in the host's contiguous memory space; according to the target data volume supported by the parallel processing module, the data to be queried is divided into multiple data blocks; the data blocks with adjacent memory locations overlap by N memory pages; the data volume of the other data blocks in the multiple data blocks, except for the last data block, is S times the memory page size; the data volume of the data blocks is less than or equal to the target data volume; where N and S are positive integers, and S>N;

[0007] The parallel processing module reads the target data block from the plurality of data blocks into the contiguous memory space of the parallel processing module;

[0008] The parallel processing module is used to perform parallel queries on the target data block to obtain the query results of the target data block; read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; and delete the query results of the first N memory pages of the target data block during the process of reading the query results of the target data block if the target data block is not the first data block among the multiple data blocks.

[0009] This application also provides a data processing method, including:

[0010] The host stores the data to be queried corresponding to the query request in the host's contiguous memory space;

[0011] The host divides the data to be queried into multiple data blocks according to the target data volume supported by the parallel processing module; the data blocks with adjacent memory locations overlap by N memory pages; the data volume of the other data blocks, except for the last data block, is S times the memory page size; the data volume of each data block is less than or equal to the target data volume; where N and S are positive integers, and S>N;

[0012] The parallel processing module reads the target data block from the plurality of data blocks into the contiguous memory space of the parallel processing module;

[0013] The parallel processing module performs parallel queries on the target data block to obtain the query results of the target data block; the query results of the target data block are read from the parallel processing module into the result memory space pre-set for the target data block in the host; if the target data block is not the first data block among the multiple data blocks, the query results of the first N memory pages of the target data block are deleted during the reading of the query results of the target data block.

[0014] This application embodiment also provides a parallel processing module, including: memory and computing unit; the memory and the computing unit are electrically connected;

[0015] The parallel processing module is used to communicate with the host and to read target data blocks from multiple data blocks stored in the host's contiguous memory space into the contiguous memory space of the host. The multiple data blocks are obtained by the host from the data to be queried corresponding to the query request, based on the target data volume that the parallel processing module can process. Data blocks with adjacent memory locations in the multiple data blocks overlap by N memory pages. The data volume of the gas data blocks before the last data block in the multiple data blocks is S times the number of memory pages. The data volume of each data block is less than or equal to the target data volume. Where N and S are positive integers, and S > N.

[0016] The computing unit is used to perform parallel queries on the target data block to obtain the query results of the target data block;

[0017] The parallel processing module is further configured to read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; and to delete the query results of the first N memory pages of the target data block during the process of reading the query results of the target data block if the target data block is not the first data block among the multiple data blocks.

[0018] In this embodiment, data querying is offloaded to the parallel processing module for parallel querying, which improves data query speed compared to traditional CPU data querying. Offloading data querying to the parallel processing module reduces the CPU load on the device hosting the query engine, lowers CPU resource consumption, and helps reduce the probability of CPU performance bottlenecks. Furthermore, when the host partitions the data to be queried, it directly uses S times the memory page size as the partition boundary, eliminating the need to search for element boundaries, thus improving data partitioning efficiency and subsequently increasing data query speed. On the other hand, partitioning the data to be queried by using S times the memory page size as the partition boundary ensures that the partitioned data blocks are cache-line aligned. When the parallel processing module queries the data blocks, there is no need for cache line alignment operations, reducing the number of data block copies and further improving data query speed. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0020] Figure 1 This is a schematic diagram of the structure of the data processing system provided in the embodiments of this application;

[0021] Figure 2 A flowchart illustrating the data query process provided in this application embodiment;

[0022] Figure 3 This is a schematic diagram of data distribution provided for an embodiment of this application;

[0023] Figure 4 This is a schematic diagram illustrating the data block segmentation process provided in an embodiment of this application;

[0024] Figure 5 This is another data distribution diagram provided for an embodiment of this application;

[0025] Figure 6 A flowchart illustrating the data processing method provided in an embodiment of this application;

[0026] Figure 7This is a schematic diagram of the structure of the parallel processing module provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] In some traditional data querying schemes, the CPU of the device hosting the query engine uses filter operators to filter data and perform the query. This method of CPU-based data querying has two drawbacks: firstly, the software query speed is relatively slow; secondly, data querying consumes a significant amount of the device's CPU resources, which can easily create a CPU performance bottleneck.

[0029] To improve data query efficiency, heterogeneous resources are used to offload the database's data query function to heterogeneous resource devices. These devices then use filter operators to perform data filtering, thus achieving data query offloading. Heterogeneous resource devices refer to devices or components with computing resources other than the CPU, such as Field-Programmable Gate Arrays (FPGAs). This heterogeneous resource offloading method for data querying improves query speed and reduces the CPU load on the query engine device, thus lowering the probability of CPU performance bottlenecks.

[0030] Because the memory capacity of the computing device (i.e., the host) where the query engine resides differs from that of heterogeneous resource devices, which typically have smaller memory and larger memory, the traditional approach involves dividing the data to be queried in the host's memory into multiple data blocks, each no larger than the memory capacity of the heterogeneous resource device, according to the element boundaries of the database. These data blocks are then distributed to the heterogeneous resource device for data querying.

[0031] In this context, database elements refer to the attributes of data objects. For example, if a data object is a product, its elements could include the product's identifier, serial number, manufacturer, unit price, and production date, but are not limited to these. In big data scenarios, elements vary in length. Therefore, when the host performs data block partitioning, it needs to traverse the data to be queried and find element boundaries, resulting in low data partitioning efficiency and consequently affecting the speed of subsequent data queries.

[0032] On the other hand, element boundaries often lie at non-memory page boundaries, resulting in data blocks frequently being non-cacheline aligned. During memory copying, an entire cacheline is loaded at once from the cacheline-aligned address (typically 64 bytes), without finer-grained splitting. Therefore, when querying data blocks on heterogeneous resource devices, the data block must first be copied to a free buffer, cacheline aligned within the buffer, and then copied back to the memory of the heterogeneous resource device. These multiple data copies undoubtedly slow down data query speeds.

[0033] In some embodiments of this application, to improve data query speed, data querying is offloaded to a parallel processing module for parallel querying, which improves data query speed compared to traditional CPU data querying. Offloading data querying to the parallel processing module reduces the CPU load on the device hosting the query engine, lowers CPU resource consumption, and helps reduce the probability of CPU performance bottlenecks. Furthermore, when the host partitions the data to be queried, it directly uses S times the memory page size as the partition boundary, eliminating the need to search for element boundaries, thus improving data partitioning efficiency and consequently improving subsequent data query speed. On the other hand, using S times the memory page size as the partition boundary for data partitioning ensures that the partitioned data blocks are cache-line aligned. When the parallel processing module queries the data blocks, cache line alignment is not required, reducing the number of data block copies and further improving data query speed.

[0034] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0035] It should be noted that the same reference numerals denote the same object in the following figures and embodiments. Therefore, once an object is defined in one figure or embodiment, it does not need to be discussed further in subsequent figures and embodiments.

[0036] Figure 1 This is a schematic diagram of the data processing system provided in an embodiment of this application. (In conjunction with...) Figure 1 The data processing system includes a host computer 10 and a parallel processing module 20.

[0037] In this embodiment, host 10 refers to any computer device with computing, storage, and communication functions. For example, host 10 can be a server, computer, mobile phone, etc. In this embodiment, the host may include: general-purpose processing units, etc. In this embodiment, the number of general-purpose processing units is not limited. There can be at least one general-purpose processing unit, that is, one or more; each general-purpose processing unit can be a single-core processing unit or a multi-core processing unit.

[0038] In this embodiment, the general-purpose processing unit is typically a processing chip located on the motherboard of the host 10, such as the host's Central Processing Unit (CPU) 101, and cannot be expanded to a single machine. The general-purpose processing unit can be any processing device with computing capabilities. It can be a serial processing unit or a parallel processing unit. For example, it can be a general-purpose processor, such as a CPU. A parallel processing unit refers to a processing device capable of parallel computing. For example, it can be a Graphics Processing Unit (GPU) or a Field-Programmable Gate Array (FPGA). Optionally, the memory of the general-purpose processing unit is larger than the memory of the parallel processing unit. Figure 1 The illustration uses the CPU as the general-purpose processing unit only, but this is not intended to be limiting.

[0039] The aforementioned parallel processing module 20 refers to any device or component with parallel computing and storage capabilities. The parallel processing module 20 can be a GPU or a programmable hardware device, etc.

[0040] The programmable hardware device can be a hardware processor built from electronic components, or a hardware processor that uses a Hardware Description Language (HDL) for data processing. The HDL can be Very-High-Speed ​​Integrated Circuit Hardware Description Language (VHDL), Verilog HDL, System Verilog, or System C, etc. Correspondingly, the parallel processing module 20 can be an FPGA, a Programmable Array Logic (PAL), a General Array Logic (GAL), a Complex Programmable Logic Device (CPLD), etc. Alternatively, the parallel processing module 20 can also be an Application Specific Integrated Circuit (ASIC) or a Data Processing Unit (DPU). A DPU is a dedicated electronic circuit with hardware acceleration capabilities used for data-centric computing.

[0041] In this embodiment, the parallel processing module 20 is communicatively connected to the host 10; specifically, the parallel processing module 20 is communicatively connected to the CPU 101 of the host 10. Specifically, the parallel processing module 20 and the host 10 can communicate via a bus interface. This bus interface can be a serial bus interface, such as a Peripheral Component Interconnect Express (PCIe) bus interface, a Peripheral Component Interconnect (PCI) bus interface, an Ultra Path Interconnect (UPI) bus interface, a Universal Serial Bus (USB) serial interface, an RS485 interface, or an RS232 interface. Preferably, the bus interface is a PCIe interface, which can improve the data transfer rate between the parallel processing module 20 and the host 10.

[0042] The bus interface of host 10 can be expanded according to the specifications of host 10. Generally, host 10 has multiple communication interfaces. In the embodiments of this application, "multiple" means more than one, that is, two or more. When the parallel processing module 20 communicates with host 10 through the bus interface, there can be one or more parallel processing modules 20. The implementation of multiple parallel processing modules 20 can be the same, or partially or completely different. For example, in some embodiments, multiple parallel processing modules 20 can all be FPGAs, or all can be DPUs, ASICs, or GPUs, etc. In other embodiments, multiple parallel processing modules 20 can be partially FPGAs, partially DPUs, ASIC chips, or GPUs, etc., but are not limited to these.

[0043] In some embodiments, the parallel processing module 20 and the host 10 may be located on different physical machines, and the host 10 and the parallel processing module 20 may be connected via network communication. For example, the host 10 and the parallel processing module 20 may be located on different cloud servers and connected via network communication; and so on. Figure 1 The illustration shows only the host 10 and the parallel processing module 20 on the same physical machine, but this does not constitute a limitation.

[0044] In practical applications, databases typically separate computation and storage. Storage nodes store data, while compute nodes perform data queries and computational operations during the query process. Computational operations during data queries can include aggregation operations. To improve query speed, some databases also use cache nodes to store frequently queried data. Storage nodes generally use disks for data storage, while cache nodes typically use memory or solid-state drives (SSDs). Cache nodes generally have faster data read speeds than storage nodes. Cache nodes and compute nodes can be implemented on the same physical machine or on different physical machines.

[0045] In this embodiment, host 10 can be the physical machine where the computing node resides, the physical machine where the cache node resides, or the physical machine where the query engine of the data source resides. The data source is used to store data. The data source can be a database or a server hosting the database. The database can be an analytical database, a relational database, or other types of database. In this embodiment, host 10 is equipped with a query engine that can obtain query requests for the data source. The query request may include filtering conditions. Filtering conditions are used to limit the query scope and the conditions for the final filtered data. For a columnar storage format data source, the filtering conditions limit the query scope based on the column to be queried. In some embodiments, the data source stores data in a columnar storage file format such as Parquet.

[0046] In this embodiment, host 10 can obtain a query request and extract filtering conditions from the query request. Then, it can read the data to be queried from the data source according to the filtering conditions. In some embodiments, the data source stores data in a column-oriented storage file format. Host 10 can then read the column to be queried corresponding to the query request from the data source according to the filtering conditions, using it as the data to be queried. That is, host 10 reads the column to be queried defined by the filtering conditions from the data source as the data to be queried. Furthermore, host 10 can store the data to be queried in a contiguous memory space of host 102.

[0047] Because the memory storage format differs from the data source storage format, host 10 can also convert the data to be queried (i.e., the column to be queried) into a memory-supported column storage format. The memory-supported column storage format can be Arrow format. Arrow is a memory-supported column storage format. Accordingly, host 10 can store the column to be queried with a memory-supported column storage format (such as Arrow format) in a contiguous memory space of host 10's memory 102.

[0048] In this embodiment, to reduce the pressure on the CPU of the host 10 and decrease the probability of the CPU reaching its performance bottleneck, the host 10 can map the parallel processing module 20 as a virtual device of the host through virtualization technology; and through the mapped virtual device, the data processing function is offloaded to the parallel processing module 20. Due to its strong parallel computing capabilities, the parallel processing module 20 can improve the data processing speed.

[0049] In this embodiment, the parallel processing module 20 includes memory 201. Generally, the capacity of memory 201 in the parallel processing module 20 is smaller than the capacity of memory 102 in the host 10. To save memory resources, both memory 201 and memory 102 store data in contiguous memory space.

[0050] In this embodiment, the parallel processing module 20 further includes one or more computing units 202. "More than" means two or more. A computing unit (CU) 202 is a unit for measuring the computing power of the parallel processing module 20. A parallel processing module 20 may include each computing unit 202 as a parallel computing unit, providing parallel computing capabilities. The computing unit 202 may be a hardware processor built from electronic devices, or a computing unit encoded by a hardware description language. To improve the parallel computing capabilities of the parallel processing module 20, it generally includes multiple computing units 202. This application focuses on using the parallel processing module 20 including multiple computing units 202 as an example to exemplify the data processing method provided in this embodiment.

[0051] In this embodiment, the parallel processing module 20 can read a portion of the continuously stored data from the query data stored in the host 10 into the contiguous memory space of the parallel processing module 201. The amount of the read portion of continuously stored data is less than or equal to the memory capacity of the parallel processing module 20, and does not exceed the target data amount that the parallel processing module 20 can process. The target data amount that the parallel processing module 20 can process is used to characterize the data processing capability of the parallel processing module 20, and can be the maximum amount of data that the parallel processing module 20 can process, which does not exceed the memory capacity of the parallel processing module 20.

[0052] In this embodiment, the specific amount of data read by the parallel processing module 20 from the contiguous storage is not limited. In some embodiments, the parallel processing module 20 may, according to the target amount of data it can process, read the contiguously stored data in batches into the contiguous memory space of its memory 201 in ascending order of the offset address of the data to be queried in memory 102. The data read in each batch is the portion of the contiguously stored data corresponding to the current batch. The amount of contiguously stored data read in each batch is less than or equal to the target amount of data.

[0053] In some embodiments, combined with Figure 1 and Figure 2 The host 10 can divide the data to be queried into multiple data blocks according to the target data volume supported by the parallel processing module 20. "Multiple" refers to two or more data blocks. Preferably, the number of data blocks is an integer multiple of the number of parallel processing modules 20.

[0054] In this context, the data size of each data block (excluding the last data block) is S times the size of a memory page. S is a positive integer. Generally, S ≥ 2. In some embodiments, S ≥ 3. The memory offset addresses of the same data block are contiguous, and the last data block refers to the data block with the largest starting memory offset address among the multiple data blocks. The data size of the last data block is determined by the total amount of data to be queried, and may be an integer multiple or a non-integer multiple of the size of memory pages. Generally, the target data volume that the parallel processing module 20 supports processing is characterized by the maximum number of memory pages that the parallel processing module 20 can process. Accordingly, S can be determined by the data processing capability of the parallel processing module 20, i.e., by the target data volume that the parallel processing module 20 supports processing.

[0055] For example, suppose the target data volume that the parallel processing module 20 supports processing is represented by Split_len. Split_len equals S multiplied by the memory page size. If the memory page size is 4kB, then Split_len = S * 4kB. Each data block can be labeled with a sequence number n. n = 0, 1, 2, 3, ... Then the starting memory offset address for splitting each data block n is: Split_len * n * memory page size. Accordingly, the data to be queried can be split into multiple data blocks according to the starting memory offset address of the data block splitting.

[0056] In other embodiments, there are multiple parallel processing modules 20. To improve data query speed, multiple parallel processing modules 20 can be used to query the data to be queried in parallel. In this embodiment, the host 10 can divide the data to be queried into multiple data blocks according to the target data volume that the multiple parallel processing modules 20 can process. The data processing capabilities of the multiple parallel processing modules 20 can be the same or different. That is, the target data volume that the multiple parallel processing modules 20 can support can be the same or different. In embodiments where the target data volume that the multiple parallel processing modules 20 can support is different, the value of the memory page multiple S of the data volume of the other data blocks before the last data block in the multiple data blocks is different.

[0057] Considering the varying lengths of database elements, and the fact that some elements' data size is not an integer multiple of a memory page, some element boundaries may not be memory page boundaries, meaning that some elements' data is stored across memory pages. For example, ... Figure 3 As shown, assuming a memory page is 4kB and the data size of a certain element is 9kB, the data of this element is stored across 3 memory pages. If the partition boundary of the data block is boundary A, the data of this element will be incomplete in the header data of the next data block (such as the last 1kB of the 9kB element), which will cause data querying in the next data block to fail.

[0058] To solve this technical problem, combined with Figure 1 and Figure 2 In this embodiment of the application, for multiple data blocks, the data whose beginning and end overlap by N memory pages is considered to be adjacent in memory location. Here, N is a positive integer, and N < S. The adjacent data blocks are the data blocks with sequence numbers n and (n+1). The data whose beginning and end overlap by N memory pages means that the tail of the preceding data block (i.e., data block n) overlaps with the head of the following data block (i.e., data block n+1) by N memory pages.

[0059] The value of N is determined by the data size Q of the element to which the query data belongs. Specifically, N ≥ X. Here, X represents the integer part of the result, which is the data size Q of the element to which the query data belongs, divided by the memory page size and then rounded up. That is: Where Q represents the size of the element containing the data to be queried, which is generally determined by the database and is the maximum size of data the database specifies for an element. For example, if the size of the data for the price of a specified product does not exceed 7kB, then Q = 7kB. P represents the memory page size, such as P = 4kB. This indicates rounding up. For example, if Q = 7kB and P = 4kB, then X = 2. Accordingly, N ≥ 2. To reduce computational complexity, N is generally set to X, meaning that the first and last edges of two adjacent data blocks in multiple data blocks overlap by X memory pages.

[0060] Combination Figure 1 and Figure 2 After obtaining multiple data blocks, the parallel processing module 20 can read the target data block from the data to be queried stored on the host and store it in its contiguous memory space. The target data block read by the parallel processing module 20 is the portion of contiguously stored data that it reads.

[0061] In this embodiment, the specific implementation of the parallel processing module 20 reading the target data block from the data to be queried stored on the host is not limited. For multiple parallel processing modules 20, multiple data blocks can be read in parallel from the data to be queried stored on the host into their respective contiguous memory spaces. Each parallel processing module 20 can read one data block at a time.

[0062] In the embodiments of this application, such as Figure 1 As shown, the parallel processing module 20 can use Direct Memory Access (DMA) to read the target data block from the data to be queried stored in the host 10 and access the contiguous memory space of the parallel processing module 20.

[0063] Specifically, such as Figure 1As shown, a DMA driver 103 is deployed on the host 10 side; a DMA engine 203 is deployed on the parallel processing module 20. The DMA driver 103 refers to a software function module or plug-in used to drive the DMA engine 203. In this embodiment, after the host 10 divides the data to be queried into multiple data blocks, it can call the DMA driver 103 to drive the DMA engine 203. The DMA driver 103 can issue a data query instruction to the DMA engine 203, which can carry the starting memory offset address of the data block to be read by the DMA engine 203 and the length of the data block to be read. The data block to be read is the target data block corresponding to the parallel processing module 20. Further, the DMA engine 203 can respond to the data query instruction and, based on the starting memory address offset and the length of the data block to be read, read the data block to be read (i.e., the target data block) from the data to be queried stored on the host 10 using DMA to the contiguous memory space of the parallel processing module 20. The data block to be read is the target data block read by the parallel processing module 20.

[0064] Combination Figure 1 and Figure 2 Multiple parallel processing modules 20 can perform data queries on their respective read target data blocks in parallel to obtain query results for multiple data blocks. In this embodiment, the parallel processing modules 20 can perform parallel data queries on the read target data blocks asynchronously to obtain query results for those data blocks.

[0065] In one embodiment of the parallel processing module 20, in order to improve the data query speed, the parallel processing module 20 can perform data query on the target data block in an asynchronous manner. That is, the parallel processing module 20 does not need to wait for the data block to be queried to be completed before it can read the next data block.

[0066] In asynchronous data query scenarios or in embodiments where the parallel processing module 20 has multiple implementations, since the order in which multiple data blocks complete data queries cannot be determined, a result storage area can be pre-set in the memory of the host 10 for each data block. The result storage areas for adjacent data blocks are adjacent. The host 10 can allocate a result storage area for each data block before, after, or during the allocation of multiple data blocks to the parallel processing module 20. The size of the result storage area can be equal to the data volume of the data block. In this way, the host 10 cannot determine the order in which the query results returned by each parallel processing module 20 are received, and can store the query results of multiple data blocks in the pre-set result storage area corresponding to each data block.

[0067] Because two adjacent data blocks in multiple data blocks have their beginning and end overlapping by N memory pages, the query result for these N overlapping memory pages is invalid. Since the data block query process proceeds sequentially from smallest to largest memory offset address, the query result for the last N memory pages of the preceding data block is correct, while the query result for the first N memory pages of the following data block may be invalid because those N memory pages only store the latter half of the element's data.

[0068] Based on this, the parallel processing module 20 can read the query results of the target data block from the parallel processing module 20 to the memory space pre-set for the target data block by the host 10; specifically, the DMA engine in the parallel processing module 20 can use DMA to read the query results of the target data block from the parallel processing module 20 to the memory space pre-set for the target data block by the host 10.

[0069] Furthermore, combined with Figure 1 and Figure 2 In cases where the target data block is not the first data block among multiple data blocks, the parallel processing module 20 can delete the query results of the first N memory pages of the target data block during the reading of the query results, thereby obtaining the query results of the partially contiguous data (such as data block n) read by the parallel processing unit. This allows the use of the out-of-bounds data at the end of the previous data block to correct the matching failure caused by incomplete data at the beginning of the subsequent data block due to data segmentation.

[0070] For example, assuming a memory page size of 4kB, and the data size Q of the element to which the query data belongs is ≤4kB, then the beginning and end of adjacent data blocks overlap by one memory page, i.e., 4kB of overlapping data. Since the tail of data block n overlaps with the head of data block (n+1) by one memory page (i.e., 4kB) of data, the query result of the tail 4kB of data block n overlaps with the query result of the head 4kB of data block (n+1). Therefore, during the reading of the query result of data block (n+1), the head 4kB of query result of data block (n+1) can be deleted. This allows the matching failure caused by the incomplete data at the head of the subsequent data block due to data segmentation to be corrected by utilizing the out-of-bounds data at the end of the previous data block.

[0071] Accordingly, if the target data block is the first data block among multiple data blocks, the query result of the target data block can be directly read from the parallel processing module 20 into the memory space pre-set for the target data block in the host 10, thereby obtaining the query results of multiple data blocks, that is, the query result of the data to be queried.

[0072] In this embodiment, data query is offloaded to the parallel processing module for parallel query. Compared with traditional CPU data query, the data query speed can be improved. Since the data query is offloaded to the parallel processing module, the load of the CPU of the device where the query engine is located is reduced, the CPU resource consumption is reduced, and it helps to reduce the probability of the occurrence of the CPU performance bottleneck. In addition, when the host performs data segmentation on the data to be queried, it directly uses S times of the memory page as the segmentation boundary without searching for the element boundary, which can improve the data segmentation efficiency and thus help to improve the subsequent data query speed. On the other hand, the host uses S times of the memory page as the segmentation boundary to segment the data to be queried, that is, data segmentation is performed at the memory page boundary, so that the segmented data blocks are cache line-aligned. When the parallel processing module performs data query on the data blocks, no cache line alignment operation is required, which can reduce the number of data block copies and thus help to improve the data query speed.

[0073] In the above embodiment, the data query processes of the multiple parallel processing modules 20 are the same. Below, taking any one of the parallel processing modules 20 as an example, an exemplary description of the data query process inside the parallel processing module 20 will be given.

[0074] Combined with Figure 2 and Figure 4 , the parallel processing module 20 includes one or more computing units 202. The parallel processing module 20 can utilize the multiple computing units 202 to perform parallel query on the read target data block to improve the data query speed. Therefore, for the partially continuously stored data φ in the memory of the parallel processing module 20, the parallel processing module 20 can segment the partially continuously stored data φ into multiple data sub-blocks whose data volume is an integer multiple of the memory page. Among them, the data volume of other data sub-blocks except the last data sub-block among the multiple data sub-blocks is M times of the memory page. M is a positive integer, and N < M < S. Generally, M ≥ 2. The last data sub-block among the multiple data sub-blocks refers to the data sub-block with the largest memory offset address among the multiple data sub-blocks. The data volume of the last data sub-block among the multiple data sub-blocks is determined by the size of the partially continuously stored data φ read. Assuming that the data volume of the partially continuously stored data φ is Y and the memory page size is P, then the data volume of the last data sub-block is equal to (Y - M * P).

[0075] Considering that the elements in the database have different lengths, the data volume of some elements is not an integer multiple of the memory page, which will cause the boundaries of some elements to be non-memory page boundaries, that is, the data of some elements is stored across memory pages, resulting in the data of this element being incomplete at the head data of the next data block (such as Figure 3 the last 1 kB of the 9 kB element in Figure 3 ), and thus the data query in the next data block fails. For details, please refer to the above

[0076] To address this issue, in this embodiment, the beginning and end of two adjacent data sub-blocks in memory locations can be overlapped by N memory pages. The value of N can be found in the relevant content of the above embodiments, and will not be repeated here.

[0077] In some embodiments, the parallel processing module 20 may divide the read contiguously stored data (such as data block n) into multiple data sub-blocks whose data size is an integer multiple of the memory page, according to the data size Q of the element to which the data to be queried belongs and the number of multiple computing units K.

[0078] Specifically, the data size Z of a data sub-block can be determined based on the number K of multiple computing units and the data size Y of partially contiguously stored data φ (such as data block n). Where Z = Y / K. Further, as... Figure 4 As shown, based on the data size Z of the data sub-blocks, the target data block (e.g., data block n) can be divided into multiple initial data sub-blocks (e.g., ...). Figure 4 The initial data sub-block is 0-(k-1). The data size of the initial data sub-block is Z. The number of initial data sub-blocks is equal to the number of data sub-blocks, which in turn is equal to the number of computing units K.

[0079] Furthermore, the number N of overlapping memory pages between two adjacent data sub-blocks can be determined by rounding up the value X obtained by dividing the data size Q of the element to be queried by the memory page size P. This indicates rounding down. Generally, N = X.

[0080] Furthermore, such as Figure 4 As shown, for two adjacent initial data sub-blocks in memory locations, the data from the first N memory pages of the latter initial data sub-block can be added to the end of the former initial data sub-block to obtain multiple data sub-blocks. For example... Figure 4 The data sub-block 0-(K-1) is in the data. Figure 4 In the diagram, the slashed filled portion represents the N memory pages that overlap between two adjacent data sub-blocks. The beginning of the next initial data sub-block also contains the data from these N memory pages. Thus, the overlap between the beginning and end of two adjacent data sub-blocks is N memory pages. The data size of the data sub-blocks, excluding the last one, is: Z + N * P, where P represents the memory page size.

[0081] because X represents the data size Q of the element to be queried, divided by the memory page size P and rounded up. Therefore, even if elements are stored across memory pages, the preceding data block of two adjacent data blocks can retain all the data of that element. In subsequent data queries, this avoids the problem of matching failure due to incomplete data at the beginning of the following data block.

[0082] After dividing the data into multiple sub-blocks, the parallel processing module 20 can distribute these sub-blocks to multiple computing units 202 within the parallel processing module 20. The computing units 202 can then query the data sub-blocks in parallel to obtain query results for multiple data sub-blocks.

[0083] In this embodiment, the specific implementation of the querying of data sub-blocks by the computing unit 202 is not limited. In some embodiments, the computing unit 202 may use a string matching algorithm to perform character matching between the target data sub-block assigned to the computing unit and the filtering conditions corresponding to the query request; and use binary bit values ​​to mark the matching results of each character in the target data sub-block to obtain the query results of the target data sub-block. The binary bit value is 0 or 1. The binary bit value varies depending on the string matching algorithm.

[0084] In this application embodiment, the specific implementation form of the string matching algorithm is not limited. Optionally, the string matching algorithm may be a shift-and algorithm, a shift-or algorithm, the Sunday algorithm, or the Rabin-Karp algorithm, etc. Among them, the shift-and algorithm uses binary 1 to mark the matching result of each character in the target data sub-block; the shift-or algorithm uses binary 0 to mark the matching result of each character in the target data sub-block.

[0085] The following example uses the shift-and algorithm to illustrate the data query process for the target data sub-block. The general idea of ​​the shift-and algorithm is to preprocess the pattern string (i.e., the string corresponding to the filtering condition) into a special encoding form, and then match the text string (target data sub-block) bit by bit according to this encoding form.

[0086] First, the strings corresponding to the filtering conditions are preprocessed using binary encoding. Based on the position of a character in the string corresponding to the filtering condition, the character is encoded as a binary number with the same number of bits as the string. The bit position of the character is 1, and other bits are 0. For example, if the string corresponding to the filtering condition is "abac", and 'a' appears in the 0th and 2nd positions, then the encoding information for 'a' is 0101 in binary. Similarly, if 'b' appears in the 1st position, then the encoding information for 'b' is 0010; and if 'c' appears in the 3rd position, then the encoding information for 'c' is 1000.

[0087] Furthermore, for each character in the target data sub-block, a corresponding status code number D is defined. A value of 1 in the i-th bit of D indicates that when this character is the last character, the target data sub-block completely matches characters 0 through i of the string corresponding to the filtering condition. For example, if the string corresponding to the filtering condition is "acbace", and the target data sub-block is the second "a" character in "...acbaef..", when this "a" character is the last character, it may completely match the 0th character of the string corresponding to the filtering condition, or it may completely match the first 4 characters (i.e., characters 0 through 3) of the string corresponding to the filtering condition. Therefore, the status code D for the second "a" character in "...acbaef.." is 2. 0 +2 3 =9.

[0088] The initial state D = 0. Assume the previous state code D has already been determined; for example, in the example above, D = 2. 0 +2 3 =9. For a new target data sub-block, if the first 1 or 4 characters of the filter string are known to be completely matched, then check if the first or 4th character of the target data sub-block `text[i]` and the filter string are completely matched. The new status code should be equal to `(D<<1)&(code[text[i]])`. Here, `D<<1` means shifting the original status code left by one position; `code[text[i]` represents the binary code corresponding to the i-th character of the target string. `&` indicates a bitwise AND operation. In the example above, `i=1` or `i=4`. If the check is to see if the first character of the target data sub-block matches the filter string, then `i=1`; if the check is to see if the fourth character of the target data sub-block matches the filter string, then `i=4`.

[0089] Another scenario is if code[text[i]] is exactly 1, meaning text[i] is the 0th character of the string corresponding to the filter condition. In this case, the 0th bit of the new D's binary representation should also be 1. Combining these two scenarios, the new status code D = ((D<<1)|1)&(code[text[i]]). Here, "|" represents bitwise OR. If a match is found and the j-th bit of the status code D's binary representation is 1 (j is the length of the string corresponding to the filter condition), then the filter condition is completely matched, i.e., the match is successful.

[0090] The above example uses Shift-and to illustrate the character matching process of the target data sub-block and the corresponding filtering conditions of the query request, but it does not constitute a limitation. The Shift-or algorithm is based on the same principle as the Shift-and algorithm, but replaces the core AND operation in Shift-and with an OR operation, saving the additional OR operation "D<<1|1". That is, in the Shift-or algorithm, the new status code D = D<<1|(code[text[i]]). Compared to the Shift-and algorithm, it reduces one bitwise operation (i.e., the OR operation). The Shift-or algorithm uses binary 0 to represent character matching.

[0091] In this embodiment, which uses a string matching algorithm to perform character matching between the target data sub-block and the corresponding filter conditions of the query request, the query result of the target data sub-block is a binary string. The length of the binary string is equal to that of the target data sub-block. For the shift-and algorithm, if the i-th bit of the query result of the target data sub-block is 1, it means that the first i bits of the target data sub-block match the filter conditions. For the shift-or algorithm, if the i-th bit of the query result of the target data sub-block is 0, it means that the first i bits of the target data sub-block match the filter conditions.

[0092] The above description only illustrates the query process of the parallel processing module 20 on the target data sub-blocks assigned to it. Multiple parallel processing modules 20 query multiple data sub-blocks in parallel, obtaining query results corresponding to each of the multiple data sub-blocks.

[0093] Since the order in which the multiple computing units 202 in the parallel processing module 20 complete the query of data sub-blocks cannot be determined, in this embodiment, a result storage area can be pre-set for each data sub-block in the parallel processing module 20. The result storage areas of adjacent data sub-blocks are adjacent. The parallel processing module 20 can allocate a result storage area for each data sub-block before, after, or during the allocation of multiple data sub-blocks to multiple computing units 202. The size of the result storage area can be equal to the data volume of the data sub-block. In this way, the parallel processing module 20 cannot determine the order in which the query results returned by each parallel processing module 20 are processed, and can store the query results of multiple data sub-blocks in the pre-set result storage area corresponding to each data sub-block.

[0094] Since the first and last N memory pages of two adjacent data sub-blocks overlap, the query result for these two adjacent data sub-blocks also overlaps. Because the query process for data sub-blocks proceeds sequentially from smallest to largest memory offset address, the query result for the last N memory pages of the preceding data sub-block is correct, while the query result for the first N memory pages of the following data sub-block may be invalid because those N memory pages only store the latter half of the element's data. Therefore, during the storage of the query results for data sub-blocks, for two adjacent data sub-blocks, the query result of the last N memory pages of the preceding data sub-block can be used to overwrite the query result of the first N memory pages of the following data sub-block, thus obtaining the query result for the target data block (e.g., data block n) read by the parallel processing unit. In this way, the out-of-bounds data at the end of the previous data sub-block can be used to correct the matching failure caused by the incomplete data at the beginning of the subsequent data sub-block due to data segmentation.

[0095] For example, such as Figure 5 As shown, assuming a memory page size of 4kB and the data size Q of the element to be queried is ≤ 4kB, then adjacent data sub-blocks overlap by one memory page, i.e., 4kB of overlapping data. The starting memory address of the nth data sub-block is n*4k*R. Here, R = the data size of the data sub-block divided by the memory page size (e.g., 4kB), so the data size of the data sub-block is 4k*(R+1). Therefore, the query result of data sub-block n can be stored in the pre-allocated nth result storage area.

[0096] Since the tail of data sub-block n overlaps with the head of data sub-block (n+1) by one memory page (i.e., 4kB) of data, the query result at the offset address of data sub-block n (4k*(R+1)) overlaps with the query result at the starting offset address of data sub-block (n+1) (4k). Therefore, during the storage of query results for multiple data sub-blocks, the query result of the 4kB data at the head of data sub-block n can be used to overwrite the query result of the 4kB data at the head of data sub-block (n+1), thereby obtaining the query result of the target data block (such as data block n mentioned above). This achieves the goal of using the data overflow at the end of the previous data sub-block to correct the matching failure caused by the incomplete data at the head of the subsequent data sub-block due to data segmentation.

[0097] Furthermore, the parallel processing module 20 can provide the query results of the target data block read above to the host 10. Specifically, the parallel processing module 20 can utilize a DMA engine to read the query results of the target data block into a pre-defined memory area for the target data block in the host 10 using DMA. For cases where the target data block is not the first data block among multiple data blocks, the parallel processing module 20 can delete the query results of the first N memory pages of the target data block during the reading process, thereby obtaining the query results of the partially contiguous data (such as data block n) read by the parallel processing unit. In this way, the out-of-bounds data at the end of the previous data block can be used to correct the matching failure caused by incomplete data at the beginning of the subsequent data block due to data segmentation.

[0098] Accordingly, if the target data block is the first data block among multiple data blocks, the query result of the target data block can be directly read from the parallel processing module 20 into the memory space pre-set for the target data block in the host 10, thereby obtaining the query results of multiple data blocks, that is, the query result of the data to be queried.

[0099] In an embodiment where a string matching algorithm is used to query a target data block, the query result for the data to be queried is the matching result of each character in the data to be queried (marked with bit values) with the filtering conditions corresponding to the query request. After obtaining the query result for the data to be queried, the host 10 can further filter out target data that meets the filtering conditions included in the query request from the data to be queried based on the matching result of each character in the data to be queried (marked with bit values) with the filtering conditions corresponding to the query request; and provide the target data to the device that issued the query result, etc.

[0100] In this embodiment, the parallel processing module makes reasonable use of the data overflow at the end to correct the matching failure caused by the incomplete data at the beginning of the data sub-block during the operation of the computing unit due to the violent splitting (splitting directly with the integer multiple of the memory page as the boundary). While ensuring the continuity of the query results of the data block without data copying, it enables the upper-layer software to start parallel operation without being noticed.

[0101] In addition to the data processing system described above, this application also provides a data processing method. The data processing method provided in this application is illustrated below.

[0102] Figure 6 This is a flowchart illustrating the data processing method provided in an embodiment of this application. Figure 6 As shown, the method mainly includes:

[0103] 601. The host stores the data to be queried corresponding to the query request in the host's contiguous memory space.

[0104] 602. The host divides the data to be queried into multiple data blocks according to the target data volume supported by the parallel processing module; the data blocks with adjacent memory locations overlap by N memory pages; the data volume of the other data blocks, except for the last data block, is S times the memory page size; the data volume of the data blocks is less than or equal to the target data volume; where M and S are positive integers, and S>N.

[0105] 603. The parallel processing module reads the target data block from multiple data blocks into the contiguous memory space of the parallel processing module.

[0106] 604. The parallel processing module performs parallel queries on the target data block to obtain the query results for the target data block.

[0107] 605. The parallel processing module reads the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host.

[0108] 606. For cases where the target data block is not the first data block among multiple data blocks, the parallel processing module deletes the query results of the first N memory pages of the target data block during the query result reading process.

[0109] In this embodiment, the implementation details of the parallel processing module and the host can be found in the relevant content of the above system embodiment, and will not be repeated here.

[0110] In this embodiment, the host is equipped with a query engine that can obtain query requests for the data source. The query request may include filtering conditions. Filtering conditions are used to limit the query scope and the conditions for selecting the final data. For column-oriented data sources, the filtering conditions limit the query scope based on the columns to be queried.

[0111] In this embodiment, the host can obtain a query request and extract filtering conditions from the query request. Then, it can read the data to be queried from the data source according to the filtering conditions. In some embodiments, the data source stores data in a column-oriented file format. The host can then read the column to be queried corresponding to the query request from the data source according to the filtering conditions, as the data to be queried. That is, the host reads the column to be queried specified by the filtering conditions from the data source as the data to be queried. Furthermore, the host can store the data to be queried in a contiguous memory space of its own memory.

[0112] Because the memory storage format differs from the data source storage format, the host can also convert the data to be queried (i.e., the column to be queried) into a memory-supported column storage format. One such memory-supported column storage format is Arrow format. Arrow is one such memory-supported column storage format. Accordingly, the host can store the column to be queried with a memory-supported column storage format (such as Arrow format) in a contiguous memory space within the host's memory.

[0113] In this embodiment, to reduce the pressure on the host's CPU and decrease the probability of the CPU reaching its performance bottleneck, the host can use virtualization technology to map the parallel processing module as a virtual device on the host. Through this mapped virtual device, data processing functions are offloaded to the parallel processing module. Due to its strong parallel computing capabilities, the parallel processing module can improve data processing speed.

[0114] In this embodiment, the parallel processing module includes: memory. Generally, the memory capacity of the parallel processing module is smaller than the memory capacity of the host 10. To conserve memory resources, both the memory and the main memory store data in contiguous memory space.

[0115] In this embodiment, the parallel processing module further includes one or more computing units. "More than" refers to two or more. In this embodiment, the parallel processing module can read a portion of contiguously stored data from the data to be queried stored on the host computer into a contiguous memory space of the parallel processing module's memory. The amount of the read portion of contiguously stored data is less than or equal to the memory capacity of the parallel processing module, and does not exceed the target data amount that the parallel processing module can process. The target data amount that the parallel processing module can process refers to the data processing capability of the parallel processing module, which can be the maximum amount of data that the parallel processing module can process, and this maximum data amount does not exceed the memory capacity of the parallel processing module.

[0116] In this embodiment, the specific amount of data read by the parallel processing module from the contiguous storage is not limited. In some embodiments, the parallel processing module may, according to the target amount of data it can process, read the contiguously stored data in batches into the contiguous memory space of the parallel processing module's memory, in ascending order of the offset address of the data to be queried in memory. The data read in each batch is the contiguously stored data corresponding to the current batch.

[0117] In some embodiments, the host may divide the data to be queried into multiple data blocks according to the target data volume that the parallel processing modules can process. Multiple means two or more. Preferably, the number of data blocks is an integer multiple of the number of parallel processing modules.

[0118] In this system, the data size of all data blocks except the last one is S times the size of a memory page. S is a positive integer. Preferably, S ≥ 3. The memory offset addresses of the same data block are contiguous, and the last data block refers to the data block with the largest starting memory offset address. The data size of the last data block is determined by the total amount of data to be queried, and may be an integer multiple or a non-integer multiple of the size of a memory page. Generally, the target data size that the parallel processing module can process is characterized by the maximum number of memory pages that the parallel processing module can process. Accordingly, S can be determined by the target data size that the parallel processing module can process.

[0119] In other embodiments, there are multiple parallel processing modules. To improve data query speed, multiple parallel processing modules can be used to query the data to be queried in parallel. In this embodiment, the host can divide the data to be queried into multiple data blocks according to the target data volume that each of the multiple parallel processing modules can process. The target data volume that the multiple parallel processing modules can process varies. In embodiments where the target data volume that the multiple parallel processing modules can process differs, the value of the memory page multiple S for the data volume of the other data blocks before the last data block in the multiple data blocks is different.

[0120] Considering the varying lengths of database elements, and the fact that some elements' data size is not an integer multiple of a memory page, some element boundaries may be non-memory page boundaries. This means some elements' data is stored across memory pages, causing the header data of the next data block after the partition boundary (e.g., ...) to be... Figure 3 In the 9kB element, the last 1kB is incomplete, which causes the data query in the next data block to fail.

[0121] To address this technical problem, in this embodiment of the application, adjacent data blocks in multiple data blocks have their beginning and end overlapping by N memory pages. Here, N is a positive integer, and N < S. Adjacent data blocks are those with sequence numbers n and (n+1). The overlap of N memory pages between adjacent data blocks means that the tail of the preceding data block (i.e., data block n) overlaps with the head of the following data block (i.e., data block n+1) by N memory pages.

[0122] The value of N is determined by the data size Q of the element to which the query data belongs. Specifically, N ≥ X. Here, X represents the integer part of the result, which is the data size Q of the element to which the query data belongs, divided by the memory page size and then rounded up. That is: Where Q represents the amount of data in the element to which the data to be queried belongs. It is generally determined by the database and is the maximum amount of data that the database specifies for an element.

[0123] After obtaining multiple data blocks, the parallel processing module can read the target data block from the data to be queried stored on the host computer into its contiguous memory space. The target data block read by the parallel processing module is the portion of contiguously stored data that it reads.

[0124] In this embodiment, the specific implementation of the parallel processing module reading the target data block from the data to be queried stored on the host is not limited. For multiple parallel processing modules, multiple data blocks can be read from the data to be queried stored on the host in parallel into their respective contiguous memory spaces. Each parallel processing module can read one data block at a time.

[0125] In this embodiment, the parallel processing module can use DMA to read the target data block from the data to be queried stored on the host and access the contiguous memory space of the parallel processing module.

[0126] Specifically, a DMA driver is deployed on the host 10 side; a DMA engine is deployed on the parallel processing module. After the host divides the data to be queried into multiple data blocks, it can use the DMA driver to send a data query command to the DMA engine. This data query command can carry the starting memory offset address of the data block to be read by the DMA engine and the length of the data block to be read. The data block to be read is the target data block corresponding to the parallel processing module. Further, the parallel processing module can use the DMA engine to respond to the data query command and, based on the starting memory address offset and the length of the data block to be read, read the data block to be read (i.e., the target data block) from the data to be queried stored on the host using DMA to the contiguous memory space of the parallel processing module. The data block to be read is the target data block read by the aforementioned parallel processing module 20.

[0127] Multiple parallel processing modules can perform data queries on their respective read target data blocks in parallel to obtain query results for multiple data blocks. In this embodiment, the parallel processing modules can perform parallel data queries on the read target data blocks asynchronously to obtain query results for those data blocks.

[0128] In one embodiment of the parallel processing module, in order to improve the data query speed, the parallel processing module can use an asynchronous method to query the target data block. That is, the parallel processing module does not need to wait for the data block to be queried to be completed before it can read the next data block.

[0129] In asynchronous data query scenarios or embodiments with multiple parallel processing modules, since the order in which multiple data blocks complete data queries cannot be determined, a result storage area can be pre-set in the host's memory for each data block. The result storage areas for adjacent data blocks are adjacent. The host can allocate a result storage area for each data block before, after, or during the allocation of multiple data blocks to the parallel processing modules. The size of the result storage area can be equal to the data volume of the data block. In this way, the host cannot determine the order in which the query results returned by each parallel processing module are received, and can store the query results of multiple data blocks in the pre-set result storage area corresponding to each data block.

[0130] Because two adjacent data blocks in multiple data blocks have their beginning and end overlapping by N memory pages, the query result for these N overlapping memory pages is invalid. Since the data block query process proceeds sequentially from smallest to largest memory offset address, the query result for the last N memory pages of the preceding data block is correct, while the query result for the first N memory pages of the following data block may be invalid because those N memory pages only store the latter half of the element's data.

[0131] Based on this, the parallel processing module can read the query results of the target data block from the parallel processing module to the memory space that the host has pre-set for the target data block; specifically, the DMA engine in the parallel processing module can use DMA to read the query results of the target data block from the parallel processing module to the memory space that the host has pre-set for the target data block.

[0132] Furthermore, for cases where the target data block is not the first data block among multiple data blocks, the parallel processing module can delete the query results of the first N memory pages of the target data block during the reading of the query results, thereby obtaining the query results of the partially contiguous data (such as data block n) read by the aforementioned parallel processing unit. In this way, the out-of-bounds data at the end of the previous data block can be used to correct the matching failure caused by incomplete data at the beginning of the subsequent data block due to data segmentation.

[0133] Correspondingly, if the target data block is the first data block among multiple data blocks, the query results of the target data block can be directly read from the parallel processing module into the memory space pre-set for the target data block in the host, thereby obtaining the query results of multiple data blocks, that is, the query results of the data to be queried.

[0134] In this embodiment, data query is offloaded to the parallel processing module for parallel query. Compared with traditional CPU data query, the data query speed can be improved. Since the data query is offloaded to the parallel processing module, the load of the CPU of the device where the query engine is located is reduced, the CPU resource consumption is reduced, and it helps to reduce the probability of the occurrence of the CPU performance bottleneck. In addition, when the host performs data segmentation on the data to be queried, it directly uses S times of the memory page as the segmentation boundary without searching for the element boundary, which can improve the data segmentation efficiency and thus help to improve the subsequent data query speed. On the other hand, when the host segments the data to be queried with S times of the memory page as the segmentation boundary, that is, segments the data with the memory page boundary, the segmented data blocks are cache line-aligned. When the parallel processing module performs data query on the data blocks, no cache line alignment operation is required, which can reduce the number of data block copies and thus help to improve the data query speed.

[0135] In the above embodiment, the data query processes of multiple parallel processing modules are the same. Below, taking any parallel processing module 0 as an example, an exemplary description of the data query process inside the parallel processing module will be given.

[0136] The parallel processing module includes one or more computing units. The parallel processing module 20 can utilize multiple computing units to perform parallel query on the read target data block to improve the data query speed. Therefore, for the partially continuously stored data φ in the memory of the parallel processing module, the parallel processing module can segment the partially continuously stored data φ into multiple data sub-blocks with the data volume being an integer multiple of the memory page. Among them, the data volume of other data sub-blocks except the last data sub-block among the multiple data sub-blocks is M times of the memory page. M is a positive integer, and N < M < S. Generally, M ≥ 2. The last data sub-block among the multiple data sub-blocks refers to the data sub-block with the largest memory offset address among the multiple data sub-blocks. The data volume of the last data sub-block among the multiple data sub-blocks is determined by the size of the partially continuously stored data φ read. Assuming that the data volume of the partially continuously stored data φ is Y and the memory page size is P, then the data volume of the last data sub-block is equal to (Y - M * P).

[0137] Considering that the elements in the database have different lengths, the data volume of some elements is not an integer multiple of the memory page, which will cause the boundaries of some elements to be non-memory page boundaries, that is, the data of some elements is stored across memory pages, resulting in the first data (such as Figure 3 the last 1 kB of the 9 kB element in Figure 3 .

[0138] To address this issue, in this embodiment, the beginning and end of two adjacent data sub-blocks in memory locations can be overlapped by N memory pages. The value of N can be found in the relevant content of the above embodiments, and will not be repeated here.

[0139] In some embodiments, the parallel processing module 20 may divide the read contiguously stored data (such as data block n) into multiple data sub-blocks whose data size is an integer multiple of the memory page, according to the data size Q of the element to which the data to be queried belongs and the number of multiple computing units K.

[0140] Specifically, the data size Z of a data sub-block can be determined based on the number K of multiple computing units and the data size Y of partially contiguously stored data φ (such as data block n). Where Z = Y / K. Further, as... Figure 4 As shown, based on the data size Z of the data sub-blocks, the target data block (e.g., data block n) can be divided into multiple initial data sub-blocks (e.g., ...). Figure 4 The initial data sub-block is 0-(k-1). The data size of the initial data sub-block is Z. The number of initial data sub-blocks is equal to the number of data sub-blocks, which in turn is equal to the number of computing units K.

[0141] Furthermore, the number N of overlapping memory pages between two adjacent data sub-blocks can be determined by rounding up the value X obtained by dividing the data size Q of the element to be queried by the memory page size P. This indicates rounding down. Generally, N = X.

[0142] Furthermore, for two initial data sub-blocks that are adjacent in memory location, the data of the first N memory pages of the latter initial data sub-block can be added to the end of the former initial data sub-block to obtain multiple data sub-blocks.

[0143] because X represents the data size Q of the element to be queried, divided by the memory page size P and rounded up. Therefore, even if elements are stored across memory pages, the preceding data block of two adjacent data blocks can retain all the data of that element. In subsequent data queries, this avoids the problem of matching failure due to incomplete data at the beginning of the following data block.

[0144] After dividing the data into multiple sub-blocks, the parallel processing module can distribute the multiple data sub-blocks to multiple computing units in the parallel processing module, and use the multiple computing units to perform parallel queries on the multiple data sub-blocks to obtain the query results of the multiple data sub-blocks.

[0145] In this application embodiment, the specific implementation method of the computing unit querying the data sub-block is not limited. In some embodiments, the computing unit may use a string matching algorithm to perform character matching between the target data sub-block allocated by the computing unit and the filtering conditions corresponding to the query request; and use binary bit values ​​to mark the matching results of each character in the target data sub-block to obtain the query result of the target data sub-block. The binary bit value is 0 or 1. The binary bit value is different depending on the string matching algorithm.

[0146] In this application embodiment, the specific implementation form of the string matching algorithm is not limited. Optionally, the string matching algorithm may be a shift-and algorithm, a shift-or algorithm, the Sunday algorithm, or the Rabin-Karp algorithm, etc. Among them, the shift-and algorithm uses binary 1 to mark the matching result of each character in the target data sub-block; the shift-or algorithm uses binary 0 to mark the matching result of each character in the target data sub-block.

[0147] Since the order in which multiple computing units in the parallel processing module complete the query of data sub-blocks cannot be determined, in this embodiment, a result storage area can be pre-set for each data sub-block in the parallel processing module. The result storage areas of adjacent data sub-blocks are adjacent. The parallel processing module can allocate a result storage area for each data sub-block before, after, or during the allocation of multiple data sub-blocks to multiple computing units. The size of the result storage area can be equal to the data volume of the data sub-block. In this way, the parallel processing module cannot determine the order in which the query results returned by each parallel processing module are processed, and can store the query results of multiple data sub-blocks in the pre-set result storage area corresponding to each data sub-block.

[0148] Since the first and last N memory pages of two adjacent data sub-blocks overlap, the query result for these two adjacent data sub-blocks also overlaps. Because the query process for data sub-blocks proceeds sequentially from smallest to largest memory offset address, the query result for the last N memory pages of the preceding data sub-block is correct, while the query result for the first N memory pages of the following data sub-block may be invalid because those N memory pages only store the latter half of the element's data. Therefore, during the storage of the query results for data sub-blocks, for two adjacent data sub-blocks, the query result of the last N memory pages of the preceding data sub-block can be used to overwrite the query result of the first N memory pages of the following data sub-block, thus obtaining the query result for the target data block (e.g., data block n) read by the parallel processing unit. In this way, the out-of-bounds data at the end of the previous data sub-block can be used to correct the matching failure caused by the incomplete data at the beginning of the subsequent data sub-block due to data segmentation.

[0149] Furthermore, the parallel processing module can provide the query results of the target data block read above to the host. Specifically, the parallel processing module can utilize a DMA engine to read the query results of the target data block into a pre-defined memory area for the target data block in the host 10 using DMA. For cases where the target data block is not the first data block among multiple data blocks, the parallel processing module can delete the query results of the first N memory pages of the target data block during the reading process, thereby obtaining the query results of the partially contiguous data (such as data block n) read by the parallel processing unit. In this way, the out-of-bounds data at the end of the previous data block can be used to correct the matching failure caused by incomplete data at the beginning of the subsequent data block due to data segmentation.

[0150] Correspondingly, if the target data block is the first data block among multiple data blocks, the query results of the target data block can be directly read from the parallel processing module into the memory space pre-set for the target data block in the host, thereby obtaining the query results of multiple data blocks, that is, the query results of the data to be queried.

[0151] In an embodiment that uses a string matching algorithm to query a target data block, the query result for the data to be queried is the matching result of each character in the data to be queried (marked with bit values) with the filtering conditions corresponding to the query request. After obtaining the query result for the data to be queried, the host can further filter out target data that meets the filtering conditions included in the query request from the data to be queried based on the matching result of each character in the data to be queried (marked with bit values) with the filtering conditions corresponding to the query request; and provide the target data to the device that issued the query result, etc.

[0152] In this embodiment, the parallel processing module makes reasonable use of the data overflow at the end to correct the matching failure caused by the incomplete data at the beginning of the data sub-block during the operation of the computing unit due to the violent splitting (splitting directly with the integer multiple of the memory page as the boundary). While ensuring the continuity of the query results of the data block without data copying, it enables the upper-layer software to start parallel operation without being noticed.

[0153] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 601 and 602 can be device A; or the execution subject of step 601 can be device A, and the execution subject of step 602 can be device B; and so on.

[0154] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 601, 602, etc., are merely used to distinguish different operations and do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.

[0155] Figure 7 This is a schematic diagram of the structure of the parallel processing module provided in an embodiment of this application. Figure 7 As shown, the parallel processing module includes a memory 701 and a computing unit 702. The memory 701 and the computing unit 702 are electrically connected.

[0156] The parallel processing module is used to communicate with the host and read the target data block from multiple data blocks stored in the host's contiguous memory space into the contiguous memory space of memory 701. The multiple data blocks are obtained by the host from the data to be queried corresponding to the query request according to the target data volume supported by the parallel processing module. The data blocks with adjacent memory locations in the multiple data blocks overlap by N memory pages. The data volume of the gas data blocks before the last data block in the multiple data blocks is S times the memory page. The data volume of the data blocks is less than or equal to the target data volume. Where N and S are positive integers, and S>N.

[0157] The computing unit 702 is used to perform parallel queries on the target data block to obtain the query results of the target data block. The parallel processing module is also used to read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; if the target data block is not the first data block among multiple data blocks, the query results of the first N memory pages of the target data block are deleted during the reading of the query results of the target data block.

[0158] In some embodiments, such as Figure 7 As shown, the parallel processing module also includes a DMA engine 703. The DMA engine 703 is used to obtain data query instructions issued by the host; obtain the starting memory offset address and length of the target data block from the data query instructions; and read the target data block into the contiguous memory space of any parallel processing module using DMA based on the starting memory offset address and length of the target data block.

[0159] The parallel processing module also includes a memory controller 704. The memory controller 704 is used to divide the target data block into multiple data sub-blocks, each with a data size that is an integer multiple of the size of a memory page; two adjacent data sub-blocks overlap by N memory pages; wherein, except for the last data sub-block, the data size of the other data sub-blocks is M times the size of a memory page; M and N are positive integers, and N... <M<S;S≥3。

[0160] In some embodiments, there are multiple computing units 702. The multiple computing units 702 perform parallel queries on multiple data sub-blocks to obtain query results for the multiple data sub-blocks. A memory controller 704 is configured to store the query results of the multiple data sub-blocks into a result storage area pre-set for the multiple data sub-blocks in the parallel processing module; and, during the storage process, to use the query results of the last N memory pages of the preceding data sub-block in two adjacent data sub-blocks to overwrite the query results of the first N memory pages of the following data sub-block, thereby obtaining the query result for the target data block.

[0161] When dividing a target data block into multiple data sub-blocks whose data size is an integer multiple of the memory page, the memory controller 704 is specifically used to: divide the target data block into multiple data sub-blocks whose data size is an integer multiple of the memory page based on the data size of the element to which the data to be queried belongs and the number of multiple computing units.

[0162] When the memory controller 704 divides the target data block into multiple data sub-blocks whose data size is an integer multiple of the memory page size, based on the data size of the element to which the queried data belongs and the number of multiple computing units, it specifically performs the following: determining the data size of the data sub-blocks based on the number of multiple computing units and the data size of the target data block; dividing the target data block into multiple initial data sub-blocks based on the data size of the data sub-blocks; ensuring that the number of initial data sub-blocks is equal to the number of data sub-blocks; determining the number of memory pages N overlapping between two adjacent data sub-blocks based on the value X obtained by dividing the data size Q of the element to which the queried data belongs by the memory page size and rounding it up; where N ≥ X; and for two adjacent initial data sub-blocks, adding the data of the first N memory pages of the latter initial data sub-block to the end of the former initial data sub-block to obtain multiple data sub-blocks.

[0163] For any computing unit 702 among multiple computing units, a string matching algorithm is used to perform character matching on the target data sub-block assigned to any computing unit and the filtering conditions corresponding to the query request; and the matching results of each character in the target data sub-block are marked with binary bit values ​​to obtain the query results of the target data sub-block.

[0164] Optionally, the string matching algorithm is either a bitwise OR algorithm or a bitwise AND algorithm.

[0165] The parallel processing module provided in this embodiment, when connected to the host, offloads data queries to the parallel processing module for parallel querying, which improves data query speed compared to traditional CPU data querying. Offloading data queries to the parallel processing module reduces the CPU load on the device hosting the query engine, lowers CPU resource consumption, and helps reduce the probability of CPU performance bottlenecks. Furthermore, when the host partitions the data to be queried, it directly uses S times the memory page size as the partition boundary, eliminating the need to search for element boundaries, thus improving data partitioning efficiency and subsequently increasing data query speed. On the other hand, the host partitions the data to be queried using S times the memory page size as the partition boundary, meaning data partitioning is based on memory page boundaries. This ensures that the partitioned data blocks are cache-line aligned. When the parallel processing module queries the data blocks, there is no need for cache-line alignment operations, reducing the number of data block copies and further improving data query speed.

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

[0167] It should also be noted that the terms "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.

[0168] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.

[0169] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (or systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0170] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0171] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0172] In a typical configuration, a computing device includes one or more processors (such as a CPU), input / output interfaces, network interfaces, and memory.

[0173] Memory may include non-persistent storage in computer-readable media, such as random-access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0174] Computer storage media are readable storage media, also known as removable media. Removable and non-removable media can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include transient computer-readable media, such as modulated data signals and carrier waves.

[0175] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the aforementioned element.

[0176] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A data processing system, characterized in that, include: Host and parallel processing module; The host computer is communicatively connected to the parallel processing module; The host is used to store the data to be queried corresponding to the query request into the host's contiguous memory space; Based on the target data volume that the parallel processing module can process, the data to be queried is divided into multiple data blocks; the data blocks that are adjacent in memory location overlap by N memory pages; the data volume of the other data blocks, except for the last data block, is S times the memory page size; the data volume of each data block is less than or equal to the target data volume; where N and S are positive integers, and S>N; The parallel processing module reads the target data block from the plurality of data blocks into the contiguous memory space of the parallel processing module; The parallel processing module is used to perform parallel queries on the target data block to obtain the query results of the target data block; read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; and delete the query results of the first N memory pages of the target data block during the process of reading the query results of the target data block if the target data block is not the first data block among the multiple data blocks.

2. The system according to claim 1, characterized in that, There are multiple parallel processing modules; the multiple parallel processing modules may support processing the same or different amounts of target data. The host is used to invoke the direct memory access (DMA) driver and issue data query instructions to the DMA engines in the multiple parallel processing modules; Any one of the plurality of parallel processing modules is used to obtain the starting memory offset address of the target data block and the length of the target data block from the data query instruction; Based on the starting memory offset address of the target data block and the length of the target data block, the DMA engine is used to read the target data block into the contiguous memory space of any parallel processing module using DMA.

3. The system according to claim 1, characterized in that, The parallel processing module includes multiple computing units; The parallel processing module is further configured to: divide the target data block into multiple data sub-blocks whose data size is an integer multiple of the memory page size; two adjacent data sub-blocks overlap by N memory pages; wherein, the data size of the other data sub-blocks, excluding the last data sub-block, is M times the memory page size; M is a positive integer, and N... <M<S;S≥3; The multiple computing units query the multiple data sub-blocks in parallel to obtain query results for the multiple data sub-blocks; the query results for the multiple data sub-blocks are stored in the result storage area pre-set for the multiple data sub-blocks in the parallel processing module; during the storage process, the query results of the last N memory pages of the preceding data sub-block in two adjacent data sub-blocks are used to overwrite the query results of the first N memory pages of the following data sub-block to obtain the query result for the target data block.

4. A data processing method, characterized in that, include: The host stores the data to be queried corresponding to the query request in the host's contiguous memory space; The host divides the data to be queried into multiple data blocks according to the target data volume supported by the parallel processing module; the data blocks with adjacent memory locations overlap by N memory pages; the data volume of the other data blocks, except for the last data block, is S times the memory page size; the data volume of each data block is less than or equal to the target data volume; where N and S are positive integers, and S>N; The parallel processing module reads the target data block from the plurality of data blocks into the contiguous memory space of the parallel processing module; The parallel processing module performs parallel queries on the target data block to obtain the query results of the target data block; the query results of the target data block are read from the parallel processing module into the result memory space pre-set for the target data block in the host; if the target data block is not the first data block among the multiple data blocks, the query results of the first N memory pages of the target data block are deleted during the reading of the query results of the target data block.

5. The method according to claim 4, characterized in that, There are multiple parallel processing modules; The multiple parallel processing modules support processing the same or different amounts of target data; the method includes: The host invokes the Direct Memory Access (DMA) driver to send data query commands to the DMA engine of the multiple parallel processing modules. The parallel processing module reads a target data block from the plurality of data blocks into the contiguous memory space of the parallel processing module, including: The starting memory offset address and the length of the target data block are obtained from the data query instruction; based on the starting memory offset address and the length of the target data block, the target data block is read into the contiguous memory space of the parallel processing module using the DMA engine in DMA mode.

6. The method according to claim 4, characterized in that, The parallel processing module includes multiple computing units; the parallel processing module performs parallel queries on the target data block, including: The parallel processing module divides the target data block into multiple data sub-blocks, each with a data size that is an integer multiple of the number of memory pages. Two adjacent data sub-blocks overlap by N memory pages. The data size of each data sub-block, except for the last one, is M times the number of memory pages; M is a positive integer, and N... <M<S;S≥3; The multiple computing units are used to perform parallel queries on the multiple data sub-blocks to obtain the query results for the multiple data sub-blocks; The query results of the multiple data sub-blocks are stored in the result storage area pre-set for the multiple data sub-blocks in the parallel processing module; During the storage process, the query results of the last N memory pages of the preceding data sub-block in two adjacent data sub-blocks are used to overwrite the query results of the first N memory pages of the following data sub-block to obtain the query results of the target data block.

7. The method according to claim 6, characterized in that, The parallel processing module divides the target data block into multiple data sub-blocks whose data size is an integer multiple of the memory page size, including: The parallel processing module divides the target data block into multiple data sub-blocks, each with a data size that is an integer multiple of the memory page size, based on the data volume of the element to which the data to be queried belongs and the number of the multiple computing units.

8. The method according to claim 7, characterized in that, The parallel processing module divides the target data block into multiple data sub-blocks, each with a data size that is an integer multiple of the memory page size, based on the data volume of the element to which the queried data belongs and the number of the multiple computing units. These sub-blocks include: The parallel processing module determines the data volume of the data sub-block based on the number of the plurality of computing units and the data volume of the target data block; Based on the data volume of the data sub-blocks, the target data block is divided into multiple initial data sub-blocks; the number of the multiple initial data sub-blocks is equal to the number of the multiple data sub-blocks. The number of memory pages N that overlap at the beginning and end of two adjacent data sub-blocks is determined by dividing the data size Q of the element to be queried by the memory page size and rounding up; where N≥X. For two initial data sub-blocks that are adjacent in memory location, the data of the first N memory pages of the latter initial data sub-block is added to the end of the former initial data sub-block to obtain the plurality of data sub-blocks.

9. The method according to claim 6, characterized in that, The parallel processing unit utilizes the multiple computing units to perform parallel queries on the multiple data sub-blocks, including: Each of the plurality of computing units uses a string matching algorithm to perform character matching on the target data sub-block assigned to the computing unit and the filtering conditions corresponding to the query request; and uses binary bit values ​​to mark the matching results of each character in the target data sub-block to obtain the query result of the target data sub-block.

10. The method according to claim 9, characterized in that, The string matching algorithm is either a bitwise OR algorithm or a bitwise AND algorithm.

11. The method according to any one of claims 4-10, characterized in that, The query result of the data to be queried is the matching result of each character in the data to be queried using positional tags and the filtering conditions corresponding to the query request; The method further includes: The host selects target data that meets the filtering conditions from the data to be queried based on the matching results of each character in the data to be queried using bit value marking and the filtering conditions corresponding to the query request. The target data is provided to the device that issued the query request.

12. The method according to any one of claims 4-10, characterized in that, Before storing the data to be queried corresponding to the query request in the contiguous memory space of the host, the method further includes: The host reads the column to be queried corresponding to the query request from the data source as the data to be queried; Convert the column to be queried into a column storage format supported by memory; The step of storing the data to be queried corresponding to the query request in the contiguous memory space of the host is specifically used for: The column to be queried, which has a memory-supported column storage format, is stored in the contiguous memory space of the host.

13. A parallel processing module, characterized in that, include: Memory and computing units; The memory and the computing unit are electrically connected; The parallel processing module is used to communicate with the host and to read target data blocks from multiple data blocks stored in the host's contiguous memory space into the contiguous memory space of the host. The multiple data blocks are obtained by the host from the data to be queried corresponding to the query request, based on the target data volume that the parallel processing module can process. The data blocks in the multiple data blocks that are adjacent in memory location overlap by N memory pages. Furthermore, the data volume of the data blocks, excluding the last data block, is S times the number of memory pages. The data volume of each data block is less than or equal to the target data volume. Where N and S are positive integers, and S > N. The computing unit is used to perform parallel queries on the target data block to obtain the query results of the target data block; The parallel processing module is further configured to read the query results of the target data block from the parallel processing module into the result memory space pre-set for the target data block in the host; and to delete the query results of the first N memory pages of the target data block during the process of reading the query results of the target data block if the target data block is not the first data block among the multiple data blocks.

14. The module according to claim 13, characterized in that, The parallel processing module includes multiple computing units; the parallel processing module also includes a memory controller; The memory controller is used to: divide the target data block into multiple data sub-blocks, each with a data size that is an integer multiple of the memory page size; two adjacent data sub-blocks overlap by N memory pages; wherein, the data size of the data sub-blocks, except for the last data sub-block, is M times the memory page size; M is a positive integer, and N... <M<S;S≥3; Multiple computing units query the multiple data sub-blocks in parallel to obtain the query results for the multiple data sub-blocks; The memory controller is further configured to store the query results of the plurality of data sub-blocks into a result storage area pre-set for the plurality of data sub-blocks in the parallel processing module; and during the storage process, to use the query results of the last N memory pages of the preceding data sub-block in two adjacent data sub-blocks to overwrite the query results of the first N memory pages of the following data sub-block, so as to obtain the query results of the target data block.

Citation Information

Patent Citations

  • Data processing method and device

    CN114676072A

  • Scalable query processing

    US20210374135A1