Data query method and apparatus

By extracting the data unit group in the columnar database to generate the initial data matrix, filtering and updating according to the query conditions, selecting the data acquisition strategy of the target element, the performance degradation caused by I/O and parsing operations during the data query process is solved, and query efficiency is improved and overall overhead is reduced.

WO2025163375A1PCT designated stage Publication Date: 2025-08-07CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2024/062167
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-02
Filing Date
2024-12-04
Publication Date
2025-08-07

AI Technical Summary

Technical Problem

In the prior art, columnar databases have repeated data I/O operations and parsing operations during data query, resulting in serious performance degradation and high overhead during query.

Method used

By determining the query conditions in response to the data query request, the data unit group is extracted and the initial data matrix is generated, and the initial data matrix is updated according to the data unit group and query conditions, the cache information in the target data matrix is obtained, the data acquisition strategy of the target element is selected, and data analysis is performed only when the target element is accessed last, reducing the performance overhead brought by I/O and analysis operations.

Benefits of technology

It realizes the reduction of unnecessary I/O and parsing operations during the data query process, improves data query efficiency, and reduces the overall query overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2024062167_07082025_PF_FP_ABST
    Figure IB2024062167_07082025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a data query method and apparatus. The data query method comprises: in response to a data query request for a target database, determining a query condition, and extracting data unit groups from the target database on the basis of the query condition; generating an initial data matrix on the basis of the data unit groups, and updating the initial data matrix on the basis of the data unit groups and the query condition, so as to obtain a target data matrix; acquiring cache information corresponding to a target element in the target data matrix, and selecting a data acquisition policy for the target element on the basis of the cache information; and according to the data acquisition policy, acquiring target data corresponding to the target element, and using same as a query result corresponding to the data query request. During data query, an initial data matrix is generated by means of extracting data unit groups, and the initial data matrix is filtered and updated, thereby reducing performance overheads caused by subsequent I / O parsing. On the basis of data cache conditions, specific processing is performed on different data, thereby reducing overall query overheads.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Data Query Method and Apparatus This disclosure claims priority to Chinese patent application No. 202410153809.1, filed with the China Patent Office on February 2, 2024, entitled "Data Query Method and Apparatus," the entire contents of which are incorporated herein by reference. Technical Field: Embodiments of the present disclosure relate to the field of computer technology, and more particularly to a data query method and apparatus. Background: With the continuous development of fields such as big data analysis and data mining, the amount of data processed by databases is increasing, far exceeding the capacity of memory. To efficiently process data, column-based databases have emerged. Column-based databases use a column-related storage architecture for data storage and are primarily suitable for batch data processing and real-time queries. However, during the data query process, repeated I / O and parsing operations occur, resulting in significant performance degradation and high query overhead. Therefore, improving query efficiency and accelerating query speed is an urgent issue. SUMMARY: In view of this, embodiments of the present disclosure provide a data query method. One or more embodiments of the present disclosure relate to a data query apparatus, a computing device, a computer-readable storage medium, and a computer program product to address technical deficiencies in the prior art. According to a first aspect of an embodiment of the present disclosure, a data query method is provided, comprising: determining query conditions in response to a data query request for a target database, extracting a data unit group from the target database based on the query conditions; generating an initial data matrix based on the data unit group, and updating the initial data matrix based on the data unit group and the query conditions to obtain a target data matrix; obtaining cache information corresponding to a target element in the target data matrix, and selecting a data acquisition strategy for the target element based on the cache information; and obtaining target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request.According to a second aspect of an embodiment of the present disclosure, a data query apparatus is provided, comprising: an extraction module configured to determine a query condition in response to a data query request for a target database, and extract a data unit group from the target database according to the query condition; an update module configured to generate an initial data matrix based on the data unit group, and update the initial data matrix according to the data unit group and the query condition to obtain a target data matrix; a selection module configured to obtain cache information corresponding to a target element in the target data matrix, and select a data acquisition strategy for the target element based on the cache information; and an acquisition module configured to obtain target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request. According to a third aspect of an embodiment of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is configured to store computer-executable instructions, and the processor is configured to execute the computer-executable instructions, wherein the computer-executable instructions, when executed by the processor, implement the steps of the data query method described above. According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, storing computer-executable instructions, wherein the instructions, when executed by the processor, implement the steps of the data query method described above. According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the aforementioned data query method. The present disclosure provides a data query method, comprising: determining query conditions in response to a data query request for a target database; extracting data unit groups from the target database based on the query conditions; generating an initial data matrix based on the data unit groups; and updating the initial data matrix based on the data unit groups and the query conditions to obtain a target data matrix; obtaining cache information corresponding to a target element in the target data matrix; selecting a data acquisition strategy for the target element based on the cache information; and obtaining target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request. One embodiment of the present disclosure implements a method for querying data in the target database by extracting data unit groups from the target database based on the data query request, generating an initial data matrix based on the data unit groups, and filtering and updating the initial data matrix using the data unit groups and the query conditions, thereby reducing the performance overhead associated with subsequent I / O parsing of unnecessary data. Based on the data cache status, data in different regions can be processed specifically, further reducing overall query overhead.BRIEF DESCRIPTION OF THE DRAWINGS FIG1 is a schematic diagram of a data query method provided by one embodiment of the present disclosure; FIG2 is a flow chart of a data query method provided by one embodiment of the present disclosure; FIG3 is a flow chart of a processing process of a data query method provided by one embodiment of the present disclosure; FIG4 is a schematic diagram of the structure of a data query device provided by one embodiment of the present disclosure; and FIG5 is a block diagram of the structure of a computing device provided by one embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS The following description sets forth numerous specific details to facilitate a thorough understanding of the present disclosure. However, the present disclosure can be implemented in many other ways than those described herein, and those skilled in the art may make similar generalizations without departing from the scope of the present disclosure. Therefore, the present disclosure is not limited to the specific implementations disclosed below. The terminology used in one or more embodiments of the present disclosure is intended solely to describe specific embodiments and is not intended to limit the present disclosure. As used in one or more embodiments of the present disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should be understood that while terms such as "first" and "second" may be used to describe various information in one or more embodiments of the present disclosure, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, "first" could also be referred to as "second," and similarly, "second" could also be referred to as "first," without departing from the scope of one or more embodiments of the present disclosure. Depending on the context, the term "if" as used herein could be interpreted as "at the time of," "when," or "in response to a determination." Furthermore, 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, stored data, and displayed data, etc.) involved in one or more embodiments of the present disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding entry points are provided for users to choose to authorize or deny such information. First, the terminology used in one or more embodiments of the present disclosure is explained.

[0002] ORC: The ORC format is a columnar storage format for storing and processing big data, offering high compression and fast read performance. The ORC format stores data by column, providing highly optimized compression, indexing, and predicate pushdown capabilities, making it suitable for large-scale data analysis and query scenarios. Columnar Database: A columnar database is a database management system that uses columns as the basic storage unit. Unlike traditional row-based databases, columnar databases store data values ​​within the same column together, providing higher read, aggregation, and analysis efficiency. They can efficiently process large amounts of data and compress and encode data during storage, reducing storage space usage. Columnar databases also enable fast indexing and searching of specific columns, improving query speed and flexibility. Therefore, columnar databases are widely used in fields such as big data, data warehousing, and data analytics. Delayed Materialization: In the database field, this generally refers to the dynamic conversion of data from a logical state to a physical state when needed, reducing storage and computational overhead. This technology delays time-consuming data calculation and storage processes, generating the required results only when they are actually accessed, thereby accelerating query performance.

[0003] Scan: In the database field, a scan refers to a full table scan of a database table or index, often accompanied by certain filtering conditions. It is a linear traversal method, reading each row or column of data in a table one by one. When a database performs a Scan operation, ORC's internal search mechanism is used to coarsely filter and locate row groups, automatically triggering synchronous I / O (Input / Output, read and write operations) and data parsing. This results in unnecessary I / O and parsing overhead in terms of performance. Furthermore, it is not possible to schedule the parsing and I / O operations using different threads. Based on this, the present disclosure provides a data query method, which also involves a data query device, a computing device, and a computer-readable storage medium. Each of these methods is described in detail in the following embodiments. Referring to FIG1 , FIG1 illustrates a scenario diagram of a data query method provided according to an embodiment of the present disclosure. In this case, a target database is the database for subsequent data query. Data unit groups can be extracted from the target database according to query conditions. An initial data matrix is ​​then constructed based on the extracted data unit groups. After obtaining the initial data matrix, the initial data matrix is ​​filtered and updated using the data unit groups and query conditions to obtain a target data matrix. Based on the cache information of the target element in the target data matrix, it is determined whether the target element is cached. Based on the cache information, a data acquisition strategy corresponding to different situations is selected. The actual target data corresponding to the target element is acquired according to the data acquisition strategy as the query result corresponding to the data query request. This ensures that data parsing is performed only when the target data of the target element is finally accessed, reducing the performance overhead caused by I / O and parsing operations during the data query process and improving data query efficiency. Referring to FIG2 , FIG2 illustrates a flow chart of a data query method provided according to an embodiment of the present disclosure, specifically comprising the following steps: Step 202: In response to a data query request for the target database, query conditions are determined, and data unit groups are extracted from the target database according to the query conditions. The target database can be understood as a distributed columnar database, and a data query request for the target database can be understood as a request to query data stored in the target database. The query condition can be understood as a read condition for reading data from the target database. A data unit group contains basic units (column, row-group) filtered from the target database, where column is the index of the data column and row-group is the full column data of a specified number of rows in a data column.In practical applications, in column-based database access, data query requests can be abstracted as a matrix. Each column (row-group) in the matrix is ​​a basic unit of read, including selection, cache hit, I / O execution, and parsing. Selection refers to locating the column-group basic unit after undergoing logic such as pruning and TSO (total store ordering) visibility checks. A cache hit indicates that the basic unit has been cached and can be directly accessed. I / O execution refers to performing I / O read and write operations on the unit in the event of a cache miss. Parsing refers to the process of performing general-level decompression and RLE (Run-Length Encoding) decompression after the I / O operation on the unit to form a block. A block is a data block, the smallest unit of stored data information. In specific implementations, the scan process of a distributed columnar database involves rough cropping to obtain a set of (column, row-group) location information. Batch I / O is then performed on the cropped (column, row-group) set to obtain uncompressed raw byte regions. The raw byte data obtained by I / O is then decompressed and copied to memory one by one to obtain a columnar structure. Data type conversion is then performed to obtain chunks, where chunks represent data blocks. This process results in a large number of unnecessary I / O operations and data parsing, significantly increasing the performance overhead of data queries. In contrast, the data query method provided herein utilizes delayed materialization, strictly adhering to the on-demand loading principle. The materialization process is only triggered upon the first access to the block. Specific processing is then performed on different regions for different scenarios, such as caching, parsing, and I / O, reducing data query performance overhead. In a specific embodiment of the present disclosure, a query condition is determined in response to a data query request for a target database. For example, if the database needs to be queried for names of users aged between 18 and 25, the query condition is "filter out names of users aged between 18 and 25." A data unit group is extracted from the target database based on the query condition.Furthermore, in order to accurately extract data unit groups from a target database, query character information needs to be determined based on query conditions. Specifically, extracting data unit groups from the target database based on the query conditions includes: determining query character information based on the query conditions; determining data column information in the target database based on the query character information, wherein the data storage format of the target database is column-based storage; and extracting data unit groups from the target database based on the data column information. The query character information can be understood as character information corresponding to a query keyword in the query condition. For example, if the query condition is to filter out the names of users aged between 18 and 25, the query keyword in the query condition is "age, name," and the query character information corresponding to the query keyword is "age, name." Based on the query character information, data column information can be determined in the target database. Since the data storage format of the target database is column-based storage, data stored in the corresponding column can be directly selected from the target database based on the data column information. The data column information can be understood as a data index in the target database, and all data belonging to that column can be extracted based on the data column information. In practical applications, after determining the query conditions based on a data query request, the attribute categories of the data to be queried can be determined. Based on the query character information, data column information can be determined in the target database. Based on the data column information, all data in the target database that meets the query conditions can be extracted. Subsequently, the extracted data can be further filtered and updated based on the filter conditions in the query conditions to select more accurate data. In a specific embodiment of the present disclosure, the query conditions determine the query character information as "age, name." Based on the query character information, data column information is determined from the target database. Based on the data column information, data in both the age column and the name column in the target database are extracted as data unit groups. Based on this, by determining the query character information based on the query conditions, a data unit group that meets the query conditions can be roughly selected from the target database. The query conditions and the column data of the data unit group can then be further filtered and updated based on the query conditions, thereby reducing performance waste caused by I / O and parsing of invalid data. Step 204: Generate an initial data matrix based on the data unit group, and update the initial data matrix based on the data unit group and the query conditions to obtain a target data matrix.The initial data matrix can be understood as a data matrix constructed from multiple data cell groups. Since the initial data matrix is ​​roughly screened from the target database based on query conditions, the data cell groups in the initial data matrix may contain data that is not required for the query. Therefore, the initial data matrix needs to be further filtered to obtain a filtered target data matrix. In practical applications, the filter column can be used to execute the query expression to filter out data cell groups that do not meet the conditions. The filter column refers to the data column used as the filter column. In specific implementation, the data corresponding to the filter column can be checked for cache hits. I / O and parsing are performed on the non-hits to obtain the data corresponding to the filter. Push-down filtering is then performed to obtain a selection position set. The data cell groups that do not match the selection are removed from the initial data matrix, and the data matrix after removal is used as the target data matrix. The selection position set refers to the set of element positions selected after filtering. The target data matrix is ​​then constructed based on the selection. In a specific embodiment of the present disclosure, an initial data matrix is ​​generated based on a data unit group. The initial data matrix is ​​further filtered based on filter columns in the data unit group and a query expression to obtain a target data matrix. For example, user data that does not contain an age of 35 in the data unit group is filtered out. Furthermore, to accurately construct the initial data matrix, matrix generation can be performed based on the arrangement information of the data column information. Specifically, generating the initial data matrix based on the data unit group includes: determining data category information corresponding to at least one data unit subgroup in the data unit group; and concatenating the at least one data unit subgroup based on the arrangement information of the data column information and the data category information corresponding to the at least one data unit subgroup to obtain the initial data matrix. A data unit subgroup can be understood as one data unit group among multiple data unit groups. Since multiple data unit groups are determined, data category information for each data unit subgroup in the multiple data unit groups can be determined. The data unit subgroup is thus a data unit group. The data category information can be understood as the data category described by the data unit subgroup, such as the data unit subgroup being an age data category, a name data category, etc. After determining the data category information corresponding to each data unit subgroup in the multiple data unit groups, an initial data matrix can be generated according to the arrangement information of the data column information and the data category information corresponding to each data unit subgroup.In practical applications, since the extracted data unit groups may belong to different data columns, it is necessary to determine the data category information for each data unit group. Then, data are spliced ​​based on the data column information arrangement information to construct an initial data matrix. The data column information arrangement information can be understood as the order of the data columns in the data matrix. For example, if the data columns are arranged by age, name, height, and weight, the data unit groups need to be subsequently arranged and spliced ​​according to this order to generate an initial data matrix with the corresponding order. In a specific embodiment of the present disclosure, referring to the above example, the data category information corresponding to each data unit subgroup in the data unit group is determined. For example, the data category information corresponding to data unit subgroup 1 is the age category, and the data category information corresponding to data unit subgroup 2 is the name category. Based on the data column information arrangement information and the data category information corresponding to each data unit subgroup, all data unit subgroups are spliced ​​together, and the column data of each category is spliced ​​together to generate an initial data matrix. Based on this, the initial data matrix is ​​generated by splicing the data unit groups according to the data column information arrangement information. This facilitates subsequent matrix element filtering based on the data in the data unit groups. Furthermore, in order to filter out accurate data and reduce the performance overhead caused by processing invalid data, it is necessary to filter and update the initial data matrix. Specifically, the initial data matrix is ​​updated based on the data unit group and the query condition to obtain a target data matrix. This includes: if the query condition is a multi-level query condition, determining filter elements in the data unit group based on the multi-level query condition, determining filter data corresponding to the filter elements, determining target filter elements in the initial data matrix based on the filter data and the multi-level query condition, and removing the target filter elements to obtain the target data matrix; if the query condition is a single-level query condition, determining target filter elements in the initial data matrix based on the data unit group and the single-level query condition, and removing the target filter elements to obtain the target data matrix. When the query condition is a multi-level query condition, filtering and updating can be performed based on the filter elements, while when the query condition is a single-level query condition, filtering and updating can be performed directly based on the data unit group. A multi-level query condition can be understood as a query condition that includes multiple layers of queries. For example, to query the names of users who are 25 years old, age is a first-level query and name is a second-level query. A single-level query condition can be understood as a query condition that only has one layer of query. For example, to query the number of users who are 25 years old, only the data with the age of 25 needs to be queried.In summary, in the case of multi-level query conditions, you can use the query filter elements to filter data, and after filtering, you can query for the final required data; in the case of single-level query conditions, since the query filter elements are the final required data, you can directly filter according to the data unit group. In practical applications, a filter element can be understood as a filter column element in a data unit group. For example, when the data unit group is age and name, and the query condition is to filter out names with an age of 35, the query condition is a multi-level query condition. In this case, age is the filter element. The filter data corresponding to the filter element of each data piece in each data unit group is obtained. The filter data is the data actually corresponding to the filter element. Therefore, to determine the filter data corresponding to the filter element, a cache query needs to be performed on the filter column element. Specifically, determining the filter data corresponding to the filter element includes: determining column cache information corresponding to the filter element, and selecting a column data acquisition strategy for the filter element based on the column cache information; when the column data acquisition strategy is a direct column data acquisition strategy, acquiring the filter data corresponding to the filter element in the column data cache space; when the column data acquisition strategy is a column data parsing acquisition strategy, acquiring filter data byte information corresponding to the filter element, determining compressed filter data corresponding to the filter element according to the filter data byte information, and adding the compressed filter data to the filter data cache space; when receiving an acquisition request for the compressed filter data, The compressed filtered data is decompressed in the filtered data cache space to obtain the filtered data corresponding to the filter element. Column cache information can be understood as information recording whether the filter element has a cache hit. This information allows for cache queries of the filter element, specifically, to determine whether the cache contains the actual data corresponding to the filter element. If so, the filtered data for the filter element can be directly read from the cache. If not, an I / O read and parse operation is performed on the filter element to obtain the actual data of the filter column. Therefore, the column data acquisition strategy for the filter element can be determined based on the column cache information of the filter element. Column data acquisition strategies include direct column data acquisition strategies and parsed column data acquisition strategies. The direct column data acquisition strategy directly acquires the already loaded filtered data from the column data cache space. The parsed column data acquisition strategy requires first performing an I / O operation on the compressed filtered data of the filter element from the memory space and loading it into the filtered data cache space. The specific compressed filtered data can be determined based on the byte information of the filtered data.After being added to the filter data cache space and receiving a request to obtain compressed filter data, the compressed filter data can be decompressed, including decompression and segmentation, to obtain the filter data corresponding to the filter element. In summary, by also performing a cache query on the filter column element data, repeated I / O for the filter data is avoided, reducing data query overhead. In specific implementations, the initial data matrix is ​​updated using the filter data and query conditions. The target filter elements in the initial data matrix can be determined based on the filter data and multi-level query conditions. The target filter elements are filter elements that do not meet the query conditions, such as the filter element with an age of 36. By removing the target filter elements from the initial data matrix, unnecessary data unit groups can be filtered out, eliminating the need for subsequent processing of the filtered data unit groups, reducing unnecessary performance overhead. When the query condition is to filter out the number of names with an age of 35, the query condition is a single-level query condition. In this case, age is the final data to be queried. During filtering, since the actual data in the filter column is the final data to be queried, the elements to be filtered can be directly determined in the initial data matrix based on the data unit group and the single-level query condition, and the target data matrix can be directly obtained. Based on this, by using the filtered data and query condition to perform push-down filtering, unnecessary data is filtered, reducing the performance overhead caused by subsequent data I / O and parsing. Furthermore, in the case of multi-level query conditions, a query expression can be generated using the query condition, and filtering can be performed based on the query expression. Specifically, the target filter elements are determined in the initial data matrix based on the filtered data and the multi-level query condition and then removed. This includes: generating a query expression based on the query condition; filtering the filtered data based on the query expression; and selecting and removing the target filter elements from the initial data matrix based on the filtering results. The query expression can be understood as a data reading expression determined based on the query conditions. For example, if the query condition is "user names whose age is greater than 18 and less than 25," the query expression is "18<=age<=25." Different query expressions can be determined based on different query conditions. By filtering the filtered data based on the query expression, ages less than 18 and greater than 25 can be filtered out. In other words, the determined target filter elements are all elements that do not meet the query expression.In a specific embodiment of the present disclosure, a query expression is generated based on a query condition. For example, if the query expression is "age <= 35," the filter data, i.e., the actual age data, is filtered based on the query expression, and target filter elements with ages greater than 35 are selected and eliminated. Based on this, the initial data matrix is ​​filtered using the query condition and the filter data, thereby filtering out unnecessary data and reducing performance overhead caused by invalid data. Furthermore, since the initial data matrix includes multiple columns of different data cell groups, after determining the target filter data based on the filtering results, the data in other columns corresponding to the target filter data can be deleted. Specifically, selecting and eliminating the target filter element from the initial data matrix based on the filtering results includes: determining the target filter data based on the filtering results, obtaining data row information corresponding to the target filter data; and selecting the target filter element from the initial data matrix based on the data row information. Among them, the target filtering data is the actual data that needs to be filtered out. For example, the query condition is to filter out the names of users who are 35 years old, and the target filtering data is age data that is not equal to 35. After determining the target filtering data, it is also necessary to delete the data corresponding to these target filtering data in other rows. Therefore, the data row information corresponding to the target filtering data can be obtained. The data row information can be understood as the row information of the target filtering data in the current data column. For example, if a certain age data is in the first row of the age data column, then the first row of the name data column is the name corresponding to the age data. According to the data row information, the name data in the first row of the name data column can also be deleted, thereby realizing the filtering and updating of the initial data matrix according to the target filtering data. In practical applications, due to the data storage characteristics of column-based databases, each data column stores data of the same data type. For example, an age column stores only age data, and a name column stores only name data. Furthermore, data in different data columns has a positional mapping relationship. For example, if a piece of data is "age 35, name A," the different types of data within that piece of data will be stored in corresponding positions within the data column, for example, all rows within the first row of the data column. Therefore, when deleting filtered data, all data can be deleted based on the row information of the filtered data. In a specific embodiment of the present disclosure, target filtered data is determined based on the filtering results. Target filtered data is data that does not meet the query criteria. The row information of each target filtered data item in the current data column is then determined. Based on this row information, the target filtered data elements in other data columns are selectively removed.Based on this, the initial data matrix is ​​filtered and updated by removing filter elements from different data columns based on the data row information of the target filtered data. Step 206: Obtain cache information corresponding to the target element in the target data matrix and select a data acquisition strategy for the target element based on the cache information. Cache information can be understood as information indicating whether the target element in the target data matrix has a cache hit. If the data corresponding to the target element has already hit the block cache, the actual data corresponding to the target element can be directly acquired from the cache, eliminating the need for further I / O and parsing operations. Therefore, a data acquisition strategy for the target element can be selected based on the cache information, thereby performing I / O and parsing operations on the portion of data that did not hit the cache, reducing data query performance overhead. In a specific embodiment of the present disclosure, cache information corresponding to the target element in the target database is obtained, a data acquisition strategy for the target element is selected based on the cache information, and the actual data corresponding to the target element is subsequently acquired based on the data acquisition strategy. Furthermore, to determine the cache information corresponding to the target element, a traversal query can be performed in the data cache space based on the target element. Specifically, obtaining the cache information corresponding to the target element in the target data matrix includes: determining the target element in the target data matrix; traversing the first data cache space corresponding to the target database based on the target element, and generating the cache information corresponding to the target element based on the traversal results. The first data cache space can be understood as the query cache space corresponding to the target database. Traversing the first data cache space based on the target element can determine whether data corresponding to the target element exists in the cache space, thereby determining whether the current target element is cached. The target element is the matrix element corresponding to the filtered data unit group in the target data matrix. For example, if the filtered element is age, the target element is the user name. In practical applications, the target element is the element corresponding to the projected column (projection refers to extracting certain columns that meet specific conditions) in the target data matrix. The corresponding element can be searched in the data cache space to determine whether data corresponding to the target element has been previously cached. In a specific embodiment of the present disclosure, referring to the above example, it is determined that the target element is the name element "name1", and a traversal is performed in the first data cache space to find whether there is data corresponding to the name element in the first data cache space.In specific implementations, the BlockLoader component can be used to determine cache information corresponding to a target element, traverse the first data cache space corresponding to the target database based on the target element, and generate cache information corresponding to the target element based on the traversal results. This process includes: invoking a block loading component to traverse the first data cache space corresponding to the target database based on the target element, determining the location information of the target element based on the traversal results; and generating cache information corresponding to the target element based on the location information. The BlockLoader component can be understood as a block loading component. When determining cache information corresponding to a target element, the block loading component can be invoked. This component first checks whether the element within the Block has a cache hit. In actual applications, the block loading component can be used to traverse the first data cache space to determine whether the target data corresponding to the target element has been loaded. Based on the traversal results, the location information of the target element is the location of the space where the actual data corresponding to the target element resides. If the target element is not found in the cache space, i.e., it misses the cache, the location information represents the disk storage space. If the target element is found in the cache space, i.e., it hits the cache, the location information represents the cache space. Based on the location information, cache information can be determined, and data can subsequently be retrieved based on the cache information. Specifically, the data retrieval process includes the following: If a cache hit is found, the cached result is directly returned, avoiding unnecessary I / O and parsing. If the BlockLoader misses a cache hit, the following steps are performed: A RandomAccessBlock object is created based on the type and the corresponding memory space is allocated. The startAt method of the CountReader is called to move the CountReader's read pointer to the corresponding position of the BlockLoader. This step ensures that data is read from the correct starting position. The read method of the CountReader is called to read data from the current pointer position and write it to the RandomAccessBlock. This step completes the actual data reading and writing operations. In summary, the BlockLoader component improves data processing efficiency and performance through its caching mechanism and collaboration with the CountReader. Further, selecting the data acquisition strategy for the target element according to the cache information includes: if the cache information is a cache hit, determining that the data acquisition strategy for the target element is a direct acquisition strategy; if the cache information is a cache miss, determining that the data acquisition strategy for the target element is a parsing acquisition strategy.If the cache information indicates a cache hit, it means the data corresponding to the target element already exists in the memory cache. In this case, the data acquisition strategy for the target element is a direct acquisition strategy. If the cache information indicates a cache miss, it means the data corresponding to the target element does not exist in the memory cache. In this case, the data acquisition strategy for the target element is a parsing acquisition strategy, requiring I / O and parsing operations to obtain the actual data corresponding to the target element. In one specific embodiment of the present disclosure, if the cache information is determined to be a memory cache, the data acquisition strategy for the target element is a direct acquisition strategy. Subsequently, the actual data corresponding to the target element can be directly read from the memory cache. In another specific embodiment of the present disclosure, if the cache information is determined to be a disk cache, the data acquisition strategy for the target element is a parsing acquisition strategy. Subsequently, I / O and parsing operations are required for the target element to obtain the actual data corresponding to the target element. Based on this, different data acquisition strategies are selected based on different cache conditions to obtain the actual data corresponding to the target element, reducing the performance overhead caused by I / O and parsing of some data. Step 208: Obtain the target data corresponding to the target element according to the data acquisition strategy as the query result corresponding to the data query request. The target data can be understood as the actual data corresponding to the target element. After acquiring the target data corresponding to the target element according to the data acquisition strategy, the target data can be used as the query result corresponding to the data query request, and the downstream task can continue to be executed. In a specific embodiment of the present disclosure, the target data corresponding to the target element is acquired according to the data acquisition strategy. The target data is the name of a user aged 35. The acquired target data is used as the query result corresponding to the data query request. Furthermore, because different cache situations require different data acquisition strategies, acquiring data according to the data acquisition strategy requires different acquisition strategies. Specifically, acquiring the target data corresponding to the target element according to the data acquisition strategy includes: acquiring the target data corresponding to the target element according to the direct acquisition strategy; or acquiring the target data corresponding to the target element according to the parsing acquisition strategy. The direct acquisition strategy can be understood as a strategy that directly acquires the target data from the memory cache. The parsing acquisition strategy can be understood as a strategy that acquires the target data directly from the memory cache. Therefore, it is necessary to first perform I / O to obtain the raw byte area, and then parse the raw bytes to obtain Block to obtain the actual target data.Furthermore, acquiring the target data corresponding to the target element according to the data acquisition strategy includes: invoking a read / write component according to the parsing acquisition strategy to acquire data byte information corresponding to the target element, determining compressed data corresponding to the target element based on the data byte information, and adding the compressed data to a second data cache space; and upon receiving an access request for the compressed data, invoking the parsing component to decompress the compressed data in the second data cache space to acquire the target data corresponding to the target element. The data byte information corresponding to the target element can be understood as information about the data byte region corresponding to the target element. The data byte information can include physical byte position information, such as a physical byte starting position and compressed byte size information. After determining the data byte information corresponding to the target element, the compressed data corresponding to the target element can be added to the second data cache space according to the data byte information, thereby implementing an I / O operation for the target element. The compressed data in the second data cache space is then decompressed to acquire the target data corresponding to the target element. It should be noted that the second data cache space can be the same as the first data cache space. Decompressing compressed data involves decompressing, parsing, and segmenting the raw byte data to obtain the block data corresponding to the target element. In practice, the data byte information is obtained through the read / write component, which is the StreamLoader component. The read / write component's implementation involves calling the open method to obtain all stream information associated with the stream, which is then maintained by the StreamManager. This step is performed when opening a data unit named "stream." It aims to obtain all stream information associated with the stream and store it in the StreamManager for subsequent use.

[0004] In the I oad method, according to the specified column and the corresponding row-group, the byte area list BufferChunkList is obtained. oThe specific method is to locate the physical byte start position and the compressed byte size of each row-group according to the Row Index mentioned above, so as to form a buffer chunk node for each row-group, and maintain the buffer chunk nodes of adjacent row-groups with a linked list. In the "load" method, the system locates the physical byte start position and the compressed byte size of each row-group according to the columns specified by the user and the corresponding row-group. These information are used to construct a linked list named BufferChunkList, where each node represents the buffer chunk of a row-group; an asynchronous thread is called to return CompletableFuture<Map<StreamName, InStream>>, and this step involves asynchronous processing. The system will start an asynchronous thread to execute the next steps and return a CompletableFuture object representing the asynchronous operation; using the DataReader interface, a strategy of first merging and then IO is adopted for the BufferChunkList linked list. Nodes in the linked list that are adjacent or have a distance less than the MAX_MERGE_DISTANCE (default 64KB) parameter are merged into one IO. The DataReader interface is used to read data. Here it adopts a strategy of first merging nodes in the BufferChunkList linked list that are adjacent or have a distance less than a specific threshold (default 64KB), and then performing input / output (IO) operations. This can reduce the number of IOs and improve efficiency;

[0005] The DataReader calls the FileSystem / InputStream interface to write the results back to each linked list node. The DataReader performs the actual operations by calling the underlying file system interface (such as FileSystem or InputStream). Upon completion, the results are written back to each node of the previously constructed BufferChunkList linked list. From the linked list, InStream objects are sequentially partitioned and assembled based on the stream to which each linked list node belongs. Finally, the system extracts data from the BufferChunkList linked list and creates and configures an InStream object based on the stream type of each node. An InStream object may represent different types of input streams, such as compressed or encrypted streams. In the above description, a Stream is the organizational unit of an ORC file. Within an ORC file, each 64MB segment forms a Stream. Within a Stream, it can be divided into a matrix with two dimensions: (column, row-group). A stream is a lower-level storage unit within each (column, row-group) unit, used to manage data compression. Generally speaking, the StreamLoader component is responsible for collecting the physical byte position information of each (column, row-group) unit, providing a corresponding read interface, and returning uncompressed physical byte data. In summary, the StreamLoader component involves a complex data processing process, primarily involving data reading, merging, I / O operations, and stream processing, which helps improve the speed and efficiency of big data processing. In a specific embodiment of the present disclosure, the read / write component is invoked according to the parsing acquisition strategy to obtain the data byte information corresponding to the target element. This data byte information includes the data's physical byte position and byte size. Based on this data byte information, the original compressed data corresponding to the target element is added to the data cache space. This implements I / O operations on the target element's data and writes the original byte data to the cache space, allowing subsequent data accesses to directly retrieve the data from the cache space. In practical applications, when an access request for compressed data is received, the parsing component can be used to decompress the compressed data to obtain the target data.The parsing component can be understood as a ColumnReader component. This component is responsible for invoking the StripeLoader to obtain the raw byte data for each column (such as the filter column and the projection column) and given row-group information. It then decompresses, parses, and segments this raw byte data, providing columnar block data in units of 1024 rows. In practice, the ColumnReader component is an interface for parsing ORC-formatted data. Its primary task is to convert the raw ORC byte data loaded by the StripeLoader into the Block objects required by the executor. This component has three main methods: open: This method initializes the ColumnReader. There are two ways to call this method: Passing the callback function returned by the StripeLoader.ioad as a parameter allows the ColumnReader to indirectly obtain data from the callback. Directly triggering the StripeLoader.ioad process within the ColumnReader and synchronously waiting for its completion. This ensures that data loading and parsing are performed synchronously. oStartAt: This method is used to move the read pointer within the ColumnReader to the specified element position in the specified row group. This enables the ColumnReader to access data randomly, allowing data to be read from any location, rather than just sequentially. next: This method writes a specified amount of data to the RandomAccessBlock, starting from the current pointer position, to construct a complete Block. Compared to the tail-append construction of the BlockBuilder, this approach avoids additional overhead such as array expansion and dynamic array bounds checking, thereby improving the efficiency of data reading and parsing. In summary, the main function of the ColumnReader component is to parse raw byte data in ORC format into the Block objects required by the executor and provide random access and efficient data reading capabilities. By properly using this component, the efficiency and performance of data processing and analysis can be improved.Furthermore, to extract data unit groups from the target database, logical grouping is performed based on the row data units contained in the target database. Specifically, the row data units contained in the target database are identified. A row data iteration component is then invoked to logically group the row data units. Based on the grouping results, the logical row data corresponding to each row data sub-unit within the row data unit is determined. The logical row data is used to construct data unit groups. A row data unit can be understood as a row group of row data in the target database, and a row data iteration component can be understood as a RowGroupIterator component. The RowGroupIterator component abstracts the internal rowGroup sequence within Stripe and is responsible for managing Stripe-level data and memory resources. The RowGroupIterator component manages the data information required by the StripeLoader component and generates row-group-based objects, namely logical row data. (A Logical RowGroup is a logical row group that does not store the actual physical data within the row group. It can generate a batch of Chunk objects consisting of 1024 rows. A Chunk object is a collection of Block columns.) A row data unit contains multiple row data sub-units. Therefore, after logically grouping the row data units, the logical row data corresponding to each row array sub-unit can be determined based on the grouping results. In practical applications, the most important function of a Logical RowGroup is to enumerate all chunks within a RowGroup (represented here as a generic BATCH). To avoid triggering specific I / O and parsing processes, the Logical RowGroup uses LazyBlock and BlockLoader objects to construct chunks during chunk enumeration. Furthermore, it records the starting element position (StartPosition) and number of elements (PositionCount) of each chunk within the RowGroup. This improves data processing efficiency and performance by avoiding unnecessary I / O and parsing processes. The LazyBlock component is obtained by enumerating a Logical RowGroup and represents an uninterpreted logical block. It inherits the Block and RandomAccessBlock interfaces, making it fully compatible and transparent to the executor.All Bock interface calls first proceed to the Iod method, where the BockLoader performs the initial loading to obtain the actual Bock data. In summary, the Logical RowGroup and LazyBock components play a key role in data processing and analysis. Their proper use can improve efficiency and performance. In specific implementations, the RowGroupIterator component encapsulates an iterator that enumerates logical RowGroups based on a given Stripeld and a sequence of RowGroupIDs. For example, when stripeld is 0 and row_group_ids is {1, 3, 5, 7}, calling the next and current methods will retrieve the Logical RowGroup objects numbered 1, 3, 5, and 7, respectively.

[0006] The RowGroup Iterator component manages Stripe-level I0 and memory resources. To improve performance, the I0 tasks for all Stripe-level columns and all RowGroups should be combined and executed together as much as possible. The I0 results are then distributed during parsing. This can reduce performance regressions caused by random I0.

[0007] The RowGroupIterator component supports the getStr i peLoader method of StripeLoader. By binding the RowGroup sequence and the I0 execution process of StripeLoader, the RowGroupIterator can better manage data loading and parsing at the Stripe level.

[0008] The RowGroupI terator component manages the Stripe-level column parser, ColumnReader. Because the 10 result is shared at the Stripe level, the ColumnReader that depends on it should also be shared at the Stripe level. Using ColumnReader's startAt interface, you can move the cursor to a specific rowGroupId for parsing.

[0009] The RowGroupIerator component manages Stripe-level cache data (CacheReader). Because Stripe-level I / O tasks need to be consolidated, comprehensive Stripe-level cache data information is required to eliminate unnecessary I / O processes. In summary, the RowGroupIerator component primarily manages the RowGroup sequence within Stripe and is responsible for managing Stripe-level I / O and memory resources. Proper use of this component can improve the efficiency and performance of data processing and analysis. In the data query method disclosed herein, under the delayed materialization mechanism, there are indeed two paths for the executor to access Chunks / Blocks. The following is a detailed explanation of these two paths: Path 1: Chunk -> Block -> BlockLoader -> CacheReader (Stripe-level shared) -> BufferChunkList (Stripe-level shared). When the executor needs to access a Chunk, it first converts it into the corresponding Block. Then, it retrieves the Block's data through the BlockLoader. Because the CodenumReader is shared at the Stripe level, executors use it to read data. This means multiple executors can share the same CodenumReader, improving resource utilization and performance. Finally, executors can access the actual stored data through the BufferChunkList (also shared at the Stripe level). This path is suitable for scenarios that require direct access to the underlying data. Path 2: Chunk -> Block -> BlockLoader -> BlockCacheManager. This path is primarily used for cache management. When an executor needs to access a Chunk, it first converts it into the corresponding Block and then retrieves the data through the BlockLoader. Unlike path 1, the data here is directly stored in the BlockCacheManager for cache. This allows data to be read directly from the cache for the same Chunk, avoiding unnecessary I / O operations. This path is suitable for scenarios where data is frequently accessed and rarely changes, as caching can significantly improve performance. In summary, the choice between these two paths depends on the specific scenario and requirements.By properly utilizing these two paths, data access performance and resource consumption can be better balanced. In practical applications, to ensure the normal execution of Scan, the ScanWork component is required to manage the entire Scan task. For the original row-group sequence, the 10 task is executed for all filter columns using StripeLoader. In this step, the ScanWork component processes the original row-group sequence and performs the 10 task for all columns that need to be filtered. These 10 tasks are executed by StripeLoader. Constructing the 1 azy b I lock / 1 azy chunk for the filter column and injecting the asynchronous callback of the 10 task: After completing the 10 task, the ScanWork component constructs the 1 azy b I lock or 1 azy chunk for the filtered column. At the same time, it injects these tasks into the asynchronous callback for subsequent processing when needed. Triggering the loading of the filter column may synchronously wait for the 10 task to complete. Once the above steps are completed, the ScanWork component triggers the loading of the filtered column. This may involve waiting for 10 tasks to complete, depending on the specific situation. Perform vectorized filtering on each chunk output by the filter column: After loading the filter column, the ScanWork component performs vectorized filtering on each chunk. In this step, the impact of the column-stored item bitmap must also be considered. For the set item [] obtained by vectorized filtering, comprehensively check whether the set item [] corresponding to all chunks in the row-group is hit: After vectorized filtering, the ScanWork component checks whether the set item □ corresponding to the chunk in each row-group is hit. If not, the row-group is marked as not visited. Based on the results of the above two steps, 10 tasks and I azy b I lock are constructed for the project column, and the scan work ends: Finally, based on the results of the above steps, the ScanWork component constructs 10 tasks and I azy b I lock for the project column, and ends the scan work.In summary, the ScanWork component primarily encapsulates the execution logic of a set of RowGroups and constitutes the basic operational unit of a scan. Through a series of processing and filtering steps, this component can effectively process and filter data to meet diverse query requirements. This disclosure provides a data query method, comprising: determining query conditions in response to a data query request for a target database; extracting data unit groups from the target database based on the query conditions; generating an initial data matrix based on the data unit groups; and updating the initial data matrix based on the data unit groups and the query conditions to obtain a target data matrix; obtaining cache information corresponding to target elements in the target data matrix; selecting a data acquisition strategy for the target elements based on the cache information; and obtaining target data corresponding to the target elements according to the data acquisition strategy as the query result corresponding to the data query request. This method enables the target database to extract data unit groups from the target database based on the data query request, generate an initial data matrix based on the data unit groups, and filter and update the initial data matrix using the data unit groups and the query conditions, thereby reducing the performance overhead associated with subsequent I / O parsing of unnecessary data. Based on the data cache status, data in different regions can be processed specifically, further reducing overall query overhead. The following, in conjunction with FIG3 , further illustrates the data query method provided by the present disclosure, using its application in user information querying as an example. FIG3 shows a flowchart of the processing process of a data query method provided by one embodiment of the present disclosure, specifically comprising the following steps: Step 302: Determine a query condition in response to a data query request for a target database. In one implementation, if a user wishes to query the target database for information about users with more than five years of service, the query condition is determined to be "more than five years of service" based on the data query request. Step 304: Determine query character information based on the query condition, and determine data column information in the target database based on the query character information. In one implementation, if the query condition determines the query character information to be "hours, name," data column information is determined in the target database based on the query character information, and the data column information is the years of service and the user's name. Step 306: Extract data unit groups from the target database based on the data column information. In one achievable manner, the data of years of service and user names are extracted as a data unit group. Step 308: Generate an initial data matrix based on the data unit group.In one achievable method, data category information corresponding to at least one data unit subgroup in the data unit group is determined. The at least one data unit subgroup is concatenated according to the data column arrangement information and the data category information corresponding to the at least one data unit subgroup, thereby obtaining an initial data matrix. Step 310: The initial data matrix is ​​updated based on the data unit group and the query conditions to obtain a target data matrix. In one achievable method, based on the multi-level query conditions, a filter element is determined in the initial data matrix to be the matrix element corresponding to years of service. The actual data corresponding to the filter element, i.e., the actual value of years of service in each piece of data, is determined in the data unit group. Based on the filter data and the query expression "hours>5" in the query conditions, target filter elements that do not meet the query conditions are identified and extracted from the initial data matrix to obtain the target data matrix. Step 312: The target element is determined in the target data matrix. A traversal is performed based on the target element in the first data cache space corresponding to the target database, and cache information corresponding to the target element is generated based on the traversal results. Step 314: A data acquisition strategy for the target element is selected based on the cache information. In one achievable implementation, no data corresponding to the target element is found in the data cache space, so the data retrieval strategy is determined to be a parsing retrieval strategy. Step 316: Determine the data byte information corresponding to the target element according to the parsing retrieval strategy, extract the compressed data corresponding to the data byte information from the target database, and add it to the second data cache space. Step 318: Decompress the compressed data in the second data cache space to obtain the target data corresponding to the target element. The present disclosure provides a data query method that, when querying data in a target database, extracts data unit groups from the target database according to a data query request, generates an initial data matrix based on the data unit groups, and filters and updates the initial data matrix using the data unit groups and query conditions, thereby reducing the performance overhead caused by subsequent I / O parsing of unnecessary data. Based on the data cache status, data in different regions is processed specifically, further reducing overall query overhead. Corresponding to the above-mentioned method embodiments, the present disclosure also provides an embodiment of a data query device. Figure 4 shows a schematic structural diagram of a data query device provided by one embodiment of the present disclosure.As shown in FIG4 , the apparatus includes: an extraction module 402 configured to determine a query condition in response to a data query request for a target database, and extract a data unit group from the target database based on the query condition; an update module 404 configured to generate an initial data matrix based on the data unit group, and update the initial data matrix based on the data unit group and the query condition to obtain a target data matrix; a selection module 406 configured to obtain cache information corresponding to a target element in the target data matrix, and select a data acquisition strategy for the target element based on the cache information; and an acquisition module 408 configured to acquire target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request. Optionally, the extraction module 402 is further configured to determine query character information based on the query condition, and determine data column information in the target database based on the query character information, wherein the data storage format of the target database is column-based storage; and extract the data unit group from the target database based on the data column information. Optionally, the extraction module 402 is further configured to determine data category information corresponding to at least one data unit subgroup in the data unit group; and concatenate the at least one data unit subgroup according to the arrangement information of the data column information and the data category information corresponding to the at least one data unit subgroup to obtain an initial data matrix. Optionally, the update module 404 is further configured to, if the query condition is a multi-level query condition, determine filter elements in the initial data matrix according to the multi-level query condition, determine filter data corresponding to the filter elements in the data unit group, determine target filter elements in the initial data matrix based on the filter data and the multi-level query condition, and remove the target filter elements to obtain a target data matrix. If the query condition is a single-level query condition, determine target filter elements in the initial data matrix based on the data unit group and the single-level query condition, and remove the target filter elements to obtain a target data matrix. Optionally, the update module 404 is further configured to generate a query expression based on the query condition; filter the filter data based on the query expression; and select and remove target filter elements from the initial data matrix based on the filter results. Optionally, the update module 404 is further configured to determine target filter data based on the filter results, obtain data row information corresponding to the target filter data; and select target filter elements from the initial data matrix based on the data row information.Optionally, the selection module 406 is further configured to determine a target element in the target data matrix; traverse a first data cache space corresponding to the target database based on the target element, and generate cache information corresponding to the target element based on the traversal results. Optionally, the selection module 406 is further configured to determine that the data acquisition strategy for the target element is a direct acquisition strategy if the cache information indicates a cache hit; and to determine that the data acquisition strategy for the target element is a parsing acquisition strategy if the cache information indicates a cache miss. Optionally, the acquisition module 408 is further configured to determine data byte information corresponding to the target element according to the parsing acquisition strategy; extract compressed data corresponding to the data byte information from the target database and add it to a second data cache space; and decompress the compressed data in the second data cache space to obtain target data corresponding to the target element. The present disclosure provides a data query device comprising: an extraction module configured to determine query conditions in response to a data query request for a target database, and extract data unit groups from the target database based on the query conditions; an update module configured to generate an initial data matrix based on the data unit groups, and update the initial data matrix based on the data unit groups and the query conditions to obtain a target data matrix; a selection module configured to obtain cache information corresponding to a target element in the target data matrix, and select a data acquisition strategy for the target element based on the cache information; and an acquisition module configured to acquire target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request. This device implements a method for extracting data unit groups from the target database based on the data query request, generating an initial data matrix based on the data unit groups, and filtering and updating the initial data matrix using the data unit groups and the query conditions, thereby reducing the performance overhead associated with subsequent I / O parsing of unnecessary data. Based on the data cache status, data in different regions can be processed specifically, further reducing overall query overhead. The above is an exemplary embodiment of a data query device according to this embodiment. It should be noted that the technical solution of the data query device and the technical solution of the aforementioned data query method share the same concept. For details not described in detail in the technical solution of the data query device, please refer to the description of the technical solution of the aforementioned data query method. Figure 5 shows a block diagram of a computing device 500 provided according to one embodiment of the present disclosure. Components of computing device 500 include, but are not limited to, a memory 510 and a processor 520. oThe processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data. The computing device 500 also includes an access device 540, which enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface. In one embodiment of the present disclosure, the aforementioned components of the computing device 500 and other components not shown in FIG. 5 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG. 5 is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art may add or replace other components as needed. Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). Computing device 500 may also be a mobile or stationary server.The processor 520 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned data query method. The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the aforementioned data query method are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the aforementioned data query method. An embodiment of the present disclosure also provides a computer-readable storage medium storing computer-executable instructions. When executed by the processor, these computer-executable instructions implement the steps of the aforementioned data query method. The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the aforementioned data query method are based on the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the aforementioned data query method. An embodiment of the present disclosure also provides a computer program product, including a computer program or instructions. When executed by a processor, these computer program or instructions implement the steps of the aforementioned data query method. The above is a schematic diagram of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the aforementioned data query method share the same concept. For details not described in detail in the technical solution of the computer program product, reference should be made to the description of the technical solution of the aforementioned data query method. The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. The computer instructions include computer program code, which may be in source code form, object code form, executable files, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium.It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. It should be noted that for ease of description, the aforementioned method embodiments are described as a series of combined actions. However, those skilled in the art should understand that the embodiments of the present disclosure are not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously according to the embodiments of the present disclosure. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for the embodiments of the present disclosure. In the above embodiments, the description of each embodiment has its own emphasis. For portions not described in detail in a particular embodiment, reference should be made to the relevant descriptions of other embodiments. The preferred embodiments of the present disclosure disclosed above are merely intended to help illustrate the present disclosure. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific implementations described. Obviously, many modifications and variations are possible based on the content of the embodiments of the present disclosure. These embodiments are selected and described in detail in this disclosure to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize the disclosure. This disclosure is limited only by the claims and their full scope and equivalents.

Claims

Claims 1. A data query method, comprising: determining a query condition in response to a data query request for a target database, and extracting a data unit group from the target database according to the query condition; generating an initial data matrix based on the data unit group, and updating the initial data matrix according to the data unit group and the query condition to obtain a target data matrix; Acquire cache information corresponding to a target element in the target data matrix, and select a data acquisition strategy for the target element according to the cache information; The target data corresponding to the target element is acquired according to the data acquisition strategy as a query result corresponding to the data query request.

2. The method according to claim 1, wherein extracting a data unit group from the target database according to the query condition comprises: Determine query character information according to the query condition, determine data column information in the target database based on the query character information, wherein the data storage format of the target database is column storage; and extract the data unit group from the target database according to the data column information.

3. The method according to claim 2, wherein generating an initial data matrix based on the data unit group comprises: Determining data category information corresponding to at least one data unit subgroup in the data unit group; According to the arrangement information of the data column information and the data category information corresponding to the at least one data unit subgroup, the at least one data unit subgroup is spliced to obtain an initial data matrix.

4. The method according to any one of claims 1 to 3, wherein the initial data matrix is updated according to the data unit group and the query condition to obtain a target data matrix, comprising: when the query condition is a multi-level query condition, determining a filter element in the data unit group according to the multi-level query condition, determining filter data corresponding to the filter element, and determining and eliminating target filter elements in the initial data matrix according to the filter data and the multi-level query condition to obtain a target data matrix; and when the query condition is a single-level query condition, determining and eliminating target filter elements in the initial data matrix according to the data unit group and the single-level query condition to obtain a target data matrix.

5. The method according to claim 4, wherein determining the filter data corresponding to the filter element comprises: determining column cache information corresponding to the filter element, and selecting a column data acquisition strategy for the filter element based on the column cache information; When the column data acquisition strategy is a direct column data acquisition strategy, the filtered data corresponding to the filter element is acquired from the column data cache space. When the column data acquisition strategy is a parsed column data acquisition strategy, the filtered data byte information corresponding to the filter element is acquired, and the compressed filtered data corresponding to the filter element is determined based on the filtered data byte information and added to the filtered data cache space. When receiving a request for obtaining the compressed filter data, the compressed filter data is decompressed in the filter data cache space to obtain filter data corresponding to the filter element.

6. The method according to claim 4 or 5, wherein determining target filter elements in the initial data matrix and removing the target filter elements according to the filter data and the multi-level query conditions comprises: Generate a query expression according to the query condition; The filter data is filtered based on the query expression, and target filter elements are selected and eliminated from the initial data matrix according to the filtering result.

7. The method according to claim 6, wherein the target filter element is selected from the initial data matrix according to the screening result. Elements are removed, including: Determine target filtering data according to the screening results, and obtain data row information corresponding to the target filtering data; A target filtering element is selected in the initial data matrix according to the data row information.

8. The method according to any one of claims 1 to 7, wherein obtaining cache information corresponding to a target element in the target data matrix comprises: determining a target element in the target data matrix; Traversing the first data cache space corresponding to the target database according to the target element, and generating cache information corresponding to the target element according to the traversal result.

9. The method according to claim 8, wherein traversing the first data cache space corresponding to the target database according to the target element and generating cache information corresponding to the target element according to the traversal result comprises: calling the block loading component to traverse the first data cache space corresponding to the target database according to the target element, and determining the location information of the target element according to the traversal result; Generate cache information corresponding to the target element based on the location information.

10. The method according to any one of claims 1 to 9, wherein selecting a data acquisition strategy for the target element according to the cache information comprises: In a case where the cache information is a cache hit, determining that the data acquisition strategy for the target element is a direct acquisition strategy; In a case where the cache information indicates a cache miss, determining that the data acquisition strategy for the target element is a parsing acquisition strategy.

11. The method according to claim 10, wherein the data acquisition strategy is the parsing acquisition strategy; acquiring target data corresponding to the target element according to the data acquisition strategy comprises: According to the parsing and acquisition strategy, the read-write component is called to obtain data byte information corresponding to the target element, and the compressed data corresponding to the target element is determined based on the data byte information and added to the second data cache space; when an access request for the compressed data is received, the parsing component is called to decompress the compressed data in the second data cache space to obtain the target data corresponding to the target element.

12. The method according to any one of claims 1 to 11, further comprising: Determining row data units contained in the target database; The row data iteration component is called to logically group the row data units, and logical row data corresponding to each row data sub-unit in the row data unit is determined according to the grouping result, wherein the logical row data is used to construct a data unit group.

13. A data query device, comprising: an extraction module configured to determine a query condition in response to a data query request for a target database, and extract a data unit group from the target database according to the query condition; an updating module configured to generate an initial data matrix based on the data unit group, and update the initial data matrix according to the data unit group and the query condition to obtain a target data matrix; A selection module is configured to obtain cache information corresponding to a target element in the target data matrix, and select a data acquisition strategy for the target element according to the cache information; An acquisition module is configured to acquire target data corresponding to the target element according to the data acquisition strategy as a query result corresponding to the data query request.

14. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 12 are implemented. 18 15. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.

16. A computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method for establishing column memory buffer area for analytical database

    CN117472961A

  • Caching for disk based hybrid transactional analytical processing system

    US20220391394A1

  • Late materialization of queried data in database cache

    WO2023086322A1