Data storage and reading
By introducing a second cache pool in the cloud storage system and compressing and storing data, the problem of limited cache pool memory resources is solved, the read and write performance and data search efficiency of the cloud storage system are improved, and storage costs are saved.
Patent Information
- Application Number
- PCT/IB2025/052314
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-29
- Filing Date
- 2025-03-04
- Publication Date
- 2025-10-02
AI Technical Summary
The cache pool memory resources in existing cloud-native databases are limited, which limits the improvement of database performance. How to fully utilize the value of the cache pool to improve read and write performance has become an urgent problem that needs to be solved.
A second cache pool is introduced between the memory of the computing node and the persistent storage medium of the storage node. The data is compressed and stored in the second cache pool, and the location and length information of the data in the cache pool are recorded to improve the data search hit rate and system performance.
By introducing a second cache pool and data compression technology, cache pool resources can be used more effectively, improving the read and write performance and hit rate of the cloud storage system and saving storage costs.
Smart Images

Figure IB2025052314_02102025_PF_FP_ABST
Abstract
Description
[0001] Data storage and reading technology field
[0002]
[0001] The present disclosure relates to the field of cloud computing technology, and more particularly to data storage and reading.
[0003] With the rapid migration of data to the cloud and the explosive growth of user data, cloud-native databases are becoming increasingly popular. Cloud-native databases typically use a storage-computing separation architecture to achieve independent elasticity of computing and storage resources, high service availability, and pay-as-you-go features. To improve the read and write performance of cloud-native databases, the concept of a buffer pool (BP) was introduced.
[0004] The cache pool is a continuous area of memory allocated by the operating system of a compute node to cache frequently accessed data. Data reads are first read from the cache pool, and if not, then read from the storage node. Data writes are first written to the cache pool and then persisted to the storage node. Because memory access speeds are much faster than persistent media such as disks, using a cache pool can significantly improve database read and write performance.
[0005]
[0004] However, the memory resources that the system can allocate to the buffer pool are limited, and the cost of memory resources is relatively high. Therefore, how to give full play to the value of the buffer pool to further improve the performance of the database system has become a technical problem that urgently needs to be solved in the database field.
[0006]
[0005] Various aspects of the present disclosure provide a data storage and reading method, device, system, storage medium, and program product to fully utilize the value of a cache pool and thereby improve the performance of a database system.
[0007]
[0006] An embodiment of the present disclosure provides a data storage method, which is applied to a computing node in a cloud storage system, wherein the cloud storage system includes a first cache pool located in a memory of the computing node, and a second cache pool located between the first cache pool and a persistent storage medium of a storage node in the cloud storage system. The method includes: reading a first data object to be transferred from the first cache pool; compressing the first data object to obtain a first compressed data object; writing the first compressed data object into the second cache pool, and recording the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
[0008]
[0007] An embodiment of the present disclosure also provides a data reading method, which is applied to a computing node in a cloud storage system, wherein the cloud storage system includes a first cache pool located in the memory of the computing node, and a second cache pool located between the first cache pool and the persistent storage medium of the storage node in the cloud storage system. The method includes: receiving a read request, wherein the read request is used to request to read a fourth data object; when the fourth data object is stored in the second cache pool, querying a mapping table in the second cache pool to obtain storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second cache pool; reading the fourth compressed data object from the second cache pool according to the storage location and length information of the fourth compressed data object in the second cache pool; decompressing the fourth compressed data object to obtain the fourth data object and returning it.
[0009]
[0008] An embodiment of the present disclosure also provides a cloud storage system, comprising: a computing node and a storage node, the cloud storage system further comprising a first cache pool located in the memory of the computing node, and a second cache pool located between the first cache pool and the persistent storage medium of the storage node; the computing node is configured to read a first data object to be transferred from the first cache pool; compress the first data object to obtain a first compressed data object; write the first compressed data object into the second cache pool, and record the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
[0010]
[0009] An embodiment of the present disclosure further provides an electronic device, comprising: a memory and a processor; the memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program to implement the steps in the above method.
[0011]
[0010] The embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above method.
[0012]
[0011] The embodiment of the present disclosure also provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the above method embodiment.
[0013]
[0012] In the disclosed embodiments, the introduction of a second cache pool between the first cache pool and the persistent storage medium of the storage node allows more data objects to be located in the cache pool, fully leveraging the read and write performance advantages that the cache pool brings to the cloud storage system. Furthermore, by compressing data and storing it in the second cache pool, more data can be stored using the limited resources of the second cache pool, further improving the hit rate when searching for data in the cache pool, further leveraging the cache pool, improving the performance of the cloud storage system, and saving storage costs. DESCRIPTION OF THE DRAWINGS
[0014]
[0013] The drawings described herein are intended to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are intended to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0015]
[0014] Figures 1a to 1c are schematic structural diagrams of a cloud storage system provided by an exemplary embodiment of the present disclosure;
[0016]
[0015] FIG2 is a schematic diagram of a cloud storage system and its data reading and writing process provided by an exemplary embodiment of the present disclosure;
[0017]
[0016] FIG3 is a flow chart of a data storage method provided by an exemplary embodiment of the present disclosure;
[0018] FIG4 is a flow chart of a data reading method provided by an exemplary embodiment of the present disclosure;
[0019]
[0018] FIG5 is a schematic diagram of the structure of an electronic device provided by another exemplary embodiment of the present disclosure.
[0020] To make the objectives, technical solutions, and advantages of the present disclosure more clearly apparent, the technical solutions of the present disclosure will be described clearly and completely below in conjunction with specific embodiments of the present disclosure and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present disclosure, and are not all of the embodiments. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present disclosure without creative effort are within the scope of protection of the present disclosure.
[0021]
[0020] 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, storage, and display) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of relevant data must comply with relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or reject. In addition, the various models involved in this disclosure (including but not limited to language models or large models) comply with relevant laws and standards.
[0022]
[0021] In response to the technical problem of low performance of existing database systems, the embodiments of the present disclosure provide a solution. The basic idea is: introducing a second cache pool between the first cache pool and the persistent storage medium of the storage node can allow more data objects to be located in the cache pool, giving full play to the read and write performance advantages that the cache pool brings to the cloud storage system; further, by compressing the data and storing it in the second cache pool, more data can be stored using the limited resources of the second cache pool, further improving the hit rate when searching for data from the cache pool, further giving full play to the role of the cache pool, improving the performance of the cloud storage system, and saving storage costs.
[0023]
[0022] The following describes in detail the technical solutions provided by various embodiments of the present disclosure in conjunction with the accompanying drawings.
[0024]
[0023] FIG1a is a schematic diagram of the structure of a cloud storage system provided by an exemplary embodiment of the present disclosure. As shown in FIG1a, the system 100 includes: a computing layer and a storage layer, wherein the computing layer includes at least one computing node 101, and the storage layer includes at least one storage node 102. The computing node 101 includes a memory and a persistent storage medium, and the storage node 102 includes a memory and a persistent storage medium. Whether it is a computing node 101 or a storage node 102, the memory is used to store data that is being used by the CPU, commonly used data, or data with high popularity, and is usually implemented using a storage medium with high read / write performance, such as DRAM (Dynamic Random Access Memory), SRAM, etc.
[0025] Static Random-Access Memory (SRAM). For both compute node 101 and storage node 102, persistent storage media is used to persistently store data. These media can be implemented using relatively low-performance and low-cost storage media, such as SSDs (Solid State Disks) and HDDs (Hard Disk Drives). From a storage technology perspective, storage node 102 can be, but is not limited to, cloud disks and object-based storage systems (OSS). Compared to the local persistent storage media of compute node 101, the persistent storage media of storage node 102 offers large capacity and elastic scalability, making it the primary storage medium used for persistent data storage in cloud storage systems.
[0026] Furthermore, the cloud storage system 100 provided in this embodiment also includes a first cache pool located in the memory of the computing node 101, and a second cache pool located between the first cache pool and the persistent storage medium of the storage node 102. The cloud storage system provided in this embodiment introduces the concept of a two-level cache pool for the first time. This two-level cache pool allows more data to be stored in the cache pools, fully leveraging the read and write performance advantages that the cache pools bring to the cloud storage system. The first cache pool is a first-level cache pool, located directly in the memory of the computing node 101 and closest to the CPU of the computing node 101. This allows the CPU to more quickly and conveniently read and write data in the first cache pool. In contrast, the second cache pool is a second-level cache pool. It is closer to the CPU of the computing node 101 than to the persistent storage medium on the cloud storage node 102, making it relatively convenient for the CPU of the computing node 101 to read and write data in the second cache pool.
[0027] It should be noted that the second cache pool is closer to the CPU of the computing node 101 relative to the persistent storage medium of the storage node 102, but the embodiment of the present disclosure does not limit the location of the second cache pool. Optionally, as shown in FIG1a, the second cache pool may be located in the memory of the computing node 101; or, as shown in FIG1b, the second cache pool may be located in the persistent storage medium of the computing node 101; or, the second cache pool may be located in the memory of a remote node. The term "remote node" refers to a specific computing node 101. For a specific computing node 101, the remote node may be a node other than the computing node 101 in the cloud storage system, such as another computing node 101 or any storage node 102, or a memory node based on Compute eXpress Link (a high-speed interconnect technology) in the cloud storage system. In one example, as shown in FIG1c, the remote node may be any storage node 102 in the cloud storage system, and the second cache pool may be located in the memory of the storage node 102.
[0028] In this embodiment, the cloud storage system provides storage services to clients, and the computing nodes can receive read or write requests from clients. Regarding the situation of receiving a read request, please refer to the description in the subsequent embodiments. When a write request is received, the data to be written is written to the first cache pool, a redo log is generated, and the redo log is persisted to the log space, thus completing the data write operation. The log space can be storage space in the local persistent storage medium of the computing node or storage space in the persistent storage medium of the storage node. Furthermore, if the computing node is relatively idle or the amount of data in the first cache pool is large, the data in the first cache pool can be transferred to the persistent storage medium of the storage node.
[0029] However, when a second buffer pool is introduced in the embodiments of the present disclosure, the computing node can preferentially transfer data from the first buffer pool to the second buffer pool. Leveraging the second buffer pool's proximity to the computing node's CPU, this improves both data transfer efficiency and data read efficiency. Furthermore, to increase the amount of data stored in the second buffer pool and fully leverage its advantages, data can be compressed before being stored in the second buffer pool. Based on this, the computing node in this embodiment is further configured to read a first data object to be transferred from the first buffer pool; compress the first data object to obtain a first compressed data object; write the first compressed data object to the second buffer pool; and record the storage location and length information of the first compressed data object in the second buffer pool in a mapping table in the second buffer pool, so that the first compressed data object can be read. For ease of description and distinction, the result of compressing a data object is called a compressed data object. For example, the compression result corresponding to the first data object is called a first compressed data object, the compression result corresponding to the second data object is called a second compressed data object, the compression result corresponding to the third data object is called a third compressed data object, and so on.
[0030] In the disclosed embodiments, the number of second cache pools in the cloud storage system is not limited and may include multiple second cache pools. Furthermore, the distribution of the multiple second cache pools is also not limited and may be distributed entirely in the memory of each storage node, partially in the memory of a computing node, or partially in a local persistent storage medium of the computing node. Therefore, when writing a first compressed data object to a second cache pool, the computing node may prioritize a second cache pool that is relatively close, has more remaining storage space, or has relatively high read / write performance, and then write the first compressed data object to the second cache pool. For example, if a second cache pool exists in the local memory of a computing node, the second cache pool in the local memory may be preferentially selected. If the second cache pool does not exist in the local memory of the computing node but exists in the local persistent storage medium, the second cache pool in the local persistent storage medium may be preferentially selected. If the second cache pool does not exist in either the local memory or the local persistent storage medium of the computing node, the second cache pool in the memory of a relatively nearby storage node or another computing node may be selected. Furthermore, if there are multiple relatively nearby second cache pools, the second cache pool with more remaining storage space may be selected, without limitation. Furthermore, the computing node may pre-maintain information related to the second cache pools in the cloud storage system, such as the number of second cache pools in the cloud storage system, the location of each second cache pool, and the capacity of each second cache pool. Furthermore, the remaining capacity of each second cache pool may be obtained through mutual interaction. Of course, the cloud storage system may also include a control node, which is responsible for maintaining information related to the second cache pools in the cloud storage system. The computing node may query the control node for required second cache pool information, without limitation to the query method.
[0031]
[0029] In the embodiment of the present disclosure, the first buffer pool can be specifically implemented as a BP (Buffer Pool), which is located in the memory of the computing node. For example, in a relational database system, the BP is used as a memory cache layer between the transaction manager and the persistent storage medium, and can cache data pages or index pages in units of pages.
[0032] The page size can be, for example, 16KB, 32KB, or 48KB. The data in the data page is typically table data in a database table, and is used to record index information on the index page. The second cache pool can be specifically implemented as an L2C (Level-2 Cache), located between the first cache pool and the persistent storage medium of the storage node. Pages in the L2C are stored in compressed form. In the disclosed embodiments, the capacity of the first and second buffer pools is not limited, nor is the relationship between the two capacities. Optionally, the second cache pool can have a larger capacity than the first cache pool. A larger L2 cache can store more data, thereby improving cache hit rates. In the disclosed embodiments, the first data object can be one or more, and can be various pages in the first cache pool, such as data pages (including dirty and clean pages), index pages, and redo logs in memory.
[0033] In the disclosed embodiments, data compression can be performed by the CPU of the computing node or by an additional hardware compression module. In an optional embodiment, a hardware compression module is deployed on the computing node, and the first data object can be provided to the hardware compression module, so that the hardware compression module compresses the first data object to obtain a first compressed data object. Hardware compression is more efficient, can reduce the delay consumed by data compression, and further reduce the storage delay introduced by data compression, and does not require CPU participation. The compression module can be a hardware module with data compression function implemented based on programmable hardware such as an FPGA (Field Programmable Gate Array) or a CPLD (Complex Programming Logic Device), or can be implemented using an ASIC (Application Specific Integrated Circuit), without limitation. Accordingly, the embodiments of the present disclosure do not limit the compression algorithm. For example, Deflate (a lossless data compression algorithm) or LZMA (Lempel-Ziv-Markov chain algorithm) may be used. The compression algorithm may be flexibly selected based on multiple factors such as computational complexity, compression delay, and compression cost.
[0034]
[0031] In another optional embodiment, data compression is performed by the CPU of the computing node. Specifically, software compression can be performed using threads. Alternatively, data compression can be performed using a single thread. Alternatively, multiple threads can be used to perform concurrent compression, thereby increasing the compression speed. These threads can be created in advance and stored in a dedicated thread pool for reuse.
[0035]
[0032] In this embodiment, when the first compressed data object is written into the second buffer pool, the identification information of the first data object is also recorded, so that when querying, the storage position and length information of the first compressed data object can be queried in the mapping table based on the identification information. That is, the mapping table stores the identification information of the first data object, the storage position of the first compressed data object corresponding to the first data object in the second buffer pool, and the length information of the first compressed data object. It is noted here that the length of each compressed data object is not fixed, that is, each compressed data object is of non-fixed length. Therefore, in order to successfully read each compressed data object, not only its storage position but also its length information is stored in the mapping table. The storage position here mainly refers to the starting storage position of the compressed data object in the second buffer pool.
[0036]
[0033] In the embodiment of the present disclosure, the introduction of a second cache pool between the first cache pool and the persistent storage medium of the storage node can allow more data objects to be located in the cache pool, giving full play to the read and write performance advantages that the cache pool brings to the cloud storage system; further, by compressing the data and storing it in the second cache pool, more data can be stored with limited second cache pool resources, further improving the hit rate when searching for data from the cache pool, further giving full play to the role of the cache pool, improving the performance of the cloud storage system, and saving storage costs.
[0037] In an optional embodiment, when a computing node writes a first compressed data object into the second cache pool, the method includes: temporarily storing the first compressed data object in a data cache area; and when the number of compressed data objects in the data cache area reaches a predetermined first data threshold, writing the compressed data objects in the data cache area in batches to the second cache pool; wherein the data cache area is a portion of the computing node's memory. This method is applicable to situations where the second cache pool is deployed in any location. This method uses the data cache area to temporarily store data, and then writes the compressed data objects in batches to the second cache pool when the number of compressed data objects in the data cache area reaches a predetermined threshold. Compared to a data transfer method in which data is written to the second cache pool once each compressed data object is generated, the number of I / O (Input / Output) operations can be significantly reduced. It should be noted that the disclosed embodiments also support a data transfer method in which data is written to the second cache pool once each compressed data object is generated.
[0038] In another alternative embodiment, when the second cache pool is implemented in the memory of a computing node, the data cache area can be implemented as a sliding window in the second cache pool. Specifically, the second cache pool is divided into sliding windows, each of which serves as the data cache area mentioned in the above embodiment. In this way, data can be directly written into the sliding window in the second cache pool each time it is temporarily stored. When a sliding window is full, the next sliding window is written to. Because the sliding window itself serves as storage space in the second cache pool, batch write operations from the data cache area to the second cache pool can be saved. The sliding window is a dynamic window that can be moved to continuously write compressed data objects. This process can reduce the overhead of write operations from the data cache area to the second cache pool.
[0039]
[0036] Optionally, the computing node can monitor whether a first data transfer condition corresponding to the first cache pool is met. If the first data transfer condition is met, the computing node reads a first data object to be transferred from the first cache pool, compresses the first data object to obtain a first compressed data object, and writes the first compressed data object to the second cache pool. The first data transfer condition includes at least one of the following: the computing node's CPU utilization is greater than a set first utilization threshold, the amount of data in the first cache pool is greater than a set second data threshold, and a persistence operation is triggered based on log space recovery. In this embodiment, data objects in the first cache pool are transferred based on the first data transfer condition, rather than frequently or in real time. This leverages the advantages of the second cache pool while also saving resources consumed by data transfer.
[0040] In this embodiment, when the amount of data in the first cache pool exceeds a set second data threshold, a data transfer operation is triggered. In this case, data can be transferred to the second cache pool first rather than directly to the persistent storage medium of the storage node, which is beneficial for improving transfer efficiency. Furthermore, when the CPU utilization of the computing node exceeds the set first utilization threshold, it means that the CPU of the computing node is in a high load state. At this time, transferring data to the persistent storage medium of the storage node would be relatively time-consuming. Therefore, transferring data to the second cache pool is preferred.
[0041] In the cloud storage system of this embodiment, a Write Ahead Log (WAL) strategy is employed to prevent data loss caused by downtime. Specifically, redo logs are written to disk before transactions are committed. This mechanism ensures that even if a system crash occurs before data has been written to disk, all committed transactions can still be recovered using the redo logs, thereby ensuring data integrity and consistency. The redo logs are stored in a persistent log space, which is also limited in size. To conserve log space, data objects in the compute node's memory can be periodically persisted to the storage node's persistent storage medium. In the disclosed embodiment, the persistence operation triggered by reclaiming log space is referred to as a checkpoint. A checkpoint is used to periodically write data objects in memory to the storage node's persistent storage medium. After the data objects are written to the storage node's persistent storage medium, the associated log records can be deleted, thereby reclaiming log space and preventing unlimited log space growth.
[0042] It should be noted that, in this embodiment, when the first data transfer condition triggers a persistence operation based on log space recovery, this means that the data in the first buffer pool needs to be periodically transferred to another location, such as the persistent storage medium of a storage node. However, this is not limiting. In this embodiment, because a second buffer pool has been added, data can be transferred to the second buffer pool first. The data transferred in the first buffer pool can be dirty pages or clean pages, which is not limited in this embodiment. In other words, when a checkpoint is triggered, it means that the data objects in the first buffer pool need to be persistently stored. The first data object to be transferred can be read from the first buffer pool, compressed to obtain a first compressed data object, and written to the second buffer pool. Furthermore, the second data transfer condition corresponding to the second buffer pool can be met to transfer the first compressed data object from the second buffer pool to the persistent storage medium of the storage node.
[0043] In an embodiment of the present disclosure, when transferring a first data object from a first cache pool to a second cache pool, some data objects may be selected from the first cache pool as the first data objects. The embodiment of the present disclosure does not limit the method for selecting the first data objects. Optionally, pages in the first cache pool may be divided into three levels: hot, warm, and cold, based on their access frequency. Hot pages represent pages with a very high access frequency and may be frequently requested; warm pages represent pages with a moderate access frequency; and cold pages represent pages with a low access frequency. Optionally, when a page is warm, it is compressed and transferred to the second cache pool. Hot pages may be retained in the first cache pool. Cold pages may be compressed and transferred to the second cache pool when the CPU of the computing node is relatively busy. When the CPU is relatively idle, cold pages may be directly transferred to the persistent storage medium of the storage node.
[0044] In an optional embodiment, in addition to preferentially compressing the data objects in the first cache pool and then transferring them to the second cache pool, in some special cases, the data objects in the first cache pool may also be directly transferred to the persistent storage medium of the storage node. For example, when the CPU utilization of the computing node is less than the set second utilization threshold,
[0045] (Indicating that the CPU is relatively idle), or when a specific data object appears in the first cache pool, a second data object to be transferred from the first cache pool can be read and written to the persistent storage medium of the storage node. When the specific data object appears in the first cache pool, the second data object includes the specific data object. The specific data object is a data object that requires timely and persistent storage, such as a data object that will be deleted soon, such as a temporary page, or a very important data object, such as a system page.
[0046] In an optional embodiment, the computing node is further configured to transfer the compressed data objects in the second cache pool to the persistent storage medium of the storage node to free up storage space in the second cache pool. Based on this, the computing node can read a third compressed data object to be transferred from the second cache pool, where the third compressed data object is any compressed data object; persistently store the third compressed data object in the persistent storage medium of the storage node; or decompress the third compressed data object into a third data object and then persistently store the third compressed data object in the persistent storage medium of the storage node.
[0047] When transferring the third compressed data objects in the second cache pool to the persistent storage medium of the storage node, some compressed data objects may be selected from the second cache pool as the third compressed data objects. The disclosed embodiment does not limit the method for selecting the third compressed data objects. Optionally, the compressed data objects in the second cache pool may be classified into two levels, hot and cold, based on their access frequency. Hot compressed data objects represent compressed data objects with relatively high access frequency and are suitable for retention in the second cache pool; cold compressed data objects represent compressed data objects with relatively low access frequency and may be preferentially transferred to the persistent storage medium of the storage node.
[0048]
[0044] Further optionally, the computing node may monitor whether a second data transfer condition corresponding to the second cache pool is met. If the second data transfer condition is met, the computing node may read the third compressed data object to be transferred from the second cache pool; then persistently store the third compressed data object in the persistent storage medium of the storage node, or decompress the third compressed data object into a third data object and then persistently store it in the persistent storage medium of the storage node. The second data transfer condition includes at least one of the following: the computing node's CPU utilization is less than a set third utilization threshold, the amount of data in the second cache pool is greater than a set third data threshold, and a persistence operation is triggered based on log space recycling.
[0045] In this embodiment, when the computing node's CPU utilization is less than the set third utilization threshold, it means that the CPU is currently idle and has more computing resources available for processing other tasks, such as data flushing. In this case, the compressed data object in the second cache pool may be transferred to the persistent storage medium of the storage node. When the amount of data in the second cache pool exceeds a set third data threshold, indicating that the second cache pool is relatively full, a data flush is required, regardless of whether the CPU is busy or not. At this time, the compressed data objects in the second cache pool need to be transferred to the storage node's persistent storage medium. Furthermore, when a persistence operation is triggered based on log space reclamation, a data flush is also required to reclaim log space. In this case, data objects in the first cache pool can be compressed and transferred to the second cache pool. At the same time, the compressed data objects in the second cache pool can also be transferred to the storage node's persistent storage medium.
[0049]
[0046] It should be noted that, in this embodiment, when the second data transfer condition triggers a persistence operation based on log space recovery, the data in the second buffer pool is flushed to disk. This may be done directly or after decompression, and this is not limited in this embodiment. Similarly, the data objects flushed to disk from the second buffer pool may be dirty pages or clean pages, and this is not limited in this embodiment.
[0050]
[0047] It should be noted that in the embodiment of the present disclosure, the second and third utilization thresholds are smaller than the first utilization threshold, and there is no size restriction between the second and third utilization thresholds. The first, second, and third data thresholds are not differentiated by size, but are merely for convenience of distinction.
[0051]
[0048] In an optional embodiment, the computing node is further used to: when the second cache pool adopts append writing, when the garbage collection triggering condition is met, perform a garbage collection operation on the second cache pool, wherein the embodiment of the present disclosure does not limit the triggering condition of garbage collection, for example, garbage collection may be triggered periodically, or when there are many fragments in the cache pool, or when the usage of the cache pool reaches a set usage upper limit, etc. The garbage collection triggering condition can be flexibly set according to application requirements.
[0052]
[0049] The above embodiments focus on describing how computing nodes store data, and the following embodiments will describe in detail how computing nodes read data.
[0053]
[0050] In an optional embodiment, the computing node is further used to receive a read request, which is used to request to read a fourth data object; when the fourth data object is stored in the second cache pool, query the mapping table to obtain the storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second cache pool; read the fourth compressed data object from the second cache pool based on the storage location and length information of the fourth compressed data object in the second cache pool; decompress the fourth compressed data object to obtain the fourth data object and return it.
[0054] In this embodiment, after receiving the read request, the computing node first determines whether the fourth data object is stored in the fastest cache (the first cache pool). If the fourth data object is stored in the first cache pool, it is directly read and returned. If the fourth data object is not stored in the first cache pool, the search continues in the second cache pool. Furthermore, if the fourth data object is not found in the second cache pool, the computing node begins searching the storage node. Optionally, the computing node may also maintain metadata information for the data object. The metadata information records the storage location of the data object. By querying the metadata information, the user's storage location can be determined. The metadata information needs to be persistently stored. Preferably, the metadata information can be stored in the computing node's local persistent storage medium. Alternatively, the metadata information can be stored in the persistent storage medium of a designated storage node, although this is not limited in the present embodiment. In actual use, the metadata information can also reside in the computing node's memory to facilitate quick query.
[0055] Based on this, the computing node is further configured to, if the database instance to which the fourth data object belongs has the two-level cache pool function enabled, identify whether the fourth data object is stored in the second cache pool; and, if the database instance to which the fourth data object belongs does not have the two-level cache pool function enabled, identify whether the fourth data object is stored in the first cache pool or in a persistent storage medium of a storage node. In this case, the computing node first queries whether the fourth data object is stored in the first cache pool. If not, the computing node further queries the storage node. In an optional embodiment, when the computing node queries the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object corresponding to the fourth data object in the second cache pool, the computing node may, if the database instance to which the fourth data object belongs has the data compression function enabled, query the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object in the second cache pool.
[0056] In this embodiment, based on the storage location and length information of the fourth compressed data object in the second buffer pool, the fourth compressed data object is read from the second buffer pool. Furthermore, the fourth compressed data object is decompressed to obtain and return a fourth data object. The disclosed embodiments do not limit the decompression method; the decompression process may be performed by the CPU of the computing node or by an additional hardware compression module. When decompressing the data using the hardware compression module, the fourth compressed data object is provided to the hardware compression module, which decompresses the fourth compressed data object to obtain the fourth data object. For details on the selection of the hardware compression module, see the previous embodiment and will not be elaborated upon here.
[0057]
[0054] In an optional embodiment, the computing node is further configured to query a mapping table in the second cache pool to obtain storage location and length information of the fourth data object in the second cache pool when the database instance to which the fourth data object belongs does not have a data compression function enabled; and read the fourth data object from the second cache pool based on the storage location and length information of the fourth data object in the second cache pool and return it.
[0058] In some embodiments of the present disclosure, the cloud storage system enables the two-level cache pool function by default, and enables the data compression function for the second cache pool, but the present invention is not limited to this. In some of the following embodiments, the two-level cache function and the data compression function of the second cache pool are implemented as pluggable functional modules, allowing users to enable or disable them as needed, providing greater flexibility and scalability. The users in this case can be either cloud storage system operators or cloud storage system users, without limitation.
[0059]
[0056] Based on this, the computing node is further used to: respond to a first configuration operation on the two-level cache pool function, pre-enable / disable the two-level cache pool function for the first database instance; and / or respond to a second configuration operation on the data compression function, enable / disable the data compression function for the second database instance.
[0060]
[0057] It should be noted that the first and second database instances may be the same or different; the first and second database instances may be all database instances or part of the database instances.
[0061]
[0058] The selection of the first and second database instances can be made based on user level, database instance type, importance, current operating status, and the like. For example, for database instances with high-value users (e.g., VIP users), the two-level cache pool function can be enabled to reduce database access latency and improve response speed. For another example, for database instances involving a large number of read and write operations and requiring high real-time performance, the two-level cache pool function can also be enabled to improve processing speed. For another example, for database instances containing critical data, the two-level cache pool function can also be enabled to provide faster access speed. Furthermore, the data compression function can be enabled for these database instances to store more data using the limited resources of the second cache pool, further improving the hit rate when searching for data in the cache pool, further leveraging the cache pool, improving the performance of the cloud storage system, and saving storage costs.
[0062] In another example, the first and second database instances can be selected based on the data types included in the database instance. For example, if the database instance contains a large amount of text data, since text data is relatively easy to compress, the two-level buffer pool function and the data compression function can be enabled for the database instance. It should be noted that although pictures and videos are rarely stored in the database, the two-level buffer pool function and the data compression function are also applicable to pictures and videos.
[0063]
[0060] Based on the above, before compressing the first data object, the computing node further includes: determining whether the database instance to which the first data object belongs has enabled the two-level cache pool function and the data compression function; if both functions are enabled, compressing the first data object to obtain a first compressed data object, writing the first compressed data object into the second cache pool, and recording the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
[0064]
[0061] Optionally, if the two-level cache pool function is not enabled, meaning the second cache pool cannot be used for data storage, the compute node can write the first data object to the persistent storage medium of the storage node. If the two-level cache pool function is enabled but the data compression function is not enabled, the compute node cannot compress the first data object, but can use the second cache pool for data storage. Therefore, the compute node can directly write the first data object to the second cache pool and record the storage location and length of the first data object in the second cache pool in a mapping table for easy access. In this application, the second cache pool supports storage of both compressed and uncompressed data objects.
[0065] FIG2 is a schematic diagram of a cloud storage system and its data reading and writing process provided by an exemplary embodiment of the present disclosure. As shown in FIG2 , the cloud storage system includes: at least one computing node and at least one storage node; a first cache pool located in the DRAM (Dynamic Random Access Memory) of the computing node; and a second cache pool located between the first cache pool and the persistent storage medium of the storage node. The computing node includes DRAM and the persistent storage medium, and the storage node includes at least the persistent storage medium.
[0066]
[0063] It should be noted that FIG2 only illustrates the first cache pool in the DRAM of a computing node, the second cache pool in the DRAM of the computing node, and the persistent storage medium of the storage node. This does not mean that this embodiment can only include one computing node or one storage node. FIG2 uses one computing node and one storage node to conveniently illustrate the process of reading and writing data in the cloud storage system. The process of reading and writing data between other computing nodes and storage nodes can be analogous to this process.
[0067]
[0064] In this embodiment, the computing node is used to read a first data object to be transferred from a first cache pool; compress the first data object to obtain a first compressed data object; write the first compressed data object into a second cache pool, and record the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
[0068]
[0065] As shown in FIG2 , there are two paths when transferring data objects from the first buffer pool.
[0069] Path 1 (as shown in FIG. 2 , step ①): When a first data transfer condition is met, a first data object to be transferred is read from the first buffer pool. Furthermore, the first data object is compressed to obtain a first compressed data object. The first compressed data object is written to the second buffer pool. During the writing process, the first compressed data object is temporarily stored in a data buffer area. When the number of compressed data objects in the data buffer area reaches a predetermined first data threshold, the compressed data objects in the data buffer area are batch-written to the second buffer pool. The data buffer area is a portion of the DRAM of the computing node.
[0070]
[0067] Path 2 (as shown in step 5 in Figure 2): When the CPU utilization of the computing node is less than a set second utilization threshold, or when a specific data object appears in the first cache pool, read the second data object to be transferred in the first cache pool; write the second data object directly into the persistent storage medium of the storage node, wherein, when the specific data object appears in the first cache pool, the second data object includes the specific data object.
[0071]
[0068] As shown in ④ in Figure 2, the data objects in the second cache will also be transferred. For example, when the second data transfer condition is met, the third compressed data object to be transferred is read from the second cache pool; the third compressed data object is persistently stored in the persistent storage medium of the storage node, or the third compressed data object is decompressed into a third data object and then persistently stored in the persistent storage medium of the storage node.
[0072]
[0069] For the specific contents of the first data transfer condition and the second data transfer condition, please refer to the aforementioned embodiment and will not be described in detail here.
[0073]
[0070] It should be noted that the “eviction” in FIG2 is synonymous with the “dumping” described in the embodiment of the present disclosure.
[0074]
[0071] As shown in Figure 2, the computing node receives a read request, which is used to request to read the fourth data object; as shown in ③ in Figure 2, when the fourth data object is stored in the second cache pool, the mapping table is queried to obtain the storage position and length information of the fourth compressed data object corresponding to the fourth data object in the second cache pool; according to the storage position and length information of the fourth compressed data object in the second cache pool, the fourth compressed data object is read from the second cache pool; the fourth compressed data object is decompressed to obtain the fourth data object and return it.
[0075]
[0072] In FIG. 2 , there is a special case, as shown in ② in FIG. 2 , that is, the number of compressed data objects in the data cache area has not yet reached the set first data threshold, so these compressed data objects have not yet been written into the second cache pool in batches. In this case, when the data object to be searched is located in the data cache area, data can also be read directly from the data cache area.
[0076]
[0073] As shown in ⑥ in FIG. 2 , the computing node may also directly read data from the persistent storage medium of the storage node.
[0077]
[0074] Figure 3 shows a data storage method provided by an exemplary embodiment of the present disclosure, which is applied to a computing node in a cloud storage system. The cloud storage system includes a first cache pool located in the memory of the computing node, and a second cache pool located between the first cache pool and a persistent storage medium of a storage node in the cloud storage system. The method includes the following steps.
[0078]
[0075] S301: Read the first data object to be transferred in the first buffer pool.
[0079]
[0076] S302: Compress the first data object to obtain a first compressed data object.
[0080]
[0077] S303: Write the first compressed data object into the second buffer pool, and record the storage location and length information of the first compressed data object in the second buffer pool in a mapping table in the second buffer pool for reading the first compressed data object.
[0081]
[0078] In an optional embodiment, the second cache pool is located in the memory of the computing node; or, the second cache pool is located in the persistent storage medium of the computing node; or, the second cache pool is located in the memory of a remote node, and the remote node is a node other than the computing node in the cloud storage system.
[0082]
[0079] In an optional embodiment, when compressing the first data object to obtain the first compressed data object, it includes: providing the first data object to a hardware compression module, so that the hardware compression module compresses the first data object to obtain the first compressed data object; and receiving the first compressed data object output by the hardware compression module.
[0083]
[0080] In an optional embodiment, when writing the first compressed data object into the second cache pool, it includes: temporarily storing the first compressed data object in the data cache area, and when the number of compressed data objects in the data cache area reaches a set first data threshold, writing the compressed data objects in the data cache area into the second cache pool in batches; wherein the data cache area is a partial area in the memory of the computing node.
[0084]
[0081] In an optional embodiment, when the second cache pool is implemented in the memory of the computing node, the data cache area is implemented as a sliding window in the second cache pool to save batch write operations from the data cache area to the second cache pool.
[0085]
[0082] In an optional embodiment, when reading the first data object to be transferred in the first cache pool, it includes: when a first data transfer condition is met, reading the first data object to be transferred from the first cache pool; wherein the first data transfer condition includes at least one of the following: the CPU utilization of the computing node is greater than a set first utilization threshold, the amount of data in the first cache pool is greater than a set second data threshold, and a persistence operation is triggered based on the recovery of log space.
[0086]
[0083] In an optional embodiment, the method further includes: when the CPU utilization of the computing node is less than a set second utilization threshold, or when a specific data object appears in the first cache pool, reading the second data object to be transferred in the first cache pool; writing the second data object to the persistent storage medium of the storage node, wherein, when the specific data object appears in the first cache pool, the second data object includes the specific data object.
[0087]
[0084] In an optional embodiment, the method further includes: reading a third compressed data object to be transferred from the second cache pool, where the third compressed data object is any compressed data object; and persistently storing the third compressed data object in a persistent storage medium of the storage node, or, decompressing the third compressed data object into a third data object and then persistently storing the third compressed data object in a persistent storage medium of the storage node.
[0085] In an optional embodiment, when reading the third compressed data object to be transferred from the second cache pool, the method further includes: reading the third compressed data object to be transferred from the second cache pool when a second data transfer condition is met; wherein the second data transfer condition includes at least one of the following: a CPU utilization rate of the computing node is less than a set third utilization rate threshold, an amount of data in the second cache pool is greater than a set third data threshold, and a persistence operation is triggered based on reclaiming log space.
[0088]
[0086] In an optional embodiment, the method further includes: receiving a read request, the read request being used to request reading a fourth data object; when the fourth data object is stored in the second cache pool, querying the mapping table to obtain the storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second cache pool; reading the fourth compressed data object from the second cache pool based on the storage location and length information of the fourth compressed data object in the second cache pool; decompressing the fourth compressed data object to obtain the fourth data object and returning it.
[0089]
[0087] In an optional embodiment, the method also includes performing at least one of the following operations: performing a garbage collection operation on the second cache pool when a garbage collection trigger condition is met; in response to a first configuration operation on the two-level cache pool function, pre-enabling / disabling the two-level cache pool function for the first database instance; and in response to a second configuration operation on the data compression function, enabling / disabling the data compression function for the second database instance.
[0090]
[0088] In an optional embodiment, before compressing the first data object, the method further includes: determining whether the database instance to which the first data object belongs has enabled a two-level cache function and a data compression function; if both are enabled, compressing the first data object to obtain a first compressed data object.
[0091]
[0089] In an optional embodiment, the method further includes: when the two-level cache pool function is not started, writing the first data object into the persistent storage medium of the storage node; when the two-level cache pool function is enabled but the data compression function is not enabled, writing the first data object into the second cache pool, and recording the storage location and length information of the first data object in the second cache pool in a mapping table for reading the first data object.
[0092]
[0090] Figure 4 shows a data reading method provided by an embodiment of the present disclosure, which is applied to a computing node in a cloud storage system. The cloud storage system includes a first cache pool located in the memory of the computing node, and a second cache pool located between the first cache pool and the persistent storage medium of the storage node in the cloud storage system. The method includes the following steps.
[0093]
[0091] S401: Receive a read request, where the read request is used to request to read a fourth data object.
[0094]
[0092] S402: When the fourth data object is stored in the second buffer pool, query the mapping table in the second buffer pool to obtain the storage location and length information of the fourth compressed data object corresponding to the fourth data object in the second buffer pool.
[0095]
[0093] S403: Read the fourth compressed data object from the second buffer pool according to the storage position and length information of the fourth compressed data object in the second buffer.
[0096]
[0094] S404: Decompress the fourth compressed data object to obtain a fourth data object and return it.
[0097]
[0095] In an optional embodiment, the method further includes: when the database instance to which the fourth data object belongs has the two-level cache pool function enabled, identifying whether the fourth data object is stored in the second cache pool; when the database instance to which the fourth data object belongs does not have the two-level cache pool function enabled, identifying whether the fourth data object is stored in the first cache pool or the persistent storage medium of the storage node.
[0098]
[0096] In an optional embodiment, querying the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object corresponding to the fourth data object in the second cache pool includes: when the database instance to which the fourth data object belongs has a data compression function enabled, querying the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object in the second cache pool.
[0099]
[0097] In an optional embodiment, the method further includes: when the database instance to which the fourth data object belongs does not have a data compression function enabled, querying a mapping table in the second cache pool to obtain the storage location and length information of the fourth data object in the second cache pool; and reading the fourth data object from the second cache pool and returning it based on the storage location and length information of the fourth data object in the second cache pool.
[0100]
[0098] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0101] It should be noted that the execution entity of each step of the method provided in the above embodiment may be the same device, or the method may be executed by different devices. For example, the execution entity of steps 401 to 403 may be device A; for another example, the execution entity of steps 401 and 402 may be device A, and the execution entity of step 403 may be device B; and so on.
[0102]
[0100] In addition, some of the processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be understood that these operations may not be executed in the order in which they appear herein or may be executed in parallel. Operation sequence numbers, such as 401 and 402, are merely used to distinguish between different operations and do not represent any specific order of execution. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that terms such as "first" and "second" herein are used to distinguish between different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0103]
[0101] FIG5 is a schematic diagram of the structure of an electronic device provided by another exemplary embodiment of the present disclosure. As shown in FIG5, the electronic device includes: a memory 54 and a processor 55.
[0104] The memory 54 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc.
[0105]
[0103] The memory 54 can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0106]
[0104] The processor 55 is coupled to the memory 54 and is configured to execute a computer program in the memory 54, so as to: read a first data object to be transferred from the first cache pool; compress the first data object to obtain a first compressed data object; write the first compressed data object into the second cache pool, and record the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
[0107]
[0105] In an optional embodiment, the second cache pool is located in the memory of the computing node; or, the second cache pool is located in the persistent storage medium of the computing node; or, the second cache pool is located in the memory of a remote node, and the remote node is a node other than the computing node in the cloud storage system.
[0108]
[0106] In an optional embodiment, when the processor 55 compresses the first data object to obtain a first compressed data object, it is specifically used to: provide the first data object to a hardware compression module so that the hardware compression module compresses the first data object to obtain a first compressed data object; and receive the first compressed data object output by the hardware compression module.
[0109]
[0107] In an optional embodiment, when the processor 55 writes the first compressed data object into the second cache pool, it is specifically used to: temporarily store the first compressed data object in a data cache area, and when the number of compressed data objects in the data cache area reaches a set first data threshold, batch write the compressed data objects in the data cache area into the second cache pool; wherein the data cache area is a partial area in the memory of the computing node.
[0110]
[0108] In an optional embodiment, when the second cache pool is implemented in the memory of the computing node, the data cache area is implemented as a sliding window in the second cache pool to save batch write operations from the data cache area to the second cache pool.
[0111]
[0109] In an optional embodiment, when the processor 55 reads the first data object to be transferred in the first cache pool, it is specifically used to: read the first data object to be transferred from the first cache pool when a first data transfer condition is met; wherein the first data transfer condition includes at least one of the following: the CPU utilization of the computing node is greater than a set first utilization threshold, the amount of data in the first cache pool is greater than a set second data threshold, and a persistence operation is triggered based on the recovery of log space.
[0112]
[0110] In an optional embodiment, the processor 55 is further used to: when the CPU utilization of the computing node is less than a set second utilization threshold, or when a specific data object appears in the first cache pool, read the second data object to be transferred in the first cache pool; and write the second data object to the persistent storage medium of the storage node, wherein, when a specific data object appears in the first cache pool, the second data object includes the specific data object.
[0113]
[0111] In an optional embodiment, the processor 55 is further used to: read the third compressed data object to be transferred in the second cache pool, where the third compressed data object is any compressed data object; persistently store the third compressed data object in the persistent storage medium of the storage node, or, decompress the third compressed data object into a third data object and then persistently store it in the persistent storage medium of the storage node.
[0114]
[0112] In an optional embodiment, when the processor 55 reads the third compressed data object to be transferred in the second cache pool, it is specifically used to: read the third compressed data object to be transferred from the second cache pool when the second data transfer condition is met; wherein the second data transfer condition includes at least one of the following: the CPU utilization of the computing node is less than the set third utilization threshold, the amount of data in the second cache pool is greater than the set third data threshold, and the persistence operation is triggered based on the recovery of log space.
[0115]
[0113] In an optional embodiment, the processor 55 is further used to: receive a read request, the read request being used to request reading a fourth data object; when the fourth data object is stored in the second cache pool, query the mapping table to obtain the storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second cache pool; read the fourth compressed data object from the second cache pool based on the storage location and length information of the fourth compressed data object in the second cache pool; and decompress the fourth compressed data object to obtain and return the fourth data object.
[0116]
[0114] In an optional embodiment, the processor 55 is further configured to perform at least one of the following operations: performing a garbage collection operation on the second cache pool when a garbage collection trigger condition is met; pre-enabling / disabling the two-level cache pool function for the first database instance in response to a first configuration operation on the two-level cache pool function; and enabling / disabling the data compression function for the second database instance in response to a second configuration operation on the data compression function.
[0117]
[0115] In an optional embodiment, before compressing the first data object, the processor 55 is specifically used to: determine whether the database instance to which the first data object belongs has enabled the two-level cache pool function and the data compression function; if both are enabled, compress the first data object to obtain a first compressed data object.
[0118]
[0116] In an optional embodiment, the processor 55 is further used to: when the two-level cache pool function is not started, write the first data object into the persistent storage medium of the storage node; when the two-level cache pool function is enabled but the data compression function is not enabled, write the first data object into the second cache pool, and record the storage location and length information of the first data object in the second cache pool in the mapping table for reading the first data object.
[0119]
[0117] Furthermore, as shown in FIG5 , the electronic device further includes: a communication component 56, a display 57, a power supply component 58, an audio component 59, and other components. FIG5 only schematically illustrates some components, which does not mean that the electronic device only includes the components shown in FIG5 . In addition, the components within the dashed box in FIG5 are optional components, not mandatory components, and the specific components may depend on the product form of the working node. The working node of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IoT device, or as a server-side device such as a conventional server, a cloud server, or a server array. If the working node of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it may include the components within the dashed box in FIG5 ; if the working node of this embodiment is implemented as a server-side device such as a conventional server, a cloud server, or a server array, it may not include the components within the dashed box in FIG5 .
[0120]
[0118] An embodiment of the present disclosure also provides an electronic device. The implementation structure of the electronic device is the same as or similar to the implementation structure of the electronic device shown in FIG5 , and can be implemented with reference to the structure of the electronic device shown in FIG5 . The electronic device provided by this embodiment differs from the electronic device shown in FIG5 primarily in that the functions implemented by the processor executing the computer program stored in the memory are different. In the electronic device provided by this embodiment, the processor executes the computer program stored in the memory, and can be configured to: receive a read request for reading a fourth data object; if the fourth data object is stored in the second buffer pool, query a mapping table in the second buffer pool to obtain the storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second buffer pool; read the fourth compressed data object from the second buffer pool based on the storage location and length information of the fourth compressed data object in the second buffer pool; and decompress the fourth compressed data object to obtain and return the fourth data object.
[0121]
[0119] In an optional embodiment, the processor is further used to: when the database instance to which the fourth data object belongs has the two-level cache pool function enabled, identify whether the fourth data object is stored in the second cache pool; when the database instance to which the fourth data object belongs does not have the two-level cache pool function enabled, identify whether the fourth data object is stored in the first cache pool or the persistent storage medium of the storage node.
[0122]
[0120] In an optional embodiment, when the processor queries the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object corresponding to the fourth data object in the second cache pool, it is specifically used to: when the database instance to which the fourth data object belongs has the data compression function enabled, query the mapping table in the second cache pool to obtain the storage location and length information of the fourth compressed data object in the second cache pool.
[0123]
[0121] In an optional embodiment, the processor is further used to: when the database instance to which the fourth data object belongs does not have a data compression function enabled, query the mapping table in the second cache pool to obtain the storage location and length information of the fourth data object in the second cache pool; and read the fourth data object from the second cache pool and return it based on the storage location and length information of the fourth data object in the second cache pool.
[0124]
[0122] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0125]
[0123] Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement each step in the above method embodiment.
[0126]
[0124] Accordingly, an embodiment of the present disclosure further provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is enabled to implement the steps in the above method embodiment.
[0127]
[0125] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0128]
[0126] The communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0129]
[0127] The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0130]
[0128] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0131]
[0129] The audio component may be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal may be further stored in a memory or sent via a communication component. In some embodiments, the audio component further includes a speaker for outputting the audio signal.
[0132]
[0130] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
[0133] The present disclosure is described with reference to the flow chart and / or block diagram according to the method, equipment (system) and computer program product of the embodiment of the present disclosure.It should be understood that each flow process and / or square frame and the flow process and / or square frame in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of general-purpose computer, special-purpose computer, embedded processor or other programmable data processing equipment to produce a machine, so that the instruction executed by the processor of computer or other programmable data processing equipment produces the device for realizing the function specified in flow chart one flow process or multiple flow processes and / or block diagram one square frame or multiple square frames.
[0134]
[0132] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0135]
[0133] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0136]
[0134] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interface, network interface and memory.
[0137]
[0135] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory.
[0138] (flash RAM). Memory is an example of a computer-readable medium.
[0139]
[0136] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmitting media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0140]
[0137] It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, commodity, or device. In the absence of further limitations, an element defined by the phrase "comprising a . . . . " does not preclude the presence of other identical elements in the process, method, commodity, or device comprising the element.
[0141]
[0138] The above are merely embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure should be included within the scope of the claims of the present disclosure.
Claims
Claims 1. A data storage method, applied to a computing node in a cloud storage system, wherein the cloud storage system includes a first cache pool located in a memory of the computing node and a second cache pool located between the first cache pool and a persistent storage medium of a storage node in the cloud storage system. The method comprises: Reading a first data object to be transferred in the first buffer pool; compressing the first data object to obtain a first compressed data object; The first compressed data object is written into the second buffer pool, and the storage location and length information of the first compressed data object in the second buffer pool are recorded in a mapping table in the second buffer pool for reading the first compressed data object.
2. The method according to claim 1, wherein: The second cache pool is located in the memory of the computing node; or, the second cache pool is located in the persistent storage medium of the computing node; or, the second cache pool is located in the memory of a remote node, and the remote node is a node other than the computing node in the cloud storage system.
3. The method according to claim 1, wherein: Compressing the first data object to obtain a first compressed data object includes: providing the first data object to a hardware compression module, so that the hardware compression module compresses the first data object to obtain the first compressed data object; and receiving the first compressed data object output by the hardware compression module.
4. The method according to claim 1, wherein: Writing the first compressed data object into the second cache pool includes: temporarily storing the first compressed data object in a data cache area, and when the number of compressed data objects in the data cache area reaches a set first data threshold, writing the compressed data objects in the data cache area into the second cache pool in batches; wherein the data cache area is a partial area in the memory of the computing node.
5. The method according to claim 4, wherein: When the second cache pool is implemented in the memory of the computing node, the data cache area is implemented as a sliding window in the second cache pool to save batch write operations from the data cache area to the second cache pool.
6. The method according to any one of claims 1 to 5, further comprising: Reading a third compressed data object to be transferred from the second buffer pool, where the third compressed data object is any compressed data object; The third compressed data object is persistently stored in the persistent storage medium of the storage node, or the third compressed data object is decompressed into a third data object and then persistently stored in the persistent storage medium of the storage node.
7. The method according to any one of claims 1 to 5, further comprising: receiving a read request, where the read request is used to request reading a fourth data object; In the case where the fourth data object is stored in the second buffer pool, the mapping table is queried to obtain the storage location and length information of the fourth compressed data object corresponding to the fourth data object in the second buffer pool. information; reading the fourth compressed data object from the second cache pool according to the storage location and length information of the fourth compressed data object in the second cache; decompressing the fourth compressed data object to obtain the fourth data object and returning it.
8. The method according to any one of claims 1 to 5, further comprising performing at least one of the following operations: in response to a first configuration operation on a two-level cache pool function, pre-enabling / disabling the two-level cache pool function for a first database instance; and in response to a second configuration operation on a data compression function, enabling / disabling the data compression function for a second database instance.
9. The method according to claim 8, wherein: Before compressing the first data object, the method further includes: determining whether the database instance to which the first data object belongs has enabled the two-level cache pool function and the data compression function; if both functions are enabled, compressing the first data object to obtain a first compressed data object; if the two-level cache pool function is not enabled, writing the first data object to the persistent storage medium of the storage node; if the two-level cache pool function is enabled but the data compression function is not enabled, writing the first data object to the second cache pool, and recording the storage location and length information of the first data object in the second cache pool in the mapping table for reading the first data object.
10. A data reading method, applied to a computing node in a cloud storage system, the cloud storage system comprising a first cache pool located in a memory of the computing node and a second cache pool located between the first cache pool and a persistent storage medium of a storage node in the cloud storage system, the method comprising: receiving a read request, where the read request is used to request reading a fourth data object; In a case where the fourth data object is stored in the second cache pool, a mapping table in the second cache pool is queried to obtain storage location and length information of a fourth compressed data object corresponding to the fourth data object in the second cache pool; based on the storage location and length information of the fourth compressed data object in the second cache pool, the fourth compressed data object is read from the second cache pool; and the fourth compressed data object is decompressed to obtain and return the fourth data object.
11. The method according to claim 10, further comprising at least one of the following operations: identifying whether the fourth data object is stored in the second cache pool when the database instance to which the fourth data object belongs has a two-level cache pool function enabled; and identifying whether the fourth data object is stored in the first cache pool or a persistent storage medium of the storage node when the database instance to which the fourth data object belongs does not have the two-level cache pool function enabled.
12. A cloud storage system, comprising: Computing nodes and storage nodes, wherein the cloud storage system further includes a first cache pool located in the memory of the computing node, and a first cache pool located in the first cache pool and the storage node. a second cache pool between persistent storage media; the computing node is used to read a first data object to be transferred from the first cache pool; compress the first data object to obtain a first compressed data object; write the first compressed data object into the second cache pool, and record the storage location and length information of the first compressed data object in the second cache pool in a mapping table in the second cache pool for reading the first compressed data object.
13. An electronic device, comprising: A memory and a processor; wherein the memory is used to store a computer program, and the processor is coupled to the memory and is used to execute the computer program in the memory to implement the steps in the method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing a computer program / instruction, wherein: When the computer program is executed by a processor, the processor is enabled to implement the steps of the method according to any one of claims 1 to 11.
15. A computer program product comprising: A computer program / instruction, wherein, when the computer program / instruction is executed by a processor, the processor is enabled to implement the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Clustering multi-overall-situation buffer pool system, center node, computational node and management method
CN103530253A
Cloud storage framework for second level cache prefetching for small files and construction method thereof
CN106528451A
Systems and methods for efficient compressed cache line storage and handling
CN109815165A
Remote file data access performance optimization method based on efficient caching of client
CN110188080A
Data processing method and device
CN113297210A