Method and device for processing database tasks, hot and cold data
Abstract
Embodiments of this application provide a database task processing method, a hot and cold data processing method, a storage engine, a device, and a storage medium. In the embodiments of this application, a database storage engine is integrated with a machine learning model, involved data samples and used resources in training of the machine learning model are dynamically adjusted by sensing a load pressure of the database storage engine, and through data collection at a storage engine level and a design of a lightweight model, online updating is performed on a model based on a background task. In this way, effectiveness and availability that the database storage engine is integrated with the machine learning model are ensured, and an accuracy rate and a recall rate of a task execution result are improved.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 16 · Forward citations: 0.
Claims (8)
- Claim 1Independent Claim
A method for processing database tasks, applicable to a database storage engine integrated with a machine learning model configured to process a hot-and-cold data identification task in a data layering application scenario, and the database storage engine comprises K layers of persistent storage medium in the data layering application scenario, and the method comprising: monitoring a usage rate of the persistent storage medium for any layer of persistent storage medium in a previous M layers of the persistent storage medium; calling, in response to the usage rate of the persistent storage medium having reached a set usage rate threshold, the machine learning model to perform the hot-and-cold data identification task, and triggering a subsequent action based on a task execution result output by the machine learning model; wherein the triggering the subsequent action based on the task execution result output by the machine learning model comprises: compressing cold data in the persistent
- Claim 2Depends on #1
The method according to claim 1, wherein determining the target resource information and the target sample data available for the current model updating comprises: obtaining current resource usage status information of the database storage engine, wherein the current resource usage status information represents the current load information of the database storage engine; determining the target resource information and training parameters available for the current model updating based on the current resource usage status information, wherein the training parameters at least comprise a quantity of samples; and sampling, based on the quantity of samples, the target sample data from kernel mode data corresponding to the database task.
- Claim 3Depends on #2
The method according to claim 2, wherein determining the target resource information and the training parameters available for the current model updating comprises: determining the target resource information available for the current model updating based on the current resource usage status information; and determining the training parameters available for the current model updating based on the target resource information and a correspondence between a resource amount and the training parameters obtained through pretraining.
- Claim 4Depends on #3
The method according to claim 3, wherein the training parameters further comprise a quantity of threads, a quantity of iterations, and a model hyperparameter; and wherein starting the background task to perform online updating on the machine learning model based on the target resource information and the target sample data comprises: starting threads used for the current model updating based on the target resource information and the quantity of threads, and controlling, based on the target sample data, the quantity of iterations, and the model hyperparameter, the threads to perform online updating on the machine learning model.
- Claim 5Depends on #2
The method according to claim 2, wherein sampling, based on the quantity of samples, the target sample data from the kernel mode data corresponding to the database task comprises: sampling, based on the quantity of samples, access features of N data blocks from a feature table corresponding to the hot-and-cold data identification task, wherein the feature table stores access features of data blocks collected from previous M layers of the persistent storage media; and obtaining static properties of the N data blocks respectively from metadata of the N data blocks, and using the access features and the static properties of the N data blocks as the target sample data, wherein N is a positive integer greater than or equal to 2.
- Claim 6Depends on #5
The method according to claim 5, further comprising: for each data block in the previous M layers of the persistent storage media, collecting an access feature of a data block within a sliding window from the previous M layers of the persistent storage media with the sliding window corresponding to the data block, and storing the access feature of the data block to the feature table.
- Claim 7Depends on #5
The method according to claim 5, wherein calling the machine learning model to perform the hot-and-cold data identification task comprises: calling the machine learning model to perform hot-and-cold data identification on a data block in the persistent storage medium, and outputting a hot-and-cold data identification result.
- Claim 8Independent Claim
A data processing device, running a database storage engine, wherein the database storage engine is integrated with a machine learning model configured to process a hot-and-cold data identification task in a data layering application scenario, and the database storage engine comprises K layers of persistent storage medium in the data layering application scenario, and the data processing device comprises: a memory and one or more processors, wherein the memory is configured to store a computer program corresponding to the database storage engine; and the one or more processors are configured to execute the computer program corresponding to the database storage engine, to perform operations comprising: monitoring a usage rate of the persistent storage medium for any layer of persistent storage medium in a previous M layers of the persistent storage medium; calling, in response to the usage rate of the persistent storage medium having reached a set usage rate threshold, the machine learn
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS This disclosure claims the benefits of priority to PCT Application No. PCT/CN2022/112559, filed on Aug. 15, 2022, which claims the benefits of priority to Chinese Patent Application No. 202110968775.8, filed on Aug. 23, 2021, both of which are incorporated herein by reference in their entireties. TECHNICAL FIELD This disclosure relates to the field of database technologies, and in particular, to methods and devices for processing database tasks. BACKGROUND As a complex system, a database has many parameters from a computing layer to a storage layer. The parameters correspond to many tasks triggered by rules. Although a manner of triggering tasks based on fixed rules is simple to implement, an accuracy rate and a recall rate of task results are low. For example, in some databases, a log structured merge-tree (LSM-Tree) storage structure is used. By using a rule-based hot and cold data identification algorithm, for example, least recently used (LRU) or least frequently used (LFU), an LSM-Tree identifies a hot and cold degree of data, and layering storage (also referred to as tiered storage) is performed on the data based on the hot and cold degree of the data. Although storage costs can be reduced and high performance of the databases can be maintained, hot and cold data identification performed based on rules has a low accuracy rate and recall rate. SUMMARY The disclosed embodiments of the present disclosure provide a method, a device, and a storage medium for processing database tasks, to improve an accuracy rate and a recall rate of a task execution result. Some embodiments of this disclosure provide a method for processing database tasks, applicable to a database storage engine integrated with a machine learning model configured to process a database task, and including: calling, in a case that the database task is triggered, the machine learning model to execute the database task, and triggering a subsequent action based on
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (16)
| Patent | Title | Year | Citations |
|---|---|---|---|
| CN 113,033,824 B | Model hyper-parameter determination method, model training method and system | 2023 | 0 |
Non-Patent Literature (10)
- PCT International Search Report and Written Opinion mailed Oct. 27, 2022, issued in corresponding International Application No. PCT/CN2022/112559 (11 pgs.).
- Liuwang et al.,
- “
- Parallel PRPD analysis and pattern recognition for local discharge big data,
- ”
- Chinese Electrical Engineering Proceedings of the CSEE, vol. 36, No. 5, 21 pages, 2016.
- Xiaochao et al.,
- “
- An energy consumption optimization scheme based on a new energy-driven storage system,
- ”