Adaptive slice eviction method, controller and system for hierarchical memory

By using an adaptive slice eviction method, hierarchical indexes and slices are used to maintain tuple heat data. Slices are split and merged to optimize heat distribution, which solves the problem of inaccurate identification of hot and cold tuples in hierarchical memory systems and improves the access efficiency and utilization of fast memory.

CN122111886APending Publication Date: 2026-05-29HUAZHONG UNIV OF SCI & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAZHONG UNIV OF SCI & TECH
Filing Date
2026-04-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing slice-level eviction algorithms suffer from inaccurate identification of hot and cold tuples in hierarchical memory systems, resulting in low fast memory utilization, high overhead of hot metadata, and limited improvement in fast memory access efficiency.

Method used

An adaptive slice eviction method is adopted, which uses hierarchical indexes and slices to maintain tuple heat data, optimizes heat distribution by splitting and merging slices, and adjusts the threshold by simulated annealing algorithm to improve fast memory access efficiency.

Benefits of technology

It achieves the best trade-off between the accuracy of hot and cold tuple identification and the overhead of heat recording, improves the access efficiency and utilization of fast memory, and adapts to efficient access under different loads and configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111886A_ABST
    Figure CN122111886A_ABST
Patent Text Reader

Abstract

The application discloses a layered memory-oriented adaptive slice eviction method, a controller and a system, and belongs to the technical field of data storage, and comprises the following steps: maintaining tuple data by using a layered index; maintaining the hottest partial tuples by using an upper-layer tree residing in a fast memory, and maintaining the remaining tuples by using a lower-layer tree residing in the fast memory; maintaining the hotness metadata of the tuples by using a slice; splitting a slice S1 into two slices when the slice S1 is greater than SplitSize and the hotness dispersion degree of the tuples is greater than SplitDisp; merging a slice S2 and an adjacent slice S3 into one slice when the sum of the sizes of the slice S2 and the slice S3 is less than MergeSize and the hotness dispersion degrees of the tuples are less than MergeDisp; and selecting a slice in which the tuples are located in the fast memory and the hotness is the lowest, and migrating the corresponding tuples to a slow memory when the fast memory space is insufficient. The application can realize the best trade-off between cold and hot recognition accuracy and hotness recording overhead, and improve the FAR of the layered memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data storage technology, and more specifically, relates to an adaptive slice eviction method, controller, and system for hierarchical memory. Background Technology

[0002] Emerging byte-addressable memory technologies, such as memory-semantic SSDs, persistent memory, and compressible memory, offer lower costs per GB. Meanwhile, the recently developed CXL (Compute Express Link) technology enables latency down to the nanosecond level. Therefore, tiered memory systems consisting of fast DRAM and low-cost slower memory have become a reality, capable of meeting the ever-growing memory demands of database systems at a lower cost.

[0003] Traditional memory management schemes operate at the page level. However, real-world database workloads inevitably exhibit skewed access patterns, with a few frequently accessed records being accessed far more frequently than the remaining infrequently accessed records. Therefore, the Tuple Granularity Tiered BufferManager proposed in related research can effectively improve system performance. This is because tiered memory can be addressed at the byte level, allowing for tuple-level rather than page-level migration between the performance and capacity layers, effectively reducing bandwidth waste and read / write amplification. Furthermore, retaining only hot tuples rather than entire pages in the performance layer saves memory space and improves its utilization.

[0004] Since there is still a performance gap of more than 2 times between fast memory and slow memory, in tuple-level hierarchical buffer management, a tuple eviction algorithm is still needed to accurately identify hot and cold tuples, promptly evict cooled tuples to slow memory, free up space in fast memory to store new hot data, thereby effectively improving the access rate of fast memory and the performance of database operation.

[0005] Small tuples are ubiquitous in database management system (DBMS) workloads (for example, the average size of a tuple is only 73 bytes under a TPC-C workload). Therefore, hot / cold identification at the tuple level incurs significant memory overhead, as the hot metadata stored with each tuple in fast memory occupies space that could otherwise be used to store data, resulting in a 21.3% to 31.5% decrease in Fast Memory Access (FAR).

[0006] To address this issue, some researchers have proposed grouping tuples with consecutive keys into slices to distribute the memory overhead of hot metadata. When fast memory is insufficient, data eviction is performed at the slice level. However, existing slice-based eviction algorithms use rigid page-aligned slices, leading to excessively large differences in the popularity of tuples within a slice. This can result in lower-popularity tuples occupying fast memory because they are in the same slice as higher-popularity tuples, or higher-popularity tuples being evicted to slower memory along with lower-popularity tuples in the same slice, requiring them to be copied back to fast memory in subsequent accesses. Ultimately, this only improves FAR by 2.9% to 6.7%. Summary of the Invention

[0007] To address the shortcomings and improvement needs of existing technologies, this invention provides an adaptive slice eviction method, controller, and system for hierarchical memory. Its purpose is to achieve the optimal trade-off between cold and hot identification accuracy and heat recording overhead, thereby improving the fast memory utilization rate of hierarchical memory systems.

[0008] To achieve the above objectives, according to one aspect of the present invention, an adaptive slice eviction method for hierarchical memory is provided, comprising: A hierarchical index is used to maintain tuple data; the hierarchical index consists of an upper-level tree and a lower-level tree, both of which are B+ trees; the upper-level tree is used to maintain the most frequently accessed tuples and resides in fast memory; the lower-level tree is used to maintain the remaining tuples, and the top n levels reside in fast memory; n is a positive integer; Use slices to maintain the popularity metadata of tuples; each slice stores the popularity metadata including: slice popularity, number of tuples contained, minimum key of the contained tuples, and popularity dispersion of the contained tuples; when the size of slice S1 is greater than the threshold SplitSize and the popularity dispersion of the tuples contained in it is greater than the threshold SplitDisp, slice S1 is split into two slices; when the sum of the sizes of slice S2 and its adjacent slice S3 is less than the threshold MergeSize, and the popularity dispersion of the tuples in both slice S2 and slice S3 is less than the threshold MergeDisp, then slice S2 and slice S3 are merged into one slice. When accessing tuple data, the upper-level tree is accessed first. If the upper-level tree is not found, the lower-level tree is accessed. After the access is completed, the popularity metadata of the slice containing the accessed tuple is updated. When the storage space of fast memory is insufficient, select the slice with the lowest slice popularity that corresponds to the tuple in fast memory as the target slice, and migrate the tuple corresponding to the target slice to slow memory. Among them, 0 <MergeSize<SplitSize,0<MergeDisp<SplitDisp。

[0009] Furthermore, the adaptive slice eviction method for hierarchical memory provided by the present invention further includes: regularly monitoring the fast memory access efficiency of the hierarchical memory, and if it is less than the preset threshold th FAR , then execute the adaptive threshold adjustment strategy to adjust the threshold set <SplitSize, MergeSize, SplitDisp, MergeDisp>; The adaptive threshold adjustment strategy includes: Construct a request data set using the requests since the last execution of the adaptive threshold adjustment strategy; Use the request data set to evaluate the fast memory access efficiency corresponding to the threshold set <SplitSize, MergeSize, SplitDisp, MergeDisp>, and iteratively optimize the threshold set <SplitSize, MergeSize, SplitDisp, MergeDisp> according to the evaluation results until the fast memory access efficiency is maximized.

[0010] Furthermore, when iteratively optimizing the threshold set <SplitSize, MergeSize, SplitDisp, MergeDisp> according to the evaluation results, use the simulated annealing algorithm.

[0011] Furthermore, the slices are managed by a skip list, and each slice corresponds to a node of the skip list; the hot metadata stored in each skip list further includes: the node height and the pointer to the next node in the same layer.

[0012] Furthermore, for the tuple T1, the method for locating its corresponding slice includes: S1: Obtain the key Key of the tuple T1; S2: Use the head node of the skip list as the starting node, and use the top layer of the skip list as the current layer; S3: Starting from the starting node, search for the node curr that satisfies curr.start_key ≤ key < next.start_key along the current layer pointer; curr.start_key represents the minimum key of the tuple contained in the node curr, and next represents the next node pointed to by the top layer pointer of the node curr; S4: If there are other nodes between the node curr and the node next, then use the node curr as the starting node, use the next layer of the current layer as the new current layer, and go to S3; otherwise, go to S5; S5: Locate the slice corresponding to the current node curr as the node corresponding to the tuple T1.

[0013] Furthermore, the adaptive slice eviction method for hierarchical memory provided by the present invention further includes: when accessing a lower-level tree, if the target tuple being accessed is located in slow memory or a hard disk, the target tuple is copied to the upper-level tree according to a preset probability, and after the copy is completed, the target tuple in the slow memory or hard disk is marked as an invalid tuple.

[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, including a stored computer program that, when executed by a processor, implements the adaptive slice eviction method for hierarchical memory provided by the present invention.

[0015] According to another aspect of the present invention, a storage controller for a hierarchical memory system is provided, comprising: A computer-readable storage medium for storing computer programs; And a processor for reading a computer program stored in a computer-readable storage medium to implement the adaptive slice eviction method for hierarchical memory provided by the present invention.

[0016] According to another aspect of the present invention, a hierarchical memory system is provided, comprising: hierarchical memory and a storage controller for hierarchical memory systems provided by the present invention.

[0017] According to another aspect of the present invention, a storage system is provided, comprising: a hierarchical memory system and a hard disk provided by the present invention.

[0018] In summary, the above-described technical solutions conceived in this invention can achieve the following beneficial effects: (1) The present invention manages the heat of tuple data at the granularity of slices containing multiple consecutive tuples, which can effectively reduce the recording overhead. On this basis, the splitting and merging of slices is driven by threshold combination, thereby automatically keeping the length of each slice and the heat unevenness of the tuples within it (and the heat dispersion of the tuples) within a suitable range. This avoids low heat tuples being stored in fast memory along with high heat tuples in the same slice, or high heat tuples being driven to slow memory along with low heat tuples in the same slice, thereby effectively improving the efficiency of fast memory access.

[0019] (2) In a preferred embodiment of the present invention, the fast memory access efficiency of the hierarchical memory is monitored periodically, and when the fast memory access efficiency is low, the threshold set is evaluated using a request and optimized based on the evaluation results. This ensures high fast memory access efficiency under different loads and configurations. In a further preferred embodiment, the threshold set is optimized using a simulated annealing algorithm, which can quickly find the global optimum.

[0020] (3) In a preferred embodiment of the present invention, using skip lists to manage slices can efficiently index the tuple data corresponding to the slices. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the existing page-level and tuple-level database buffer managers.

[0022] Figure 2 This is a schematic diagram of an adaptive slice eviction method for hierarchical memory provided in an embodiment of the present invention.

[0023] Figure 3 This is a schematic diagram of a skip list-based slice management method provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0025] In this invention, the terms "first," "second," etc. (if present) in the invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0026] Tiered memory consists of DRAM and emerging byte-addressable memory devices (such as memory semantic SSDs and persistent memory). The CPU locally accesses DRAM, which acts as fast memory, and uses protocols like CXL or DDR-T to directly access remote, slower memory devices (such as CXL memory and PM) with latency in the hundreds of nanoseconds via load / store instructions. Because slower memory has a lower cost per GB, tiered memory can meet the growing memory demands of database systems at a lower cost.

[0027] Traditional hierarchical memory data management adopts Figure 1 The page-level database buffer manager shown on the left keeps frequently accessed pages in fast memory. When page accessibility decreases, less frequently accessed pages are evicted to slower memory when fast memory is insufficient. Since a single page may contain multiple tuples, real-world database workloads inevitably exhibit skewed access patterns, with a few frequently accessed records being accessed far more often than the remaining less frequently accessed records. Evicting these pages at the page level would lead to bandwidth waste and read / write amplification issues.

[0028] Database buffer managers that use tuples as their granularity, such as Figure 1 As shown on the right, since tiered memory can be addressed byte-by-byte, migrating between the performance tier (i.e., fast memory) and the capacity tier (i.e., slow memory) at the tuple level, rather than the page level, can effectively reduce bandwidth waste and read / write amplification. Furthermore, retaining only hot tuples instead of entire pages in the performance tier memory saves performance tier memory space and improves its utilization. However, hot / cold identification at the tuple level requires storing the hotness metadata for each tuple, which incurs significant memory overhead, causing a 21.3% to 31.5% decrease in Fast Memory Access (FAR).

[0029] Existing slice-based data eviction methods group tuples with consecutive keys into a slice to distribute the memory overhead of hot data metadata. However, existing slice-based eviction methods use rigid page-aligned slices, resulting in excessively large differences in hotness between tuples within a slice, only improving FAR by 2.9% to 6.7%. To address this issue, this invention provides an adaptive slice eviction method, controller, and system for hierarchical memory. This method manages data hotness at the slice level, containing multiple consecutive tuples, thereby reducing the overhead of hotness recording. Furthermore, it drives slice splitting and merging based on threshold combinations, automatically keeping the length of each slice and the hotness unevenness (and the degree of hotness dispersion) of its tuples within an appropriate range, thus further improving the efficiency of fast memory access.

[0030] The following is an example.

[0031] Example 1: An adaptive slice eviction method for hierarchical memory, such as Figure 2 As shown, it includes: The hierarchical index is used to maintain tuple data. The hierarchical index consists of a top tree and a bottom tree, both of which are B+ trees. The top tree is used to maintain the most frequently accessed tuples and resides in fast memory. The bottom tree is used to maintain the remaining tuples, with the top three levels residing in fast memory to speed up access. The remaining intermediate nodes and leaf nodes are stored in slow memory or on disk.

[0032] It is easy to understand that in this embodiment, the leaf nodes of the upper and lower trees are used to store tuple data, the intermediate nodes are used to store the index information of the tuple data, and the number of layers in the lower tree stored in fast memory can be flexibly adjusted.

[0033] When a tuple needs to be accessed, the memory address or offset on the hard disk of the page is first looked up using a hash table based on the page ID where the tuple is located.

[0034] Newly generated tuples are directly inserted into the upper-level tree of fast memory. When the system needs to search, update, or delete data, it first performs the corresponding operation in the upper-level tree of fast memory. If the data is not in fast memory, it searches, updates, or deletes in the lower-level tree of slow memory. If the data is still not in slow memory, the page is read from the hard drive into slow memory. When the tuple to be searched or updated is in slow memory or hard drive, it is copied to fast memory according to a certain probability (promotion rate), and the corresponding tuple in slow memory or hard drive is marked as invalid. Tuples currently stored in slow memory or hard drive are not necessarily accessed by subsequent requests. Compared to traditional data management methods, which directly copy data to fast memory when it is located in slow memory or hard drive based on the temporal locality of data access, this embodiment only copies data with a certain probability, avoiding storing low-frequency tuples in fast memory and further improving the efficiency of fast memory access. In practical applications, this probability can be set according to the access characteristics of the load or based on experience according to the load type.

[0035] like Figure 2 As shown, this embodiment also includes: maintaining tuple hotness metadata using slices; this embodiment uses slices to maintain the hotness metadata of multiple tuples simultaneously, which can effectively distribute memory overhead. To improve the indexing efficiency of slices, as a preferred implementation, slices are managed by skip lists in this embodiment, and each slice corresponds to a node in the skip list. Accordingly, in this embodiment, the hotness metadata stored in the slice includes: slice hotness, the number of tuples contained (size), the minimum key of the contained tuples (start_key), and the hotness dispersion of the contained tuples. In addition, it also includes some status flags, node height, lock, and a side-length array of pointers to the next node in the same level. This embodiment can be adapted to any existing eviction algorithm, and the method of determining slice hotness will also be adapted to the corresponding eviction algorithm. For example, for LRU, LRU2, Second-Chance, and Sieve, each slice also stores pointers to the elements before and after in the linked list; for Hyperbolic and WATT algorithms, each slice also stores access timestamps, etc.

[0036] This embodiment places data at the granularity of multiple consecutive tuple slices based on tuple popularity information, thus distributing memory overhead. High-popularity slices are retained in fast memory, while low-popularity slices are migrated to slow memory. When fast memory space is insufficient, a target slice with lower popularity is selected from fast memory based on a preset popularity identification method, and the target slice is migrated to slow memory to free up fast memory space.

[0037] In addition, the access times of each table (one table corresponds to multiple pages) are recorded in real time, and then the number of tuples that each table needs to be evicted from fast memory to slow memory is allocated with the reciprocal of the access times as the weight. When the slow memory space is insufficient, the LeanEvict page eviction algorithm is used to evict cold pages to the hard disk.

[0038] A skip list is a randomized data structure based on parallel ordered linked lists. By maintaining multiple levels of index layers, it achieves the lookup efficiency of an approximately balanced tree with relatively low complexity. The bottom layer of the skip list is an ordered linked list storing all data. Based on this, a part of the nodes are randomly selected to form a sparse index layer, and higher index layers are randomly formed in the same way, finally forming a multi-level index. When looking up, start from the top layer, quickly narrow down the range, and then start from the lower layers in turn to accurately locate the node to be searched.

[0039] When it is necessary to find the slice where a tuple is located, the key of the tuple is compared with the start_key of the nodes in the skip list. If the relationship between the key of the tuple and the start_key of a certain node curr and its next node next is curr.start_key <= key < next.start_key, it means that the tuple belongs to the slice corresponding to node curr. Figure 3 For example, when wanting to locate key 130 in the skiplist, first start searching along the top layer (the second layer) pointer from the head node and find that the key is between 30 and 156; then start searching along the pointer of the next layer (the first layer) from the node with start_key = 30 and find that the key is within the range of 121 and 156. Therefore, the node with start_key = 121 is located.

[0040] After finding the slice where a tuple is located, if the operation to be performed is deletion, only its size needs to be decremented; if it is lookup and update, only the popularity of the slice needs to be updated; if it is an insertion operation, in addition to updating the popularity of the slice, only its size needs to be incremented.

[0041] To avoid the fixed page alignment slices from restricting the improvement of fast memory access efficiency, this embodiment provides a slice splitting and merging strategy. Specifically, two heuristic parameter thresholds SplitSize and MergeSize (0 < MergeSize < SplitSize) are used to limit the size of the slices to avoid coarse-grained segmentation. In addition, two thresholds SplitDisp and MergeDisp (0 < MergeDisp < SplitDisp) are used to control the popularity uniformity of tuple data within the same slice.

[0042] When the size of a slice S1 is greater than the threshold SplitSize and the heat dispersion of the tuples contained therein is greater than the threshold SplitDisp, slice S1 is split into two slices. When the sum of the sizes of slice S2 and its adjacent slice S3 is less than the threshold MergeSize, and the heat dispersion of tuples in both slice S2 and slice S3 is less than the threshold MergeDisp, slice S2 and slice S3 are merged into one slice.

[0043] It is easy to understand that when splitting slices, the two slices obtained from the split should satisfy the condition that the heat dispersion within the same slice is less than the threshold SplitDisp. Furthermore, when splitting and merging slices, the skip list structure needs to be adjusted accordingly.

[0044] Tuple popularity can be identified using existing rule-based popularity identification schemes, while the dispersion of tuple popularity can be quantified by variance, mean difference, and coefficient of variation.

[0045] This embodiment drives the splitting and merging of slices based on threshold combinations, automatically keeping the length of each slice and the heat unevenness (and heat dispersion of tuples) within a suitable range. This can prevent low-heat tuples from being stored in fast memory along with high-heat tuples in the same slice, or high-heat tuples from being driven to slow memory along with low-heat tuples in the same slice, thereby effectively improving the efficiency of fast memory access.

[0046] As a preferred embodiment, this embodiment further includes: Regularly monitor the efficiency of fast memory access in the tiered memory system; if it falls below a preset threshold... FAR Then, an adaptive threshold adjustment strategy is executed to adjust the threshold set.<SplitSize、MergeSize、SplitDisp、MergeDisp> ; Adaptive threshold adjustment strategies include: Build a request dataset using requests since the last execution of the adaptive threshold adjustment strategy; Evaluate threshold sets using the requested dataset<SplitSize、MergeSize、SplitDisp、MergeDisp> The corresponding fast memory access efficiency, and the threshold set based on the evaluation results.<SplitSize、MergeSize、SplitDisp、MergeDisp> Perform iterative optimizations until the efficiency of fast memory access is maximized.

[0047] This embodiment periodically monitors the fast memory access efficiency of tiered memory and aims to maximize fast memory access efficiency when it is low. It utilizes a request evaluation threshold set and optimizes the threshold set based on the evaluation results, which can ensure high fast memory access efficiency under different loads and configurations.

[0048] As a preferred implementation, this embodiment adjusts the threshold set based on the evaluation results.<SplitSize、MergeSize、SplitDisp、MergeDisp> During iterative optimization, the simulated annealing (SA) algorithm is used to accurately and quickly solve the optimization problem. It should be noted that the simulated annealing algorithm is only a preferred implementation method and should not be construed as the sole limitation of the invention. Other optimization algorithms may also be used in other embodiments of the invention.

[0049] Overall, the adaptive slice eviction method for hierarchical memory databases proposed in this embodiment manages the heat data of tuple data at the slice level, and dynamically performs slice splitting and merging operations based on the slice size and the heat dispersion of tuples within the slice. Furthermore, it dynamically optimizes the corresponding thresholds for splitting and merging, achieving the best trade-off between the accuracy of hot and cold identification and the overhead of heat recording, and can effectively improve the fast memory utilization rate.

[0050] This embodiment can be combined with existing eviction algorithms. For example, this embodiment can be integrated with four eviction algorithms based on linked lists or queues: LRU, LRU2, Second-Chance, and Sieve. Specifically: In the LRU algorithm, updating the slice's popularity means promoting the slice to the head of the cache list. In the LRU2 algorithm, when updating the slice's popularity, if the slice is in the history queue, it is promoted from the history queue to the cache list; if the slice is in the cache list, it is promoted to the head of the cache list. In the Second-Chance and Sieve algorithms, updating the slice's popularity means setting the slice's access flag.

[0051] When executing `copyHotness(slicenext, slice)`, `slicenext` is positioned next to `slice` in the algorithm's linked list or queue. When executing `mergeHotness(slice, sliceenext)`, `slice` and `slicenext` are not necessarily adjacent in the algorithm's linked list or queue; they may even be in different linked lists or queues (e.g., LRU2, 2Q, ARC, etc.). The merged slice is located at the position of the slice with the larger original size. If the two slices are of equal size, the merged slice has a 50% chance of being located at either `slice` or `slicenext`. Here, `copyHotness(slicenext, slice)` represents the heat magnitude at the time of slice splitting, `mergeHotness(slice, sliceenext)` represents the heat merging at the time of slice merging, and `slice` and `slicenext` represent two different slices.

[0052] This embodiment also integrates with Hyperbolic and WATT, two eviction algorithms based on heat values, as detailed below: The timestamp is defined as the cumulative number of tuples evicted to slower memory. In the Hyperbolic algorithm, each slice contains two variables: an 8-byte `insert_time` and a 4-byte `access_count`, representing the time the slice was inserted and the cumulative number of accesses, respectively. In the WATT algorithm, the timestamp is 4 bytes in size and uses a lazy growth scheme, meaning the timestamp only increments after a certain number (e.g., 1000) of tuples have been evicted. Each slice contains a circular array `access_times` storing the most recently accessed timestamps, and a 1-byte array index `pos` indicating the position of the latest timestamp in the circular array. The length of the timestamp array can be arbitrarily set; using 4 timestamps minimizes the algorithm's memory overhead.

[0053] Using a separate sampling thread, when the fast memory space is insufficient, each node is scanned according to the order of the skip list nodes and the pointers of its lowest level. A portion of the slices is randomly sampled with a certain probability (e.g., 10%) and the lower priority slices are evicted.

[0054] When executing `copyHotness(slicenext, slice)`, all fields of the heat information in `slicenext` are copied from `slice`. When executing `mergeHotness(slice, slicenext)`, for the Hyperbolic algorithm, the `access_time` of the merged slice is the larger of the `access_time` values ​​of `slice` and `slicenext`, and `access_cnt` is the sum of the `access_cnt` values ​​of `slice` and `slicenext`. For the WATT algorithm, after sorting the valid timestamps in `slice` and `slicenext`, the most recent series of timestamps are stored in `access_times`, and `pos` is updated accordingly.

[0055] Example 2: A computer-readable storage medium includes a stored computer program that, when executed by a processor, implements the adaptive slice eviction method for hierarchical memory provided in Embodiment 1 above.

[0056] Example 3: A storage controller for a tiered memory system includes: A computer-readable storage medium for storing computer programs; And a processor for reading a computer program stored in a computer-readable storage medium to implement the adaptive slice eviction method for hierarchical memory provided in Embodiment 1 above.

[0057] Example 4: A hierarchical memory system includes: hierarchical memory and a storage controller for hierarchical memory systems provided in Embodiment 3 above.

[0058] Example 5: A storage system includes: the hierarchical memory system and the hard disk provided in Embodiment 4 above.

[0059] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An adaptive slice eviction method for hierarchical memory, characterized in that, include: Tuple data is maintained using a hierarchical index; the hierarchical index includes an upper-level tree and a lower-level tree, both of which are B+ trees; The upper-level tree is used to maintain the most frequently accessed tuples and resides in fast memory; the lower-level tree is used to maintain the remaining tuples, and the top n levels reside in fast memory; n is a positive integer. Use slicing to maintain the hot metadata of tuples; Each slice stores the following metadata: slice popularity, number of tuples contained, minimum key of the tuples contained, and popularity dispersion of the tuples contained. When the size of slice S1 is greater than the threshold SplitSize and the popularity dispersion of the tuples contained in it is greater than the threshold SplitDisp, slice S1 is split into two slices. When the sum of the sizes of slice S2 and its adjacent slice S3 is less than the threshold MergeSize, and the popularity dispersion of the tuples in both slice S2 and slice S3 is less than the threshold MergeDisp, slice S2 and slice S3 are merged into one slice. When accessing tuple data, the upper-level tree is accessed first. If the upper-level tree is not found, the lower-level tree is accessed. After the access is completed, the popularity metadata of the slice where the accessed tuple is located is updated. When the storage space of the fast memory is insufficient, the slice with the lowest slice popularity and corresponding tuple located in the fast memory is selected as the target slice, and the tuple corresponding to the target slice is migrated to the slow memory. Among them, 0 <MergeSize<SplitSize,0<MergeDisp<SplitDisp。 2. The adaptive slice eviction method for hierarchical memory as described in claim 1, characterized in that, Also includes: Regularly monitor the fast memory access efficiency of the hierarchical memory; if it is less than a preset threshold, [the efficiency will be assessed]. FAR Then, an adaptive threshold adjustment strategy is executed to adjust the threshold set.<SplitSize、MergeSize、SplitDisp、MergeDisp> ; The adaptive threshold adjustment strategy includes: Build a request dataset using requests since the last execution of the adaptive threshold adjustment strategy; Evaluate the threshold set using the requested dataset.<SplitSize、MergeSize、SplitDisp、MergeDisp> The corresponding fast memory access efficiency, and the threshold set based on the evaluation results.<SplitSize、MergeSize、SplitDisp、MergeDisp> Perform iterative optimizations until the efficiency of fast memory access is maximized.

3. The adaptive slice eviction method for hierarchical memory as described in claim 2, characterized in that, Based on the evaluation results, the threshold set<SplitSize、MergeSize、SplitDisp、MergeDisp> Simulated annealing algorithm is used for iterative optimization.

4. The adaptive slice eviction method for hierarchical memory as described in any one of claims 1 to 3, characterized in that, Slices are managed by skip lists, and each slice corresponds to a node in the skip list; Each skip list stores the following metadata related to popularity: node height and a pointer to the next node in the same layer.

5. The adaptive slice eviction method for hierarchical memory as described in claim 4, characterized in that, For tuple T1, the methods for locating its corresponding slice include: S1: Get the key of tuple T1; S2: Starting from the head node of the skip list, take the top layer of the skip list as the current layer; S3: Starting from the starting node, search for the node curr that satisfies curr.start_key ≤ key < next.start_key along the current layer pointer; curr.start_key represents the minimum key of the tuples contained in node curr, and next represents the next node pointed to by the top layer pointer of node curr; S4: If there are other nodes between node curr and node next, use node curr as the starting node, use the next layer of the current layer as the new current layer, and go to S3; otherwise, go to S5; S5: Locate the slice corresponding to the current node curr as the node corresponding to tuple T1.

6. The adaptive slice eviction method for hierarchical memory as described in any one of claims 1 to 3, characterized in that, It further includes: When accessing the lower layer tree, if the target tuple to be accessed is in slow memory or on the hard disk, copy the target tuple to the upper layer tree with a preset probability, and mark the target tuple in slow memory or on the hard disk as an invalid tuple after the copying is completed.

7. A computer-readable storage medium, characterized in that, It includes a stored computer program, which, when executed by a processor, implements the adaptive slice eviction method for hierarchical memory according to any one of claims 1 to 6.

8. A storage controller for a hierarchical memory system, characterized in that, It includes: A computer-readable storage medium for storing a computer program; And a processor for reading the computer program stored in the computer-readable storage medium and implementing the adaptive slice eviction method for hierarchical memory according to any one of claims 1 to 6.

9. A hierarchical memory system, characterized in that, It includes: A hierarchical memory and the storage controller for the hierarchical memory system according to claim 8.

10. A storage system, characterized in that, It includes: The hierarchical memory system according to claim 9 and a hard disk.